From 00842604483e4c2e622dfdb3a97440e07646158f Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Wed, 12 Apr 2017 21:47:49 -0700 Subject: deps: upgrade npm to 4.5.0 PR-URL: https://github.com/nodejs/node/pull/12480 Reviewed-By: Jeremiah Senkpiel --- deps/npm/.github/issue_template.md | 4 +- deps/npm/.mailmap | 1 + deps/npm/.travis.yml | 2 + deps/npm/AUTHORS | 9 + deps/npm/CHANGELOG.md | 419 + deps/npm/CONTRIBUTING.md | 94 +- deps/npm/README.md | 4 +- deps/npm/TROUBLESHOOTING.md | 192 + deps/npm/bin/npm-cli.js | 15 +- deps/npm/doc/cli/npm-adduser.md | 11 +- deps/npm/doc/cli/npm-unpublish.md | 5 + deps/npm/doc/misc/npm-config.md | 24 +- deps/npm/html/doc/README.html | 4 +- deps/npm/html/doc/cli/npm-access.html | 2 +- deps/npm/html/doc/cli/npm-adduser.html | 12 +- deps/npm/html/doc/cli/npm-bin.html | 2 +- deps/npm/html/doc/cli/npm-bugs.html | 2 +- deps/npm/html/doc/cli/npm-build.html | 2 +- deps/npm/html/doc/cli/npm-bundle.html | 2 +- deps/npm/html/doc/cli/npm-cache.html | 2 +- deps/npm/html/doc/cli/npm-completion.html | 2 +- deps/npm/html/doc/cli/npm-config.html | 2 +- deps/npm/html/doc/cli/npm-dedupe.html | 2 +- deps/npm/html/doc/cli/npm-deprecate.html | 2 +- deps/npm/html/doc/cli/npm-dist-tag.html | 2 +- deps/npm/html/doc/cli/npm-docs.html | 2 +- deps/npm/html/doc/cli/npm-doctor.html | 2 +- deps/npm/html/doc/cli/npm-edit.html | 2 +- deps/npm/html/doc/cli/npm-explore.html | 2 +- deps/npm/html/doc/cli/npm-help-search.html | 2 +- deps/npm/html/doc/cli/npm-help.html | 2 +- deps/npm/html/doc/cli/npm-init.html | 2 +- deps/npm/html/doc/cli/npm-install-test.html | 2 +- deps/npm/html/doc/cli/npm-install.html | 2 +- deps/npm/html/doc/cli/npm-link.html | 2 +- deps/npm/html/doc/cli/npm-logout.html | 2 +- deps/npm/html/doc/cli/npm-ls.html | 4 +- deps/npm/html/doc/cli/npm-outdated.html | 2 +- deps/npm/html/doc/cli/npm-owner.html | 2 +- deps/npm/html/doc/cli/npm-pack.html | 2 +- deps/npm/html/doc/cli/npm-ping.html | 2 +- deps/npm/html/doc/cli/npm-prefix.html | 2 +- deps/npm/html/doc/cli/npm-prune.html | 2 +- deps/npm/html/doc/cli/npm-publish.html | 2 +- deps/npm/html/doc/cli/npm-rebuild.html | 2 +- deps/npm/html/doc/cli/npm-repo.html | 2 +- deps/npm/html/doc/cli/npm-restart.html | 2 +- deps/npm/html/doc/cli/npm-root.html | 2 +- deps/npm/html/doc/cli/npm-run-script.html | 2 +- deps/npm/html/doc/cli/npm-search.html | 2 +- deps/npm/html/doc/cli/npm-shrinkwrap.html | 2 +- deps/npm/html/doc/cli/npm-star.html | 2 +- deps/npm/html/doc/cli/npm-stars.html | 2 +- deps/npm/html/doc/cli/npm-start.html | 2 +- deps/npm/html/doc/cli/npm-stop.html | 2 +- deps/npm/html/doc/cli/npm-team.html | 2 +- deps/npm/html/doc/cli/npm-test.html | 2 +- deps/npm/html/doc/cli/npm-uninstall.html | 2 +- deps/npm/html/doc/cli/npm-unpublish.html | 6 +- deps/npm/html/doc/cli/npm-update.html | 2 +- deps/npm/html/doc/cli/npm-version.html | 2 +- deps/npm/html/doc/cli/npm-view.html | 2 +- deps/npm/html/doc/cli/npm-whoami.html | 2 +- deps/npm/html/doc/cli/npm.html | 6 +- deps/npm/html/doc/files/npm-folders.html | 2 +- deps/npm/html/doc/files/npm-global.html | 2 +- deps/npm/html/doc/files/npm-json.html | 2 +- deps/npm/html/doc/files/npmrc.html | 2 +- deps/npm/html/doc/files/package.json.html | 2 +- deps/npm/html/doc/index.html | 2 +- deps/npm/html/doc/misc/npm-coding-style.html | 2 +- deps/npm/html/doc/misc/npm-config.html | 23 +- deps/npm/html/doc/misc/npm-developers.html | 2 +- deps/npm/html/doc/misc/npm-disputes.html | 12 +- deps/npm/html/doc/misc/npm-index.html | 2 +- deps/npm/html/doc/misc/npm-orgs.html | 2 +- deps/npm/html/doc/misc/npm-registry.html | 2 +- deps/npm/html/doc/misc/npm-scope.html | 2 +- deps/npm/html/doc/misc/npm-scripts.html | 2 +- deps/npm/html/doc/misc/removing-npm.html | 2 +- deps/npm/html/doc/misc/semver.html | 2 +- deps/npm/lib/adduser.js | 159 +- deps/npm/lib/auth/legacy.js | 142 + deps/npm/lib/auth/oauth.js | 7 + deps/npm/lib/auth/saml.js | 7 + deps/npm/lib/auth/sso.js | 59 + deps/npm/lib/bugs.js | 2 +- deps/npm/lib/config/core.js | 2 +- deps/npm/lib/config/defaults.js | 12 +- deps/npm/lib/docs.js | 2 +- deps/npm/lib/doctor/check-files-permission.js | 2 +- deps/npm/lib/doctor/get-latest-npm-version.js | 2 +- deps/npm/lib/fetch-package-metadata.js | 28 +- deps/npm/lib/install.js | 2 +- deps/npm/lib/install/action/extract.js | 75 +- deps/npm/lib/install/action/finalize.js | 24 +- deps/npm/lib/install/action/move.js | 12 +- deps/npm/lib/install/action/remove.js | 10 +- deps/npm/lib/install/action/test.js | 8 - deps/npm/lib/install/actions.js | 7 +- deps/npm/lib/install/deps.js | 4 +- deps/npm/lib/install/inflate-bundled.js | 8 +- deps/npm/lib/install/inflate-shrinkwrap.js | 2 +- deps/npm/lib/install/validate-tree.js | 20 +- deps/npm/lib/ls.js | 121 +- deps/npm/lib/npm.js | 35 +- deps/npm/lib/outdated.js | 2 +- deps/npm/lib/repo.js | 2 +- deps/npm/lib/search/format-package-stream.js | 2 +- deps/npm/lib/utils/completion.sh | 5 +- deps/npm/lib/utils/error-handler.js | 71 +- deps/npm/lib/utils/error-message.js | 9 - deps/npm/lib/utils/lifecycle.js | 10 + deps/npm/lib/utils/move.js | 19 + deps/npm/lib/utils/rename.js | 21 +- deps/npm/lib/utils/tar.js | 4 +- deps/npm/man/man1/npm-README.1 | 4 +- deps/npm/man/man1/npm-access.1 | 2 +- deps/npm/man/man1/npm-adduser.1 | 16 +- deps/npm/man/man1/npm-bin.1 | 2 +- deps/npm/man/man1/npm-bugs.1 | 2 +- deps/npm/man/man1/npm-build.1 | 2 +- deps/npm/man/man1/npm-bundle.1 | 2 +- deps/npm/man/man1/npm-cache.1 | 2 +- deps/npm/man/man1/npm-completion.1 | 2 +- deps/npm/man/man1/npm-config.1 | 2 +- deps/npm/man/man1/npm-dedupe.1 | 2 +- deps/npm/man/man1/npm-deprecate.1 | 2 +- deps/npm/man/man1/npm-dist-tag.1 | 2 +- deps/npm/man/man1/npm-docs.1 | 2 +- deps/npm/man/man1/npm-doctor.1 | 2 +- deps/npm/man/man1/npm-edit.1 | 2 +- deps/npm/man/man1/npm-explore.1 | 2 +- deps/npm/man/man1/npm-help-search.1 | 2 +- deps/npm/man/man1/npm-help.1 | 2 +- deps/npm/man/man1/npm-init.1 | 2 +- deps/npm/man/man1/npm-install-test.1 | 2 +- deps/npm/man/man1/npm-install.1 | 2 +- deps/npm/man/man1/npm-link.1 | 2 +- deps/npm/man/man1/npm-logout.1 | 2 +- deps/npm/man/man1/npm-ls.1 | 4 +- deps/npm/man/man1/npm-outdated.1 | 2 +- deps/npm/man/man1/npm-owner.1 | 2 +- deps/npm/man/man1/npm-pack.1 | 2 +- deps/npm/man/man1/npm-ping.1 | 2 +- deps/npm/man/man1/npm-prefix.1 | 2 +- deps/npm/man/man1/npm-prune.1 | 2 +- deps/npm/man/man1/npm-publish.1 | 2 +- deps/npm/man/man1/npm-rebuild.1 | 2 +- deps/npm/man/man1/npm-repo.1 | 2 +- deps/npm/man/man1/npm-restart.1 | 2 +- deps/npm/man/man1/npm-root.1 | 2 +- deps/npm/man/man1/npm-run-script.1 | 2 +- deps/npm/man/man1/npm-search.1 | 2 +- deps/npm/man/man1/npm-shrinkwrap.1 | 2 +- deps/npm/man/man1/npm-star.1 | 2 +- deps/npm/man/man1/npm-stars.1 | 2 +- deps/npm/man/man1/npm-start.1 | 2 +- deps/npm/man/man1/npm-stop.1 | 2 +- deps/npm/man/man1/npm-team.1 | 2 +- deps/npm/man/man1/npm-test.1 | 2 +- deps/npm/man/man1/npm-uninstall.1 | 2 +- deps/npm/man/man1/npm-unpublish.1 | 7 +- deps/npm/man/man1/npm-update.1 | 2 +- deps/npm/man/man1/npm-version.1 | 2 +- deps/npm/man/man1/npm-view.1 | 2 +- deps/npm/man/man1/npm-whoami.1 | 2 +- deps/npm/man/man1/npm.1 | 4 +- deps/npm/man/man5/npm-folders.5 | 2 +- deps/npm/man/man5/npm-global.5 | 2 +- deps/npm/man/man5/npm-json.5 | 2 +- deps/npm/man/man5/npmrc.5 | 2 +- deps/npm/man/man5/package.json.5 | 2 +- deps/npm/man/man7/npm-coding-style.7 | 2 +- deps/npm/man/man7/npm-config.7 | 35 +- deps/npm/man/man7/npm-developers.7 | 2 +- deps/npm/man/man7/npm-disputes.7 | 2 +- deps/npm/man/man7/npm-index.7 | 2 +- deps/npm/man/man7/npm-orgs.7 | 2 +- deps/npm/man/man7/npm-registry.7 | 2 +- deps/npm/man/man7/npm-scope.7 | 2 +- deps/npm/man/man7/npm-scripts.7 | 2 +- deps/npm/man/man7/removing-npm.7 | 2 +- deps/npm/man/man7/semver.7 | 2 +- deps/npm/node_modules/JSONStream/.travis.yml | 1 + deps/npm/node_modules/JSONStream/index.js | 12 +- .../JSONStream/node_modules/jsonparse/jsonparse.js | 89 +- .../JSONStream/node_modules/jsonparse/package.json | 23 +- .../node_modules/jsonparse/test/big-token.js | 24 + deps/npm/node_modules/JSONStream/package.json | 46 +- .../node_modules/JSONStream/test/header_footer.js | 1 + deps/npm/node_modules/abbrev/abbrev.js | 1 - deps/npm/node_modules/abbrev/package.json | 56 +- deps/npm/node_modules/aproba/README.md | 36 +- deps/npm/node_modules/aproba/index.js | 101 +- deps/npm/node_modules/aproba/package.json | 53 +- deps/npm/node_modules/bluebird/LICENSE | 21 + deps/npm/node_modules/bluebird/README.md | 50 + deps/npm/node_modules/bluebird/changelog.md | 1 + .../bluebird/js/browser/bluebird.core.js | 3777 +++++++++ .../bluebird/js/browser/bluebird.core.min.js | 31 + .../node_modules/bluebird/js/browser/bluebird.js | 5619 ++++++++++++++ .../bluebird/js/browser/bluebird.min.js | 31 + deps/npm/node_modules/bluebird/js/release/any.js | 21 + .../npm/node_modules/bluebird/js/release/assert.js | 55 + deps/npm/node_modules/bluebird/js/release/async.js | 161 + deps/npm/node_modules/bluebird/js/release/bind.js | 67 + .../node_modules/bluebird/js/release/bluebird.js | 11 + .../node_modules/bluebird/js/release/call_get.js | 123 + .../npm/node_modules/bluebird/js/release/cancel.js | 129 + .../bluebird/js/release/catch_filter.js | 42 + .../node_modules/bluebird/js/release/context.js | 69 + .../bluebird/js/release/debuggability.js | 916 +++ .../bluebird/js/release/direct_resolve.js | 46 + deps/npm/node_modules/bluebird/js/release/each.js | 29 + .../npm/node_modules/bluebird/js/release/errors.js | 116 + deps/npm/node_modules/bluebird/js/release/es5.js | 80 + .../npm/node_modules/bluebird/js/release/filter.js | 12 + .../node_modules/bluebird/js/release/finally.js | 146 + .../node_modules/bluebird/js/release/generators.js | 223 + deps/npm/node_modules/bluebird/js/release/join.js | 168 + deps/npm/node_modules/bluebird/js/release/map.js | 168 + .../npm/node_modules/bluebird/js/release/method.js | 55 + .../node_modules/bluebird/js/release/nodeback.js | 51 + .../node_modules/bluebird/js/release/nodeify.js | 58 + .../node_modules/bluebird/js/release/promise.js | 775 ++ .../bluebird/js/release/promise_array.js | 185 + .../node_modules/bluebird/js/release/promisify.js | 313 + deps/npm/node_modules/bluebird/js/release/props.js | 118 + deps/npm/node_modules/bluebird/js/release/queue.js | 73 + deps/npm/node_modules/bluebird/js/release/race.js | 49 + .../npm/node_modules/bluebird/js/release/reduce.js | 172 + .../node_modules/bluebird/js/release/schedule.js | 61 + .../npm/node_modules/bluebird/js/release/settle.js | 43 + deps/npm/node_modules/bluebird/js/release/some.js | 148 + .../bluebird/js/release/synchronous_inspection.js | 103 + .../node_modules/bluebird/js/release/thenables.js | 86 + .../npm/node_modules/bluebird/js/release/timers.js | 93 + deps/npm/node_modules/bluebird/js/release/using.js | 226 + deps/npm/node_modules/bluebird/js/release/util.js | 379 + deps/npm/node_modules/bluebird/package.json | 138 + deps/npm/node_modules/call-limit/README.md | 85 + deps/npm/node_modules/call-limit/call-limit.js | 86 + deps/npm/node_modules/call-limit/package.json | 90 + deps/npm/node_modules/fs-vacuum/README.md | 2 +- deps/npm/node_modules/fs-vacuum/package.json | 61 +- .../fs-vacuum/test/not-remove-home-directory.js | 46 + deps/npm/node_modules/fs-vacuum/vacuum.js | 5 + .../node_modules/fs-write-stream-atomic/index.js | 64 +- .../fs-write-stream-atomic/package.json | 62 +- .../fs-write-stream-atomic/test/rename-eperm.js | 154 + deps/npm/node_modules/fstream/lib/reader.js | 8 +- deps/npm/node_modules/fstream/lib/writer.js | 4 +- deps/npm/node_modules/fstream/package.json | 51 +- deps/npm/node_modules/hosted-git-info/.npmignore | 2 - deps/npm/node_modules/hosted-git-info/README.md | 61 +- .../node_modules/hosted-git-info/git-host-info.js | 16 +- deps/npm/node_modules/hosted-git-info/git-host.js | 84 +- deps/npm/node_modules/hosted-git-info/index.js | 56 +- deps/npm/node_modules/hosted-git-info/package.json | 87 +- .../init-package-json/default-input.js | 8 +- .../init-package-json/node_modules/glob/LICENSE | 15 - .../init-package-json/node_modules/glob/README.md | 359 - .../init-package-json/node_modules/glob/common.js | 226 - .../init-package-json/node_modules/glob/glob.js | 765 -- .../glob/node_modules/minimatch/LICENSE | 15 - .../glob/node_modules/minimatch/README.md | 209 - .../glob/node_modules/minimatch/minimatch.js | 923 --- .../node_modules/brace-expansion/README.md | 122 - .../node_modules/brace-expansion/index.js | 201 - .../node_modules/balanced-match/.npmignore | 5 - .../node_modules/balanced-match/LICENSE.md | 21 - .../node_modules/balanced-match/README.md | 91 - .../node_modules/balanced-match/index.js | 58 - .../node_modules/balanced-match/package.json | 111 - .../node_modules/concat-map/.travis.yml | 4 - .../node_modules/concat-map/LICENSE | 18 - .../node_modules/concat-map/README.markdown | 62 - .../node_modules/concat-map/example/map.js | 6 - .../node_modules/concat-map/index.js | 13 - .../node_modules/concat-map/package.json | 111 - .../node_modules/concat-map/test/map.js | 39 - .../node_modules/brace-expansion/package.json | 113 - .../glob/node_modules/minimatch/package.json | 99 - .../glob/node_modules/path-is-absolute/index.js | 20 - .../glob/node_modules/path-is-absolute/license | 21 - .../node_modules/path-is-absolute/package.json | 99 - .../glob/node_modules/path-is-absolute/readme.md | 51 - .../node_modules/glob/package.json | 98 - .../init-package-json/node_modules/glob/sync.js | 460 -- .../node_modules/init-package-json/package.json | 68 +- .../init-package-json/test/dependencies.js | 60 + deps/npm/node_modules/lazy-property/.npmignore | 16 + deps/npm/node_modules/lazy-property/LICENSE | 22 + deps/npm/node_modules/lazy-property/README.md | 44 + deps/npm/node_modules/lazy-property/component.json | 7 + .../npm/node_modules/lazy-property/lazyProperty.js | 19 + deps/npm/node_modules/lazy-property/package.json | 91 + deps/npm/node_modules/move-concurrently/LICENSE | 13 + deps/npm/node_modules/move-concurrently/README.md | 53 + deps/npm/node_modules/move-concurrently/move.js | 84 + .../node_modules/copy-concurrently/LICENSE | 13 + .../node_modules/copy-concurrently/README.md | 128 + .../node_modules/copy-concurrently/copy.js | 224 + .../node_modules/copy-concurrently/is-windows.js | 2 + .../node_modules/copy-concurrently/package.json | 106 + .../node_modules/run-queue/README.md | 86 + .../node_modules/run-queue/package.json | 97 + .../node_modules/run-queue/queue.js | 95 + .../node_modules/move-concurrently/package.json | 112 + deps/npm/node_modules/node-gyp/README.md | 2 +- deps/npm/node_modules/node-gyp/addon.gypi | 19 +- .../node-gyp/gyp/pylib/gyp/generator/msvs.py | 37 + deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs | 268 + deps/npm/node_modules/node-gyp/lib/build.js | 13 +- deps/npm/node_modules/node-gyp/lib/configure.js | 34 +- deps/npm/node_modules/node-gyp/lib/find-vs2017.js | 46 + deps/npm/node_modules/node-gyp/package.json | 74 +- .../node_modules/normalize-package-data/.npmignore | 2 +- .../node_modules/normalize-package-data/AUTHORS | 2 +- .../node_modules/normalize-package-data/LICENSE | 2 +- .../node_modules/normalize-package-data/README.md | 13 +- .../normalize-package-data/lib/make_warning.js | 2 +- .../normalize-package-data/lib/normalize.js | 6 +- .../normalize-package-data/lib/safe_format.js | 2 +- .../normalize-package-data/lib/typos.json | 2 +- .../normalize-package-data/package.json | 118 +- .../normalize-package-data/test/consistency.js | 4 +- .../normalize-package-data/test/dependencies.js | 4 +- .../test/fixtures/async.json | 2 +- .../test/fixtures/bcrypt.json | 2 +- .../test/fixtures/coffee-script.json | 2 +- .../test/fixtures/http-server.json | 8 +- .../test/fixtures/movefile.json | 2 +- .../test/fixtures/no-description.json | 2 +- .../test/fixtures/node-module_exist.json | 2 +- .../normalize-package-data/test/fixtures/npm.json | 2 +- .../test/fixtures/request.json | 2 +- .../test/fixtures/underscore.json | 2 +- .../normalize-package-data/test/normalize.js | 6 - .../normalize-package-data/test/typo.js | 2 +- deps/npm/node_modules/npm-package-arg/.npmignore | 1 - deps/npm/node_modules/npm-package-arg/.travis.yml | 10 - deps/npm/node_modules/npm-package-arg/package.json | 56 +- .../npm/node_modules/npm-package-arg/test/basic.js | 187 - .../node_modules/npm-package-arg/test/bitbucket.js | 81 - .../node_modules/npm-package-arg/test/github.js | 104 - .../node_modules/npm-package-arg/test/gitlab.js | 79 - .../node_modules/npm-package-arg/test/windows.js | 79 - .../node_modules/npm-registry-client/.npmignore | 5 - .../node_modules/npm-registry-client/.travis.yml | 12 - .../npm/node_modules/npm-registry-client/README.md | 17 +- deps/npm/node_modules/npm-registry-client/index.js | 56 +- .../node_modules/npm-registry-client/lib/access.js | 1 + .../npm-registry-client/lib/adduser.js | 4 +- .../node_modules/npm-registry-client/lib/ping.js | 8 +- .../npm-registry-client/lib/request.js | 8 +- .../node_modules/readable-stream/.npmignore | 5 - .../node_modules/readable-stream/.travis.yml | 52 - .../node_modules/readable-stream/.zuul.yml | 1 - .../node_modules/readable-stream/LICENSE | 18 - .../node_modules/readable-stream/README.md | 36 - .../readable-stream/doc/stream.markdown | 1760 ----- .../readable-stream/doc/wg-meetings/2015-01-30.md | 60 - .../node_modules/readable-stream/duplex.js | 1 - .../readable-stream/lib/_stream_duplex.js | 96 - .../readable-stream/lib/_stream_passthrough.js | 47 - .../readable-stream/lib/_stream_readable.js | 901 --- .../readable-stream/lib/_stream_transform.js | 201 - .../readable-stream/lib/_stream_writable.js | 537 -- .../node_modules/core-util-is/LICENSE | 19 - .../node_modules/core-util-is/README.md | 3 - .../node_modules/core-util-is/float.patch | 604 -- .../node_modules/core-util-is/lib/util.js | 128 - .../node_modules/core-util-is/package.json | 88 - .../node_modules/core-util-is/test.js | 68 - .../node_modules/isarray/.npmignore | 1 - .../node_modules/isarray/.travis.yml | 4 - .../readable-stream/node_modules/isarray/Makefile | 6 - .../readable-stream/node_modules/isarray/README.md | 60 - .../node_modules/isarray/component.json | 19 - .../readable-stream/node_modules/isarray/index.js | 5 - .../node_modules/isarray/package.json | 98 - .../readable-stream/node_modules/isarray/test.js | 20 - .../node_modules/process-nextick-args/.travis.yml | 12 - .../node_modules/process-nextick-args/index.js | 43 - .../node_modules/process-nextick-args/license.md | 19 - .../node_modules/process-nextick-args/package.json | 82 - .../node_modules/process-nextick-args/readme.md | 18 - .../node_modules/process-nextick-args/test.js | 24 - .../node_modules/string_decoder/.npmignore | 2 - .../node_modules/string_decoder/LICENSE | 20 - .../node_modules/string_decoder/README.md | 7 - .../node_modules/string_decoder/index.js | 242 - .../node_modules/string_decoder/package.json | 81 - .../node_modules/util-deprecate/History.md | 16 - .../node_modules/util-deprecate/LICENSE | 24 - .../node_modules/util-deprecate/README.md | 53 - .../node_modules/util-deprecate/browser.js | 67 - .../node_modules/util-deprecate/node.js | 6 - .../node_modules/util-deprecate/package.json | 83 - .../node_modules/readable-stream/package.json | 105 - .../node_modules/readable-stream/passthrough.js | 1 - .../node_modules/readable-stream/readable.js | 12 - .../node_modules/readable-stream/transform.js | 1 - .../node_modules/readable-stream/writable.js | 1 - .../node_modules/concat-stream/package.json | 34 +- .../node_modules/concat-stream/readme.md | 2 +- .../node_modules/npm-registry-client/package.json | 79 +- .../npm-registry-client/test/00-setup.js | 11 - .../npm-registry-client/test/access.js | 370 - .../npm-registry-client/test/adduser-new.js | 58 - .../npm-registry-client/test/adduser-update.js | 68 - .../npm-registry-client/test/adduser.js | 162 - .../npm-registry-client/test/config-defaults.js | 42 - .../npm-registry-client/test/config-override.js | 61 - .../npm-registry-client/test/deprecate.js | 216 - .../npm-registry-client/test/dist-tags-add.js | 142 - .../npm-registry-client/test/dist-tags-fetch.js | 99 - .../npm-registry-client/test/dist-tags-rm.js | 118 - .../npm-registry-client/test/dist-tags-set.js | 122 - .../npm-registry-client/test/dist-tags-update.js | 113 - .../npm-registry-client/test/econnreset.js | 95 - .../npm-registry-client/test/fetch-404.js | 35 - .../npm-registry-client/test/fetch-408.js | 54 - .../npm-registry-client/test/fetch-503.js | 54 - .../npm-registry-client/test/fetch-authed.js | 58 - .../npm-registry-client/test/fetch-basic.js | 93 - .../test/fetch-github-api-json.js | 68 - .../npm-registry-client/test/fetch-not-authed.js | 54 - .../npm-registry-client/test/fetch-streaming.js | 58 - .../npm-registry-client/test/get-403.js | 30 - .../npm-registry-client/test/get-basic.js | 85 - .../npm-registry-client/test/get-error-403.js | 34 - .../npm-registry-client/test/initialize.js | 125 - .../npm-registry-client/test/lib/common.js | 31 - .../npm-registry-client/test/lib/server.js | 59 - .../npm-registry-client/test/logout.js | 74 - .../node_modules/npm-registry-client/test/ping.js | 76 - .../test/publish-again-scoped.js | 91 - .../npm-registry-client/test/publish-again.js | 89 - .../test/publish-failed-no-message.js | 44 - .../test/publish-mixcase-name.js | 92 - .../test/publish-new-mixcase-name.js | 73 - .../test/publish-scoped-auth-token.js | 57 - .../npm-registry-client/test/publish-scoped.js | 64 - .../npm-registry-client/test/publish.js | 204 - .../npm-registry-client/test/redirects.js | 56 - .../test/request-gzip-content.js | 61 - .../npm-registry-client/test/request.js | 317 - .../npm-registry-client/test/retries.js | 52 - .../npm-registry-client/test/send-anon-metrics.js | 78 - .../node_modules/npm-registry-client/test/star.js | 176 - .../node_modules/npm-registry-client/test/stars.js | 81 - .../node_modules/npm-registry-client/test/tag.js | 108 - .../node_modules/npm-registry-client/test/team.js | 215 - .../npm-registry-client/test/unpublish-scoped.js | 68 - .../npm-registry-client/test/unpublish.js | 104 - .../npm-registry-client/test/whoami.js | 70 - .../npm-registry-client/test/zz-cleanup.js | 11 - .../node_modules/are-we-there-yet/package.json | 4 +- deps/npm/node_modules/opener/README.md | 57 + deps/npm/node_modules/opener/package.json | 38 +- .../node_modules/util-extend/extend.js | 21 - deps/npm/node_modules/read-package-json/README.md | 6 - .../read-package-json/node_modules/glob/LICENSE | 15 - .../read-package-json/node_modules/glob/README.md | 359 - .../read-package-json/node_modules/glob/common.js | 226 - .../read-package-json/node_modules/glob/glob.js | 765 -- .../glob/node_modules/minimatch/LICENSE | 15 - .../glob/node_modules/minimatch/README.md | 209 - .../glob/node_modules/minimatch/minimatch.js | 923 --- .../node_modules/brace-expansion/README.md | 122 - .../node_modules/brace-expansion/index.js | 201 - .../node_modules/balanced-match/.npmignore | 5 - .../node_modules/balanced-match/LICENSE.md | 21 - .../node_modules/balanced-match/README.md | 91 - .../node_modules/balanced-match/index.js | 58 - .../node_modules/balanced-match/package.json | 111 - .../node_modules/concat-map/.travis.yml | 4 - .../node_modules/concat-map/LICENSE | 18 - .../node_modules/concat-map/README.markdown | 62 - .../node_modules/concat-map/example/map.js | 6 - .../node_modules/concat-map/index.js | 13 - .../node_modules/concat-map/package.json | 111 - .../node_modules/concat-map/test/map.js | 39 - .../node_modules/brace-expansion/package.json | 113 - .../glob/node_modules/minimatch/package.json | 99 - .../glob/node_modules/path-is-absolute/index.js | 20 - .../glob/node_modules/path-is-absolute/license | 21 - .../node_modules/path-is-absolute/package.json | 99 - .../glob/node_modules/path-is-absolute/readme.md | 51 - .../node_modules/glob/package.json | 98 - .../read-package-json/node_modules/glob/sync.js | 460 -- .../node_modules/read-package-json/package.json | 89 +- .../node_modules/read-package-json/read-json.js | 4 +- .../read-package-json/test/fixtures/not-json.css | 4 +- deps/npm/node_modules/readable-stream/.travis.yml | 4 +- .../node_modules/readable-stream/CONTRIBUTING.md | 38 + .../npm/node_modules/readable-stream/GOVERNANCE.md | 136 + deps/npm/node_modules/readable-stream/LICENSE | 29 + deps/npm/node_modules/readable-stream/README.md | 23 +- .../readable-stream/lib/_stream_duplex.js | 21 - .../readable-stream/lib/_stream_passthrough.js | 21 - .../readable-stream/lib/_stream_readable.js | 23 +- .../readable-stream/lib/_stream_transform.js | 21 - .../readable-stream/lib/_stream_writable.js | 58 +- .../node_modules/core-util-is/lib/util.js | 21 - .../node_modules/string_decoder/index.js | 21 - deps/npm/node_modules/readable-stream/package.json | 76 +- deps/npm/node_modules/request/CHANGELOG.md | 34 +- deps/npm/node_modules/request/README.md | 55 +- deps/npm/node_modules/request/lib/helpers.js | 3 +- deps/npm/node_modules/request/lib/multipart.js | 3 +- deps/npm/node_modules/request/lib/oauth.js | 3 +- .../node_modules/request/node_modules/aws4/aws4.js | 21 +- .../request/node_modules/aws4/package.json | 24 +- .../request/node_modules/caseless/index.js | 1 + .../request/node_modules/caseless/package.json | 43 +- .../request/node_modules/caseless/test.js | 27 + .../request/node_modules/har-validator/README.md | 296 +- .../node_modules/har-validator/bin/har-validator | 56 - .../node_modules/har-validator/lib/async.js | 14 - .../har-validator/lib/browser/async.js | 96 + .../har-validator/lib/browser/error.js | 15 + .../har-validator/lib/browser/promise.js | 93 + .../node_modules/har-validator/lib/error.js | 10 - .../node_modules/har-validator/lib/index.js | 22 - .../node_modules/har-validator/lib/node4/async.js | 136 + .../node_modules/har-validator/lib/node4/error.js | 22 + .../har-validator/lib/node4/promise.js | 132 + .../node_modules/har-validator/lib/node6/async.js | 133 + .../node_modules/har-validator/lib/node6/error.js | 22 + .../har-validator/lib/node6/promise.js | 130 + .../node_modules/har-validator/lib/node7/async.js | 133 + .../node_modules/har-validator/lib/node7/error.js | 22 + .../har-validator/lib/node7/promise.js | 130 + .../node_modules/har-validator/lib/runner.js | 29 - .../har-validator/lib/schemas/cache.json | 13 - .../har-validator/lib/schemas/cacheEntry.json | 31 - .../har-validator/lib/schemas/content.json | 27 - .../har-validator/lib/schemas/cookie.json | 34 - .../har-validator/lib/schemas/creator.json | 18 - .../har-validator/lib/schemas/entry.json | 51 - .../har-validator/lib/schemas/har.json | 11 - .../har-validator/lib/schemas/index.js | 49 - .../har-validator/lib/schemas/log.json | 34 - .../har-validator/lib/schemas/page.json | 30 - .../har-validator/lib/schemas/pageTimings.json | 16 - .../har-validator/lib/schemas/postData.json | 41 - .../har-validator/lib/schemas/record.json | 18 - .../har-validator/lib/schemas/request.json | 55 - .../har-validator/lib/schemas/response.json | 52 - .../har-validator/lib/schemas/timings.json | 40 - .../node_modules/ajv/.tonic_example.js | 20 + .../har-validator/node_modules/ajv/LICENSE | 21 + .../har-validator/node_modules/ajv/README.md | 1207 +++ .../node_modules/ajv/dist/ajv.bundle.js | 8041 ++++++++++++++++++++ .../har-validator/node_modules/ajv/dist/ajv.min.js | 6 + .../node_modules/ajv/dist/ajv.min.js.map | 1 + .../node_modules/ajv/dist/nodent.min.js | 8 + .../node_modules/ajv/dist/regenerator.min.js | 36 + .../har-validator/node_modules/ajv/lib/ajv.d.ts | 282 + .../har-validator/node_modules/ajv/lib/ajv.js | 420 + .../har-validator/node_modules/ajv/lib/async.js | 218 + .../har-validator/node_modules/ajv/lib/cache.js | 26 + .../node_modules/ajv/lib/compile/_rules.js | 28 + .../node_modules/ajv/lib/compile/equal.js | 45 + .../node_modules/ajv/lib/compile/formats.js | 164 + .../node_modules/ajv/lib/compile/index.js | 390 + .../node_modules/ajv/lib/compile/resolve.js | 267 + .../node_modules/ajv/lib/compile/rules.js | 40 + .../node_modules/ajv/lib/compile/schema_obj.js | 9 + .../node_modules/ajv/lib/compile/ucs2length.js | 20 + .../node_modules/ajv/lib/compile/util.js | 257 + .../ajv/lib/compile/validation_error.js | 14 + .../node_modules/ajv/lib/dot/_limit.jst | 49 + .../node_modules/ajv/lib/dot/_limitItems.jst | 10 + .../node_modules/ajv/lib/dot/_limitLength.jst | 10 + .../node_modules/ajv/lib/dot/_limitProperties.jst | 10 + .../node_modules/ajv/lib/dot/allOf.jst | 34 + .../node_modules/ajv/lib/dot/anyOf.jst | 48 + .../node_modules/ajv/lib/dot/coerce.def | 61 + .../node_modules/ajv/lib/dot/custom.jst | 188 + .../node_modules/ajv/lib/dot/defaults.def | 32 + .../node_modules/ajv/lib/dot/definitions.def | 182 + .../node_modules/ajv/lib/dot/dependencies.jst | 69 + .../node_modules/ajv/lib/dot/enum.jst | 30 + .../node_modules/ajv/lib/dot/errors.def | 185 + .../node_modules/ajv/lib/dot/format.jst | 100 + .../node_modules/ajv/lib/dot/items.jst | 101 + .../node_modules/ajv/lib/dot/missing.def | 34 + .../node_modules/ajv/lib/dot/multipleOf.jst | 20 + .../har-validator/node_modules/ajv/lib/dot/not.jst | 43 + .../node_modules/ajv/lib/dot/oneOf.jst | 44 + .../node_modules/ajv/lib/dot/pattern.jst | 14 + .../node_modules/ajv/lib/dot/properties.jst | 319 + .../har-validator/node_modules/ajv/lib/dot/ref.jst | 86 + .../node_modules/ajv/lib/dot/required.jst | 96 + .../node_modules/ajv/lib/dot/uniqueItems.jst | 38 + .../node_modules/ajv/lib/dot/v5/_formatLimit.jst | 116 + .../node_modules/ajv/lib/dot/v5/constant.jst | 10 + .../ajv/lib/dot/v5/patternRequired.jst | 28 + .../node_modules/ajv/lib/dot/v5/switch.jst | 73 + .../node_modules/ajv/lib/dot/validate.jst | 210 + .../node_modules/ajv/lib/dotjs/README.md | 3 + .../node_modules/ajv/lib/dotjs/_formatLimit.js | 176 + .../node_modules/ajv/lib/dotjs/_limit.js | 124 + .../node_modules/ajv/lib/dotjs/_limitItems.js | 76 + .../node_modules/ajv/lib/dotjs/_limitLength.js | 81 + .../node_modules/ajv/lib/dotjs/_limitProperties.js | 76 + .../node_modules/ajv/lib/dotjs/allOf.js | 43 + .../node_modules/ajv/lib/dotjs/anyOf.js | 66 + .../node_modules/ajv/lib/dotjs/constant.js | 53 + .../node_modules/ajv/lib/dotjs/custom.js | 221 + .../node_modules/ajv/lib/dotjs/dependencies.js | 148 + .../node_modules/ajv/lib/dotjs/enum.js | 66 + .../node_modules/ajv/lib/dotjs/format.js | 139 + .../node_modules/ajv/lib/dotjs/items.js | 145 + .../node_modules/ajv/lib/dotjs/multipleOf.js | 77 + .../node_modules/ajv/lib/dotjs/not.js | 84 + .../node_modules/ajv/lib/dotjs/oneOf.js | 77 + .../node_modules/ajv/lib/dotjs/pattern.js | 75 + .../node_modules/ajv/lib/dotjs/patternRequired.js | 52 + .../node_modules/ajv/lib/dotjs/properties.js | 446 ++ .../node_modules/ajv/lib/dotjs/ref.js | 120 + .../node_modules/ajv/lib/dotjs/required.js | 250 + .../node_modules/ajv/lib/dotjs/switch.js | 129 + .../node_modules/ajv/lib/dotjs/uniqueItems.js | 72 + .../node_modules/ajv/lib/dotjs/validate.js | 376 + .../har-validator/node_modules/ajv/lib/keyword.js | 129 + .../ajv/lib/refs/json-schema-draft-04.json | 150 + .../node_modules/ajv/lib/refs/json-schema-v5.json | 328 + .../har-validator/node_modules/ajv/lib/v5.js | 52 + .../node_modules/ajv/node_modules/co/History.md | 172 + .../node_modules/ajv/node_modules/co/LICENSE | 22 + .../node_modules/ajv/node_modules/co/Readme.md | 212 + .../node_modules/ajv/node_modules/co/index.js | 237 + .../node_modules/ajv/node_modules/co/package.json | 106 + .../node_modules/json-stable-stringify/.npmignore | 1 + .../node_modules/json-stable-stringify/.travis.yml | 4 + .../ajv/node_modules/json-stable-stringify/LICENSE | 18 + .../json-stable-stringify/example/key_cmp.js | 7 + .../json-stable-stringify/example/nested.js | 3 + .../json-stable-stringify/example/str.js | 3 + .../json-stable-stringify/example/value_cmp.js | 7 + .../node_modules/json-stable-stringify/index.js | 84 + .../node_modules/jsonify/README.markdown | 34 + .../node_modules/jsonify/index.js | 2 + .../node_modules/jsonify/lib/parse.js | 273 + .../node_modules/jsonify/lib/stringify.js | 154 + .../node_modules/jsonify/package.json | 90 + .../node_modules/jsonify/test/parse.js | 16 + .../node_modules/jsonify/test/stringify.js | 15 + .../json-stable-stringify/package.json | 109 + .../json-stable-stringify/readme.markdown | 130 + .../node_modules/json-stable-stringify/test/cmp.js | 11 + .../json-stable-stringify/test/nested.js | 35 + .../json-stable-stringify/test/replacer.js | 74 + .../json-stable-stringify/test/space.js | 59 + .../node_modules/json-stable-stringify/test/str.js | 32 + .../json-stable-stringify/test/to-json.js | 20 + .../har-validator/node_modules/ajv/package.json | 166 + .../har-validator/node_modules/ajv/scripts/bundle | 33 + .../node_modules/ajv/scripts/compile-dots.js | 56 + .../har-validator/node_modules/ajv/scripts/info | 10 + .../node_modules/ajv/scripts/prepare-tests | 9 + .../node_modules/ajv/scripts/travis-gh-pages | 21 + .../har-validator/node_modules/chalk/index.js | 116 - .../har-validator/node_modules/chalk/license | 21 - .../chalk/node_modules/ansi-styles/index.js | 65 - .../chalk/node_modules/ansi-styles/license | 21 - .../chalk/node_modules/ansi-styles/package.json | 115 - .../chalk/node_modules/ansi-styles/readme.md | 86 - .../node_modules/escape-string-regexp/index.js | 11 - .../node_modules/escape-string-regexp/license | 21 - .../node_modules/escape-string-regexp/package.json | 110 - .../node_modules/escape-string-regexp/readme.md | 27 - .../chalk/node_modules/has-ansi/index.js | 4 - .../chalk/node_modules/has-ansi/license | 21 - .../chalk/node_modules/has-ansi/package.json | 119 - .../chalk/node_modules/has-ansi/readme.md | 36 - .../chalk/node_modules/supports-color/index.js | 50 - .../chalk/node_modules/supports-color/license | 21 - .../chalk/node_modules/supports-color/package.json | 114 - .../chalk/node_modules/supports-color/readme.md | 36 - .../har-validator/node_modules/chalk/package.json | 143 - .../har-validator/node_modules/chalk/readme.md | 213 - .../node_modules/commander/History.md | 261 - .../har-validator/node_modules/commander/LICENSE | 22 - .../har-validator/node_modules/commander/Readme.md | 351 - .../har-validator/node_modules/commander/index.js | 1110 --- .../node_modules/graceful-readlink/.npmignore | 3 - .../node_modules/graceful-readlink/.travis.yml | 5 - .../node_modules/graceful-readlink/LICENSE | 22 - .../node_modules/graceful-readlink/README.md | 17 - .../node_modules/graceful-readlink/index.js | 12 - .../node_modules/graceful-readlink/package.json | 84 - .../node_modules/commander/package.json | 105 - .../har-validator/node_modules/har-schema/LICENSE | 13 + .../node_modules/har-schema/README.md | 49 + .../node_modules/har-schema/lib/afterRequest.json | 29 + .../node_modules/har-schema/lib/beforeRequest.json | 29 + .../node_modules/har-schema/lib/browser.json | 19 + .../node_modules/har-schema/lib/cache.json | 20 + .../node_modules/har-schema/lib/content.json | 28 + .../node_modules/har-schema/lib/cookie.json | 35 + .../node_modules/har-schema/lib/creator.json | 19 + .../node_modules/har-schema/lib/entry.json | 52 + .../node_modules/har-schema/lib/har.json | 12 + .../node_modules/har-schema/lib/header.json | 19 + .../node_modules/har-schema/lib/index.js | 22 + .../node_modules/har-schema/lib/log.json | 35 + .../node_modules/har-schema/lib/page.json | 31 + .../node_modules/har-schema/lib/pageTimings.json | 17 + .../node_modules/har-schema/lib/postData.json | 42 + .../node_modules/har-schema/lib/query.json | 19 + .../node_modules/har-schema/lib/request.json | 56 + .../node_modules/har-schema/lib/response.json | 53 + .../node_modules/har-schema/lib/timings.json | 41 + .../node_modules/har-schema/package.json | 122 + .../node_modules/is-my-json-valid/.npmignore | 2 - .../node_modules/is-my-json-valid/.travis.yml | 3 - .../node_modules/is-my-json-valid/LICENSE | 21 - .../node_modules/is-my-json-valid/README.md | 173 - .../node_modules/is-my-json-valid/example.js | 18 - .../node_modules/is-my-json-valid/formats.js | 14 - .../node_modules/is-my-json-valid/index.js | 594 -- .../node_modules/generate-function/.npmignore | 1 - .../node_modules/generate-function/.travis.yml | 3 - .../node_modules/generate-function/README.md | 72 - .../node_modules/generate-function/example.js | 27 - .../node_modules/generate-function/index.js | 61 - .../node_modules/generate-function/package.json | 88 - .../node_modules/generate-function/test.js | 33 - .../generate-object-property/.npmignore | 1 - .../generate-object-property/.travis.yml | 3 - .../node_modules/generate-object-property/LICENSE | 21 - .../generate-object-property/README.md | 19 - .../node_modules/generate-object-property/index.js | 12 - .../node_modules/is-property/.npmignore | 17 - .../node_modules/is-property/LICENSE | 22 - .../node_modules/is-property/README.md | 28 - .../node_modules/is-property/is-property.js | 5 - .../node_modules/is-property/package.json | 93 - .../generate-object-property/package.json | 85 - .../node_modules/generate-object-property/test.js | 12 - .../node_modules/jsonpointer/.travis.yml | 7 - .../node_modules/jsonpointer/LICENSE.md | 21 - .../node_modules/jsonpointer/README.md | 39 - .../node_modules/jsonpointer/benchmark.js | 56 - .../node_modules/jsonpointer/jsonpointer.js | 93 - .../node_modules/jsonpointer/package.json | 109 - .../node_modules/jsonpointer/test.js | 131 - .../is-my-json-valid/node_modules/xtend/.npmignore | 1 - .../is-my-json-valid/node_modules/xtend/LICENCE | 19 - .../is-my-json-valid/node_modules/xtend/Makefile | 4 - .../is-my-json-valid/node_modules/xtend/README.md | 32 - .../node_modules/xtend/immutable.js | 19 - .../is-my-json-valid/node_modules/xtend/mutable.js | 17 - .../node_modules/xtend/package.json | 118 - .../is-my-json-valid/node_modules/xtend/test.js | 83 - .../node_modules/is-my-json-valid/package.json | 116 - .../node_modules/is-my-json-valid/require.js | 12 - .../is-my-json-valid/test/fixtures/cosmic.js | 84 - .../test/json-schema-draft4/additionalItems.json | 82 - .../json-schema-draft4/additionalProperties.json | 88 - .../test/json-schema-draft4/allOf.json | 112 - .../test/json-schema-draft4/anyOf.json | 68 - .../test/json-schema-draft4/bignum.json | 107 - .../test/json-schema-draft4/default.json | 49 - .../test/json-schema-draft4/definitions.json | 32 - .../test/json-schema-draft4/dependencies.json | 113 - .../test/json-schema-draft4/enum.json | 72 - .../test/json-schema-draft4/format.json | 143 - .../test/json-schema-draft4/items.json | 46 - .../test/json-schema-draft4/maxItems.json | 28 - .../test/json-schema-draft4/maxLength.json | 28 - .../test/json-schema-draft4/maxProperties.json | 28 - .../test/json-schema-draft4/maximum.json | 42 - .../test/json-schema-draft4/minItems.json | 28 - .../test/json-schema-draft4/minLength.json | 28 - .../test/json-schema-draft4/minProperties.json | 28 - .../test/json-schema-draft4/minimum.json | 42 - .../test/json-schema-draft4/multipleOf.json | 96 - .../test/json-schema-draft4/not.json | 96 - .../test/json-schema-draft4/nullAndFormat.json | 18 - .../test/json-schema-draft4/nullAndObject.json | 18 - .../test/json-schema-draft4/oneOf.json | 68 - .../test/json-schema-draft4/pattern.json | 23 - .../test/json-schema-draft4/patternProperties.json | 110 - .../test/json-schema-draft4/properties.json | 92 - .../test/json-schema-draft4/ref.json | 128 - .../test/json-schema-draft4/refRemote.json | 74 - .../test/json-schema-draft4/required.json | 39 - .../test/json-schema-draft4/type.json | 330 - .../test/json-schema-draft4/uniqueItems.json | 79 - .../is-my-json-valid/test/json-schema.js | 23 - .../node_modules/is-my-json-valid/test/misc.js | 471 -- .../node_modules/pinkie-promise/index.js | 3 - .../node_modules/pinkie-promise/license | 21 - .../pinkie-promise/node_modules/pinkie/index.js | 292 - .../pinkie-promise/node_modules/pinkie/license | 21 - .../node_modules/pinkie/package.json | 101 - .../pinkie-promise/node_modules/pinkie/readme.md | 83 - .../node_modules/pinkie-promise/package.json | 103 - .../node_modules/pinkie-promise/readme.md | 28 - .../node_modules/har-validator/package.json | 108 +- .../node_modules/har-validator/src/async.js | 96 + .../node_modules/har-validator/src/error.js | 15 + .../node_modules/har-validator/src/promise.js | 93 + .../http-signature/node_modules/sshpk/README.md | 27 +- .../node_modules/sshpk/lib/certificate.js | 90 +- .../node_modules/sshpk/lib/formats/x509.js | 223 +- .../node_modules/sshpk/lib/identity.js | 24 +- .../sshpk/node_modules/bcrypt-pbkdf/index.js | 5 +- .../sshpk/node_modules/bcrypt-pbkdf/package.json | 40 +- .../node_modules/sshpk/node_modules/jsbn/index.js | 17 +- .../sshpk/node_modules/jsbn/package.json | 31 +- .../sshpk/node_modules/tweetnacl/AUTHORS.md | 28 + .../sshpk/node_modules/tweetnacl/CHANGELOG.md | 40 + .../sshpk/node_modules/tweetnacl/COPYING.txt | 9 - .../sshpk/node_modules/tweetnacl/LICENSE | 24 + .../tweetnacl/PULL_REQUEST_TEMPLATE.md | 20 + .../sshpk/node_modules/tweetnacl/README.md | 52 +- .../sshpk/node_modules/tweetnacl/nacl-fast.min.js | 4 +- .../sshpk/node_modules/tweetnacl/nacl.d.ts | 98 + .../sshpk/node_modules/tweetnacl/nacl.min.js | 2 +- .../sshpk/node_modules/tweetnacl/package.json | 29 +- .../http-signature/node_modules/sshpk/package.json | 32 +- .../request/node_modules/mime-types/HISTORY.md | 6 + .../mime-types/node_modules/mime-db/HISTORY.md | 16 + .../mime-types/node_modules/mime-db/db.json | 43 +- .../mime-types/node_modules/mime-db/package.json | 45 +- .../request/node_modules/mime-types/package.json | 27 +- .../node_modules/performance-now/.npmignore | 1 + .../node_modules/performance-now/.tm_properties | 7 + .../node_modules/performance-now/.travis.yml | 4 + .../request/node_modules/performance-now/Makefile | 25 + .../request/node_modules/performance-now/README.md | 30 + .../performance-now/lib/performance-now.js | 32 + .../node_modules/performance-now/license.txt | 7 + .../node_modules/performance-now/package.json | 85 + .../performance-now/src/performance-now.coffee | 15 + .../node_modules/performance-now/test/mocha.opts | 3 + .../performance-now/test/performance-now.coffee | 38 + .../request/node_modules/qs/.jscs.json | 175 + .../request/node_modules/qs/CHANGELOG.md | 31 + .../request/node_modules/qs/CONTRIBUTING.md | 1 - .../node_modules/request/node_modules/qs/README.md | 46 +- .../request/node_modules/qs/dist/qs.js | 85 +- .../request/node_modules/qs/lib/index.js | 0 .../request/node_modules/qs/lib/parse.js | 27 +- .../request/node_modules/qs/lib/stringify.js | 52 +- .../request/node_modules/qs/lib/utils.js | 6 +- .../request/node_modules/qs/package.json | 54 +- .../request/node_modules/qs/test/parse.js | 72 +- .../request/node_modules/qs/test/stringify.js | 31 +- .../request/node_modules/qs/test/utils.js | 0 .../request/node_modules/safe-buffer/.travis.yml | 7 + .../request/node_modules/safe-buffer/LICENSE | 21 + .../request/node_modules/safe-buffer/README.md | 581 ++ .../request/node_modules/safe-buffer/browser.js | 1 + .../request/node_modules/safe-buffer/index.js | 58 + .../request/node_modules/safe-buffer/package.json | 104 + .../request/node_modules/safe-buffer/test.js | 99 + .../request/node_modules/tunnel-agent/index.js | 9 +- .../request/node_modules/tunnel-agent/package.json | 51 +- deps/npm/node_modules/request/package.json | 71 +- deps/npm/node_modules/request/request.js | 122 +- deps/npm/node_modules/rimraf/bin.js | 16 +- deps/npm/node_modules/rimraf/package.json | 54 +- deps/npm/node_modules/rimraf/rimraf.js | 24 +- deps/npm/node_modules/update-notifier/check.js | 22 + deps/npm/node_modules/update-notifier/index.js | 148 + .../update-notifier/node_modules/boxen/index.js | 139 + .../update-notifier/node_modules/boxen/license | 21 + .../boxen/node_modules/ansi-align/CHANGELOG.md | 21 + .../boxen/node_modules/ansi-align/LICENSE | 13 + .../boxen/node_modules/ansi-align/README.md | 79 + .../boxen/node_modules/ansi-align/index.js | 61 + .../ansi-align/node_modules/string-width/index.js | 37 + .../ansi-align/node_modules/string-width/license | 21 + .../node_modules/code-point-at/index.js | 32 + .../node_modules/code-point-at/license | 21 + .../node_modules/code-point-at/package.json | 106 + .../node_modules/code-point-at/readme.md | 32 + .../node_modules/is-fullwidth-code-point/index.js | 46 + .../node_modules/is-fullwidth-code-point/license | 21 + .../node_modules/number-is-nan/index.js | 4 + .../node_modules/number-is-nan/license | 21 + .../node_modules/number-is-nan/package.json | 103 + .../node_modules/number-is-nan/readme.md | 28 + .../is-fullwidth-code-point/package.json | 108 + .../node_modules/is-fullwidth-code-point/readme.md | 39 + .../node_modules/string-width/package.json | 123 + .../ansi-align/node_modules/string-width/readme.md | 42 + .../boxen/node_modules/ansi-align/package.json | 107 + .../boxen/node_modules/camelcase/index.js | 49 + .../boxen/node_modules/camelcase/license | 21 + .../boxen/node_modules/camelcase/package.json | 110 + .../boxen/node_modules/camelcase/readme.md | 57 + .../boxen/node_modules/cli-boxes/boxes.json | 50 + .../boxen/node_modules/cli-boxes/index.js | 2 + .../boxen/node_modules/cli-boxes/license | 21 + .../boxen/node_modules/cli-boxes/package.json | 107 + .../boxen/node_modules/cli-boxes/readme.md | 94 + .../boxen/node_modules/string-width/index.js | 35 + .../boxen/node_modules/string-width/license | 21 + .../node_modules/is-fullwidth-code-point/index.js | 46 + .../node_modules/is-fullwidth-code-point/license | 21 + .../is-fullwidth-code-point/package.json | 113 + .../node_modules/is-fullwidth-code-point/readme.md | 39 + .../boxen/node_modules/string-width/package.json | 125 + .../boxen/node_modules/string-width/readme.md | 42 + .../boxen/node_modules/term-size/index.js | 70 + .../boxen/node_modules/term-size/license | 21 + .../term-size/node_modules/execa/index.js | 172 + .../term-size/node_modules/execa/license | 21 + .../node_modules/cross-spawn-async/.editorconfig | 15 + .../node_modules/cross-spawn-async/.npmignore | 3 + .../node_modules/cross-spawn-async/.travis.yml | 7 + .../execa/node_modules/cross-spawn-async/LICENSE | 19 + .../execa/node_modules/cross-spawn-async/README.md | 58 + .../node_modules/cross-spawn-async/appveyor.yml | 30 + .../execa/node_modules/cross-spawn-async/index.js | 27 + .../node_modules/cross-spawn-async/lib/enoent.js | 51 + .../node_modules/cross-spawn-async/lib/parse.js | 128 + .../cross-spawn-async/lib/resolveCommand.js | 38 + .../node_modules/lru-cache/LICENSE | 15 + .../node_modules/lru-cache/README.md | 148 + .../node_modules/lru-cache/lib/lru-cache.js | 469 ++ .../lru-cache/node_modules/pseudomap/LICENSE | 15 + .../lru-cache/node_modules/pseudomap/README.md | 60 + .../lru-cache/node_modules/pseudomap/map.js | 9 + .../lru-cache/node_modules/pseudomap/package.json | 85 + .../lru-cache/node_modules/pseudomap/pseudomap.js | 113 + .../lru-cache/node_modules/pseudomap/test/basic.js | 86 + .../lru-cache/node_modules/yallist/.npmignore | 4 + .../lru-cache/node_modules/yallist/.travis.yml | 7 + .../lru-cache/node_modules/yallist/CONTRIBUTING.md | 4 + .../lru-cache/node_modules/yallist/LICENSE | 15 + .../lru-cache/node_modules/yallist/README.md | 204 + .../lru-cache/node_modules/yallist/package.json | 85 + .../lru-cache/node_modules/yallist/test/basic.js | 188 + .../lru-cache/node_modules/yallist/yallist.js | 360 + .../node_modules/lru-cache/package.json | 103 + .../node_modules/cross-spawn-async/package.json | 111 + .../execa/node_modules/is-stream/index.js | 21 + .../execa/node_modules/is-stream/license | 21 + .../execa/node_modules/is-stream/package.json | 106 + .../execa/node_modules/is-stream/readme.md | 42 + .../execa/node_modules/npm-run-path/index.js | 23 + .../execa/node_modules/npm-run-path/license | 21 + .../execa/node_modules/npm-run-path/package.json | 105 + .../execa/node_modules/npm-run-path/readme.md | 66 + .../execa/node_modules/object-assign/index.js | 90 + .../execa/node_modules/object-assign/license | 21 + .../execa/node_modules/object-assign/package.json | 118 + .../execa/node_modules/object-assign/readme.md | 61 + .../execa/node_modules/path-key/index.js | 15 + .../execa/node_modules/path-key/license | 21 + .../execa/node_modules/path-key/package.json | 101 + .../execa/node_modules/path-key/readme.md | 51 + .../execa/node_modules/strip-eof/index.js | 15 + .../execa/node_modules/strip-eof/license | 21 + .../execa/node_modules/strip-eof/package.json | 103 + .../execa/node_modules/strip-eof/readme.md | 28 + .../term-size/node_modules/execa/package.json | 124 + .../term-size/node_modules/execa/readme.md | 137 + .../boxen/node_modules/term-size/package.json | 115 + .../boxen/node_modules/term-size/readme.md | 41 + .../boxen/node_modules/term-size/vendor/resize | Bin 0 -> 67056 bytes .../term-size/vendor/win-term-size.exe | Bin 0 -> 17408 bytes .../boxen/node_modules/widest-line/index.js | 8 + .../boxen/node_modules/widest-line/license | 21 + .../widest-line/node_modules/string-width/index.js | 37 + .../widest-line/node_modules/string-width/license | 21 + .../node_modules/code-point-at/index.js | 32 + .../node_modules/code-point-at/license | 21 + .../node_modules/code-point-at/package.json | 118 + .../node_modules/code-point-at/readme.md | 32 + .../node_modules/is-fullwidth-code-point/index.js | 46 + .../node_modules/is-fullwidth-code-point/license | 21 + .../node_modules/number-is-nan/index.js | 4 + .../node_modules/number-is-nan/license | 21 + .../node_modules/number-is-nan/package.json | 115 + .../node_modules/number-is-nan/readme.md | 28 + .../is-fullwidth-code-point/package.json | 120 + .../node_modules/is-fullwidth-code-point/readme.md | 39 + .../node_modules/string-width/package.json | 123 + .../node_modules/string-width/readme.md | 42 + .../boxen/node_modules/widest-line/package.json | 119 + .../boxen/node_modules/widest-line/readme.md | 34 + .../node_modules/boxen/package.json | 119 + .../update-notifier/node_modules/boxen/readme.md | 175 + .../update-notifier/node_modules/chalk/index.js | 116 + .../update-notifier/node_modules/chalk/license | 21 + .../chalk/node_modules/ansi-styles/index.js | 65 + .../chalk/node_modules/ansi-styles/license | 21 + .../chalk/node_modules/ansi-styles/package.json | 114 + .../chalk/node_modules/ansi-styles/readme.md | 86 + .../node_modules/escape-string-regexp/index.js | 11 + .../node_modules/escape-string-regexp/license | 21 + .../node_modules/escape-string-regexp/package.json | 109 + .../node_modules/escape-string-regexp/readme.md | 27 + .../chalk/node_modules/has-ansi/index.js | 4 + .../chalk/node_modules/has-ansi/license | 21 + .../chalk/node_modules/has-ansi/package.json | 118 + .../chalk/node_modules/has-ansi/readme.md | 36 + .../chalk/node_modules/supports-color/index.js | 50 + .../chalk/node_modules/supports-color/license | 21 + .../chalk/node_modules/supports-color/package.json | 113 + .../chalk/node_modules/supports-color/readme.md | 36 + .../node_modules/chalk/package.json | 143 + .../update-notifier/node_modules/chalk/readme.md | 213 + .../node_modules/configstore/index.js | 98 + .../configstore/node_modules/dot-prop/index.js | 120 + .../configstore/node_modules/dot-prop/license | 21 + .../dot-prop/node_modules/is-obj/index.js | 5 + .../dot-prop/node_modules/is-obj/license | 21 + .../dot-prop/node_modules/is-obj/package.json | 101 + .../dot-prop/node_modules/is-obj/readme.md | 34 + .../configstore/node_modules/dot-prop/package.json | 115 + .../configstore/node_modules/dot-prop/readme.md | 97 + .../node_modules/unique-string/index.js | 4 + .../configstore/node_modules/unique-string/license | 21 + .../node_modules/crypto-random-string/index.js | 10 + .../node_modules/crypto-random-string/license | 21 + .../node_modules/crypto-random-string/package.json | 111 + .../node_modules/crypto-random-string/readme.md | 49 + .../node_modules/unique-string/package.json | 111 + .../node_modules/unique-string/readme.md | 32 + .../node_modules/configstore/package.json | 134 + .../node_modules/configstore/readme.md | 114 + .../update-notifier/node_modules/is-npm/index.js | 4 + .../node_modules/is-npm/package.json | 94 + .../update-notifier/node_modules/is-npm/readme.md | 30 + .../node_modules/latest-version/index.js | 4 + .../node_modules/latest-version/license | 21 + .../node_modules/package-json/index.js | 51 + .../node_modules/package-json/license | 21 + .../package-json/node_modules/got/index.js | 364 + .../package-json/node_modules/got/license | 21 + .../got/node_modules/create-error-class/index.js | 44 + .../got/node_modules/create-error-class/license | 21 + .../node_modules/capture-stack-trace/index.js | 18 + .../node_modules/capture-stack-trace/package.json | 91 + .../node_modules/capture-stack-trace/readme.md | 36 + .../node_modules/create-error-class/package.json | 95 + .../got/node_modules/create-error-class/readme.md | 54 + .../got/node_modules/duplexer3/LICENSE.md | 26 + .../got/node_modules/duplexer3/README.md | 115 + .../got/node_modules/duplexer3/index.js | 76 + .../got/node_modules/duplexer3/package.json | 96 + .../got/node_modules/get-stream/buffer-stream.js | 51 + .../got/node_modules/get-stream/index.js | 51 + .../got/node_modules/get-stream/license | 21 + .../got/node_modules/get-stream/package.json | 120 + .../got/node_modules/get-stream/readme.md | 117 + .../got/node_modules/is-redirect/index.js | 14 + .../got/node_modules/is-redirect/license | 21 + .../got/node_modules/is-redirect/package.json | 99 + .../got/node_modules/is-redirect/readme.md | 28 + .../got/node_modules/is-retry-allowed/index.js | 60 + .../got/node_modules/is-retry-allowed/license | 21 + .../got/node_modules/is-retry-allowed/package.json | 98 + .../got/node_modules/is-retry-allowed/readme.md | 42 + .../got/node_modules/is-stream/index.js | 21 + .../got/node_modules/is-stream/license | 21 + .../got/node_modules/is-stream/package.json | 118 + .../got/node_modules/is-stream/readme.md | 42 + .../got/node_modules/lowercase-keys/index.js | 11 + .../got/node_modules/lowercase-keys/package.json | 98 + .../got/node_modules/lowercase-keys/readme.md | 33 + .../got/node_modules/safe-buffer/.travis.yml | 7 + .../got/node_modules/safe-buffer/LICENSE | 21 + .../got/node_modules/safe-buffer/README.md | 581 ++ .../got/node_modules/safe-buffer/browser.js | 1 + .../got/node_modules/safe-buffer/index.js | 58 + .../got/node_modules/safe-buffer/package.json | 103 + .../got/node_modules/safe-buffer/test.js | 99 + .../got/node_modules/timed-out/index.js | 55 + .../got/node_modules/timed-out/license | 21 + .../got/node_modules/timed-out/package.json | 104 + .../got/node_modules/timed-out/readme.md | 42 + .../got/node_modules/unzip-response/index.js | 36 + .../got/node_modules/unzip-response/license | 21 + .../got/node_modules/unzip-response/package.json | 109 + .../got/node_modules/unzip-response/readme.md | 29 + .../got/node_modules/url-parse-lax/index.js | 14 + .../got/node_modules/url-parse-lax/license | 21 + .../node_modules/prepend-http/index.js | 14 + .../node_modules/prepend-http/license | 21 + .../node_modules/prepend-http/package.json | 103 + .../node_modules/prepend-http/readme.md | 31 + .../got/node_modules/url-parse-lax/package.json | 104 + .../got/node_modules/url-parse-lax/readme.md | 100 + .../package-json/node_modules/got/package.json | 141 + .../package-json/node_modules/got/readme.md | 335 + .../node_modules/registry-auth-token/.npmignore | 6 + .../node_modules/registry-auth-token/CHANGELOG.md | 57 + .../node_modules/registry-auth-token/LICENSE | 21 + .../node_modules/registry-auth-token/README.md | 57 + .../node_modules/registry-auth-token/base64.js | 20 + .../node_modules/registry-auth-token/index.js | 92 + .../registry-auth-token/node_modules/rc/.npmignore | 3 + .../node_modules/rc/LICENSE.APACHE2 | 15 + .../node_modules/rc/LICENSE.BSD | 26 + .../node_modules/rc/LICENSE.MIT | 24 + .../registry-auth-token/node_modules/rc/README.md | 149 + .../registry-auth-token/node_modules/rc/browser.js | 7 + .../registry-auth-token/node_modules/rc/index.js | 60 + .../node_modules/rc/lib/utils.js | 102 + .../rc/node_modules/deep-extend/CHANGELOG.md | 21 + .../rc/node_modules/deep-extend/LICENSE | 20 + .../rc/node_modules/deep-extend/README.md | 90 + .../rc/node_modules/deep-extend/index.js | 1 + .../rc/node_modules/deep-extend/lib/deep-extend.js | 144 + .../rc/node_modules/deep-extend/package.json | 120 + .../rc/node_modules/minimist/.travis.yml | 8 + .../node_modules/rc/node_modules/minimist/LICENSE | 18 + .../rc/node_modules/minimist/example/parse.js | 2 + .../node_modules/rc/node_modules/minimist/index.js | 235 + .../rc/node_modules/minimist/package.json | 105 + .../rc/node_modules/minimist/readme.markdown | 91 + .../rc/node_modules/minimist/test/all_bool.js | 32 + .../rc/node_modules/minimist/test/bool.js | 166 + .../rc/node_modules/minimist/test/dash.js | 31 + .../rc/node_modules/minimist/test/default_bool.js | 35 + .../rc/node_modules/minimist/test/dotted.js | 22 + .../rc/node_modules/minimist/test/kv_short.js | 16 + .../rc/node_modules/minimist/test/long.js | 31 + .../rc/node_modules/minimist/test/num.js | 36 + .../rc/node_modules/minimist/test/parse.js | 197 + .../node_modules/minimist/test/parse_modified.js | 9 + .../rc/node_modules/minimist/test/short.js | 67 + .../rc/node_modules/minimist/test/stop_early.js | 15 + .../rc/node_modules/minimist/test/unknown.js | 102 + .../rc/node_modules/minimist/test/whitespace.js | 8 + .../rc/node_modules/strip-json-comments/index.js | 70 + .../rc/node_modules/strip-json-comments/license | 21 + .../node_modules/strip-json-comments/package.json | 110 + .../rc/node_modules/strip-json-comments/readme.md | 64 + .../node_modules/rc/package.json | 100 + .../node_modules/rc/test/ini.js | 15 + .../node_modules/rc/test/nested-env-vars.js | 38 + .../node_modules/rc/test/test.js | 59 + .../node_modules/registry-auth-token/package.json | 110 + .../registry-auth-token/registry-url.js | 5 + .../registry-auth-token/test/auth-token.test.js | 325 + .../registry-auth-token/test/registry-url.test.js | 64 + .../node_modules/registry-url/index.js | 6 + .../package-json/node_modules/registry-url/license | 21 + .../registry-url/node_modules/rc/.npmignore | 3 + .../registry-url/node_modules/rc/LICENSE.APACHE2 | 15 + .../registry-url/node_modules/rc/LICENSE.BSD | 26 + .../registry-url/node_modules/rc/LICENSE.MIT | 24 + .../registry-url/node_modules/rc/README.md | 149 + .../registry-url/node_modules/rc/browser.js | 7 + .../registry-url/node_modules/rc/index.js | 60 + .../registry-url/node_modules/rc/lib/utils.js | 102 + .../rc/node_modules/deep-extend/CHANGELOG.md | 21 + .../rc/node_modules/deep-extend/LICENSE | 20 + .../rc/node_modules/deep-extend/README.md | 90 + .../rc/node_modules/deep-extend/index.js | 1 + .../rc/node_modules/deep-extend/lib/deep-extend.js | 144 + .../rc/node_modules/deep-extend/package.json | 132 + .../rc/node_modules/minimist/.travis.yml | 8 + .../node_modules/rc/node_modules/minimist/LICENSE | 18 + .../rc/node_modules/minimist/example/parse.js | 2 + .../node_modules/rc/node_modules/minimist/index.js | 235 + .../rc/node_modules/minimist/package.json | 117 + .../rc/node_modules/minimist/readme.markdown | 91 + .../rc/node_modules/minimist/test/all_bool.js | 32 + .../rc/node_modules/minimist/test/bool.js | 166 + .../rc/node_modules/minimist/test/dash.js | 31 + .../rc/node_modules/minimist/test/default_bool.js | 35 + .../rc/node_modules/minimist/test/dotted.js | 22 + .../rc/node_modules/minimist/test/kv_short.js | 16 + .../rc/node_modules/minimist/test/long.js | 31 + .../rc/node_modules/minimist/test/num.js | 36 + .../rc/node_modules/minimist/test/parse.js | 197 + .../node_modules/minimist/test/parse_modified.js | 9 + .../rc/node_modules/minimist/test/short.js | 67 + .../rc/node_modules/minimist/test/stop_early.js | 15 + .../rc/node_modules/minimist/test/unknown.js | 102 + .../rc/node_modules/minimist/test/whitespace.js | 8 + .../rc/node_modules/strip-json-comments/index.js | 70 + .../rc/node_modules/strip-json-comments/license | 21 + .../node_modules/strip-json-comments/package.json | 122 + .../rc/node_modules/strip-json-comments/readme.md | 64 + .../registry-url/node_modules/rc/package.json | 112 + .../registry-url/node_modules/rc/test/ini.js | 15 + .../node_modules/rc/test/nested-env-vars.js | 38 + .../registry-url/node_modules/rc/test/test.js | 59 + .../node_modules/registry-url/package.json | 109 + .../node_modules/registry-url/readme.md | 50 + .../node_modules/package-json/package.json | 116 + .../node_modules/package-json/readme.md | 62 + .../node_modules/latest-version/package.json | 109 + .../node_modules/latest-version/readme.md | 40 + .../update-notifier/node_modules/lazy-req/index.js | 53 + .../update-notifier/node_modules/lazy-req/license | 21 + .../node_modules/lazy-req/package.json | 111 + .../node_modules/lazy-req/readme.md | 64 + .../node_modules/semver-diff/index.js | 27 + .../node_modules/semver-diff/license | 21 + .../node_modules/semver-diff/package.json | 97 + .../node_modules/semver-diff/readme.md | 52 + .../node_modules/xdg-basedir/index.js | 28 + .../node_modules/xdg-basedir/license | 21 + .../node_modules/xdg-basedir/package.json | 109 + .../node_modules/xdg-basedir/readme.md | 60 + deps/npm/node_modules/update-notifier/package.json | 149 + deps/npm/node_modules/update-notifier/readme.md | 175 + .../validate-npm-package-name/.travis.yml | 6 + .../validate-npm-package-name/README.md | 5 +- .../validate-npm-package-name/index.js | 51 +- .../node_modules/builtins/License | 20 + .../node_modules/builtins/builtins.json | 6 +- .../node_modules/builtins/package.json | 91 +- .../node_modules/builtins/test.js | 5 + .../validate-npm-package-name/package.json | 126 +- .../validate-npm-package-name/test/index.js | 87 +- deps/npm/node_modules/which/CHANGELOG.md | 12 + .../which/node_modules/isexe/README.md | 14 +- .../which/node_modules/isexe/access.js | 15 - .../node_modules/which/node_modules/isexe/index.js | 2 - .../node_modules/which/node_modules/isexe/mode.js | 10 +- .../which/node_modules/isexe/package.json | 67 +- .../which/node_modules/isexe/test/basic.js | 10 + .../which/node_modules/isexe/windows.js | 14 +- deps/npm/node_modules/which/package.json | 61 +- deps/npm/package.json | 64 +- deps/npm/scripts/changelog.js | 2 +- deps/npm/scripts/dep-update | 2 +- .../npm/test/broken-under-nyc-and-travis/whoami.js | 2 +- deps/npm/test/common-tap.js | 6 +- deps/npm/test/tap/00-verify-no-scoped.js | 30 + deps/npm/test/tap/add-remote-git-submodule.js | 7 +- deps/npm/test/tap/adduser-oauth.js | 85 + deps/npm/test/tap/adduser-saml.js | 85 + deps/npm/test/tap/anon-cli-metrics.js | 2 +- deps/npm/test/tap/bundled-transitive-deps.js | 32 +- deps/npm/test/tap/config-meta.js | 6 +- deps/npm/test/tap/debug-logs.js | 2 +- deps/npm/test/tap/extraneous-dep-cycle-ls-ok.js | 3 +- deps/npm/test/tap/git-races.js | 15 +- .../npm/test/tap/install-duplicate-deps-warning.js | 69 + deps/npm/test/tap/lifecycle-signal.js | 58 +- deps/npm/test/tap/peer-deps-toplevel.js | 121 +- deps/npm/test/tap/search.js | 2 +- .../test/tap/unit-deps-childDependencySpecifier.js | 3 + deps/npm/test/tap/unit-deps-earliestInstallable.js | 3 + deps/npm/test/tap/unit-deps-removeObsoleteDep.js | 3 + 1256 files changed, 68049 insertions(+), 32235 deletions(-) create mode 100644 deps/npm/TROUBLESHOOTING.md create mode 100644 deps/npm/lib/auth/legacy.js create mode 100644 deps/npm/lib/auth/oauth.js create mode 100644 deps/npm/lib/auth/saml.js create mode 100644 deps/npm/lib/auth/sso.js delete mode 100644 deps/npm/lib/install/action/test.js create mode 100644 deps/npm/lib/utils/move.js create mode 100644 deps/npm/node_modules/JSONStream/node_modules/jsonparse/test/big-token.js create mode 100644 deps/npm/node_modules/bluebird/LICENSE create mode 100644 deps/npm/node_modules/bluebird/README.md create mode 100644 deps/npm/node_modules/bluebird/changelog.md create mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.core.js create mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.core.min.js create mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.js create mode 100644 deps/npm/node_modules/bluebird/js/browser/bluebird.min.js create mode 100644 deps/npm/node_modules/bluebird/js/release/any.js create mode 100644 deps/npm/node_modules/bluebird/js/release/assert.js create mode 100644 deps/npm/node_modules/bluebird/js/release/async.js create mode 100644 deps/npm/node_modules/bluebird/js/release/bind.js create mode 100644 deps/npm/node_modules/bluebird/js/release/bluebird.js create mode 100644 deps/npm/node_modules/bluebird/js/release/call_get.js create mode 100644 deps/npm/node_modules/bluebird/js/release/cancel.js create mode 100644 deps/npm/node_modules/bluebird/js/release/catch_filter.js create mode 100644 deps/npm/node_modules/bluebird/js/release/context.js create mode 100644 deps/npm/node_modules/bluebird/js/release/debuggability.js create mode 100644 deps/npm/node_modules/bluebird/js/release/direct_resolve.js create mode 100644 deps/npm/node_modules/bluebird/js/release/each.js create mode 100644 deps/npm/node_modules/bluebird/js/release/errors.js create mode 100644 deps/npm/node_modules/bluebird/js/release/es5.js create mode 100644 deps/npm/node_modules/bluebird/js/release/filter.js create mode 100644 deps/npm/node_modules/bluebird/js/release/finally.js create mode 100644 deps/npm/node_modules/bluebird/js/release/generators.js create mode 100644 deps/npm/node_modules/bluebird/js/release/join.js create mode 100644 deps/npm/node_modules/bluebird/js/release/map.js create mode 100644 deps/npm/node_modules/bluebird/js/release/method.js create mode 100644 deps/npm/node_modules/bluebird/js/release/nodeback.js create mode 100644 deps/npm/node_modules/bluebird/js/release/nodeify.js create mode 100644 deps/npm/node_modules/bluebird/js/release/promise.js create mode 100644 deps/npm/node_modules/bluebird/js/release/promise_array.js create mode 100644 deps/npm/node_modules/bluebird/js/release/promisify.js create mode 100644 deps/npm/node_modules/bluebird/js/release/props.js create mode 100644 deps/npm/node_modules/bluebird/js/release/queue.js create mode 100644 deps/npm/node_modules/bluebird/js/release/race.js create mode 100644 deps/npm/node_modules/bluebird/js/release/reduce.js create mode 100644 deps/npm/node_modules/bluebird/js/release/schedule.js create mode 100644 deps/npm/node_modules/bluebird/js/release/settle.js create mode 100644 deps/npm/node_modules/bluebird/js/release/some.js create mode 100644 deps/npm/node_modules/bluebird/js/release/synchronous_inspection.js create mode 100644 deps/npm/node_modules/bluebird/js/release/thenables.js create mode 100644 deps/npm/node_modules/bluebird/js/release/timers.js create mode 100644 deps/npm/node_modules/bluebird/js/release/using.js create mode 100644 deps/npm/node_modules/bluebird/js/release/util.js create mode 100644 deps/npm/node_modules/bluebird/package.json create mode 100644 deps/npm/node_modules/call-limit/README.md create mode 100644 deps/npm/node_modules/call-limit/call-limit.js create mode 100644 deps/npm/node_modules/call-limit/package.json create mode 100644 deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js create mode 100644 deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js delete mode 100644 deps/npm/node_modules/hosted-git-info/.npmignore delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/README.md delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/common.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/glob.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/LICENSE delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/package.json delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/sync.js create mode 100644 deps/npm/node_modules/init-package-json/test/dependencies.js create mode 100644 deps/npm/node_modules/lazy-property/.npmignore create mode 100644 deps/npm/node_modules/lazy-property/LICENSE create mode 100644 deps/npm/node_modules/lazy-property/README.md create mode 100644 deps/npm/node_modules/lazy-property/component.json create mode 100644 deps/npm/node_modules/lazy-property/lazyProperty.js create mode 100644 deps/npm/node_modules/lazy-property/package.json create mode 100644 deps/npm/node_modules/move-concurrently/LICENSE create mode 100644 deps/npm/node_modules/move-concurrently/README.md create mode 100644 deps/npm/node_modules/move-concurrently/move.js create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/LICENSE create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/README.md create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/copy.js create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/is-windows.js create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/package.json create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/run-queue/README.md create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/run-queue/package.json create mode 100644 deps/npm/node_modules/move-concurrently/node_modules/run-queue/queue.js create mode 100644 deps/npm/node_modules/move-concurrently/package.json create mode 100644 deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs create mode 100644 deps/npm/node_modules/node-gyp/lib/find-vs2017.js delete mode 100644 deps/npm/node_modules/npm-package-arg/.npmignore delete mode 100644 deps/npm/node_modules/npm-package-arg/.travis.yml delete mode 100644 deps/npm/node_modules/npm-package-arg/test/basic.js delete mode 100644 deps/npm/node_modules/npm-package-arg/test/bitbucket.js delete mode 100644 deps/npm/node_modules/npm-package-arg/test/github.js delete mode 100644 deps/npm/node_modules/npm-package-arg/test/gitlab.js delete mode 100644 deps/npm/node_modules/npm-package-arg/test/windows.js delete mode 100644 deps/npm/node_modules/npm-registry-client/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-client/.travis.yml delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js delete mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/00-setup.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/access.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/adduser-new.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/adduser-update.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/adduser.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/config-defaults.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/config-override.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/deprecate.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/econnreset.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-404.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-408.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-503.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-authed.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-basic.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/get-403.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/get-basic.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/get-error-403.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/initialize.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/lib/common.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/lib/server.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/logout.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/ping.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish-again.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish-scoped.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/publish.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/redirects.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/request.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/retries.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/send-anon-metrics.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/star.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/stars.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/tag.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/team.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/unpublish.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/whoami.js delete mode 100644 deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js create mode 100644 deps/npm/node_modules/opener/README.md delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/README.md delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/common.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/glob.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/LICENSE delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/package.json delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/sync.js create mode 100644 deps/npm/node_modules/readable-stream/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/readable-stream/GOVERNANCE.md delete mode 100755 deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/async.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/browser/async.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/browser/error.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/browser/promise.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/error.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/index.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node4/async.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node4/error.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node4/promise.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node6/async.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node6/error.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node6/promise.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node7/async.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node7/error.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/node7/promise.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/runner.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cache.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/content.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/creator.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/entry.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/har.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/log.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/page.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/postData.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/record.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/request.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/response.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/timings.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/.tonic_example.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/LICENSE create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/README.md create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/ajv.bundle.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/ajv.min.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/ajv.min.js.map create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/nodent.min.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/regenerator.min.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.d.ts create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/async.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/cache.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/_rules.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/equal.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/formats.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/index.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/resolve.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/rules.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/schema_obj.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/ucs2length.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/util.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/validation_error.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limit.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitItems.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitLength.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitProperties.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/allOf.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/anyOf.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/coerce.def create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/custom.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/defaults.def create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/definitions.def create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/dependencies.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/enum.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/errors.def create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/format.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/items.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/missing.def create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/multipleOf.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/not.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/oneOf.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/pattern.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/properties.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/required.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/uniqueItems.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/_formatLimit.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/constant.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/patternRequired.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/validate.jst create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/README.md create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_formatLimit.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limit.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitItems.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitLength.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitProperties.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/allOf.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/anyOf.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/constant.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/custom.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/dependencies.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/enum.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/format.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/items.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/multipleOf.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/not.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/oneOf.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/pattern.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/properties.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/ref.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/required.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/switch.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/uniqueItems.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/validate.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/keyword.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/refs/json-schema-draft-04.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/refs/json-schema-v5.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/v5.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/History.md create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/LICENSE create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/Readme.md create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/index.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/package.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.npmignore create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.travis.yml create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/LICENSE create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/key_cmp.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/nested.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/str.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/value_cmp.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/index.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/README.markdown create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/index.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/parse.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/stringify.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/package.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/parse.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/stringify.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/package.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/readme.markdown create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/nested.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/replacer.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/space.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/str.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/to-json.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/package.json create mode 100755 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/bundle create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/compile-dots.js create mode 100755 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/info create mode 100755 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/prepare-tests create mode 100755 deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/travis-gh-pages delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/license delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/History.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/LICENSE delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/.travis.yml delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/LICENSE create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/README.md create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/afterRequest.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/beforeRequest.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/browser.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/cache.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/content.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/cookie.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/creator.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/entry.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/har.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/header.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/index.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/log.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/page.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/pageTimings.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/postData.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/query.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/request.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/response.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/lib/timings.json create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/har-schema/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/.travis.yml delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/LICENSE delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/example.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/example.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/test.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/.travis.yml delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/LICENSE delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/LICENSE delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/is-property.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/LICENSE.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/benchmark.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/LICENCE delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/Makefile delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/immutable.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/mutable.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/test.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/require.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/fixtures/cosmic.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalItems.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/additionalProperties.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/allOf.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/anyOf.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/bignum.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/default.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/definitions.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/dependencies.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/enum.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/format.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/items.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxItems.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxLength.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maxProperties.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/maximum.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minItems.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minLength.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minProperties.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/minimum.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndFormat.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/oneOf.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/pattern.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/patternProperties.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/properties.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/ref.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/refRemote.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/required.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/type.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/uniqueItems.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/license delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/license delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/readme.md create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/src/async.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/src/error.js create mode 100644 deps/npm/node_modules/request/node_modules/har-validator/src/promise.js create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/AUTHORS.md delete mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/LICENSE create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.d.ts create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/.npmignore create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/.tm_properties create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/.travis.yml create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/Makefile create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/README.md create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/lib/performance-now.js create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/license.txt create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/package.json create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/src/performance-now.coffee create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/test/mocha.opts create mode 100644 deps/npm/node_modules/request/node_modules/performance-now/test/performance-now.coffee create mode 100644 deps/npm/node_modules/request/node_modules/qs/.jscs.json delete mode 100644 deps/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md mode change 100755 => 100644 deps/npm/node_modules/request/node_modules/qs/lib/index.js mode change 100755 => 100644 deps/npm/node_modules/request/node_modules/qs/lib/parse.js mode change 100755 => 100644 deps/npm/node_modules/request/node_modules/qs/lib/stringify.js mode change 100755 => 100644 deps/npm/node_modules/request/node_modules/qs/lib/utils.js mode change 100755 => 100644 deps/npm/node_modules/request/node_modules/qs/test/parse.js mode change 100755 => 100644 deps/npm/node_modules/request/node_modules/qs/test/stringify.js mode change 100755 => 100644 deps/npm/node_modules/request/node_modules/qs/test/utils.js create mode 100644 deps/npm/node_modules/request/node_modules/safe-buffer/.travis.yml create mode 100644 deps/npm/node_modules/request/node_modules/safe-buffer/LICENSE create mode 100644 deps/npm/node_modules/request/node_modules/safe-buffer/README.md create mode 100644 deps/npm/node_modules/request/node_modules/safe-buffer/browser.js create mode 100644 deps/npm/node_modules/request/node_modules/safe-buffer/index.js create mode 100644 deps/npm/node_modules/request/node_modules/safe-buffer/package.json create mode 100644 deps/npm/node_modules/request/node_modules/safe-buffer/test.js create mode 100644 deps/npm/node_modules/update-notifier/check.js create mode 100644 deps/npm/node_modules/update-notifier/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/CHANGELOG.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/code-point-at/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/code-point-at/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/code-point-at/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/code-point-at/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/node_modules/string-width/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/ansi-align/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/camelcase/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/camelcase/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/camelcase/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/camelcase/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/cli-boxes/boxes.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/cli-boxes/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/cli-boxes/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/cli-boxes/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/cli-boxes/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/node_modules/is-fullwidth-code-point/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/string-width/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/.editorconfig create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/.npmignore create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/.travis.yml create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/appveyor.yml create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/lib/enoent.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/lib/parse.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/lib/resolveCommand.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/lib/lru-cache.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/pseudomap/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/pseudomap/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/pseudomap/map.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/pseudomap/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/pseudomap/test/basic.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/.npmignore create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/.travis.yml create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/test/basic.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/node_modules/yallist/yallist.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/node_modules/lru-cache/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/cross-spawn-async/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/is-stream/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/is-stream/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/is-stream/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/is-stream/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/npm-run-path/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/npm-run-path/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/npm-run-path/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/npm-run-path/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/object-assign/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/object-assign/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/object-assign/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/object-assign/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/path-key/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/path-key/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/path-key/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/path-key/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/strip-eof/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/strip-eof/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/strip-eof/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/node_modules/strip-eof/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/node_modules/execa/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/readme.md create mode 100755 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/vendor/resize create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/vendor/win-term-size.exe create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/code-point-at/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/code-point-at/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/code-point-at/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/code-point-at/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/node_modules/string-width/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/node_modules/widest-line/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/boxen/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/ansi-styles/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/ansi-styles/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/ansi-styles/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/ansi-styles/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/escape-string-regexp/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/escape-string-regexp/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/escape-string-regexp/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/escape-string-regexp/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/has-ansi/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/has-ansi/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/has-ansi/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/has-ansi/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/supports-color/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/supports-color/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/supports-color/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/node_modules/supports-color/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/chalk/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/node_modules/is-obj/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/node_modules/is-obj/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/node_modules/is-obj/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/node_modules/is-obj/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/dot-prop/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/node_modules/crypto-random-string/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/node_modules/crypto-random-string/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/node_modules/crypto-random-string/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/node_modules/crypto-random-string/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/node_modules/unique-string/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/configstore/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/is-npm/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/is-npm/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/is-npm/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/node_modules/capture-stack-trace/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/create-error-class/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/LICENSE.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/duplexer3/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/buffer-stream.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/get-stream/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-redirect/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-retry-allowed/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/is-stream/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/lowercase-keys/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/.travis.yml create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/browser.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/safe-buffer/test.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/timed-out/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/unzip-response/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/node_modules/prepend-http/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/node_modules/url-parse-lax/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/got/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/.npmignore create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/CHANGELOG.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/base64.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/.npmignore create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/LICENSE.APACHE2 create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/LICENSE.BSD create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/LICENSE.MIT create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/browser.js create mode 100755 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/lib/utils.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/deep-extend/CHANGELOG.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/deep-extend/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/deep-extend/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/deep-extend/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/deep-extend/lib/deep-extend.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/deep-extend/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/.travis.yml create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/example/parse.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/readme.markdown create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/all_bool.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/bool.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/dash.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/default_bool.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/dotted.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/kv_short.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/long.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/num.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/parse.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/parse_modified.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/short.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/stop_early.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/unknown.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/minimist/test/whitespace.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/strip-json-comments/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/strip-json-comments/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/strip-json-comments/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/node_modules/strip-json-comments/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/test/ini.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/test/nested-env-vars.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/node_modules/rc/test/test.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/registry-url.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/test/auth-token.test.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-auth-token/test/registry-url.test.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/.npmignore create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/LICENSE.APACHE2 create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/LICENSE.BSD create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/LICENSE.MIT create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/browser.js create mode 100755 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/lib/utils.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/CHANGELOG.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/README.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/lib/deep-extend.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/deep-extend/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/.travis.yml create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/LICENSE create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/example/parse.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/readme.markdown create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/all_bool.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/bool.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/dash.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/default_bool.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/dotted.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/kv_short.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/long.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/num.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/parse.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/parse_modified.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/short.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/stop_early.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/unknown.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/minimist/test/whitespace.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/strip-json-comments/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/strip-json-comments/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/strip-json-comments/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/node_modules/strip-json-comments/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/test/ini.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/test/nested-env-vars.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/node_modules/rc/test/test.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/node_modules/registry-url/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/node_modules/package-json/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/latest-version/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/lazy-req/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/lazy-req/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/lazy-req/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/lazy-req/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/semver-diff/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/semver-diff/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/semver-diff/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/semver-diff/readme.md create mode 100644 deps/npm/node_modules/update-notifier/node_modules/xdg-basedir/index.js create mode 100644 deps/npm/node_modules/update-notifier/node_modules/xdg-basedir/license create mode 100644 deps/npm/node_modules/update-notifier/node_modules/xdg-basedir/package.json create mode 100644 deps/npm/node_modules/update-notifier/node_modules/xdg-basedir/readme.md create mode 100644 deps/npm/node_modules/update-notifier/package.json create mode 100644 deps/npm/node_modules/update-notifier/readme.md create mode 100644 deps/npm/node_modules/validate-npm-package-name/.travis.yml create mode 100644 deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/License create mode 100644 deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/test.js delete mode 100644 deps/npm/node_modules/which/node_modules/isexe/access.js create mode 100644 deps/npm/test/tap/00-verify-no-scoped.js create mode 100644 deps/npm/test/tap/adduser-oauth.js create mode 100644 deps/npm/test/tap/adduser-saml.js create mode 100644 deps/npm/test/tap/install-duplicate-deps-warning.js diff --git a/deps/npm/.github/issue_template.md b/deps/npm/.github/issue_template.md index 9ae9029805..f3a5861866 100644 --- a/deps/npm/.github/issue_template.md +++ b/deps/npm/.github/issue_template.md @@ -40,10 +40,10 @@ before submitting your issue. - Please check if there's a solution in the troubleshooting wiki: - https://github.com/npm/npm/wiki/Troubleshooting + https://github.com/npm/npm/blob/latest/TROUBLESHOOTING.md - Also ensure that your new issue conforms to npm's contribution guidelines: - https://github.com/npm/npm/wiki/Contributing-Guidelines + https://github.com/npm/npm/blob/latest/CONTRIBUTING.md - Participation in this open source project is subject to the npm Code of Conduct: https://www.npmjs.com/policies/conduct diff --git a/deps/npm/.mailmap b/deps/npm/.mailmap index 85eed6222c..7c092c41ca 100644 --- a/deps/npm/.mailmap +++ b/deps/npm/.mailmap @@ -53,6 +53,7 @@ Ryan Emery Sam Mikes Stephanie Snopek Takaya Kobayashi +Ted Yavuzkurt Thomas Reggi Timo Weiß Tony diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index 6e1950523b..ea6dedb5ce 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -28,6 +28,8 @@ notifications: cache: directories: - $HOME/.npm + - html/doc + - man - node_modules/.bin - node_modules/.cache - node_modules/deep-equal diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index f267e5024f..12e2cce6d3 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -450,3 +450,12 @@ Daijirō Wachi Dmitry Litvinchenko chocolateboy Henry Zhu +Nate Goldman +Ted Yavuzkurt +Arseniy Maximov +Joshua Bennett +Evgeny Kulikov +Сковорода Никита Андреевич +Carol (Nichols || Goulding) +Jarid Margolin +David Cook diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 6d1ccc252b..c6dc604bc9 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,422 @@ +### v4.5.0 (2017-03-24) + +Welcome a wrinkle on npm's registry API! + +Codename: Corgi + +![corgi-meme](https://cloud.githubusercontent.com/assets/757502/24126107/64c14268-0d89-11e7-871b-d457e6d0082b.jpg) + +This release has some bug fixes, but it's mostly about bringing support for +MUCH smaller package metadata. How much smaller? Well, for npm itself it +reduces 416K of gzip compressed JSON to 24K. + +As a user, all you have to do is update to get to use the new API. If +you're interested in the details we've [documented the +changes](https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md) +in detail. + +#### CORGUMENTS + +Package metadata: now smaller. This means a smaller cache and less to download. + +* [`86dad0d74`](https://github.com/npm/npm/commit/86dad0d747f288eab467d49c9635644d3d44d6f0) + Add support for filtered package metadata. + ([@iarna](https://github.com/iarna)) +* [`41789cffa`](https://github.com/npm/npm/commit/41789cffac9845603f4bdf3f5b03f412144a0e9f) + `npm-registry-client@8.1.0` + ([@iarna](https://github.com/iarna)) + +#### NO SHRINKWRAP, NO PROBLEM + +Previously we needed to extract every package's tarball to look for an +`npm-shrinkwrap.json` before we could begin working through what its +dependencies were. This was one of the things stopping npm's network +accesses from happening more concurrently. The new filtered package +metadata provides a new key, `_hasShrinkwrap`. When that's set to `false` +then we know we don't have to look for one. + +* [`4f5060eb3`](https://github.com/npm/npm/commit/4f5060eb31b9091013e1d6a34050973613a294a3) + [#15969](https://github.com/npm/npm/pull/15969) + Add support for skipping `npm-shrinkwrap.json` extraction when the + registry can affirm that one doesn't exist. + ([@iarna](https://github.com/iarna)) + +#### INTERRUPTING SCRIPTS + +* [`878aceb25`](https://github.com/npm/npm/commit/878aceb25e6d6052dac15da74639ce274c8e62c5) + [#16129](https://github.com/npm/npm/pull/16129) + Better handle Ctrl-C while running scripts. `npm` will now no longer exit + until the script it is running has exited. If you press Ctrl-C a second + time it kill the script rather than just forwarding the Ctrl-C. + ([@jaridmargolin](https://github.com/jaridmargolin)) + +#### DEPENDENCY UPDATES: + +* [`def75eebf`](https://github.com/npm/npm/commit/def75eebf1ad437bf4fd3f5e103cc2d963bd2a73) + `hosted-git-info@2.4.1`: + Preserve case of the user name part of shortcut specifiers, previously they were lowercased. + ([@iarna](https://github.com/iarna)) +* [`eb3789fd1`](https://github.com/npm/npm/commit/eb3789fd18cfb063de9e6f80c3049e314993d235) + `node-gyp@3.6.0`: Add support for VS2017 and Chakracore improvements. + ([@refack](https://github.com/refack)) + ([@kunalspathak](https://github.com/kunalspathak)) +* [`245e25315`](https://github.com/npm/npm/commit/245e25315524b95c0a71c980223a27719392ba75) + `readable-stream@2.2.6` ([@mcollina](https://github.com/mcollina)) +* [`30357ebc5`](https://github.com/npm/npm/commit/30357ebc5691d7c9e9cdc6e0fe7dc6253220c9c2) + `which@1.2.14` ([@isaacs](https://github.com/isaacs)) + +### v4.4.4 (2017-03-16) + +😩😤😅 Okay! We have another `next` +release for ya today. So, yes! With v4.4.3 we fixed the bug that made +bundled scoped modules uninstallable. But somehow I overlooked the fact +that we: A) were using these and B) that made upgrading to v4.4.3 impossible. 😭 + +So I've renamed those two scoped modules to no longer use scopes and we now +have a shiny new test to ensure that scoped modules don't creep into our +transitive deps and make it impossible to upgrade to `npm`. + +(None of our woes applies to most of you all because most of you all don't +use bundled dependencies. `npm` does because we want the published artifact to be +installable without having to already have `npm`.) + +* [`2a7409fcb`](https://github.com/npm/npm/commit/2a7409fcba6a8fab716c80f56987b255983e048e) + [#16066](https://github.com/npm/npm/pull/16066) + Ensure we aren't using any scoped modules + Because `npm`s prior 4.4.3 can't install dependencies that have bundled scoped + modules. This didn't show up sooner because they ALSO had a bug that caused + bundled scoped modules to not be included in the bundle. + ([@iarna](https://github.com/iarna)) +* [`eb4c70796`](https://github.com/npm/npm/commit/eb4c70796c38f24ee9357f5d4a0116db582cc7a9) + [#16066](https://github.com/npm/npm/pull/16066) + Switch to move-concurrently to remove scoped dependency + ([@iarna](https://github.com/iarna)) + +### v4.4.3 (2017-03-15) + +This is a small patch release, mostly because the published tarball for +v4.4.2 was missing a couple of modules, due to a bug involving scoped +modules, bundled dependencies and legacy tree layouts. + +There are a couple of other things here that happened to be ready to go. So +without further ado… + +#### BUG FIXES + +* [`3d80f8f70`](https://github.com/npm/npm/commit/3d80f8f70679ad2b8ce7227d20e8dbce257a47b9) + [npm/fs-vacuum#6](https://github.com/npm/fs-vacuum/pull/6) + `fs-vacuum@1.2.1`: Make sure we never, ever remove home directories. Previously if your + home directory was entirely empty then we might `rmdir` it. + ([@helio-frota](https://github.com/helio-frota)) +* [`1af85ca9f`](https://github.com/npm/npm/commit/1af85ca9f4d625f948e85961372de7df3f3774e2) + [#16040](https://github.com/npm/npm/pull/16040) + Fix bug where bundled transitive dependencies that happened to be + installed under bundled scoped dependencies wouldn't be included in the + tarball when building a package. + ([@iarna](https://github.com/iarna)) +* [`13c7fdc2e`](https://github.com/npm/npm/commit/13c7fdc2e87456a87b1c9385a3daeae228ed7c95) + [#16040](https://github.com/npm/npm/pull/16040) + Fix a bug where bundled scoped dependencies couldn't be extracted. + ([@iarna](https://github.com/iarna)) +* [`d6cde98c2`](https://github.com/npm/npm/commit/d6cde98c2513fe160eab41e31c3198dfde993207) + [#16040](https://github.com/npm/npm/pull/16040) + Stop printing `ENOENT` errors more than once. + ([@iarna](https://github.com/iarna)) +* [`722fbf0f6`](https://github.com/npm/npm/commit/722fbf0f6cf4413cdc24b610bbd60a7dbaf2adfe) + [#16040](https://github.com/npm/npm/pull/16040) + Rewrite the `extract` action for greater clarity. + Specifically, this involves moving things around structurally to do the same + thing [`d0c6d194`](https://github.com/npm/npm/commit/d0c6d194) did, but in a more comprehensive manner. + This also fixes a long standing bug where errors from the move step would be + eaten during this phase and as a result we would get mysterious crashes in + the finalize phase when finalize tried to act on them. + ([@iarna](https://github.com/iarna)) +* [`6754dabb6`](https://github.com/npm/npm/commit/6754dabb6bd3301504efb3b62f36d3fe70958c19) + [#16040](https://github.com/npm/npm/pull/16040) + Flatten out `@npmcorp/move`'s deps for backwards compatibility reasons. Versions prior to this + one will fail to install any package that bundles a scoped dependency. This was responsible + for `ENOENT` errors during the `finalize` phase. + ([@iarna](https://github.com/iarna)) + +#### DOC UPDATES + +* [`fba51c582`](https://github.com/npm/npm/commit/fba51c582d1d08dd4aa6eb27f9044dddba91bb18) + [#15960](https://github.com/npm/npm/pull/15960) + Update troubleshooting and contribution guide links. + ([@watilde](https://github.com/watilde)) + + +### v4.4.2 (2017-03-09): + +This week, the focus on the release was mainly going through [all of npm's deps +that we manage +ourselves](https://github.com/npm/npm/wiki/npm-maintained-dependencies), and +making sure all their PRs and versions were up to date. That means there's a few +fixes here and there. Nothing too big codewise, though. + +The most exciting part of this release is probably our [shiny new +Contributing](https://github.com/npm/npm/blob/latest/CONTRIBUTING.md) and +[Troubleshooting](https://github.com/npm/npm/blob/latest/TROUBLESHOOTING.md) +docs! [@snopeks](https://github.com/snopeks) did some ✨fantastic✨ work hashing it +out, and we're really hoping this is a nice big step towards making contributing +to npm easier. The troubleshooting doc will also hopefully solve common issues +for people! Do you think something is missing from it? File a PR and we'll add +it! The current document is just a baseline for further editing and additions. + +Also there's maybe a bit of an easter egg in this release. 'Cause those are fun and I'm a huge nerd. 😉 + +#### DOCUMENTATION AHOY + +* [`07e997a`](https://github.com/npm/npm/commit/07e997a7ecedba7b29ad76ffb2ce990d5c0200fc) + [#15756](https://github.com/npm/npm/pull/15756) + Overhaul `CONTRIBUTING.md` and add new `TROUBLESHOOTING.md` files. 🙌🏼 + ([@snopeks](https://github.com/snopeks)) +* [`2f3e4b6`](https://github.com/npm/npm/commit/2f3e4b645cdc268889cf95ba24b2aae572d722ad) + [#15833](https://github.com/npm/npm/pull/15833) + Mention the [24-hour unpublish + policy](http://blog.npmjs.org/post/141905368000/changes-to-npms-unpublish-policy) + on the main registry. + ([@carols10cents](https://github.com/carols10cents)) + +#### NOT REALLY FEATURES, NOT REALLY BUGFIXES. MORE LIKE TWEAKS? 🤔 + +* [`84be534`](https://github.com/npm/npm/commit/84be534aedb78c65cd8012427fc04871ceeccf90) + [#15888](https://github.com/npm/npm/pull/15888) + Stop flattening `ls`-tree output. From now on, deduped deps will be marked as + such in the place where they would've been before getting hoisted by the + installer. + ([@iarna](https://github.com/iarna)) +* [`e9a5dca`](https://github.com/npm/npm/commit/e9a5dca369ead646ab5922326cede1406c62bd3b) + [#15967](https://github.com/npm/npm/pull/15967) + Limit metadata fetches to 10 concurrent requests. + ([@iarna](https://github.com/iarna)) +* [`46aa9bc`](https://github.com/npm/npm/commit/46aa9bcae088740df86234fc199f7aef53b116df) + [#15967](https://github.com/npm/npm/pull/15967) + Limit concurrent installer actions to 10. + ([@iarna](https://github.com/iarna)) + +#### BUGFIXES + +* [`c3b994b`](https://github.com/npm/npm/commit/c3b994b71565eb4f943cce890bb887d810e6e2d4) + [#15901](https://github.com/npm/npm/pull/15901) + Use EXDEV aware move instead of rename. This will allow moving across devices + and moving when filesystems don't support renaming directories full of files. It might make folks using Docker a bit happier. + ([@iarna](https://github.com/iarna)) +* [`0de1a9c`](https://github.com/npm/npm/commit/0de1a9c1db90e6705c65c068df1fe82899e60d68) + [#15735](https://github.com/npm/npm/pull/15735) + Autocomplete support for npm scripts with `:` colons in the name. + ([@beyondcompute](https://github.com/beyondcompute)) +* [`84b0b92`](https://github.com/npm/npm/commit/84b0b92e7f78ec4add42e8161c555325c99b7f98) + [#15874](https://github.com/npm/npm/pull/15874) + Stop using [undocumented](https://github.com/nodejs/node/pull/11355) + `res.writeHeader` alias for `res.writeHead`. + ([@ChALkeR](https://github.com/ChALkeR)) +* [`895ffe4`](https://github.com/npm/npm/commit/895ffe4f3eecd674796395f91c30eda88aca6b36) + [#15824](https://github.com/npm/npm/pull/15824) + Fix empty versions column in `npm search` output. + ([@bcoe](https://github.com/bcoe)) +* [`38c8d7a`](https://github.com/npm/npm/commit/38c8d7adc1f43ab357d1e729ae7cd5d801a26e68) + `init-package-json@1.9.5`: [npm/init-package-json#61](https://github.com/npm/init-package-json/pull/61) Exclude existing `devDependencies` from being added to `dependencies`. Fixes [#12260](https://github.com/npm/npm/issues/12260). + ([@addaleax](https://github.com/addaleax)) + +### v4.4.1 (2017-03-06): + +This is a quick little patch release to forgo the update notification +checker if you're on an unsuported (but not otherwise broken) version of +Node.js. Right now that means 0.10 or 0.12. + +* [`56ac249`](https://github.com/npm/npm/commit/56ac249ef8ede1021f1bc62a0e4fe1e9ba556af2) + [#15864](https://github.com/npm/npm/pull/15864) + Only use `update-notifier` on supported versions. + ([@legodude17](https://github.com/legodude17)) + +### v4.4.0 (2017-02-23): + +Aaaah, [@iarna](https://github.com/iarna) here, it's been a little while +since I did one of these! This is a nice little release, we've got an +update notifier, vastly less verbose error messages, new warnings on package +metadata that will probably give you a bad day, and a sprinkling of bug +fixes. + +#### UPDATE NOTIFICATIONS + +We now have a little nudge to update your `npm`, courtesy of +[update-notifier](https://www.npmjs.com/package/update-notifier). + +* [`148ee66`](https://github.com/npm/npm/commit/148ee663740aa05877c64f16cdf18eba33fbc371) + [#15774](https://github.com/npm/npm/pull/15774) + `npm` will now check at start up to see if a newer version is available. + It will check once a day. If you want to disable this, set `optOut` to `true` in + `~/.config/configstore/update-notifier-npm.json`. + ([@ceejbot](https://github.com/ceejbot)) + +#### LESS VERBOSE ERROR MESSAGES + +`npm` has, for a long time, had very verbose error messages. There was a +lot of info in there, including the cause of the error you were seeing but +without a lot of experience reading them pulling that out was time consuming +and difficult. + +With this change the output is cut down substantially, centering the error +message. So, for example if you try to `npm run sdlkfj` then the entire +error you'll get will be: + +``` +npm ERR! missing script: sldkfj + +npm ERR! A complete log of this run can be found in: +npm ERR! /Users/rebecca/.npm/_logs/2017-02-24T00_41_36_988Z-debug.log +``` + +The CLI team has discussed cutting this down even further and stripping the +`npm ERR!` prefix off those lines too. We'd appreciate your feedback on +this! + +* [`e544124`](https://github.com/npm/npm/commit/e544124592583654f2970ec332003cfd00d04f2b) + [#15716](https://github.com/npm/npm/pull/15716) + Make error output less verbose. + ([@iarna](https://github.com/iarna)) +* [`166bda9`](https://github.com/npm/npm/commit/166bda97410d0518b42ed361020ade1887e684af) + [#15716](https://github.com/npm/npm/pull/15716) + Stop encouraging users to visit the issue tracker unless we know for + certain that it's an npm bug. + ([@iarna](https://github.com/iarna)) + +#### OTHER NEW FEATURES + +* [`53412eb`](https://github.com/npm/npm/commit/53412eb22c1c75d768e30f96d69ed620dfedabde) + [#15772](https://github.com/npm/npm/pull/15772) + We now warn if you have a module listed in both dependencies and + devDependencies. + ([@TedYav](https://github.com/TedYav)) +* [`426b180`](https://github.com/npm/npm/commit/426b1805904a13bdc5c0dd504105ba037270cbee) + [#15757](https://github.com/npm/npm/pull/15757) + Default reporting metrics to default registry. Previously it defaulted to using + `https://registry.npmjs.org`, now it will default to the result of + `npm config get registry`. For most folks this won't actually change anything, but it + means that folks who use a private registry will have metrics routed there by default. + This has the potential to be interesting because it means that in the + future private registry products ([npme](https://npme.npmjs.com/docs/)!) + will be able to report on these metrics. + ([@iarna](https://github.com/iarna)) + +#### BUG FIXES + +* [`8ea0de9`](https://github.com/npm/npm/commit/8ea0de98563648ba0db032acd4d23d27c4a50a66) + [#15716](https://github.com/npm/npm/pull/15716) + Write logs for `cb() never called` errors. +* [`c4e83dc`](https://github.com/npm/npm/commit/c4e83dca830b24305e3cb3201a42452d56d2d864) + Make it so that errors while reading the existing node_modules tree can't + result in installer crashes. + ([@iarna](https://github.com/iarna)) +* [`2690dc2`](https://github.com/npm/npm/commit/2690dc2684a975109ef44953c2cf0746dbe343bb) + Update `npm doctor` to not treat broken symlinks in your global modules as + a permission failure. This is particularly important if you link modules and your text + editor uses the convention of creating symlinks from `.#filename.js` to a + machine name and pid to lock files (eg emacs and compatible things). + ([@iarna](https://github.com/iarna)) +* [`f4c3f48`](https://github.com/npm/npm/commit/f4c3f489aa5787cf0d60e8436be2190e4b0d0ff7) + [#15777](https://github.com/npm/npm/pull/15777) + Not exactly a bug, but change a parameterless `.apply` to `.call`. + ([@notarseniy](https://github.com/notarseniy)) + +#### DEPENDENCY UPDATES + +* [`549dcff`](https://github.com/npm/npm/commit/549dcff58c7aaa1e7ba71abaa14008fdf2697297) + `rimraf@2.6.0`: + Retry EBUSY, ENOTEMPTY and EPERM on non-Windows platforms too. + More reliable `rimraf.sync` on Windows. + ([@isaacs](https://github.com/isaacs)) +* [`052dfb6`](https://github.com/npm/npm/commit/052dfb623da508f2b5f681da0258125552a18a4a) + `validate-npm-package-name@3.0.0`: + Remove ableist language in README. + Stop allowing ~'!()* in package names. + ([@tomdale](https://github.com/tomdale)) + ([@chrisdickinson](https://github.com/chrisdickinson)) +* [`6663ea6`](https://github.com/npm/npm/commit/6663ea6ac0f0ecec5a3f04a3c01a71499632f4dc) + `abbrev@1.1.0` ([@isaacs](https://github.com/isaacs)) +* [`be6de9a`](https://github.com/npm/npm/commit/be6de9aab9e20b6eac70884e8626161eebf8721a) + `opener@1.4.3` ([@dominic](https://github.com/dominic)) +* [`900a5e3`](https://github.com/npm/npm/commit/900a5e3e3411ec221306455f99b24b9ce35757c0) + `readable-stream@2.2.3` ([@RangerMauve](https://github.com/RangerMauve)) ([@mcollina](https://github.com/mcollina)) +* [`c972a8b`](https://github.com/npm/npm/commit/c972a8b0f20a61a79c45b6642f870bea8c55c7e4) + `tacks@1.2.6` + ([@iarna](https://github.com/iarna)) +* [`85a36ef`](https://github.com/npm/npm/commit/85a36efdac0c24501876875cb9ad40292024e0b0) + [`7ac9265`](https://github.com/npm/npm/commit/7ac9265c56b4d9eeaca6fcfb29513f301713e7bb) + `tap@10.2.0` + ([@isaacs](https://github.com/saacs)) + +### v4.3.0 (2017-02-09): + +Yay! Release time! It's a rainy day, and we have another smallish release for +y'all. These things are not necessarily related. Or are they 🌧🤔 + +As far as news go, you may have noticed that the CLI team dropped support for +`node@0.12` when that version went out of maintenance. Still, we've avoided +explicitly breaking it and `node@0.10` so far -- but not much longer. + +Sometime soon, the CLI team plans on switching over to language features only +available as of `node@4 LTS`, and will likely start dropping old versions of node +as they go out of maintenance. The new features are exciting! We're really +looking forward to using them in the core CLI (and its dependencies) as we keep up +with our current feature work. + +And speaking of features, this release is a minor bump due to a small change in +how `npm login` works for the sake of supporting OAuth-based login for npm +Enterprise users. But we won't leave the rest of y'all out -- we're working on a +larger version of this feature. Soon enough, you'll be able to log in to npm +with, say, GitHub -- and use some shiny features that come from the integration. +Or turn on 2FA and other such security features. Keep your eyes peeled for new +on this in the next few releases and our weekly newsletter! + +#### NEW AUTH TYPES + +There's a new command line option: `--auth-type`, which can be used to log in to +a supporting registry with OAuth2 or SAML. The current implementation is mainly +meant to support npmE customers, so if you're one of those: ask us about using +it! If not, just hold off cause we'll have a much more complete version of this +feature out soon. + +* [`ac8595e`](https://github.com/npm/npm/commit/ac8595e3c9b615ff95abc3301fac1262c434792c) [`bcf2dd8`](https://github.com/npm/npm/commit/bcf2dd8a165843255c06515fa044c6e4d3b71ca4) [`9298d20`](https://github.com/npm/npm/commit/9298d20af58b92572515bfa9cf7377bd4221dc7d) [`66b61bc`](https://github.com/npm/npm/commit/66b61bc42e81ee8a1ee00fc63517f62284140688) [`dc85de7`](https://github.com/npm/npm/commit/dc85de7df6bb61f7788611813ee82ae695a18f1f) + [#13389](https://github.com/npm/npm/pull/13389) + Implement single-sign-on support with `--auth-type` option. + ([@zkat](https://github.com/zkat)) + +#### FASTER STARTUP. SOMETIMES! + +`request` is pretty heavy. And it loads a bunch of things. It's actually a +pretty big chunk of npm's load time. This small patch by Rebecca will make it so +npm only loads that module when we're actually intending to make network +requests. Those of you who use npm commands that run offline might see a small +speedup in startup time. + +* [`ac73568`](https://github.com/npm/npm/commit/ac735682e666e8724549d56146821f3b8b018e25) + [#15631](https://github.com/npm/npm/pull/15631) + Lazy load `caching-registry-client`. + ([@iarna](https://github.com/iarna)) + +#### DOCUMENTATION + +* [`4ad9247`](https://github.com/npm/npm/commit/4ad9247aa82f7553c9667ee93c74ec7399d6ceec) + [#15630](https://github.com/npm/npm/pull/15630) + Fix formatting/rendering for root npm README. + ([@ungoldman](https://github.com/ungoldman)) + +#### DEPENDENCY UPDATES + +* [`8cc1112`](https://github.com/npm/npm/commit/8cc1112958638ff88ac2c24c4a065acacb93d64b) + [npm/hosted-git-info#21](https://github.com/npm/hosted-git-info/pull/21) + `hosted-git-info@2.2.0`: + Add support for `.tarball()` URLs. + ([@zkat](https://github.com/zkat)) +* [`6eacc1b`](https://github.com/npm/npm/commit/6eacc1bc1925fe3cc79fc97bdc3194d944fce55e) + `npm-registry-mock@1.1.0` + ([@addaleax](https://github.com/addaleax)) +* [`a9b6d77`](https://github.com/npm/npm/commit/a9b6d775e61cf090df0e13514c624f99bf31d1e7) + `aproba@1.1.1` + ([@iarna](https://github.com/iarna)) + ### v4.2.0 (2017-01-26): Hi all! I'm Kat, and I'm currently sitting in a train traveling at ~300km/h diff --git a/deps/npm/CONTRIBUTING.md b/deps/npm/CONTRIBUTING.md index 73049a495e..9fb7853af8 100644 --- a/deps/npm/CONTRIBUTING.md +++ b/deps/npm/CONTRIBUTING.md @@ -1,12 +1,82 @@ -## Before you submit a new issue - -* Check if there's a simple solution in the - [Troubleshooting](https://github.com/npm/npm/wiki/Troubleshooting) - wiki. -* [Search for similar - issues](https://github.com/npm/npm/search?q=Similar%20issues&type=Issues). -* Ensure your new issue conforms to the [Contributing - Guidelines](https://github.com/npm/npm/wiki/Contributing-Guidelines). - -Participation in this open source project is subject to the [npm Code -of Conduct](http://www.npmjs.com/policies/conduct). +# npm CLI Contributor Roles and Responsibilities + +## Table of Contents + +* [Introduction](#introduction) +* [Roles](#roles) + * [Community Members](#community-members) + * [Collaborators](#collaborators) + * [npm, Inc Employeees](#npm-inc-employees) + + +## Introduction + +Welcome to the npm CLI Contributor Guide! This document outlines the npm CLI repository's process for community interaction and contribution. This includes the issue tracker, pull requests, wiki pages, and, to a certain extent, outside communication in the context of the npm CLI. It defines roles, responsibilities, and procedures, and is an entry point for anyone wishing to contribute their time and effort to making npm a better tool for the JavaScript community! + +All interactions in the npm repository are covered by the [npm Code of Conduct](https://www.npmjs.com/policies/conduct) + +## Roles + +There are three main roles for people participating in the npm issue tracker. Each has a specific set of abilities and responsibilities: [Community members](#community-members), [Collaborators](#collaborators), and [npm, Inc employees](#npm-inc-employees). + +Failure to comply with the expected responsibilities of each role, or violating the Code of Conduct will result in punitive action relative to the transgression, ranging from a warning to full removal from the project, at the discretion of npm employees. + +### Community Members + +This includes anyone who may show up to the npm/npm repo with issues, PRs, comments etc. They may not have any other involvement with npm. + +#### Abilities + +* Open issues and PRs +* Comment on issues and PRs + +#### Responsibilities + +* Comment on issues when they have a reference to the answer. +* If community members aren't sure they are correct and don't have a reference to the answer, please leave the issue and try another one. +* Defer to collaborators and npm employees for answers. +* Make sure to search for [the troubleshooting doc](./TROUBLESHOOTING.md) and search on the issue tracker for similar issues before opening a new one. +* Any users with urgent support needs are welcome to email support@npmjs.com, and our dedicated support team will be happy to help. + +PLEASE don't @ collaborators or npm employees on issues. The CLI team is small, and has many outstanding commitments to fulfill. + +### Collaborators + +These are folks who have the ability to label and close issues. The role of collaborators may expand over time, but for now it is a limited (& important) role. This is an excellent way to contribute to npm without writing code. + +Community members may become collaborators by showing consistent, proven track record of quality contributions to the project, a reasonable level of proficiency with the CLI, and regular participation through the tracker and other related mediums, including regular contact with the CLI team itself. This role entails a higher level of responsibility than community member, so we ask for a higher level of understanding and commitment. + +Collaborators who become inactive for 3 months or longer may have their collaborator privileges removed until they are ready to return. + +#### Abilities + +* Label/triage new issues +* Respond to ongoing issues +* Close resolved issues. + +#### Responsibilities + +* Only answer questions when they know the answer, and provide a reference to the answer. +* If collaborators aren't totally confident about their answer, please leave the issue and try another one. +* If they've responded to an issue, it becomes their responsibility to see it to resolution. +* Close issues if there's no response within a month. +* Defer to fellow Collaborators & npm employees for answers (Again, please don't @ collaborators or npm employees, thank you!) +* Make sure to search for [the troubleshooting doc](./TROUBLESHOOTING.md) and search on the issue tracker for similar issues before opening a new one. + +### npm, Inc Employees + +Folks who work at npm, Inc, who have a responsibility to ensure the stability and functionality of the tools npm offers. + +#### Abilities +* Label/triage new issues +* Respond to ongoing issues +* Close resolved issues +* Land PRs + +Please note that this is a living document, and the CLI team will put up PRs to it as needed. + +#### Responsibilities + +* Preserve and promote the health of the CLI, the registry, the website, etc. + +In special cases, [Collaborators](#collaborators) may request time to speak with an npm employee directly, by contacting them and coordinating a time/place. diff --git a/deps/npm/README.md b/deps/npm/README.md index 2237414a54..1ba66e46ae 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -1,6 +1,8 @@ npm(1) -- a JavaScript package manager ============================== + [![Build Status](https://img.shields.io/travis/npm/npm/latest.svg)](https://travis-ci.org/npm/npm) + ## SYNOPSIS This is just enough info to get you up and running. @@ -86,7 +88,7 @@ experience if you run a recent version of npm. To upgrade, either use [Microsoft upgrade tool](https://github.com/felixrieseberg/npm-windows-upgrade), [download a new version of Node](https://nodejs.org/en/download/), or follow the Windows upgrade instructions in the -[npm Troubleshooting Guide](https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows). +[npm Troubleshooting Guide](./TROUBLESHOOTING.md). If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly. diff --git a/deps/npm/TROUBLESHOOTING.md b/deps/npm/TROUBLESHOOTING.md new file mode 100644 index 0000000000..0320075c51 --- /dev/null +++ b/deps/npm/TROUBLESHOOTING.md @@ -0,0 +1,192 @@ +# Troubleshooting Common Issues + +## Using this Document + +Search for the error message you're getting and see if there's a match, or skim the [table of contents](#table-of-contents) below for topics that seem relevant to the issue you're having. Each issue section has steps to work around or fix the particular issue, and have examples of common error messages. + +If you do not find the issue below, try searching the issue tracker itself for potential duplicates before opening a new issue. + +If you're reading this document because you noticed an issue with npm's web site, please let the [web team](https://github.com/npm/www/issues) know. + +### Updating this Document + +If you think something should be added here, make a PR that includes the following: + +0. a summary +0. one or more example errors +0. steps to debug and fix +0. links to at least one related issue from the tracker + +For more details of the content and formatting of these entries, refer to examples below. + +## Table of Contents + +* [Upgrading npm](#upgrading-npm) +* [Proxies and Networking](#proxy-and-networking-issues) +* [Cannot find module](#cannot-find-module) +* [Shasum Check Fails](#shasum-check-fails) +* [No Git](#no-git) + +## Upgrading npm + +Whenever you get npm errors, it's a good idea to first check your npm version and upgrade to latest whenever possible. We still see people running npm@1 (!) and in those cases, installing the latest version of npm usually solves the problem. + +You can check your npm version by running `npm -v`. + +### Steps to Fix +* Upgrading on \*nix (OSX, Linux, etc.) + +(You may need to prefix these commands with sudo, especially on Linux, or OS X if you installed Node using its default installer.) +You can upgrade to the latest version of npm using: +`npm install -g npm@latest` +Or upgrade to the most recent LTS release: +`npm install -g npm@lts` + +* Upgrading on Windows + +We have a [detailed guide](https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows) for upgrading on windows on our wiki. + +## Proxy and Networking Issues + +npm might not be able to connect to the registry for various reasons. Perhaps your machine is behind a firewall that needs to be opened, or you require a corporate proxy to access the npm registry. This issue can manifest in a wide number of different ways. Usually, strange network errors are an instance of this specific problem. + +Sometimes, users may have install failures due to Git/Github access issues. Git/GitHub access is separate from npm registry access. For users in some locations (India in particular), problems installing packages may be due to connectivity problems reaching GitHub and not the npm registry. + +If you believe your network is configured and working correctly, and you're still having problems installing, please let the [registry team](https://github.com/npm/registry/issues) know you're having trouble. + +### Steps to Fix + +0. Make sure you have a working internet connection. Can you reach https://registry.npmjs.org? Can you reach other sites? If other sites are unreachable, this is not a problem with npm. + +0. Check http://status.npmjs.org/ for any potential current service outages. + +0. If your company has a process for domain whitelisting for developers, make sure https://registry.npmjs.org is a whitelisted domain. + +0. If you're in China, consider using https://npm.taobao.org/ as a registry, which sits behind the Firewall. + +0. On Windows, npm does not access proxies configured at the system level, so you need to configure them manually in order for npm to access them. Make sure [you have added the appropriate proxy configuration to `.npmrc`](https://docs.npmjs.com/misc/config#https-proxy). + +0. If you already have a proxy configured, it might be configured incorrectly or use the wrong credentials. Verify your credentials, test the specific credentials with a separate application. + +0. The proxy itself, on the server, might also have a configuration error. In this case, you'll need to work with your system administrator to verify that the proxy, and HTTPS, are configured correctly. You may test it by running regular HTTPS requests. + +### Example Errors + +This error can manifest in a wide range of different ways: + +``` +npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE +npm ERR! unable to verify the first certificate +``` +``` +npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY +npm ERR! unable to get local issuer certificate +``` +``` +npm ERR! code DEPTH_ZERO_SELF_SIGNED_CERT +npm ERR! self signed certificate +``` +``` +124 error code ECONNREFUSED +125 error errno ECONNREFUSED +126 error syscall connect +``` +``` +136 error Unexpected token < +136 error +136 error +136 error ERROR: Cache Access Denied +``` +``` +31 verbose stack Error: connect ETIMEDOUT 123.123.123.123:443 +``` +``` +108 error code EAI_AGAIN +109 error errno EAI_AGAIN +110 error syscall getaddrinfo +111 error getaddrinfo EAI_AGAIN proxy.yourcorp.com:811 +``` +``` +npm ERR! Error: getaddrinfo ESRCH +npm ERR! at errnoException (dns.js:37:11) +npm ERR! at Object.onanswer as oncomplete +``` +``` +35 error Unexpected token u +35 error function FindProxyForURL(url, host) { +``` + +### Related issues +* [#14318](https://github.com/npm/npm/issues/14318) +* [#15059](https://github.com/npm/npm/issues/15059) +* [#14336](https://github.com/npm/npm/issues/14336) + +## Cannot find module + +If *when running npm* (not your application), you get an error about a module not being found, this almost certainly means that there's something wrong with your npm installation. + +If this happens when trying to start your application, you might not have installed your package's dependencies yet. + +### Steps to Fix + +0. If this happens when you try to start your application, try running `npm install` to install the app's dependencies. Make sure all its actual dependencies are listed in `package.json` + +0. If this happens on any npm command, please reinstall. + +### Examples + +``` +module.js:338 + throw err; + ^ +Error: Cannot find module +``` +### Related Issues + +* [#14699](https://github.com/npm/npm/issues/14699) + +## Shasum Check Fails + +This is a common issue which used to be caused by caching issues. Nowadays, the cache has been improved, so it's likely to be an install issue, which can be caused by network problems (sometimes even [proxy issues](#proxy-and-networking-issues)), a node bug, or possibly some sort of npm bug. + +### Steps to Fix + +0. Try running `npm install` again. It may have been a momentary hiccup or corruption during package download. + +0. Check http://status.npmjs.org/ for any potential current service outages. + +0. If the shasum error specifically has `Actual: da39a3ee5e6b4b0d3255bfef95601890afd80709`, with this exact shasum, it means the package download was empty, which is certainly a networking issue. + +0. Make sure your [network connection and proxy settings](#proxy-and-networking-issues) are ok. + +0. Update your node version to the latest stable version. + +### Examples + +``` +npm ERR! shasum check failed for C:\Users\some-user\AppData\Local\Temp\npm-9356-7 +d74e411\registry.npmjs.org\some-package\-\some-package-1.0.0.tgz +npm ERR! Expected: 652294c14651db29fa93bd2d5ff2983a4f08c636 +npm ERR! Actual: c45474b40e6a7474633ec6f2b0315feaf15c61f2 +npm ERR! From: https://registry.npmjs.org/some-package/-/some-package-1.0.0.tgz +``` + +### Related Issues +* [#14720](https://github.com/npm/npm/issues/14720) +* [#13405](https://github.com/npm/npm/issues/13405) + +## No Git +If your install fails and you see a message saying you don't have git installed, it should be resolved by installing git. + +### Steps to Fix + +0. [Install git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) following the instructions for your machine. + +### Examples + +npm ERR! not found: git +ENOGIT + +### Related Issues + +* [#11095](https://github.com/npm/npm/issues/11095) diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js index 8c8fa8031e..14937d64f2 100755 --- a/deps/npm/bin/npm-cli.js +++ b/deps/npm/bin/npm-cli.js @@ -25,10 +25,17 @@ unsupported.checkForUnsupportedNode() + if (!unsupported.checkVersion(process.version).unsupported) { + var updater = require('update-notifier') + var pkg = require('../package.json') + updater({pkg: pkg}).notify({defer: true}) + } + var path = require('path') var npm = require('../lib/npm.js') var npmconf = require('../lib/config/core.js') var errorHandler = require('../lib/utils/error-handler.js') + var output = require('../lib/utils/output.js') var configDefs = npmconf.defs var shorthands = configDefs.shorthands @@ -74,6 +81,12 @@ conf._exit = true npm.load(conf, function (er) { if (er) return errorHandler(er) - npm.commands[npm.command](npm.argv, errorHandler) + npm.commands[npm.command](npm.argv, function (err) { + // https://www.youtube.com/watch?v=7nfPu8qTiQU + if (!err && npm.config.get('ham-it-up')) { + output('\n 🎵 I Have the Honour to Be Your Obedient Servant,🎵 ~ npm 📜🖋\n') + } + errorHandler.apply(this, arguments) + }) }) })() diff --git a/deps/npm/doc/cli/npm-adduser.md b/deps/npm/doc/cli/npm-adduser.md index 5a53bdd8e2..72433e00f7 100644 --- a/deps/npm/doc/cli/npm-adduser.md +++ b/deps/npm/doc/cli/npm-adduser.md @@ -3,7 +3,7 @@ npm-adduser(1) -- Add a registry user account ## SYNOPSIS - npm adduser [--registry=url] [--scope=@orgname] [--always-auth] + npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy] aliases: login, add-user @@ -66,6 +66,15 @@ different hostnames. See `always-auth` in `npm-config(7)` for more details on always-auth. Registry-specific configuration of `always-auth` takes precedence over any global configuration. +### auth-type + +* Default: `'legacy'` +* Type: `'legacy'`, `'sso'`, `'saml'`, `'oauth'` + +What authentication strategy to use with `adduser`/`login`. Some npm registries +(for example, npmE) might support alternative auth strategies besides classic +username/password entry in legacy npm. + ## SEE ALSO * npm-registry(7) diff --git a/deps/npm/doc/cli/npm-unpublish.md b/deps/npm/doc/cli/npm-unpublish.md index 0a5731ee1d..8ee07dfd81 100644 --- a/deps/npm/doc/cli/npm-unpublish.md +++ b/deps/npm/doc/cli/npm-unpublish.md @@ -27,6 +27,11 @@ 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. +With the default registry (`registry.npmjs.org`), unpublish is +only allowed with versions published in the last 24 hours. If you +are trying to unpublish a version published longer ago than that, +contact support@npmjs.com. + The scope is optional and follows the usual rules for `npm-scope(7)`. ## SEE ALSO diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index cafbedf532..463e6f192f 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -137,6 +137,13 @@ even for `GET` requests. When "dev" or "development" and running local `npm shrinkwrap`, `npm outdated`, or `npm update`, is an alias for `--dev`. +### auth-type + +* Default: `'legacy'` +* Type: `'legacy'`, `'sso'`, `'saml'`, `'oauth'` + +What authentication strategy to use with `adduser`/`login`. + ### bin-links * Default: `true` @@ -609,7 +616,7 @@ Any "%s" in the message will be replaced with the version number. ### metrics-registry -* Default: "https://registry.npmjs.org/" +* Default: The value of `registry` (which defaults to "https://registry.npmjs.org/") * Type: String The registry you want to send cli metrics to if `send-metrics` is true. @@ -904,6 +911,21 @@ using `-s` to add a signature. Note that git requires you to have set up GPG keys in your git configs for this to work properly. +### sso-poll-frequency + +* Default: 500 +* Type: Number + +When used with SSO-enabled `auth-type`s, configures how regularly the registry +should be polled while the user is completing authentication. + +### sso-type + +* Default: 'oauth' +* Type: 'oauth', 'saml', or null + +If `--auth-type=sso`, the type of SSO type to use. + ### strict-ssl * Default: true diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index c471072b8c..d735088d47 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -62,7 +62,7 @@ experience if you run a recent version of npm. To upgrade, either use download a new version of Node, or follow the Windows upgrade instructions in the -npm Troubleshooting Guide.

+npm Troubleshooting Guide.

If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly.

Installing on Cygwin

@@ -126,5 +126,5 @@ will no doubt tell you to put the output in a gist or email.

       - + diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index 178d8d462d..31fee57e6e 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -84,5 +84,5 @@ with an HTTP 402 status code (logically enough), unless you use        - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index 381f351296..5870752a62 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -11,7 +11,7 @@

npm-adduser

Add a registry user account

SYNOPSIS

-
npm adduser [--registry=url] [--scope=@orgname] [--always-auth]
+
npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy]
 
 aliases: login, add-user
 

DESCRIPTION

@@ -52,6 +52,14 @@ private registries where metadata and package tarballs are stored on hosts with different hostnames. See always-auth in npm-config(7) for more details on always-auth. Registry-specific configuration of always-auth takes precedence over any global configuration.

+

auth-type

+
    +
  • Default: 'legacy'
  • +
  • Type: 'legacy', 'sso', 'saml', 'oauth'
  • +
+

What authentication strategy to use with adduser/login. Some npm registries +(for example, npmE) might support alternative auth strategies besides classic +username/password entry in legacy npm.

SEE ALSO

  • npm-registry(7)
  • @@ -73,5 +81,5 @@ over any global configuration.

           - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 2eec18bdd3..195a104ea0 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -35,5 +35,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 41f5d9b2cf..f0dbb42cd5 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -55,5 +55,5 @@ a package.json in the current folder and use the name        - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index e78f351dec..56819cfee6 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -40,5 +40,5 @@ directly, run:

           - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index c45d3b09af..fb949b64fe 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@ install packages into the local space.

           - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index 0aed55fca5..3d9b2cb087 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -82,5 +82,5 @@ they do not make an HTTP request to the registry.

           - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index d6f553a453..4e409caffe 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -43,5 +43,5 @@ completions based on the arguments.

           - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index 2aa0f880ac..ac198d75ab 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -67,5 +67,5 @@ global config.

           - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index e1ca0d1628..633430e48f 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -61,5 +61,5 @@ result in new modules being installed.

           - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 557e12086b..294cce0666 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -38,5 +38,5 @@ something like this:

           - + diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html index 68aabf0fdd..6273b95542 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -86,5 +86,5 @@ begin with a number or the letter v.

           - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index c15d6b3ceb..48b0fef0df 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -56,5 +56,5 @@ the current folder and use the name property.

           - + diff --git a/deps/npm/html/doc/cli/npm-doctor.html b/deps/npm/html/doc/cli/npm-doctor.html index f5cce1cf98..28d409b32e 100644 --- a/deps/npm/html/doc/cli/npm-doctor.html +++ b/deps/npm/html/doc/cli/npm-doctor.html @@ -103,4 +103,4 @@ cache, you should probably run npm cache clean and reset the cache.        - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 0d8732ce7a..0954d6417a 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -49,5 +49,5 @@ or "notepad" on Windows.        - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 62acbee3fb..077d6f6b3b 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -49,5 +49,5 @@ Windows        - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index 733d715651..97a92627bb 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -45,5 +45,5 @@ where the terms were found in the documentation.

           - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 722a9e45e7..8ab25aef3b 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -50,5 +50,5 @@ matches are equivalent to specifying a topic name.

           - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index 1569d2b75f..367621b5cd 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -48,5 +48,5 @@ defaults and not prompt you for any options.

           - + diff --git a/deps/npm/html/doc/cli/npm-install-test.html b/deps/npm/html/doc/cli/npm-install-test.html index 1939b4e584..978dcda9a7 100644 --- a/deps/npm/html/doc/cli/npm-install-test.html +++ b/deps/npm/html/doc/cli/npm-install-test.html @@ -42,5 +42,5 @@ takes exactly the same arguments as npm install.

           - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 20e5a75a3f..3158830410 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -316,5 +316,5 @@ affects a real use-case, it will be investigated.

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index befca7eac9..fae09d4227 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -74,5 +74,5 @@ include that scope, e.g.

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index f7e890c480..2c735288d8 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -51,5 +51,5 @@ it takes precedence.

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index 5293f35ef3..528bd80bdd 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -21,7 +21,7 @@ installed, as well as their dependencies, in a tree-structure.

    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@4.2.0 /path/to/npm
    +
    npm@4.5.0 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     

    It will print out extraneous, missing, and invalid packages.

    @@ -104,5 +104,5 @@ project.

           - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index de59123cff..5edd415e71 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -116,5 +116,5 @@ project.

           - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index b1270f7a7f..5e422e34d5 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -51,5 +51,5 @@ that is not implemented at this time.

           - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index d74b2defb8..8443721fe9 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -41,5 +41,5 @@ overwritten the second time.

           - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index 3c4ff700fe..300e7f294f 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -32,5 +32,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index ba0ddb1281..7b2520e074 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -38,5 +38,5 @@ to contain a package.json file unless -g is also specified.

           - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index 60b5c173cd..7aea579d70 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -40,5 +40,5 @@ negate NODE_ENV being set to production.

           - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index 3f137577f9..1ec867fb80 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -76,5 +76,5 @@ packs them into a tarball to be uploaded to the registry.

           - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index c4174bf810..c3d5e6b702 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -35,5 +35,5 @@ the new binary.

           - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index ad2adc5513..26fc99c11e 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -41,5 +41,5 @@ a package.json in the current folder and use the name        - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 4e085fd070..2117ccd522 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -53,5 +53,5 @@ behavior will be accompanied by an increase in major version number

           - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index 6bc996a3b0..d90558dc69 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -35,5 +35,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index c1221878f6..ab33c6e393 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -66,5 +66,5 @@ you will be given a warning to run npm install, just in case you        - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 7b142d53fe..33c102506e 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -109,5 +109,5 @@ setting.

           - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 3c3edc39bf..ba9b4b59cf 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -180,5 +180,5 @@ contents rather than versions.

           - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index a29e01f68b..39ddbf2d7c 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -36,5 +36,5 @@ a vaguely positive way to show that you care.

           - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index e528841db2..d461a3cca2 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -36,5 +36,5 @@ you will most certainly enjoy this command.

           - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index 7b0a14e6fe..dda116689c 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -39,5 +39,5 @@ more details.

           - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 780a232008..79186a5c9e 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -34,5 +34,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index 0cb0689e7d..32515cd0c1 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -67,5 +67,5 @@ use the npm access command to grant or revoke the appropriate permi        - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index 4268691075..ee1585a3ee 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -36,5 +36,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index eda627104f..03f527a66d 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -60,5 +60,5 @@ npm uninstall dtrace-provider --save-optional        - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 296b5279ec..41b7649f74 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -26,6 +26,10 @@ the root package entry is removed from the registry entirely.

    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.

    +

    With the default registry (registry.npmjs.org), unpublish is +only allowed with versions published in the last 24 hours. If you +are trying to unpublish a version published longer ago than that, +contact support@npmjs.com.

    The scope is optional and follows the usual rules for npm-scope(7).

    SEE ALSO

      @@ -47,5 +51,5 @@ package again, a new version number must be used.

             - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index 805232b0d3..825af505d3 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -118,5 +118,5 @@ be downgraded.

             - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index c40e663293..04e25b6b3b 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -107,5 +107,5 @@ and tag up to the server, and deletes the build/temp directory.

             - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 1374740004..40461e1791 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -86,5 +86,5 @@ the field name.

             - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index ac8c1c6bc3..04182e9fcf 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -33,5 +33,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index e1e53c2018..81b42767e3 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -13,7 +13,7 @@

      SYNOPSIS

      npm <command> [args]
       

      VERSION

      -

      4.2.0

      +

      4.5.0

      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 @@ -126,7 +126,7 @@ will no doubt tell you to put the output in a gist or email.

      Isaac Z. Schlueter :: isaacs :: @izs :: -i@izs.me

      +i@izs.me

      SEE ALSO

      When "dev" or "development" and running local npm shrinkwrap, npm outdated, or npm update, is an alias for --dev.

      +

      auth-type

      +
        +
      • Default: 'legacy'
      • +
      • Type: 'legacy', 'sso', 'saml', 'oauth'
      • +
      +

      What authentication strategy to use with adduser/login.

      • Default: true
      • @@ -525,7 +531,7 @@ combination). Passed to the http Agent used to make th

        Any "%s" in the message will be replaced with the version number.

        metrics-registry

        The registry you want to send cli metrics to if send-metrics is true.

        @@ -774,6 +780,19 @@ installing.

        using -s to add a signature.

        Note that git requires you to have set up GPG keys in your git configs for this to work properly.

        +

        sso-poll-frequency

        +
          +
        • Default: 500
        • +
        • Type: Number
        • +
        +

        When used with SSO-enabled auth-types, configures how regularly the registry +should be polled while the user is completing authentication.

        +

        sso-type

        +
          +
        • Default: 'oauth'
        • +
        • Type: 'oauth', 'saml', or null
        • +
        +

        If --auth-type=sso, the type of SSO type to use.

        strict-ssl

        • Default: true
        • @@ -901,5 +920,5 @@ exit successfully.

                 - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 13b0c3d14f..24df9632e2 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -194,5 +194,5 @@ from a fresh checkout.

                 - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index 731f73ff1d..4d21dfc1f1 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -20,7 +20,7 @@ Conduct.

          TL;DR

          1. Get the author email with npm owner ls <pkgname>
          2. -
          3. Email the author, CC support@npmjs.com
          4. +
          5. Email the author, CC support@npmjs.com
          6. After a few weeks, if there's no resolution, we'll sort it out.

          Don't squat on package names. Publish code or move out of the way.

          @@ -55,12 +55,12 @@ because Yusuf's foo is in the way.

        • Alice emails Yusuf, explaining the situation as respectfully as possible, and what she would like to do with the module name. She adds the npm support -staff support@npmjs.com to the CC list of the email. Mention in the email +staff support@npmjs.com to the CC list of the email. Mention in the email that Yusuf can run npm owner add alice foo to add Alice as an owner of the foo package.
        • After a reasonable amount of time, if Yusuf has not responded, or if Yusuf and Alice can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks.)
        • REASONING

          @@ -96,12 +96,12 @@ application database or otherwise putting non-packagey things into it. Code of Conduct such as hateful language, pornographic content, or harassment. -

          If you see bad behavior like this, please report it to abuse@npmjs.com right +

          If you see bad behavior like this, please report it to abuse@npmjs.com right away. You are never expected to resolve abusive behavior on your own. We are here to help.

          TRADEMARKS

          If you think another npm publisher is infringing your trademark, such as by -using a confusingly similar package name, email abuse@npmjs.com with a link to +using a confusingly similar package name, email abuse@npmjs.com with a link to the package or user account on https://npmjs.com. Attach a copy of your trademark registration certificate.

          If we see that the package's publisher is intentionally misleading others by @@ -134,5 +134,5 @@ License.

                 - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index c3a177c3b0..23f111f8ef 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -162,5 +162,5 @@        - + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index 295839e289..93a6a4f1e9 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -86,5 +86,5 @@        - + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index 79eb492303..51182dede1 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -90,5 +90,5 @@ effectively implement the entire CouchDB API anyway.

                 - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index eab13e7beb..d0672ff6e7 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -99,5 +99,5 @@ that registry instead.

                 - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 3b37178494..461a8964a6 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -237,5 +237,5 @@ scripts is for compilation which must be done on the target architecture.        - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index aeaea468d1..d6cc76f23f 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -57,5 +57,5 @@ modules. To track those down, you can do the following:

                 - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index 48dee7d64b..1250143bf6 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -325,5 +325,5 @@ range, use the satisfies(version, range) function.

                 - + diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index 7f3975175a..0aac6b7fbb 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -2,11 +2,7 @@ module.exports = adduser var log = require('npmlog') var npm = require('./npm.js') -var read = require('read') -var userValidate = require('npm-user-validate') -var output = require('./utils/output') var usage = require('./utils/usage') -var chain = require('slide').chain var crypto try { @@ -15,7 +11,7 @@ try { adduser.usage = usage( 'adduser', - 'npm adduser [--registry=url] [--scope=@orgname] [--always-auth]' + 'npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] [--always-auth]' ) function adduser (args, cb) { @@ -25,154 +21,29 @@ function adduser (args, cb) { )) } - var creds = npm.config.getCredentialsByURI(npm.config.get('registry')) - var c = { - u: creds.username || '', - p: creds.password || '', - e: creds.email || '' - } - var u = {} - - log.disableProgress() - chain([ - [readUsername, c, u], - [readPassword, c, u], - [readEmail, c, u], - [save, c, u] - ], cb) -} - -function readUsername (c, u, cb) { - var v = userValidate.username - read({prompt: 'Username: ', default: c.u || ''}, function (er, un) { - if (er) { - return cb(er.message === 'cancelled' ? er.message : er) - } - - // make sure it's valid. we have to do this here, because - // couchdb will only ever say "bad password" with a 401 when - // you try to PUT a _users record that the validate_doc_update - // rejects for *any* reason. - - if (!un) { - return readUsername(c, u, cb) - } - - var error = v(un) - if (error) { - log.warn(error.message) - return readUsername(c, u, cb) - } - - c.changed = c.u !== un - u.u = un - cb(er) - }) -} - -function readPassword (c, u, cb) { - var v = userValidate.pw - - var prompt - if (c.p && !c.changed) { - prompt = 'Password: (or leave unchanged) ' - } else { - prompt = 'Password: ' - } - - read({prompt: prompt, silent: true}, function (er, pw) { - if (er) { - return cb(er.message === 'cancelled' ? er.message : er) - } - - if (!c.changed && pw === '') { - // when the username was not changed, - // empty response means "use the old value" - pw = c.p - } - - if (!pw) { - return readPassword(c, u, cb) - } - - var error = v(pw) - if (error) { - log.warn(error.message) - return readPassword(c, u, cb) - } - - c.changed = c.changed || c.p !== pw - u.p = pw - cb(er) - }) -} - -function readEmail (c, u, cb) { - var v = userValidate.email - var r = { prompt: 'Email: (this IS public) ', default: c.e || '' } - read(r, function (er, em) { - if (er) { - return cb(er.message === 'cancelled' ? er.message : er) - } - - if (!em) { - return readEmail(c, u, cb) - } - - var error = v(em) - if (error) { - log.warn(error.message) - return readEmail(c, u, cb) - } - - u.e = em - cb(er) - }) -} - -function save (c, u, cb) { - // save existing configs, but yank off for this PUT - var uri = npm.config.get('registry') + var registry = npm.config.get('registry') var scope = npm.config.get('scope') + var creds = npm.config.getCredentialsByURI(npm.config.get('registry')) - // there may be a saved scope and no --registry (for login) if (scope) { var scopedRegistry = npm.config.get(scope + ':registry') var cliRegistry = npm.config.get('registry', 'cli') - if (scopedRegistry && !cliRegistry) uri = scopedRegistry - } - - var params = { - auth: { - username: u.u, - password: u.p, - email: u.e - } + if (scopedRegistry && !cliRegistry) registry = scopedRegistry } - npm.registry.adduser(uri, params, function (er, doc) { - if (er) return cb(er) - - // don't want this polluting the configuration - npm.config.del('_token', 'user') - if (scope) npm.config.set(scope + ':registry', uri, 'user') + log.disableProgress() - if (doc && doc.token) { - npm.config.setCredentialsByURI(uri, { - token: doc.token - }) - } else { - npm.config.setCredentialsByURI(uri, { - username: u.u, - password: u.p, - email: u.e, - alwaysAuth: npm.config.get('always-auth') - }) - } + try { + var auth = require('./auth/' + npm.config.get('auth-type')) + } catch (e) { + return cb(new Error('no such auth module')) + } + auth.login(creds, registry, scope, function (err, newCreds) { + if (err) return cb(err) - log.info('adduser', 'Authorized user %s', u.u) - var scopeMessage = scope ? ' to scope ' + scope : '' - output('Logged in as %s%s on %s.', u.u, scopeMessage, uri) + npm.config.del('_token', 'user') // prevent legacy pollution + if (scope) npm.config.set(scope + ':registry', registry, 'user') + npm.config.setCredentialsByURI(registry, newCreds) npm.config.save('user', cb) }) } diff --git a/deps/npm/lib/auth/legacy.js b/deps/npm/lib/auth/legacy.js new file mode 100644 index 0000000000..2fa4a26e35 --- /dev/null +++ b/deps/npm/lib/auth/legacy.js @@ -0,0 +1,142 @@ +var log = require('npmlog') +var npm = require('../npm.js') +var read = require('read') +var userValidate = require('npm-user-validate') +var output = require('../utils/output') +var chain = require('slide').chain + +module.exports.login = function login (creds, registry, scope, cb) { + var c = { + u: creds.username || '', + p: creds.password || '', + e: creds.email || '' + } + var u = {} + + chain([ + [readUsername, c, u], + [readPassword, c, u], + [readEmail, c, u], + [save, c, u, registry, scope] + ], function (err, res) { + cb(err, res && res[res.length - 1]) + }) +} + +function readUsername (c, u, cb) { + var v = userValidate.username + read({prompt: 'Username: ', default: c.u || ''}, function (er, un) { + if (er) { + return cb(er.message === 'cancelled' ? er.message : er) + } + + // make sure it's valid. we have to do this here, because + // couchdb will only ever say "bad password" with a 401 when + // you try to PUT a _users record that the validate_doc_update + // rejects for *any* reason. + + if (!un) { + return readUsername(c, u, cb) + } + + var error = v(un) + if (error) { + log.warn(error.message) + return readUsername(c, u, cb) + } + + c.changed = c.u !== un + u.u = un + cb(er) + }) +} + +function readPassword (c, u, cb) { + var v = userValidate.pw + + var prompt + if (c.p && !c.changed) { + prompt = 'Password: (or leave unchanged) ' + } else { + prompt = 'Password: ' + } + + read({prompt: prompt, silent: true}, function (er, pw) { + if (er) { + return cb(er.message === 'cancelled' ? er.message : er) + } + + if (!c.changed && pw === '') { + // when the username was not changed, + // empty response means "use the old value" + pw = c.p + } + + if (!pw) { + return readPassword(c, u, cb) + } + + var error = v(pw) + if (error) { + log.warn(error.message) + return readPassword(c, u, cb) + } + + c.changed = c.changed || c.p !== pw + u.p = pw + cb(er) + }) +} + +function readEmail (c, u, cb) { + var v = userValidate.email + var r = { prompt: 'Email: (this IS public) ', default: c.e || '' } + read(r, function (er, em) { + if (er) { + return cb(er.message === 'cancelled' ? er.message : er) + } + + if (!em) { + return readEmail(c, u, cb) + } + + var error = v(em) + if (error) { + log.warn(error.message) + return readEmail(c, u, cb) + } + + u.e = em + cb(er) + }) +} + +function save (c, u, registry, scope, cb) { + var params = { + auth: { + username: u.u, + password: u.p, + email: u.e + } + } + npm.registry.adduser(registry, params, function (er, doc) { + if (er) return cb(er) + + var newCreds = (doc && doc.token) + ? { + token: doc.token + } + : { + username: u.u, + password: u.p, + email: u.e, + alwaysAuth: npm.config.get('always-auth') + } + + log.info('adduser', 'Authorized user %s', u.u) + var scopeMessage = scope ? ' to scope ' + scope : '' + output('Logged in as %s%s on %s.', u.u, scopeMessage, registry) + + cb(null, newCreds) + }) +} diff --git a/deps/npm/lib/auth/oauth.js b/deps/npm/lib/auth/oauth.js new file mode 100644 index 0000000000..1cb3ffec6f --- /dev/null +++ b/deps/npm/lib/auth/oauth.js @@ -0,0 +1,7 @@ +var ssoAuth = require('./sso') +var npm = require('../npm') + +module.exports.login = function login () { + npm.config.set('sso-type', 'oauth') + ssoAuth.login.apply(this, arguments) +} diff --git a/deps/npm/lib/auth/saml.js b/deps/npm/lib/auth/saml.js new file mode 100644 index 0000000000..ae92ea5bbf --- /dev/null +++ b/deps/npm/lib/auth/saml.js @@ -0,0 +1,7 @@ +var ssoAuth = require('./sso') +var npm = require('../npm') + +module.exports.login = function login () { + npm.config.set('sso-type', 'saml') + ssoAuth.login.apply(this, arguments) +} diff --git a/deps/npm/lib/auth/sso.js b/deps/npm/lib/auth/sso.js new file mode 100644 index 0000000000..faffe2fa59 --- /dev/null +++ b/deps/npm/lib/auth/sso.js @@ -0,0 +1,59 @@ +var log = require('npmlog') +var npm = require('../npm.js') +var output = require('../utils/output') +var opener = require('opener') + +module.exports.login = function login (creds, registry, scope, cb) { + var ssoType = npm.config.get('sso-type') + if (!ssoType) { return cb(new Error('Missing option: sso-type')) } + + var params = { + // We're reusing the legacy login endpoint, so we need some dummy + // stuff here to pass validation. They're never used. + auth: { + username: 'npm_' + ssoType + '_auth_dummy_user', + password: 'placeholder', + email: 'support@npmjs.com', + authType: ssoType + } + } + npm.registry.adduser(registry, params, function (er, doc) { + if (er) return cb(er) + if (!doc || !doc.token) return cb(new Error('no SSO token returned')) + if (!doc.sso) return cb(new Error('no SSO URL returned by services')) + + output('If your browser doesn\'t open, visit ' + + doc.sso + + ' to complete authentication') + opener(doc.sso, { command: npm.config.get('browser') }, function () { + pollForSession(registry, doc.token, function (err, username) { + if (err) return cb(err) + + log.info('adduser', 'Authorized user %s', username) + var scopeMessage = scope ? ' to scope ' + scope : '' + output('Logged in as %s%s on %s.', username, scopeMessage, registry) + + cb(null, { token: doc.token }) + }) + }) + }) +} + +function pollForSession (registry, token, cb) { + log.info('adduser', 'Polling for validated SSO session') + npm.registry.whoami(registry, { + auth: { + token: token + } + }, function (er, username) { + if (er && er.statusCode !== 401) { + cb(er) + } else if (!username) { + setTimeout(function () { + pollForSession(registry, token, cb) + }, npm.config.get('sso-poll-frequency')) + } else { + cb(null, username) + } + }) +} diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index 003ce7f8cb..5f166c33f6 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -19,7 +19,7 @@ bugs.completion = function (opts, cb) { function bugs (args, cb) { var n = args.length ? args[0] : '.' - fetchPackageMetadata(n, '.', function (er, d) { + fetchPackageMetadata(n, '.', {fullMetadata: true}, function (er, d) { if (er) return cb(er) var url = d.bugs && ((typeof d.bugs === 'string') ? d.bugs : d.bugs.url) diff --git a/deps/npm/lib/config/core.js b/deps/npm/lib/config/core.js index b833b75409..15a1674b3d 100644 --- a/deps/npm/lib/config/core.js +++ b/deps/npm/lib/config/core.js @@ -208,7 +208,7 @@ inherits(Conf, CC) function Conf (base) { if (!(this instanceof Conf)) return new Conf(base) - CC.apply(this) + CC.call(this) if (base) { if (base instanceof Conf) { diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js index a79c8a0fa0..96499d1718 100644 --- a/deps/npm/lib/config/defaults.js +++ b/deps/npm/lib/config/defaults.js @@ -108,6 +108,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { access: null, 'always-auth': false, also: null, + 'auth-type': 'legacy', 'bin-links': true, browser: null, @@ -148,6 +149,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { 'global-style': false, group: process.platform === 'win32' ? 0 : process.env.SUDO_GID || (process.getgid && process.getgid()), + 'ham-it-up': false, heading: 'npm', 'if-present': false, 'ignore-scripts': false, @@ -168,7 +170,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { long: false, maxsockets: 50, message: '%s', - 'metrics-registry': 'https://registry.npmjs.org/', + 'metrics-registry': null, 'node-version': process.version, 'onload-script': false, only: null, @@ -203,6 +205,8 @@ Object.defineProperty(exports, 'defaults', {get: function () { shell: osenv.shell(), shrinkwrap: true, 'sign-git-tag': false, + 'sso-poll-frequency': 500, + 'sso-type': 'oauth', 'strict-ssl': true, tag: 'latest', 'tag-version-prefix': 'v', @@ -231,6 +235,7 @@ exports.types = { access: [null, 'restricted', 'public'], 'always-auth': Boolean, also: [null, 'dev', 'development'], + 'auth-type': ['legacy', 'sso', 'saml', 'oauth'], 'bin-links': Boolean, browser: [null, String], ca: [null, String, Array], @@ -262,6 +267,7 @@ exports.types = { group: [Number, String], 'https-proxy': [null, url], 'user-agent': String, + 'ham-it-up': Boolean, 'heading': String, 'if-present': Boolean, 'ignore-scripts': Boolean, @@ -284,7 +290,7 @@ exports.types = { long: Boolean, maxsockets: Number, message: String, - 'metrics-registry': String, + 'metrics-registry': [null, String], 'node-version': [null, semver], 'onload-script': [null, String], only: [null, 'dev', 'development', 'prod', 'production'], @@ -314,6 +320,8 @@ exports.types = { shell: String, shrinkwrap: Boolean, 'sign-git-tag': Boolean, + 'sso-poll-frequency': Number, + 'sso-type': [null, 'oauth', 'saml'], 'strict-ssl': Boolean, tag: String, tmp: path, diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index 19dcce163c..2248702a46 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -33,7 +33,7 @@ function docs (args, cb) { function getDoc (project, cb) { log.silly('getDoc', project) - fetchPackageMetadata(project, '.', function (er, d) { + fetchPackageMetadata(project, '.', {fullMetadata: true}, function (er, d) { if (er) return cb(er) var url = d.homepage if (!url) url = 'https://www.npmjs.org/package/' + d.name diff --git a/deps/npm/lib/doctor/check-files-permission.js b/deps/npm/lib/doctor/check-files-permission.js index ac3bb40bc6..74393596f6 100644 --- a/deps/npm/lib/doctor/check-files-permission.js +++ b/deps/npm/lib/doctor/check-files-permission.js @@ -34,7 +34,7 @@ function checkFilesPermission (root, mask, cb) { function checkFile (f, next) { var file = path.join(root, f) tracker.silly('checkFilePermissions', f) - fs.stat(file, function (e, stat) { + fs.lstat(file, function (e, stat) { tracker.completeWork(1) if (e) return next(e) if (!stat.isFile()) return next() diff --git a/deps/npm/lib/doctor/get-latest-npm-version.js b/deps/npm/lib/doctor/get-latest-npm-version.js index 4df0fee0fa..aba9b773cd 100644 --- a/deps/npm/lib/doctor/get-latest-npm-version.js +++ b/deps/npm/lib/doctor/get-latest-npm-version.js @@ -4,7 +4,7 @@ var fetchPackageMetadata = require('../fetch-package-metadata') function getLatestNpmVersion (cb) { var tracker = log.newItem('getLatestNpmVersion', 1) tracker.info('getLatestNpmVersion', 'Getting npm package information') - fetchPackageMetadata('npm@latest', '.', function (e, d) { + fetchPackageMetadata('npm@latest', '.', {fullMetadata: true}, function (e, d) { tracker.finish() cb(e, d.version) }) diff --git a/deps/npm/lib/fetch-package-metadata.js b/deps/npm/lib/fetch-package-metadata.js index bd6e47e17c..ae22004e5b 100644 --- a/deps/npm/lib/fetch-package-metadata.js +++ b/deps/npm/lib/fetch-package-metadata.js @@ -16,6 +16,7 @@ var clone = require('lodash.clonedeep') var validate = require('aproba') var unpipe = require('unpipe') var normalizePackageData = require('normalize-package-data') +var limit = require('call-limit') var npm = require('./npm.js') var mapToRegistry = require('./utils/map-to-registry.js') @@ -39,12 +40,16 @@ function andLogAndFinish (spec, tracker, done) { } } -module.exports = function fetchPackageMetadata (spec, where, tracker, done) { +module.exports = limit(fetchPackageMetadata, npm.limit.fetch) + +function fetchPackageMetadata (spec, where, opts, done) { + validate('SSOF|SSFZ|OSOF|OSFZ', [spec, where, opts, done]) + if (!done) { - done = tracker || where - tracker = null - if (done === where) where = null + done = opts + opts = {} } + var tracker = opts.tracker if (typeof spec === 'object') { var dep = spec spec = dep.raw @@ -53,11 +58,11 @@ module.exports = function fetchPackageMetadata (spec, where, tracker, done) { if (!dep) { log.silly('fetchPackageMetaData', spec) return realizePackageSpecifier(spec, where, iferr(logAndFinish, function (dep) { - fetchPackageMetadata(dep, where, tracker, done) + fetchPackageMetadata(dep, where, {tracker: tracker}, done) })) } if (dep.type === 'version' || dep.type === 'range' || dep.type === 'tag') { - fetchNamedPackageData(dep, addRequestedAndFinish) + fetchNamedPackageData(dep, opts, addRequestedAndFinish) } else if (dep.type === 'directory') { fetchDirectoryPackageData(dep, where, addRequestedAndFinish) } else { @@ -105,14 +110,15 @@ function fetchDirectoryPackageData (dep, where, next) { var regCache = {} -function fetchNamedPackageData (dep, next) { - validate('OF', arguments) +function fetchNamedPackageData (dep, opts, next) { + validate('OOF', arguments) log.silly('fetchNamedPackageData', dep.name || dep.rawSpec) mapToRegistry(dep.name || dep.rawSpec, npm.config, iferr(next, function (url, auth) { if (regCache[url]) { pickVersionFromRegistryDocument(clone(regCache[url])) } else { - npm.registry.get(url, {auth: auth}, pulseTillDone('fetchMetadata', iferr(next, pickVersionFromRegistryDocument))) + var fullMetadata = opts.fullMetadata == null ? true : opts.fullMetadata + npm.registry.get(url, {auth: auth, fullMetadata: fullMetadata}, pulseTillDone('fetchMetadata', iferr(next, pickVersionFromRegistryDocument))) } function thenAddMetadata (pkg) { pkg._from = dep.raw @@ -180,6 +186,10 @@ function retryWithCached (pkg, asserter, next) { module.exports.addShrinkwrap = function addShrinkwrap (pkg, next) { validate('OF', arguments) if (pkg._shrinkwrap !== undefined) return next(null, pkg) + if (pkg._hasShrinkwrap === false) { + pkg._shrinkwrap = null + return next(null, pkg) + } if (retryWithCached(pkg, addShrinkwrap, next)) return pkg._shrinkwrap = null // FIXME: cache the shrinkwrap directly diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 1b0601d9f4..43ba436630 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -508,7 +508,7 @@ Installer.prototype.rollbackFailedOptional = function (staging, actionsToRun, cb }).filter(function (pkg) { return pkg.failed && pkg.rollback }) - var top = this.currentTree.path + var top = this.currentTree && this.currentTree.path asyncMap(failed, function (pkg, next) { asyncMap(pkg.rollback, function (rollback, done) { rollback(top, staging, pkg, done) diff --git a/deps/npm/lib/install/action/extract.js b/deps/npm/lib/install/action/extract.js index 2c8a995af6..fd9562c184 100644 --- a/deps/npm/lib/install/action/extract.js +++ b/deps/npm/lib/install/action/extract.js @@ -3,7 +3,8 @@ var path = require('path') var iferr = require('iferr') var asyncMap = require('slide').asyncMap var fs = require('graceful-fs') -var rename = require('../../utils/rename.js') +var mkdirp = require('mkdirp') +var move = require('../../utils/move.js') var gentlyRm = require('../../utils/gently-rm.js') var updatePackageJson = require('../update-package-json') var npm = require('../../npm.js') @@ -11,6 +12,7 @@ var moduleName = require('../../utils/module-name.js') var packageId = require('../../utils/package-id.js') var cache = require('../../cache.js') var moduleStagingPath = require('../module-staging-path.js') +var readPackageJson = require('read-package-json') module.exports = function (staging, pkg, log, next) { log.silly('extract', packageId(pkg)) @@ -19,31 +21,45 @@ module.exports = function (staging, pkg, log, next) { var group = up ? null : npm.config.get('group') var extractTo = moduleStagingPath(staging, pkg) cache.unpack(pkg.package.name, pkg.package.version, extractTo, null, null, user, group, - andUpdatePackageJson(pkg, staging, extractTo, andStageBundledChildren(pkg, staging, extractTo, log, next))) + andUpdatePackageJson(pkg, staging, extractTo, + andStageBundledChildren(pkg, staging, extractTo, log, + andRemoveExtraneousBundles(extractTo, next)))) } function andUpdatePackageJson (pkg, staging, extractTo, next) { return iferr(next, function () { - updatePackageJson(pkg, extractTo, next) + readPackageJson(path.join(extractTo, 'package.json'), false, function (err, metadata) { + if (!err) { + // Copy _ keys (internal to npm) and any missing keys from the possibly incomplete + // registry metadata over to the full package metadata read off of disk. + Object.keys(pkg.package).forEach(function (key) { + if (key[0] === '_' || !(key in metadata)) metadata[key] = pkg.package[key] + }) + metadata.name = pkg.package.name // things go wrong if these don't match + pkg.package = metadata + } + updatePackageJson(pkg, extractTo, next) + }) }) } function andStageBundledChildren (pkg, staging, extractTo, log, next) { return iferr(next, function () { - for (var i = 0; i < pkg.children.length; ++i) { - var c = pkg.children[i] - if (!c.package.name) return next(c.error) - } + if (!pkg.package.bundleDependencies) return next() - asyncMap(pkg.children, andStageBundledModule(pkg, staging, extractTo), cleanupBundled) + asyncMap(pkg.children, andStageBundledModule(pkg, staging, extractTo), next) }) - function cleanupBundled () { +} + +function andRemoveExtraneousBundles (extractTo, next) { + return iferr(next, function () { gentlyRm(path.join(extractTo, 'node_modules'), next) - } + }) } function andStageBundledModule (bundler, staging, parentPath) { return function (child, next) { + if (child.error) return next(child.error) stageBundledModule(bundler, child, staging, parentPath, next) } } @@ -64,25 +80,36 @@ function stageBundledModule (bundler, child, staging, parentPath, next) { var stageFrom = path.join(parentPath, 'node_modules', child.package.name) var stageTo = moduleStagingPath(staging, child) - asyncMap(child.children, andStageBundledModule(bundler, staging, stageFrom), iferr(next, moveModule)) + return asyncMap(child.children, andStageBundledModule(bundler, staging, stageFrom), iferr(next, finishModule)) - function moveModule () { - if (child.fromBundle) { - return rename(stageFrom, stageTo, iferr(next, updateMovedPackageJson)) + function finishModule () { + // If we were the one's who bundled this module… + if (child.fromBundle === bundler) { + return moveModule() } else { - return fs.stat(stageFrom, function (notExists, exists) { - if (exists) { - warn(bundler, 'EBUNDLEOVERRIDE', 'In ' + packageId(bundler) + - ' replacing bundled version of ' + moduleName(child) + - ' with ' + packageId(child)) - return gentlyRm(stageFrom, next) - } else { - return next() - } - }) + return checkForReplacement() } } + function moveModule () { + return mkdirp(path.dirname(stageTo), iferr(next, function () { + return move(stageFrom, stageTo, iferr(next, updateMovedPackageJson)) + })) + } + + function checkForReplacement () { + return fs.stat(stageFrom, function (notExists, exists) { + if (exists) { + warn(bundler, 'EBUNDLEOVERRIDE', 'In ' + packageId(bundler) + + ' replacing bundled version of ' + moduleName(child) + + ' with ' + packageId(child)) + return gentlyRm(stageFrom, next) + } else { + return next() + } + }) + } + function updateMovedPackageJson () { updatePackageJson(child, stageTo, next) } diff --git a/deps/npm/lib/install/action/finalize.js b/deps/npm/lib/install/action/finalize.js index acc11cc4a7..03a71f4cc0 100644 --- a/deps/npm/lib/install/action/finalize.js +++ b/deps/npm/lib/install/action/finalize.js @@ -4,7 +4,7 @@ var rimraf = require('rimraf') var fs = require('graceful-fs') var mkdirp = require('mkdirp') var asyncMap = require('slide').asyncMap -var rename = require('../../utils/rename.js') +var move = require('../../utils/move.js') var gentlyRm = require('../../utils/gently-rm') var moduleStagingPath = require('../module-staging-path.js') @@ -26,31 +26,31 @@ module.exports = function (staging, pkg, log, next) { function destStatted (doesNotExist) { if (doesNotExist) { - rename(extractedTo, pkg.path, whenMoved) + move(extractedTo, pkg.path, whenMoved) } else { moveAway() } } - function whenMoved (renameEr) { - if (!renameEr) return next() - if (renameEr.code !== 'ENOTEMPTY') return next(renameEr) + function whenMoved (moveEr) { + if (!moveEr) return next() + if (moveEr.code !== 'ENOTEMPTY' && moveEr.code !== 'EEXIST') return next(moveEr) moveAway() } function moveAway () { - rename(pkg.path, delpath, whenOldMovedAway) + move(pkg.path, delpath, whenOldMovedAway) } - function whenOldMovedAway (renameEr) { - if (renameEr) return next(renameEr) - rename(extractedTo, pkg.path, whenConflictMoved) + function whenOldMovedAway (moveEr) { + if (moveEr) return next(moveEr) + move(extractedTo, pkg.path, whenConflictMoved) } - function whenConflictMoved (renameEr) { + function whenConflictMoved (moveEr) { // if we got an error we'll try to put back the original module back, // succeed or fail though we want the original error that caused this - if (renameEr) return rename(delpath, pkg.path, function () { next(renameEr) }) + if (moveEr) return move(delpath, pkg.path, function () { next(moveEr) }) fs.readdir(path.join(delpath, 'node_modules'), makeTarget) } @@ -65,7 +65,7 @@ module.exports = function (staging, pkg, log, next) { asyncMap(files, function (file, done) { var from = path.join(delpath, 'node_modules', file) var to = path.join(pkg.path, 'node_modules', file) - rename(from, to, done) + move(from, to, done) }, cleanup) } diff --git a/deps/npm/lib/install/action/move.js b/deps/npm/lib/install/action/move.js index 3f29379f2b..07649c3556 100644 --- a/deps/npm/lib/install/action/move.js +++ b/deps/npm/lib/install/action/move.js @@ -8,7 +8,7 @@ var mkdirp = require('mkdirp') var rmStuff = require('../../unbuild.js').rmStuff var lifecycle = require('../../utils/lifecycle.js') var updatePackageJson = require('../update-package-json.js') -var rename = require('../../utils/rename.js') +var move = require('../../utils/move.js') /* Move a module from one point in the node_modules tree to another. @@ -46,7 +46,7 @@ function moveModuleOnly (from, to, log, done) { log.silly('move', 'move existing destination node_modules away', toModules) - rename(toModules, tempToModules, removeDestination(done)) + move(toModules, tempToModules, removeDestination(done)) function removeDestination (next) { return function (er) { @@ -62,7 +62,7 @@ function moveModuleOnly (from, to, log, done) { function moveToModulesBack (next) { return function () { log.silly('move', 'move existing destination node_modules back', toModules) - rename(tempToModules, toModules, iferr(done, next)) + move(tempToModules, toModules, iferr(done, next)) } } @@ -76,14 +76,14 @@ function moveModuleOnly (from, to, log, done) { function moveNodeModules (next) { return function () { log.silly('move', 'move source node_modules away', fromModules) - rename(fromModules, tempFromModules, iferr(doMove(next), doMove(moveNodeModulesBack(next)))) + move(fromModules, tempFromModules, iferr(doMove(next), doMove(moveNodeModulesBack(next)))) } } function doMove (next) { return function () { log.silly('move', 'move module dir to final dest', from, to) - rename(from, to, iferr(done, next)) + move(from, to, iferr(done, next)) } } @@ -91,7 +91,7 @@ function moveModuleOnly (from, to, log, done) { return function () { mkdirp(from, iferr(done, function () { log.silly('move', 'put source node_modules back', fromModules) - rename(tempFromModules, fromModules, iferr(done, next)) + move(tempFromModules, fromModules, iferr(done, next)) })) } } diff --git a/deps/npm/lib/install/action/remove.js b/deps/npm/lib/install/action/remove.js index 47d5b766f7..9fe77c35e0 100644 --- a/deps/npm/lib/install/action/remove.js +++ b/deps/npm/lib/install/action/remove.js @@ -6,7 +6,7 @@ var asyncMap = require('slide').asyncMap var mkdirp = require('mkdirp') var npm = require('../../npm.js') var andIgnoreErrors = require('../and-ignore-errors.js') -var rename = require('../../utils/rename.js') +var move = require('../../utils/move.js') // This is weird because we want to remove the module but not it's node_modules folder // allowing for this allows us to not worry about the order of operations @@ -26,11 +26,11 @@ function removeLink (pkg, next) { function removeDir (pkg, log, next) { var modpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.MODULES') - rename(path.join(pkg.path, 'node_modules'), modpath, unbuildPackage) + move(path.join(pkg.path, 'node_modules'), modpath, unbuildPackage) - function unbuildPackage (renameEr) { + function unbuildPackage (moveEr) { npm.commands.unbuild(pkg.path, true, function () { - rimraf(pkg.path, renameEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack) + rimraf(pkg.path, moveEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack) }) } @@ -58,7 +58,7 @@ function removeDir (pkg, log, next) { var to = path.join(pkg.path, 'node_modules', file) // we ignore errors here, because they can legitimately happen, for instance, // bundled modules will be in both node_modules folders - rename(from, to, andIgnoreErrors(done)) + move(from, to, andIgnoreErrors(done)) }, cleanup) } diff --git a/deps/npm/lib/install/action/test.js b/deps/npm/lib/install/action/test.js deleted file mode 100644 index 29f26f3ecf..0000000000 --- a/deps/npm/lib/install/action/test.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict' -var lifecycle = require('../../utils/lifecycle.js') -var packageId = require('../../utils/package-id.js') - -module.exports = function (staging, pkg, log, next) { - log.silly('test', packageId(pkg)) - lifecycle(pkg.package, 'test', pkg.path, false, false, next) -} diff --git a/deps/npm/lib/install/actions.js b/deps/npm/lib/install/actions.js index 6e9c1a0b65..cb41217c02 100644 --- a/deps/npm/lib/install/actions.js +++ b/deps/npm/lib/install/actions.js @@ -2,7 +2,9 @@ var validate = require('aproba') var chain = require('slide').chain var asyncMap = require('slide').asyncMap +var limit = require('call-limit') var iferr = require('iferr') +var npm = require('../npm.js') var andFinishTracker = require('./and-finish-tracker.js') var andAddParentToErrors = require('./and-add-parent-to-errors.js') var failedDependency = require('./deps.js').failedDependency @@ -15,7 +17,6 @@ var actions = {} actions.fetch = require('./action/fetch.js') actions.extract = require('./action/extract.js') actions.build = require('./action/build.js') -actions.test = require('./action/test.js') actions.preinstall = require('./action/preinstall.js') actions.install = require('./action/install.js') actions.postinstall = require('./action/postinstall.js') @@ -32,7 +33,7 @@ actions['global-link'] = require('./action/global-link.js') Object.keys(actions).forEach(function (actionName) { var action = actions[actionName] - actions[actionName] = function (staging, pkg, log, next) { + actions[actionName] = limit(function (staging, pkg, log, next) { // top, buildpath, pkg, log validate('SOOF', arguments) // refuse to run actions for failed packages @@ -62,7 +63,7 @@ Object.keys(actions).forEach(function (actionName) { function andDone (cb) { return andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, cb))) } - } + }, npm.limit.action) }) function markAsFailed (pkg) { diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js index a31976a50d..d1feb6cd4b 100644 --- a/deps/npm/lib/install/deps.js +++ b/deps/npm/lib/install/deps.js @@ -462,7 +462,7 @@ function addDependency (name, versionSpec, tree, log, done) { } })) } else { - fetchPackageMetadata(req, packageRelativePath(tree), log.newItem('fetchMetadata'), iferr(next, function (pkg) { + fetchPackageMetadata(req, packageRelativePath(tree), {tracker: log.newItem('fetchMetadata')}, iferr(next, function (pkg) { resolveWithNewModule(pkg, tree, log, next) })) } @@ -547,7 +547,7 @@ function resolveWithNewModule (pkg, tree, log, next) { if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) if (hasBundled) { - inflateBundled(child, child.children) + inflateBundled(child, child, child.children) } if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { diff --git a/deps/npm/lib/install/inflate-bundled.js b/deps/npm/lib/install/inflate-bundled.js index f91e9112b9..5694841290 100644 --- a/deps/npm/lib/install/inflate-bundled.js +++ b/deps/npm/lib/install/inflate-bundled.js @@ -3,15 +3,15 @@ var validate = require('aproba') var childPath = require('../utils/child-path.js') var reset = require('./node.js').reset -module.exports = function inflateBundled (parent, children) { - validate('OA', arguments) +module.exports = function inflateBundled (bundler, parent, children) { + validate('OOA', arguments) children.forEach(function (child) { reset(child) - child.fromBundle = true + child.fromBundle = bundler child.parent = parent child.path = childPath(parent.path, child) child.realpath = childPath(parent.path, child) child.isLink = child.isLink || parent.isLink || parent.target - inflateBundled(child, child.children) + inflateBundled(bundler, child, child.children) }) } diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js index 497bbe3348..aca4204930 100644 --- a/deps/npm/lib/install/inflate-shrinkwrap.js +++ b/deps/npm/lib/install/inflate-shrinkwrap.js @@ -89,7 +89,7 @@ function inflateShrinkwrap (topPath, tree, swdeps, finishInflating) { tree.children.push(child) if (pkg._bundled) { delete pkg._bundled - inflateBundled(child, child.children) + inflateBundled(child, child, child.children) } inflateShrinkwrap(topPath, child, dependencies || {}, next) } diff --git a/deps/npm/lib/install/validate-tree.js b/deps/npm/lib/install/validate-tree.js index e89cd6fdd2..ccd4e2e310 100644 --- a/deps/npm/lib/install/validate-tree.js +++ b/deps/npm/lib/install/validate-tree.js @@ -26,7 +26,8 @@ module.exports = function (idealTree, log, next) { ], done) }], [thenValidateAllPeerDeps, idealTree], - [thenCheckTop, idealTree] + [thenCheckTop, idealTree], + [thenCheckDuplicateDeps, idealTree] ], andFinishTracker(log, next)) } @@ -73,5 +74,22 @@ function thenCheckTop (idealTree, next) { warnObj.code = 'ENODEPRE' idealTree.warnings.push(warnObj) } + + next() +} + +// check for deps duplciated between devdeps and regular deps +function thenCheckDuplicateDeps (idealTree, next) { + var deps = idealTree.package.dependencies || {} + var devDeps = idealTree.package.devDependencies || {} + + for (var pkg in devDeps) { + if (pkg in deps) { + var warnObj = new Error('The package ' + pkg + ' is included as both a dev and production dependency.') + warnObj.code = 'EDUPLICATEDEP' + idealTree.warnings.push(warnObj) + } + } + next() } diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index ba5ab16e51..3c0e4384dd 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -15,6 +15,8 @@ var semver = require('semver') var color = require('ansicolors') var npa = require('npm-package-arg') var iferr = require('iferr') +var sortedObject = require('sorted-object') +var extend = Object.assign || require('util')._extend var npm = require('./npm.js') var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') var recalculateMetadata = require('./install/deps.js').recalculateMetadata @@ -76,8 +78,8 @@ var lsFromTree = ls.fromTree = function (dir, physicalTree, args, silent, cb) { pruneNestedExtraneous(data) filterByEnv(data) - var bfs = filterFound(bfsify(data), args) - var lite = getLite(bfs) + var unlooped = filterFound(unloop(data), args) + var lite = getLite(unlooped) if (silent) return cb(null, data, lite) @@ -86,7 +88,7 @@ var lsFromTree = ls.fromTree = function (dir, physicalTree, args, silent, cb) { var out if (json) { var seen = [] - var d = long ? bfs : lite + var d = long ? unlooped : lite // the raw data can be circular out = JSON.stringify(d, function (k, o) { if (typeof o === 'object') { @@ -96,9 +98,9 @@ var lsFromTree = ls.fromTree = function (dir, physicalTree, args, silent, cb) { return o }, 2) } else if (npm.config.get('parseable')) { - out = makeParseable(bfs, long, dir) + out = makeParseable(unlooped, long, dir) } else if (data) { - out = makeArchy(bfs, long, dir) + out = makeArchy(unlooped, long, dir) } output(out) @@ -247,18 +249,10 @@ function getLite (data, noname, depth) { return lite } -function bfsify (root) { - // walk over the data, and turn it from this: - // +-- a - // | `-- b - // | `-- a (truncated) - // `--b (truncated) - // into this: - // +-- a - // `-- b - // which looks nicer +function unloop (root) { var queue = [root] - var seen = [root] + var seen = {} + seen[root.path] = true while (queue.length) { var current = queue.shift() @@ -266,17 +260,14 @@ function bfsify (root) { Object.keys(deps).forEach(function (d) { var dep = deps[d] if (dep.missing) return - if (inList(seen, dep)) { - if (npm.config.get('parseable') || !npm.config.get('long')) { - delete deps[d] - return - } else { - dep = deps[d] = Object.create(dep) - dep.dependencies = {} - } + if (dep.path && seen[dep.path]) { + dep = deps[d] = extend({}, dep) + dep.dependencies = {} + dep._deduped = path.relative(root.path, dep.path).replace(/node_modules\//g, '') + return } + seen[dep.path] = true queue.push(dep) - seen.push(dep) }) } @@ -285,18 +276,23 @@ function bfsify (root) { function filterFound (root, args) { if (!args.length) return root - var deps = root.dependencies - if (deps) { - Object.keys(deps).forEach(function (depName) { - var dep = filterFound(deps[depName], args) + if (!root.dependencies) return root + + // Mark all deps + var toMark = [root] + while (toMark.length) { + var markPkg = toMark.shift() + var markDeps = markPkg.dependencies + if (!markDeps) continue + Object.keys(markDeps).forEach(function (depName) { + var dep = markDeps[depName] if (dep.peerMissing) return - - // see if this one itself matches - var found = false - for (var ii = 0; !found && ii < args.length; ii++) { + dep._parent = markPkg + for (var ii = 0; ii < args.length; ii++) { var argName = args[ii][0] var argVersion = args[ii][1] var argRaw = args[ii][2] + var found if (depName === argName && argVersion) { found = semver.satisfies(dep.version, argVersion, true) } else if (depName === argName) { @@ -305,16 +301,33 @@ function filterFound (root, args) { } else if (dep.path === argRaw) { found = true } + if (found) { + dep._found = 'explicit' + var parent = dep._parent + while (parent && !parent._found && !parent._deduped) { + parent._found = 'implicit' + parent = parent._parent + } + break + } } - // included explicitly - if (found) dep._found = true - // included because a child was included - if (dep._found && !root._found) root._found = 1 - // not included - if (!dep._found) delete deps[depName] + toMark.push(dep) + }) + } + var toTrim = [root] + while (toTrim.length) { + var trimPkg = toTrim.shift() + var trimDeps = trimPkg.dependencies + if (!trimDeps) continue + trimPkg.dependencies = {} + Object.keys(trimDeps).forEach(function (name) { + var dep = trimDeps[name] + if (!dep._found) return + if (dep._found === 'implicit' && dep._deduped) return + trimPkg.dependencies[name] = dep + toTrim.push(dep) }) } - if (!root._found) root._found = false return root } @@ -345,7 +358,7 @@ function makeArchy_ (data, long, dir, depth, parent, d) { var out = {} // the top level is a bit special. out.label = data._id || '' - if (data._found === true && data._id) { + if (data._found === 'explicit' && data._id) { if (npm.color) { out.label = color.bgBlack(color.yellow(out.label.trim())) + ' ' } else { @@ -354,6 +367,14 @@ function makeArchy_ (data, long, dir, depth, parent, d) { } if (data.link) out.label += ' -> ' + data.link + if (data._deduped) { + if (npm.color) { + out.label += ' ' + color.brightBlack('deduped') + } else { + out.label += ' deduped' + } + } + if (data.invalid) { if (data.realName !== data.name) out.label += ' (' + data.realName + ')' var invalid = 'invalid' @@ -369,6 +390,7 @@ function makeArchy_ (data, long, dir, depth, parent, d) { if (data.peerMissing) { var peerMissing = 'UNMET PEER DEPENDENCY' + if (npm.color) peerMissing = color.bgBlack(color.red(peerMissing)) out.label = peerMissing + ' ' + out.label } @@ -415,7 +437,7 @@ function makeArchy_ (data, long, dir, depth, parent, d) { .sort(alphasort).filter(function (d) { return !isCruft(data.dependencies[d]) }).map(function (d) { - return makeArchy_(data.dependencies[d], long, dir, depth + 1, data, d) + return makeArchy_(sortedObject(data.dependencies[d]), long, dir, depth + 1, data, d) }) } @@ -444,19 +466,20 @@ function getExtras (data) { } function makeParseable (data, long, dir, depth, parent, d) { + if (data._deduped) return [] depth = depth || 0 if (depth > npm.config.get('depth')) return [ makeParseable_(data, long, dir, depth, parent, d) ] return [ makeParseable_(data, long, dir, depth, parent, d) ] - .concat(Object.keys(data.dependencies || {}) - .sort(alphasort).map(function (d) { - return makeParseable(data.dependencies[d], long, dir, depth + 1, data, d) - })) - .filter(function (x) { return x }) - .join('\n') + .concat(Object.keys(data.dependencies || {}) + .sort(alphasort).map(function (d) { + return makeParseable(data.dependencies[d], long, dir, depth + 1, data, d) + })) + .filter(function (x) { return x }) + .join('\n') } function makeParseable_ (data, long, dir, depth, parent, d) { - if (data.hasOwnProperty('_found') && data._found !== true) return '' + if (data.hasOwnProperty('_found') && data._found !== 'explicit') return '' if (data.missing) { if (depth < npm.config.get('depth')) { diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 890c369cc6..f852886433 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -31,7 +31,7 @@ var which = require('which') var glob = require('glob') var rimraf = require('rimraf') - var CachingRegClient = require('./cache/caching-client.js') + var lazyProperty = require('lazy-property') var parseJSON = require('./utils/parse-json.js') var aliases = require('./config/cmd-list').aliases var cmdList = require('./config/cmd-list').cmdList @@ -51,6 +51,13 @@ npm.commands = {} + // TUNING + npm.limit = { + fetch: 10, + action: 10 + } + // *** + npm.rollbacks = [] try { @@ -79,6 +86,9 @@ return littleGuys.indexOf(c) === -1 }) + var registryRefer + var registryLoaded + Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { Object.defineProperty(npm.commands, c, { get: function () { if (!loaded) { @@ -112,9 +122,8 @@ } }) - npm.registry.version = npm.version - if (!npm.registry.refer) { - npm.registry.refer = [a].concat(args[0]).map(function (arg) { + if (!registryRefer) { + registryRefer = [a].concat(args[0]).map(function (arg) { // exclude anything that might be a URL, path, or private module // Those things will always have a slash in them somewhere if (arg && arg.match && arg.match(/\/|\\/)) { @@ -125,6 +134,7 @@ }).filter(function (arg) { return arg && arg.match }).join(' ') + if (registryLoaded) npm.registry.refer = registryRefer } cmd.apply(npm, args) @@ -253,6 +263,10 @@ ua = ua.replace(/\{arch\}/gi, process.arch) config.set('user-agent', ua) + if (config.get('metrics-registry') == null) { + config.set('metrics-registry', config.get('registry')) + } + var color = config.get('color') log.level = config.get('loglevel') @@ -299,10 +313,6 @@ log.resume() - // at this point the configs are all set. - // go ahead and spin up the registry client. - npm.registry = new CachingRegClient(npm.config) - var umask = npm.config.get('umask') npm.modes = { exec: parseInt('0777', 8) & (~umask), @@ -322,7 +332,14 @@ // at this point the configs are all set. // go ahead and spin up the registry client. - npm.registry = new CachingRegClient(npm.config) + lazyProperty(npm, 'registry', function () { + registryLoaded = true + var CachingRegClient = require('./cache/caching-client.js') + var registry = new CachingRegClient(npm.config) + registry.version = npm.version + registry.refer = registryRefer + return registry + }) startMetrics() diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index a4a0d15abb..546d14b134 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -357,7 +357,7 @@ function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { } } - if (curr.version !== wanted) { + if (!curr || curr.version !== wanted) { doIt(wanted, latest) } else { skip() diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index caaf422cfe..d7e79d76ab 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -16,7 +16,7 @@ repo.completion = function (opts, cb) { function repo (args, cb) { var n = args.length ? args[0] : '.' - fetchPackageMetadata(n, '.', function (er, d) { + fetchPackageMetadata(n, '.', {fullMetadata: true}, function (er, d) { if (er) return cb(er) getUrlAndOpen(d, cb) }) diff --git a/deps/npm/lib/search/format-package-stream.js b/deps/npm/lib/search/format-package-stream.js index caa46cb898..a312e3f483 100644 --- a/deps/npm/lib/search/format-package-stream.js +++ b/deps/npm/lib/search/format-package-stream.js @@ -161,7 +161,7 @@ function normalizePackage (data, opts) { : typeof data.keywords === 'string' ? data.keywords.replace(/[,\s]+/, ' ') : '', - version: Object.keys(data.versions || {})[0] || [], + version: data.version, date: data.date && (data.date.toISOString() // remove time .split('T').join(' ') diff --git a/deps/npm/lib/utils/completion.sh b/deps/npm/lib/utils/completion.sh index 25bef2c17b..c549b31c96 100755 --- a/deps/npm/lib/utils/completion.sh +++ b/deps/npm/lib/utils/completion.sh @@ -11,7 +11,7 @@ if type complete &>/dev/null; then _npm_completion () { local words cword if type _get_comp_words_by_ref &>/dev/null; then - _get_comp_words_by_ref -n = -n @ -w words -i cword + _get_comp_words_by_ref -n = -n @ -n : -w words -i cword else cword="$COMP_CWORD" words=("${COMP_WORDS[@]}") @@ -24,6 +24,9 @@ if type complete &>/dev/null; then npm completion -- "${words[@]}" \ 2>/dev/null)) || return $? IFS="$si" + if type __ltrim_colon_completions &>/dev/null; then + __ltrim_colon_completions "${words[cword]}" + fi } complete -o default -F _npm_completion npm elif type compdef &>/dev/null; then diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index a2911a101a..1213902886 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -4,17 +4,16 @@ module.exports = errorHandler var cbCalled = false var log = require('npmlog') var npm = require('../npm.js') -var rm = require('rimraf') var itWorked = false var path = require('path') var wroteLogFile = false var exitCode = 0 var rollbacks = npm.rollbacks var chain = require('slide').chain -var writeStreamAtomic = require('fs-write-stream-atomic') +var writeFileAtomic = require('write-file-atomic') var errorMessage = require('./error-message.js') var stopMetrics = require('./metrics.js').stop -var mkdir = require('mkdirp') +var mkdirp = require('mkdirp') var logFileName function getLogFile () { @@ -32,10 +31,15 @@ process.on('exit', function (code) { stopMetrics() if (code) itWorked = false - if (itWorked) log.info('ok') - else { + if (itWorked) { + log.info('ok') + } else { if (!cbCalled) { log.error('', 'cb() never called!') + console.error('') + log.error('', 'This is an error with npm itself. Please report this error at:') + log.error('', ' ') + writeLogFile() } if (wroteLogFile) { @@ -45,7 +49,7 @@ process.on('exit', function (code) { log.error( '', [ - 'Please include the following file with any support request:', + 'A complete log of this run can be found in:', ' ' + getLogFile() ].join('\n') ) @@ -83,19 +87,22 @@ function exit (code, noLog) { }), function (er) { if (er) { log.error('error rolling back', er) - if (!code) errorHandler(er) - else if (noLog) rm('npm-debug.log', reallyExit.bind(null, er)) - else writeLogFile(reallyExit.bind(this, er)) + if (!code) { + errorHandler(er) + } else { + if (!noLog) writeLogFile() + reallyExit(er) + } } else { - if (!noLog && code) writeLogFile(reallyExit) - else rm(getLogFile(), reallyExit) + if (!noLog && code) writeLogFile() + reallyExit() } }) rollbacks.length = 0 } else if (code && !noLog) { writeLogFile(reallyExit) } else { - rm('npm-debug.log', reallyExit) + reallyExit() } function reallyExit (er) { @@ -115,7 +122,6 @@ function exit (code, noLog) { function errorHandler (er) { log.disableProgress() - // console.error('errorHandler', er) if (!npm.config || !npm.config.loaded) { // logging won't work unless we pretend that it's ready er = er || new Error('Exit prior to config file resolving.') @@ -163,14 +169,10 @@ function errorHandler (er) { log.verbose('cwd', process.cwd()) var os = require('os') - // log.error('System', os.type() + ' ' + os.release()) - // log.error('command', process.argv.map(JSON.stringify).join(' ')) - // log.error('node -v', process.version) - // log.error('npm -v', npm.version) - log.error('', os.type() + ' ' + os.release()) - log.error('argv', process.argv.map(JSON.stringify).join(' ')) - log.error('node', process.version) - log.error('npm ', 'v' + npm.version) + log.verbose('', os.type() + ' ' + os.release()) + log.verbose('argv', process.argv.map(JSON.stringify).join(' ')) + log.verbose('node', process.version) + log.verbose('npm ', 'v' + npm.version) ;[ 'file', @@ -183,9 +185,6 @@ function errorHandler (er) { if (v) log.error(k, v) }) - // just a line break - if (log.levels[log.level] <= log.levels.error) console.error('') - var msg = errorMessage(er) msg.summary.concat(msg.detail).forEach(function (errline) { log.error.apply(log, errline) @@ -194,20 +193,15 @@ function errorHandler (er) { exit(typeof er.errno === 'number' ? er.errno : 1) } -var writingLogFile = false -function writeLogFile (cb) { - if (writingLogFile) return cb() - writingLogFile = true +function writeLogFile () { + if (wroteLogFile) return wroteLogFile = true var os = require('os') - mkdir(path.resolve(npm.config.get('cache'), '_logs'), function (er) { - if (er) { - cb(er) - return - } - var fstr = writeStreamAtomic(getLogFile()) + try { + mkdirp.sync(path.resolve(npm.config.get('cache'), '_logs')) + var logOutput = '' log.record.forEach(function (m) { var pref = [m.id, m.level] if (m.prefix) pref.push(m.prefix) @@ -216,10 +210,11 @@ function writeLogFile (cb) { m.message.trim().split(/\r?\n/).map(function (line) { return (pref + ' ' + line).trim() }).forEach(function (line) { - fstr.write(line + os.EOL) + logOutput += line + os.EOL }) }) - fstr.end() - fstr.on('close', cb) - }) + writeFileAtomic.sync(getLogFile(), logOutput) + } catch (ex) { + return + } } diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index 5c7ce15bf1..f19d0bf6d3 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -268,7 +268,6 @@ function errorMessage (er) { detail.push([ 'enoent', [ - er.message, 'This is most likely not a problem with npm itself', 'and is related to npm not being able to find a file.', er.file ? "\nCheck if the file '" + er.file + "' is present." : '' @@ -304,14 +303,6 @@ function errorMessage (er) { default: short.push(['', er.message || er]) - detail.push([ - '', - [ - '', - 'If you need help, you may report this error at:', - ' ' - ].join('\n') - ]) break } if (er.optional) { diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index f48d5e2a3b..4ab5e0979a 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -282,6 +282,7 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { procError(er) }) process.once('SIGTERM', procKill) + process.once('SIGINT', procInterupt) function procError (er) { if (er) { @@ -302,11 +303,20 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { er.pkgname = pkg.name } process.removeListener('SIGTERM', procKill) + process.removeListener('SIGTERM', procInterupt) + process.removeListener('SIGINT', procKill) return cb(er) } function procKill () { proc.kill() } + function procInterupt () { + proc.kill('SIGINT') + proc.on('exit', function () { + process.exit() + }) + process.once('SIGINT', procKill) + } } function runHookLifecycle (pkg, env, wd, unsafe, cb) { diff --git a/deps/npm/lib/utils/move.js b/deps/npm/lib/utils/move.js new file mode 100644 index 0000000000..242e87d37f --- /dev/null +++ b/deps/npm/lib/utils/move.js @@ -0,0 +1,19 @@ +'use strict' +module.exports = wrappedMove + +var fs = require('graceful-fs') +var move = require('move-concurrently') +var Bluebird = require('bluebird') + +function wrappedMove (from, to, cb) { + var movePromise = move(from, to, {fs: fs, Promise: Bluebird, maxConcurrency: 4}) + if (cb) { + return movePromise.then(function (value) { + cb(value) + }, function (err) { + cb(err) + }) + } else { + return movePromise + } +} diff --git a/deps/npm/lib/utils/rename.js b/deps/npm/lib/utils/rename.js index 8a44428984..43a2f7e104 100644 --- a/deps/npm/lib/utils/rename.js +++ b/deps/npm/lib/utils/rename.js @@ -1,16 +1,9 @@ -'use strict' -var fs = require('graceful-fs') -var SaveStack = require('./save-stack.js') +/* -module.exports = rename +This is a stub file to ensure that the following hack doesn't break. This can be removed w/ npm@5. -function rename (from, to, cb) { - var saved = new SaveStack(rename) - fs.rename(from, to, function (er) { - if (er) { - return cb(saved.completeWith(er)) - } else { - return cb() - } - }) -} +# Fix bug https://github.com/npm/npm/issues/9863 +RUN cd $(npm root -g)/npm \ + && npm install fs-extra \ + && sed -i -e s/graceful-fs/fs-extra/ -e s/fs\.rename/fs.move/ ./lib/utils/rename.js +*/ diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index f580c8e05d..88cfc6b805 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -136,8 +136,10 @@ BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) { // the package root. var p = this.parent - // the package before this one. + // the directory before this one. var pp = p && p.parent + // the directory before that (if this is scoped) + if (pp && pp.basename[0] === '@') pp = pp && pp.parent // if this entry has already been bundled, and is a symlink, // and it is the *same* symlink as this one, then exclude it. diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index 1af9c6a0bd..3da142d834 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "February 2017" "" "" +.TH "NPM" "1" "April 2017" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P @@ -85,7 +85,7 @@ experience if you run a recent version of npm\. To upgrade, either use Microsoft upgrade tool \fIhttps://github\.com/felixrieseberg/npm\-windows\-upgrade\fR, download a new version of Node \fIhttps://nodejs\.org/en/download/\fR, or follow the Windows upgrade instructions in the -npm Troubleshooting Guide \fIhttps://github\.com/npm/npm/wiki/Troubleshooting#upgrading\-on\-windows\fR\|\. +npm Troubleshooting Guide \fI\|\./TROUBLESHOOTING\.md\fR\|\. .P If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly\. diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 61f97269bc..2159bda133 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "February 2017" "" "" +.TH "NPM\-ACCESS" "1" "April 2017" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 2386263636..05292d8438 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,11 +1,11 @@ -.TH "NPM\-ADDUSER" "1" "February 2017" "" "" +.TH "NPM\-ADDUSER" "1" "April 2017" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS .P .RS 2 .nf -npm adduser [\-\-registry=url] [\-\-scope=@orgname] [\-\-always\-auth] +npm adduser [\-\-registry=url] [\-\-scope=@orgname] [\-\-always\-auth] [\-\-auth\-type=legacy] aliases: login, add\-user .fi @@ -72,6 +72,18 @@ private registries where metadata and package tarballs are stored on hosts with different hostnames\. See \fBalways\-auth\fP in npm help 7 \fBnpm\-config\fP for more details on always\-auth\. Registry\-specific configuration of \fBalways\-auth\fP takes precedence over any global configuration\. +.SS auth\-type +.RS 0 +.IP \(bu 2 +Default: \fB\|'legacy'\fP +.IP \(bu 2 +Type: \fB\|'legacy'\fP, \fB\|'sso'\fP, \fB\|'saml'\fP, \fB\|'oauth'\fP + +.RE +.P +What authentication strategy to use with \fBadduser\fP/\fBlogin\fP\|\. Some npm registries +(for example, npmE) might support alternative auth strategies besides classic +username/password entry in legacy npm\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index fb6e29c0b9..f3e72259c0 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "February 2017" "" "" +.TH "NPM\-BIN" "1" "April 2017" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 6c023dddd9..74cba49230 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "February 2017" "" "" +.TH "NPM\-BUGS" "1" "April 2017" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index b3a3d984a6..ecfb4b00a3 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUILD" "1" "February 2017" "" "" +.TH "NPM\-BUILD" "1" "April 2017" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 84fdac2677..e785c48170 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUNDLE" "1" "February 2017" "" "" +.TH "NPM\-BUNDLE" "1" "April 2017" "" "" .SH "NAME" \fBnpm-bundle\fR \- REMOVED .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index c44e1081fc..badbbe4bfd 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "February 2017" "" "" +.TH "NPM\-CACHE" "1" "April 2017" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index a861d751e3..afc7cce99b 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "February 2017" "" "" +.TH "NPM\-COMPLETION" "1" "April 2017" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 6667aebb77..fbb957b531 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "February 2017" "" "" +.TH "NPM\-CONFIG" "1" "April 2017" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 317dac0523..fa45c9104f 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "February 2017" "" "" +.TH "NPM\-DEDUPE" "1" "April 2017" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 19293be079..77ad822e18 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "February 2017" "" "" +.TH "NPM\-DEPRECATE" "1" "April 2017" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 31b287fa6f..3bef22ba90 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "February 2017" "" "" +.TH "NPM\-DIST\-TAG" "1" "April 2017" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index b8595d8c79..8c516318e2 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "February 2017" "" "" +.TH "NPM\-DOCS" "1" "April 2017" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index d6fe7261a7..1b00a96f94 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCTOR" "1" "February 2017" "" "" +.TH "NPM\-DOCTOR" "1" "April 2017" "" "" .SH "NAME" \fBnpm-doctor\fR \- Check your environments .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index bb46a86b5a..506c165a04 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "February 2017" "" "" +.TH "NPM\-EDIT" "1" "April 2017" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 2716637d34..c0488214e4 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "February 2017" "" "" +.TH "NPM\-EXPLORE" "1" "April 2017" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index a4337630fe..fd0cfad996 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "February 2017" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "April 2017" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 7997c03b2f..052ceac718 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "February 2017" "" "" +.TH "NPM\-HELP" "1" "April 2017" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 7a89ee32f4..cbe48422b0 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "February 2017" "" "" +.TH "NPM\-INIT" "1" "April 2017" "" "" .SH "NAME" \fBnpm-init\fR \- Interactively create a package\.json file .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index b10135c3b0..0c31b351a3 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM" "" "February 2017" "" "" +.TH "NPM" "" "April 2017" "" "" .SH "NAME" \fBnpm\fR .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index ef483c88a1..f7a4648220 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "February 2017" "" "" +.TH "NPM\-INSTALL" "1" "April 2017" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 8c071ae7b4..63479c5718 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "February 2017" "" "" +.TH "NPM\-LINK" "1" "April 2017" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 634ce0970e..d1005f52ea 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "February 2017" "" "" +.TH "NPM\-LOGOUT" "1" "April 2017" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 9d96de5afc..8cffc7ac4c 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "February 2017" "" "" +.TH "NPM\-LS" "1" "April 2017" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS @@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@4.2.0 /path/to/npm +npm@4.5.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 4304a4ed1b..45f05cd7f6 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "February 2017" "" "" +.TH "NPM\-OUTDATED" "1" "April 2017" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index cf48a32062..b00a1ac85e 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "February 2017" "" "" +.TH "NPM\-OWNER" "1" "April 2017" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 5e9b3eee5b..2013d0818f 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "February 2017" "" "" +.TH "NPM\-PACK" "1" "April 2017" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 518e76f057..ae9c1f2303 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "February 2017" "" "" +.TH "NPM\-PING" "1" "April 2017" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 2f34f8cc53..d85a0a54d1 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "February 2017" "" "" +.TH "NPM\-PREFIX" "1" "April 2017" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index eb25bc604f..397c722c95 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "February 2017" "" "" +.TH "NPM\-PRUNE" "1" "April 2017" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index f2bde25278..864418d645 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "February 2017" "" "" +.TH "NPM\-PUBLISH" "1" "April 2017" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index c708c0b984..f40096009c 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "February 2017" "" "" +.TH "NPM\-REBUILD" "1" "April 2017" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 1aa5e949be..d26c658c62 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "February 2017" "" "" +.TH "NPM\-REPO" "1" "April 2017" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 13748d1d58..f59c08f4f7 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "February 2017" "" "" +.TH "NPM\-RESTART" "1" "April 2017" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index a3469bbb92..c11be4f067 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "February 2017" "" "" +.TH "NPM\-ROOT" "1" "April 2017" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 5328771582..d5e32a8ad3 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "February 2017" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "April 2017" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index b5b35c7f68..f80384b945 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "February 2017" "" "" +.TH "NPM\-SEARCH" "1" "April 2017" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 96205fd6c0..7448d31e68 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "February 2017" "" "" +.TH "NPM\-SHRINKWRAP" "1" "April 2017" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 222e12d4a0..02b39fc097 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "February 2017" "" "" +.TH "NPM\-STAR" "1" "April 2017" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index daad14a186..4cf4defdae 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "February 2017" "" "" +.TH "NPM\-STARS" "1" "April 2017" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 466ad39948..2c95642786 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "February 2017" "" "" +.TH "NPM\-START" "1" "April 2017" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 6646abc28a..aa0f66aa24 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "February 2017" "" "" +.TH "NPM\-STOP" "1" "April 2017" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 5e349fc4f9..54b7d50732 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "February 2017" "" "" +.TH "NPM\-TEAM" "1" "April 2017" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 46adee17db..daf33e3208 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "February 2017" "" "" +.TH "NPM\-TEST" "1" "April 2017" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 25d1e0f8ef..934f8d7d85 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "February 2017" "" "" +.TH "NPM\-UNINSTALL" "1" "April 2017" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 0d116aace9..e152c80b77 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "February 2017" "" "" +.TH "NPM\-UNPUBLISH" "1" "April 2017" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS @@ -29,6 +29,11 @@ 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\. .P +With the default registry (\fBregistry\.npmjs\.org\fP), unpublish is +only allowed with versions published in the last 24 hours\. If you +are trying to unpublish a version published longer ago than that, +contact support@npmjs\.com\. +.P The scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fP\|\. .SH SEE ALSO .RS 0 diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index c0232918c8..3787f99616 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "February 2017" "" "" +.TH "NPM\-UPDATE" "1" "April 2017" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 498abaaa2f..755e7ac041 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "February 2017" "" "" +.TH "NPM\-VERSION" "1" "April 2017" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 065050a24a..944766b2be 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "February 2017" "" "" +.TH "NPM\-VIEW" "1" "April 2017" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index e21e814458..4086a692a2 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "February 2017" "" "" +.TH "NPM\-WHOAMI" "1" "April 2017" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index e473ee6d7a..de4cef6862 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "February 2017" "" "" +.TH "NPM" "1" "April 2017" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -4.2.0 +4.5.0 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index b96a5b44e2..9eeeb34231 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "February 2017" "" "" +.TH "NPM\-FOLDERS" "5" "April 2017" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index b96a5b44e2..9eeeb34231 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "February 2017" "" "" +.TH "NPM\-FOLDERS" "5" "April 2017" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 004ff00094..9d5739ba93 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "February 2017" "" "" +.TH "PACKAGE\.JSON" "5" "April 2017" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 5649907f75..02ce7d4ad2 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "February 2017" "" "" +.TH "NPMRC" "5" "April 2017" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index 004ff00094..9d5739ba93 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "February 2017" "" "" +.TH "PACKAGE\.JSON" "5" "April 2017" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 93caeb1fc2..6394eb5326 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CODING\-STYLE" "7" "February 2017" "" "" +.TH "NPM\-CODING\-STYLE" "7" "April 2017" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 23d3ca56ff..dd6b755031 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "7" "February 2017" "" "" +.TH "NPM\-CONFIG" "7" "April 2017" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -189,6 +189,16 @@ Type: String .P When "dev" or "development" and running local \fBnpm shrinkwrap\fP, \fBnpm outdated\fP, or \fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\. +.SS auth\-type +.RS 0 +.IP \(bu 2 +Default: \fB\|'legacy'\fP +.IP \(bu 2 +Type: \fB\|'legacy'\fP, \fB\|'sso'\fP, \fB\|'saml'\fP, \fB\|'oauth'\fP + +.RE +.P +What authentication strategy to use with \fBadduser\fP/\fBlogin\fP\|\. .SS bin\-links .RS 0 .IP \(bu 2 @@ -844,7 +854,7 @@ Any "%s" in the message will be replaced with the version number\. .SS metrics\-registry .RS 0 .IP \(bu 2 -Default: "https://registry\.npmjs\.org/" +Default: The value of \fBregistry\fP (which defaults to "https://registry\.npmjs\.org/") .IP \(bu 2 Type: String @@ -1232,6 +1242,27 @@ using \fB\-s\fP to add a signature\. .P Note that git requires you to have set up GPG keys in your git configs for this to work properly\. +.SS sso\-poll\-frequency +.RS 0 +.IP \(bu 2 +Default: 500 +.IP \(bu 2 +Type: Number + +.RE +.P +When used with SSO\-enabled \fBauth\-type\fPs, configures how regularly the registry +should be polled while the user is completing authentication\. +.SS sso\-type +.RS 0 +.IP \(bu 2 +Default: 'oauth' +.IP \(bu 2 +Type: 'oauth', 'saml', or null + +.RE +.P +If \fB\-\-auth\-type=sso\fP, the type of SSO type to use\. .SS strict\-ssl .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 9e908846a2..c8fdf0056e 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DEVELOPERS" "7" "February 2017" "" "" +.TH "NPM\-DEVELOPERS" "7" "April 2017" "" "" .SH "NAME" \fBnpm-developers\fR \- Developer Guide .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index f347da46f0..f623c6a79e 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DISPUTES" "7" "February 2017" "" "" +.TH "NPM\-DISPUTES" "7" "April 2017" "" "" .SH "NAME" \fBnpm-disputes\fR \- Handling Module Name Disputes .P diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index 36a1e2d12a..48e1c36750 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,4 +1,4 @@ -.TH "NPM\-INDEX" "7" "February 2017" "" "" +.TH "NPM\-INDEX" "7" "April 2017" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7 index 278b766a9e..9c5cf42a57 100644 --- a/deps/npm/man/man7/npm-orgs.7 +++ b/deps/npm/man/man7/npm-orgs.7 @@ -1,4 +1,4 @@ -.TH "NPM\-ORGS" "7" "February 2017" "" "" +.TH "NPM\-ORGS" "7" "April 2017" "" "" .SH "NAME" \fBnpm-orgs\fR \- Working with Teams & Orgs .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index 83fcd4beeb..a1d3186f38 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REGISTRY" "7" "February 2017" "" "" +.TH "NPM\-REGISTRY" "7" "April 2017" "" "" .SH "NAME" \fBnpm-registry\fR \- The JavaScript Package Registry .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7 index be3a322b5c..be15431be0 100644 --- a/deps/npm/man/man7/npm-scope.7 +++ b/deps/npm/man/man7/npm-scope.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCOPE" "7" "February 2017" "" "" +.TH "NPM\-SCOPE" "7" "April 2017" "" "" .SH "NAME" \fBnpm-scope\fR \- Scoped packages .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index d28e9a1b53..77ffee6d7a 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCRIPTS" "7" "February 2017" "" "" +.TH "NPM\-SCRIPTS" "7" "April 2017" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index fcc488d389..e3993d07ab 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REMOVAL" "1" "February 2017" "" "" +.TH "NPM\-REMOVAL" "1" "April 2017" "" "" .SH "NAME" \fBnpm-removal\fR \- Cleaning the Slate .SH SYNOPSIS diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index 1c452d2bb7..e443f8fc89 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "February 2017" "" "" +.TH "SEMVER" "7" "April 2017" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Usage diff --git a/deps/npm/node_modules/JSONStream/.travis.yml b/deps/npm/node_modules/JSONStream/.travis.yml index 56c2d58656..2f60c363d2 100644 --- a/deps/npm/node_modules/JSONStream/.travis.yml +++ b/deps/npm/node_modules/JSONStream/.travis.yml @@ -3,3 +3,4 @@ node_js: - 4 - 5 - 6 +sudo: false diff --git a/deps/npm/node_modules/JSONStream/index.js b/deps/npm/node_modules/JSONStream/index.js index 86ad5c7443..2cc9fff071 100755 --- a/deps/npm/node_modules/JSONStream/index.js +++ b/deps/npm/node_modules/JSONStream/index.js @@ -94,6 +94,12 @@ exports.parse = function (path, map) { } } + + // emit header + if (header) { + stream.emit('header', header); + header = false; + } if (j !== this.stack.length) return count ++ @@ -115,12 +121,6 @@ exports.parse = function (path, map) { for(var k in this.stack) if (!Object.isFrozen(this.stack[k])) this.stack[k].value = null - - // emit header - if (header) { - stream.emit('header', header); - header = false; - } } parser._onToken = parser.onToken; diff --git a/deps/npm/node_modules/JSONStream/node_modules/jsonparse/jsonparse.js b/deps/npm/node_modules/JSONStream/node_modules/jsonparse/jsonparse.js index 92365f6a4e..26752d4a1b 100644 --- a/deps/npm/node_modules/JSONStream/node_modules/jsonparse/jsonparse.js +++ b/deps/npm/node_modules/JSONStream/node_modules/jsonparse/jsonparse.js @@ -40,13 +40,24 @@ var KEY = C.KEY = 0x72; // Parser Modes var OBJECT = C.OBJECT = 0x81; var ARRAY = C.ARRAY = 0x82; +// Character constants +var BACK_SLASH = "\\".charCodeAt(0); +var FORWARD_SLASH = "\/".charCodeAt(0); +var BACKSPACE = "\b".charCodeAt(0); +var FORM_FEED = "\f".charCodeAt(0); +var NEWLINE = "\n".charCodeAt(0); +var CARRIAGE_RETURN = "\r".charCodeAt(0); +var TAB = "\t".charCodeAt(0); +var STRING_BUFFER_SIZE = 64 * 1024; function Parser() { this.tState = START; this.value = undefined; this.string = undefined; // string data + this.stringBuffer = Buffer.alloc ? Buffer.alloc(STRING_BUFFER_SIZE) : new Buffer(STRING_BUFFER_SIZE); + this.stringBufferOffset = 0; this.unicode = undefined; // unicode escapes this.key = undefined; @@ -77,6 +88,41 @@ proto.charError = function (buffer, i) { this.tState = STOP; this.onError(new Error("Unexpected " + JSON.stringify(String.fromCharCode(buffer[i])) + " at position " + i + " in state " + Parser.toknam(this.tState))); }; +proto.appendStringChar = function (char) { + if (this.stringBufferOffset >= STRING_BUFFER_SIZE) { + this.string += this.stringBuffer.toString('utf8'); + this.stringBufferOffset = 0; + } + + this.stringBuffer[this.stringBufferOffset++] = char; +}; +proto.appendStringBuf = function (buf, start, end) { + var size = buf.length; + if (typeof start === 'number') { + if (typeof end === 'number') { + if (end < 0) { + // adding a negative end decreeses the size + size = buf.length - start + end; + } else { + size = end - start; + } + } else { + size = buf.length - start; + } + } + + if (size < 0) { + size = 0; + } + + if (this.stringBufferOffset + size > STRING_BUFFER_SIZE) { + this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); + this.stringBufferOffset = 0; + } + + buf.copy(this.stringBuffer, this.stringBufferOffset, start, end); + this.stringBufferOffset += size; +}; proto.write = function (buffer) { if (typeof buffer === "string") buffer = new Buffer(buffer); var n; @@ -93,7 +139,10 @@ proto.write = function (buffer) { }else if(n === 0x74){ this.tState = TRUE1; // t }else if(n === 0x66){ this.tState = FALSE1; // f }else if(n === 0x6e){ this.tState = NULL1; // n - }else if(n === 0x22){ this.string = ""; this.tState = STRING1; // " + }else if(n === 0x22){ // " + this.string = ""; + this.stringBufferOffset = 0; + this.tState = STRING1; }else if(n === 0x2d){ this.string = "-"; this.tState = NUMBER1; // - }else{ if (n >= 0x30 && n < 0x40) { // 1-9 @@ -112,7 +161,8 @@ proto.write = function (buffer) { for (var j = 0; j < this.bytes_remaining; j++) { this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence - this.bytes_remaining + j] = buffer[j]; } - this.string += this.temp_buffs[this.bytes_in_sequence].toString(); + + this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]); this.bytes_in_sequence = this.bytes_remaining = 0; i = i + j - 1; } else if (this.bytes_remaining === 0 && n >= 128) { // else if no remainder bytes carried over, parse multi byte (>=128) chars one at a time @@ -129,25 +179,34 @@ proto.write = function (buffer) { this.bytes_remaining = (i + this.bytes_in_sequence) - buffer.length; i = buffer.length - 1; } else { - this.string += buffer.slice(i, (i + this.bytes_in_sequence)).toString(); + this.appendStringBuf(buffer, i, i + this.bytes_in_sequence); i = i + this.bytes_in_sequence - 1; } - } else if (n === 0x22) { this.tState = START; this.onToken(STRING, this.string); this.offset += Buffer.byteLength(this.string, 'utf8') + 1; this.string = undefined; } - else if (n === 0x5c) { this.tState = STRING2; } - else if (n >= 0x20) { this.string += String.fromCharCode(n); } + } else if (n === 0x22) { + this.tState = START; + this.string += this.stringBuffer.toString('utf8', 0, this.stringBufferOffset); + this.stringBufferOffset = 0; + this.onToken(STRING, this.string); + this.offset += Buffer.byteLength(this.string, 'utf8') + 1; + this.string = undefined; + } + else if (n === 0x5c) { + this.tState = STRING2; + } + else if (n >= 0x20) { this.appendStringChar(n); } else { return this.charError(buffer, i); } }else if (this.tState === STRING2){ // After backslash n = buffer[i]; - if(n === 0x22){ this.string += "\""; this.tState = STRING1; - }else if(n === 0x5c){ this.string += "\\"; this.tState = STRING1; - }else if(n === 0x2f){ this.string += "\/"; this.tState = STRING1; - }else if(n === 0x62){ this.string += "\b"; this.tState = STRING1; - }else if(n === 0x66){ this.string += "\f"; this.tState = STRING1; - }else if(n === 0x6e){ this.string += "\n"; this.tState = STRING1; - }else if(n === 0x72){ this.string += "\r"; this.tState = STRING1; - }else if(n === 0x74){ this.string += "\t"; this.tState = STRING1; + if(n === 0x22){ this.appendStringChar(n); this.tState = STRING1; + }else if(n === 0x5c){ this.appendStringChar(BACK_SLASH); this.tState = STRING1; + }else if(n === 0x2f){ this.appendStringChar(FORWARD_SLASH); this.tState = STRING1; + }else if(n === 0x62){ this.appendStringChar(BACKSPACE); this.tState = STRING1; + }else if(n === 0x66){ this.appendStringChar(FORM_FEED); this.tState = STRING1; + }else if(n === 0x6e){ this.appendStringChar(NEWLINE); this.tState = STRING1; + }else if(n === 0x72){ this.appendStringChar(CARRIAGE_RETURN); this.tState = STRING1; + }else if(n === 0x74){ this.appendStringChar(TAB); this.tState = STRING1; }else if(n === 0x75){ this.unicode = ""; this.tState = STRING3; }else{ return this.charError(buffer, i); @@ -158,7 +217,7 @@ proto.write = function (buffer) { if ((n >= 0x30 && n < 0x40) || (n > 0x40 && n <= 0x46) || (n > 0x60 && n <= 0x66)) { this.unicode += String.fromCharCode(n); if (this.tState++ === STRING6) { - this.string += String.fromCharCode(parseInt(this.unicode, 16)); + this.appendStringBuf(Buffer(String.fromCharCode(parseInt(this.unicode, 16)))); this.unicode = undefined; this.tState = STRING1; } diff --git a/deps/npm/node_modules/JSONStream/node_modules/jsonparse/package.json b/deps/npm/node_modules/JSONStream/node_modules/jsonparse/package.json index 65e97dd867..f60aa1ef70 100644 --- a/deps/npm/node_modules/JSONStream/node_modules/jsonparse/package.json +++ b/deps/npm/node_modules/JSONStream/node_modules/jsonparse/package.json @@ -14,14 +14,19 @@ ] ], "_from": "jsonparse@>=1.2.0 <2.0.0", - "_id": "jsonparse@1.2.0", + "_id": "jsonparse@1.3.0", "_inCache": true, "_location": "/JSONStream/jsonparse", + "_nodeVersion": "4.1.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/jsonparse-1.3.0.tgz_1484597944748_0.925271877553314" + }, "_npmUser": { "name": "creationix", "email": "tim@creationix.com" }, - "_npmVersion": "1.4.28", + "_npmVersion": "2.14.4", "_phantomChildren": {}, "_requested": { "raw": "jsonparse@^1.2.0", @@ -35,8 +40,8 @@ "_requiredBy": [ "/JSONStream" ], - "_resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.2.0.tgz", - "_shasum": "5c0c5685107160e72fe7489bddea0b44c2bc67bd", + "_resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.0.tgz", + "_shasum": "85fc245b1d9259acc6941960b905adf64e7de0e8", "_shrinkwrap": null, "_spec": "jsonparse@^1.2.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/JSONStream", @@ -55,14 +60,14 @@ }, "directories": {}, "dist": { - "shasum": "5c0c5685107160e72fe7489bddea0b44c2bc67bd", - "tarball": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.2.0.tgz" + "shasum": "85fc245b1d9259acc6941960b905adf64e7de0e8", + "tarball": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.0.tgz" }, "engines": [ "node >= 0.2.0" ], - "gitHead": "b3f4dc7b49300a549aea19a628d712009ca84ced", - "homepage": "https://github.com/creationix/jsonparse", + "gitHead": "69f02ca615aeeb4cbbe786ab42ce0592b44dc217", + "homepage": "https://github.com/creationix/jsonparse#readme", "license": "MIT", "main": "jsonparse.js", "maintainers": [ @@ -89,5 +94,5 @@ "json", "stream" ], - "version": "1.2.0" + "version": "1.3.0" } diff --git a/deps/npm/node_modules/JSONStream/node_modules/jsonparse/test/big-token.js b/deps/npm/node_modules/JSONStream/node_modules/jsonparse/test/big-token.js new file mode 100644 index 0000000000..36046317ee --- /dev/null +++ b/deps/npm/node_modules/JSONStream/node_modules/jsonparse/test/big-token.js @@ -0,0 +1,24 @@ +var stream = require('stream'); +var JsonParse = require('../jsonparse'); +var test = require('tape'); + +test('can handle large tokens without running out of memory', function (t) { + var parser = new JsonParse(); + var chunkSize = 1024; + var chunks = 1024 * 200; // 200mb + var quote = Buffer.from ? Buffer.from('"') : new Buffer('"'); + t.plan(1); + + parser.onToken = function (type, value) { + t.equal(value.length, chunkSize * chunks, 'token should be size of input json'); + t.end(); + }; + + parser.write(quote); + for (var i = 0; i < chunks; ++i) { + var buf = Buffer.alloc ? Buffer.alloc(chunkSize) : new Buffer(chunkSize); + buf.fill('a'); + parser.write(buf); + } + parser.write(quote); +}); diff --git a/deps/npm/node_modules/JSONStream/package.json b/deps/npm/node_modules/JSONStream/package.json index 75eacb3b0f..91907f21cf 100644 --- a/deps/npm/node_modules/JSONStream/package.json +++ b/deps/npm/node_modules/JSONStream/package.json @@ -2,50 +2,50 @@ "_args": [ [ { - "raw": "JSONStream@1.3.0", + "raw": "JSONStream@latest", "scope": null, "escapedName": "JSONStream", "name": "JSONStream", - "rawSpec": "1.3.0", - "spec": "1.3.0", - "type": "version" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "JSONStream@1.3.0", - "_id": "JSONStream@1.3.0", + "_from": "JSONStream@latest", + "_id": "JSONStream@1.3.1", "_inCache": true, "_location": "/JSONStream", - "_nodeVersion": "6.5.0", + "_nodeVersion": "6.9.4", "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/JSONStream-1.3.0.tgz_1481845260408_0.7681232686154544" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/JSONStream-1.3.1.tgz_1487992062630_0.4616028449963778" }, "_npmUser": { "name": "dominictarr", "email": "dominic.tarr@gmail.com" }, - "_npmVersion": "3.10.3", + "_npmVersion": "3.10.10", "_phantomChildren": {}, "_requested": { - "raw": "JSONStream@1.3.0", + "raw": "JSONStream@latest", "scope": null, "escapedName": "JSONStream", "name": "JSONStream", - "rawSpec": "1.3.0", - "spec": "1.3.0", - "type": "version" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.0.tgz", - "_shasum": "680ab9ac6572a8a1a207e0b38721db1c77b215e5", + "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "_shasum": "707f761e01dae9e16f1bcf93703b78c70966579a", "_shrinkwrap": null, - "_spec": "JSONStream@1.3.0", - "_where": "/Users/rebecca/code/npm", + "_spec": "JSONStream@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Dominic Tarr", "email": "dominic.tarr@gmail.com", @@ -72,13 +72,13 @@ }, "directories": {}, "dist": { - "shasum": "680ab9ac6572a8a1a207e0b38721db1c77b215e5", - "tarball": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.0.tgz" + "shasum": "707f761e01dae9e16f1bcf93703b78c70966579a", + "tarball": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz" }, "engines": { "node": "*" }, - "gitHead": "3d5d3283d79e23da81fa6fc4b76bc1f44ff0047d", + "gitHead": "71ab5610d272bb47e64957e2191df6662ee64a90", "homepage": "http://github.com/dominictarr/JSONStream", "keywords": [ "json", @@ -109,5 +109,5 @@ "scripts": { "test": "set -e; for t in test/*.js; do echo '***' $t '***'; node $t; done" }, - "version": "1.3.0" + "version": "1.3.1" } diff --git a/deps/npm/node_modules/JSONStream/test/header_footer.js b/deps/npm/node_modules/JSONStream/test/header_footer.js index ef0187940e..f18fc59e7e 100644 --- a/deps/npm/node_modules/JSONStream/test/header_footer.js +++ b/deps/npm/node_modules/JSONStream/test/header_footer.js @@ -38,6 +38,7 @@ parser.on('data', function (data) { value: {rev: it.typeof('string')}, key:it.typeof('string') }) + it(headerCalled).equal(1) parsed.push(data) }) diff --git a/deps/npm/node_modules/abbrev/abbrev.js b/deps/npm/node_modules/abbrev/abbrev.js index 69cfeac521..7b1dc5d676 100644 --- a/deps/npm/node_modules/abbrev/abbrev.js +++ b/deps/npm/node_modules/abbrev/abbrev.js @@ -1,4 +1,3 @@ - module.exports = exports = abbrev.abbrev = abbrev abbrev.monkeyPatch = monkeyPatch diff --git a/deps/npm/node_modules/abbrev/package.json b/deps/npm/node_modules/abbrev/package.json index 17ac1cad32..5d637efee7 100644 --- a/deps/npm/node_modules/abbrev/package.json +++ b/deps/npm/node_modules/abbrev/package.json @@ -2,50 +2,51 @@ "_args": [ [ { - "raw": "abbrev@1.0.9", + "raw": "abbrev@latest", "scope": null, + "escapedName": "abbrev", "name": "abbrev", - "rawSpec": "1.0.9", - "spec": "1.0.9", - "type": "version" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "/Users/rebecca/code/npm" ] ], - "_from": "abbrev@1.0.9", - "_id": "abbrev@1.0.9", + "_from": "abbrev@latest", + "_id": "abbrev@1.1.0", "_inCache": true, - "_installable": true, "_location": "/abbrev", - "_nodeVersion": "4.4.4", + "_nodeVersion": "8.0.0-pre", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/abbrev-1.0.9.tgz_1466016055839_0.7825860097073019" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/abbrev-1.1.0.tgz_1487054000015_0.9229173036292195" }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "3.9.1", + "_npmVersion": "4.3.0", "_phantomChildren": {}, "_requested": { - "raw": "abbrev@1.0.9", + "raw": "abbrev@latest", "scope": null, + "escapedName": "abbrev", "name": "abbrev", - "rawSpec": "1.0.9", - "spec": "1.0.9", - "type": "version" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ "#USER", "/", - "/nopt", - "/tap/nyc/istanbul" + "/node-gyp/nopt", + "/nopt" ], - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "_shasum": "91b4792588a7738c25f35dd6f63752a2f8776135", + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", + "_shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f", "_shrinkwrap": null, - "_spec": "abbrev@1.0.9", + "_spec": "abbrev@latest", "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", @@ -57,17 +58,17 @@ "dependencies": {}, "description": "Like ruby's abbrev module, but in js", "devDependencies": { - "tap": "^5.7.2" + "tap": "^10.1" }, "directories": {}, "dist": { - "shasum": "91b4792588a7738c25f35dd6f63752a2f8776135", - "tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz" + "shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f", + "tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" }, "files": [ "abbrev.js" ], - "gitHead": "c386cd9dbb1d8d7581718c54d4ba944cc9298d6f", + "gitHead": "7136d4d95449dc44115d4f78b80ec907724f64e0", "homepage": "https://github.com/isaacs/abbrev-js#readme", "license": "ISC", "main": "abbrev.js", @@ -85,7 +86,10 @@ "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" }, "scripts": { - "test": "tap test.js --cov" + "postpublish": "git push origin --all; git push origin --tags", + "postversion": "npm publish", + "preversion": "npm test", + "test": "tap test.js --100" }, - "version": "1.0.9" + "version": "1.1.0" } diff --git a/deps/npm/node_modules/aproba/README.md b/deps/npm/node_modules/aproba/README.md index 8246a9cc6e..a9d38222a7 100644 --- a/deps/npm/node_modules/aproba/README.md +++ b/deps/npm/node_modules/aproba/README.md @@ -29,7 +29,8 @@ N | typeof == number F | typeof == function O | typeof == object and not type A and not type E B | typeof == boolean -E | instanceof Error OR null +E | instanceof Error OR null **(special: see below)** +Z | == null Validation failures throw one of three exception types, distinguished by a `code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. @@ -37,8 +38,37 @@ Validation failures throw one of three exception types, distinguished by a If you pass in an invalid type then it will throw with a code of `EUNKNOWNTYPE`. -If an error argument is found and is not null then the remaining arguments -will not be validated. +If an **error** argument is found and is not null then the remaining +arguments are optional. That is, if you say `ESO` then that's like using a +non-magical `E` in: `E|ESO|ZSO`. + +### But I have optional arguments?! + +You can provide more than one signature by separating them with pipes `|`. +If any signature matches the arguments then they'll be considered valid. + +So for example, say you wanted to write a signature for +`fs.createWriteStream`. The docs for it describe it thusly: + +``` +fs.createWriteStream(path[, options]) +``` + +This would be a signature of `SO|S`. That is, a string and and object, or +just a string. + +Now, if you read the full `fs` docs, you'll see that actually path can ALSO +be a buffer. And options can be a string, that is: +``` +path | +options | +``` + +To reproduce this you have to fully enumerate all of the possible +combinations and that implies a signature of `SO|SS|OO|OS|S|O`. The +awkwardness is a feature: It reminds you of the complexity you're adding to +your API when you do this sort of thing. + ### Why this exists diff --git a/deps/npm/node_modules/aproba/index.js b/deps/npm/node_modules/aproba/index.js index bb5ac3cda6..bc6ed1f17b 100644 --- a/deps/npm/node_modules/aproba/index.js +++ b/deps/npm/node_modules/aproba/index.js @@ -1,36 +1,64 @@ 'use strict' function isArguments (thingy) { - return typeof thingy === 'object' && thingy.hasOwnProperty('callee') + return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee') } var types = { - '*': ['any', function () { return true }], - A: ['array', function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }], - S: ['string', function (thingy) { return typeof thingy === 'string' }], - N: ['number', function (thingy) { return typeof thingy === 'number' }], - F: ['function', function (thingy) { return typeof thingy === 'function' }], - O: ['object', function (thingy) { return typeof thingy === 'object' && !types.A[1](thingy) && !types.E[1](thingy) }], - B: ['boolean', function (thingy) { return typeof thingy === 'boolean' }], - E: ['error', function (thingy) { return thingy instanceof Error }] -} - -var validate = module.exports = function (schema, args) { - if (!schema) throw missingRequiredArg(0, 'schema') + '*': {label: 'any', check: function () { return true }}, + A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }}, + S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }}, + N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }}, + F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }}, + O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }}, + B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }}, + E: {label: 'error', check: function (thingy) { return thingy instanceof Error }}, + Z: {label: 'null', check: function (thingy) { return thingy == null }} +} + +var validate = module.exports = function (rawSchemas, args) { + if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length) + if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas') if (!args) throw missingRequiredArg(1, 'args') - if (!types.S[1](schema)) throw invalidType(0, 'string', schema) - if (!types.A[1](args)) throw invalidType(1, 'array', args) - for (var ii = 0; ii < schema.length; ++ii) { - var type = schema[ii] - if (!types[type]) throw unknownType(ii, type) - var typeLabel = types[type][0] - var typeCheck = types[type][1] - if (type === 'E' && args[ii] == null) continue - if (args[ii] == null) throw missingRequiredArg(ii) - if (!typeCheck(args[ii])) throw invalidType(ii, typeLabel, args[ii]) - if (type === 'E') return + if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas) + if (!types.A.check(args)) throw invalidType(1, ['array'], args) + var schemas = rawSchemas.split('|') + var arity = {} + function addSchema (schema) { + var group = arity[schema.length] = arity[schema.length] || [] + if (group.indexOf(schema) === -1) group.push(schema) + } + schemas.forEach(function (schema) { + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + } + if (/E.*E/.test(schema)) throw moreThanOneError(schema) + addSchema(schema) + if (/E/.test(schema)) { + addSchema(schema.replace(/E.*$/, 'E')) + addSchema(schema.replace(/E/, 'Z')) + if (schema.length === 1) addSchema('') + } + }) + var matching = arity[args.length] + if (!matching) { + throw wrongNumberOfArgs(Object.keys(arity), args.length) + } + for (var ii = 0; ii < args.length; ++ii) { + var newMatching = matching.filter(function (schema) { + var type = schema[ii] + var typeCheck = types[type].check + return typeCheck(args[ii]) + }) + if (!newMatching.length) { + var labels = matching.map(function (schema) { + return types[schema[ii]].label + }).filter(function (schema) { return schema != null }) + throw invalidType(ii, labels, args[ii]) + } + matching = newMatching } - if (schema.length < args.length) throw tooManyArgs(schema.length, args.length) } function missingRequiredArg (num) { @@ -41,17 +69,30 @@ function unknownType (num, type) { return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1)) } -function invalidType (num, expectedType, value) { +function invalidType (num, expectedTypes, value) { var valueType Object.keys(types).forEach(function (typeCode) { - if (types[typeCode][1](value)) valueType = types[typeCode][0] + if (types[typeCode].check(value)) valueType = types[typeCode].label }) return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' + - expectedType + ' but got ' + valueType) + englishList(expectedTypes) + ' but got ' + valueType) +} + +function englishList (list) { + return list.join(', ').replace(/, ([^,]+)$/, ' or $1') +} + +function wrongNumberOfArgs (expected, got) { + var english = englishList(expected) + var args = expected.every(function (ex) { return ex.length === 1 }) + ? 'argument' + : 'arguments' + return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got) } -function tooManyArgs (expected, got) { - return newException('ETOOMANYARGS', 'Too many arguments, expected ' + expected + ' and got ' + got) +function moreThanOneError (schema) { + return newException('ETOOMANYERRORTYPES', + 'Only one error type per argument signature is allowed, more than one found in "' + schema + '"') } function newException (code, msg) { diff --git a/deps/npm/node_modules/aproba/package.json b/deps/npm/node_modules/aproba/package.json index b5e08a31c1..dfe2377542 100644 --- a/deps/npm/node_modules/aproba/package.json +++ b/deps/npm/node_modules/aproba/package.json @@ -2,52 +2,51 @@ "_args": [ [ { - "raw": "aproba@~1.0.3", + "raw": "aproba@latest", "scope": null, "escapedName": "aproba", "name": "aproba", - "rawSpec": "~1.0.3", - "spec": ">=1.0.3 <1.1.0", - "type": "range" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "aproba@>=1.0.3 <1.1.0", - "_id": "aproba@1.0.4", + "_from": "aproba@latest", + "_id": "aproba@1.1.1", "_inCache": true, - "_installable": true, "_location": "/aproba", - "_nodeVersion": "4.4.0", + "_nodeVersion": "7.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/aproba-1.0.4.tgz_1466718885402_0.5348939662799239" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/aproba-1.1.1.tgz_1486593129508_0.5718816472217441" }, "_npmUser": { "name": "iarna", "email": "me@re-becca.org" }, - "_npmVersion": "3.10.2", + "_npmVersion": "4.2.0", "_phantomChildren": {}, "_requested": { - "raw": "aproba@~1.0.3", + "raw": "aproba@latest", "scope": null, "escapedName": "aproba", "name": "aproba", - "rawSpec": "~1.0.3", - "spec": ">=1.0.3 <1.1.0", - "type": "range" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ "#USER", "/", "/npmlog/gauge" ], - "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.0.4.tgz", - "_shasum": "2713680775e7614c8ba186c065d4e2e52d1072c0", + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz", + "_shasum": "95d3600f07710aa0e9298c726ad5ecf2eacbabab", "_shrinkwrap": null, - "_spec": "aproba@~1.0.3", - "_where": "/Users/rebecca/code/npm", + "_spec": "aproba@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Rebecca Turner", "email": "me@re-becca.org" @@ -58,20 +57,20 @@ "dependencies": {}, "description": "A rediculously light-weight argument validator", "devDependencies": { - "standard": "^7.1.2", - "tap": "^5.7.3" + "standard": "^8.6.0", + "tap": "^10.0.2" }, "directories": { "test": "test" }, "dist": { - "shasum": "2713680775e7614c8ba186c065d4e2e52d1072c0", - "tarball": "https://registry.npmjs.org/aproba/-/aproba-1.0.4.tgz" + "shasum": "95d3600f07710aa0e9298c726ad5ecf2eacbabab", + "tarball": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz" }, "files": [ "index.js" ], - "gitHead": "c6c8f82d519b9ec3816f20f23a9101083c022200", + "gitHead": "e7c76b4b42356092db3cd9e2d9388a0134845eb2", "homepage": "https://github.com/iarna/aproba", "keywords": [ "argument", @@ -93,7 +92,7 @@ "url": "git+https://github.com/iarna/aproba.git" }, "scripts": { - "test": "standard && tap test/*.js" + "test": "standard && tap -j3 test/*.js" }, - "version": "1.0.4" + "version": "1.1.1" } diff --git a/deps/npm/node_modules/bluebird/LICENSE b/deps/npm/node_modules/bluebird/LICENSE new file mode 100644 index 0000000000..ae732d5299 --- /dev/null +++ b/deps/npm/node_modules/bluebird/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2017 Petka Antonov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/bluebird/README.md b/deps/npm/node_modules/bluebird/README.md new file mode 100644 index 0000000000..538b182ef1 --- /dev/null +++ b/deps/npm/node_modules/bluebird/README.md @@ -0,0 +1,50 @@ + + Promises/A+ logo + +[![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird) +[![coverage-98%](http://img.shields.io/badge/coverage-98%-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html) + +**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises) + +# Introduction + +Bluebird is a fully featured promise library with focus on innovative features and performance + +See the [**bluebird website**](http://bluebirdjs.com/docs/getting-started.html) for further documentation, references and instructions. See the [**API reference**](http://bluebirdjs.com/docs/api-reference.html) here. + +For bluebird 2.x documentation and files, see the [2.x tree](https://github.com/petkaantonov/bluebird/tree/2.x). + +# Questions and issues + +The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`. + + + +## Thanks + +Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8. + +# License + +The MIT License (MIT) + +Copyright (c) 2013-2017 Petka Antonov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/bluebird/changelog.md b/deps/npm/node_modules/bluebird/changelog.md new file mode 100644 index 0000000000..73b2eb6c79 --- /dev/null +++ b/deps/npm/node_modules/bluebird/changelog.md @@ -0,0 +1 @@ +[http://bluebirdjs.com/docs/changelog.html](http://bluebirdjs.com/docs/changelog.html) diff --git a/deps/npm/node_modules/bluebird/js/browser/bluebird.core.js b/deps/npm/node_modules/bluebird/js/browser/bluebird.core.js new file mode 100644 index 0000000000..3ed2f6a689 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/browser/bluebird.core.js @@ -0,0 +1,3777 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.5.0 + * Features enabled: core + * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":17,"./schedule":18,"./util":21}],2:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],3:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":15}],4:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":21}],5:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":10,"./util":21}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + async.invokeLater(this._notifyUnhandledRejection, this, undefined); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":9,"./util":21}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":10,"./util":21}],10:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":5,"./util":21}],12:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":21}],13:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":21}],14:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":9,"./es5":10,"./util":21}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = _dereq_("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.0"; + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":21}],17:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],18:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":21}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],20:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":21}],21:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"; +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":10}]},{},[3])(3) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/deps/npm/node_modules/bluebird/js/browser/bluebird.core.min.js b/deps/npm/node_modules/bluebird/js/browser/bluebird.core.min.js new file mode 100644 index 0000000000..a556a428d9 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/browser/bluebird.core.min.js @@ -0,0 +1,31 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.5.0 + * Features enabled: core + * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(a,s){if(!e[a]){if(!t[a]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=s},{"./queue":17,"./schedule":18,"./util":21}],2:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var f={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,a,void 0,u,f),l._then(s,c,void 0,u,f),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],3:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":15}],4:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],7:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+I.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function a(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?I.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function s(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function f(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function h(){this._trace=new x(this._peekContext())}function _(t,e){if(H(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=E(t);I.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),I.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&X){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),c=C(s),l=c.length-1;l>=0;--l){var u=c[l];if(!V.test(u)){var p=u.match(Q);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var f=c[0],l=0;l0&&(a="\n"+s[l-1]);break}}var h="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;r._warn(h,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new U(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var a=E(o);o.stack=a.message+"\n"+a.stack.join("\n")}tt("warning",o)||k(o,"",!0)}}function g(t,e){for(var n=0;n=0;--s)if(r[s]===o){a=s;break}for(var s=a;s>=0;--s){var c=r[s];if(e[i]!==c)break;e.pop(),i--}e=r}}function C(t){for(var e=[],n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function E(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?w(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:C(e)}}function k(t,e,n){if("undefined"!=typeof console){var r;if(I.isObject(t)){var i=t.stack;r=e+G(i,t)}else r=e+String(t);"function"==typeof L?L(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function j(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){B.throwLater(o)}"unhandledRejection"===t?tt(t,n,r)||i||k(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():I.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+T(e)+">, no stack trace)"}function T(t){var e=41;return t.lengtha||0>s||!n||!r||n!==r||a>=s||(nt=function(t){if(D.test(t))return!0;var e=R(t);return e&&e.fileName===n&&a<=e.line&&e.line<=s?!0:!1})}}function x(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,x),e>32&&this.uncycle()}var O,A,L,N=e._getDomain,B=e._async,U=t("./errors").Warning,I=t("./util"),H=I.canAttachTrace,D=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,V=/\((?:timers\.js):\d+:\d+\)/,Q=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,G=null,M=!1,W=!(0==I.env("BLUEBIRD_DEBUG")||!I.env("BLUEBIRD_DEBUG")&&"development"!==I.env("NODE_ENV")),$=!(0==I.env("BLUEBIRD_WARNINGS")||!W&&!I.env("BLUEBIRD_WARNINGS")),z=!(0==I.env("BLUEBIRD_LONG_STACK_TRACES")||!W&&!I.env("BLUEBIRD_LONG_STACK_TRACES")),X=0!=I.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&($||!!I.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),B.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){j("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),j("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=N();A="function"==typeof t?null===e?t:I.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=N();O="function"==typeof t?null===e?t:I.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(B.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&P()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(B.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),B.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=h,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),B.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&P()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return I.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!I.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return I.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!I.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),I.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!I.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Y=function(){return I.isNode?function(){return process.emit.apply(process,arguments)}:I.global?function(t){var e="on"+t.toLowerCase(),n=I.global[e];return n?(n.apply(I.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(n){B.throwLater(n),e=!0}var r=!1;try{r=J(t,Z[t].apply(null,arguments))}catch(n){B.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,X=ot.warnings,I.isObject(n)&&"wForgottenReturn"in n&&(X=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(B.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=s,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=a,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;I.inherits(x,Error),n.CapturedTrace=x,x.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var a=e[r].stack,s=n[a];if(void 0!==s&&s!==r){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>s?(c._parent=e[s+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},x.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=E(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(C(i.stack.split("\n"))),i=i._parent;b(r),m(r),I.notEnumerableProp(t,"stack",g(n,r)),I.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,G=e;var n=Error.captureStackTrace;return nt=function(t){return D.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,G=e,M=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(G=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,G=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(L=function(t){console.warn(t)},I.isNode&&process.stderr.isTTY?L=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:I.isNode||"string"!=typeof(new Error).stack||(L=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:$,longStackTraces:!1,cancellation:!1,monitoring:!1};return z&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return f},checkForgottenReturns:d,setBounds:S,warn:y,deprecated:v,CapturedTrace:x,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":9,"./util":21}],8:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],9:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,a,s=t("./es5"),c=s.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,f=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(v){o=r("TypeError","type error"),a=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function s(){return l.call(this,this.promise._target()._settledValue())}function c(t){return a(this,t)?void 0:(f.e=t,f)}function l(t){var i=this.promise,l=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?l.call(i._boundValue()):l.call(i._boundValue(),t);if(u===r)return u;if(void 0!==u){i._setReturnedNonUndefined();var h=n(u,i);if(h instanceof e){if(null!=this.cancelPromise){if(h._isCancelled()){var _=new p("late cancellation observer");return i._attachExtraTrace(_),f.e=_,f}h.isPending()&&h._attachCancellationCallback(new o(this))}return h._then(s,c,void 0,this,void 0)}}}return i.isRejected()?(a(this),f.e=t,f):(a(this),t)}var u=t("./util"),p=e.CancellationError,f=u.errorObj,h=t("./catch_filter")(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){a(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new i(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,l,l)},e.prototype.tap=function(t){return this._passThrough(t,1,l)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,l);var r,i=new Array(n-1),o=0;for(r=0;n-1>r;++r){var a=arguments[r];if(!u.isObject(a))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+u.classString(a)));i[o++]=a}i.length=o;var s=arguments[r];return this._passThrough(h(i,s,this),1,void 0,l)},i}},{"./catch_filter":5,"./util":21}],12:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,a){var s=t("./util");s.canEvaluate,s.tryCatch,s.errorObj;e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":21}],13:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var a=t("./util"),s=a.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=s(t).apply(this,arguments),a=r._popContext();return o.checkForgottenReturns(i,a,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+a.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=a.isArray(l)?s(t).apply(u,l):s(t).call(u,l)}else c=s(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":21}],14:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!h.isObject(o))return p("Catch statement predicate: expecting an object but got "+h.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(F.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+h.classString(t);arguments.length>1&&(n+=", "+h.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+h.classString(t)):this.all()._then(t,void 0,void 0,C,void 0); +},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new k(this).promise()},i.prototype.error=function(t){return this.caught(h.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=x(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new k(t).promise()},i.cast=function(t){var e=E(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new g("expecting a function but got "+h.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var a=void 0!==o,s=a?o:new i(b),l=this._target(),u=l._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var p=c();if(0!==(50397184&u)){var f,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,f=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,f=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new m("late cancellation observer"),l._attachExtraTrace(_),f=e),v.invoke(d,l,{handler:null===p?f:"function"==typeof f&&h.domainBind(p,f),promise:s,receiver:r,value:_})}else l._addCallbacks(t,e,s,r,p);return s},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===f?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=f),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=f),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:h.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:h.domainBind(i,e));else{var a=4*o-4;this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===i?t:h.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:h.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=E(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0===(50397184&o)){var a=this._length();a>0&&r._migrateCallback0(this);for(var s=1;a>s;++s)r._migrateCallbackAt(this,s);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var c=new m("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=h.ensureErrorObject(t),i=r===t;if(!i&&!n&&F.warnings()){var o="a promise was rejected with a non-error: "+h.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){if(t!==b){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===C?n&&"number"==typeof n.length?o=x(t).apply(this._boundValue(),n):(o=S,o.e=new g("cannot .spread() a non-array: "+h.classString(n))):o=x(t).call(e,n);var a=r._popContext();i=r._bitField,0===(65536&i)&&(o===w?r._reject(n):o===S?r._rejectCallback(o.e,!1):(F.checkForgottenReturns(o,a,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var a=t instanceof i,s=this._bitField,c=0!==(134217728&s);0!==(65536&s)?(a&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,x(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):a||t instanceof k?t._cancel():r.cancel()):"function"==typeof e?a?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&s)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):a&&(c&&t._setAsyncGuaranteed(),0!==(33554432&s)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,h.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){F.deprecated("Promise.defer","new Promise");var t=new i(b);return{promise:t,resolve:o,reject:a}},h.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,E,p,F),t("./bind")(i,b,E,F),t("./cancel")(i,k,p,F),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,k,E,b,v,c),i.Promise=i,i.version="3.5.0",h.toFastProperties(i),h.toFastProperties(i.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new i(b)),F.setBounds(d.firstLineError,h.lastLineError),i}},{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function a(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function s(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var s=o._bitField;if(this._values=o,0===(50397184&s))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&s))return 0!==(16777216&s)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(a(n))):void this._iterate(o)},s.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,a=null,s=0;n>s;++s){var c=r(t[s],i);c instanceof e?(c=c._target(),a=c._bitField):a=null,o?null!==a&&c.suppressUnhandledRejections():null!==a?0===(50397184&a)?(c._proxy(this,s),this._values[s]=c):o=0!==(33554432&a)?this._promiseFulfilled(c._value(),s):0!==(16777216&a)?this._promiseRejected(c._reason(),s):this._promiseCancelled(s):o=this._promiseFulfilled(c,s)}o||i._setAsyncGuaranteed()},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;no;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityn;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function f(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function h(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return L.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function g(t){try{u(t,"isOperational",!0)}catch(e){}}function m(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function C(t){return{}.toString.call(t)}function w(t,e,n){for(var r=F.names(t),i=0;i10||t[0]>0}(),D.isNode&&D.toFastProperties(process);try{throw new Error}catch(V){D.lastLineError=V}e.exports=D},{"./es5":10}]},{},[3])(3)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/deps/npm/node_modules/bluebird/js/browser/bluebird.js b/deps/npm/node_modules/bluebird/js/browser/bluebird.js new file mode 100644 index 0000000000..8dd65f2870 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/browser/bluebird.js @@ -0,0 +1,5619 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.5.0 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],4:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":22}],5:[function(_dereq_,module,exports){ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!true) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var args = [].slice.call(arguments, 1);; + if (!true) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; + +},{"./util":36}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":36}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + async.invokeLater(this._notifyUnhandledRejection, this, undefined); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + + +},{}],12:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],14:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; + +},{}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":7,"./util":36}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = _dereq_("./errors"); +var TypeError = errors.TypeError; +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; + +},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":36}],18:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : util.domainBind(domain, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; + +},{"./util":36}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":36}],20:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var util = _dereq_("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; + +},{"./util":36}],22:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = _dereq_("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.0"; +_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./call_get.js')(Promise); +_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +_dereq_('./timers.js')(Promise, INTERNAL, debug); +_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +_dereq_('./nodeify.js')(Promise); +_dereq_('./promisify.js')(Promise, INTERNAL); +_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./settle.js')(Promise, PromiseArray, debug); +_dereq_('./some.js')(Promise, PromiseArray, apiRejection); +_dereq_('./filter.js')(Promise, INTERNAL); +_dereq_('./each.js')(Promise, INTERNAL); +_dereq_('./any.js')(Promise); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":36}],24:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = _dereq_("./util"); +var nodebackForPromise = _dereq_("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = _dereq_("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!true) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + + +},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); +var isObject = util.isObject; +var es5 = _dereq_("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; + +},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],27:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; + +},{"./util":36}],28:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : util.domainBind(domain, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; + +},{"./util":36}],29:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":36}],30:[function(_dereq_,module,exports){ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = _dereq_("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; + +},{"./util":36}],31:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = _dereq_("./util"); +var RangeError = _dereq_("./errors").RangeError; +var AggregateError = _dereq_("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; + +},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":36}],34:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = _dereq_("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; + +},{"./util":36}],35:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = _dereq_("./util"); + var TypeError = _dereq_("./errors").TypeError; + var inherits = _dereq_("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; + +},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"; +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":13}]},{},[4])(4) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/deps/npm/node_modules/bluebird/js/browser/bluebird.min.js b/deps/npm/node_modules/bluebird/js/browser/bluebird.min.js new file mode 100644 index 0000000000..5d0bac8f89 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/browser/bluebird.min.js @@ -0,0 +1,31 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.5.0 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=r,e.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";function r(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=r,e.exports=o},{"./promise":22}],5:[function(t,e,n){"use strict";var r=Object.create;if(r){var i=r(null),o=r(null);i[" size"]=o[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,e){return{promise:e}}function i(){return!1}function o(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function a(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function f(){this._trace=new S(this._peekContext())}function _(t,e){if(N(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=j(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function d(t,e,n,r,i){if(void 0===t&&null!==e&&W){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&r._bitField))return;n&&(n+=" ");var o="",s="";if(e._trace){for(var a=e._trace.stack.split("\n"),c=w(a),l=c.length-1;l>=0;--l){var u=c[l];if(!U.test(u)){var p=u.match(M);p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ");break}}if(c.length>0)for(var h=c[0],l=0;l0&&(s="\n"+a[l-1]);break}}var f="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(f,!0,e)}}function v(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),y(n)}function y(t,n,r){if(ot.warnings){var i,o=new L(t);if(n)r._attachExtraTrace(o);else if(ot.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=j(o);o.stack=s.message+"\n"+s.stack.join("\n")}tt("warning",o)||E(o,"",!0)}}function m(t,e){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function w(t){for(var e=[],n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}function j(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?C(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:w(e)}}function E(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+Q(i,t)}else r=e+String(t);"function"==typeof D?D(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function k(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){I.throwLater(o)}"unhandledRejection"===t?tt(t,n,r)||i||E(n,"Unhandled rejection "):tt(t,r)}function F(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.lengths||0>a||!n||!r||n!==r||s>=a||(nt=function(t){if(B.test(t))return!0;var e=P(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function S(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);it(this,S),e>32&&this.uncycle()}var O,A,D,V=e._getDomain,I=e._async,L=t("./errors").Warning,H=t("./util"),N=H.canAttachTrace,B=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,U=/\((?:timers\.js):\d+:\d+\)/,M=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,q=null,Q=null,$=!1,G=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),z=!(0==H.env("BLUEBIRD_WARNINGS")||!G&&!H.env("BLUEBIRD_WARNINGS")),X=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!H.env("BLUEBIRD_LONG_STACK_TRACES")),W=0!=H.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(z||!!H.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),I.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){k("rejectionHandled",O,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),k("unhandledRejection",A,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return y(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=V();A="function"==typeof t?null===e?t:H.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=V();O="function"==typeof t?null===e?t:H.domainBind(e,t):void 0};var K=function(){};e.longStackTraces=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!ot.longStackTraces&&T()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;ot.longStackTraces=!0,K=function(){if(I.haveItemsQueued()&&!ot.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),I.enableTrampoline(),ot.longStackTraces=!1},e.prototype._captureStackTrace=f,e.prototype._attachExtraTrace=_,n.activateLongStackTraces(),I.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return ot.longStackTraces&&T()};var J=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!H.global.dispatchEvent(n)}}if("function"==typeof Event){var t=new Event("CustomEvent");return H.global.dispatchEvent(t),function(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0});return n.detail=e,!H.global.dispatchEvent(n)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),H.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!H.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Y=function(){return H.isNode?function(){return process.emit.apply(process,arguments)}:H.global?function(t){var e="on"+t.toLowerCase(),n=H.global[e];return n?(n.apply(H.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:r},tt=function(t){var e=!1;try{e=Y.apply(null,arguments)}catch(n){I.throwLater(n),e=!0}var r=!1;try{r=J(t,Z[t].apply(null,arguments))}catch(n){I.throwLater(n),r=!0}return r||e};e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&K()),"warnings"in t){var n=t.warnings;ot.warnings=!!n,W=ot.warnings,H.isObject(n)&&"wForgottenReturn"in n&&(W=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!ot.cancellation){if(I.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=l,e.prototype._propagateFrom=u,e.prototype._onCancel=a,e.prototype._setOnCancel=c,e.prototype._attachCancellationCallback=s,e.prototype._execute=o,et=u,ot.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!ot.monitoring?(ot.monitoring=!0,e.prototype._fireEvent=tt):!t.monitoring&&ot.monitoring&&(ot.monitoring=!1,e.prototype._fireEvent=i)),e},e.prototype._fireEvent=i,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var et=p,nt=function(){return!1},rt=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(S,Error),n.CapturedTrace=S,S.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},S.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(w(i.stack.split("\n"))),i=i._parent;b(r),g(r),H.notEnumerableProp(t,"stack",m(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var it=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():F(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,q=t,Q=e;var n=Error.captureStackTrace;return nt=function(t){return B.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return q=/@/,Q=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(Q=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?F(e):e.toString()},null):(q=t,Q=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(D=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?D=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:H.isNode||"string"!=typeof(new Error).stack||(D=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var ot={warnings:z,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&e.longStackTraces(),{longStackTraces:function(){return ot.longStackTraces},warnings:function(){return ot.warnings},cancellation:function(){return ot.cancellation},monitoring:function(){return ot.monitoring},propagateFromFunction:function(){return et},boundValueFunction:function(){return h},checkForgottenReturns:d,setBounds:R,warn:y,deprecated:v,CapturedTrace:S,fireDomEvent:J,fireGlobalEvent:Y}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,r){return i(t,r,e,0)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e,n){"use strict";function r(t,e){function n(r){return this instanceof n?(p(this,"message","string"==typeof r?r:e),p(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return u(n,Error),n}function i(t){return this instanceof i?(p(this,"name","OperationalError"),p(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(p(this,"message",t.message),p(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5"),c=a.freeze,l=t("./util"),u=l.inherits,p=l.notEnumerableProp,h=r("Warning","warning"),f=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),d=r("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=r("TypeError","type error"),s=r("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),m=0;m1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function a(){return l.call(this,this.promise._target()._settledValue())}function c(t){return s(this,t)?void 0:(h.e=t,h)}function l(t){var i=this.promise,l=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?l.call(i._boundValue()):l.call(i._boundValue(),t);if(u===r)return u;if(void 0!==u){i._setReturnedNonUndefined();var f=n(u,i);if(f instanceof e){if(null!=this.cancelPromise){if(f._isCancelled()){var _=new p("late cancellation observer");return i._attachExtraTrace(_),h.e=_,h}f.isPending()&&f._attachCancellationCallback(new o(this))}return f._then(a,c,void 0,this,void 0)}}}return i.isRejected()?(s(this),h.e=t,h):(s(this),t)}var u=t("./util"),p=e.CancellationError,h=u.errorObj,f=t("./catch_filter")(r);return i.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){s(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new i(this,e,t),void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,l,l)},e.prototype.tap=function(t){return this._passThrough(t,1,l)},e.prototype.tapCatch=function(t){var n=arguments.length;if(1===n)return this._passThrough(t,1,void 0,l);var r,i=new Array(n-1),o=0;for(r=0;n-1>r;++r){var s=arguments[r];if(!u.isObject(s))return e.reject(new TypeError("tapCatch statement predicate: expecting an object but got "+u.classString(s)));i[o++]=s}i.length=o;var a=arguments[r];return this._passThrough(f(i,a,this),1,void 0,l)},i}},{"./catch_filter":7,"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function c(t,n,i,o){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var s=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));s=i.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(t,n,s,o).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=e._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var m=++this._totalResolved;return m>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";function r(t){return t instanceof Error&&u.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=u.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!f.isObject(o))return p("Catch statement predicate: expecting an object but got "+f.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,P(r,t,this))}return this.then(void 0,t)},i.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},i.prototype.then=function(t,e){if(x.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+f.classString(t);arguments.length>1&&(n+=", "+f.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},i.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},i.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+f.classString(t)):this.all()._then(t,void 0,void 0,w,void 0)},i.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},i.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new E(this).promise()},i.prototype.error=function(t){return this.caught(f.originatesFromRejection,t)},i.getNewLibraryCopy=e.exports,i.is=function(t){return t instanceof i},i.fromNode=i.fromCallback=function(t){var e=new i(b);e._captureStackTrace();var n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,r=O(t)(R(e,n));return r===S&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},i.all=function(t){return new E(t).promise()},i.cast=function(t){var e=j(t);return e instanceof i||(e=new i(b),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},i.resolve=i.fulfilled=i.cast,i.reject=i.rejected=function(t){var e=new i(b);return e._captureStackTrace(),e._rejectCallback(t,!0),e},i.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));return v.setScheduler(t)},i.prototype._then=function(t,e,n,r,o){var s=void 0!==o,a=s?o:new i(b),l=this._target(),u=l._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!==(2097152&this._bitField)&&(r=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var p=c();if(0!==(50397184&u)){var h,_,d=l._settlePromiseCtx;0!==(33554432&u)?(_=l._rejectionHandler0,h=t):0!==(16777216&u)?(_=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(d=l._settlePromiseLateCancellationObserver,_=new g("late cancellation observer"),l._attachExtraTrace(_),h=e),v.invoke(d,l,{handler:null===p?h:"function"==typeof h&&f.domainBind(p,h),promise:a,receiver:r,value:_})}else l._addCallbacks(t,e,a,r,p);return a},i.prototype._length=function(){return 65535&this._bitField},i.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},i.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},i.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},i.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},i.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},i.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},i.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},i.prototype._isFinal=function(){return(4194304&this._bitField)>0},i.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},i.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},i.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},i.prototype._setAsyncGuaranteed=function(){v.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},i.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===h?void 0:void 0===e&&this._isBound()?this._boundValue():e},i.prototype._promiseAt=function(t){return this[4*t-4+2]},i.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},i.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},i.prototype._boundValue=function(){},i.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,n,r,i,null)},i.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(n,r,i,o,null)},i.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:f.domainBind(i,e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:f.domainBind(i,t)),"function"==typeof e&&(this[s+1]=null===i?e:f.domainBind(i,e))}return this._setLength(o+1),o},i.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},i.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var n=j(t,this);if(!(n instanceof i))return this._fulfill(t);e&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(l());var o=r._bitField;if(0===(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;s>a;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!==(33554432&o))this._fulfill(r._value());else if(0!==(16777216&o))this._reject(r._reason());else{var c=new g("late cancellation observer");r._attachExtraTrace(c),this._reject(c)}}},i.prototype._rejectCallback=function(t,e,n){var r=f.ensureErrorObject(t),i=r===t;if(!i&&!n&&x.warnings()){var o="a promise was rejected with a non-error: "+f.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},i.prototype._resolveFromExecutor=function(t){if(t!==b){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)}},i.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===w?n&&"number"==typeof n.length?o=O(t).apply(this._boundValue(),n):(o=S,o.e=new m("cannot .spread() a non-array: "+f.classString(n))):o=O(t).call(e,n);var s=r._popContext();i=r._bitField,0===(65536&i)&&(o===C?r._reject(n):o===S?r._rejectCallback(o.e,!1):(x.checkForgottenReturns(o,s,"",r,this),r._resolveCallback(o)))}},i.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},i.prototype._followee=function(){return this._rejectionHandler0},i.prototype._setFollowee=function(t){this._rejectionHandler0=t},i.prototype._settlePromise=function(t,e,r,o){var s=t instanceof i,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),r instanceof T&&r.isFinallyHandler()?(r.cancelPromise=t,O(e).call(r,o)===S&&t._reject(S.e)):e===u?t._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(t):s||t instanceof E?t._cancel():r.cancel()):"function"==typeof e?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,r,o,t)):e.call(r,o,t):r instanceof n?r._isResolved()||(0!==(33554432&a)?r._promiseFulfilled(o,t):r._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},i.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,r=t.receiver,o=t.value;"function"==typeof e?n instanceof i?this._settlePromiseFromHandler(e,r,o,n):e.call(r,o,n):n instanceof i&&n._reject(o)},i.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},i.prototype._settlePromise0=function(t,e,n){var r=this._promise0,i=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)},i.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},i.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=l();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():v.settlePromises(this))}},i.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?v.fatalError(t,f.isNode):void((65535&e)>0?v.settlePromises(this):this._ensurePossibleRejectionHandled())},i.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},i.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},i.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},i.defer=i.pending=function(){x.deprecated("Promise.defer","new Promise");var t=new i(b);return{promise:t,resolve:o,reject:s}},f.notEnumerableProp(i,"_makeSelfResolutionError",l),t("./method")(i,b,j,p,x),t("./bind")(i,b,j,x),t("./cancel")(i,E,p,x),t("./direct_resolve")(i),t("./synchronous_inspection")(i),t("./join")(i,E,j,b,v,c),i.Promise=i,i.version="3.5.0",t("./map.js")(i,E,p,j,b,x),t("./call_get.js")(i),t("./using.js")(i,p,j,F,b,x),t("./timers.js")(i,b,x),t("./generators.js")(i,p,b,j,n,x),t("./nodeify.js")(i),t("./promisify.js")(i,b),t("./props.js")(i,E,j,p),t("./race.js")(i,b,j,p),t("./reduce.js")(i,E,p,j,b,x),t("./settle.js")(i,E,x),t("./some.js")(i,E,p),t("./filter.js")(i,b),t("./each.js")(i,b),t("./any.js")(i),f.toFastProperties(i),f.toFastProperties(i.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new i(b)),x.setBounds(d.firstLineError,f.lastLineError),i}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var c=t("./util");c.isArray;return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;nc;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===k)t[_]=k(u,h,u,p,e,i);else{var d=r(p,function(){return k(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return k(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,m=t("./errors").TypeError,g="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},k=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new m("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new m("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=g);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=k),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;ao;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,n?-6:-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function r(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:f.domainBind(s,n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,i===o?this._eachValues=Array(this._length):0===i?this._eachValues=null:this._eachValues=void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&null!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return null!==this._eachValues&&this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e,n){"use strict";var r,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")},s=i.getNativePromise();if(i.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,c=process.nextTick;r=i.isRecentNode?function(t){a.call(global,t)}:function(t){c.call(process,t)}}else if("function"==typeof s&&"function"==typeof s.resolve){var l=s.resolve();r=function(t){l.then(t)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,r=document.createElement("div"),i=new MutationObserver(function(){t.classList.toggle("foo"),n=!1});i.observe(r,e);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(t,e),o()}}();e.exports=r},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t), +this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){try{return p.call(t,"_promise0")}catch(e){return!1}}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,r){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function s(t){throw clearTimeout(this.handle),t}var a=t("./util"),c=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var l=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,o){var s,a;return void 0!==o?(s=e.resolve(o)._then(l,null,null,t,void 0),r.cancellation()&&o instanceof e&&s._setOnCancel(o)):(s=new e(n),a=setTimeout(function(){s._fulfill()},+t),r.cancellation()&&s._setOnCancel(new i(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};e.prototype.delay=function(t){return u(t,this)};var p=function(t,e,n){var r;r="string"!=typeof e?e instanceof Error?e:new c("operation timed out"):new c(e),a.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),null!=n&&n.cancel()};e.prototype.timeout=function(t,e){t=+t;var n,a,c=new i(setTimeout(function(){n.isPending()&&p(n,e,a)},t));return r.cancellation()?(a=this.then(),n=a._then(o,s,void 0,c,void 0),n._setOnCancel(c)):n=this._then(o,s,void 0,c,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,m=_.tryCatch,g={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():g},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=e!==g?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var g=r(d);g instanceof e&&(d=g._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=P;return P=null,t.apply(this,arguments)}catch(e){return T.e=e,T}}function i(t){return P=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!F.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return F.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=F.names(t.prototype),n=F.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=A.test(t+"")&&F.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return D.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function m(t){try{u(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function b(t){return y(t)&&F.propertyIsWritable(t,"stack")}function w(t){return{}.toString.call(t)}function C(t,e,n){for(var r=F.names(t),i=0;i10||t[0]>0}(),B.isNode&&B.toFastProperties(process);try{throw new Error}catch(U){B.lastLineError=U}e.exports=B},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/deps/npm/node_modules/bluebird/js/release/any.js b/deps/npm/node_modules/bluebird/js/release/any.js new file mode 100644 index 0000000000..05a6228ef9 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/any.js @@ -0,0 +1,21 @@ +"use strict"; +module.exports = function(Promise) { +var SomePromiseArray = Promise._SomePromiseArray; +function any(promises) { + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(1); + ret.setUnwrap(); + ret.init(); + return promise; +} + +Promise.any = function (promises) { + return any(promises); +}; + +Promise.prototype.any = function () { + return any(this); +}; + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/assert.js b/deps/npm/node_modules/bluebird/js/release/assert.js new file mode 100644 index 0000000000..4518231a1b --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/assert.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = (function(){ +var AssertionError = (function() { + function AssertionError(a) { + this.constructor$(a); + this.message = a; + this.name = "AssertionError"; + } + AssertionError.prototype = new Error(); + AssertionError.prototype.constructor = AssertionError; + AssertionError.prototype.constructor$ = Error; + return AssertionError; +})(); + +function getParams(args) { + var params = []; + for (var i = 0; i < args.length; ++i) params.push("arg" + i); + return params; +} + +function nativeAssert(callName, args, expect) { + try { + var params = getParams(args); + var constructorArgs = params; + constructorArgs.push("return " + + callName + "("+ params.join(",") + ");"); + var fn = Function.apply(null, constructorArgs); + return fn.apply(null, args); + } catch (e) { + if (!(e instanceof SyntaxError)) { + throw e; + } else { + return expect; + } + } +} + +return function assert(boolExpr, message) { + if (boolExpr === true) return; + + if (typeof boolExpr === "string" && + boolExpr.charAt(0) === "%") { + var nativeCallName = boolExpr; + var $_len = arguments.length;var args = new Array(Math.max($_len - 2, 0)); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];}; + if (nativeAssert(nativeCallName, args, message) === message) return; + message = (nativeCallName + " !== " + message); + } + + var ret = new AssertionError(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(ret, assert); + } + throw ret; +}; +})(); diff --git a/deps/npm/node_modules/bluebird/js/release/async.js b/deps/npm/node_modules/bluebird/js/release/async.js new file mode 100644 index 0000000000..41f6655647 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/async.js @@ -0,0 +1,161 @@ +"use strict"; +var firstLineError; +try {throw new Error(); } catch (e) {firstLineError = e;} +var schedule = require("./schedule"); +var Queue = require("./queue"); +var util = require("./util"); + +function Async() { + this._customScheduler = false; + this._isTickUsed = false; + this._lateQueue = new Queue(16); + this._normalQueue = new Queue(16); + this._haveDrainedQueues = false; + this._trampolineEnabled = true; + var self = this; + this.drainQueues = function () { + self._drainQueues(); + }; + this._schedule = schedule; +} + +Async.prototype.setScheduler = function(fn) { + var prev = this._schedule; + this._schedule = fn; + this._customScheduler = true; + return prev; +}; + +Async.prototype.hasCustomScheduler = function() { + return this._customScheduler; +}; + +Async.prototype.enableTrampoline = function() { + this._trampolineEnabled = true; +}; + +Async.prototype.disableTrampolineIfNecessary = function() { + if (util.hasDevTools) { + this._trampolineEnabled = false; + } +}; + +Async.prototype.haveItemsQueued = function () { + return this._isTickUsed || this._haveDrainedQueues; +}; + + +Async.prototype.fatalError = function(e, isNode) { + if (isNode) { + process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) + + "\n"); + process.exit(2); + } else { + this.throwLater(e); + } +}; + +Async.prototype.throwLater = function(fn, arg) { + if (arguments.length === 1) { + arg = fn; + fn = function () { throw arg; }; + } + if (typeof setTimeout !== "undefined") { + setTimeout(function() { + fn(arg); + }, 0); + } else try { + this._schedule(function() { + fn(arg); + }); + } catch (e) { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } +}; + +function AsyncInvokeLater(fn, receiver, arg) { + this._lateQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncInvoke(fn, receiver, arg) { + this._normalQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncSettlePromises(promise) { + this._normalQueue._pushOne(promise); + this._queueTick(); +} + +if (!util.hasDevTools) { + Async.prototype.invokeLater = AsyncInvokeLater; + Async.prototype.invoke = AsyncInvoke; + Async.prototype.settlePromises = AsyncSettlePromises; +} else { + Async.prototype.invokeLater = function (fn, receiver, arg) { + if (this._trampolineEnabled) { + AsyncInvokeLater.call(this, fn, receiver, arg); + } else { + this._schedule(function() { + setTimeout(function() { + fn.call(receiver, arg); + }, 100); + }); + } + }; + + Async.prototype.invoke = function (fn, receiver, arg) { + if (this._trampolineEnabled) { + AsyncInvoke.call(this, fn, receiver, arg); + } else { + this._schedule(function() { + fn.call(receiver, arg); + }); + } + }; + + Async.prototype.settlePromises = function(promise) { + if (this._trampolineEnabled) { + AsyncSettlePromises.call(this, promise); + } else { + this._schedule(function() { + promise._settlePromises(); + }); + } + }; +} + +Async.prototype._drainQueue = function(queue) { + while (queue.length() > 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; diff --git a/deps/npm/node_modules/bluebird/js/release/bind.js b/deps/npm/node_modules/bluebird/js/release/bind.js new file mode 100644 index 0000000000..fc3379db28 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/bind.js @@ -0,0 +1,67 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/bluebird.js b/deps/npm/node_modules/bluebird/js/release/bluebird.js new file mode 100644 index 0000000000..1c36cf3644 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/bluebird.js @@ -0,0 +1,11 @@ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = require("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; diff --git a/deps/npm/node_modules/bluebird/js/release/call_get.js b/deps/npm/node_modules/bluebird/js/release/call_get.js new file mode 100644 index 0000000000..0ed7714ac1 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/call_get.js @@ -0,0 +1,123 @@ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!false) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + if (!false) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/cancel.js b/deps/npm/node_modules/bluebird/js/release/cancel.js new file mode 100644 index 0000000000..7a12415ee5 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/cancel.js @@ -0,0 +1,129 @@ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/catch_filter.js b/deps/npm/node_modules/bluebird/js/release/catch_filter.js new file mode 100644 index 0000000000..0f24ce23ec --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/catch_filter.js @@ -0,0 +1,42 @@ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = require("./util"); +var getKeys = require("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/context.js b/deps/npm/node_modules/bluebird/js/release/context.js new file mode 100644 index 0000000000..c307414fc6 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/context.js @@ -0,0 +1,69 @@ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/debuggability.js b/deps/npm/node_modules/bluebird/js/release/debuggability.js new file mode 100644 index 0000000000..bf0587ce7d --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/debuggability.js @@ -0,0 +1,916 @@ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = require("./errors").Warning; +var util = require("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (false || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + async.invokeLater(this._notifyUnhandledRejection, this, undefined); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/direct_resolve.js b/deps/npm/node_modules/bluebird/js/release/direct_resolve.js new file mode 100644 index 0000000000..a890298261 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/direct_resolve.js @@ -0,0 +1,46 @@ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/each.js b/deps/npm/node_modules/bluebird/js/release/each.js new file mode 100644 index 0000000000..e34b6b9c16 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/each.js @@ -0,0 +1,29 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/errors.js b/deps/npm/node_modules/bluebird/js/release/errors.js new file mode 100644 index 0000000000..f62f323eb8 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/errors.js @@ -0,0 +1,116 @@ +"use strict"; +var es5 = require("./es5"); +var Objectfreeze = es5.freeze; +var util = require("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; diff --git a/deps/npm/node_modules/bluebird/js/release/es5.js b/deps/npm/node_modules/bluebird/js/release/es5.js new file mode 100644 index 0000000000..ea41d5a566 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/es5.js @@ -0,0 +1,80 @@ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} diff --git a/deps/npm/node_modules/bluebird/js/release/filter.js b/deps/npm/node_modules/bluebird/js/release/filter.js new file mode 100644 index 0000000000..ed57bf0159 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/filter.js @@ -0,0 +1,12 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/finally.js b/deps/npm/node_modules/bluebird/js/release/finally.js new file mode 100644 index 0000000000..d57444bed4 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/finally.js @@ -0,0 +1,146 @@ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = require("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = require("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/generators.js b/deps/npm/node_modules/bluebird/js/release/generators.js new file mode 100644 index 0000000000..500c280c0b --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/generators.js @@ -0,0 +1,223 @@ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = require("./errors"); +var TypeError = errors.TypeError; +var util = require("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/join.js b/deps/npm/node_modules/bluebird/js/release/join.js new file mode 100644 index 0000000000..4945e3f782 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/join.js @@ -0,0 +1,168 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!false) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!false) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];}; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/map.js b/deps/npm/node_modules/bluebird/js/release/map.js new file mode 100644 index 0000000000..976f15ef29 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/map.js @@ -0,0 +1,168 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : util.domainBind(domain, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/method.js b/deps/npm/node_modules/bluebird/js/release/method.js new file mode 100644 index 0000000000..ce9e4db7ed --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/method.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/nodeback.js b/deps/npm/node_modules/bluebird/js/release/nodeback.js new file mode 100644 index 0000000000..71e69ebdbe --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/nodeback.js @@ -0,0 +1,51 @@ +"use strict"; +var util = require("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = require("./errors"); +var OperationalError = errors.OperationalError; +var es5 = require("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; diff --git a/deps/npm/node_modules/bluebird/js/release/nodeify.js b/deps/npm/node_modules/bluebird/js/release/nodeify.js new file mode 100644 index 0000000000..ce2b19004e --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/nodeify.js @@ -0,0 +1,58 @@ +"use strict"; +module.exports = function(Promise) { +var util = require("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/promise.js b/deps/npm/node_modules/bluebird/js/release/promise.js new file mode 100644 index 0000000000..2a1d002adf --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/promise.js @@ -0,0 +1,775 @@ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = require("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = require("./es5"); +var Async = require("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = require("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = require("./thenables")(Promise, INTERNAL); +var PromiseArray = + require("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = require("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = require("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + require("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = require("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = require("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +require("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +require("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +require("./cancel")(Promise, PromiseArray, apiRejection, debug); +require("./direct_resolve")(Promise); +require("./synchronous_inspection")(Promise); +require("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.0"; +require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./call_get.js')(Promise); +require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +require('./timers.js')(Promise, INTERNAL, debug); +require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +require('./nodeify.js')(Promise); +require('./promisify.js')(Promise, INTERNAL); +require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./settle.js')(Promise, PromiseArray, debug); +require('./some.js')(Promise, PromiseArray, apiRejection); +require('./filter.js')(Promise, INTERNAL); +require('./each.js')(Promise, INTERNAL); +require('./any.js')(Promise); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/promise_array.js b/deps/npm/node_modules/bluebird/js/release/promise_array.js new file mode 100644 index 0000000000..0fb303eb0d --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/promise_array.js @@ -0,0 +1,185 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = require("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/promisify.js b/deps/npm/node_modules/bluebird/js/release/promisify.js new file mode 100644 index 0000000000..f7d14275b0 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/promisify.js @@ -0,0 +1,313 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = require("./util"); +var nodebackForPromise = require("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = require("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!false) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/props.js b/deps/npm/node_modules/bluebird/js/release/props.js new file mode 100644 index 0000000000..6a34aaf556 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/props.js @@ -0,0 +1,118 @@ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = require("./util"); +var isObject = util.isObject; +var es5 = require("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/queue.js b/deps/npm/node_modules/bluebird/js/release/queue.js new file mode 100644 index 0000000000..ffd36fda1f --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/queue.js @@ -0,0 +1,73 @@ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; diff --git a/deps/npm/node_modules/bluebird/js/release/race.js b/deps/npm/node_modules/bluebird/js/release/race.js new file mode 100644 index 0000000000..b862f46d64 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/race.js @@ -0,0 +1,49 @@ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = require("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/reduce.js b/deps/npm/node_modules/bluebird/js/release/reduce.js new file mode 100644 index 0000000000..e8b7843e55 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/reduce.js @@ -0,0 +1,172 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = require("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : util.domainBind(domain, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; diff --git a/deps/npm/node_modules/bluebird/js/release/schedule.js b/deps/npm/node_modules/bluebird/js/release/schedule.js new file mode 100644 index 0000000000..f70df9fc12 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/schedule.js @@ -0,0 +1,61 @@ +"use strict"; +var util = require("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; diff --git a/deps/npm/node_modules/bluebird/js/release/settle.js b/deps/npm/node_modules/bluebird/js/release/settle.js new file mode 100644 index 0000000000..fade3a174f --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/settle.js @@ -0,0 +1,43 @@ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = require("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/some.js b/deps/npm/node_modules/bluebird/js/release/some.js new file mode 100644 index 0000000000..400d85207d --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/some.js @@ -0,0 +1,148 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = require("./util"); +var RangeError = require("./errors").RangeError; +var AggregateError = require("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/synchronous_inspection.js b/deps/npm/node_modules/bluebird/js/release/synchronous_inspection.js new file mode 100644 index 0000000000..9c49d2e600 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/synchronous_inspection.js @@ -0,0 +1,103 @@ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/thenables.js b/deps/npm/node_modules/bluebird/js/release/thenables.js new file mode 100644 index 0000000000..d6ab9aa275 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/thenables.js @@ -0,0 +1,86 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = require("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; diff --git a/deps/npm/node_modules/bluebird/js/release/timers.js b/deps/npm/node_modules/bluebird/js/release/timers.js new file mode 100644 index 0000000000..cb8f1f421a --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/timers.js @@ -0,0 +1,93 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = require("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/using.js b/deps/npm/node_modules/bluebird/js/release/using.js new file mode 100644 index 0000000000..65de531c11 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/using.js @@ -0,0 +1,226 @@ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = require("./util"); + var TypeError = require("./errors").TypeError; + var inherits = require("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; diff --git a/deps/npm/node_modules/bluebird/js/release/util.js b/deps/npm/node_modules/bluebird/js/release/util.js new file mode 100644 index 0000000000..84c28ec475 --- /dev/null +++ b/deps/npm/node_modules/bluebird/js/release/util.js @@ -0,0 +1,379 @@ +"use strict"; +var es5 = require("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"; +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; diff --git a/deps/npm/node_modules/bluebird/package.json b/deps/npm/node_modules/bluebird/package.json new file mode 100644 index 0000000000..a966478c0b --- /dev/null +++ b/deps/npm/node_modules/bluebird/package.json @@ -0,0 +1,138 @@ +{ + "_args": [ + [ + { + "raw": "bluebird@latest", + "scope": null, + "escapedName": "bluebird", + "name": "bluebird", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "bluebird@latest", + "_id": "bluebird@3.5.0", + "_inCache": true, + "_location": "/bluebird", + "_nodeVersion": "7.7.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/bluebird-3.5.0.tgz_1488577769162_0.549377566203475" + }, + "_npmUser": { + "name": "esailija", + "email": "petka_antonov@hotmail.com" + }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "bluebird@latest", + "scope": null, + "escapedName": "bluebird", + "name": "bluebird", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "_shasum": "791420d7f551eea2897453a8a77653f96606d67c", + "_shrinkwrap": null, + "_spec": "bluebird@latest", + "_where": "/Users/zkat/Documents/code/npm", + "author": { + "name": "Petka Antonov", + "email": "petka_antonov@hotmail.com", + "url": "http://github.com/petkaantonov/" + }, + "browser": "./js/browser/bluebird.js", + "bugs": { + "url": "http://github.com/petkaantonov/bluebird/issues" + }, + "dependencies": {}, + "description": "Full featured Promises/A+ implementation with exceptionally good performance", + "devDependencies": { + "acorn": "~0.6.0", + "baconjs": "^0.7.43", + "bluebird": "^2.9.2", + "body-parser": "^1.10.2", + "browserify": "^8.1.1", + "cli-table": "~0.3.1", + "co": "^4.2.0", + "cross-spawn": "^0.2.3", + "glob": "^4.3.2", + "grunt-saucelabs": "~8.4.1", + "highland": "^2.3.0", + "istanbul": "^0.3.5", + "jshint": "^2.6.0", + "jshint-stylish": "~0.2.0", + "kefir": "^2.4.1", + "mkdirp": "~0.5.0", + "mocha": "~2.1", + "open": "~0.0.5", + "optimist": "~0.6.1", + "rimraf": "~2.2.6", + "rx": "^2.3.25", + "serve-static": "^1.7.1", + "sinon": "~1.7.3", + "uglify-js": "~2.4.16" + }, + "directories": {}, + "dist": { + "shasum": "791420d7f551eea2897453a8a77653f96606d67c", + "tarball": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz" + }, + "files": [ + "js/browser", + "js/release", + "LICENSE" + ], + "gitHead": "0b281e6caeec9c30b8de9a409b8ff1723f973f59", + "homepage": "https://github.com/petkaantonov/bluebird", + "keywords": [ + "promise", + "performance", + "promises", + "promises-a", + "promises-aplus", + "async", + "await", + "deferred", + "deferreds", + "future", + "flow control", + "dsl", + "fluent interface" + ], + "license": "MIT", + "main": "./js/release/bluebird.js", + "maintainers": [ + { + "name": "esailija", + "email": "petka_antonov@hotmail.com" + } + ], + "name": "bluebird", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/petkaantonov/bluebird.git" + }, + "scripts": { + "generate-browser-core": "node tools/build.js --features=core --no-debug --release --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js", + "generate-browser-full": "node tools/build.js --no-clean --no-debug --release --browser --minify", + "istanbul": "istanbul", + "lint": "node scripts/jshint.js", + "prepublish": "npm run generate-browser-core && npm run generate-browser-full", + "test": "node tools/test.js" + }, + "version": "3.5.0", + "webpack": "./js/release/bluebird.js" +} diff --git a/deps/npm/node_modules/call-limit/README.md b/deps/npm/node_modules/call-limit/README.md new file mode 100644 index 0000000000..dc4f081dce --- /dev/null +++ b/deps/npm/node_modules/call-limit/README.md @@ -0,0 +1,85 @@ +call-limit +---------- + +Limit the number of simultaneous executions of a async function. + +```javascript +var fs = require('fs') +var limit = require('call-limit') +var limitedStat = limit(fs.stat, 5) +``` + +Or with promise returning functions: + +```javascript +var fs = Bluebird.promisifyAll(require('fs')) +var limit = require('call-limit') +var limitedStat = limit.promise(fs.statAsync, 5) +``` + +### USAGE: + +Given that: + +```javascript +var limit = require('call-limit') +``` + +### limit(func, maxRunning) → limitedFunc + +The returned function will execute up to maxRunning calls of `func` at once. +Beyond that they get queued and called when the previous call completes. + +`func` must accept a callback as the final argument and must call it when +it completes, or `call-limit` won't know to dequeue the next thing to run. + +By contrast, callers to `limitedFunc` do NOT have to pass in a callback, but +if they do they'll be called when `func` calls its callback. + +### limit.promise(func, maxRunning) → limitedFunc + +The returned function will execute up to maxRunning calls of `func` at once. +Beyond that they get queued and called when the previous call completes. + +`func` must return a promise. + +`limitedFunc` will return a promise that resolves with the promise returned +from the call to `func`. + +### limit.method(class, methodName, maxRunning) + +This is sugar for: + +```javascript +class.prototype.methodName = limit(class.prototype.methodName, maxRunning) +``` + +### limit.method(object, methodName, maxRunning) + +This is sugar for: + +```javascript +object.methodName = limit(object.methodName, maxRunning) +``` + +For example `limit.promise.method(fs, 'stat', 5)` is the same as +`fs.stat = limit.promise(fs.stat, 5)`. + +### limit.promise.method(class, methodName, maxRunning) + +This is sugar for: + +```javascript +class.prototype.methodName = limit.promise(class.prototype.methodName, maxRunning) +``` + +### limit.promise.method(object, methodName, maxRunning) + +This is sugar for: + +```javascript +object.methodName = limit.promise(object.methodName, maxRunning) +``` + +For example `limit.promise.method(fs, 'statAsync', 5)` is the same as +`fs.statAsync = limit.promise(fs.statAsync, 5)`. diff --git a/deps/npm/node_modules/call-limit/call-limit.js b/deps/npm/node_modules/call-limit/call-limit.js new file mode 100644 index 0000000000..d6e4534b8a --- /dev/null +++ b/deps/npm/node_modules/call-limit/call-limit.js @@ -0,0 +1,86 @@ +"use strict" + +var defaultMaxRunning = 50 + +var limit = module.exports = function (func, maxRunning) { + var running = 0 + var queue = [] + if (!maxRunning) maxRunning = defaultMaxRunning + return function limited () { + var self = this + var args = Array.prototype.slice.call(arguments) + if (running >= maxRunning) { + queue.push({self: this, args: args}) + return + } + var cb = typeof args[args.length-1] === 'function' && args.pop() + ++ running + args.push(function () { + var cbargs = arguments + -- running + cb && process.nextTick(function () { + cb.apply(self, cbargs) + }) + if (queue.length) { + var next = queue.shift() + limited.apply(next.self, next.args) + } + }) + func.apply(self, args) + } +} + +module.exports.method = function (classOrObj, method, maxRunning) { + if (typeof classOrObj === 'function') { + var func = classOrObj.prototype[method] + classOrObj.prototype[method] = limit(func, maxRunning) + } else { + var func = classOrObj[method] + classOrObj[method] = limit(func, maxRunning) + } +} + +module.exports.promise = function (func, maxRunning) { + var running = 0 + var queue = [] + if (!maxRunning) maxRunning = defaultMaxRunning + return function () { + var self = this + var args = Array.prototype.slice.call(arguments) + return new Promise(function (resolve) { + if (running >= maxRunning) { + queue.push({self: self, args: args, resolve: resolve}) + return + } else { + runNext(self, args, resolve) + } + function runNext (self, args, resolve) { + ++ running + resolve( + func.apply(self, args) + .then(finish, function (err) { + finish(err) + throw err + })) + } + + function finish () { + -- running + if (queue.length) { + var next = queue.shift() + process.nextTick(runNext, next.self, next.args, next.resolve) + } + } + }) + } +} + +module.exports.promise.method = function (classOrObj, method, maxRunning) { + if (typeof classOrObj === 'function') { + var func = classOrObj.prototype[method] + classOrObj.prototype[method] = limit.promise(func, maxRunning) + } else { + var func = classOrObj[method] + classOrObj[method] = limit.promise(func, maxRunning) + } +} diff --git a/deps/npm/node_modules/call-limit/package.json b/deps/npm/node_modules/call-limit/package.json new file mode 100644 index 0000000000..631a123f12 --- /dev/null +++ b/deps/npm/node_modules/call-limit/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + { + "raw": "call-limit@latest", + "scope": null, + "escapedName": "call-limit", + "name": "call-limit", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/rebecca/code/npm-latest" + ] + ], + "_from": "call-limit@latest", + "_id": "call-limit@1.1.0", + "_inCache": true, + "_location": "/call-limit", + "_nodeVersion": "7.7.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/call-limit-1.1.0.tgz_1488849297527_0.29955350141972303" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "4.4.1", + "_phantomChildren": {}, + "_requested": { + "raw": "call-limit@latest", + "scope": null, + "escapedName": "call-limit", + "name": "call-limit", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/call-limit/-/call-limit-1.1.0.tgz", + "_shasum": "6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea", + "_shrinkwrap": null, + "_spec": "call-limit@latest", + "_where": "/Users/rebecca/code/npm-latest", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/call-limit/issues" + }, + "dependencies": {}, + "description": "Limit the number of simultaneous calls to an async function", + "devDependencies": { + "tap": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "6fd61b03f3da42a2cd0ec2b60f02bd0e71991fea", + "tarball": "https://registry.npmjs.org/call-limit/-/call-limit-1.1.0.tgz" + }, + "files": [ + "call-limit.js" + ], + "gitHead": "2b05fe72f0cf33a2aac951cd68dd949fccb0d9e9", + "homepage": "https://npmjs.com/packages/call-limit", + "license": "ISC", + "main": "call-limit.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "call-limit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/call-limit.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/fs-vacuum/README.md b/deps/npm/node_modules/fs-vacuum/README.md index df31243df5..8af1cb2485 100644 --- a/deps/npm/node_modules/fs-vacuum/README.md +++ b/deps/npm/node_modules/fs-vacuum/README.md @@ -18,7 +18,7 @@ var options = { /* Assuming there are no other files or directories in "out", "to", or "my", * the final path will just be "/path/to/my/tree/root". */ -vacuum("/path/to/my/tree/root/out/to/my/files", function (error) { +vacuum("/path/to/my/tree/root/out/to/my/files", options, function (error) { if (error) console.error("Unable to cleanly vacuum:", error.message); }); ``` diff --git a/deps/npm/node_modules/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json index 7567a84fd8..5f414b8046 100644 --- a/deps/npm/node_modules/fs-vacuum/package.json +++ b/deps/npm/node_modules/fs-vacuum/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "fs-vacuum@", - "/Users/rebecca/code/npm" + { + "raw": "fs-vacuum@latest", + "scope": null, + "escapedName": "fs-vacuum", + "name": "fs-vacuum", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/zkat/Documents/code/npm" ] ], "_from": "fs-vacuum@latest", - "_id": "fs-vacuum@1.2.9", + "_id": "fs-vacuum@1.2.10", "_inCache": true, - "_installable": true, "_location": "/fs-vacuum", - "_nodeVersion": "5.10.1", + "_nodeVersion": "7.7.1", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/fs-vacuum-1.2.9.tgz_1461273179969_0.39465441973879933" + "tmp": "tmp/fs-vacuum-1.2.10.tgz_1489187970453_0.7888825018890202" }, "_npmUser": { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.8.7", + "_npmVersion": "4.4.2", "_phantomChildren": {}, "_requested": { - "name": "fs-vacuum", - "raw": "fs-vacuum@", - "rawSpec": "", + "raw": "fs-vacuum@latest", "scope": null, + "escapedName": "fs-vacuum", + "name": "fs-vacuum", + "rawSpec": "latest", "spec": "latest", "type": "tag" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.9.tgz", - "_shasum": "4f90193ab8ea02890995bcd4e804659a5d366b2d", + "_resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.10.tgz", + "_shasum": "b7629bec07a4031a2548fdf99f5ecf1cc8b31e36", "_shrinkwrap": null, - "_spec": "fs-vacuum@", - "_where": "/Users/rebecca/code/npm", + "_spec": "fs-vacuum@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "ogd@aoaioxxysz.net", - "name": "Forrest L Norvell" + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" }, "bugs": { "url": "https://github.com/npm/fs-vacuum/issues" @@ -60,10 +69,10 @@ }, "directories": {}, "dist": { - "shasum": "4f90193ab8ea02890995bcd4e804659a5d366b2d", - "tarball": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.9.tgz" + "shasum": "b7629bec07a4031a2548fdf99f5ecf1cc8b31e36", + "tarball": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.10.tgz" }, - "gitHead": "acff37c635731a0169367acb32338d9d4e7d615c", + "gitHead": "e2daf9ab461004d10cc934e286052a6cd72a6127", "homepage": "https://github.com/npm/fs-vacuum", "keywords": [ "rm", @@ -74,12 +83,12 @@ "main": "vacuum.js", "maintainers": [ { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "fs-vacuum", @@ -92,5 +101,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "1.2.9" + "version": "1.2.10" } diff --git a/deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js b/deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js new file mode 100644 index 0000000000..8cab009455 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/not-remove-home-directory.js @@ -0,0 +1,46 @@ +var path = require('path') + +var test = require('tap').test +var mkdtemp = require('tmp').dir +var mkdirp = require('mkdirp') + +var vacuum = require('../vacuum.js') + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup: true, + mode: '0700' +} + +var BASE_PATH = path.join('foo') +var HOME_PATH = path.join(BASE_PATH, 'foo', 'bar') + +var messages = [] +function log () { messages.push(Array.prototype.slice.call(arguments).join(' ')) } + +var homePath, basePath, realHome +test('xXx setup xXx', function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, 'temp directory exists') + + homePath = path.resolve(tmpdir, HOME_PATH) + basePath = path.resolve(tmpdir, BASE_PATH) + + realHome = process.env.HOME + process.env.HOME = homePath + + mkdirp(homePath, function (er) { + t.ifError(er, 'made test path') + t.end() + }) + }) +}) + +test('do not remove home directory', function (t) { + vacuum(homePath, {purge: false, base: basePath, log: log}, function (er) { + t.ifError(er, 'cleaned up to base') + t.equal(messages[0], 'quitting because cannot remove home directory ' + homePath) + process.env.HOME = realHome + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/vacuum.js b/deps/npm/node_modules/fs-vacuum/vacuum.js index 1fb674da96..050f870186 100644 --- a/deps/npm/node_modules/fs-vacuum/vacuum.js +++ b/deps/npm/node_modules/fs-vacuum/vacuum.js @@ -79,6 +79,11 @@ function vacuum (leaf, options, cb) { return cb(null) } + if (branch === process.env.HOME) { + log('quitting because cannot remove home directory', branch) + return cb(null) + } + log('removing', branch) lstat(branch, function (error, stat) { if (error) { diff --git a/deps/npm/node_modules/fs-write-stream-atomic/index.js b/deps/npm/node_modules/fs-write-stream-atomic/index.js index 59b50db6d7..1690ff5ae7 100644 --- a/deps/npm/node_modules/fs-write-stream-atomic/index.js +++ b/deps/npm/node_modules/fs-write-stream-atomic/index.js @@ -3,11 +3,12 @@ var Writable = require('readable-stream').Writable var util = require('util') var MurmurHash3 = require('imurmurhash') var iferr = require('iferr') +var crypto = require('crypto') function murmurhex () { var hash = MurmurHash3('') for (var ii = 0; ii < arguments.length; ++ii) { - hash.hash(hash + arguments[ii]) + hash.hash('' + arguments[ii]) } return hash.result() } @@ -36,6 +37,8 @@ function WriteStreamAtomic (path, options) { } Writable.call(this, options) + this.__isWin = options && options.hasOwnProperty('isWin') ? options.isWin : process.platform === 'win32' + this.__atomicTarget = path this.__atomicTmp = getTmpname(path) @@ -84,15 +87,64 @@ function handleClose (writeStream) { moveIntoPlace() } } + + function moveIntoPlace () { + fs.rename(writeStream.__atomicTmp, writeStream.__atomicTarget, iferr(trapWindowsEPERM, end)) + } + + function trapWindowsEPERM (err) { + if (writeStream.__isWin && + err.syscall && err.syscall === 'rename' && + err.code && err.code === 'EPERM' + ) { + checkFileHashes(err) + } else { + cleanup(err) + } + } + + function checkFileHashes (eperm) { + var inprocess = 2 + var tmpFileHash = crypto.createHash('sha512') + var targetFileHash = crypto.createHash('sha512') + + fs.createReadStream(writeStream.__atomicTmp) + .on('data', function (data, enc) { tmpFileHash.update(data, enc) }) + .on('error', fileHashError) + .on('end', fileHashComplete) + fs.createReadStream(writeStream.__atomicTarget) + .on('data', function (data, enc) { targetFileHash.update(data, enc) }) + .on('error', fileHashError) + .on('end', fileHashComplete) + + function fileHashError () { + if (inprocess === 0) return + inprocess = 0 + cleanup(eperm) + } + + function fileHashComplete () { + if (inprocess === 0) return + if (--inprocess) return + if (tmpFileHash.digest('hex') === targetFileHash.digest('hex')) { + return cleanup() + } else { + return cleanup(eperm) + } + } + } + function cleanup (err) { fs.unlink(writeStream.__atomicTmp, function () { - writeStream.emit('error', err) - writeStream.emit('close') + if (err) { + writeStream.emit('error', err) + writeStream.emit('close') + } else { + end() + } }) } - function moveIntoPlace () { - fs.rename(writeStream.__atomicTmp, writeStream.__atomicTarget, iferr(cleanup, end)) - } + function end () { // We have to use our parent class directly because we suppress `finish` // events fired via our own emit method. diff --git a/deps/npm/node_modules/fs-write-stream-atomic/package.json b/deps/npm/node_modules/fs-write-stream-atomic/package.json index e65fa32c0e..f1526baa15 100644 --- a/deps/npm/node_modules/fs-write-stream-atomic/package.json +++ b/deps/npm/node_modules/fs-write-stream-atomic/package.json @@ -1,40 +1,56 @@ { "_args": [ [ - "fs-write-stream-atomic@1.0.8", - "/Users/rebecca/code/npm" + { + "raw": "fs-write-stream-atomic@latest", + "scope": null, + "escapedName": "fs-write-stream-atomic", + "name": "fs-write-stream-atomic", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "fs-write-stream-atomic@1.0.8", - "_id": "fs-write-stream-atomic@1.0.8", + "_from": "fs-write-stream-atomic@latest", + "_id": "fs-write-stream-atomic@1.0.10", "_inCache": true, - "_installable": true, "_location": "/fs-write-stream-atomic", - "_nodeVersion": "4.2.2", + "_nodeVersion": "7.7.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/fs-write-stream-atomic-1.0.10.tgz_1488925398888_0.6416559314820915" + }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, - "_npmVersion": "3.5.2", + "_npmVersion": "4.4.1", "_phantomChildren": {}, "_requested": { - "name": "fs-write-stream-atomic", - "raw": "fs-write-stream-atomic@1.0.8", - "rawSpec": "1.0.8", + "raw": "fs-write-stream-atomic@latest", "scope": null, - "spec": "1.0.8", - "type": "version" + "escapedName": "fs-write-stream-atomic", + "name": "fs-write-stream-atomic", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ - "/" + "#USER", + "/", + "/@npmcorp/move", + "/@npmcorp/move/@npmcorp/copy" ], - "_shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b", + "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "_shasum": "b47df53493ef911df75731e70a9ded0189db40c9", "_shrinkwrap": null, - "_spec": "fs-write-stream-atomic@1.0.8", - "_where": "/Users/rebecca/code/npm", + "_spec": "fs-write-stream-atomic@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -56,10 +72,10 @@ "test": "test" }, "dist": { - "shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b", - "tarball": "http://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz" + "shasum": "b47df53493ef911df75731e70a9ded0189db40c9", + "tarball": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz" }, - "gitHead": "b55824ee4de7f1ca23784929d68b1b8f5edbf4a4", + "gitHead": "de157c0373a40fb5539640923cab9671cef08b12", "homepage": "https://github.com/npm/fs-write-stream-atomic", "license": "ISC", "main": "index.js", @@ -91,5 +107,5 @@ "scripts": { "test": "standard && tap --coverage test/*.js" }, - "version": "1.0.8" + "version": "1.0.10" } diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js new file mode 100644 index 0000000000..b1be0f3183 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-eperm.js @@ -0,0 +1,154 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-rename-eperm1') +var target2 = path.resolve(__dirname, 'test-rename-eperm2') +var target3 = path.resolve(__dirname, 'test-rename-eperm3') + +test('rename eperm none existing file', function (t) { + t.plan(2) + + var _rename = fs.rename + fs.existsSync = function (src) { + return true + } + fs.rename = function (src, dest, cb) { + // simulate a failure during rename where the file + // is renamed successfully but the process encounters + // an EPERM error and the target file does not exist + _rename(src, dest, function (e) { + var err = new Error('TEST BREAK') + err.syscall = 'rename' + err.code = 'EPERM' + cb(err) + }) + } + + var stream = writeStream(target, { isWin: true }) + var hadError = false + var calledFinish = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('finish', function () { + calledFinish = true + }) + stream.on('close', function () { + t.is(hadError, true, 'error was caught') + t.is(calledFinish, false, 'finish was called before close') + }) + stream.end() +}) + +// test existing file with diff. content +test('rename eperm existing file different content', function (t) { + t.plan(2) + + var _rename = fs.rename + fs.existsSync = function (src) { + return true + } + fs.rename = function (src, dest, cb) { + // simulate a failure during rename where the file + // is renamed successfully but the process encounters + // an EPERM error and the target file that has another content than the + // destination + _rename(src, dest, function (e) { + fs.writeFile(src, 'dest', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + fs.writeFile(target2, 'target', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + var err = new Error('TEST BREAK') + err.syscall = 'rename' + err.code = 'EPERM' + cb(err) + }) + }) + }) + } + + var stream = writeStream(target2, { isWin: true }) + var hadError = false + var calledFinish = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('finish', function () { + calledFinish = true + }) + stream.on('close', function () { + t.is(hadError, true, 'error was caught') + t.is(calledFinish, false, 'finish was called before close') + }) + stream.end() +}) + +// test existing file with the same content +// test existing file with diff. content +test('rename eperm existing file different content', function (t) { + t.plan(2) + + var _rename = fs.rename + fs.existsSync = function (src) { + return true + } + fs.rename = function (src, dest, cb) { + // simulate a failure during rename where the file + // is renamed successfully but the process encounters + // an EPERM error and the target file that has the same content than the + // destination + _rename(src, dest, function (e) { + fs.writeFile(src, 'target2', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + fs.writeFile(target3, 'target2', function (writeErr) { + if (writeErr) { + return console.log('WRITEERR: ' + writeErr) + } + + var err = new Error('TEST BREAK') + err.syscall = 'rename' + err.code = 'EPERM' + cb(err) + }) + }) + }) + } + + var stream = writeStream(target3, { isWin: true }) + var hadError = false + var calledFinish = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('finish', function () { + calledFinish = true + }) + stream.on('close', function () { + t.is(hadError, false, 'error was caught') + t.is(calledFinish, true, 'finish was called before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + rimraf.sync(target2) + rimraf.sync(target3) + t.end() +}) diff --git a/deps/npm/node_modules/fstream/lib/reader.js b/deps/npm/node_modules/fstream/lib/reader.js index 876021f92b..be4f570eeb 100644 --- a/deps/npm/node_modules/fstream/lib/reader.js +++ b/deps/npm/node_modules/fstream/lib/reader.js @@ -21,10 +21,6 @@ function Reader (props, currentStat) { props = { path: props } } - if (!props.path) { - self.error('Must provide a path', null, true) - } - // polymorphism. // call fstream.Reader(dir) to get a DirReader object, etc. // Note that, unlike in the Writer case, ProxyReader is going @@ -85,6 +81,10 @@ function Reader (props, currentStat) { Abstract.call(self) + if (!props.path) { + self.error('Must provide a path', null, true) + } + self.readable = true self.writable = false diff --git a/deps/npm/node_modules/fstream/lib/writer.js b/deps/npm/node_modules/fstream/lib/writer.js index ca3396b5d1..140e449e06 100644 --- a/deps/npm/node_modules/fstream/lib/writer.js +++ b/deps/npm/node_modules/fstream/lib/writer.js @@ -30,8 +30,6 @@ function Writer (props, current) { props = { path: props } } - if (!props.path) self.error('Must provide a path', null, true) - // polymorphism. // call fstream.Writer(dir) to get a DirWriter object, etc. var type = getType(props) @@ -61,6 +59,8 @@ function Writer (props, current) { Abstract.call(self) + if (!props.path) self.error('Must provide a path', null, true) + // props is what we want to set. // set some convenience properties as well. self.type = props.type diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json index cb1ad42e11..162dbba1eb 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -2,41 +2,40 @@ "_args": [ [ { - "raw": "fstream@~1.0.10", + "raw": "fstream@latest", "scope": null, "escapedName": "fstream", "name": "fstream", - "rawSpec": "~1.0.10", - "spec": ">=1.0.10 <1.1.0", - "type": "range" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, - "/Users/ogd/Documents/projects/npm/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "fstream@>=1.0.10 <1.1.0", - "_id": "fstream@1.0.10", + "_from": "fstream@latest", + "_id": "fstream@1.0.11", "_inCache": true, - "_installable": true, "_location": "/fstream", - "_nodeVersion": "4.4.5", + "_nodeVersion": "7.7.1", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/fstream-1.0.10.tgz_1466189553883_0.3062701092567295" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/fstream-1.0.11.tgz_1488923219641_0.18055859790183604" }, "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.10.0", + "_npmVersion": "4.1.2", "_phantomChildren": {}, "_requested": { - "raw": "fstream@~1.0.10", + "raw": "fstream@latest", "scope": null, "escapedName": "fstream", "name": "fstream", - "rawSpec": "~1.0.10", - "spec": ">=1.0.10 <1.1.0", - "type": "range" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ "#USER", @@ -45,11 +44,11 @@ "/node-gyp", "/tar" ], - "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz", - "_shasum": "604e8a92fe26ffd9f6fae30399d4984e1ab22822", + "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "_shasum": "5c1fb1f117477114f0632a0eb4b71b3cb0fd3171", "_shrinkwrap": null, - "_spec": "fstream@~1.0.10", - "_where": "/Users/ogd/Documents/projects/npm/npm", + "_spec": "fstream@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -71,13 +70,13 @@ }, "directories": {}, "dist": { - "shasum": "604e8a92fe26ffd9f6fae30399d4984e1ab22822", - "tarball": "https://registry.npmjs.org/fstream/-/fstream-1.0.10.tgz" + "shasum": "5c1fb1f117477114f0632a0eb4b71b3cb0fd3171", + "tarball": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz" }, "engines": { "node": ">=0.6" }, - "gitHead": "24fabdec32e334dd3b130d77b38c010e3119b102", + "gitHead": "1e4527ffe8688d4f5325283d7cf2cf2d61f14c6b", "homepage": "https://github.com/npm/fstream#readme", "license": "ISC", "main": "fstream.js", @@ -109,5 +108,5 @@ "scripts": { "test": "standard && tap examples/*.js" }, - "version": "1.0.10" + "version": "1.0.11" } diff --git a/deps/npm/node_modules/hosted-git-info/.npmignore b/deps/npm/node_modules/hosted-git-info/.npmignore deleted file mode 100644 index efab07fb1b..0000000000 --- a/deps/npm/node_modules/hosted-git-info/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -test -.travis.yml diff --git a/deps/npm/node_modules/hosted-git-info/README.md b/deps/npm/node_modules/hosted-git-info/README.md index 1db47dd656..f9db5dd959 100644 --- a/deps/npm/node_modules/hosted-git-info/README.md +++ b/deps/npm/node_modules/hosted-git-info/README.md @@ -4,11 +4,11 @@ This will let you identify and transform various git hosts URLs between protocols. It also can tell you what the URL is for the raw path for particular file for direct access without git. -## Usage +## Example ```javascript var hostedGitInfo = require("hosted-git-info") -var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git") +var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git", opts) /* info looks like: { type: "github", @@ -32,9 +32,39 @@ If it does match, the returned object has properties of: * info.user -- The name of the user/org on the git host * info.project -- The name of the project on the git host -And methods of: +## Version Contract + +The major version will be bumped any time… + +* The constructor stops accepting URLs that it previously accepted. +* A method is removed. +* A method can no longer accept the number and type of arguments it previously accepted. +* A method can return a different type than it currently returns. + +Implications: + +* I do not consider the specific format of the urls returned from, say + `.https()` to be a part of the contract. The contract is that it will + return a string that can be used to fetch the repo via HTTPS. But what + that string looks like, specifically, can change. +* Dropping support for a hosted git provider would constitute a breaking + change. + +## Usage + +### var info = hostedGitInfo.fromUrl(gitSpecifier[, options]) + +* *gitSpecifer* is a URL of a git repository or a SCP-style specifier of one. +* *options* is an optional object. It can have the following properties: + * *noCommittish* — If true then committishes won't be included in generated URLs. + * *noGitPlus* — If true then `git+` won't be prefixed on URLs. + +## Methods + +All of the methods take the same options as the `fromUrl` factory. Options +provided to a method override those provided to the constructor. -* info.file(path) +* info.file(path, opts) Given the path of a file relative to the repository, returns a URL for directly fetching it from the githost. If no committish was set then @@ -43,44 +73,48 @@ directly fetching it from the githost. If no committish was set then For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` -* info.shortcut() +* info.shortcut(opts) eg, `github:npm/hosted-git-info` -* info.browse() +* info.browse(opts) eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0` -* info.bugs() +* info.bugs(opts) eg, `https://github.com/npm/hosted-git-info/issues` -* info.docs() +* info.docs(opts) eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` -* info.https() +* info.https(opts) eg, `git+https://github.com/npm/hosted-git-info.git` -* info.sshurl() +* info.sshurl(opts) eg, `git+ssh://git@github.com/npm/hosted-git-info.git` -* info.ssh() +* info.ssh(opts) eg, `git@github.com:npm/hosted-git-info.git` -* info.path() +* info.path(opts) eg, `npm/hosted-git-info` +* info.tarball(opts) + +eg, `https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz` + * info.getDefaultRepresentation() Returns the default output type. The default output type is based on the string you passed in to be parsed -* info.toString() +* info.toString(opts) Uses the getDefaultRepresentation to call one of the other methods to get a URL for this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give @@ -91,7 +125,6 @@ form of `org/project` will be normalized to `github:org/project`. SSH connect strings will be normalized into `git+ssh` URLs. - ## Supported hosts Currently this supports Github, Bitbucket and Gitlab. Pull requests for diff --git a/deps/npm/node_modules/hosted-git-info/git-host-info.js b/deps/npm/node_modules/hosted-git-info/git-host-info.js index 22343335ee..93cf617440 100644 --- a/deps/npm/node_modules/hosted-git-info/git-host-info.js +++ b/deps/npm/node_modules/hosted-git-info/git-host-info.js @@ -9,19 +9,22 @@ var gitHosts = module.exports = { 'treepath': 'tree', 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}', 'bugstemplate': 'https://{domain}/{user}/{project}/issues', - 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}' + 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', + 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' }, bitbucket: { 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], 'domain': 'bitbucket.org', - 'treepath': 'src' + 'treepath': 'src', + 'tarballtemplate': 'https://{domain}/{user}/{project}/get/{committish}.tar.gz' }, gitlab: { 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ], 'domain': 'gitlab.com', 'treepath': 'tree', 'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README', - 'bugstemplate': 'https://{domain}/{user}/{project}/issues' + 'bugstemplate': 'https://{domain}/{user}/{project}/issues', + 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}' }, gist: { 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ], @@ -36,7 +39,8 @@ var gitHosts = module.exports = { 'docstemplate': 'https://{domain}/{project}{/committish}', 'httpstemplate': 'git+https://{domain}/{project}.git{#committish}', 'shortcuttemplate': '{type}:{project}{#committish}', - 'pathtemplate': '{project}{#committish}' + 'pathtemplate': '{project}{#committish}', + 'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' } } @@ -49,7 +53,7 @@ var gitHostDefaults = { 'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}', 'shortcuttemplate': '{type}:{user}/{project}{#committish}', 'pathtemplate': '{user}/{project}{#committish}', - 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/ + 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/ } Object.keys(gitHosts).forEach(function (name) { @@ -59,6 +63,6 @@ Object.keys(gitHosts).forEach(function (name) { }) gitHosts[name].protocols_re = RegExp('^(' + gitHosts[name].protocols.map(function (protocol) { - return protocol.replace(/([\\+*{}()\[\]$^|])/g, '\\$1') + return protocol.replace(/([\\+*{}()[\]$^|])/g, '\\$1') }).join('|') + '):$') }) diff --git a/deps/npm/node_modules/hosted-git-info/git-host.js b/deps/npm/node_modules/hosted-git-info/git-host.js index ea31380a4e..4c6641bbf7 100644 --- a/deps/npm/node_modules/hosted-git-info/git-host.js +++ b/deps/npm/node_modules/hosted-git-info/git-host.js @@ -1,7 +1,8 @@ 'use strict' var gitHosts = require('./git-host-info.js') +var extend = Object.assign || require('util')._extend -var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation) { +var GitHost = module.exports = function (type, user, auth, project, committish, defaultRepresentation, opts) { var gitHostInfo = this gitHostInfo.type = type Object.keys(gitHosts[type]).forEach(function (key) { @@ -12,6 +13,7 @@ var GitHost = module.exports = function (type, user, auth, project, committish, gitHostInfo.project = project gitHostInfo.committish = committish gitHostInfo.default = defaultRepresentation + gitHostInfo.opts = opts || {} } GitHost.prototype = {} @@ -19,9 +21,10 @@ GitHost.prototype.hash = function () { return this.committish ? '#' + this.committish : '' } -GitHost.prototype._fill = function (template, vars) { +GitHost.prototype._fill = function (template, opts) { if (!template) return - if (!vars) vars = {} + var vars = extend({}, opts) + opts = extend(extend({}, this.opts), opts) var self = this Object.keys(this).forEach(function (key) { if (self[key] != null && vars[key] == null) vars[key] = self[key] @@ -32,65 +35,80 @@ GitHost.prototype._fill = function (template, vars) { vars[key] = encodeURIComponent(vars[key]) }) vars['auth@'] = rawAuth ? rawAuth + '@' : '' - vars['#committish'] = rawComittish ? '#' + rawComittish : '' - vars['/tree/committish'] = vars.committish - ? '/' + vars.treepath + '/' + vars.committish - : '' - vars['/committish'] = vars.committish ? '/' + vars.committish : '' - vars.committish = vars.committish || 'master' + if (opts.noCommittish) { + vars['#committish'] = '' + vars['/tree/committish'] = '' + vars['/comittish'] = '' + vars.comittish = '' + } else { + vars['#committish'] = rawComittish ? '#' + rawComittish : '' + vars['/tree/committish'] = vars.committish + ? '/' + vars.treepath + '/' + vars.committish + : '' + vars['/committish'] = vars.committish ? '/' + vars.committish : '' + vars.committish = vars.committish || 'master' + } var res = template Object.keys(vars).forEach(function (key) { res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key]) }) - return res + if (opts.noGitPlus) { + return res.replace(/^git[+]/, '') + } else { + return res + } } -GitHost.prototype.ssh = function () { - return this._fill(this.sshtemplate) +GitHost.prototype.ssh = function (opts) { + return this._fill(this.sshtemplate, opts) } -GitHost.prototype.sshurl = function () { - return this._fill(this.sshurltemplate) +GitHost.prototype.sshurl = function (opts) { + return this._fill(this.sshurltemplate, opts) } -GitHost.prototype.browse = function () { - return this._fill(this.browsetemplate) +GitHost.prototype.browse = function (opts) { + return this._fill(this.browsetemplate, opts) } -GitHost.prototype.docs = function () { - return this._fill(this.docstemplate) +GitHost.prototype.docs = function (opts) { + return this._fill(this.docstemplate, opts) } -GitHost.prototype.bugs = function () { - return this._fill(this.bugstemplate) +GitHost.prototype.bugs = function (opts) { + return this._fill(this.bugstemplate, opts) } -GitHost.prototype.https = function () { - return this._fill(this.httpstemplate) +GitHost.prototype.https = function (opts) { + return this._fill(this.httpstemplate, opts) } -GitHost.prototype.git = function () { - return this._fill(this.gittemplate) +GitHost.prototype.git = function (opts) { + return this._fill(this.gittemplate, opts) } -GitHost.prototype.shortcut = function () { - return this._fill(this.shortcuttemplate) +GitHost.prototype.shortcut = function (opts) { + return this._fill(this.shortcuttemplate, opts) } -GitHost.prototype.path = function () { - return this._fill(this.pathtemplate) +GitHost.prototype.path = function (opts) { + return this._fill(this.pathtemplate, opts) } -GitHost.prototype.file = function (P) { - return this._fill(this.filetemplate, { +GitHost.prototype.tarball = function (opts) { + return this._fill(this.tarballtemplate, opts) +} + +GitHost.prototype.file = function (P, opts) { + return this._fill(this.filetemplate, extend({ path: P.replace(/^[/]+/g, '') - }) + }, opts)) } GitHost.prototype.getDefaultRepresentation = function () { return this.default } -GitHost.prototype.toString = function () { - return (this[this.default] || this.sshurl).call(this) +GitHost.prototype.toString = function (opts) { + return (this[this.default] || this.sshurl).call(this, opts) } diff --git a/deps/npm/node_modules/hosted-git-info/index.js b/deps/npm/node_modules/hosted-git-info/index.js index 453ce87d38..a3fc25b839 100644 --- a/deps/npm/node_modules/hosted-git-info/index.js +++ b/deps/npm/node_modules/hosted-git-info/index.js @@ -23,37 +23,43 @@ var authProtocols = { 'git+http:': true } -module.exports.fromUrl = function (giturl) { +module.exports.fromUrl = function (giturl, opts) { if (giturl == null || giturl === '') return var url = fixupUnqualifiedGist( isGitHubShorthand(giturl) ? 'github:' + giturl : giturl ) var parsed = parseGitUrl(url) + var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)')) var matches = Object.keys(gitHosts).map(function (gitHostName) { - var gitHostInfo = gitHosts[gitHostName] - var auth = null - if (parsed.auth && authProtocols[parsed.protocol]) { - auth = decodeURIComponent(parsed.auth) + try { + var gitHostInfo = gitHosts[gitHostName] + var auth = null + if (parsed.auth && authProtocols[parsed.protocol]) { + auth = decodeURIComponent(parsed.auth) + } + var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null + var user = null + var project = null + var defaultRepresentation = null + if (shortcutMatch && shortcutMatch[1] === gitHostName) { + user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]) + project = decodeURIComponent(shortcutMatch[3]) + defaultRepresentation = 'shortcut' + } else { + if (parsed.host !== gitHostInfo.domain) return + if (!gitHostInfo.protocols_re.test(parsed.protocol)) return + if (!parsed.path) return + var pathmatch = gitHostInfo.pathmatch + var matched = parsed.path.match(pathmatch) + if (!matched) return + if (matched[1] != null) user = decodeURIComponent(matched[1]) + if (matched[2] != null) project = decodeURIComponent(matched[2]) + defaultRepresentation = protocolToRepresentation(parsed.protocol) + } + return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts) + } catch (ex) { + if (!(ex instanceof URIError)) throw ex } - var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null - var user = null - var project = null - var defaultRepresentation = null - if (parsed.protocol === gitHostName + ':') { - user = decodeURIComponent(parsed.host) - project = parsed.path && decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, '$1')) - defaultRepresentation = 'shortcut' - } else { - if (parsed.host !== gitHostInfo.domain) return - if (!gitHostInfo.protocols_re.test(parsed.protocol)) return - var pathmatch = gitHostInfo.pathmatch - var matched = parsed.path.match(pathmatch) - if (!matched) return - if (matched[1] != null) user = decodeURIComponent(matched[1]) - if (matched[2] != null) project = decodeURIComponent(matched[2]) - defaultRepresentation = protocolToRepresentation(parsed.protocol) - } - return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation) }).filter(function (gitHostInfo) { return gitHostInfo }) if (matches.length !== 1) return return matches[0] @@ -83,7 +89,7 @@ function fixupUnqualifiedGist (giturl) { function parseGitUrl (giturl) { if (typeof giturl !== 'string') giturl = '' + giturl - var matched = giturl.match(/^([^@]+)@([^:]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) + var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) if (!matched) return url.parse(giturl) return { protocol: 'git+ssh:', diff --git a/deps/npm/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/hosted-git-info/package.json index 7c8475510e..c1c321c51d 100644 --- a/deps/npm/node_modules/hosted-git-info/package.json +++ b/deps/npm/node_modules/hosted-git-info/package.json @@ -2,53 +2,45 @@ "_args": [ [ { - "name": "hosted-git-info", - "raw": "hosted-git-info@latest", - "rawSpec": "latest", + "raw": "hosted-git-info@2.4.1", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "hosted-git-info", + "name": "hosted-git-info", + "rawSpec": "2.4.1", + "spec": "2.4.1", + "type": "version" }, - "/Users/zkat/Documents/code/npm" + "/Users/rebecca/code/npm" ] ], - "_from": "hosted-git-info@latest", - "_id": "hosted-git-info@2.1.5", - "_inCache": true, - "_installable": true, + "_from": "hosted-git-info@2.4.1", + "_hasShrinkwrap": false, + "_id": "hosted-git-info@2.4.1", "_location": "/hosted-git-info", - "_nodeVersion": "5.10.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/hosted-git-info-2.1.5.tgz_1463518889246_0.20443619322031736" - }, - "_npmUser": { - "email": "kat@sykosomatic.org", - "name": "zkat" - }, - "_npmVersion": "3.9.1", "_phantomChildren": {}, "_requested": { - "name": "hosted-git-info", - "raw": "hosted-git-info@latest", - "rawSpec": "latest", + "raw": "hosted-git-info@2.4.1", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "hosted-git-info", + "name": "hosted-git-info", + "rawSpec": "2.4.1", + "spec": "2.4.1", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/normalize-package-data", "/npm-package-arg" ], - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz", - "_shasum": "0ba81d90da2e25ab34a332e6ec77936e1598118b", + "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.4.1.tgz", + "_shasum": "4b0445e41c004a8bd1337773a4ff790ca40318c8", "_shrinkwrap": null, - "_spec": "hosted-git-info@latest", - "_where": "/Users/zkat/Documents/code/npm", + "_spec": "hosted-git-info@2.4.1", + "_where": "/Users/rebecca/code/npm", "author": { - "email": "me@re-becca.org", "name": "Rebecca Turner", + "email": "me@re-becca.org", "url": "http://re-becca.org" }, "bugs": { @@ -57,15 +49,19 @@ "dependencies": {}, "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", "devDependencies": { - "standard": "^3.3.2", - "tap": "^0.4.13" + "standard": "^9.0.2", + "tap": "^10.3.0" }, "directories": {}, "dist": { - "shasum": "0ba81d90da2e25ab34a332e6ec77936e1598118b", - "tarball": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.5.tgz" + "shasum": "4b0445e41c004a8bd1337773a4ff790ca40318c8", + "tarball": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.4.1.tgz" }, - "gitHead": "4e6bb323a97a57c18e6b4b891527e26154d04fbe", + "files": [ + "index.js", + "git-host.js", + "git-host-info.js" + ], "homepage": "https://github.com/npm/hosted-git-info", "keywords": [ "git", @@ -75,29 +71,16 @@ ], "license": "ISC", "main": "index.js", - "maintainers": [ - { - "email": "me@re-becca.org", - "name": "iarna" - }, - { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" - }, - { - "email": "kat@sykosomatic.org", - "name": "zkat" - } - ], "name": "hosted-git-info", "optionalDependencies": {}, - "readme": "ERROR: No README data found!", + "readme": "# hosted-git-info\n\nThis will let you identify and transform various git hosts URLs between\nprotocols. It also can tell you what the URL is for the raw path for\nparticular file for direct access without git.\n\n## Example\n\n```javascript\nvar hostedGitInfo = require(\"hosted-git-info\")\nvar info = hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git\", opts)\n/* info looks like:\n{\n type: \"github\",\n domain: \"github.com\",\n user: \"npm\",\n project: \"hosted-git-info\"\n}\n*/\n```\n\nIf the URL can't be matched with a git host, `null` will be returned. We\ncan match git, ssh and https urls. Additionally, we can match ssh connect\nstrings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg,\n`github:npm/hosted-git-info`). Github specifically, is detected in the case\nof a third, unprefixed, form: `npm/hosted-git-info`.\n\nIf it does match, the returned object has properties of:\n\n* info.type -- The short name of the service\n* info.domain -- The domain for git protocol use\n* info.user -- The name of the user/org on the git host\n* info.project -- The name of the project on the git host\n\n## Version Contract\n\nThe major version will be bumped any time…\n\n* The constructor stops accepting URLs that it previously accepted.\n* A method is removed.\n* A method can no longer accept the number and type of arguments it previously accepted.\n* A method can return a different type than it currently returns.\n\nImplications:\n\n* I do not consider the specific format of the urls returned from, say\n `.https()` to be a part of the contract. The contract is that it will\n return a string that can be used to fetch the repo via HTTPS. But what\n that string looks like, specifically, can change.\n* Dropping support for a hosted git provider would constitute a breaking\n change.\n\n## Usage\n\n### var info = hostedGitInfo.fromUrl(gitSpecifier[, options])\n\n* *gitSpecifer* is a URL of a git repository or a SCP-style specifier of one.\n* *options* is an optional object. It can have the following properties:\n * *noCommittish* — If true then committishes won't be included in generated URLs.\n * *noGitPlus* — If true then `git+` won't be prefixed on URLs.\n\n## Methods\n\nAll of the methods take the same options as the `fromUrl` factory. Options\nprovided to a method override those provided to the constructor.\n\n* info.file(path, opts)\n\nGiven the path of a file relative to the repository, returns a URL for\ndirectly fetching it from the githost. If no committish was set then\n`master` will be used as the default.\n\nFor example `hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git#v1.0.0\").file(\"package.json\")`\nwould return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json`\n\n* info.shortcut(opts)\n\neg, `github:npm/hosted-git-info`\n\n* info.browse(opts)\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`\n\n* info.bugs(opts)\n\neg, `https://github.com/npm/hosted-git-info/issues`\n\n* info.docs(opts)\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme`\n\n* info.https(opts)\n\neg, `git+https://github.com/npm/hosted-git-info.git`\n\n* info.sshurl(opts)\n\neg, `git+ssh://git@github.com/npm/hosted-git-info.git`\n\n* info.ssh(opts)\n\neg, `git@github.com:npm/hosted-git-info.git`\n\n* info.path(opts)\n\neg, `npm/hosted-git-info`\n\n* info.tarball(opts)\n\neg, `https://github.com/npm/hosted-git-info/archive/v1.2.0.tar.gz`\n\n* info.getDefaultRepresentation()\n\nReturns the default output type. The default output type is based on the\nstring you passed in to be parsed\n\n* info.toString(opts)\n\nUses the getDefaultRepresentation to call one of the other methods to get a URL for\nthis resource. As such `hostedGitInfo.fromUrl(url).toString()` will give\nyou a normalized version of the URL that still uses the same protocol.\n\nShortcuts will still be returned as shortcuts, but the special case github\nform of `org/project` will be normalized to `github:org/project`.\n\nSSH connect strings will be normalized into `git+ssh` URLs.\n\n## Supported hosts\n\nCurrently this supports Github, Bitbucket and Gitlab. Pull requests for\nadditional hosts welcome.\n\n", + "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/npm/hosted-git-info.git" }, "scripts": { - "test": "standard && tap test/*.js" + "test": "standard && tap -J --coverage test/*.js" }, - "version": "2.1.5" + "version": "2.4.1" } diff --git a/deps/npm/node_modules/init-package-json/default-input.js b/deps/npm/node_modules/init-package-json/default-input.js index 59f8fec612..4110bac987 100644 --- a/deps/npm/node_modules/init-package-json/default-input.js +++ b/deps/npm/node_modules/init-package-json/default-input.js @@ -15,7 +15,7 @@ function niceName (n) { return n.replace(/^node-|[.-]js$/g, '').toLowerCase() } -function readDeps (test) { return function (cb) { +function readDeps (test, excluded) { return function (cb) { fs.readdir('node_modules', function (er, dir) { if (er) return cb() var deps = {} @@ -23,7 +23,7 @@ function readDeps (test) { return function (cb) { if (n === 0) return cb(null, deps) dir.forEach(function (d) { if (d.match(/^\./)) return next() - if (test !== isTestPkg(d)) + if (test !== isTestPkg(d) || excluded[d]) return next() var dp = path.join(dirname, 'node_modules', d, 'package.json') @@ -137,11 +137,11 @@ exports.directories = function (cb) { } if (!package.dependencies) { - exports.dependencies = readDeps(false) + exports.dependencies = readDeps(false, package.devDependencies || {}) } if (!package.devDependencies) { - exports.devDependencies = readDeps(true) + exports.devDependencies = readDeps(true, package.dependencies || {}) } // MUST have a test script! diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE deleted file mode 100644 index 19129e315f..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/README.md deleted file mode 100644 index 6960483bac..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/README.md +++ /dev/null @@ -1,359 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/common.js b/deps/npm/node_modules/init-package-json/node_modules/glob/common.js deleted file mode 100644 index c9127eb334..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/common.js +++ /dev/null @@ -1,226 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - return !(/\/$/.test(e)) - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js deleted file mode 100644 index a62da27ebd..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js +++ /dev/null @@ -1,765 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - var n = this.minimatch.set.length - this._processing = 0 - this.matches = new Array(n) - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - - function done () { - --self._processing - if (self._processing <= 0) - self._finish() - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - fs.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (this.matches[index][e]) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = this._makeAbs(e) - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - if (this.mark) - e = this._mark(e) - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er) - return cb() - - var isSym = lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && !stat.isDirectory()) - return cb(null, false, stat) - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return cb() - - return cb(null, c, stat) -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e315f..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index ad72b8133e..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instantiating the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index 5b5f8cf444..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,923 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } - - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md deleted file mode 100644 index 179392978d..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js deleted file mode 100644 index 955f27c817..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore deleted file mode 100644 index ae5d8c36ac..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -test -.gitignore -.travis.yml -Makefile -example.js diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e4148..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index 08e918c0db..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index e8d8587020..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,58 +0,0 @@ -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index 7933a525fc..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "balanced-match@^0.4.1", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^0.4.1", - "spec": ">=0.4.1 <0.5.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ] - ], - "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.2", - "_inCache": true, - "_installable": true, - "_location": "/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "4.4.7", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" - }, - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "2.15.8", - "_phantomChildren": {}, - "_requested": { - "raw": "balanced-match@^0.4.1", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^0.4.1", - "spec": ">=0.4.1 <0.5.0", - "type": "range" - }, - "_requiredBy": [ - "/minimatch/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", - "_shrinkwrap": null, - "_spec": "balanced-match@^0.4.1", - "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "dependencies": {}, - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "devDependencies": { - "tape": "^4.6.0" - }, - "directories": {}, - "dist": { - "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" - }, - "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", - "homepage": "https://github.com/juliangruber/balanced-match", - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "balanced-match", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "test": "make test" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "0.4.2" -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13c8a..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE deleted file mode 100644 index ee27ba4b44..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a1be..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js deleted file mode 100644 index 33656217b6..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js deleted file mode 100644 index b29a7812e5..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json deleted file mode 100644 index 9b6c500890..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "_args": [ - [ - "concat-map@0.0.1", - "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ], - [ - "concat-map@0.0.1", - "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ] - ], - "_from": "concat-map@0.0.1", - "_id": "concat-map@0.0.1", - "_inCache": true, - "_installable": true, - "_location": "/init-package-json/glob/minimatch/brace-expansion/concat-map", - "_npmUser": { - "email": "mail@substack.net", - "name": "substack" - }, - "_npmVersion": "1.3.21", - "_phantomChildren": {}, - "_requested": { - "name": "concat-map", - "raw": "concat-map@0.0.1", - "rawSpec": "0.0.1", - "scope": null, - "spec": "0.0.1", - "type": "version" - }, - "_requiredBy": [ - "/init-package-json/glob/minimatch/brace-expansion" - ], - "_shrinkwrap": null, - "_spec": "concat-map@0.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", - "author": { - "email": "mail@substack.net", - "name": "James Halliday", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "dependencies": {}, - "description": "concatenative mapdashery", - "devDependencies": { - "tape": "~2.4.0" - }, - "directories": { - "example": "example", - "test": "test" - }, - "dist": { - "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "homepage": "https://github.com/substack/node-concat-map", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "mail@substack.net", - "name": "substack" - } - ], - "name": "concat-map", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "browsers": { - "chrome": [ - 10, - 22 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "ie": [ - 6, - 7, - 8, - 9 - ], - "opera": [ - 12 - ], - "safari": [ - 5.1 - ] - }, - "files": "test/*.js" - }, - "version": "0.0.1" -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd7022f6..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json deleted file mode 100644 index 479c7879db..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "brace-expansion@^1.0.0", - "scope": null, - "escapedName": "brace-expansion", - "name": "brace-expansion", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch" - ] - ], - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.6", - "_inCache": true, - "_installable": true, - "_location": "/minimatch/brace-expansion", - "_nodeVersion": "4.4.7", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" - }, - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "2.15.8", - "_phantomChildren": {}, - "_requested": { - "raw": "brace-expansion@^1.0.0", - "scope": null, - "escapedName": "brace-expansion", - "name": "brace-expansion", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/minimatch" - ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", - "_shrinkwrap": null, - "_spec": "brace-expansion@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "dependencies": { - "balanced-match": "^0.4.1", - "concat-map": "0.0.1" - }, - "description": "Brace expansion as known from sh/bash", - "devDependencies": { - "tape": "^4.6.0" - }, - "directories": {}, - "dist": { - "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" - }, - "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", - "homepage": "https://github.com/juliangruber/brace-expansion", - "keywords": [], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - } - ], - "name": "brace-expansion", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "scripts": { - "gentest": "bash test/generate.sh", - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.1.6" -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index 22bfd82a8e..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "minimatch@2 || 3", - "scope": null, - "escapedName": "minimatch", - "name": "minimatch", - "rawSpec": "2 || 3", - "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob" - ] - ], - "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "minimatch@3.0.3", - "_inCache": true, - "_installable": true, - "_location": "/minimatch", - "_nodeVersion": "4.4.4", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.10.6", - "_phantomChildren": {}, - "_requested": { - "raw": "minimatch@2 || 3", - "scope": null, - "escapedName": "minimatch", - "name": "minimatch", - "rawSpec": "2 || 3", - "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", - "_shrinkwrap": null, - "_spec": "minimatch@2 || 3", - "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "description": "a glob matcher in javascript", - "devDependencies": { - "standard": "^3.7.2", - "tap": "^5.6.0" - }, - "directories": {}, - "dist": { - "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", - "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" - }, - "engines": { - "node": "*" - }, - "files": [ - "minimatch.js" - ], - "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", - "homepage": "https://github.com/isaacs/minimatch#readme", - "license": "ISC", - "main": "minimatch.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "minimatch", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js" - }, - "version": "3.0.3" -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js deleted file mode 100644 index 19f103f908..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -}; - -function win32(path) { - // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = !!device && device.charAt(1) !== ':'; - - // UNC paths are always absolute - return !!result[2] || isUnc; -}; - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json deleted file mode 100644 index 3fc29597c5..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "_args": [ - [ - "path-is-absolute@^1.0.0", - "/Users/rebecca/code/npm/node_modules/glob" - ], - [ - "path-is-absolute@^1.0.0", - "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob" - ] - ], - "_from": "path-is-absolute@>=1.0.0 <2.0.0", - "_id": "path-is-absolute@1.0.0", - "_inCache": true, - "_installable": true, - "_location": "/init-package-json/glob/path-is-absolute", - "_nodeVersion": "0.12.0", - "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - }, - "_npmVersion": "2.5.1", - "_phantomChildren": {}, - "_requested": { - "name": "path-is-absolute", - "raw": "path-is-absolute@^1.0.0", - "rawSpec": "^1.0.0", - "scope": null, - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/init-package-json/glob" - ], - "_shrinkwrap": null, - "_spec": "path-is-absolute@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob", - "author": { - "email": "sindresorhus@gmail.com", - "name": "Sindre Sorhus", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/path-is-absolute/issues" - }, - "dependencies": {}, - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", - "homepage": "https://github.com/sindresorhus/path-is-absolute", - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ], - "license": "MIT", - "maintainers": [ - { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - } - ], - "name": "path-is-absolute", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-is-absolute.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md deleted file mode 100644 index cdf94f4309..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -var pathIsAbsolute = require('path-is-absolute'); - -// Linux -pathIsAbsolute('/home/foo'); -//=> true - -// Windows -pathIsAbsolute('C:/Users/'); -//=> true - -// Any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -The Posix specific version. - -### pathIsAbsolute.win32(path) - -The Windows specific version. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/package.json deleted file mode 100644 index 1ce30a9b38..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - "glob@^6.0.0", - "/Users/rebecca/code/npm/node_modules/init-package-json" - ] - ], - "_from": "glob@>=6.0.0 <7.0.0", - "_id": "glob@6.0.4", - "_inCache": true, - "_installable": true, - "_location": "/init-package-json/glob", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "glob", - "raw": "glob@^6.0.0", - "rawSpec": "^6.0.0", - "scope": null, - "spec": ">=6.0.0 <7.0.0", - "type": "range" - }, - "_requiredBy": [ - "/init-package-json" - ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", - "_shrinkwrap": null, - "_spec": "glob@^6.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/init-package-json", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "description": "a little globber", - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^5.0.0", - "tick": "0.0.6" - }, - "directories": {}, - "dist": { - "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", - "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" - }, - "engines": { - "node": "*" - }, - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", - "homepage": "https://github.com/isaacs/node-glob#readme", - "license": "ISC", - "main": "glob.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "glob", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "scripts": { - "bench": "bash benchmark.sh", - "benchclean": "node benchclean.js", - "prepublish": "npm run benchclean", - "prof": "bash prof.sh && cat profile.txt", - "profclean": "rm -f v8.log profile.txt", - "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" - }, - "version": "6.0.4" -} diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js deleted file mode 100644 index 09883d2ce0..0000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js +++ /dev/null @@ -1,460 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = fs.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this.matches[index][e] = true - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - var abs = this._makeAbs(e) - if (this.mark) - e = this._mark(e) - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[this._makeAbs(e)] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - // lstat failed, doesn't exist - return null - } - - var isSym = lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this.matches[index][prefix] = true -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - return false - } - - if (lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index fbca584dd5..4377a372d7 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -2,10 +2,11 @@ "_args": [ [ { - "name": "init-package-json", "raw": "init-package-json@latest", - "rawSpec": "latest", "scope": null, + "escapedName": "init-package-json", + "name": "init-package-json", + "rawSpec": "latest", "spec": "latest", "type": "tag" }, @@ -13,72 +14,71 @@ ] ], "_from": "init-package-json@latest", - "_id": "init-package-json@1.9.4", + "_id": "init-package-json@1.9.5", "_inCache": true, - "_installable": true, "_location": "/init-package-json", - "_nodeVersion": "5.10.1", + "_nodeVersion": "7.7.1", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/init-package-json-1.9.4.tgz_1463610982259_0.011722659226506948" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/init-package-json-1.9.5.tgz_1488924630483_0.1780379111878574" }, "_npmUser": { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.9.1", + "_npmVersion": "4.1.2", "_phantomChildren": { - "inflight": "1.0.5", - "inherits": "2.0.1", - "once": "1.3.3", "read": "1.0.7" }, "_requested": { - "name": "init-package-json", "raw": "init-package-json@latest", - "rawSpec": "latest", "scope": null, + "escapedName": "init-package-json", + "name": "init-package-json", + "rawSpec": "latest", "spec": "latest", "type": "tag" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.4.tgz", - "_shasum": "b4053d0b40f0cf842a41966937cb3dc0f534e856", + "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.5.tgz", + "_shasum": "7d4d64a264dc76c1f1f557cbbe824978bf10cd09", "_shrinkwrap": null, "_spec": "init-package-json@latest", "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { "url": "https://github.com/npm/init-package-json/issues" }, "dependencies": { - "glob": "^6.0.0", + "glob": "^7.1.1", "npm-package-arg": "^4.0.0", "promzard": "^0.3.0", "read": "~1.0.1", "read-package-json": "1 || 2", "semver": "2.x || 3.x || 4 || 5", "validate-npm-package-license": "^3.0.1", - "validate-npm-package-name": "^2.0.1" + "validate-npm-package-name": "^3.0.0" }, "description": "A node module to get your node module started", "devDependencies": { - "npm": "^2", + "mkdirp": "^0.5.1", + "npm": "^4.3.0", "rimraf": "^2.1.4", - "tap": "^1.2.0" + "tap": "^10.3.0" }, "directories": {}, "dist": { - "shasum": "b4053d0b40f0cf842a41966937cb3dc0f534e856", - "tarball": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.4.tgz" + "shasum": "7d4d64a264dc76c1f1f557cbbe824978bf10cd09", + "tarball": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.5.tgz" }, - "gitHead": "3c34250fa58507056a94f3940ee2a28540f83592", + "gitHead": "d83eb6cb36d17c6938b9f7a58ae6566f1c8fc869", "homepage": "https://github.com/npm/init-package-json#readme", "keywords": [ "init", @@ -94,20 +94,20 @@ "main": "init-package-json.js", "maintainers": [ { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "init-package-json", @@ -120,5 +120,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "1.9.4" + "version": "1.9.5" } diff --git a/deps/npm/node_modules/init-package-json/test/dependencies.js b/deps/npm/node_modules/init-package-json/test/dependencies.js new file mode 100644 index 0000000000..a53f46a641 --- /dev/null +++ b/deps/npm/node_modules/init-package-json/test/dependencies.js @@ -0,0 +1,60 @@ +var tap = require('tap') +var init = require('../') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var fs = require('fs') + +var EXPECT = { + name: 'test-deps', + version: '1.0.0', + description: '', + author: '', + scripts: { test: 'mocha' }, + main: 'index.js', + keywords: [], + license: 'ISC', + dependencies: { + 'tap': '*' + }, + devDependencies: { + 'mocha': '^1.0.0' + } +} + +var origwd = process.cwd() +var testdir = path.resolve(__dirname, 'test-deps') +mkdirp.sync(testdir) +process.chdir(testdir) + +fs.writeFileSync(path.resolve(testdir, 'package.json'), JSON.stringify({ + dependencies: { + 'tap': '*' + } +})) + +var fakedeps = ['mocha', 'tap', 'async', 'foobar'] + +fakedeps.forEach(function(dep) { + var depdir = path.resolve(testdir, 'node_modules', dep) + mkdirp.sync(depdir) + + fs.writeFileSync(path.resolve(depdir, 'package.json'), JSON.stringify({ + name: dep, + version: '1.0.0' + })) +}) + +tap.test('read in dependencies and dev deps', function (t) { + init(testdir, testdir, {yes: 'yes', 'save-prefix': '^'}, function (er, data) { + if (er) throw er + + t.same(data, EXPECT, 'used the correct dependency information') + t.end() + }) +}) + +tap.test('teardown', function (t) { + process.chdir(origwd) + rimraf(testdir, t.end.bind(t)) +}) diff --git a/deps/npm/node_modules/lazy-property/.npmignore b/deps/npm/node_modules/lazy-property/.npmignore new file mode 100644 index 0000000000..038e0242eb --- /dev/null +++ b/deps/npm/node_modules/lazy-property/.npmignore @@ -0,0 +1,16 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log +node_modules/* +test/* \ No newline at end of file diff --git a/deps/npm/node_modules/lazy-property/LICENSE b/deps/npm/node_modules/lazy-property/LICENSE new file mode 100644 index 0000000000..8ce206a845 --- /dev/null +++ b/deps/npm/node_modules/lazy-property/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2013 Mikola Lysenko + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/lazy-property/README.md b/deps/npm/node_modules/lazy-property/README.md new file mode 100644 index 0000000000..d339c8f460 --- /dev/null +++ b/deps/npm/node_modules/lazy-property/README.md @@ -0,0 +1,44 @@ +lazy-property +============= +Adds a lazily initialized property to an object. + +## Example + +```javascript +var addLazyProperty = require("lazy-property") + +var obj = {} + +addLazyProperty(obj, "foo", function() { + console.log("initialized!") + return "bar" +}) + +//Access the property +console.log(obj.foo) +console.log(obj.foo) + +//Prints out: +// +// initialized! +// bar +// bar +// +``` + +## Install + + npm install lazy-property + +## API + +### `require("lazy-property")(obj, name, init[, enumerable])` +Adds a lazily initialized property to the object. + +* `obj` is the object to add the property to +* `name` is the name of the property +* `init` is a function that computes the value of the property +* `enumerable` if the property is enumerable (default `false`) + +## Credits +(c) 2013 Mikola Lysenko. MIT License diff --git a/deps/npm/node_modules/lazy-property/component.json b/deps/npm/node_modules/lazy-property/component.json new file mode 100644 index 0000000000..142938e496 --- /dev/null +++ b/deps/npm/node_modules/lazy-property/component.json @@ -0,0 +1,7 @@ +{ + "name": "lazy-property", + "version": "0.0.2", + "description": "Lazily initialized properties for objects", + "main": "lazyProperty.js", + "scripts": ["lazyProperty.js"] +} diff --git a/deps/npm/node_modules/lazy-property/lazyProperty.js b/deps/npm/node_modules/lazy-property/lazyProperty.js new file mode 100644 index 0000000000..20e5fe1912 --- /dev/null +++ b/deps/npm/node_modules/lazy-property/lazyProperty.js @@ -0,0 +1,19 @@ +"use strict" + +function addLazyProperty(object, name, initializer, enumerable) { + Object.defineProperty(object, name, { + get: function() { + var v = initializer.call(this) + Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true }) + return v + }, + set: function(v) { + Object.defineProperty(this, name, { value: v, enumerable: !!enumerable, writable: true }) + return v + }, + enumerable: !!enumerable, + configurable: true + }) +} + +module.exports = addLazyProperty diff --git a/deps/npm/node_modules/lazy-property/package.json b/deps/npm/node_modules/lazy-property/package.json new file mode 100644 index 0000000000..a11a940768 --- /dev/null +++ b/deps/npm/node_modules/lazy-property/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + { + "raw": "lazy-property", + "scope": null, + "escapedName": "lazy-property", + "name": "lazy-property", + "rawSpec": "", + "spec": "latest", + "type": "tag" + }, + "/Users/rebecca/code/npm" + ] + ], + "_from": "lazy-property@latest", + "_id": "lazy-property@1.0.0", + "_inCache": true, + "_location": "/lazy-property", + "_npmUser": { + "name": "mikolalysenko", + "email": "mikolalysenko@gmail.com" + }, + "_npmVersion": "1.4.3", + "_phantomChildren": {}, + "_requested": { + "raw": "lazy-property", + "scope": null, + "escapedName": "lazy-property", + "name": "lazy-property", + "rawSpec": "", + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/lazy-property/-/lazy-property-1.0.0.tgz", + "_shasum": "84ddc4b370679ba8bd4cdcfa4c06b43d57111147", + "_shrinkwrap": null, + "_spec": "lazy-property", + "_where": "/Users/rebecca/code/npm", + "author": { + "name": "Mikola Lysenko" + }, + "bugs": { + "url": "https://github.com/mikolalysenko/lazy-property/issues" + }, + "dependencies": {}, + "description": "Lazily initialized properties for objects", + "devDependencies": { + "tape": "^2.12.3" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "84ddc4b370679ba8bd4cdcfa4c06b43d57111147", + "tarball": "https://registry.npmjs.org/lazy-property/-/lazy-property-1.0.0.tgz" + }, + "gitHead": "850a27f710ec72f05b534805c31f095ff590f1ea", + "homepage": "https://github.com/mikolalysenko/lazy-property", + "keywords": [ + "lazy", + "property", + "object", + "initialize", + "array", + "dictionary" + ], + "license": "MIT", + "main": "lazyProperty.js", + "maintainers": [ + { + "name": "mikolalysenko", + "email": "mikolalysenko@gmail.com" + } + ], + "name": "lazy-property", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/lazy-property.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/move-concurrently/LICENSE b/deps/npm/node_modules/move-concurrently/LICENSE new file mode 100644 index 0000000000..e0040f6659 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2017, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/move-concurrently/README.md b/deps/npm/node_modules/move-concurrently/README.md new file mode 100644 index 0000000000..0e6e9b9ea8 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/README.md @@ -0,0 +1,53 @@ +# move-concurrently + +Move files and directories. + +``` +const move = require('move-concurrently') +move('/path/to/thing', '/new/path/thing').then(() => { + // thing is now moved! +}).catch(err => { + // oh no! +}) +``` + +Uses `rename` to move things as fast as possible. + +If you `move` across devices or on filesystems that don't support renaming +large directories. That is, situations that result in `rename` returning +the `EXDEV` error, then `move` will fallback to copy + delete. + +When recursively copying directories it will first try to rename the +contents before falling back to copying. While this will be slightly slower +in true cross-device scenarios, it is MUCH faster in cases where the +filesystem can't handle directory renames. + +When copying ownership is maintained when running as root. Permissions are +always maintained. On Windows, if symlinks are unavailable then junctions +will be used. + +## INTERFACE + +### move(from, to, options) → Promise + +Recursively moves `from` to `to` and resolves its promise when finished. +If `to` already exists then the promise will be rejected with an `EEXIST` +error. + +Starts by trying to rename `from` to `to`. + +Options are: + +* maxConcurrency – (Default: `1`) The maximum number of concurrent copies to do at once. +* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires + an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory + fails then we'll try making a junction instead. + +Options can also include dependency injection: + +* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's. +* fs - (Default: `require('fs')`) The filesystem module to use. Can be used + to use `graceful-fs` or to inject a mock. +* writeStreamAtomic - (Default: `require('fs-write-stream-atomic')`) The + implementation of `writeStreamAtomic` to use. Used to inject a mock. +* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock. diff --git a/deps/npm/node_modules/move-concurrently/move.js b/deps/npm/node_modules/move-concurrently/move.js new file mode 100644 index 0000000000..6a2a7332c8 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/move.js @@ -0,0 +1,84 @@ +'use strict' +module.exports = move + +var nodeFs = require('fs') +var rimraf = require('rimraf') +var validate = require('aproba') +var copy = require('copy-concurrently') +var RunQueue = require('run-queue') +var extend = Object.assign || require('util')._extend + +function promisify (Promise, fn) { + return function () { + var args = [].slice.call(arguments) + return new Promise(function (resolve, reject) { + return fn.apply(null, args.concat(function (err, value) { + if (err) { + reject(err) + } else { + resolve(value) + } + })) + }) + } +} + +function move (from, to, opts) { + validate('SSO|SS', arguments) + opts = extend({}, opts || {}) + + var Promise = opts.Promise || global.Promise + var fs = opts.fs || nodeFs + var rimrafAsync = promisify(Promise, rimraf) + var renameAsync = promisify(Promise, fs.rename) + + opts.top = from + + var queue = new RunQueue({ + maxConcurrency: opts.maxConcurrency, + Promise: Promise + }) + opts.queue = queue + opts.recurseWith = rename + + queue.add(0, rename, [from, to, opts]) + + return queue.run().then(function () { + return remove(from) + }, function (err) { + // if the target already exists don't clobber it + if (err.code === 'EEXIST' || err.code === 'EPERM') { + return passThroughError() + } else { + return remove(to).then(passThroughError, passThroughError) + } + function passThroughError () { + return Promise.reject(err) + } + }) + + function remove (target) { + var opts = { + unlink: fs.unlink, + chmod: fs.chmod, + stat: fs.stat, + lstat: fs.lstat, + rmdir: fs.rmdir, + readdir: fs.readdir, + glob: false + } + return rimrafAsync(target, opts) + } + + function rename (from, to, opts, done) { + return renameAsync(from, to).catch(function (err) { + if (err.code !== 'EXDEV') { + return Promise.reject(err) + } else { + return remove(to).then(function () { + return copy.item(from, to, opts) + }) + } + }) + } +} diff --git a/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/LICENSE b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/LICENSE new file mode 100644 index 0000000000..e0040f6659 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2017, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/README.md b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/README.md new file mode 100644 index 0000000000..e27b016d72 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/README.md @@ -0,0 +1,128 @@ +# copy-concurrently + +Copy files, directories and symlinks + +``` +const copy = require('copy-concurrently') +copy('/path/to/thing', '/new/path/thing').then(() => { + // this is now copied +}).catch(err => { + // oh noooo +}) +``` + +Copies files, directories and symlinks. Ownership is maintained when +running as root, permissions are always maintained. On Windows, if symlinks +are unavailable then junctions will be used. + +## PUBLIC INTERFACE + +### copy(from, to, [options]) → Promise + +Recursively copies `from` to `to` and resolves its promise when finished. +If `to` already exists then the promise will be rejected with an `EEXIST` +error. + +Options are: + +* maxConcurrency – (Default: `1`) The maximum number of concurrent copies to do at once. +* recurseWith - (Default: `copy.item`) The function to call on each file after recursing into a directory. +* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires + an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory + fails then we'll try making a junction instead. + +Options can also include dependency injection: + +* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's. +* fs - (Default: `require('fs')`) The filesystem module to use. Can be used + to use `graceful-fs` or to inject a mock. +* writeStreamAtomic - (Default: `require('fs-write-stream-atomic')`) The + implementation of `writeStreamAtomic` to use. Used to inject a mock. +* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock. + +## EXTENSION INTERFACE + +Ordinarily you'd only call `copy` above. But it's possible to use it's +component functions directly. This is useful if, say, you're writing +[move-concurently](https://npmjs.com/package/move-concurrently). + +### copy.file(from, to, options) → Promise + +Copies an ordinary file `from` to destination `to`. Uses +`fs-write-stream-atomic` to ensure that the file is either entirely copied +or not at all. + +Options are: + +* uid, gid - (Optional) If `getuid()` is `0` then this and gid will be used to + set the user and group of `to`. If uid is present then gid must be too. +* mode - (Optional) If set then `to` will have its perms set to `mode`. +* fs - (Default: `require('fs')`) The filesystem module to use. Can be used + to use `graceful-fs` or to inject a mock. +* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's. +* writeStreamAtomic - (Default `require('fs-write-stream-atomic')`) The + implementation of `writeStreamAtomic` to use. Used to inject a mock. + +### copy.symlink(from, to, options) → Promise + +Copies a symlink `from` to destination `to`. If you're using Windows and +symlinking fails and what you're linking is a directory then junctions will +be tried instead. + +Options are: + +* top - The top level the copy is being run from. This is used to determine + if the symlink destination is within the set of files we're copying or + outside it. +* fs - (Default: `require('fs')`) The filesystem module to use. Can be used + to use `graceful-fs` or to inject a mock. +* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's. +* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires + an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory + fails then we'll try making a junction instead. + +### copy.recurse(from, to, options) → Promise + +Reads all of the files in directory `from` and adds them to the `queue` +using `recurseWith` (by default `copy.item`). + +Options are: + +* queue - A [`run-queue`](https://npmjs.com/package/run-queue) object to add files found inside `from` to. +* recurseWith - (Default: `copy.item`) The function to call on each file after recursing into a directory. +* uid, gid - (Optional) If `getuid()` is `0` then this and gid will be used to + set the user and group of `to`. If uid is present then gid must be too. +* mode - (Optional) If set then `to` will have its perms set to `mode`. +* fs - (Default: `require('fs')`) The filesystem module to use. Can be used + to use `graceful-fs` or to inject a mock. +* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock. + +### copy.item(from, to, options) → Promise + +Copies some kind of `from` to destination `to`. This looks at the filetype +and calls `copy.file`, `copy.symlink` or `copy.recurse` as appropriate. + +Symlink copies are queued with a priority such that they happen after all +file and directory copies as you can't create a junction on windows to a +file that doesn't exist yet. + +Options are: + +* top - The top level the copy is being run from. This is used to determine + if the symlink destination is within the set of files we're copying or + outside it. +* queue - The [`run-queue`](https://npmjs.com/package/run-queue) object to + pass to `copy.recurse` if `from` is a directory. +* recurseWith - (Default: `copy.item`) The function to call on each file after recursing into a directory. +* uid, gid - (Optional) If `getuid()` is `0` then this and gid will be used to + set the user and group of `to`. If uid is present then gid must be too. +* mode - (Optional) If set then `to` will have its perms set to `mode`. +* fs - (Default: `require('fs')`) The filesystem module to use. Can be used + to use `graceful-fs` or to inject a mock. +* getuid - (Default: `process.getuid`) A function that returns the current UID. Used to inject a mock. +* isWindows - (Default: `process.platform === 'win32'`) If true enables Windows symlink semantics. This requires + an extra `stat` to determine if the destination of a symlink is a file or directory. If symlinking a directory + fails then we'll try making a junction instead. +* Promise - (Default: `global.Promise`) The promise implementation to use, defaults to Node's. +* writeStreamAtomic - (Default `require('fs-write-stream-atomic')`) The + implementation of `writeStreamAtomic` to use. Used to inject a mock. diff --git a/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/copy.js b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/copy.js new file mode 100644 index 0000000000..7455928a98 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/copy.js @@ -0,0 +1,224 @@ +'use strict' +module.exports = copy +module.exports.item = copyItem +module.exports.recurse = recurseDir +module.exports.symlink = copySymlink +module.exports.file = copyFile + +var nodeFs = require('fs') +var path = require('path') +var validate = require('aproba') +var stockWriteStreamAtomic = require('fs-write-stream-atomic') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var isWindows = require('./is-windows') +var RunQueue = require('run-queue') +var extend = Object.assign || require('util')._extend + +function promisify (Promise, fn) { + return function () { + var args = [].slice.call(arguments) + return new Promise(function (resolve, reject) { + return fn.apply(null, args.concat(function (err, value) { + if (err) { + reject(err) + } else { + resolve(value) + } + })) + }) + } +} + +function copy (from, to, opts) { + validate('SSO|SS', arguments) + opts = extend({}, opts || {}) + + var Promise = opts.Promise || global.Promise + var fs = opts.fs || nodeFs + + if (opts.isWindows == null) opts.isWindows = isWindows + if (!opts.Promise) opts.Promise = Promise + if (!opts.fs) opts.fs = fs + if (!opts.recurseWith) opts.recurseWith = copyItem + if (!opts.lstat) opts.lstat = promisify(opts.Promise, fs.lstat) + if (!opts.stat) opts.stat = promisify(opts.Promise, fs.stat) + if (!opts.chown) opts.chown = promisify(opts.Promise, fs.chown) + if (!opts.readdir) opts.readdir = promisify(opts.Promise, fs.readdir) + if (!opts.readlink) opts.readlink = promisify(opts.Promise, fs.readlink) + if (!opts.symlink) opts.symlink = promisify(opts.Promise, fs.symlink) + if (!opts.chmod) opts.chmod = promisify(opts.Promise, fs.chmod) + + opts.top = from + opts.mkdirpAsync = promisify(opts.Promise, mkdirp) + var rimrafAsync = promisify(opts.Promise, rimraf) + + var queue = new RunQueue({ + maxConcurrency: opts.maxConcurrency, + Promise: Promise + }) + opts.queue = queue + + queue.add(0, copyItem, [from, to, opts]) + + return queue.run().catch(function (err) { + // if the target already exists don't clobber it + if (err.code === 'EEXIST' || err.code === 'EPERM') { + return passThroughError() + } else { + return remove(to).then(passThroughError, passThroughError) + } + function passThroughError () { + return Promise.reject(err) + } + }) + + function remove (target) { + var opts = { + unlink: fs.unlink, + chmod: fs.chmod, + stat: fs.stat, + lstat: fs.lstat, + rmdir: fs.rmdir, + readdir: fs.readdir, + glob: false + } + return rimrafAsync(target, opts) + } +} + +function copyItem (from, to, opts) { + validate('SSO', [from, to, opts]) + var fs = opts.fs || nodeFs + var Promise = opts.Promise || global.Promise + var lstat = opts.lstat || promisify(Promise, fs.lstat) + + return lstat(to).then(function () { + return Promise.reject(eexists(from, to)) + }, function (err) { + if (err && err.code !== 'ENOENT') return Promise.reject(err) + return lstat(from) + }).then(function (fromStat) { + var cmdOpts = extend(extend({}, opts), fromStat) + if (fromStat.isDirectory()) { + return recurseDir(from, to, cmdOpts) + } else if (fromStat.isSymbolicLink()) { + opts.queue.add(1, copySymlink, [from, to, cmdOpts]) + } else if (fromStat.isFile()) { + return copyFile(from, to, cmdOpts) + } else if (fromStat.isBlockDevice()) { + return Promise.reject(eunsupported(from + " is a block device, and we don't know how to copy those.")) + } else if (fromStat.isCharacterDevice()) { + return Promise.reject(eunsupported(from + " is a character device, and we don't know how to copy those.")) + } else if (fromStat.isFIFO()) { + return Promise.reject(eunsupported(from + " is a FIFO, and we don't know how to copy those.")) + } else if (fromStat.isSocket()) { + return Promise.reject(eunsupported(from + " is a socket, and we don't know how to copy those.")) + } else { + return Promise.reject(eunsupported("We can't tell what " + from + " is and so we can't copy it.")) + } + }) +} + +function recurseDir (from, to, opts) { + validate('SSO', [from, to, opts]) + var recurseWith = opts.recurseWith || copyItem + var fs = opts.fs || nodeFs + var chown = opts.chown || promisify(Promise, fs.chown) + var readdir = opts.readdir || promisify(Promise, fs.readdir) + + return opts.mkdirpAsync(to, {fs: fs, mode: opts.mode}).then(function () { + var getuid = opts.getuid || process.getuid + if (getuid && opts.uid != null && getuid() === 0) { + return chown(to, opts.uid, opts.gid) + } + }).then(function () { + return readdir(from) + }).then(function (files) { + files.forEach(function (file) { + opts.queue.add(0, recurseWith, [path.join(from, file), path.join(to, file), opts]) + }) + }) +} + +function copySymlink (from, to, opts) { + validate('SSO', [from, to, opts]) + var fs = opts.fs || nodeFs + var readlink = opts.readlink || promisify(Promise, fs.readlink) + var stat = opts.stat || promisify(Promise, fs.symlink) + var symlink = opts.symlink || promisify(Promise, fs.symlink) + var Promise = opts.Promise || global.Promise + + return readlink(from).then(function (fromDest) { + var absoluteDest = path.resolve(path.dirname(from), fromDest) + // Treat absolute paths that are inside the tree we're + // copying as relative. This necessary to properly support junctions + // on windows (which are always absolute) but is also DWIM with symlinks. + var relativeDest = path.relative(opts.top, absoluteDest) + var linkFrom = relativeDest.substr(0, 2) === '..' ? fromDest : path.relative(path.dirname(from), absoluteDest) + if (opts.isWindows) { + return stat(absoluteDest).catch(function () { return null }).then(function (destStat) { + var isDir = destStat && destStat.isDirectory() + var type = isDir ? 'dir' : 'file' + return symlink(linkFrom, to, type).catch(function (err) { + if (type === 'dir') { + return symlink(linkFrom, to, 'junction') + } else { + return Promise.reject(err) + } + }) + }) + } else { + return symlink(linkFrom, to) + } + }) +} + +function copyFile (from, to, opts) { + validate('SSO', [from, to, opts]) + var fs = opts.fs || nodeFs + var writeStreamAtomic = opts.writeStreamAtomic || stockWriteStreamAtomic + var Promise = opts.Promise || global.Promise + var chmod = opts.chmod || promisify(Promise, fs.chmod) + + var writeOpts = {} + var getuid = opts.getuid || process.getuid + if (getuid && opts.uid != null && getuid() === 0) { + writeOpts.chown = { + uid: opts.uid, + gid: opts.gid + } + } + + return new Promise(function (resolve, reject) { + var errored = false + function onError (err) { + errored = true + reject(err) + } + fs.createReadStream(from) + .once('error', onError) + .pipe(writeStreamAtomic(to, writeOpts)) + .once('error', onError) + .once('close', function () { + if (errored) return + if (opts.mode != null) { + resolve(chmod(to, opts.mode)) + } else { + resolve() + } + }) + }) +} + +function eexists (from, to) { + var err = new Error('Could not move ' + from + ' to ' + to + ': destination already exists.') + err.code = 'EEXIST' + return err +} + +function eunsupported (msg) { + var err = new Error(msg) + err.code = 'EUNSUPPORTED' + return err +} diff --git a/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/is-windows.js b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/is-windows.js new file mode 100644 index 0000000000..8a991d54f5 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/is-windows.js @@ -0,0 +1,2 @@ +'use strict' +module.exports = process.platform === 'win32' diff --git a/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/package.json b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/package.json new file mode 100644 index 0000000000..28ff79dd57 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/copy-concurrently/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "copy-concurrently@^1.0.0", + "scope": null, + "escapedName": "copy-concurrently", + "name": "copy-concurrently", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/move-concurrently" + ] + ], + "_from": "copy-concurrently@>=1.0.0 <2.0.0", + "_id": "copy-concurrently@1.0.3", + "_inCache": true, + "_location": "/move-concurrently/copy-concurrently", + "_nodeVersion": "4.6.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/copy-concurrently-1.0.3.tgz_1489706523710_0.4328302445355803" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "4.4.3", + "_phantomChildren": {}, + "_requested": { + "raw": "copy-concurrently@^1.0.0", + "scope": null, + "escapedName": "copy-concurrently", + "name": "copy-concurrently", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/move-concurrently" + ], + "_resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.3.tgz", + "_shasum": "45fb7866249a1ca889aa5708e6cbd273e75bb250", + "_shrinkwrap": null, + "_spec": "copy-concurrently@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/move-concurrently", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/npm/copy-concurrently/issues" + }, + "dependencies": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + }, + "description": "Promises of copies of files, directories and symlinks, with concurrency controls and win32 junction fallback.", + "devDependencies": { + "standard": "^8.6.0", + "tacks": "^1.2.6", + "tap": "^10.1.1" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "45fb7866249a1ca889aa5708e6cbd273e75bb250", + "tarball": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.3.tgz" + }, + "files": [ + "copy.js", + "is-windows.js" + ], + "gitHead": "1b4b93b19c0cb2f6676c8a73dc86a1333d373230", + "homepage": "https://www.npmjs.com/package/copy-concurrently", + "keywords": [ + "copy", + "cpr" + ], + "license": "ISC", + "main": "copy.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "copy-concurrently", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/copy-concurrently.git" + }, + "scripts": { + "test": "standard && tap --coverage test" + }, + "version": "1.0.3" +} diff --git a/deps/npm/node_modules/move-concurrently/node_modules/run-queue/README.md b/deps/npm/node_modules/move-concurrently/node_modules/run-queue/README.md new file mode 100644 index 0000000000..e84214d1f0 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/run-queue/README.md @@ -0,0 +1,86 @@ +# run-queue + +A promise based, dynamic priority queue runner, with concurrency limiting. + +```js +const RunQueue = require('run-queue') + +const queue = new RunQueue({ + maxConcurrency: 1 +}) + +queue.add(1, example, [-1]) +for (let ii = 0; ii < 5; ++ii) { + queue.add(0, example, [ii]) +} +const finished = [] +queue.run().then( + console.log(finished) +}) + +function example (num, next) { + setTimeout(() => { + finished.push(num) + next() + }, 5 - Math.abs(num)) +} +``` + +would output + +``` +[ 0, 1, 2, 3, 4, -1 ] +``` + +If you bump concurrency to `2`, then you get: + +``` +[ 1, 0, 3, 2, 4, -1 ] +``` + +The concurrency means that they don't finish in order, because some take +longer than others. Each priority level must finish entirely before the +next priority level is run. See +[PRIORITIES](https://github.com/iarna/run-queue#priorities) below. This is +even true if concurrency is set high enough that all of the regular queue +can execute at once, for instance, with `maxConcurrency: 10`: + +``` +[ 4, 3, 2, 1, 0, -1 ] +``` + +## API + +### const queue = new RunQueue(options) + +Create a new queue. Options may contain: + +* maxConcurrency - (Default: `1`) The maximum number of jobs to execute at once. +* Promise - (Default: global.Promise) The promise implementation to use. + +### queue.add (prio, fn, args) + +Add a new job to the end of the queue at priority `prio` that will run `fn` +with `args`. If `fn` is async then it should return a Promise. + +### queue.run () + +Start running the job queue. Returns a Promise that resolves when either +all the jobs are complete or a job ends in error (throws or returns a +rejected promise). If a job ended in error then this Promise will be rejected +with that error and no further queue running will be done. + +## PRIORITIES + +Priorities are any integer value >= 0. + +Lowest is executed first. + +Priorities essentially represent distinct job queues. All jobs in a queue +must complete before the next highest priority job queue is executed. + +This means that if you have two queues, `0` and `1` then ALL jobs in `0` +must complete before ANY execute in `1`. If you add new `0` level jobs +while `1` level jobs are running then it will switch back processing the `0` +queue and won't execute any more `1` jobs till all of the new `0` jobs +complete. diff --git a/deps/npm/node_modules/move-concurrently/node_modules/run-queue/package.json b/deps/npm/node_modules/move-concurrently/node_modules/run-queue/package.json new file mode 100644 index 0000000000..58690aae28 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/run-queue/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + { + "raw": "run-queue@^1.0.3", + "scope": null, + "escapedName": "run-queue", + "name": "run-queue", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/move-concurrently" + ] + ], + "_from": "run-queue@>=1.0.3 <2.0.0", + "_id": "run-queue@1.0.3", + "_inCache": true, + "_location": "/move-concurrently/run-queue", + "_nodeVersion": "0.12.13", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/run-queue-1.0.3.tgz_1488161288446_0.14580746600404382" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "2.15.0", + "_phantomChildren": {}, + "_requested": { + "raw": "run-queue@^1.0.3", + "scope": null, + "escapedName": "run-queue", + "name": "run-queue", + "rawSpec": "^1.0.3", + "spec": ">=1.0.3 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/move-concurrently", + "/move-concurrently/copy-concurrently" + ], + "_resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "_shasum": "e848396f057d223f24386924618e25694161ec47", + "_shrinkwrap": null, + "_spec": "run-queue@^1.0.3", + "_where": "/Users/rebecca/code/npm/node_modules/move-concurrently", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/run-queue/issues" + }, + "dependencies": { + "aproba": "^1.1.1" + }, + "description": "A promise based, dynamic priority queue runner, with concurrency limiting.", + "devDependencies": { + "standard": "^8.6.0", + "tap": "^10.2.0" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "e848396f057d223f24386924618e25694161ec47", + "tarball": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz" + }, + "files": [ + "queue.js" + ], + "gitHead": "3c315b738d0578c2c54be2beb0469d00ccf1dc25", + "homepage": "https://npmjs.com/package/run-queue", + "keywords": [], + "license": "ISC", + "main": "queue.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "run-queue", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/run-queue.git" + }, + "scripts": { + "test": "standard && tap -J test" + }, + "version": "1.0.3" +} diff --git a/deps/npm/node_modules/move-concurrently/node_modules/run-queue/queue.js b/deps/npm/node_modules/move-concurrently/node_modules/run-queue/queue.js new file mode 100644 index 0000000000..500bf293d3 --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/node_modules/run-queue/queue.js @@ -0,0 +1,95 @@ +'use strict' +module.exports = RunQueue + +var validate = require('aproba') + +function RunQueue (opts) { + validate('Z|O', [opts]) + if (!opts) opts = {} + this.finished = false + this.inflight = 0 + this.maxConcurrency = opts.maxConcurrency || 1 + this.queued = 0 + this.queue = [] + this.currentPrio = null + this.currentQueue = null + this.Promise = opts.Promise || global.Promise + this.deferred = {} +} + +RunQueue.prototype = {} + +RunQueue.prototype.run = function () { + if (arguments.length !== 0) throw new Error('RunQueue.run takes no arguments') + var self = this + var deferred = this.deferred + if (!deferred.promise) { + deferred.promise = new this.Promise(function (resolve, reject) { + deferred.resolve = resolve + deferred.reject = reject + self._runQueue() + }) + } + return deferred.promise +} + +RunQueue.prototype._runQueue = function () { + var self = this + + while ((this.inflight < this.maxConcurrency) && this.queued) { + if (!this.currentQueue || this.currentQueue.length === 0) { + // wait till the current priority is entirely processed before + // starting a new one + if (this.inflight) return + var prios = Object.keys(this.queue) + for (var ii = 0; ii < prios.length; ++ii) { + var prioQueue = this.queue[prios[ii]] + if (prioQueue.length) { + this.currentQueue = prioQueue + this.currentPrio = prios[ii] + break + } + } + } + + --this.queued + ++this.inflight + var next = this.currentQueue.shift() + var args = next.args || [] + + // we explicitly construct a promise here so that queue items can throw + // or immediately return to resolve + var queueEntry = new this.Promise(function (resolve) { + resolve(next.cmd.apply(null, args)) + }) + + queueEntry.then(function () { + --self.inflight + if (self.finished) return + if (self.queued <= 0 && self.inflight <= 0) { + self.finished = true + self.deferred.resolve() + } + self._runQueue() + }, function (err) { + self.finished = true + self.deferred.reject(err) + }) + } +} + +RunQueue.prototype.add = function (prio, cmd, args) { + if (this.finished) throw new Error("Can't add to a finished queue. Create a new queue.") + if (Math.abs(Math.floor(prio)) !== prio) throw new Error('Priorities must be a positive integer value.') + validate('NFA|NFZ', [prio, cmd, args]) + prio = Number(prio) + if (!this.queue[prio]) this.queue[prio] = [] + ++this.queued + this.queue[prio].push({cmd: cmd, args: args}) + // if this priority is higher than the one we're currently processing, + // switch back to processing its queue. + if (this.currentPrio > prio) { + this.currentQueue = this.queue[prio] + this.currentPrio = prio + } +} diff --git a/deps/npm/node_modules/move-concurrently/package.json b/deps/npm/node_modules/move-concurrently/package.json new file mode 100644 index 0000000000..b2657d2c1e --- /dev/null +++ b/deps/npm/node_modules/move-concurrently/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + { + "raw": "move-concurrently@latest", + "scope": null, + "escapedName": "move-concurrently", + "name": "move-concurrently", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/rebecca/code/npm" + ] + ], + "_from": "move-concurrently@latest", + "_id": "move-concurrently@1.0.1", + "_inCache": true, + "_location": "/move-concurrently", + "_nodeVersion": "4.6.1", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/move-concurrently-1.0.1.tgz_1489706667405_0.5766653206665069" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "4.4.3", + "_phantomChildren": { + "aproba": "1.1.1", + "fs-write-stream-atomic": "1.0.10", + "iferr": "0.1.5", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + }, + "_requested": { + "raw": "move-concurrently@latest", + "scope": null, + "escapedName": "move-concurrently", + "name": "move-concurrently", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "_shasum": "be2c005fda32e0b29af1f05d7c4b33214c701f92", + "_shrinkwrap": null, + "_spec": "move-concurrently@latest", + "_where": "/Users/rebecca/code/npm", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/npm/move-concurrently/issues" + }, + "dependencies": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + }, + "description": "Promises of moves of files or directories with rename, falling back to recursive rename/copy on EXDEV errors, with configurable concurrency and win32 junction support.", + "devDependencies": { + "standard": "^8.6.0", + "tacks": "^1.2.6", + "tap": "^10.1.1" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "be2c005fda32e0b29af1f05d7c4b33214c701f92", + "tarball": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz" + }, + "files": [ + "move.js", + "is-windows.js" + ], + "gitHead": "8558616a681db87a77b2d9077ce5f855ceb46b87", + "homepage": "https://www.npmjs.com/package/move-concurrently", + "keywords": [ + "move" + ], + "license": "ISC", + "main": "move.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "move-concurrently", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/move-concurrently.git" + }, + "scripts": { + "test": "standard && tap --coverage test" + }, + "version": "1.0.1" +} diff --git a/deps/npm/node_modules/node-gyp/README.md b/deps/npm/node_modules/node-gyp/README.md index 7d13b038ee..22415430a0 100644 --- a/deps/npm/node_modules/node-gyp/README.md +++ b/deps/npm/node_modules/node-gyp/README.md @@ -3,7 +3,7 @@ node-gyp ### Node.js native addon build tool `node-gyp` is a cross-platform command-line tool written in Node.js for compiling -native addon modules for Node.js. It bundles the [gyp](https://code.google.com/p/gyp/) +native addon modules for Node.js. It bundles the [gyp](https://gyp.gsrc.io) project used by the Chromium team and takes away the pain of dealing with the various differences in build platforms. It is the replacement to the `node-waf` program which is removed for node `v0.8`. If you have a native addon for node that diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 3be0f591bd..1422900390 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -1,14 +1,25 @@ { + 'variables' : { + 'node_engine_include_dir%': 'deps/v8/include', + }, 'target_defaults': { 'type': 'loadable_module', 'win_delay_load_hook': 'true', 'product_prefix': '', + 'conditions': [ + [ 'node_engine=="chakracore"', { + 'variables': { + 'node_engine_include_dir%': 'deps/chakrashim/include' + }, + }] + ], + 'include_dirs': [ '<(node_root_dir)/include/node', '<(node_root_dir)/src', '<(node_root_dir)/deps/uv/include', - '<(node_root_dir)/deps/v8/include' + '<(node_root_dir)/<(node_engine_include_dir)' ], 'defines!': [ 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. @@ -79,6 +90,12 @@ ], }], [ 'OS=="win"', { + 'conditions': [ + ['node_engine=="chakracore"', { + 'library_dirs': [ '<(node_root_dir)/$(ConfigurationName)' ], + 'libraries': [ '<@(node_engine_libs)' ], + }], + ], 'libraries': [ '-lkernel32.lib', '-luser32.lib', diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py index 2ecf964c68..2b3ae19b0c 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py @@ -285,6 +285,22 @@ def _ConfigFullName(config_name, config_data): return '%s|%s' % (_ConfigBaseName(config_name, platform_name), platform_name) +def _ConfigWindowsTargetPlatformVersion(config_data): + ver = config_data.get('msvs_windows_target_platform_version') + if not ver or re.match(r'^\d+', ver): + return ver + for key in [r'HKLM\Software\Microsoft\Microsoft SDKs\Windows\%s', + r'HKLM\Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows\%s']: + sdkdir = MSVSVersion._RegistryGetValue(key % ver, 'InstallationFolder') + if not sdkdir: + continue + version = MSVSVersion._RegistryGetValue(key % ver, 'ProductVersion') or '' + # find a matching entry in sdkdir\include + names = sorted([x for x in os.listdir(r'%s\include' % sdkdir) \ + if x.startswith(version)], reverse = True) + return names[0] + + def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path, quote_cmd, do_setup_env): @@ -338,6 +354,8 @@ def _BuildCommandLineForRuleRaw(spec, cmd, cygwin_shell, has_input_path, command = ['type'] else: command = [cmd[0].replace('/', '\\')] + if quote_cmd: + command = ['"%s"' % i for i in command] # Add call before command to ensure that commands can be tied together one # after the other without aborting in Incredibuild, since IB makes a bat # file out of the raw command string, and some commands (like python) are @@ -2662,6 +2680,22 @@ def _GetMSBuildGlobalProperties(spec, guid, gyp_file_name): else: properties[0].append(['ApplicationType', 'Windows Store']) + platform_name = None + msvs_windows_target_platform_version = None + for configuration in spec['configurations'].itervalues(): + platform_name = platform_name or _ConfigPlatform(configuration) + msvs_windows_target_platform_version = \ + msvs_windows_target_platform_version or \ + _ConfigWindowsTargetPlatformVersion(configuration) + if platform_name and msvs_windows_target_platform_version: + break + + if platform_name == 'ARM': + properties[0].append(['WindowsSDKDesktopARMSupport', 'true']) + if msvs_windows_target_platform_version: + properties[0].append(['WindowsTargetPlatformVersion', \ + str(msvs_windows_target_platform_version)]) + return properties def _GetMSBuildConfigurationDetails(spec, build_file): @@ -3209,6 +3243,9 @@ def _GetMSBuildProjectReferences(project): ['ReferenceOutputAssembly', 'false'] ] for config in dependency.spec.get('configurations', {}).itervalues(): + if config.get('msvs_use_library_dependency_inputs', 0): + project_ref.append(['UseLibraryDependencyInputs', 'true']) + break # If it's disabled in any config, turn it off in the reference. if config.get('msvs_2010_disable_uldi_when_referenced', 0): project_ref.append(['UseLibraryDependencyInputs', 'false']) diff --git a/deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs b/deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs new file mode 100644 index 0000000000..a41a354f61 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/lib/Find-VS2017.cs @@ -0,0 +1,268 @@ +// Copyright 2017 - Refael Ackermann +// Distributed under MIT style license +// See accompanying file LICENSE at https://github.com/node4good/windows-autoconf + +// Usage: +// powershell -ExecutionPolicy Unrestricted -Version "2.0" -Command "&{Add-Type -Path Find-VS2017.cs; [VisualStudioConfiguration.Main]::Query()}" +using System; +using System.Text; +using System.Runtime.InteropServices; + +namespace VisualStudioConfiguration +{ + [Flags] + public enum InstanceState : uint + { + None = 0, + Local = 1, + Registered = 2, + NoRebootRequired = 4, + NoErrors = 8, + Complete = 4294967295, + } + + [Guid("6380BCFF-41D3-4B2E-8B2E-BF8A6810C848")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface IEnumSetupInstances + { + + void Next([MarshalAs(UnmanagedType.U4), In] int celt, + [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface), Out] ISetupInstance[] rgelt, + [MarshalAs(UnmanagedType.U4)] out int pceltFetched); + + void Skip([MarshalAs(UnmanagedType.U4), In] int celt); + + void Reset(); + + [return: MarshalAs(UnmanagedType.Interface)] + IEnumSetupInstances Clone(); + } + + [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupConfiguration + { + } + + [Guid("26AAB78C-4A60-49D6-AF3B-3C35BC93365D")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupConfiguration2 : ISetupConfiguration + { + + [return: MarshalAs(UnmanagedType.Interface)] + IEnumSetupInstances EnumInstances(); + + [return: MarshalAs(UnmanagedType.Interface)] + ISetupInstance GetInstanceForCurrentProcess(); + + [return: MarshalAs(UnmanagedType.Interface)] + ISetupInstance GetInstanceForPath([MarshalAs(UnmanagedType.LPWStr), In] string path); + + [return: MarshalAs(UnmanagedType.Interface)] + IEnumSetupInstances EnumAllInstances(); + } + + [Guid("B41463C3-8866-43B5-BC33-2B0676F7F42E")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupInstance + { + } + + [Guid("89143C9A-05AF-49B0-B717-72E218A2185C")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupInstance2 : ISetupInstance + { + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstanceId(); + + [return: MarshalAs(UnmanagedType.Struct)] + System.Runtime.InteropServices.ComTypes.FILETIME GetInstallDate(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstallationName(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstallationPath(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetInstallationVersion(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetDisplayName([MarshalAs(UnmanagedType.U4), In] int lcid); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetDescription([MarshalAs(UnmanagedType.U4), In] int lcid); + + [return: MarshalAs(UnmanagedType.BStr)] + string ResolvePath([MarshalAs(UnmanagedType.LPWStr), In] string pwszRelativePath); + + [return: MarshalAs(UnmanagedType.U4)] + InstanceState GetState(); + + [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] + ISetupPackageReference[] GetPackages(); + + ISetupPackageReference GetProduct(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetProductPath(); + + [return: MarshalAs(UnmanagedType.VariantBool)] + bool IsLaunchable(); + + [return: MarshalAs(UnmanagedType.VariantBool)] + bool IsComplete(); + + [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)] + ISetupPropertyStore GetProperties(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetEnginePath(); + } + + [Guid("DA8D8A16-B2B6-4487-A2F1-594CCCCD6BF5")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupPackageReference + { + + [return: MarshalAs(UnmanagedType.BStr)] + string GetId(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetVersion(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetChip(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetLanguage(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetBranch(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetType(); + + [return: MarshalAs(UnmanagedType.BStr)] + string GetUniqueId(); + + [return: MarshalAs(UnmanagedType.VariantBool)] + bool GetIsExtension(); + } + + [Guid("c601c175-a3be-44bc-91f6-4568d230fc83")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [ComImport] + public interface ISetupPropertyStore + { + + [return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] + string[] GetNames(); + + object GetValue([MarshalAs(UnmanagedType.LPWStr), In] string pwszName); + } + + [Guid("42843719-DB4C-46C2-8E7C-64F1816EFD5B")] + [CoClass(typeof(SetupConfigurationClass))] + [ComImport] + public interface SetupConfiguration : ISetupConfiguration2, ISetupConfiguration + { + } + + [Guid("177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D")] + [ClassInterface(ClassInterfaceType.None)] + [ComImport] + public class SetupConfigurationClass + { + } + + public static class Main + { + public static void Query() + { + ISetupConfiguration query = new SetupConfiguration(); + ISetupConfiguration2 query2 = (ISetupConfiguration2)query; + IEnumSetupInstances e = query2.EnumAllInstances(); + + int pceltFetched; + ISetupInstance2[] rgelt = new ISetupInstance2[1]; + StringBuilder log = new StringBuilder(); + while (true) + { + e.Next(1, rgelt, out pceltFetched); + if (pceltFetched <= 0) + { + Console.WriteLine(String.Format("{{\"log\":\"{0}\"}}", log.ToString())); + return; + } + if (CheckInstance(rgelt[0], ref log)) + return; + } + } + + private static bool CheckInstance(ISetupInstance2 setupInstance2, ref StringBuilder log) + { + // Visual Studio Community 2017 component directory: + // https://www.visualstudio.com/en-us/productinfo/vs2017-install-product-Community.workloads + + string path = setupInstance2.GetInstallationPath().Replace("\\", "\\\\"); + log.Append(String.Format("Found installation at: {0}\\n", path)); + + bool hasMSBuild = false; + bool hasVCTools = false; + uint Win10SDKVer = 0; + bool hasWin8SDK = false; + + foreach (ISetupPackageReference package in setupInstance2.GetPackages()) + { + const string Win10SDKPrefix = "Microsoft.VisualStudio.Component.Windows10SDK."; + + string id = package.GetId(); + if (id == "Microsoft.VisualStudio.VC.MSBuild.Base") + hasMSBuild = true; + else if (id == "Microsoft.VisualStudio.Component.VC.Tools.x86.x64") + hasVCTools = true; + else if (id.StartsWith(Win10SDKPrefix)) + Win10SDKVer = Math.Max(Win10SDKVer, UInt32.Parse(id.Substring(Win10SDKPrefix.Length))); + else if (id == "Microsoft.VisualStudio.Component.Windows81SDK") + hasWin8SDK = true; + else + continue; + + log.Append(String.Format(" - Found {0}\\n", id)); + } + + if (!hasMSBuild) + log.Append(" - Missing Visual Studio C++ core features (Microsoft.VisualStudio.VC.MSBuild.Base)\\n"); + if (!hasVCTools) + log.Append(" - Missing VC++ 2017 v141 toolset (x86,x64) (Microsoft.VisualStudio.Component.VC.Tools.x86.x64)\\n"); + if ((Win10SDKVer == 0) && (!hasWin8SDK)) + log.Append(" - Missing a Windows SDK (Microsoft.VisualStudio.Component.Windows10SDK.* or Microsoft.VisualStudio.Component.Windows81SDK)\\n"); + + if (hasMSBuild && hasVCTools) + { + if (Win10SDKVer > 0) + { + log.Append(" - Using this installation with Windows 10 SDK"/*\\n*/); + Console.WriteLine(String.Format("{{\"log\":\"{0}\",\"path\":\"{1}\",\"sdk\":\"10.0.{2}.0\"}}", log.ToString(), path, Win10SDKVer)); + return true; + } + else if (hasWin8SDK) + { + log.Append(" - Using this installation with Windows 8.1 SDK"/*\\n*/); + Console.WriteLine(String.Format("{{\"log\":\"{0}\",\"path\":\"{1}\",\"sdk\":\"8.1\"}}", log.ToString(), path)); + return true; + } + } + + log.Append(" - Some required components are missing, not using this installation\\n"); + return false; + } + } +} diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js index 22f2583694..5253109857 100644 --- a/deps/npm/node_modules/node-gyp/lib/build.js +++ b/deps/npm/node_modules/node-gyp/lib/build.js @@ -14,7 +14,7 @@ var fs = require('graceful-fs') , mkdirp = require('mkdirp') , exec = require('child_process').exec , processRelease = require('./process-release') - , win = process.platform == 'win32' + , win = process.platform === 'win32' exports.usage = 'Invokes `' + (win ? 'msbuild' : 'make') + '` and builds the module' @@ -124,6 +124,13 @@ function build (gyp, argv, callback) { */ function findMsbuild () { + if (config.variables.msbuild_path) { + command = config.variables.msbuild_path + log.verbose('using MSBuild:', command) + copyNodeLib() + return + } + log.verbose('could not find "msbuild.exe" in PATH - finding location in registry') var notfoundErr = 'Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?' var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s' @@ -226,7 +233,9 @@ function build (gyp, argv, callback) { // Specify the build type, Release by default if (win) { - var p = arch === 'x64' ? 'x64' : 'Win32' + var archLower = arch.toLowerCase() + var p = archLower === 'x64' ? 'x64' : + (archLower === 'arm' ? 'ARM' : 'Win32') argv.push('/p:Configuration=' + buildType + ';Platform=' + p) if (jobs) { var j = parseInt(jobs, 10) diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 66c33e6947..3349e9fedf 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -19,9 +19,11 @@ var fs = require('graceful-fs') , cp = require('child_process') , extend = require('util')._extend , processRelease = require('./process-release') - , win = process.platform == 'win32' + , win = process.platform === 'win32' , findNodeDirectory = require('./find-node-directory') , msgFormat = require('util').format +if (win) + var findVS2017 = require('./find-vs2017') exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' @@ -86,11 +88,22 @@ function configure (gyp, argv, callback) { mkdirp(buildDir, function (err, isNew) { if (err) return callback(err) log.verbose('build dir', '"build" dir needed to be created?', isNew) - createConfigFile() + if (win && (!gyp.opts.msvs_version || gyp.opts.msvs_version === '2017')) { + findVS2017(function (err, vsSetup) { + if (err) { + log.verbose('Not using VS2017:', err.message) + createConfigFile() + } else { + createConfigFile(null, vsSetup) + } + }) + } else { + createConfigFile() + } }) } - function createConfigFile (err) { + function createConfigFile (err, vsSetup) { if (err) return callback(err) var configFilename = 'config.gypi' @@ -137,6 +150,19 @@ function configure (gyp, argv, callback) { // disable -T "thin" static archives by default variables.standalone_static_library = gyp.opts.thin ? 0 : 1 + if (vsSetup) { + // GYP doesn't (yet) have support for VS2017, so we force it to VS2015 + // to avoid pulling a floating patch that has not landed upstream. + // Ref: https://chromium-review.googlesource.com/#/c/433540/ + gyp.opts.msvs_version = '2015' + process.env['GYP_MSVS_VERSION'] = 2015 + process.env['GYP_MSVS_OVERRIDE_PATH'] = vsSetup.path + defaults['msbuild_toolset'] = 'v141' + defaults['msvs_windows_target_platform_version'] = vsSetup.sdk + variables['msbuild_path'] = path.join(vsSetup.path, 'MSBuild', '15.0', + 'Bin', 'MSBuild.exe') + } + // loop through the rest of the opts and add the unknown ones as variables. // this allows for module-specific configure flags like: // @@ -272,6 +298,8 @@ function configure (gyp, argv, callback) { argv.push('-Dnode_gyp_dir=' + nodeGypDir) argv.push('-Dnode_lib_file=' + release.name + '.lib') argv.push('-Dmodule_root_dir=' + process.cwd()) + argv.push('-Dnode_engine=' + + (gyp.opts.node_engine || process.jsEngine || 'v8')) argv.push('--depth=.') argv.push('--no-parallel') diff --git a/deps/npm/node_modules/node-gyp/lib/find-vs2017.js b/deps/npm/node_modules/node-gyp/lib/find-vs2017.js new file mode 100644 index 0000000000..8c79e9ec9b --- /dev/null +++ b/deps/npm/node_modules/node-gyp/lib/find-vs2017.js @@ -0,0 +1,46 @@ +var log = require('npmlog') + , execFile = require('child_process').execFile + , path = require('path') + +function findVS2017(callback) { + var ps = path.join(process.env.SystemRoot, 'System32', 'WindowsPowerShell', + 'v1.0', 'powershell.exe') + var csFile = path.join(__dirname, 'Find-VS2017.cs') + var psArgs = ['-ExecutionPolicy', 'Unrestricted', '-Command', + '&{Add-Type -Path \'' + csFile + + '\'; [VisualStudioConfiguration.Main]::Query()}'] + + log.silly('find vs2017', 'Running', ps, psArgs) + var child = execFile(ps, psArgs, { encoding: 'utf8' }, + function (err, stdout, stderr) { + log.silly('find vs2017', 'PS err:', err) + log.silly('find vs2017', 'PS stdout:', stdout) + log.silly('find vs2017', 'PS stderr:', stderr) + + if (err) + return callback(new Error('Could not use PowerShell to find VS2017')) + + var vsSetup + try { + vsSetup = JSON.parse(stdout) + } catch (e) { + log.silly('find vs2017', e) + return callback(new Error('Could not use PowerShell to find VS2017')) + } + log.silly('find vs2017', 'vsSetup:', vsSetup) + + if (vsSetup && vsSetup.log) + log.verbose('find vs2017', vsSetup.log.trimRight()) + + if (!vsSetup || !vsSetup.path || !vsSetup.sdk) { + return callback(new Error('No usable installation of VS2017 found')) + } + + log.verbose('find vs2017', 'using installation:', vsSetup.path) + callback(null, { "path": vsSetup.path, "sdk": vsSetup.sdk }) + }) + + child.stdin.end() +} + +module.exports = findVS2017 diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 3dedc97e0f..968fa1eb19 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -2,51 +2,41 @@ "_args": [ [ { - "raw": "node-gyp@3.5.0", + "raw": "node-gyp@3.6.0", "scope": null, "escapedName": "node-gyp", "name": "node-gyp", - "rawSpec": "3.5.0", - "spec": "3.5.0", + "rawSpec": "3.6.0", + "spec": "3.6.0", "type": "version" }, "/Users/rebecca/code/npm" ] ], - "_from": "node-gyp@3.5.0", - "_id": "node-gyp@3.5.0", - "_inCache": true, + "_from": "node-gyp@3.6.0", + "_hasShrinkwrap": false, + "_id": "node-gyp@3.6.0", "_location": "/node-gyp", - "_nodeVersion": "7.2.1", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/node-gyp-3.5.0.tgz_1484012223403_0.9361806979868561" - }, - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "_npmVersion": "3.10.10", "_phantomChildren": { - "abbrev": "1.0.9" + "abbrev": "1.1.0" }, "_requested": { - "raw": "node-gyp@3.5.0", + "raw": "node-gyp@3.6.0", "scope": null, "escapedName": "node-gyp", "name": "node-gyp", - "rawSpec": "3.5.0", - "spec": "3.5.0", + "rawSpec": "3.6.0", + "spec": "3.6.0", "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.5.0.tgz", - "_shasum": "a8fe5e611d079ec16348a3eb960e78e11c85274a", + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.0.tgz", + "_shasum": "7474f63a3a0501161dda0b6341f022f14c423fa6", "_shrinkwrap": null, - "_spec": "node-gyp@3.5.0", + "_spec": "node-gyp@3.6.0", "_where": "/Users/rebecca/code/npm", "author": { "name": "Nathan Rajlich", @@ -70,7 +60,7 @@ "osenv": "0", "request": "2", "rimraf": "2", - "semver": "2.x || 3.x || 4 || 5", + "semver": "~5.3.0", "tar": "^2.0.0", "which": "1" }, @@ -83,13 +73,12 @@ }, "directories": {}, "dist": { - "shasum": "a8fe5e611d079ec16348a3eb960e78e11c85274a", - "tarball": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.5.0.tgz" + "shasum": "7474f63a3a0501161dda0b6341f022f14c423fa6", + "tarball": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.0.tgz" }, "engines": { "node": ">= 0.8.0" }, - "gitHead": "4793e1dcb8f16182d6292fd2af579082fc11294f", "homepage": "https://github.com/nodejs/node-gyp#readme", "installVersion": 9, "keywords": [ @@ -103,36 +92,11 @@ ], "license": "MIT", "main": "./lib/node-gyp.js", - "maintainers": [ - { - "name": "TooTallNate", - "email": "nathan@tootallnate.net" - }, - { - "name": "bnoordhuis", - "email": "info@bnoordhuis.nl" - }, - { - "name": "fishrock123", - "email": "fishrock123@rocketmail.com" - }, - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], "name": "node-gyp", "optionalDependencies": {}, "preferGlobal": true, - "readme": "ERROR: No README data found!", + "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js. It bundles the [gyp](https://gyp.gsrc.io)\nproject used by the Chromium team and takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.8`, ..., `4`, `5`, `6`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files or headers for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)\n * `make`\n * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)\n * On Mac OS X:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) (already installed on Mac OS X)\n * [Xcode](https://developer.apple.com/xcode/download/)\n * You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads`\n * This step will install `gcc` and the related toolchain containing `make`\n * On Windows:\n * Option 1: Install all the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) using `npm install --global --production windows-build-tools` from an elevated PowerShell or CMD.exe (run as Administrator).\n * Option 2: Install tools and configuration manually:\n * Visual C++ Build Environment:\n * Option 1: Install [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) using the **Default Install** option.\n\n * Option 2: Install [Visual Studio 2015](https://www.visualstudio.com/products/visual-studio-community-vs) (or modify an existing installation) and select *Common Tools for Visual C++* during setup. This also works with the free Community and Express for Desktop editions.\n\n > :bulb: [Windows Vista / 7 only] requires [.NET Framework 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40773)\n\n * Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.)\n * Launch cmd, `npm config set msvs_version 2015`\n\n If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips.\n\nIf you have multiple Python versions installed, you can identify which Python\nversion `node-gyp` uses by setting the '--python' variable:\n\n``` bash\n$ node-gyp --python /path/to/python2.7\n```\n\nIf `node-gyp` is called by way of `npm` *and* you have multiple versions of\nPython installed, then you can set `npm`'s 'python' config key to the appropriate\nvalue:\n\n``` bash\n$ npm config set python /path/to/executable/python2.7\n```\n\nNote that OS X is just a flavour of Unix and so needs `python`, `make`, and C/C++.\nAn easy way to obtain these is to install XCode from Apple,\nand then use it to install the command line tools (under Preferences -> Downloads).\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to process. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running either the `configure`, `build` or `rebuild` command.\n\n\nThe \"binding.gyp\" file\n----------------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. This file gets placed in the root of\nyour package, alongside the `package.json` file.\n\nA barebones `gyp` file appropriate for building a node addon looks like:\n\n``` python\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources for addons and writing `gyp` files:\n\n * [\"Going Native\" a nodeschool.io tutorial](http://nodeschool.io/#goingnative)\n * [\"Hello World\" node addon example](https://github.com/nodejs/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](https://gyp.gsrc.io/docs/UserDocumentation.md)\n * [gyp input format reference](https://gyp.gsrc.io/docs/InputFormatReference.md)\n * [*\"binding.gyp\" files out in the wild* wiki page](https://github.com/nodejs/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n| **Command** | **Description**\n|:--------------|:---------------------------------------------------------------\n| `help` | Shows the help dialog\n| `build` | Invokes `make`/`msbuild.exe` and builds the native addon\n| `clean` | Removes the `build` directory if it exists\n| `configure` | Generates project build files for the current platform\n| `rebuild` | Runs `clean`, `configure` and `build` all in a row\n| `install` | Installs node header files for the given version\n| `list` | Lists the currently installed node header versions\n| `remove` | Removes the node header files for the given version\n\n\nCommand Options\n--------\n\n`node-gyp` accepts the following command options:\n\n| **Command** | **Description**\n|:----------------------------------|:------------------------------------------\n| `-j n`, `--jobs n` | Run make in parallel\n| `--target=v6.2.1` | Node version to build for (default=process.version)\n| `--silly`, `--loglevel=silly` | Log all progress to console\n| `--verbose`, `--loglevel=verbose` | Log most progress to console\n| `--silent`, `--loglevel=silent` | Don't log anything to console\n| `debug`, `--debug` | Make Debug build (default=Release)\n| `--release`, `--no-debug` | Make Release build\n| `-C $dir`, `--directory=$dir` | Run command in different directory\n| `--make=$make` | Override make command (e.g. gmake)\n| `--thin=yes` | Enable thin static libraries\n| `--arch=$arch` | Set target architecture (e.g. ia32)\n| `--tarball=$path` | Get headers from a local tarball\n| `--devdir=$path` | SDK download directory (default=~/.node-gyp)\n| `--ensure` | Don't reinstall headers if already present\n| `--dist-url=$url` | Download header tarball from custom URL\n| `--proxy=$url` | Set HTTP proxy for downloading header tarball\n| `--cafile=$cafile` | Override default CA chain (to download tarball)\n| `--nodedir=$path` | Set the path to the node binary\n| `--python=$path` | Set path to the python (2) binary\n| `--msvs_version=$version` | Set Visual Studio version (win)\n| `--solution=$solution` | Set Visual Studio Solution version (win)\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[python-v2.7.10]: https://www.python.org/downloads/release/python-2710/\n[msvc2013]: https://www.microsoft.com/en-gb/download/details.aspx?id=44914\n[win7sdk]: https://www.microsoft.com/en-us/download/details.aspx?id=8279\n[compiler update for the Windows SDK 7.1]: https://www.microsoft.com/en-us/download/details.aspx?id=4422\n", + "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/nodejs/node-gyp.git" @@ -140,5 +104,5 @@ "scripts": { "test": "tape test/test-*" }, - "version": "3.5.0" + "version": "3.6.0" } diff --git a/deps/npm/node_modules/normalize-package-data/.npmignore b/deps/npm/node_modules/normalize-package-data/.npmignore index 096746c148..2ccbe4656c 100644 --- a/deps/npm/node_modules/normalize-package-data/.npmignore +++ b/deps/npm/node_modules/normalize-package-data/.npmignore @@ -1 +1 @@ -/node_modules/ \ No newline at end of file +/node_modules/ diff --git a/deps/npm/node_modules/normalize-package-data/AUTHORS b/deps/npm/node_modules/normalize-package-data/AUTHORS index 10860f72bc..66282ba1d1 100644 --- a/deps/npm/node_modules/normalize-package-data/AUTHORS +++ b/deps/npm/node_modules/normalize-package-data/AUTHORS @@ -1,4 +1,4 @@ # Names sorted by how much code was originally theirs. Isaac Z. Schlueter Meryn Stol -Robert Kowalski \ No newline at end of file +Robert Kowalski diff --git a/deps/npm/node_modules/normalize-package-data/LICENSE b/deps/npm/node_modules/normalize-package-data/LICENSE index 9cea2e3c96..6ed662cd5d 100644 --- a/deps/npm/node_modules/normalize-package-data/LICENSE +++ b/deps/npm/node_modules/normalize-package-data/LICENSE @@ -1,4 +1,4 @@ -This package contains code originally written by Isaac Z. Schlueter. +This package contains code originally written by Isaac Z. Schlueter. Used with permission. Copyright (c) Meryn Stol ("Author") diff --git a/deps/npm/node_modules/normalize-package-data/README.md b/deps/npm/node_modules/normalize-package-data/README.md index 526745ef69..3772777973 100644 --- a/deps/npm/node_modules/normalize-package-data/README.md +++ b/deps/npm/node_modules/normalize-package-data/README.md @@ -1,6 +1,6 @@ # normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data) -normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. +normalize-package-data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry. normalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools. @@ -16,7 +16,7 @@ Basic usage is really simple. You call the function that normalize-package-data ```javascript normalizeData = require('normalize-package-data') -packageData = fs.readFileSync("package.json") +packageData = require("./package.json") normalizeData(packageData) // packageData is now normalized ``` @@ -27,8 +27,7 @@ You may activate strict validation by passing true as the second argument. ```javascript normalizeData = require('normalize-package-data') -packageData = fs.readFileSync("package.json") -warnFn = function(msg) { console.error(msg) } +packageData = require("./package.json") normalizeData(packageData, true) // packageData is now normalized ``` @@ -41,7 +40,7 @@ Optionally, you may pass a "warning" function. It gets called whenever the `norm ```javascript normalizeData = require('normalize-package-data') -packageData = fs.readFileSync("package.json") +packageData = require("./package.json") warnFn = function(msg) { console.error(msg) } normalizeData(packageData, warnFn) // packageData is now normalized. Any number of warnings may have been logged. @@ -78,7 +77,7 @@ If the supplied data has an invalid name or version vield, `normalizeData` will * If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed. * If `homepage` field is not a string, it will be removed. * If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`. -* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. +* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]#readme . If the repository field points to a GitHub Gist repo url, the associated http url is chosen. ### Rules for name field @@ -86,7 +85,7 @@ If `name` field is given, the value of the name field must be a string. The stri * start with a period. * contain the following characters: `/@\s+%` -* contain and characters that would need to be encoded for use in urls. +* contain any characters that would need to be encoded for use in urls. * resemble the word `node_modules` or `favicon.ico` (case doesn't matter). ### Rules for version field diff --git a/deps/npm/node_modules/normalize-package-data/lib/make_warning.js b/deps/npm/node_modules/normalize-package-data/lib/make_warning.js index 0f3aad5f55..4ac74ad7cb 100644 --- a/deps/npm/node_modules/normalize-package-data/lib/make_warning.js +++ b/deps/npm/node_modules/normalize-package-data/lib/make_warning.js @@ -20,4 +20,4 @@ function makeTypoWarning (providedName, probableName, field) { probableName = field + "['" + probableName + "']" } return util.format(messages.typo, providedName, probableName) -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/lib/normalize.js b/deps/npm/node_modules/normalize-package-data/lib/normalize.js index 7e68c69a94..bd1bfef123 100644 --- a/deps/npm/node_modules/normalize-package-data/lib/normalize.js +++ b/deps/npm/node_modules/normalize-package-data/lib/normalize.js @@ -9,7 +9,7 @@ var fieldsToFix = ['name','version','description','repository','modules','script ,'files','bin','man','bugs','keywords','readme','homepage','license'] var otherThingsToFix = ['dependencies','people', 'typos'] -var thingsToFix = fieldsToFix.map(function(fieldName) { +var thingsToFix = fieldsToFix.map(function(fieldName) { return ucFirst(fieldName) + "Field" }) // two ways to do this in CoffeeScript on only one line, sub-70 chars: @@ -22,8 +22,8 @@ function normalize (data, warn, strict) { if(!strict) strict = false if(!warn || data.private) warn = function(msg) { /* noop */ } - if (data.scripts && - data.scripts.install === "node-gyp rebuild" && + if (data.scripts && + data.scripts.install === "node-gyp rebuild" && !data.scripts.preinstall) { data.gypfile = true } diff --git a/deps/npm/node_modules/normalize-package-data/lib/safe_format.js b/deps/npm/node_modules/normalize-package-data/lib/safe_format.js index 08517f1421..b07f1006d1 100644 --- a/deps/npm/node_modules/normalize-package-data/lib/safe_format.js +++ b/deps/npm/node_modules/normalize-package-data/lib/safe_format.js @@ -6,4 +6,4 @@ module.exports = function() { if (!arg) throw new TypeError('Bad arguments.') }) return util.format.apply(null, arguments) -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/lib/typos.json b/deps/npm/node_modules/normalize-package-data/lib/typos.json index 73590c0a26..7f9dd283b3 100644 --- a/deps/npm/node_modules/normalize-package-data/lib/typos.json +++ b/deps/npm/node_modules/normalize-package-data/lib/typos.json @@ -1,5 +1,5 @@ { - "topLevel": { + "topLevel": { "dependancies": "dependencies" ,"dependecies": "dependencies" ,"depdenencies": "dependencies" diff --git a/deps/npm/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json index f8c8aa9087..df940bb07c 100644 --- a/deps/npm/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/normalize-package-data/package.json @@ -1,30 +1,59 @@ { - "name": "normalize-package-data", - "version": "2.3.5", - "author": { - "name": "Meryn Stol", - "email": "merynstol@gmail.com" + "_args": [ + [ + { + "raw": "normalize-package-data@latest", + "scope": null, + "escapedName": "normalize-package-data", + "name": "normalize-package-data", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "normalize-package-data@latest", + "_id": "normalize-package-data@2.3.6", + "_inCache": true, + "_location": "/normalize-package-data", + "_nodeVersion": "7.7.1", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/normalize-package-data-2.3.6.tgz_1488928112411_0.01280554523691535" }, - "description": "Normalizes data that can be found in package.json files.", - "license": "BSD-2-Clause", - "repository": { - "type": "git", - "url": "git://github.com/npm/normalize-package-data.git" + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "main": "lib/normalize.js", - "scripts": { - "test": "tap test/*.js" + "_npmVersion": "4.1.2", + "_phantomChildren": {}, + "_requested": { + "raw": "normalize-package-data@latest", + "scope": null, + "escapedName": "normalize-package-data", + "name": "normalize-package-data", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, - "dependencies": { - "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" + "_requiredBy": [ + "#USER", + "/", + "/npm-registry-client", + "/read-package-json" + ], + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.6.tgz", + "_shasum": "498fa420c96401f787402ba21e600def9f981fff", + "_shrinkwrap": null, + "_spec": "normalize-package-data@latest", + "_where": "/Users/zkat/Documents/code/npm", + "author": { + "name": "Meryn Stol", + "email": "merynstol@gmail.com" }, - "devDependencies": { - "async": "^1.5.0", - "tap": "^2.2.0", - "underscore": "^1.8.3" + "bugs": { + "url": "https://github.com/npm/normalize-package-data/issues" }, "contributors": [ { @@ -40,24 +69,27 @@ "email": "rok@kowalski.gd" } ], - "gitHead": "3dc7756af20b3b1b24c6d75302448ca3659e0a65", - "bugs": { - "url": "https://github.com/npm/normalize-package-data/issues" + "dependencies": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" }, - "homepage": "https://github.com/npm/normalize-package-data#readme", - "_id": "normalize-package-data@2.3.5", - "_shasum": "8d924f142960e1777e7ffe170543631cc7cb02df", - "_from": "normalize-package-data@>=2.3.5 <2.4.0", - "_npmVersion": "3.3.6", - "_nodeVersion": "5.0.0", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" + "description": "Normalizes data that can be found in package.json files.", + "devDependencies": { + "async": "^1.5.0", + "tap": "^2.2.0", + "underscore": "^1.8.3" }, + "directories": {}, "dist": { - "shasum": "8d924f142960e1777e7ffe170543631cc7cb02df", - "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz" + "shasum": "498fa420c96401f787402ba21e600def9f981fff", + "tarball": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.6.tgz" }, + "gitHead": "f6c37066edd095c0e465f6e181c0cd79a02f6c3d", + "homepage": "https://github.com/npm/normalize-package-data#readme", + "license": "BSD-2-Clause", + "main": "lib/normalize.js", "maintainers": [ { "name": "iarna", @@ -80,7 +112,15 @@ "email": "kat@sykosomatic.org" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.5.tgz", - "readme": "ERROR: No README data found!" + "name": "normalize-package-data", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/npm/normalize-package-data.git" + }, + "scripts": { + "test": "tap test/*.js" + }, + "version": "2.3.6" } diff --git a/deps/npm/node_modules/normalize-package-data/test/consistency.js b/deps/npm/node_modules/normalize-package-data/test/consistency.js index 4082be25cc..6bce17a162 100644 --- a/deps/npm/node_modules/normalize-package-data/test/consistency.js +++ b/deps/npm/node_modules/normalize-package-data/test/consistency.js @@ -13,7 +13,7 @@ tap.test("consistent normalization", function(t) { fs.readdir (__dirname + "/fixtures", function (err, entries) { // entries = ['coffee-script.json'] // uncomment to limit to a specific file verifyConsistency = function(entryName, next) { - warn = function(msg) { + warn = function(msg) { // t.equal("",msg) // uncomment to have some kind of logging of warnings } filename = __dirname + "/fixtures/" + entryName @@ -33,4 +33,4 @@ tap.test("consistent normalization", function(t) { t.end() }) }) // fs.readdir -}) // tap.test \ No newline at end of file +}) // tap.test diff --git a/deps/npm/node_modules/normalize-package-data/test/dependencies.js b/deps/npm/node_modules/normalize-package-data/test/dependencies.js index 3e493ab023..5a5aff5d7f 100644 --- a/deps/npm/node_modules/normalize-package-data/test/dependencies.js +++ b/deps/npm/node_modules/normalize-package-data/test/dependencies.js @@ -15,7 +15,7 @@ tap.test("warn if dependency contains anything else but a string", function(t) { devDependencies: { "b": 456}, optionalDependencies: { "c": 789} }, warn) - + var wanted1 = safeFormat(warningMessages.nonStringDependency, "a", 123) var wanted2 = safeFormat(warningMessages.nonStringDependency, "b", 456) var wanted3 = safeFormat(warningMessages.nonStringDependency, "c", 789) @@ -34,7 +34,7 @@ tap.test("warn if bundleDependencies array contains anything else but strings", normalize(a={ bundleDependencies: ["abc", 123, {foo:"bar"}] }, warn) - + var wanted1 = safeFormat(warningMessages.nonStringBundleDependency, 123) var wanted2 = safeFormat(warningMessages.nonStringBundleDependency, {foo:"bar"}) var wanted2 = safeFormat(warningMessages.nonDependencyBundleDependency, "abc") diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/async.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/async.json index 5e652a6c6f..9fa85b53ea 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/async.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/async.json @@ -33,4 +33,4 @@ "scripts": { "test": "nodeunit test/test-async.js" } -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json index 56e6d81b3d..2cf3ba9e54 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json @@ -53,4 +53,4 @@ "Sean McArthur (https://github.com/seanmonstar)", "Fanie Oosthuysen (https://github.com/weareu)" ] -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json index a0b60a9d38..6582289d19 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json @@ -32,4 +32,4 @@ "uglify-js": "~2.2", "jison": ">=0.2.0" } -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json index 90c28863a2..2ea55eb9ac 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json @@ -4,11 +4,11 @@ "version": "0.3.0", "author": "Nodejitsu ", "description": "a simple zero-configuration command-line http server", - "contributors": [ + "contributors": [ { "name": "Marak Squires", "email": "marak@nodejitsu.com" - } + } ], "bin": { "http-server": "./bin/http-server" @@ -45,9 +45,9 @@ "bundledDependencies": [ "union", "ecstatic" - ], + ], "license": "MIT", "engines": { "node": ">=0.6" } -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json index 5933875702..07af4acf49 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json @@ -18,4 +18,4 @@ "dependencies": { "node-gyp": "~0.9.1" } -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json index 9ea70b6bf8..8c481e1afa 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json @@ -1,4 +1,4 @@ { "name": "foo-bar-package", "version": "0.0.1" -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json index acc0538252..b6786f430d 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json @@ -23,4 +23,4 @@ "modules" ], "license": "MIT" -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json index 2262b3139d..b4c704df97 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json @@ -132,4 +132,4 @@ "url": "https://github.com/isaacs/npm/raw/master/LICENSE" } ] -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/request.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/request.json index 24189a551a..4d58a95c2f 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/request.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/request.json @@ -36,4 +36,4 @@ "scripts": { "test": "node tests/run.js" } -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json index bfc8b3d26a..e27cfd8c64 100644 --- a/deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json @@ -14,4 +14,4 @@ "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" }, "license" : "MIT" -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/normalize-package-data/test/normalize.js b/deps/npm/node_modules/normalize-package-data/test/normalize.js index 3926938b6a..0cd4baf499 100644 --- a/deps/npm/node_modules/normalize-package-data/test/normalize.js +++ b/deps/npm/node_modules/normalize-package-data/test/normalize.js @@ -101,8 +101,6 @@ tap.test("urls required", function(t) { repository: "Hello." }, warn) - console.error(a) - var expect = [ warningMessages.missingDescription, warningMessages.missingRepository, @@ -129,8 +127,6 @@ tap.test("homepage field must start with a protocol.", function(t) { homepage: 'example.org' }, warn) - console.error(a) - var expect = [ warningMessages.missingDescription, warningMessages.missingRepository, @@ -152,8 +148,6 @@ tap.test("license field should be a valid SPDX expression", function(t) { license: 'Apache 2' }, warn) - console.error(a) - var expect = [ warningMessages.missingDescription, warningMessages.missingRepository, diff --git a/deps/npm/node_modules/normalize-package-data/test/typo.js b/deps/npm/node_modules/normalize-package-data/test/typo.js index 0cd3eb49d0..9c2fd70a45 100644 --- a/deps/npm/node_modules/normalize-package-data/test/typo.js +++ b/deps/npm/node_modules/normalize-package-data/test/typo.js @@ -10,7 +10,7 @@ test('typos', function(t) { function warn(m) { warnings.push(m) } - + var typoMessage = safeFormat.bind(undefined, warningMessages.typo) var expect = diff --git a/deps/npm/node_modules/npm-package-arg/.npmignore b/deps/npm/node_modules/npm-package-arg/.npmignore deleted file mode 100644 index c2658d7d1b..0000000000 --- a/deps/npm/node_modules/npm-package-arg/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/npm-package-arg/.travis.yml b/deps/npm/node_modules/npm-package-arg/.travis.yml deleted file mode 100644 index d8ce5e1a74..0000000000 --- a/deps/npm/node_modules/npm-package-arg/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: node_js -node_js: - - "6" - - "5" - - "4" - - "0.12" - - "0.10" -sudo: false -script: "npm test" - diff --git a/deps/npm/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/npm-package-arg/package.json index b9f5b4d4a6..61475cad09 100644 --- a/deps/npm/node_modules/npm-package-arg/package.json +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -2,39 +2,40 @@ "_args": [ [ { - "raw": "npm-package-arg@4.2.0", + "raw": "npm-package-arg@latest", "scope": null, + "escapedName": "npm-package-arg", "name": "npm-package-arg", - "rawSpec": "4.2.0", - "spec": "4.2.0", - "type": "version" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "npm-package-arg@4.2.0", - "_id": "npm-package-arg@4.2.0", + "_from": "npm-package-arg@latest", + "_id": "npm-package-arg@4.2.1", "_inCache": true, - "_installable": true, "_location": "/npm-package-arg", - "_nodeVersion": "6.2.1", + "_nodeVersion": "7.7.1", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/npm-package-arg-4.2.0.tgz_1465952856229_0.8071578682865947" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/npm-package-arg-4.2.1.tgz_1488928211600_0.17898930050432682" }, "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.9.6", + "_npmVersion": "4.1.2", "_phantomChildren": {}, "_requested": { - "raw": "npm-package-arg@4.2.0", + "raw": "npm-package-arg@latest", "scope": null, + "escapedName": "npm-package-arg", "name": "npm-package-arg", - "rawSpec": "4.2.0", - "spec": "4.2.0", - "type": "version" + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ "#USER", @@ -43,11 +44,11 @@ "/npm-registry-client", "/realize-package-specifier" ], - "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.2.0.tgz", - "_shasum": "809bc61cabf54bd5ff94f6165c89ba8ee88c115c", + "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.2.1.tgz", + "_shasum": "593303fdea85f7c422775f17f9eb7670f680e3ec", "_shrinkwrap": null, - "_spec": "npm-package-arg@4.2.0", - "_where": "/Users/rebecca/code/npm", + "_spec": "npm-package-arg@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -69,10 +70,13 @@ "test": "test" }, "dist": { - "shasum": "809bc61cabf54bd5ff94f6165c89ba8ee88c115c", - "tarball": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.2.0.tgz" + "shasum": "593303fdea85f7c422775f17f9eb7670f680e3ec", + "tarball": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.2.1.tgz" }, - "gitHead": "b54a9286ef387dd1fd109c54a42e8de45d7b07e8", + "files": [ + "npa.js" + ], + "gitHead": "2fa53ce9c3a000626e58c115205d4049c5b1ef42", "homepage": "https://github.com/npm/npm-package-arg", "license": "ISC", "main": "npa.js", @@ -104,5 +108,5 @@ "scripts": { "test": "standard && tap --coverage test/*.js" }, - "version": "4.2.0" + "version": "4.2.1" } diff --git a/deps/npm/node_modules/npm-package-arg/test/basic.js b/deps/npm/node_modules/npm-package-arg/test/basic.js deleted file mode 100644 index 95f260a3c7..0000000000 --- a/deps/npm/node_modules/npm-package-arg/test/basic.js +++ /dev/null @@ -1,187 +0,0 @@ -var npa = require('../npa.js') -var path = require('path') - -require('tap').test('basic', function (t) { - t.setMaxListeners(999) - - var tests = { - 'foo@1.2': { - name: 'foo', - escapedName: 'foo', - type: 'range', - spec: '>=1.2.0 <1.3.0', - raw: 'foo@1.2', - rawSpec: '1.2' - }, - - '@foo/bar': { - raw: '@foo/bar', - name: '@foo/bar', - escapedName: '@foo%2fbar', - scope: '@foo', - rawSpec: '', - spec: 'latest', - type: 'tag' - }, - - '@foo/bar@': { - raw: '@foo/bar@', - name: '@foo/bar', - escapedName: '@foo%2fbar', - scope: '@foo', - rawSpec: '', - spec: 'latest', - type: 'tag' - }, - - '@foo/bar@baz': { - raw: '@foo/bar@baz', - name: '@foo/bar', - escapedName: '@foo%2fbar', - scope: '@foo', - rawSpec: 'baz', - spec: 'baz', - type: 'tag' - }, - - '@f fo o al/ a d s ;f ': { - raw: '@f fo o al/ a d s ;f', - name: null, - escapedName: null, - rawSpec: '@f fo o al/ a d s ;f', - spec: '@f fo o al/ a d s ;f', - type: 'local' - }, - - 'foo@1.2.3': { - name: 'foo', - escapedName: 'foo', - type: 'version', - spec: '1.2.3', - raw: 'foo@1.2.3' - }, - - 'foo@=v1.2.3': { - name: 'foo', - escapedName: 'foo', - type: 'version', - spec: '1.2.3', - raw: 'foo@=v1.2.3', - rawSpec: '=v1.2.3' - }, - - 'git+ssh://git@notgithub.com/user/foo#1.2.3': { - name: null, - escapedName: null, - type: 'git', - spec: 'ssh://git@notgithub.com/user/foo#1.2.3', - raw: 'git+ssh://git@notgithub.com/user/foo#1.2.3' - }, - - 'git+file://path/to/repo#1.2.3': { - name: null, - escapedName: null, - type: 'git', - spec: 'file://path/to/repo#1.2.3', - raw: 'git+file://path/to/repo#1.2.3' - }, - - 'git://notgithub.com/user/foo': { - name: null, - escapedName: null, - type: 'git', - spec: 'git://notgithub.com/user/foo', - raw: 'git://notgithub.com/user/foo' - }, - - '@foo/bar@git+ssh://notgithub.com/user/foo': { - name: '@foo/bar', - escapedName: '@foo%2fbar', - scope: '@foo', - spec: 'ssh://notgithub.com/user/foo', - rawSpec: 'git+ssh://notgithub.com/user/foo', - raw: '@foo/bar@git+ssh://notgithub.com/user/foo' - }, - - '/path/to/foo': { - name: null, - escapedName: null, - type: 'local', - spec: path.resolve(__dirname, '/path/to/foo'), - raw: '/path/to/foo' - }, - - 'file:path/to/foo': { - name: null, - escapedName: null, - type: 'local', - spec: 'path/to/foo', - raw: 'file:path/to/foo' - }, - - 'file:~/path/to/foo': { - name: null, - escapedName: null, - type: 'local', - spec: '~/path/to/foo', - raw: 'file:~/path/to/foo' - }, - - 'file:../path/to/foo': { - name: null, - escapedName: null, - type: 'local', - spec: '../path/to/foo', - raw: 'file:../path/to/foo' - }, - - 'file:///path/to/foo': { - name: null, - escapedName: null, - type: 'local', - spec: '/path/to/foo', - raw: 'file:///path/to/foo' - }, - - 'https://server.com/foo.tgz': { - name: null, - escapedName: null, - type: 'remote', - spec: 'https://server.com/foo.tgz', - raw: 'https://server.com/foo.tgz' - }, - - 'foo@latest': { - name: 'foo', - escapedName: 'foo', - type: 'tag', - spec: 'latest', - raw: 'foo@latest' - }, - - 'foo': { - name: 'foo', - escapedName: 'foo', - type: 'tag', - spec: 'latest', - raw: 'foo' - } - } - - Object.keys(tests).forEach(function (arg) { - var res = npa(arg) - t.type(res, 'Result', arg + ' is result') - t.has(res, tests[arg], arg + ' matches expectations') - }) - - // Completely unreasonable invalid garbage throws an error - t.throws(function () { - npa('this is not a \0 valid package name or url') - }) - - t.throws(function () { - npa('gopher://yea right') - }, 'Unsupported URL Type: gopher://yea right') - - t.end() -}) diff --git a/deps/npm/node_modules/npm-package-arg/test/bitbucket.js b/deps/npm/node_modules/npm-package-arg/test/bitbucket.js deleted file mode 100644 index 53efd89862..0000000000 --- a/deps/npm/node_modules/npm-package-arg/test/bitbucket.js +++ /dev/null @@ -1,81 +0,0 @@ -var npa = require('../npa.js') - -require('tap').test('basic', function (t) { - t.setMaxListeners(999) - - var tests = { - 'bitbucket:user/foo-js': { - name: null, - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'bitbucket:user/foo-js', - raw: 'bitbucket:user/foo-js' - }, - - 'bitbucket:user/foo-js#bar/baz': { - name: null, - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'bitbucket:user/foo-js#bar/baz', - raw: 'bitbucket:user/foo-js#bar/baz' - }, - - 'bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /': { - name: null, - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /', - raw: 'bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /' - }, - - 'bitbucket:user/foo-js#bar/baz/bin': { - name: null, - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'bitbucket:user/foo-js#bar/baz/bin', - raw: 'bitbucket:user/foo-js#bar/baz/bin' - }, - - 'foo@bitbucket:user/foo-js': { - name: 'foo', - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'bitbucket:user/foo-js', - raw: 'foo@bitbucket:user/foo-js' - }, - - 'git+ssh://git@bitbucket.org/user/foo#1.2.3': { - name: null, - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'git+ssh://git@bitbucket.org/user/foo.git#1.2.3', - raw: 'git+ssh://git@bitbucket.org/user/foo#1.2.3' - }, - - 'https://bitbucket.org/user/foo.git': { - name: null, - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'git+https://bitbucket.org/user/foo.git', - raw: 'https://bitbucket.org/user/foo.git' - }, - - '@foo/bar@git+ssh://bitbucket.org/user/foo': { - name: '@foo/bar', - scope: '@foo', - type: 'hosted', - hosted: { type: 'bitbucket' }, - spec: 'git+ssh://git@bitbucket.org/user/foo.git', - rawSpec: 'git+ssh://bitbucket.org/user/foo', - raw: '@foo/bar@git+ssh://bitbucket.org/user/foo' - } - } - - Object.keys(tests).forEach(function (arg) { - var res = npa(arg) - t.type(res, 'Result', arg + ' is a result') - t.has(res, tests[arg], arg + ' matches expectations') - }) - - t.end() -}) diff --git a/deps/npm/node_modules/npm-package-arg/test/github.js b/deps/npm/node_modules/npm-package-arg/test/github.js deleted file mode 100644 index a7cc1f462f..0000000000 --- a/deps/npm/node_modules/npm-package-arg/test/github.js +++ /dev/null @@ -1,104 +0,0 @@ -var npa = require('../npa.js') - -require('tap').test('basic', function (t) { - t.setMaxListeners(999) - - var tests = { - 'user/foo-js': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - spec: 'github:user/foo-js', - raw: 'user/foo-js' - }, - - 'user/foo-js#bar/baz': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - spec: 'github:user/foo-js#bar/baz', - raw: 'user/foo-js#bar/baz' - }, - - 'user..blerg--/..foo-js# . . . . . some . tags / / /': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - spec: 'github:user..blerg--/..foo-js# . . . . . some . tags / / /', - raw: 'user..blerg--/..foo-js# . . . . . some . tags / / /' - }, - - 'user/foo-js#bar/baz/bin': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - raw: 'user/foo-js#bar/baz/bin' - }, - - 'foo@user/foo-js': { - name: 'foo', - type: 'hosted', - hosted: { type: 'github' }, - spec: 'github:user/foo-js', - raw: 'foo@user/foo-js' - }, - - 'github:user/foo-js': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - spec: 'github:user/foo-js', - raw: 'github:user/foo-js' - }, - - 'git+ssh://git@github.com/user/foo#1.2.3': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - spec: 'git+ssh://git@github.com/user/foo.git#1.2.3', - raw: 'git+ssh://git@github.com/user/foo#1.2.3' - }, - - 'git://github.com/user/foo': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - spec: 'git://github.com/user/foo.git', - raw: 'git://github.com/user/foo' - }, - - 'https://github.com/user/foo.git': { - name: null, - type: 'hosted', - hosted: { type: 'github' }, - spec: 'git+https://github.com/user/foo.git', - raw: 'https://github.com/user/foo.git' - }, - - '@foo/bar@git+ssh://github.com/user/foo': { - name: '@foo/bar', - scope: '@foo', - type: 'hosted', - hosted: { type: 'github' }, - spec: 'git+ssh://git@github.com/user/foo.git', - rawSpec: 'git+ssh://github.com/user/foo', - raw: '@foo/bar@git+ssh://github.com/user/foo' - }, - - 'foo@bar/foo': { - name: 'foo', - type: 'hosted', - hosted: { type: 'github' }, - spec: 'github:bar/foo', - raw: 'foo@bar/foo' - } - } - - Object.keys(tests).forEach(function (arg) { - var res = npa(arg) - t.type(res, 'Result', arg + ' is a result') - t.has(res, tests[arg], arg + ' matches expectations') - }) - - t.end() -}) diff --git a/deps/npm/node_modules/npm-package-arg/test/gitlab.js b/deps/npm/node_modules/npm-package-arg/test/gitlab.js deleted file mode 100644 index b1bff98f9c..0000000000 --- a/deps/npm/node_modules/npm-package-arg/test/gitlab.js +++ /dev/null @@ -1,79 +0,0 @@ -var npa = require('../npa.js') - -require('tap').test('basic', function (t) { - t.setMaxListeners(999) - - var tests = { - 'gitlab:user/foo-js': { - name: null, - type: 'hosted', - hosted: { type: 'gitlab' }, - raw: 'gitlab:user/foo-js' - }, - - 'gitlab:user/foo-js#bar/baz': { - name: null, - type: 'hosted', - hosted: { type: 'gitlab' }, - raw: 'gitlab:user/foo-js#bar/baz' - }, - - 'gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /': { - name: null, - type: 'hosted', - hosted: { type: 'gitlab' }, - spec: 'gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /', - raw: 'gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /' - }, - - 'gitlab:user/foo-js#bar/baz/bin': { - name: null, - type: 'hosted', - hosted: { type: 'gitlab' }, - spec: 'gitlab:user/foo-js#bar/baz/bin', - raw: 'gitlab:user/foo-js#bar/baz/bin' - }, - - 'foo@gitlab:user/foo-js': { - name: 'foo', - type: 'hosted', - hosted: { type: 'gitlab' }, - spec: 'gitlab:user/foo-js', - raw: 'foo@gitlab:user/foo-js' - }, - - 'git+ssh://git@gitlab.com/user/foo#1.2.3': { - name: null, - type: 'hosted', - hosted: { type: 'gitlab' }, - spec: 'git+ssh://git@gitlab.com/user/foo.git#1.2.3', - raw: 'git+ssh://git@gitlab.com/user/foo#1.2.3' - }, - - 'https://gitlab.com/user/foo.git': { - name: null, - type: 'hosted', - hosted: { type: 'gitlab' }, - spec: 'git+https://gitlab.com/user/foo.git', - raw: 'https://gitlab.com/user/foo.git' - }, - - '@foo/bar@git+ssh://gitlab.com/user/foo': { - name: '@foo/bar', - scope: '@foo', - type: 'hosted', - hosted: { type: 'gitlab' }, - spec: 'git+ssh://git@gitlab.com/user/foo.git', - rawSpec: 'git+ssh://gitlab.com/user/foo', - raw: '@foo/bar@git+ssh://gitlab.com/user/foo' - } - } - - Object.keys(tests).forEach(function (arg) { - var res = npa(arg) - t.type(res, 'Result', arg + ' is a result') - t.has(res, tests[arg], arg + ' matches expectations') - }) - - t.end() -}) diff --git a/deps/npm/node_modules/npm-package-arg/test/windows.js b/deps/npm/node_modules/npm-package-arg/test/windows.js deleted file mode 100644 index a10fa5b686..0000000000 --- a/deps/npm/node_modules/npm-package-arg/test/windows.js +++ /dev/null @@ -1,79 +0,0 @@ -global.FAKE_WINDOWS = true - -var npa = require('../npa.js') -var test = require('tap').test - -var cases = { - 'C:\\x\\y\\z': { - raw: 'C:\\x\\y\\z', - scope: null, - name: null, - escapedName: null, - rawSpec: 'C:\\x\\y\\z', - spec: 'C:\\x\\y\\z', - type: 'local' - }, - 'foo@C:\\x\\y\\z': { - raw: 'foo@C:\\x\\y\\z', - scope: null, - name: 'foo', - escapedName: 'foo', - rawSpec: 'C:\\x\\y\\z', - spec: 'C:\\x\\y\\z', - type: 'local' - }, - 'foo@file:///C:\\x\\y\\z': { - raw: 'foo@file:///C:\\x\\y\\z', - scope: null, - name: 'foo', - escapedName: 'foo', - rawSpec: 'file:///C:\\x\\y\\z', - spec: 'C:\\x\\y\\z', - type: 'local' - }, - 'foo@file://C:\\x\\y\\z': { - raw: 'foo@file://C:\\x\\y\\z', - scope: null, - name: 'foo', - escapedName: 'foo', - rawSpec: 'file://C:\\x\\y\\z', - spec: 'C:\\x\\y\\z', - type: 'local' - }, - 'file:///C:\\x\\y\\z': { - raw: 'file:///C:\\x\\y\\z', - scope: null, - name: null, - escapedName: null, - rawSpec: 'file:///C:\\x\\y\\z', - spec: 'C:\\x\\y\\z', - type: 'local' - }, - 'file://C:\\x\\y\\z': { - raw: 'file://C:\\x\\y\\z', - scope: null, - name: null, - escapedName: null, - rawSpec: 'file://C:\\x\\y\\z', - spec: 'C:\\x\\y\\z', - type: 'local' - }, - 'foo@/foo/bar/baz': { - raw: 'foo@/foo/bar/baz', - scope: null, - name: 'foo', - escapedName: 'foo', - rawSpec: '/foo/bar/baz', - spec: '/foo/bar/baz', - type: 'local' - } -} - -test('parse a windows path', function (t) { - Object.keys(cases).forEach(function (c) { - var expect = cases[c] - var actual = npa(c) - t.same(actual, expect, c) - }) - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/.npmignore b/deps/npm/node_modules/npm-registry-client/.npmignore deleted file mode 100644 index bea2db6203..0000000000 --- a/deps/npm/node_modules/npm-registry-client/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -test/fixtures/cache -node_modules -npm-debug.log -.eslintrc -.jshintrc diff --git a/deps/npm/node_modules/npm-registry-client/.travis.yml b/deps/npm/node_modules/npm-registry-client/.travis.yml deleted file mode 100644 index 6841bf1443..0000000000 --- a/deps/npm/node_modules/npm-registry-client/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "6" - - "4" - - "7" - - "0.12" -script: "npm test" -sudo: false -before_install: - - "npm install -g npm@latest" -notifications: - slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md index 74bd6e1da7..e9ab77b0dc 100644 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ b/deps/npm/node_modules/npm-registry-client/README.md @@ -53,6 +53,19 @@ for authorization. These credentials always look the same: * `alwaysAuth` {Boolean} Whether calls to the target registry are always authed. +## Requests + +As of `npm-registry-client@8`, all requests are made with an `Accept` header +of `application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`. + +This enables filtered document responses to requests for package metadata. +You know that you got a filtered response if the mime type is set to +`application/vnd.npm.install-v1+json` and not `application/json`. + +This filtering substantially reduces the over all data size. For example +for `https://registry.npmjs.org/npm`, the compressed metadata goes from +410kB to 21kB. + ## API ### client.access(uri, params, cb) @@ -125,7 +138,7 @@ Add (or replace) a single dist-tag onto the named package. * `cb` {Function} Set all of the `dist-tags` for the named package at once, creating any -`dist-tags` that do not already exit. Any `dist-tags` not included in the +`dist-tags` that do not already exist. Any `dist-tags` not included in the `distTags` map will be removed. ### client.distTags.update(uri, params, cb) @@ -164,6 +177,8 @@ Remove a single `dist-tag` from the named package. the callback quickly, and update the cache the background. Optional (default: false). * `auth` {Credentials} Optional. + * `fullMetadata` {Boolean} If true, don't attempt to fetch filtered + ("corgi") registry metadata. (default: false) * `cb` {Function} Fetches data from the registry via a GET request, saving it in the cache folder diff --git a/deps/npm/node_modules/npm-registry-client/index.js b/deps/npm/node_modules/npm-registry-client/index.js index 8de76f5aaa..8a9fb50351 100644 --- a/deps/npm/node_modules/npm-registry-client/index.js +++ b/deps/npm/node_modules/npm-registry-client/index.js @@ -2,9 +2,6 @@ module.exports = RegClient -var join = require('path').join -var fs = require('graceful-fs') - var npmlog try { npmlog = require('npmlog') @@ -48,32 +45,29 @@ function RegClient (config) { delete this.config.log var client = this - fs.readdirSync(join(__dirname, 'lib')).forEach(function (f) { - var entry = join(__dirname, 'lib', f) - - // lib/group-name/operation.js -> client.groupName.operation - var stat = fs.statSync(entry) - if (stat.isDirectory()) { - var groupName = f.replace(/-([a-z])/gi, dashToCamel) - fs.readdirSync(entry).forEach(function (f) { - if (!f.match(/\.js$/)) return - - if (!client[groupName]) { - // keep client.groupName.operation from stomping client.operation - client[groupName] = Object.create(client) - } - var name = f.replace(/\.js$/, '').replace(/-([a-z])/gi, dashToCamel) - client[groupName][name] = require(join(entry, f)) - }) - return - } - - if (!f.match(/\.js$/)) return - var name = f.replace(/\.js$/, '').replace(/-([a-z])/gi, dashToCamel) - client[name] = require(entry) - }) -} - -function dashToCamel (_, l) { - return l.toUpperCase() + client.access = require('./lib/access') + client.adduser = require('./lib/adduser') + client.attempt = require('./lib/attempt') + client.authify = require('./lib/authify') + client.deprecate = require('./lib/deprecate') + client.distTags = Object.create(client) + client.distTags.add = require('./lib/dist-tags/add') + client.distTags.fetch = require('./lib/dist-tags/fetch') + client.distTags.rm = require('./lib/dist-tags/rm') + client.distTags.set = require('./lib/dist-tags/set') + client.distTags.update = require('./lib/dist-tags/update') + client.fetch = require('./lib/fetch') + client.get = require('./lib/get') + client.initialize = require('./lib/initialize') + client.logout = require('./lib/logout') + client.ping = require('./lib/ping') + client.publish = require('./lib/publish') + client.request = require('./lib/request') + client.sendAnonymousCLIMetrics = require('./lib/send-anonymous-CLI-metrics') + client.star = require('./lib/star') + client.stars = require('./lib/stars') + client.tag = require('./lib/tag') + client.team = require('./lib/team') + client.unpublish = require('./lib/unpublish') + client.whoami = require('./lib/whoami') } diff --git a/deps/npm/node_modules/npm-registry-client/lib/access.js b/deps/npm/node_modules/npm-registry-client/lib/access.js index ff01e95e28..b33d8973f3 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/access.js +++ b/deps/npm/node_modules/npm-registry-client/lib/access.js @@ -125,6 +125,7 @@ function accessAssertions (subcommand, uri, params, cb) { function typeChecks (specs) { Object.keys(specs).forEach(function (key) { var checks = specs[key] + /* eslint valid-typeof:0 */ assert(typeof checks[0] === checks[1], key + ' is required and must be of type ' + checks[1]) }) diff --git a/deps/npm/node_modules/npm-registry-client/lib/adduser.js b/deps/npm/node_modules/npm-registry-client/lib/adduser.js index fd6f5302ae..0dd517d946 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js +++ b/deps/npm/node_modules/npm-registry-client/lib/adduser.js @@ -29,7 +29,7 @@ function adduser (uri, params, cb) { if (!username) return cb(new Error('No username supplied.')) if (!password) return cb(new Error('No password supplied.')) if (!email) return cb(new Error('No email address supplied.')) - if (!email.match(/^[^@]+@[^\.]+\.[^\.]+/)) { + if (!email.match(/^[^@]+@[^.]+\.[^.]+/)) { return cb(new Error('Please use a real email address.')) } @@ -111,7 +111,7 @@ function adduser (uri, params, cb) { client.log.verbose('adduser', 'back', [error, data, json]) if (!error) { error = new Error( - (response && response.statusCode || '') + ' ' + + ((response && response.statusCode) || '') + ' ' + 'Could not create user\n' + JSON.stringify(data) ) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/ping.js b/deps/npm/node_modules/npm-registry-client/lib/ping.js index b90f99d116..5ab98c52d2 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/ping.js +++ b/deps/npm/node_modules/npm-registry-client/lib/ping.js @@ -11,11 +11,9 @@ function ping (uri, params, cb) { var auth = params.auth assert(auth && typeof auth === 'object', 'must pass auth to ping') - this.request(url.resolve(uri, '-/ping?write=true'), { auth: auth }, function (er, fullData) { - if (er) { - cb(er) - } else if (fullData) { - cb(null, fullData) + this.request(url.resolve(uri, '-/ping?write=true'), { auth: auth }, function (er, fullData, data, response) { + if (er || fullData) { + cb(er, fullData, data, response) } else { cb(new Error('No data received')) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 8d456259a7..e96c47ef0c 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -111,13 +111,17 @@ function makeRequest (uri, params, cb_) { // metadata should be compressed headers['accept-encoding'] = 'gzip' + // metadata should be minified, if the registry supports it + var er = this.authify(params.authed, parsed, headers, params.auth) if (er) return cb_(er) + var useCorgi = params.fullMetadata == null ? false : !params.fullMetadata + var opts = this.initialize( parsed, params.method, - 'application/json', + useCorgi ? 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' : 'application/json', headers ) @@ -269,7 +273,7 @@ function requestDone (method, where, cb) { } // for the search endpoint, the 'error' property can be an object - if (parsed && parsed.error && typeof parsed.error !== 'object' || + if ((parsed && parsed.error && typeof parsed.error !== 'object') || response.statusCode >= 400) { var w = url.parse(where).pathname.substr(1) var name diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore deleted file mode 100644 index 38344f87a6..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/ -test/ -examples/ -fs.js -zlib.js \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 1b82118460..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - npm install -g npm -notifications: - email: false -matrix: - fast_finish: true - allow_failures: - - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - include: - - node_js: '0.8' - env: TASK=test - - node_js: '0.10' - env: TASK=test - - node_js: '0.11' - env: TASK=test - - node_js: '0.12' - env: TASK=test - - node_js: 1 - env: TASK=test - - node_js: 2 - env: TASK=test - - node_js: 3 - env: TASK=test - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 5 - env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml deleted file mode 100644 index 96d9cfbd38..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE deleted file mode 100644 index e3d4e695a4..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md deleted file mode 100644 index 86b95a3bf6..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# readable-stream - -***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core, including [documentation](doc/stream.markdown). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams WG Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown deleted file mode 100644 index 0bc3819e63..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/stream.markdown +++ /dev/null @@ -1,1760 +0,0 @@ -# Stream - - Stability: 2 - Stable - -A stream is an abstract interface implemented by various objects in -Node.js. For example a [request to an HTTP server][http-incoming-message] is a -stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All -streams are instances of [`EventEmitter`][]. - -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. - -This document is split up into 3 sections: - -1. The first section explains the parts of the API that you need to be - aware of to use streams in your programs. -2. The second section explains the parts of the API that you need to - use if you implement your own custom streams yourself. The API is designed to - make this easy for you to do. -3. The third section goes into more depth about how streams work, - including some of the internal mechanisms and functions that you - should probably not modify unless you definitely know what you are - doing. - - -## API for Stream Consumers - - - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][]. - -Almost all Node.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an Node.js program: - -```js -const http = require('http'); - -var server = http.createServer( (req, res) => { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', (chunk) => { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', () => { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end(`error: ${er.message}`); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Duplex streams include: - -* [TCP sockets][] -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call [`stream.read()`][stream-read] to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`stream.pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'`][] event handler to listen for data. -* Calling the [`stream.resume()`][stream-resume] method to explicitly open the - flow. -* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the - [`stream.pause()`][stream-pause] method. -* If there are pipe destinations, by removing any [`'data'`][] event - handlers, and removing all pipe destinations by calling the - [`stream.unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing [`'data'`][] -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling [`stream.pause()`][stream-pause] will -not guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [HTTP responses, on the client][http-incoming-message] -* [HTTP requests, on the server][http-incoming-message] -* [fs read streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdout and stderr][] -* [`process.stdin`][] - -#### Event: 'close' - -Emitted when the stream and any of its underlying resources (a file -descriptor, for example) have been closed. The event indicates that -no more events will be emitted, and no further computation will occur. - -Not all streams will emit the `'close'` event. - -#### Event: 'data' - -* `chunk` {Buffer|String} The chunk of data. - -Attaching a `'data'` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `'end'` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling [`stream.read()`][stream-read] repeatedly until you get to the -end. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', () => { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'error' - -* {Error Object} - -Emitted if there was an error receiving data. - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `'readable'` event will fire -again when more data is available. - -The `'readable'` event is not emitted in the "flowing" mode with the -sole exception of the last one, on end-of-stream. - -The `'readable'` event indicates that the stream has new information: -either new data is available or the end of the stream has been reached. -In the former case, [`stream.read()`][stream-read] will return that data. In the -latter case, [`stream.read()`][stream-read] will return null. For instance, in -the following example, `foo.txt` is an empty file: - -```js -const fs = require('fs'); -var rr = fs.createReadStream('foo.txt'); -rr.on('readable', () => { - console.log('readable:', rr.read()); -}); -rr.on('end', () => { - console.log('end'); -}); -``` - -The output of running this script is: - -``` -$ node test.js -readable: null -end -``` - -#### readable.isPaused() - -* Return: {Boolean} - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using [`stream.pause()`][stream-pause] without a -corresponding [`stream.resume()`][stream-resume]). - -```js -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -[`'data'`][] events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(() => { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.pipe(destination[, options]) - -* `destination` {stream.Writable} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```js -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```js -process.stdin.pipe(process.stdout); -``` - -By default [`stream.end()`][stream-end] is called on the destination when the -source stream emits [`'end'`][], so that `destination` is no longer writable. -Pass `{ end: false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```js -reader.pipe(writer, { end: false }); -reader.on('end', () => { - writer.end('Goodbye\n'); -}); -``` - -Note that [`process.stderr`][] and [`process.stdout`][] are never closed until -the process exits, regardless of the specified options. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String|Buffer|Null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`, -unless we've ended, in which case it will return the data remaining -in the buffer. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```js -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'`][] event. - -Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] -event has been triggered will return `null`. No runtime error will be raised. - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting [`'data'`][] -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open -the flow of data. - -```js -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', () => { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the specified -encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be interpreted as -UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, -then the data will be encoded in hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called [`buf.toString(encoding)`][] on them. If you want to read the data -as strings, always use this method. - -Also you can disable any encoding at all with `readable.setEncoding(null)`. -This approach is very useful if you deal with binary data or with large -multi-byte strings spread out over multiple chunks. - -```js -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', (chunk) => { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.unpipe([destination]) - -* `destination` {stream.Writable} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous [`stream.pipe()`][] -call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(() => { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event -has been triggered; a runtime error will be raised. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See [API -for Stream Implementors][].) - -```js -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -const StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` -will not end the reading process by resetting the internal reading state of the -stream. This can cause unexpected results if `unshift()` is called during a -read (i.e. from within a [`stream._read()`][stream-_read] implementation on a -custom stream). Following the call to `unshift()` with an immediate -[`stream.push('')`][stream-push] will reset the reading state appropriately, -however it is best to simply avoid calling `unshift()` while in the process of -performing a read. - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See [Compatibility][] for -more information.) - -If you are using an older Node.js library that emits [`'data'`][] events and -has a [`stream.pause()`][stream-pause] method that is advisory only, then you -can use the `wrap()` method to create a [Readable][] stream that uses the old -stream as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old Node.js programs and libraries. - -For example: - -```js -const OldReader = require('./old-api-module.js').OldReader; -const Readable = require('stream').Readable; -const oreader = new OldReader; -const myReader = new Readable().wrap(oreader); - -myReader.on('readable', () => { - myReader.read(); // etc. -}); -``` - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Transform streams include: - -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [HTTP requests, on the client][] -* [HTTP responses, on the server][] -* [fs write streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdin][] -* [`process.stdout`][], [`process.stderr`][] - -#### Event: 'drain' - -If a [`stream.write(chunk)`][stream-write] call returns `false`, then the -`'drain'` event will indicate when it is appropriate to begin writing more data -to the stream. - -```js -// Write the data to the supplied writable stream one million times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### Event: 'error' - -* {Error} - -Emitted if there was an error when writing or piping data. - -#### Event: 'finish' - -When the [`stream.end()`][stream-end] method has been called, and all data has -been flushed to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #${i}!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', () => { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {stream.Readable} source stream that is piping to this writable - -This is emitted whenever the [`stream.pipe()`][] method is called on a readable -stream, adding this writable to its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', (src) => { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that - [unpiped][`stream.unpipe()`] this writable - -This is emitted whenever the [`stream.unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', (src) => { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at [`stream.uncork()`][] or at -[`stream.end()`][stream-end] call. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String|Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If supplied, -the callback is attached as a listener on the [`'finish'`][] event. - -Calling [`stream.write()`][stream-write] after calling -[`stream.end()`][stream-end] will raise an error. - -```js -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.uncork() - -Flush all data, buffered since [`stream.cork()`][] call. - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String|Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} `true` if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the [`'drain'`][] event before writing more data. - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits()`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -3. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          -

          Use-case

          -
          -

          Class

          -
          -

          Method(s) to implement

          -
          -

          Reading only

          -
          -

          [Readable](#stream_class_stream_readable_1)

          -
          -

          [_read][stream-_read]

          -
          -

          Writing only

          -
          -

          [Writable](#stream_class_stream_writable_1)

          -
          -

          [_write][stream-_write], [_writev][stream-_writev]

          -
          -

          Reading and writing

          -
          -

          [Duplex](#stream_class_stream_duplex_1)

          -
          -

          [_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

          -
          -

          Operate on written data, then read the result

          -
          -

          [Transform](#stream_class_stream_transform_1)

          -
          -

          [_transform][stream-_transform], [_flush][stream-_flush]

          -
          - -In your implementation code, it is very important to never call the methods -described in [API for Stream Consumers][]. Otherwise, you can potentially cause -adverse side effects in programs that consume your streaming interfaces. - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a TCP -socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the [`stream._read(size)`][stream-_read] -and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you -would with a Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this class -prototypally inherits from Readable, and then parasitically from Writable. It is -thus up to the user to implement both the low-level -[`stream._read(n)`][stream-_read] method as well as the low-level -[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension -duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`stream._read(size)`][stream-_read] method. - -Please see [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default = `16384` (16kb), or `16` for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default = `null` - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns - a single value instead of a Buffer of size n. Default = `false` - * `read` {Function} Implementation for the [`stream._read()`][stream-_read] - method. - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this method, but do NOT call it directly.** - -This method is prefixed with an underscore because it is internal to the -class that defines it and should only be called by the internal Readable -class methods. All Readable stream implementations must provide a \_read -method to fetch data from the underlying resource. - -When `_read()` is called, if data is available from the resource, the `_read()` -implementation should start pushing that data into the read queue by calling -[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from -the resource and pushing data until push returns `false`, at which point it -should stop reading from the resource. Only when `_read()` is called again after -it has stopped should it start reading more data from the resource and pushing -that data onto the queue. - -Note: once the `_read()` method is called, it will not be called again until -the [`stream.push()`][stream-push] method is called. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. - -#### readable.push(chunk[, encoding]) - - -* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This method should be called by Readable implementors, NOT -by consumers of Readable streams.** - -If a value other than null is passed, The `push()` method adds a chunk of data -into the queue for subsequent stream processors to consume. If `null` is -passed, it signals the end of the stream (EOF), after which no more data -can be written. - -The data added with `push()` can be pulled out by calling the -[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```js -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = (chunk) => { - // if push() returns false, then we need to stop reading from source - if (!this.push(chunk)) - this._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = () => { - this.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```js -const Readable = require('stream').Readable; -const util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described -[here](#stream_readable_unshift_chunk), but implemented as a custom stream. -Also, note that this implementation does not convert the incoming data to a -string. - -However, this would be better implemented as a [Transform][] stream. See -[SimpleProtocol v2][] for a better implementation. - -```js -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -const Readable = require('stream').Readable; -const util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', () => { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', () => { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - // calling unshift by itself does not reset the reading state - // of the stream; since we're inside _read, doing an additional - // push('') will reset the state appropriately. - this.push(''); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`stream._read()`][stream-_read] and -[`stream._write()`][stream-_write] methods, Transform classes must implement the -[`stream._transform()`][stream-_transform] method, and may optionally -also implement the [`stream._flush()`][stream-_flush] method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `transform` {Function} Implementation for the - [`stream._transform()`][stream-_transform] method. - * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] - method. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### Events: 'finish' and 'end' - -The [`'finish'`][] and [`'end'`][] events are from the parent Writable -and Readable classes respectively. The `'finish'` event is fired after -[`stream.end()`][stream-end] is called and all chunks have been processed by -[`stream._transform()`][stream-_transform], `'end'` is fired after all data has -been output which is after the callback in [`stream._flush()`][stream-_flush] -has been called. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush()` method, which will be -called at the very end, after all the written data is consumed, but -before emitting [`'end'`][] to signal the end of the readable side. Just -like with [`stream._transform()`][stream-_transform], call -`transform.push(chunk)` zero or more times, as appropriate, and call `callback` -when the flush operation is complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform()` -method to accept input and produce output. - -`_transform()` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply a second argument to the callback -it will be passed to the push method. In other words the following are -equivalent: - -```js -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -}; - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -}; -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Example: `SimpleProtocol` parser v2 - -The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple -protocol parser can be implemented simply by using the higher level -[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol -v1` examples. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic Node.js stream -approach. - -```javascript -const util = require('util'); -const Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the -[`stream._write(chunk, encoding, callback)`][stream-_write] method. - -Please see [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when - [`stream.write()`][stream-write] starts returning `false`. Default = `16384` - (16kb), or `16` for `objectMode` streams. - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`stream._write()`][stream-_write]. - Default = `true` - * `objectMode` {Boolean} Whether or not the - [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can - write arbitrary data instead of only `Buffer` / `String` data. - Default = `false` - * `write` {Function} Implementation for the - [`stream._write()`][stream-_write] method. - * `writev` {Function} Implementation for the - [`stream._writev()`][stream-_writev] method. - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a -[`stream._write()`][stream-_write] method to send data to the underlying -resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a -stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Duplex - -```js -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -### Readable - -```js -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - } -}); -``` - -### Transform - -```js -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - - // generate output as many times as needed - // this.push(chunk); - - // call when the current chunk is consumed - next(); - }, - flush: function(done) { - // sets this._flush under the hood - - // generate output as many times as needed - // this.push(chunk); - - done(); - } -}); -``` - -### Writable - -```js -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object which can be retrieved from `_writableState.getBuffer()` or -`_readableState.buffer`, respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not -call [`stream.read()`][stream-read], then the data will sit in the internal -queue until it is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. - -The purpose of streams, especially with the [`stream.pipe()`][] method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the [`stream.read()`][stream-read] method, - [`'data'`][] events would start emitting immediately. If you needed to do - some I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`stream.pause()`][stream-pause] method was advisory, rather than - guaranteed. This meant that you still had to be prepared to receive - [`'data'`][] events even when the stream was in a paused state. - -In Node.js v0.10, the [Readable][] class was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a [`'data'`][] event handler is added, or -when the [`stream.resume()`][stream-resume] method is called. The effect is -that, even if you are not using the new [`stream.read()`][stream-read] method -and [`'readable'`][] event, you no longer have to worry about losing -[`'data'`][] chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'`][] event handler is added. -* The [`stream.resume()`][stream-resume] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```js -// WARNING! BROKEN! -net.createServer((socket) => { - - // we add an 'end' method, but never consume the data - socket.on('end', () => { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the -[`stream.resume()`][stream-resume] method to start the flow of data: - -```js -// Workaround -net.createServer((socket) => { - - socket.on('end', () => { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -[`stream.wrap()`][] method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to [`stream.read(size)`][stream-read], regardless of what the size -argument is. - -A Writable stream in object mode will always ignore the `encoding` -argument to [`stream.write(data, encoding)`][stream-write]. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from [`stream.read()`][stream-read] indicates that there is no more -data, and [`stream.push(null)`][stream-push] will signal the end of stream data -(`EOF`). - -No streams in Node.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```js -const util = require('util'); -const StringDecoder = require('string_decoder').StringDecoder; -const Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `stream.read(0)` will trigger -a low-level [`stream._read()`][stream-_read] call. - -There is almost never a need to do this. However, you will see some -cases in Node.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][stream-push], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling [`stream.read(0)`][stream-read]. -In those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -[`'data'`]: #stream_event_data -[`'drain'`]: #stream_event_drain -[`'end'`]: #stream_event_end -[`'finish'`]: #stream_event_finish -[`'readable'`]: #stream_event_readable -[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end -[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter -[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr -[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin -[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout -[`stream.cork()`]: #stream_writable_cork -[`stream.pipe()`]: #stream_readable_pipe_destination_options -[`stream.uncork()`]: #stream_writable_uncork -[`stream.unpipe()`]: #stream_readable_unpipe_destination -[`stream.wrap()`]: #stream_readable_wrap_stream -[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream -[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin -[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout -[Compatibility]: #stream_compatibility_with_older_node_js_versions -[crypto]: crypto.html -[Duplex]: #stream_class_stream_duplex -[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream -[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream -[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest -[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse -[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage -[Object mode]: #stream_object_mode -[Readable]: #stream_class_stream_readable -[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 -[stream-_flush]: #stream_transform_flush_callback -[stream-_read]: #stream_readable_read_size_1 -[stream-_transform]: #stream_transform_transform_chunk_encoding_callback -[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 -[stream-_writev]: #stream_writable_writev_chunks_callback -[stream-end]: #stream_writable_end_chunk_encoding_callback -[stream-pause]: #stream_readable_pause -[stream-push]: #stream_readable_push_chunk_encoding -[stream-read]: #stream_readable_read_size -[stream-resume]: #stream_readable_resume -[stream-write]: #stream_writable_write_chunk_encoding_callback -[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket -[Transform]: #stream_class_stream_transform -[Writable]: #stream_class_stream_writable -[zlib]: zlib.html diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index 83275f192e..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,60 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section - - diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af876..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 2b86f23705..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index a9c8358848..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index e06af75726..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,901 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events'); - -/**/ -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = undefined; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -var Duplex; -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -var Duplex; -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; - } - - if (n <= 0) return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && !this._readableState.endEmitted) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) return null; - - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index b2ce1a030c..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); - - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -function done(stream, er) { - if (er) return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 4fbcd4b4e3..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,537 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; - -util.inherits(Writable, Stream); - -function nop() {} - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -var Duplex; -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // create the two objects needed to store the corked requests - // they are not a linked list, as no new elements are inserted in there - this.corkedRequestsFree = new CorkedRequest(this); - this.corkedRequestsFree.next = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); - -var Duplex; -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE deleted file mode 100644 index d8d7f9437d..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149c..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f7..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index e6a92b7747..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index e866b4a215..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "_args": [ - [ - "core-util-is@~1.0.0", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "core-util-is@~1.0.0", - "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "core-util-is@>=1.0.0 <1.1.0", - "_id": "core-util-is@1.0.2", - "_inCache": true, - "_installable": true, - "_location": "/npm-registry-client/concat-stream/readable-stream/core-util-is", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "name": "core-util-is", - "raw": "core-util-is@~1.0.0", - "rawSpec": "~1.0.0", - "scope": null, - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/npm-registry-client/concat-stream/readable-stream" - ], - "_shrinkwrap": null, - "_spec": "core-util-is@~1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "dependencies": {}, - "description": "The `util.is*` functions introduced in Node v0.12.", - "devDependencies": { - "tap": "^2.3.0" - }, - "directories": {}, - "dist": { - "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - }, - "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", - "homepage": "https://github.com/isaacs/core-util-is#readme", - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "license": "MIT", - "main": "lib/util.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "core-util-is", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "scripts": { - "test": "tap test.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js deleted file mode 100644 index 1a490c65ac..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js +++ /dev/null @@ -1,68 +0,0 @@ -var assert = require('tap'); - -var t = require('./lib/util'); - -assert.equal(t.isArray([]), true); -assert.equal(t.isArray({}), false); - -assert.equal(t.isBoolean(null), false); -assert.equal(t.isBoolean(true), true); -assert.equal(t.isBoolean(false), true); - -assert.equal(t.isNull(null), true); -assert.equal(t.isNull(undefined), false); -assert.equal(t.isNull(false), false); -assert.equal(t.isNull(), false); - -assert.equal(t.isNullOrUndefined(null), true); -assert.equal(t.isNullOrUndefined(undefined), true); -assert.equal(t.isNullOrUndefined(false), false); -assert.equal(t.isNullOrUndefined(), true); - -assert.equal(t.isNumber(null), false); -assert.equal(t.isNumber('1'), false); -assert.equal(t.isNumber(1), true); - -assert.equal(t.isString(null), false); -assert.equal(t.isString('1'), true); -assert.equal(t.isString(1), false); - -assert.equal(t.isSymbol(null), false); -assert.equal(t.isSymbol('1'), false); -assert.equal(t.isSymbol(1), false); -assert.equal(t.isSymbol(Symbol()), true); - -assert.equal(t.isUndefined(null), false); -assert.equal(t.isUndefined(undefined), true); -assert.equal(t.isUndefined(false), false); -assert.equal(t.isUndefined(), true); - -assert.equal(t.isRegExp(null), false); -assert.equal(t.isRegExp('1'), false); -assert.equal(t.isRegExp(new RegExp()), true); - -assert.equal(t.isObject({}), true); -assert.equal(t.isObject([]), true); -assert.equal(t.isObject(new RegExp()), true); -assert.equal(t.isObject(new Date()), true); - -assert.equal(t.isDate(null), false); -assert.equal(t.isDate('1'), false); -assert.equal(t.isDate(new Date()), true); - -assert.equal(t.isError(null), false); -assert.equal(t.isError({ err: true }), false); -assert.equal(t.isError(new Error()), true); - -assert.equal(t.isFunction(null), false); -assert.equal(t.isFunction({ }), false); -assert.equal(t.isFunction(function() {}), true); - -assert.equal(t.isPrimitive(null), true); -assert.equal(t.isPrimitive(''), true); -assert.equal(t.isPrimitive(0), true); -assert.equal(t.isPrimitive(new Date()), false); - -assert.equal(t.isBuffer(null), false); -assert.equal(t.isBuffer({}), false); -assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore deleted file mode 100644 index 3c3629e647..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml deleted file mode 100644 index cc4dba29d9..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile deleted file mode 100644 index 787d56e1e9..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -test: - @node_modules/.bin/tape test.js - -.PHONY: test - diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 16d2c59c61..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,60 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) -[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) - -[![browser support](https://ci.testling.com/juliangruber/isarray.png) -](https://ci.testling.com/juliangruber/isarray) - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b68388..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index a57f634959..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 75aac295c7..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - "isarray@~1.0.0", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "isarray@~1.0.0", - "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "isarray@>=1.0.0 <1.1.0", - "_id": "isarray@1.0.0", - "_inCache": true, - "_installable": true, - "_location": "/npm-registry-client/concat-stream/readable-stream/isarray", - "_nodeVersion": "5.1.0", - "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "name": "isarray", - "raw": "isarray@~1.0.0", - "rawSpec": "~1.0.0", - "scope": null, - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/npm-registry-client/concat-stream/readable-stream" - ], - "_shrinkwrap": null, - "_spec": "isarray@~1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream", - "author": { - "email": "mail@juliangruber.com", - "name": "Julian Gruber", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "dependencies": {}, - "description": "Array#isArray for older browsers", - "devDependencies": { - "tape": "~2.13.4" - }, - "directories": {}, - "dist": { - "shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", - "homepage": "https://github.com/juliangruber/isarray", - "keywords": [ - "browser", - "isarray", - "array" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "julian@juliangruber.com", - "name": "juliangruber" - } - ], - "name": "isarray", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "scripts": { - "test": "tape test.js" - }, - "testling": { - "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ], - "files": "test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js deleted file mode 100644 index e0c3444d85..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js +++ /dev/null @@ -1,20 +0,0 @@ -var isArray = require('./'); -var test = require('tape'); - -test('is array', function(t){ - t.ok(isArray([])); - t.notOk(isArray({})); - t.notOk(isArray(null)); - t.notOk(isArray(false)); - - var obj = {}; - obj[0] = true; - t.notOk(isArray(obj)); - - var arr = []; - arr.foo = 'bar'; - t.ok(isArray(arr)); - - t.end(); -}); - diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml deleted file mode 100644 index 36201b1001..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" - - "0.12" - - "1.7.1" - - 1 - - 2 - - 3 - - 4 - - 5 diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js deleted file mode 100644 index a4f40f845f..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -if (!process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = nextTick; -} else { - module.exports = process.nextTick; -} - -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); - } -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md deleted file mode 100644 index c67e3532b5..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2015 Calvin Metcalf - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.** diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json deleted file mode 100644 index f0ee8b940e..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_args": [ - [ - { - "name": "process-nextick-args", - "raw": "process-nextick-args@~1.0.6", - "rawSpec": "~1.0.6", - "scope": null, - "spec": ">=1.0.6 <1.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "process-nextick-args@>=1.0.6 <1.1.0", - "_id": "process-nextick-args@1.0.7", - "_inCache": true, - "_installable": true, - "_location": "/npm-registry-client/concat-stream/readable-stream/process-nextick-args", - "_nodeVersion": "5.11.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" - }, - "_npmUser": { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" - }, - "_npmVersion": "3.8.6", - "_phantomChildren": {}, - "_requested": { - "name": "process-nextick-args", - "raw": "process-nextick-args@~1.0.6", - "rawSpec": "~1.0.6", - "scope": null, - "spec": ">=1.0.6 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/npm-registry-client/concat-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", - "_shrinkwrap": null, - "_spec": "process-nextick-args@~1.0.6", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream", - "author": "", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "dependencies": {}, - "description": "process.nextTick but always with args", - "devDependencies": { - "tap": "~0.2.6" - }, - "directories": {}, - "dist": { - "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", - "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" - }, - "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" - } - ], - "name": "process-nextick-args", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.7" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md deleted file mode 100644 index 78e7cfaeb7..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -process-nextick-args -===== - -[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) - -```bash -npm install --save process-nextick-args -``` - -Always be able to pass arguments to process.nextTick, no matter the platform - -```js -var nextTick = require('process-nextick-args'); - -nextTick(function (a, b, c) { - console.log(a, b, c); -}, 'step', 3, 'profit'); -``` diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js deleted file mode 100644 index ef15721584..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require("tap").test; -var nextTick = require('./'); - -test('should work', function (t) { - t.plan(5); - nextTick(function (a) { - t.ok(a); - nextTick(function (thing) { - t.equals(thing, 7); - }, 7); - }, true); - nextTick(function (a, b, c) { - t.equals(a, 'step'); - t.equals(b, 3); - t.equals(c, 'profit'); - }, 'step', 3, 'profit'); -}); - -test('correct number of arguments', function (t) { - t.plan(1); - nextTick(function () { - t.equals(2, arguments.length, 'correct number'); - }, 1, 2); -}); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48f..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa00150..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b4df147795..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index bb11cd19bf..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_args": [ - [ - "string_decoder@~0.10.x", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "string_decoder@~0.10.x", - "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_id": "string_decoder@0.10.31", - "_inCache": true, - "_installable": true, - "_location": "/npm-registry-client/concat-stream/readable-stream/string_decoder", - "_npmUser": { - "email": "rod@vagg.org", - "name": "rvagg" - }, - "_npmVersion": "1.4.23", - "_phantomChildren": {}, - "_requested": { - "name": "string_decoder", - "raw": "string_decoder@~0.10.x", - "rawSpec": "~0.10.x", - "scope": null, - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "_requiredBy": [ - "/npm-registry-client/concat-stream/readable-stream" - ], - "_shrinkwrap": null, - "_spec": "string_decoder@~0.10.x", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "dependencies": {}, - "description": "The string_decoder module from Node core", - "devDependencies": { - "tap": "~0.4.8" - }, - "directories": {}, - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "mail@substack.net", - "name": "substack" - }, - { - "email": "rod@vagg.org", - "name": "rvagg" - } - ], - "name": "string_decoder", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "version": "0.10.31" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md deleted file mode 100644 index acc8675372..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -1.0.2 / 2015-10-07 -================== - - * use try/catch when checking `localStorage` (#3, @kumavis) - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c225..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7c2..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js deleted file mode 100644 index 549ae2f065..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,67 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5dd..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json deleted file mode 100644 index 276e03f280..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_args": [ - [ - "util-deprecate@~1.0.1", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "util-deprecate@~1.0.1", - "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_id": "util-deprecate@1.0.2", - "_inCache": true, - "_installable": true, - "_location": "/npm-registry-client/concat-stream/readable-stream/util-deprecate", - "_nodeVersion": "4.1.2", - "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - }, - "_npmVersion": "2.14.4", - "_phantomChildren": {}, - "_requested": { - "name": "util-deprecate", - "raw": "util-deprecate@~1.0.1", - "rawSpec": "~1.0.1", - "scope": null, - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/npm-registry-client/concat-stream/readable-stream" - ], - "_shrinkwrap": null, - "_spec": "util-deprecate@~1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream", - "author": { - "email": "nathan@tootallnate.net", - "name": "Nathan Rajlich", - "url": "http://n8.io/" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "dependencies": {}, - "description": "The Node.js `util.deprecate()` function with browser support", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - }, - "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", - "homepage": "https://github.com/TooTallNate/util-deprecate", - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "license": "MIT", - "main": "node.js", - "maintainers": [ - { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - } - ], - "name": "util-deprecate", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json deleted file mode 100644 index 05264e0a15..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - "readable-stream@~2.0.0", - "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream" - ] - ], - "_from": "readable-stream@>=2.0.0 <2.1.0", - "_id": "readable-stream@2.0.6", - "_inCache": true, - "_installable": true, - "_location": "/npm-registry-client/concat-stream/readable-stream", - "_nodeVersion": "5.7.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" - }, - "_npmUser": { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" - }, - "_npmVersion": "3.6.0", - "_phantomChildren": {}, - "_requested": { - "name": "readable-stream", - "raw": "readable-stream@~2.0.0", - "rawSpec": "~2.0.0", - "scope": null, - "spec": ">=2.0.0 <2.1.0", - "type": "range" - }, - "_requiredBy": [ - "/npm-registry-client/concat-stream" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", - "_shrinkwrap": null, - "_spec": "readable-stream@~2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client/node_modules/concat-stream", - "browser": { - "util": false - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "tap": "~0.2.6", - "tape": "~4.5.1", - "zuul": "~3.9.0" - }, - "directories": {}, - "dist": { - "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", - "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" - }, - "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "maintainers": [ - { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - }, - { - "email": "rod@vagg.org", - "name": "rvagg" - }, - { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" - } - ], - "name": "readable-stream", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "browser": "npm run write-zuul && zuul -- test/browser.js", - "test": "tap test/parallel/*.js test/ours/*.js", - "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" - }, - "version": "2.0.6" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a551..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js deleted file mode 100644 index 6222a57986..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,12 +0,0 @@ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0780..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3c..0000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json index 7c8b5de3b4..4963aecf2c 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json @@ -14,22 +14,20 @@ ] ], "_from": "concat-stream@>=1.5.2 <2.0.0", - "_id": "concat-stream@1.5.2", + "_id": "concat-stream@1.6.0", "_inCache": true, "_location": "/npm-registry-client/concat-stream", - "_nodeVersion": "4.4.3", + "_nodeVersion": "4.6.2", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/concat-stream-1.5.2.tgz_1472715196934_0.010375389130786061" + "tmp": "tmp/concat-stream-1.6.0.tgz_1482162257023_0.2988202746491879" }, "_npmUser": { "name": "mafintosh", "email": "mathiasbuus@gmail.com" }, - "_npmVersion": "2.15.9", - "_phantomChildren": { - "inherits": "2.0.3" - }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, "_requested": { "raw": "concat-stream@^1.5.2", "scope": null, @@ -42,8 +40,8 @@ "_requiredBy": [ "/npm-registry-client" ], - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "_shasum": "708978624d856af41a5a741defdd261da752c266", + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "_shasum": "0aac662fd52be78964d5532f694784e70110acf7", "_shrinkwrap": null, "_spec": "concat-stream@^1.5.2", "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", @@ -55,18 +53,18 @@ "url": "http://github.com/maxogden/concat-stream/issues" }, "dependencies": { - "inherits": "~2.0.1", - "readable-stream": "~2.0.0", - "typedarray": "~0.0.5" + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" }, "description": "writable stream that concatenates strings or binary data and calls a callback with the result", "devDependencies": { - "tape": "~2.3.2" + "tape": "^4.6.3" }, "directories": {}, "dist": { - "shasum": "708978624d856af41a5a741defdd261da752c266", - "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz" + "shasum": "0aac662fd52be78964d5532f694784e70110acf7", + "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz" }, "engines": [ "node >= 0.8" @@ -74,8 +72,8 @@ "files": [ "index.js" ], - "gitHead": "731fedd137eae89d066c249fdca070f8f16afbb8", - "homepage": "https://github.com/maxogden/concat-stream#readme", + "gitHead": "e482281642c1e011fc158f5749ef40a71c77a426", + "homepage": "https://github.com/maxogden/concat-stream", "license": "MIT", "main": "index.js", "maintainers": [ @@ -120,5 +118,5 @@ "android-browser/4.2..latest" ] }, - "version": "1.5.2" + "version": "1.6.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md index 8ad4197c9e..f45e6fc872 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md @@ -16,7 +16,7 @@ There are also `objectMode` streams that emit things other than Buffers, and you ## Related -`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. +`concat-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. ### examples diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index e3e6fdd841..d579ab8b1a 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -2,51 +2,42 @@ "_args": [ [ { - "raw": "npm-registry-client@~7.4.5", + "raw": "npm-registry-client@8.1.0", "scope": null, "escapedName": "npm-registry-client", "name": "npm-registry-client", - "rawSpec": "~7.4.5", - "spec": ">=7.4.5 <7.5.0", - "type": "range" + "rawSpec": "8.1.0", + "spec": "8.1.0", + "type": "version" }, "/Users/rebecca/code/npm" ] ], - "_from": "npm-registry-client@>=7.4.5 <7.5.0", - "_id": "npm-registry-client@7.4.5", - "_inCache": true, + "_from": "npm-registry-client@8.1.0", + "_hasShrinkwrap": false, + "_id": "npm-registry-client@8.1.0", "_location": "/npm-registry-client", - "_nodeVersion": "6.9.1", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/npm-registry-client-7.4.5.tgz_1481241713365_0.3974522119387984" - }, - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" - }, - "_npmVersion": "4.0.5", "_phantomChildren": { - "inherits": "2.0.3" + "inherits": "2.0.3", + "readable-stream": "2.2.6" }, "_requested": { - "raw": "npm-registry-client@~7.4.5", + "raw": "npm-registry-client@8.1.0", "scope": null, "escapedName": "npm-registry-client", "name": "npm-registry-client", - "rawSpec": "~7.4.5", - "spec": ">=7.4.5 <7.5.0", - "type": "range" + "rawSpec": "8.1.0", + "spec": "8.1.0", + "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.4.5.tgz", - "_shasum": "1ef61851bb7231db53e397aaf76ddf1cb645c3df", + "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-8.1.0.tgz", + "_shasum": "ed7e5f58dfb98cb905f7b8adbf4858ce746db8d3", "_shrinkwrap": null, - "_spec": "npm-registry-client@~7.4.5", + "_spec": "npm-registry-client@8.1.0", "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", @@ -71,50 +62,36 @@ "description": "Client for the npm registry", "devDependencies": { "negotiator": "^0.6.1", - "nock": "^8.0.0", + "nock": "^9.0.9", "readable-stream": "^2.1.5", "require-inject": "^1.4.0", "rimraf": "^2.5.4", - "standard": "~8.5.0", - "tap": "^7.0.0" + "standard": "^9.0.0", + "tap": "^10.3.0" }, "directories": {}, "dist": { - "shasum": "1ef61851bb7231db53e397aaf76ddf1cb645c3df", - "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.4.5.tgz" + "shasum": "ed7e5f58dfb98cb905f7b8adbf4858ce746db8d3", + "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-8.1.0.tgz" }, - "gitHead": "317216fab0684ea642b46890be234ad3e8665ac1", + "files": [ + "lib", + "index.js" + ], "homepage": "https://github.com/npm/npm-registry-client#readme", "license": "ISC", "main": "index.js", - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "iarna", - "email": "me@re-becca.org" - }, - { - "name": "zkat", - "email": "kat@sykosomatic.org" - } - ], "name": "npm-registry-client", "optionalDependencies": { "npmlog": "2 || ^3.1.0 || ^4.0.0" }, - "readme": "ERROR: No README data found!", + "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"https://registry.npmjs.org/npm\"\nvar params = {timeout: 1000}\n\nclient.get(uri, params, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (including the registry\npath – but be sure to terminate the path with `/`). `http` and `https` URLs are\nthe only ones supported.\n\n## Using the client\n\nEvery call to the client follows the same pattern:\n\n* `uri` {String} The *fully-qualified* URI of the registry API method being\n invoked.\n* `params` {Object} Per-request parameters.\n* `callback` {Function} Callback to be invoked when the call is complete.\n\n### Credentials\n\nMany requests to the registry can be authenticated, and require credentials\nfor authorization. These credentials always look the same:\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n**or**\n\n* `token` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n## Requests\n\nAs of `npm-registry-client@8`, all requests are made with an `Accept` header\nof `application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*`.\n\nThis enables filtered document responses to requests for package metadata.\nYou know that you got a filtered response if the mime type is set to\n`application/vnd.npm.install-v1+json` and not `application/json`.\n\nThis filtering substantially reduces the over all data size. For example\nfor `https://registry.npmjs.org/npm`, the compressed metadata goes from\n410kB to 21kB.\n\n## API\n\n### client.access(uri, params, cb)\n\n* `uri` {String} Registry URL for the package's access API endpoint.\n Looks like `/-/package//access`.\n* `params` {Object} Object containing per-request properties.\n * `access` {String} New access level for the package. Can be either\n `public` or `restricted`. Registry will raise an error if trying\n to change the access level of an unscoped package.\n * `auth` {Credentials}\n\nSet the access level for scoped packages. For now, there are only two\naccess levels: \"public\" and \"restricted\".\n\n### client.adduser(uri, params, cb)\n\n* `uri` {String} Base registry URL.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nAdd a user account to the registry, or verify the credentials.\n\n### client.deprecate(uri, params, cb)\n\n* `uri` {String} Full registry URI for the deprecated package.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Semver version range.\n * `message` {String} The message to use as a deprecation warning.\n * `auth` {Credentials}\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n### client.distTags.fetch(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `auth` {Credentials}\n* `cb` {Function}\n\nFetch all of the `dist-tags` for the named package.\n\n### client.distTags.add(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `version` {String} Exact version to be mapped to the `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nAdd (or replace) a single dist-tag onto the named package.\n\n### client.distTags.set(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSet all of the `dist-tags` for the named package at once, creating any\n`dist-tags` that do not already exist. Any `dist-tags` not included in the\n`distTags` map will be removed.\n\n### client.distTags.update(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nUpdate the values of multiple `dist-tags`, creating any `dist-tags` that do\nnot already exist. Any pre-existing `dist-tags` not included in the `distTags`\nmap will be left alone.\n\n### client.distTags.rm(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a single `dist-tag` from the named package.\n\n### client.get(uri, params, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `params` {Object} Object containing per-request properties.\n * `timeout` {Number} Duration before the request times out. Optional\n (default: never).\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `staleOk` {Boolean} If there's cached data available, then return that to\n the callback quickly, and update the cache the background. Optional\n (default: false).\n * `auth` {Credentials} Optional.\n * `fullMetadata` {Boolean} If true, don't attempt to fetch filtered\n (\"corgi\") registry metadata. (default: false)\n* `cb` {Function}\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag or the \"Last Modified\" timestamp.\n\n### client.publish(uri, params, cb)\n\n* `uri` {String} The registry URI for the package to publish.\n* `params` {Object} Object containing per-request properties.\n * `metadata` {Object} Package metadata.\n * `access` {String} Access for the package. Can be `public` or `restricted` (no default).\n * `body` {Stream} Stream of the package body / tarball.\n * `auth` {Credentials}\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.\n\n### client.sendAnonymousCLIMetrics(uri, params, cb)\n\n- `uri` {String} Base URL for the registry.\n- `params` {Object} Object containing per-request properties.\n - `metricId` {String} A uuid unique to this dataset.\n - `metrics` {Object} The metrics to share with the registry, with the following properties:\n - `from` {Date} When the first data in this report was collected.\n - `to` {Date} When the last data in this report was collected. Usually right now.\n - `successfulInstalls` {Number} The number of successful installs in this period.\n - `failedInstalls` {Number} The number of installs that ended in error in this period.\n- `cb` {Function}\n\nPUT a metrics object to the `/-/npm/anon-metrics/v1/` endpoint on the registry.\n\n### client.star(uri, params, cb)\n\n* `uri` {String} The complete registry URI for the package to star.\n* `params` {Object} Object containing per-request properties.\n * `starred` {Boolean} True to star the package, false to unstar it. Optional\n (default: false).\n * `auth` {Credentials}\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n### client.stars(uri, params, cb)\n\n* `uri` {String} The base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `username` {String} Name of user to fetch starred packages for. Optional\n (default: user in `auth`).\n * `auth` {Credentials} Optional (required if `username` is omitted).\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n### client.tag(uri, params, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Version to tag.\n * `tag` {String} Tag name to apply.\n * `auth` {Credentials}\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n### client.unpublish(uri, params, cb)\n\n* `uri` {String} The complete registry URI of the package to unpublish.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} version to unpublish. Optional – omit to unpublish all\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n### client.whoami(uri, params, cb)\n\n* `uri` {String} The base registry for the URI.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSimple call to see who the registry thinks you are. Especially useful with\ntoken-based auth.\n\n\n## PLUMBING\n\nThe below are primarily intended for use by the rest of the API, or by the npm\ncaching logic directly.\n\n### client.request(uri, params, cb)\n\n* `uri` {String} URI pointing to the resource to request.\n* `params` {Object} Object containing per-request properties.\n * `method` {String} HTTP method. Optional (default: \"GET\").\n * `body` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON. Optional – body\n only used for write operations.\n * `etag` {String} The cached ETag. Optional.\n * `lastModified` {String} The cached Last-Modified timestamp. Optional.\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `streaming` {Boolean} Stream the request body as it comes, handling error\n responses in a non-streaming way.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a generic request to the registry. All the other methods are wrappers\naround `client.request`.\n\n### client.fetch(uri, params, cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `params` {Object} Object containing per-request properties.\n * `headers` {Stream} HTTP headers to be included with the request. Optional.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetch a package from a URL, with auth set appropriately if included. Used to\ncache remote tarballs as well as request package tarballs from the registry.\n\n# Configuration\n\nThe client uses its own configuration, which is just passed in as a simple\nnested object. The following are the supported values (with their defaults, if\nany):\n\n* `proxy.http` {URL} The URL to proxy HTTP requests through.\n* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be\n the same as `proxy.http` if unset.\n* `proxy.localAddress` {IP} The local address to use on multi-homed systems.\n* `ssl.ca` {String} Certificate signing authority certificates to trust.\n* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates.\n* `ssl.key` {String} Private key (PEM encoded) for client certificate.\n* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates.\n Default = `true`\n* `retry.count` {Number} Number of times to retry on GET failures. Default = 2.\n* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10.\n* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default = 10000 (10 seconds)\n* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default = 60000 (60 seconds)\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `defaultTag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `couchToken` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login).\n* `sessionToken` {String} A random identifier for this set of client requests.\n Default = 8 random hexadecimal bytes.\n* `maxSockets` {Number} The maximum number of connections that will be open per\n origin (unique combination of protocol:host:port). Passed to the\n [httpAgent](https://nodejs.org/api/http.html#http_agent_maxsockets).\n Default = 50\n* `isFromCI` {Boolean} Identify to severs if this request is coming from CI (for statistics purposes).\n Default = detected from environment– primarily this is done by looking for\n the CI environment variable to be set to `true`. Also accepted are the\n existence of the `JENKINS_URL`, `bamboo.buildKey` and `TDDIUM` environment\n variables.\n* `scope` {String} The scope of the project this command is being run for. This is the\n top level npm module in which a command was run.\n Default = none\n", + "readmeFilename": "README.md", "repository": { "url": "git+https://github.com/npm/npm-registry-client.git" }, "scripts": { "test": "standard && tap test/*.js" }, - "version": "7.4.5" + "version": "8.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/test/00-setup.js b/deps/npm/node_modules/npm-registry-client/test/00-setup.js deleted file mode 100644 index fb9585a428..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/00-setup.js +++ /dev/null @@ -1,11 +0,0 @@ -var join = require('path').join -var rimraf = require('rimraf') -var tap = require('tap') - -tap.test('setup', function (t) { - rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { - if (er) throw er - t.pass('cache cleaned') - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/access.js b/deps/npm/node_modules/npm-registry-client/test/access.js deleted file mode 100644 index 78b00017f1..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/access.js +++ /dev/null @@ -1,370 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var URI = 'http://localhost:1337' -var PARAMS = { - auth: { token: 'foo' }, - scope: 'myorg', - team: 'myteam', - package: '@foo/bar', - permissions: 'read-write' -} -var UNSCOPED = { - auth: { token: 'foo' }, - scope: 'myorg', - team: 'myteam', - package: 'bar', - permissions: 'read-write' -} - -var commands = [ - 'public', 'restricted', 'grant', 'revoke', 'ls-packages', 'ls-collaborators' -] - -test('access public', function (t) { - server.expect('POST', '/-/package/%40foo%2Fbar/access', function (req, res) { - t.equal(req.method, 'POST') - onJsonReq(req, function (json) { - t.deepEqual(json, { access: 'public' }) - res.statusCode = 200 - res.json({ accessChanged: true }) - }) - }) - var params = Object.create(PARAMS) - params.package = '@foo/bar' - client.access('public', URI, params, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.accessChanged, 'access level set') - t.end() - }) -}) - -test('access restricted', function (t) { - server.expect('POST', '/-/package/%40foo%2Fbar/access', function (req, res) { - t.equal(req.method, 'POST') - onJsonReq(req, function (json) { - t.deepEqual(json, { access: 'restricted' }) - res.statusCode = 200 - res.json({ accessChanged: true }) - }) - }) - client.access('restricted', URI, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.accessChanged, 'access level set') - t.end() - }) -}) - -test('access grant basic', function (t) { - server.expect('PUT', '/-/team/myorg/myteam/package', function (req, res) { - t.equal(req.method, 'PUT') - onJsonReq(req, function (json) { - t.deepEqual(json, { - permissions: PARAMS.permissions, - package: PARAMS.package - }) - res.statusCode = 201 - res.json({ accessChanged: true }) - }) - }) - client.access('grant', URI, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.accessChanged, 'access level set') - t.end() - }) -}) - -test('access grant basic unscoped', function (t) { - server.expect('PUT', '/-/team/myorg/myteam/package', function (req, res) { - t.equal(req.method, 'PUT') - onJsonReq(req, function (json) { - t.deepEqual(json, { - permissions: UNSCOPED.permissions, - package: UNSCOPED.package - }) - res.statusCode = 201 - res.json({ accessChanged: true }) - }) - }) - client.access('grant', URI, UNSCOPED, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.accessChanged, 'access level set') - t.end() - }) -}) - -test('access revoke basic', function (t) { - server.expect('DELETE', '/-/team/myorg/myteam/package', function (req, res) { - t.equal(req.method, 'DELETE') - onJsonReq(req, function (json) { - t.deepEqual(json, { - package: PARAMS.package - }) - res.statusCode = 200 - res.json({ accessChanged: true }) - }) - }) - client.access('revoke', URI, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.accessChanged, 'access level set') - t.end() - }) -}) - -test('access revoke basic unscoped', function (t) { - server.expect('DELETE', '/-/team/myorg/myteam/package', function (req, res) { - t.equal(req.method, 'DELETE') - onJsonReq(req, function (json) { - t.deepEqual(json, { - package: UNSCOPED.package - }) - res.statusCode = 200 - res.json({ accessChanged: true }) - }) - }) - client.access('revoke', URI, UNSCOPED, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.accessChanged, 'access level set') - t.end() - }) -}) - -test('ls-packages on team', function (t) { - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - var uri = '/-/team/myorg/myteam/package?format=cli' - server.expect('GET', uri, function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 200 - res.json(serverPackages) - }) - client.access('ls-packages', URI, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.same(data, clientPackages) - t.end() - }) -}) - -test('ls-packages on org', function (t) { - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - var uri = '/-/org/myorg/package?format=cli' - server.expect('GET', uri, function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 200 - res.json(serverPackages) - }) - var params = Object.create(PARAMS) - params.team = null - client.access('ls-packages', URI, params, function (error, data) { - t.ifError(error, 'no errors') - t.same(data, clientPackages) - t.end() - }) -}) - -test('ls-packages on user', function (t) { - var serverPackages = { - '@foo/bar': 'write', - '@foo/util': 'read' - } - var clientPackages = { - '@foo/bar': 'read-write', - '@foo/util': 'read-only' - } - var firstUri = '/-/org/myorg/package?format=cli' - server.expect('GET', firstUri, function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 404 - res.json({error: 'not found'}) - }) - var secondUri = '/-/user/myorg/package?format=cli' - server.expect('GET', secondUri, function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 200 - res.json(serverPackages) - }) - var params = Object.create(PARAMS) - params.team = null - client.access('ls-packages', URI, params, function (error, data) { - t.ifError(error, 'no errors') - t.same(data, clientPackages) - t.end() - }) -}) - -test('ls-collaborators', function (t) { - var serverCollaborators = { - 'myorg:myteam': 'write', - 'myorg:anotherteam': 'read' - } - var clientCollaborators = { - 'myorg:myteam': 'read-write', - 'myorg:anotherteam': 'read-only' - } - var uri = '/-/package/%40foo%2Fbar/collaborators?format=cli' - server.expect('GET', uri, function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 200 - res.json(serverCollaborators) - }) - client.access('ls-collaborators', URI, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.same(data, clientCollaborators) - t.end() - }) -}) - -test('ls-collaborators w/scope', function (t) { - var serverCollaborators = { - 'myorg:myteam': 'write', - 'myorg:anotherteam': 'read' - } - var clientCollaborators = { - 'myorg:myteam': 'read-write', - 'myorg:anotherteam': 'read-only' - } - var uri = '/-/package/%40foo%2Fbar/collaborators?format=cli&user=zkat' - server.expect('GET', uri, function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 200 - res.json(serverCollaborators) - }) - var params = Object.create(PARAMS) - params.user = 'zkat' - client.access('ls-collaborators', URI, params, function (error, data) { - t.ifError(error, 'no errors') - t.same(data, clientCollaborators) - t.end() - }) -}) - -test('ls-collaborators w/o scope', function (t) { - var serverCollaborators = { - 'myorg:myteam': 'write', - 'myorg:anotherteam': 'read' - } - var clientCollaborators = { - 'myorg:myteam': 'read-write', - 'myorg:anotherteam': 'read-only' - } - var uri = '/-/package/bar/collaborators?format=cli&user=zkat' - server.expect('GET', uri, function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 200 - res.json(serverCollaborators) - }) - var params = Object.create(UNSCOPED) - params.user = 'zkat' - client.access('ls-collaborators', URI, params, function (error, data) { - t.ifError(error, 'no errors') - t.same(data, clientCollaborators) - t.end() - }) -}) - -test('access command base validation', function (t) { - t.throws(function () { - client.access(undefined, URI, PARAMS, nop) - }, 'command is required') - t.throws(function () { - client.access('whoops', URI, PARAMS, nop) - }, 'command must be a valid subcommand') - commands.forEach(function (cmd) { - t.throws(function () { - client.access(cmd, undefined, PARAMS, nop) - }, 'registry URI is required') - t.throws(function () { - client.access(cmd, URI, undefined, nop) - }, 'params is required') - t.throws(function () { - client.access(cmd, URI, '', nop) - }, 'params must be an object') - t.throws(function () { - client.access(cmd, URI, {scope: 'o', team: 't'}, nop) - }, 'auth is required') - t.throws(function () { - client.access(cmd, URI, {auth: 5, scope: 'o', team: 't'}, nop) - }, 'auth must be an object') - t.throws(function () { - client.access(cmd, URI, PARAMS, {}) - }, 'callback must be a function') - t.throws(function () { - client.access(cmd, URI, PARAMS, undefined) - }, 'callback is required') - if (contains([ - 'public', 'restricted' - ], cmd)) { - t.throws(function () { - var params = Object.create(PARAMS) - params.package = null - client.access(cmd, URI, params, nop) - }, 'package is required') - t.throws(function () { - var params = Object.create(PARAMS) - params.package = 'underscore' - client.access(cmd, URI, params, nop) - }, 'only scoped packages are allowed') - } - if (contains(['grant', 'revoke', 'ls-packages'], cmd)) { - t.throws(function () { - var params = Object.create(PARAMS) - params.scope = null - client.access(cmd, URI, params, nop) - }, 'scope is required') - } - if (contains(['grant', 'revoke'], cmd)) { - t.throws(function () { - var params = Object.create(PARAMS) - params.team = null - client.access(cmd, URI, params, nop) - }, 'team is required') - } - if (cmd === 'grant') { - t.throws(function () { - var params = Object.create(PARAMS) - params.permissions = null - client.access(cmd, URI, params, nop) - }, 'permissions are required') - t.throws(function () { - var params = Object.create(PARAMS) - params.permissions = 'idkwhat' - client.access(cmd, URI, params, nop) - }, 'permissions must be either read-only or read-write') - } - }) - t.end() -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) - -function onJsonReq (req, cb) { - var buffer = '' - req.setEncoding('utf8') - req.on('data', function (data) { buffer += data }) - req.on('end', function () { cb(buffer ? JSON.parse(buffer) : undefined) }) -} - -function contains (arr, item) { - return arr.indexOf(item) !== -1 -} diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js b/deps/npm/node_modules/npm-registry-client/test/adduser-new.js deleted file mode 100644 index a834841de4..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js +++ /dev/null @@ -1,58 +0,0 @@ -var tap = require('tap') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var password = '%1234@asdf%' -var username = 'username' -var email = 'i@izs.me' -var userdata = { - name: username, - email: email, - _id: 'org.couchdb.user:username', - type: 'user', - roles: [], - date: '2012-06-07T04:11:21.591Z' -} - -var SD = require('string_decoder').StringDecoder -var decoder = new SD() - -tap.test('create new user account', function (t) { - var auth = { - username: username, - password: password, - email: email - } - var params = { auth: auth } - - server.expect('/registry/_design/app/_rewrite/-/user/org.couchdb.user:username', function (req, res) { - t.equal(req.method, 'PUT') - var b = '' - req.on('data', function (d) { - b += decoder.write(d) - }) - - req.on('end', function () { - var o = JSON.parse(b) - userdata.password = password - userdata.date = o.date - t.deepEqual(o, userdata) - - res.statusCode = 201 - res.json(auth) - }) - }) - - client.adduser( - 'http://localhost:1337/registry/_design/app/_rewrite', - params, - function (er, data) { - if (er) throw er - t.deepEqual(data, auth, 'received expected auth data') - server.close() - t.end() - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js deleted file mode 100644 index 03d5f468f1..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js +++ /dev/null @@ -1,68 +0,0 @@ -var tap = require('tap') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var password = '%1234@asdf%' -var username = 'username' -var email = 'i@izs.me' -var userdata = { - name: username, - email: email, - _id: 'org.couchdb.user:username', - type: 'user', - roles: [], - date: '2012-06-07T04:11:21.591Z' } -var SD = require('string_decoder').StringDecoder -var decoder = new SD() - -tap.test('update a user acct', function (t) { - var auth = { - username: username, - password: password, - email: email - } - var params = { auth: auth } - - server.expect('PUT', '/-/user/org.couchdb.user:username', function (req, res) { - t.equal(req.method, 'PUT') - res.statusCode = 409 - res.json({error: 'conflict'}) - }) - - server.expect('GET', '/-/user/org.couchdb.user:username?write=true', function (req, res) { - t.equal(req.method, 'GET') - res.json(userdata) - }) - - server.expect('PUT', '/-/user/org.couchdb.user:username/-rev/' + userdata._rev, function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.on('data', function (d) { - b += decoder.write(d) - }) - - req.on('end', function () { - var o = JSON.parse(b) - userdata.password = password - userdata.date = o.date - t.deepEqual(o, userdata) - - res.statusCode = 201 - res.json(auth) - }) - }) - - client.adduser( - 'http://localhost:1337/', - params, - function (er, data) { - if (er) throw er - t.deepEqual(data, auth, 'got expected auth data') - server.close() - t.end() - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser.js b/deps/npm/node_modules/npm-registry-client/test/adduser.js deleted file mode 100644 index 10816ebf95..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/adduser.js +++ /dev/null @@ -1,162 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var URI = 'https://npm.registry:8043/rewrite' -var USERNAME = 'username' -var PASSWORD = 'password' -var EMAIL = 'n@p.m' -var AUTH = { - auth: { - username: USERNAME, - password: PASSWORD, - email: EMAIL - } -} - -test('adduser call contract', function (t) { - t.throws(function () { - client.adduser(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.adduser([], AUTH, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.adduser(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.adduser(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.adduser(URI, AUTH, undefined) - }, 'requires callback') - - t.throws(function () { - client.adduser(URI, AUTH, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - auth: { - password: PASSWORD, - email: EMAIL - } - } - client.adduser(URI, params, nop) - }, - { name: 'AssertionError', message: 'must include username in auth' }, - 'auth must include username' - ) - - t.throws( - function () { - var params = { - auth: { - username: USERNAME, - email: EMAIL - } - } - client.adduser(URI, params, nop) - }, - { name: 'AssertionError', message: 'must include password in auth' }, - 'auth must include password' - ) - - t.throws( - function () { - var params = { - auth: { - username: USERNAME, - password: PASSWORD - } - } - client.adduser(URI, params, nop) - }, - { name: 'AssertionError', message: 'must include email in auth' }, - 'auth must include email' - ) - - t.test('username missing', function (t) { - var params = { - auth: { - username: '', - password: PASSWORD, - email: EMAIL - } - } - client.adduser(URI, params, function (err) { - t.equal(err && err.message, 'No username supplied.', 'username must not be empty') - t.end() - }) - }) - - t.test('password missing', function (t) { - var params = { - auth: { - username: USERNAME, - password: '', - email: EMAIL - } - } - client.adduser(URI, params, function (err) { - t.equal( - err && err.message, - 'No password supplied.', - 'password must not be empty' - ) - t.end() - }) - }) - - t.test('email missing', function (t) { - var params = { - auth: { - username: USERNAME, - password: PASSWORD, - email: '' - } - } - client.adduser(URI, params, function (err) { - t.equal( - err && err.message, - 'No email address supplied.', - 'email must not be empty' - ) - t.end() - }) - }) - - t.test('email malformed', function (t) { - var params = { - auth: { - username: USERNAME, - password: PASSWORD, - email: 'lolbutts' - } - } - client.adduser(URI, params, function (err) { - t.equal( - err && err.message, - 'Please use a real email address.', - 'email must look like email' - ) - t.end() - }) - }) - - t.end() -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/config-defaults.js b/deps/npm/node_modules/npm-registry-client/test/config-defaults.js deleted file mode 100644 index ca6983a1ba..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/config-defaults.js +++ /dev/null @@ -1,42 +0,0 @@ -var test = require('tap').test - -require('./lib/server.js').close() -var common = require('./lib/common.js') - -test('config defaults', function (t) { - var client = common.freshClient() - - var proxy = client.config.proxy - t.notOk(proxy.http, 'no default value for HTTP proxy') - t.notOk(proxy.https, 'no default value for HTTPS proxy') - t.notOk(proxy.localAddress, 'no default value for local address') - - var ssl = client.config.ssl - t.notOk(ssl.ca, 'no default value for SSL certificate authority bundle') - t.notOk(ssl.certificate, 'no default value for SSL client certificate') - t.notOk(ssl.key, 'no default value for SSL client certificate key') - t.equal(ssl.strict, true, 'SSL is strict by default') - - var retry = client.config.retry - t.equal(retry.retries, 2, 'default retry count is 2') - t.equal(retry.factor, 10, 'default retry factor is 10') - t.equal(retry.minTimeout, 10000, 'retry minimum timeout is 10000 (10 seconds)') - t.equal(retry.maxTimeout, 60000, 'retry maximum timeout is 60000 (60 seconds)') - - t.equal(client.config.userAgent, 'node/' + process.version, 'default userAgent') - t.ok(client.log.info, "there's a default logger") - t.equal(client.config.defaultTag, 'latest', 'default tag is "latest"') - t.notOk(client.config.couchToken, 'no couchToken by default') - t.notOk(client.config.sessionToken, 'no sessionToken by default') - - t.end() -}) - -test('missing HTTPS proxy defaults to HTTP proxy', function (t) { - var client = common.freshClient({ proxy: { http: 'http://proxy.npm:8088/' } }) - - t.equal(client.config.proxy.http, 'http://proxy.npm:8088/', 'HTTP proxy set') - t.equal(client.config.proxy.http, client.config.proxy.https, 'HTTP === HTTPS') - - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/config-override.js b/deps/npm/node_modules/npm-registry-client/test/config-override.js deleted file mode 100644 index ab44aa02b7..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/config-override.js +++ /dev/null @@ -1,61 +0,0 @@ -var test = require('tap').test - -require('./lib/server.js').close() -var common = require('./lib/common.js') -var config = { - proxy: { - http: 'http://proxy.npm:8088/', - https: 'https://proxy.npm:8043/', - localAddress: 'localhost.localdomain' - }, - ssl: { - ca: 'not including a PEM', - certificate: 'still not including a PEM', - key: 'nope', - strict: false - }, - retry: { - count: 1, - factor: 9001, - minTimeout: -1, - maxTimeout: Infinity - }, - userAgent: 'npm-awesome/4 (Mozilla 5.0)', - log: { fake: function () {} }, - defaultTag: 'next', - couchToken: { object: true }, - sessionToken: 'hamchunx', - isFromCI: true, - scope: '@test' -} - -test('config defaults', function (t) { - var client = common.freshClient(config) - - var proxy = client.config.proxy - t.equal(proxy.http, 'http://proxy.npm:8088/') - t.equal(proxy.https, 'https://proxy.npm:8043/') - t.equal(proxy.localAddress, 'localhost.localdomain') - - var ssl = client.config.ssl - t.equal(ssl.ca, 'not including a PEM') - t.equal(ssl.certificate, 'still not including a PEM') - t.equal(ssl.key, 'nope') - t.equal(ssl.strict, false) - - var retry = client.config.retry - t.equal(retry.count, 1) - t.equal(retry.factor, 9001) - t.equal(retry.minTimeout, -1) - t.equal(retry.maxTimeout, Infinity) - - t.equal(client.config.userAgent, 'npm-awesome/4 (Mozilla 5.0)') - t.ok(client.log.fake) - t.equal(client.config.defaultTag, 'next') - t.ok(client.config.couchToken.object) - t.equal(client.config.sessionToken, 'hamchunx') - t.ok(client.config.isFromCI) - t.is(client.config.scope, '@test') - - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/deprecate.js b/deps/npm/node_modules/npm-registry-client/test/deprecate.js deleted file mode 100644 index 4407d7c97b..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/deprecate.js +++ /dev/null @@ -1,216 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var cache = require('./fixtures/underscore/cache.json') - -var client = common.freshClient() - -function nop () {} - -var URI = 'https://npm.registry:8043/rewrite' -var VERSION = '1.3.2' -var MESSAGE = 'uhhh' -var TOKEN = 'lolbutts' -var AUTH = { - token: TOKEN -} -var PARAMS = { - version: VERSION, - message: MESSAGE, - auth: AUTH -} - -test('deprecate call contract', function (t) { - t.throws(function () { - client.deprecate(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - client.deprecate([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.deprecate(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.deprecate(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.deprecate(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.deprecate(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - message: MESSAGE, - auth: AUTH - } - client.deprecate(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass version to deprecate' }, - 'params must include version to deprecate' - ) - - t.throws( - function () { - var params = { - version: VERSION, - auth: AUTH - } - client.deprecate(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass message to deprecate' }, - 'params must include deprecation message' - ) - - t.throws( - function () { - var params = { - version: VERSION, - message: MESSAGE - } - client.deprecate(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to deprecate' }, - 'params must include auth' - ) - - t.test('malformed semver in deprecation', function (t) { - var params = { - version: '-9001', - message: MESSAGE, - auth: AUTH - } - client.deprecate(URI, params, function (err) { - t.equal( - err && err.message, - 'invalid version range: -9001', - 'got expected semver validation failure' - ) - t.end() - }) - }) - - t.end() -}) - -test('deprecate a package', function (t) { - server.expect('GET', '/underscore?write=true', function (req, res) { - t.equal(req.method, 'GET') - - res.json(cache) - }) - - server.expect('PUT', '/underscore', function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var updated = JSON.parse(b) - - var undeprecated = [ - '1.0.3', '1.0.4', '1.1.0', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', - '1.1.7', '1.2.0', '1.2.1', '1.2.2', '1.2.3', '1.2.4', '1.3.0', '1.3.1', '1.3.3' - ] - for (var i = 0; i < undeprecated.length; i++) { - var current = undeprecated[i] - t.notEqual( - updated.versions[current].deprecated, - MESSAGE, - current + ' not deprecated' - ) - } - - t.equal( - updated.versions[VERSION].deprecated, - MESSAGE, - VERSION + ' deprecated' - ) - res.statusCode = 201 - res.json({ deprecated: true }) - }) - }) - - client.deprecate( - common.registry + '/underscore', - PARAMS, - function (er, data) { - t.ifError(er) - t.ok(data.deprecated, 'was deprecated') - - t.end() - } - ) -}) - -test('deprecate a scoped package', function (t) { - server.expect('GET', '/@test%2funderscore?write=true', function (req, res) { - t.equal(req.method, 'GET') - - res.json(cache) - }) - - server.expect('PUT', '/@test%2funderscore', function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var updated = JSON.parse(b) - - var undeprecated = [ - '1.0.3', '1.0.4', '1.1.0', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', - '1.1.7', '1.2.0', '1.2.1', '1.2.2', '1.2.3', '1.2.4', '1.3.0', '1.3.1', '1.3.3' - ] - for (var i = 0; i < undeprecated.length; i++) { - var current = undeprecated[i] - t.notEqual( - updated.versions[current].deprecated, - MESSAGE, - current + ' not deprecated' - ) - } - - t.equal( - updated.versions[VERSION].deprecated, - MESSAGE, - VERSION + ' deprecated' - ) - res.statusCode = 201 - res.json({ deprecated: true }) - }) - }) - - client.deprecate( - common.registry + '/@test%2funderscore', - PARAMS, - function (er, data) { - t.ifError(er) - t.ok(data.deprecated, 'was deprecated') - - t.end() - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.ok(true) - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js deleted file mode 100644 index 00f43b0f28..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js +++ /dev/null @@ -1,142 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var BASE_URL = 'http://localhost:1337/' -var URI = '/-/package/underscore/dist-tags/test' -var TOKEN = 'foo' -var AUTH = { - token: TOKEN -} -var PACKAGE = 'underscore' -var DIST_TAG = 'test' -var VERSION = '3.1.3' -var PARAMS = { - 'package': PACKAGE, - distTag: DIST_TAG, - version: VERSION, - auth: AUTH -} - -test('distTags.add call contract', function (t) { - t.throws(function () { - client.distTags.add(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.distTags.add([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.distTags.add(BASE_URL, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.distTags.add(BASE_URL, '', nop) - }, 'params must be object') - - t.throws(function () { - client.distTags.add(BASE_URL, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.distTags.add(BASE_URL, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - distTag: DIST_TAG, - version: VERSION, - auth: AUTH - } - client.distTags.add(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass package name to distTags.add' - }, - 'distTags.add must include package name' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE, - version: VERSION, - auth: AUTH - } - client.distTags.add(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass package distTag name to distTags.add' - }, - 'distTags.add must include dist-tag' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE, - distTag: DIST_TAG, - auth: AUTH - } - client.distTags.add(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass version to be mapped to distTag to distTags.add' - }, - 'distTags.add must include version' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE, - distTag: DIST_TAG, - version: VERSION - } - client.distTags.add(BASE_URL, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to distTags.add' }, - 'distTags.add must include auth' - ) - - t.end() -}) - -test('add a new dist-tag to a package', function (t) { - server.expect('PUT', URI, function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - t.doesNotThrow(function () { - var parsed = JSON.parse(b) - t.deepEqual(parsed, VERSION) - - res.statusCode = 200 - res.json({ test: VERSION }) - }, 'got valid JSON from client') - }) - }) - - client.distTags.add(BASE_URL, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.test, 'dist-tag added') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js deleted file mode 100644 index cde338cf18..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js +++ /dev/null @@ -1,99 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var BASE_URL = 'http://localhost:1337/' -var URI = '/-/package/underscore/dist-tags' -var TOKEN = 'foo' -var AUTH = { - token: TOKEN -} -var PACKAGE = 'underscore' -var PARAMS = { - 'package': PACKAGE, - auth: AUTH -} - -test('distTags.fetch call contract', function (t) { - t.throws(function () { - client.distTags.fetch(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.distTags.fetch([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.distTags.fetch(BASE_URL, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.distTags.fetch(BASE_URL, '', nop) - }, 'params must be object') - - t.throws(function () { - client.distTags.fetch(BASE_URL, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.distTags.fetch(BASE_URL, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - auth: AUTH - } - client.distTags.fetch(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass package name to distTags.fetch' - }, - 'distTags.fetch must include package name' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE - } - client.distTags.fetch(BASE_URL, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to distTags.fetch' }, - 'distTags.fetch must include auth' - ) - - t.end() -}) - -test('fetch dist-tags for a package', function (t) { - server.expect('GET', URI, function (req, res) { - t.equal(req.method, 'GET') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - t.notOk(b, 'no request body') - - res.statusCode = 200 - res.json({ a: '1.0.0', b: '2.0.0', _etag: 'xxx' }) - }) - }) - - client.distTags.fetch(BASE_URL, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.same(data, { a: '1.0.0', b: '2.0.0' }, 'etag filtered from response') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js deleted file mode 100644 index 2076eb9312..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js +++ /dev/null @@ -1,118 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var BASE_URL = 'http://localhost:1337/' -var URI = '/-/package/underscore/dist-tags/test' -var TOKEN = 'foo' -var AUTH = { - token: TOKEN -} -var PACKAGE = 'underscore' -var DIST_TAG = 'test' -var PARAMS = { - 'package': PACKAGE, - distTag: DIST_TAG, - auth: AUTH -} - -test('distTags.rm call contract', function (t) { - t.throws(function () { - client.distTags.rm(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.distTags.rm([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.distTags.rm(BASE_URL, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.distTags.rm(BASE_URL, '', nop) - }, 'params must be object') - - t.throws(function () { - client.distTags.rm(BASE_URL, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.distTags.rm(BASE_URL, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - distTag: DIST_TAG, - auth: AUTH - } - client.distTags.rm(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass package name to distTags.rm' - }, - 'distTags.rm must include package name' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE, - auth: AUTH - } - client.distTags.rm(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass package distTag name to distTags.rm' - }, - 'distTags.rm must include dist-tag' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE, - distTag: DIST_TAG - } - client.distTags.rm(BASE_URL, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to distTags.rm' }, - 'distTags.rm must include auth' - ) - - t.end() -}) - -test('remove a dist-tag from a package', function (t) { - server.expect('DELETE', URI, function (req, res) { - t.equal(req.method, 'DELETE') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - t.notOk(b, 'got no message body') - - res.statusCode = 200 - res.json({}) - }) - }) - - client.distTags.rm(BASE_URL, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.notOk(data.test, 'dist-tag removed') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js deleted file mode 100644 index cb595f6d21..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js +++ /dev/null @@ -1,122 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var BASE_URL = 'http://localhost:1337/' -var URI = '/-/package/underscore/dist-tags' -var TOKEN = 'foo' -var AUTH = { - token: TOKEN -} -var PACKAGE = 'underscore' -var DIST_TAGS = { - 'a': '8.0.8', - 'b': '3.0.3' -} -var PARAMS = { - 'package': PACKAGE, - distTags: DIST_TAGS, - auth: AUTH -} - -test('distTags.set call contract', function (t) { - t.throws(function () { - client.distTags.set(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.distTags.set([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.distTags.set(BASE_URL, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.distTags.set(BASE_URL, '', nop) - }, 'params must be object') - - t.throws(function () { - client.distTags.set(BASE_URL, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.distTags.set(BASE_URL, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - distTags: DIST_TAGS, - auth: AUTH - } - client.distTags.set(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass package name to distTags.set' - }, - 'distTags.set must include package name' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE, - auth: AUTH - } - client.distTags.set(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass distTags map to distTags.set' - }, - 'distTags.set must include dist-tags' - ) - - t.throws( - function () { - var params = { - 'package': PACKAGE, - distTags: DIST_TAGS - } - client.distTags.set(BASE_URL, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to distTags.set' }, - 'distTags.set must include auth' - ) - - t.end() -}) - -test('set dist-tags for a package', function (t) { - server.expect('PUT', URI, function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var d = JSON.parse(b) - t.deepEqual(d, DIST_TAGS, 'got back tags') - - res.statusCode = 200 - res.json(DIST_TAGS) - }) - }) - - client.distTags.set(BASE_URL, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.a && data.b, 'dist-tags set') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js deleted file mode 100644 index 37508fc074..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js +++ /dev/null @@ -1,113 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var BASE_URL = 'http://localhost:1337/' -var URI = '/-/package/underscore/dist-tags' -var TOKEN = 'foo' -var AUTH = { - token: TOKEN -} -var PACKAGE = 'underscore' -var DIST_TAGS = { - 'a': '8.0.8', - 'b': '3.0.3' -} -var PARAMS = { - 'package': PACKAGE, - distTags: DIST_TAGS, - auth: AUTH -} - -test('distTags.update call contract', function (t) { - t.throws(function () { - client.distTags.update(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.distTags.update([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.distTags.update(BASE_URL, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.distTags.update(BASE_URL, '', nop) - }, 'params must be object') - - t.throws(function () { - client.distTags.update(BASE_URL, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.distTags.update(BASE_URL, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { distTags: DIST_TAGS, auth: AUTH } - client.distTags.update(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass package name to distTags.update' - }, - 'distTags.update must include package name' - ) - - t.throws( - function () { - var params = { 'package': PACKAGE, auth: AUTH } - client.distTags.update(BASE_URL, params, nop) - }, - { - name: 'AssertionError', - message: 'must pass distTags map to distTags.update' - }, - 'distTags.update must include dist-tags' - ) - - t.throws( - function () { - var params = { 'package': PACKAGE, distTags: DIST_TAGS } - client.distTags.update(BASE_URL, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to distTags.update' }, - 'distTags.update must include auth' - ) - - t.end() -}) - -test('update dist-tags for a package', function (t) { - server.expect('POST', URI, function (req, res) { - t.equal(req.method, 'POST') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var d = JSON.parse(b) - t.deepEqual(d, DIST_TAGS, 'got back tags') - - res.statusCode = 200 - res.json(DIST_TAGS) - }) - }) - - client.distTags.update(BASE_URL, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.a && data.b, 'dist-tags set') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/econnreset.js b/deps/npm/node_modules/npm-registry-client/test/econnreset.js deleted file mode 100644 index ee0657112b..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/econnreset.js +++ /dev/null @@ -1,95 +0,0 @@ -'use strict' -var requireInject = require('require-inject') -var test = require('tap').test -var EventEmitter = require('events').EventEmitter -var PassThrough = require('readable-stream').PassThrough - -var content = [ - 'first chunk', - 'second chunk' -] -var requests = 0 -var fetch = requireInject('../lib/fetch.js', { - request: function (opts) { - var req = new EventEmitter() - ++requests - setTimeout(function () { - var res = new PassThrough() - res.statusCode = 200 - - setTimeout(function () { - res.write(content[0]) - }, 50) - - if (requests === 1) { - setTimeout(function () { - var err = new Error('read ECONNRESET') - err.code = 'ECONNRESET' - req.emit('error', err) - }, 100) - } else { - // we allow success on retries, though in practice we won't be - // retrying. - setTimeout(function () { - res.end(content[1]) - }, 100) - } - req.emit('response', res) - }, 50) - return req - } -}) - -function clientMock (t) { - return { - log: { - info: function (section, message) { - t.comment('[info] ' + section + ': ' + [].slice.call(arguments, 1).join(' ')) - }, - http: function (section, message) { - t.comment('[http] ' + section + ': ' + [].slice.call(arguments, 1).join(' ')) - } - }, - authify: function (alwaysAuth, parsed, headers, auth) { - return - }, - initialize: function (parsed, method, accept, headers) { - return {} - }, - attempt: require('../lib/attempt.js'), - config: { - retry: { - retries: 2, - factor: 10, - minTimeout: 10000, - maxTimeout: 60000 - } - } - } -} - -/* -This tests that errors that occur in the REQUEST object AFTER a `response` -event has been emitted will be passed through to the `response` stream. -This means that we won't try to retry these sorts of errors ourselves. -*/ - -test('econnreset', function (t) { - var client = clientMock(t) - fetch.call(client, 'http://example.com/', {}, function (err, res) { - t.ifError(err, 'initial fetch ok') - var data = '' - res.on('data', function (chunk) { - data += chunk - }) - res.on('error', function (err) { - t.comment('ERROR:', err.stack) - t.pass("errored and that's ok") - t.done() - }) - res.on('end', function () { - t.is(data, content.join(''), 'succeeded and got the right data') - t.done() - }) - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js deleted file mode 100644 index fa400cd5cc..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js +++ /dev/null @@ -1,35 +0,0 @@ -var resolve = require('path').resolve -var createReadStream = require('graceful-fs').createReadStream - -var tap = require('tap') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') - -tap.test('fetch with a 404 response', function (t) { - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(404) - - createReadStream(tgz).pipe(res) - }) - - var client = common.freshClient() - var defaulted = {} - client.fetch( - 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', - defaulted, - function (err, res) { - t.equal( - err.message, - 'fetch failed with status code 404', - 'got expected error message' - ) - server.close() - t.end() - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js deleted file mode 100644 index 422376ef3d..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js +++ /dev/null @@ -1,54 +0,0 @@ -var resolve = require('path').resolve -var createReadStream = require('graceful-fs').createReadStream -var readFileSync = require('graceful-fs').readFileSync - -var tap = require('tap') -var cat = require('concat-stream') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') - -tap.test('fetch with retry on timeout', function (t) { - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(408) - res.end() - }) - - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(200, { - 'content-type': 'application/x-tar', - 'content-encoding': 'gzip' - }) - - createReadStream(tgz).pipe(res) - }) - - var client = common.freshClient() - var defaulted = {} - client.config.retry.minTimeout = 100 - client.fetch( - 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', - defaulted, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = cat(function (data) { - t.deepEqual(data, readFileSync(tgz)) - server.close() - t.end() - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js deleted file mode 100644 index 6dff115582..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js +++ /dev/null @@ -1,54 +0,0 @@ -var resolve = require('path').resolve -var createReadStream = require('graceful-fs').createReadStream -var readFileSync = require('graceful-fs').readFileSync - -var tap = require('tap') -var cat = require('concat-stream') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') - -tap.test('fetch with retry on server error', function (t) { - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(503) - res.end() - }) - - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(200, { - 'content-type': 'application/x-tar', - 'content-encoding': 'gzip' - }) - - createReadStream(tgz).pipe(res) - }) - - var client = common.freshClient() - var defaulted = {} - client.config.retry.minTimeout = 100 - client.fetch( - 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', - defaulted, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = cat(function (data) { - t.deepEqual(data, readFileSync(tgz)) - server.close() - t.end() - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js b/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js deleted file mode 100644 index d516deb379..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js +++ /dev/null @@ -1,58 +0,0 @@ -var resolve = require('path').resolve -var createReadStream = require('graceful-fs').createReadStream -var readFileSync = require('graceful-fs').readFileSync - -var tap = require('tap') -var cat = require('concat-stream') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') - -tap.test('basic fetch with scoped always-auth enabled', function (t) { - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - t.equal( - req.headers.authorization, - 'Basic dXNlcm5hbWU6JTEyMzRAYXNkZiU=', - 'got expected auth header' - ) - - res.writeHead(200, { - 'content-type': 'application/x-tar', - 'content-encoding': 'gzip' - }) - - createReadStream(tgz).pipe(res) - }) - - var auth = { - username: 'username', - password: '%1234@asdf%', - email: 'i@izs.me', - alwaysAuth: true - } - - var client = common.freshClient() - var authed = { auth: auth } - client.fetch( - 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', - authed, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = cat(function (data) { - t.deepEqual(data, readFileSync(tgz)) - server.close() - t.end() - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js deleted file mode 100644 index 31ad17edd5..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js +++ /dev/null @@ -1,93 +0,0 @@ -var resolve = require('path').resolve -var createReadStream = require('graceful-fs').createReadStream -var readFileSync = require('graceful-fs').readFileSync - -var test = require('tap').test -var concat = require('concat-stream') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') - -function nop () {} - -var URI = 'https://npm.registry:8043/rewrite' -var USERNAME = 'username' -var PASSWORD = 'hi' -var EMAIL = 'n@p.m' -var HEADERS = { - 'npm-custom': 'lolbutts' -} -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { - headers: HEADERS, - auth: AUTH -} - -test('fetch call contract', function (t) { - t.throws(function () { - client.get(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - client.get([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.get(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.get(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.get(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.get(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.end() -}) - -test('basic fetch', function (t) { - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(200, { - 'content-type': 'application/x-tar', - 'content-encoding': 'gzip' - }) - - createReadStream(tgz).pipe(res) - }) - - var defaulted = {} - client.fetch( - 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', - defaulted, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = concat(function (data) { - t.deepEqual(data, readFileSync(tgz)) - server.close() - t.end() - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js b/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js deleted file mode 100644 index 688c91d271..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js +++ /dev/null @@ -1,68 +0,0 @@ -var resolve = require('path').resolve -var createReadStream = require('graceful-fs').createReadStream -var readFileSync = require('graceful-fs').readFileSync - -var tap = require('tap') -var cat = require('concat-stream') -var Negotiator = require('negotiator') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') - -tap.test("fetch accepts github api's json", function (t) { - server.expect('/underscore/-/underscore-1.3.3', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - var negotiator = new Negotiator(req) - - // fetching a tarball from `api.github.com` returns a 415 error if json is - // not accepted - if (negotiator.mediaTypes().indexOf('application/vnd.github+json') === -1) { - res.writeHead(415, { - 'Content-Type': 'application/json' - }) - } else { - res.writeHead(302, { - 'Content-Type': 'text/html', - 'Location': '/underscore/-/underscore-1.3.3.tgz' - }) - } - - res.end() - }) - - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(200, { - 'Content-Type': 'application/x-tar', - 'Content-Encoding': 'gzip' - }) - - createReadStream(tgz).pipe(res) - }) - - var client = common.freshClient() - var defaulted = {} - client.fetch( - 'http://localhost:1337/underscore/-/underscore-1.3.3', - defaulted, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = cat(function (data) { - t.deepEqual(data, readFileSync(tgz)) - server.close() - t.end() - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js b/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js deleted file mode 100644 index 6a397cc5e9..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js +++ /dev/null @@ -1,54 +0,0 @@ -var resolve = require('path').resolve -var createReadStream = require('graceful-fs').createReadStream -var readFileSync = require('graceful-fs').readFileSync - -var tap = require('tap') -var cat = require('concat-stream') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var tgz = resolve(__dirname, './fixtures/underscore/1.3.3/package.tgz') - -tap.test('basic fetch with scoped always-auth disabled', function (t) { - server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - t.notOk(req.headers.authorization, 'received no auth header') - - res.writeHead(200, { - 'content-type': 'application/x-tar', - 'content-encoding': 'gzip' - }) - - createReadStream(tgz).pipe(res) - }) - - var auth = { - username: 'username', - password: '%1234@asdf%', - email: 'i@izs.me', - alwaysAuth: false - } - - var client = common.freshClient() - var authed = { auth: auth } - client.fetch( - 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', - authed, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = cat(function (data) { - t.deepEqual(data, readFileSync(tgz)) - server.close() - t.end() - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js b/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js deleted file mode 100644 index 72aeea0beb..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js +++ /dev/null @@ -1,58 +0,0 @@ -var test = require('tap').test -var concat = require('concat-stream') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var testData = JSON.stringify({test: true}) -var errorData = JSON.stringify({error: 'it went bad'}) - -test('streaming fetch', function (t) { - server.expect('/test', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(200, { - 'content-type': 'application/json' - }) - - res.end(testData) - }) - - server.expect('/error', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(401, { - 'content-type': 'application/json' - }) - - res.end(errorData) - }) - - client.fetch( - 'http://localhost:1337/test', - { streaming: true }, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = concat(function (data) { - t.deepEqual(data.toString(), testData) - client.fetch( - 'http://localhost:1337/error', - { streaming: true }, - function (er, res) { - t.ok(er, 'got an error') - server.close() - t.end() - } - ) - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-403.js b/deps/npm/node_modules/npm-registry-client/test/get-403.js deleted file mode 100644 index 004de207f8..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/get-403.js +++ /dev/null @@ -1,30 +0,0 @@ -var tap = require('tap') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -tap.test('get returns 403', function (t) { - server.expect('/underscore', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(403) - res.end(JSON.stringify({ - error: 'get that cat out of the toilet that\'s gross omg' - })) - }) - - var client = common.freshClient() - client.get( - 'http://localhost:1337/underscore', - {}, - function (er) { - t.ok(er, 'failed as expected') - - t.equal(er.statusCode, 403, 'status code was attached to error as expected') - t.equal(er.code, 'E403', 'error code was formatted as expected') - - server.close() - t.end() - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-basic.js b/deps/npm/node_modules/npm-registry-client/test/get-basic.js deleted file mode 100644 index 031309c92b..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/get-basic.js +++ /dev/null @@ -1,85 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var us = require('./fixtures/underscore/1.3.3/cache.json') -var usroot = require('./fixtures/underscore/cache.json') - -function nop () {} - -var URI = 'https://npm.registry:8043/rewrite' -var TIMEOUT = 3600 -var FOLLOW = false -var STALE_OK = true -var TOKEN = 'lolbutts' -var AUTH = { - token: TOKEN -} -var PARAMS = { - timeout: TIMEOUT, - follow: FOLLOW, - staleOk: STALE_OK, - auth: AUTH -} - -test('get call contract', function (t) { - t.throws(function () { - client.get(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - client.get([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.get(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.get(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.get(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.get(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.end() -}) - -test('basic request', function (t) { - server.expect('/underscore/1.3.3', function (req, res) { - res.json(us) - }) - - server.expect('/underscore', function (req, res) { - res.json(usroot) - }) - - server.expect('/@bigco%2funderscore', function (req, res) { - res.json(usroot) - }) - - t.plan(3) - client.get('http://localhost:1337/underscore/1.3.3', PARAMS, function (er, data) { - t.deepEqual(data, us) - }) - - client.get('http://localhost:1337/underscore', PARAMS, function (er, data) { - t.deepEqual(data, usroot) - }) - - client.get('http://localhost:1337/@bigco%2funderscore', PARAMS, function (er, data) { - t.deepEqual(data, usroot) - }) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js deleted file mode 100644 index 73ef436116..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js +++ /dev/null @@ -1,34 +0,0 @@ -var tap = require('tap') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -tap.test('get fails with 403', function (t) { - server.expect('/habanero', function (req, res) { - t.equal(req.method, 'GET', 'got expected method') - - res.writeHead(403) - res.end('{"error":"get that cat out of the toilet that\'s gross omg"}') - }) - - var client = common.freshClient() - client.config.retry.minTimeout = 100 - client.get( - 'http://localhost:1337/habanero', - {}, - function (er) { - t.ok(er, 'failed as expected') - - t.equal(er.statusCode, 403, 'status code was attached as expected') - t.equal(er.code, 'E403', 'error code was formatted as expected') - t.equal( - er.message, - 'get that cat out of the toilet that\'s gross omg : habanero', - 'got error message' - ) - - server.close() - t.end() - } - ) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/initialize.js b/deps/npm/node_modules/npm-registry-client/test/initialize.js deleted file mode 100644 index 4a97bd5fdf..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/initialize.js +++ /dev/null @@ -1,125 +0,0 @@ -var test = require('tap').test -var url = require('url') - -// var server = require('./lib/server.js') -var Client = require('../') - -test('defaulted initialization', function (t) { - var client = new Client() - var options = client.initialize( - 'http://localhost:1337/', - 'GET', - 'application/json', - {} - ) - - t.equal(options.url, 'http://localhost:1337/', 'URLs match') - t.equal(options.method, 'GET', 'methods match') - t.equal(options.proxy, undefined, "proxy won't overwrite environment") - t.equal(options.localAddress, undefined, 'localAddress has no default value') - t.equal(options.strictSSL, true, 'SSL is strict by default') - - t.equal(options.headers.accept, 'application/json', 'accept header set') - t.equal( - options.headers.version, - require('../package.json').version, - 'npm-registry-client version is present in headers' - ) - t.ok(options.headers['npm-session'], 'request ID generated') - t.ok(options.headers['user-agent'], 'user-agent preset') - - var HttpAgent = require('http').Agent - t.ok(options.agent instanceof HttpAgent, 'got an HTTP agent for an HTTP URL') - t.equal(options.agent.maxSockets, 50, 'maxSockets set to a reasonable default') - - t.end() -}) - -test('intializing with maxSockets set works for http', function (t) { - var client = new Client({ maxSockets: Infinity }) - var options = client.initialize( - url.parse('http://localhost:1337/'), - 'GET', - 'application/json', - {} - ) - - var HttpAgent = require('http').Agent - t.ok(options.agent instanceof HttpAgent, 'got an HTTP agent for an HTTP URL') - t.equal(options.agent.maxSockets, Infinity, 'request uses configured value for maxSockets') - - t.end() -}) - -test('intializing with maxSockets set works for https', function (t) { - var client = new Client({ maxSockets: Infinity }) - var options = client.initialize( - url.parse('https://localhost:1337/'), - 'GET', - 'application/json', - {} - ) - - var HttpsAgent = require('https').Agent - t.ok(options.agent instanceof HttpsAgent, 'got an HTTPS agent for an HTTPS URL') - t.equal(options.agent.maxSockets, Infinity, 'request uses configured value for maxSockets') - - t.end() -}) - -test('referer set on client', function (t) { - var client = new Client() - client.refer = 'xtestx' - var options = client.initialize( - 'http://localhost:1337/', - 'GET', - 'application/json', - {} - ) - - t.equal(options.headers.referer, 'xtestx', 'referer header set') - - t.end() -}) - -test('initializing with proxy explicitly disabled', function (t) { - var client = new Client({ proxy: { http: false } }) - var options = client.initialize( - 'http://localhost:1337/', - 'GET', - 'application/json', - {} - ) - t.ok('proxy' in options, 'proxy overridden by explicitly setting to false') - t.equal(options.proxy, null, 'request will override proxy when empty proxy passed in') - t.end() -}) - -test('initializing with proxy undefined', function (t) { - var client = new Client({ proxy: { http: undefined } }) - var options = client.initialize( - 'http://localhost:1337/', - 'GET', - 'application/json', - {} - ) - t.notOk('proxy' in options, 'proxy can be read from env.PROXY by request') - t.end() -}) - -test('initializing with a certificate should map down to the https agent', function (t) { - var certificate = '-----BEGIN CERTIFICATE----- TEST\nTEST -----END CERTIFICATE-----\n' - var client = new Client({ - ssl: { - certificate: certificate - } - }) - var options = client.initialize( - { protocol: 'https:' }, - 'GET', - 'application/json', - {} - ) - t.equal(options.agent.options.cert, certificate, 'certificate will be saved properly on agent') - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js deleted file mode 100644 index ea48d30149..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/lib/common.js +++ /dev/null @@ -1,31 +0,0 @@ -var server = require('./server.js') -var RC = require('../../') -var REGISTRY = 'http://localhost:' + server.port - -// cheesy hackaround for test deps (read: nock) that rely on setImmediate -if (!global.setImmediate || !require('timers').setImmediate) { - require('timers').setImmediate = global.setImmediate = function () { - var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) - setTimeout.apply(this, args) - } -} - -// See https://github.com/npm/npm-registry-client/pull/142 for background. -// Note: `process.on('warning')` only works with Node >= 6. -process.on('warning', function (warning) { - if (/Possible EventEmitter memory leak detected/.test(warning.message)) { - throw new Error('There should not be any EventEmitter memory leaks') - } -}) - -module.exports = { - port: server.port, - registry: REGISTRY, - freshClient: function freshClient (config) { - var client = new RC(config) - server.log = client.log - client.log.level = 'silent' - - return client - } -} diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/server.js b/deps/npm/node_modules/npm-registry-client/test/lib/server.js deleted file mode 100644 index 3a702e6796..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/lib/server.js +++ /dev/null @@ -1,59 +0,0 @@ -// a fake registry server. - -var http = require('http') -var server = http.createServer(handler) -var port = server.port = process.env.PORT || 1337 -var assert = require('assert') -server.listen(port) - -module.exports = server - -server._expect = {} - -function handler (req, res) { - req.connection.setTimeout(1000) - // If we got authorization, make sure it's the right password. - if (req.headers.authorization && req.headers.authorization.match(/^Basic/)) { - var auth = req.headers.authorization.replace(/^Basic /, '') - auth = new Buffer(auth, 'base64').toString('utf8') - assert.equal(auth, 'username:%1234@asdf%') - } - - var u = '* ' + req.url - var mu = req.method + ' ' + req.url - - var k = server._expect[mu] ? mu : server._expect[u] ? u : null - if (!k) throw Error('unexpected request: ' + req.method + ' ' + req.url) - - var fn = server._expect[k].shift() - if (!fn) throw Error('unexpected request: ' + req.method + ' ' + req.url) - - this.log.info('fake-registry', Object.keys(server._expect).map(function (k) { - return [k, server._expect[k].length] - }).reduce(function (acc, kv) { - acc[kv[0]] = kv[1] - return acc - }, {})) - - res.json = json - fn(req, res) -} - -function json (o) { - this.setHeader('content-type', 'application/json') - this.end(JSON.stringify(o)) -} - -// this log is meanto to be overridden -server.log = require('npmlog') - -server.expect = function (method, u, fn) { - if (typeof u === 'function') { - fn = u - u = method - method = '*' - } - u = method + ' ' + u - server._expect[u] = server._expect[u] || [] - server._expect[u].push(fn) -} diff --git a/deps/npm/node_modules/npm-registry-client/test/logout.js b/deps/npm/node_modules/npm-registry-client/test/logout.js deleted file mode 100644 index 7836d805ae..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/logout.js +++ /dev/null @@ -1,74 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var URI = 'http://localhost:1337/rewrite' -var TOKEN = 'b00b00feed' -var PARAMS = { - auth: { - token: TOKEN - } -} - -test('logout call contract', function (t) { - t.throws(function () { - client.logout(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - client.logout([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.logout(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.logout(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.logout(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.logout(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - auth: {} - } - client.logout(URI, params, nop) - }, - { name: 'AssertionError', message: 'can only log out for token auth' }, - 'auth must include token' - ) - - t.end() -}) - -test('log out from a token-based registry', function (t) { - server.expect('DELETE', '/-/user/token/' + TOKEN, function (req, res) { - t.equal(req.method, 'DELETE') - t.equal(req.headers.authorization, 'Bearer ' + TOKEN, 'request is authed') - - res.json({message: 'ok'}) - }) - - client.logout(URI, PARAMS, function (er) { - t.ifError(er, 'no errors') - - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/ping.js b/deps/npm/node_modules/npm-registry-client/test/ping.js deleted file mode 100644 index 1b30b90520..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/ping.js +++ /dev/null @@ -1,76 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var TOKEN = 'not-bad-meaning-bad-but-bad-meaning-wombat' -var AUTH = { token: TOKEN } -var PARAMS = { auth: AUTH } -var DEP_USER = 'username' -var HOST = 'localhost' - -test('ping call contract', function (t) { - t.throws(function () { - client.ping(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.ping([], AUTH, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.ping(common.registry, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.ping(common.registry, '', nop) - }, 'params must be object') - - t.throws(function () { - client.ping(common.registry, AUTH, undefined) - }, 'requires callback') - - t.throws(function () { - client.ping(common.registry, AUTH, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = {} - client.ping(common.registry, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to ping' }, - 'must pass auth to ping' - ) - - t.end() -}) - -test('ping', function (t) { - server.expect('GET', '/-/ping?write=true', function (req, res) { - t.equal(req.method, 'GET') - res.statusCode = 200 - res.json({ - ok: true, - host: HOST, - peer: HOST, - username: DEP_USER - }) - }) - - client.ping(common.registry, PARAMS, function (error, found) { - t.ifError(error, 'no errors') - var wanted = { - ok: true, - host: HOST, - peer: HOST, - username: DEP_USER - } - t.same(found, wanted) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js deleted file mode 100644 index 611a852cd8..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js +++ /dev/null @@ -1,91 +0,0 @@ -var tap = require('tap') -var fs = require('fs') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var auth = { - username: 'username', - password: '%1234@asdf%', - email: 'i@izs.me', - alwaysAuth: true -} - -var client = common.freshClient() - -tap.test('publish again', function (t) { - // not really a tarball, but doesn't matter - var bodyPath = require.resolve('../package.json') - var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath) - var pkg = require('../package.json') - var lastTime = null - - server.expect('/@npm%2fnpm-registry-client', function (req, res) { - t.equal(req.method, 'PUT') - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = lastTime = JSON.parse(b) - t.equal(o._id, '@npm/npm-registry-client') - t.equal(o['dist-tags'].latest, pkg.version) - t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) - var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd.toString('base64')) - res.statusCode = 409 - res.json({reason: 'must supply latest _rev to update existing package'}) - }) - }) - - server.expect('/@npm%2fnpm-registry-client?write=true', function (req, res) { - t.equal(req.method, 'GET') - t.ok(lastTime) - for (var i in lastTime.versions) { - var v = lastTime.versions[i] - delete lastTime.versions[i] - lastTime.versions['0.0.2'] = v - lastTime['dist-tags'] = { latest: '0.0.2' } - } - lastTime._rev = 'asdf' - res.json(lastTime) - }) - - server.expect('/@npm%2fnpm-registry-client', function (req, res) { - t.equal(req.method, 'PUT') - t.ok(lastTime) - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = JSON.parse(b) - t.equal(o._rev, 'asdf') - t.deepEqual(o.versions['0.0.2'], o.versions[pkg.version]) - res.statusCode = 201 - res.json({created: true}) - }) - }) - - pkg.name = '@npm/npm-registry-client' - - var params = { - metadata: pkg, - access: 'restricted', - body: tarball, - auth: auth - } - client.publish('http://localhost:1337/', params, function (er, data) { - if (er) throw er - t.deepEqual(data, { created: true }) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js deleted file mode 100644 index 4a895205ea..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js +++ /dev/null @@ -1,89 +0,0 @@ -var tap = require('tap') -var fs = require('fs') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var auth = { - username: 'username', - password: '%1234@asdf%', - email: 'i@izs.me', - alwaysAuth: true -} - -var client = common.freshClient() - -tap.test('publish again', function (t) { - // not really a tarball, but doesn't matter - var bodyPath = require.resolve('../package.json') - var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath) - var pkg = require('../package.json') - var lastTime = null - - server.expect('/npm-registry-client', function (req, res) { - t.equal(req.method, 'PUT') - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = lastTime = JSON.parse(b) - t.equal(o._id, 'npm-registry-client') - t.equal(o['dist-tags'].latest, pkg.version) - t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) - var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd.toString('base64')) - res.statusCode = 409 - res.json({reason: 'must supply latest _rev to update existing package'}) - }) - }) - - server.expect('/npm-registry-client?write=true', function (req, res) { - t.equal(req.method, 'GET') - t.ok(lastTime) - for (var i in lastTime.versions) { - var v = lastTime.versions[i] - delete lastTime.versions[i] - lastTime.versions['0.0.2'] = v - lastTime['dist-tags'] = { latest: '0.0.2' } - } - lastTime._rev = 'asdf' - res.json(lastTime) - }) - - server.expect('/npm-registry-client', function (req, res) { - t.equal(req.method, 'PUT') - t.ok(lastTime) - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = JSON.parse(b) - t.equal(o._rev, 'asdf') - t.deepEqual(o.versions['0.0.2'], o.versions[pkg.version]) - res.statusCode = 201 - res.json({created: true}) - }) - }) - - var params = { - metadata: pkg, - access: 'public', - body: tarball, - auth: auth - } - client.publish('http://localhost:1337/', params, function (er, data) { - if (er) throw er - t.deepEqual(data, { created: true }) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js b/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js deleted file mode 100644 index d2641e85c1..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js +++ /dev/null @@ -1,44 +0,0 @@ -var createReadStream = require('fs').createReadStream - -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var config = { retry: { retries: 0 } } -var client = common.freshClient(config) - -var URI = 'http://localhost:1337/' -var USERNAME = 'username' -var PASSWORD = '%1234@asdf%' -var EMAIL = 'i@izs.me' -var METADATA = require('../package.json') -var ACCESS = 'public' -// not really a tarball, but doesn't matter -var BODY_PATH = require.resolve('../package.json') -var BODY = createReadStream(BODY_PATH) -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { - metadata: METADATA, - access: ACCESS, - body: BODY, - auth: AUTH -} - -test('publish with a 500 response but no message', function (t) { - server.expect('/npm-registry-client', function (req, res) { - res.statusCode = 500 - res.json({ success: false }) - }) - - client.publish(URI, PARAMS, function (er, data) { - t.ok(er, 'got expected error') - t.notOk(data, 'no payload on failure') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js b/deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js deleted file mode 100644 index 5f2c44e697..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js +++ /dev/null @@ -1,92 +0,0 @@ -var tap = require('tap') -var fs = require('fs') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var auth = { - username: 'username', - password: '%1234@asdf%', - email: 'i@izs.me', - alwaysAuth: true -} - -var client = common.freshClient() - -tap.test('publish mixcase name', function (t) { - // not really a tarball, but doesn't matter - var bodyPath = require.resolve('../package.json') - var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath) - var pkg = require('../package.json') - var lastTime = null - - // change to mixed case name - pkg.name = 'npm-Registry-Client' - - server.expect('/npm-Registry-Client', function (req, res) { - t.equal(req.method, 'PUT') - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = lastTime = JSON.parse(b) - t.equal(o._id, 'npm-Registry-Client') - t.equal(o['dist-tags'].latest, pkg.version) - t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) - var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd.toString('base64')) - res.statusCode = 409 - res.json({reason: 'must supply latest _rev to update existing package'}) - }) - }) - - server.expect('/npm-Registry-Client?write=true', function (req, res) { - t.equal(req.method, 'GET') - t.ok(lastTime) - for (var i in lastTime.versions) { - var v = lastTime.versions[i] - delete lastTime.versions[i] - lastTime.versions['0.0.2'] = v - lastTime['dist-tags'] = { latest: '0.0.2' } - } - lastTime._rev = 'asdf' - res.json(lastTime) - }) - - server.expect('/npm-Registry-Client', function (req, res) { - t.equal(req.method, 'PUT') - t.ok(lastTime) - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = JSON.parse(b) - t.equal(o._rev, 'asdf') - t.deepEqual(o.versions['0.0.2'], o.versions[pkg.version]) - res.statusCode = 201 - res.json({created: true}) - }) - }) - - var params = { - metadata: pkg, - access: 'public', - body: tarball, - auth: auth - } - client.publish('http://localhost:1337/', params, function (er, data) { - if (er) throw er - t.deepEqual(data, { created: true }) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js b/deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js deleted file mode 100644 index e3e8ed2324..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js +++ /dev/null @@ -1,73 +0,0 @@ -var test = require('tap').test -var crypto = require('crypto') -var fs = require('fs') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var URI = 'http://localhost:1337/' -var USERNAME = 'username' -var PASSWORD = '%1234@asdf%' -var EMAIL = 'i@izs.me' -var METADATA = require('../package.json') -var ACCESS = 'public' -// not really a tarball, but doesn't matter -var BODY_PATH = require.resolve('../package.json') -var BODY = fs.createReadStream(BODY_PATH) -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { - metadata: METADATA, - access: ACCESS, - body: BODY, - auth: AUTH -} - -test('publish-new-mixcase-name', function (t) { - var pd = fs.readFileSync(BODY_PATH) - - // change to mixed-case name - METADATA.name = 'npm-Registry-Client' - - server.expect('/npm-Registry-Client', function (req, res) { - t.equal(req.method, 'PUT') - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = JSON.parse(b) - t.equal(o._id, 'npm-Registry-Client') - t.equal(o['dist-tags'].latest, METADATA.version) - t.equal(o.access, ACCESS) - t.has(o.versions[METADATA.version], METADATA) - t.same(o.maintainers, [{ name: 'username', email: 'i@izs.me' }]) - t.same(o.maintainers, o.versions[METADATA.version].maintainers) - - var att = o._attachments[METADATA.name + '-' + METADATA.version + '.tgz'] - t.same(att.data, pd.toString('base64')) - - var hash = crypto.createHash('sha1').update(pd).digest('hex') - t.equal(o.versions[METADATA.version].dist.shasum, hash) - - res.statusCode = 403 - res.json({error: 'Name must be lower-case'}) - }) - }) - - client.publish(URI, PARAMS, function (er, data, json, res) { - t.assert(er instanceof Error) // expect error - - // TODO: need a test that ensures useful error message - // t.similar(data.error, /must be lower-case/) - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js deleted file mode 100644 index a9c5768e58..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js +++ /dev/null @@ -1,57 +0,0 @@ -var tap = require('tap') -var crypto = require('crypto') -var fs = require('fs') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var auth = { token: 'of-glad-tidings' } - -var client = common.freshClient() - -tap.test('publish', function (t) { - // not really a tarball, but doesn't matter - var bodyPath = require.resolve('../package.json') - var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath) - var pkg = require('../package.json') - pkg.name = '@npm/npm-registry-client' - - server.expect('/@npm%2fnpm-registry-client', function (req, res) { - t.equal(req.method, 'PUT') - t.equal(req.headers.authorization, 'Bearer of-glad-tidings') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = JSON.parse(b) - t.equal(o._id, '@npm/npm-registry-client') - t.equal(o['dist-tags'].latest, pkg.version) - t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, o.versions[pkg.version].maintainers) - var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd.toString('base64')) - var hash = crypto.createHash('sha1').update(pd).digest('hex') - t.equal(o.versions[pkg.version].dist.shasum, hash) - res.statusCode = 201 - res.json({ created: true }) - }) - }) - - var params = { - metadata: pkg, - access: 'restricted', - body: tarball, - auth: auth - } - client.publish(common.registry, params, function (er, data) { - if (er) throw er - t.deepEqual(data, { created: true }) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js deleted file mode 100644 index 347364ea99..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js +++ /dev/null @@ -1,64 +0,0 @@ -var tap = require('tap') -var crypto = require('crypto') -var fs = require('fs') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') - -var auth = { - username: 'username', - password: '%1234@asdf%', - email: 'ogd@aoaioxxysz.net' -} - -var client = common.freshClient() - -var _auth = new Buffer('username:%1234@asdf%').toString('base64') - -tap.test('publish', function (t) { - // not really a tarball, but doesn't matter - var bodyPath = require.resolve('../package.json') - var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath) - var pkg = require('../package.json') - pkg.name = '@npm/npm-registry-client' - - server.expect('/@npm%2fnpm-registry-client', function (req, res) { - t.equal(req.method, 'PUT') - t.equal(req.headers.authorization, 'Basic ' + _auth) - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = JSON.parse(b) - t.equal(o._id, '@npm/npm-registry-client') - t.equal(o['dist-tags'].latest, pkg.version) - t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, [ { name: 'username', email: 'ogd@aoaioxxysz.net' } ]) - t.same(o.maintainers, o.versions[pkg.version].maintainers) - var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd.toString('base64')) - var hash = crypto.createHash('sha1').update(pd).digest('hex') - t.equal(o.versions[pkg.version].dist.shasum, hash) - res.statusCode = 201 - res.json({ created: true }) - }) - }) - - var params = { - metadata: pkg, - access: 'restricted', - body: tarball, - auth: auth - } - client.publish(common.registry, params, function (er, data) { - if (er) throw er - t.deepEqual(data, { created: true }) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish.js b/deps/npm/node_modules/npm-registry-client/test/publish.js deleted file mode 100644 index 07c8bb4617..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/publish.js +++ /dev/null @@ -1,204 +0,0 @@ -var test = require('tap').test -var crypto = require('crypto') -var fs = require('fs') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var URI = 'http://localhost:1337/' -var USERNAME = 'username' -var PASSWORD = '%1234@asdf%' -var EMAIL = 'i@izs.me' -var METADATA = require('../package.json') -var ACCESS = 'public' -// not really a tarball, but doesn't matter -var BODY_PATH = require.resolve('../package.json') -var BODY = fs.createReadStream(BODY_PATH) -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { - metadata: METADATA, - access: ACCESS, - body: BODY, - auth: AUTH -} - -test('publish call contract', function (t) { - t.throws(function () { - client.publish(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - client.publish([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.publish(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.publish(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.publish(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.publish(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - access: ACCESS, - body: BODY, - auth: AUTH - } - client.publish(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass package metadata to publish' }, - 'params must include metadata for package' - ) - - t.throws( - function () { - var params = { - metadata: METADATA, - access: ACCESS, - auth: AUTH - } - client.publish(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass package body to publish' }, - 'params must include body of package to publish' - ) - - t.throws( - function () { - var params = { - metadata: METADATA, - access: ACCESS, - body: BODY - } - client.publish(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to publish' }, - 'params must include auth' - ) - - t.throws( - function () { - var params = { - metadata: -1, - access: ACCESS, - body: BODY, - auth: AUTH - } - client.publish(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass package metadata to publish' }, - 'metadata must be object' - ) - - t.throws( - function () { - var params = { - metadata: METADATA, - access: 'hamchunx', - body: BODY, - auth: AUTH - } - client.publish(URI, params, nop) - }, - { - name: 'AssertionError', - message: "if present, access level must be either 'public' or 'restricted'" - }, - "access level must be 'public' or 'restricted'" - ) - - t.throws( - function () { - var params = { - metadata: METADATA, - access: ACCESS, - body: -1, - auth: AUTH - } - client.publish(URI, params, nop) - }, - { - name: 'AssertionError', - message: 'package body passed to publish must be a stream' - }, - 'body must be a Stream' - ) - - t.test('malformed semver in publish', function (t) { - var metadata = JSON.parse(JSON.stringify(METADATA)) - metadata.version = '%!@#$' - var params = { - metadata: metadata, - access: ACCESS, - message: BODY, - auth: AUTH - } - client.publish(URI, params, function (err) { - t.equal( - err && err.message, - 'invalid semver: %!@#$', - 'got expected semver validation failure' - ) - t.end() - }) - }) - - t.end() -}) - -test('publish', function (t) { - var pd = fs.readFileSync(BODY_PATH) - - server.expect('/npm-registry-client', function (req, res) { - t.equal(req.method, 'PUT') - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var o = JSON.parse(b) - t.equal(o._id, 'npm-registry-client') - t.equal(o['dist-tags'].latest, METADATA.version) - t.equal(o.access, ACCESS) - t.has(o.versions[METADATA.version], METADATA) - t.same(o.maintainers, [{ name: 'username', email: 'i@izs.me' }]) - t.same(o.maintainers, o.versions[METADATA.version].maintainers) - - var att = o._attachments[METADATA.name + '-' + METADATA.version + '.tgz'] - t.same(att.data, pd.toString('base64')) - - var hash = crypto.createHash('sha1').update(pd).digest('hex') - t.equal(o.versions[METADATA.version].dist.shasum, hash) - - res.statusCode = 201 - res.json({ created: true }) - }) - }) - - client.publish(URI, PARAMS, function (er, data) { - if (er) throw er - - t.deepEqual(data, { created: true }) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/redirects.js b/deps/npm/node_modules/npm-registry-client/test/redirects.js deleted file mode 100644 index 2da565769b..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/redirects.js +++ /dev/null @@ -1,56 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var pkg = { - _id: 'some-package@1.2.3', - name: 'some-package', - version: '1.2.3' -} - -test('basic request', function (t) { - // Expect one request for { follow : false } - server.expect('/-/some-package/1.2.3', function (req, res) { - res.writeHead(301, { - 'Location': '/some-package/1.2.3' - }) - res.end('Redirecting') - }) - - // Expect 2 requests for { follow : true } - server.expect('/-/some-package/1.2.3', function (req, res) { - res.writeHead(301, { - 'Location': '/some-package/1.2.3' - }) - res.end('Redirecting') - }) - - server.expect('/some-package/1.2.3', function (req, res) { - res.json(pkg) - }) - - t.plan(2) - - client.get( - 'http://localhost:1337/-/some-package/1.2.3', - { follow: false }, - function (er) { - t.ok(er, 'Error must be set') - } - ) - - client.get( - 'http://localhost:1337/-/some-package/1.2.3', - { follow: true }, - function (er, data) { - t.deepEqual(data, pkg) - } - ) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js deleted file mode 100644 index 5e25214f25..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js +++ /dev/null @@ -1,61 +0,0 @@ -var zlib = require('zlib') -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient({ - retry: { - count: 1, - minTimeout: 10, - maxTimeout: 100 - } -}) - -var TEST_URL = common.registry + '/some-package-gzip/1.2.3' - -var pkg = { - _id: 'some-package-gzip@1.2.3', - name: 'some-package-gzip', - version: '1.2.3' -} - -zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { - test('request gzip package content', function (t) { - t.ifError(err, 'example package compressed') - - server.expect('GET', '/some-package-gzip/1.2.3', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Encoding', 'gzip') - res.setHeader('Content-Type', 'application/json') - res.end(pkgGzip) - }) - - client.get(TEST_URL, {}, function (er, data) { - if (er) throw er - t.deepEqual(data, pkg, 'some-package-gzip version 1.2.3') - t.end() - }) - }) - - test('request wrong gzip package content', function (t) { - // will retry 3 times - for (var i = 0; i < 3; i++) { - server.expect('GET', '/some-package-gzip/1.2.3', function (req, res) { - res.statusCode = 200 - res.setHeader('Content-Encoding', 'gzip') - res.setHeader('Content-Type', 'application/json') - res.end(new Buffer('wrong gzip content')) - }) - } - - client.get(TEST_URL, {}, function (er) { - t.ok(er, 'ungzip error') - t.end() - }) - }) - - test('cleanup', function (t) { - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/request.js b/deps/npm/node_modules/npm-registry-client/test/request.js deleted file mode 100644 index ed02f19722..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/request.js +++ /dev/null @@ -1,317 +0,0 @@ -var Readable = require('readable-stream').Readable -var inherits = require('util').inherits - -var test = require('tap').test -var concat = require('concat-stream') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function OneA () { - Readable.call(this) - this.push('A') - this.push(null) -} -inherits(OneA, Readable) - -function nop () {} - -var URI = 'http://localhost:1337/' -var USERNAME = 'username' -var PASSWORD = '%1234@asdf%' -var EMAIL = 'i@izs.me' -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { auth: AUTH } - -test('request call contract', function (t) { - t.throws( - function () { - client.request(undefined, PARAMS, nop) - }, - { name: 'AssertionError', message: 'must pass uri to request' }, - 'requires a URI' - ) - - t.throws( - function () { - client.request([], PARAMS, nop) - }, - { name: 'AssertionError', message: 'must pass uri to request' }, - 'requires URI to be a string' - ) - - t.throws( - function () { - client.request(URI, undefined, nop) - }, - { name: 'AssertionError', message: 'must pass params to request' }, - 'requires params object' - ) - - t.throws( - function () { - client.request(URI, '', nop) - }, - { name: 'AssertionError', message: 'must pass params to request' }, - 'params must be object' - ) - - t.throws( - function () { - client.request(URI, PARAMS, undefined) - }, - { name: 'AssertionError', message: 'must pass callback to request' }, - 'requires callback' - ) - - t.throws( - function () { - client.request(URI, PARAMS, 'callback') - }, - { name: 'AssertionError', message: 'must pass callback to request' }, - 'callback must be function' - ) - - t.end() -}) - -test('run request through its paces', function (t) { - t.plan(34) - - server.expect('/request-defaults', function (req, res) { - t.equal(req.method, 'GET', 'uses GET by default') - - req.pipe(concat(function (d) { - t.notOk(d.toString('utf7'), 'no data included in request') - - res.statusCode = 200 - res.json({ fetched: 'defaults' }) - })) - }) - - server.expect('/last-modified', function (req, res) { - t.equal(req.headers['if-modified-since'], 'test-last-modified', - 'got test if-modified-since') - - res.statusCode = 200 - res.json({ fetched: 'last-modified' }) - }) - - server.expect('/etag', function (req, res) { - t.equal(req.headers['if-none-match'], 'test-etag', 'got test etag') - - res.statusCode = 200 - res.json({ fetched: 'etag' }) - }) - - server.expect('POST', '/etag-post', function (req, res) { - t.equal(req.headers['if-match'], 'post-etag', 'got test post etag') - - res.statusCode = 200 - res.json({ posted: 'etag' }) - }) - - server.expect('PUT', '/body-stream', function (req, res) { - req.pipe(concat(function (d) { - t.equal(d.toString('utf8'), 'A', 'streamed expected data') - - res.statusCode = 200 - res.json({ put: 'stream' }) - })) - }) - - server.expect('PUT', '/body-buffer', function (req, res) { - req.pipe(concat(function (d) { - t.equal(d.toString('utf8'), 'hi', 'streamed expected data') - - res.statusCode = 200 - res.json({ put: 'buffer' }) - })) - }) - - server.expect('PUT', '/body-string', function (req, res) { - req.pipe(concat(function (d) { - t.equal(d.toString('utf8'), 'erp', 'streamed expected data') - - res.statusCode = 200 - res.json({ put: 'string' }) - })) - }) - - server.expect('PUT', '/body-object', function (req, res) { - req.pipe(concat(function (d) { - t.equal(d.toString('utf8'), '["tricky"]', 'streamed expected data') - - res.statusCode = 200 - res.json({ put: 'object' }) - })) - }) - - server.expect('GET', '/body-error-string', function (req, res) { - req.pipe(concat(function () { - res.statusCode = 200 - res.json({ error: 'not really an error', reason: 'unknown' }) - })) - }) - - server.expect('GET', '/body-error-object', function (req, res) { - req.pipe(concat(function () { - res.statusCode = 200 - res.json({ error: {} }) - })) - }) - - server.expect('GET', '/@scoped%2Fpackage-failing', function (req, res) { - req.pipe(concat(function () { - res.statusCode = 402 - res.json({ error: 'payment required' }) - })) - }) - - server.expect('GET', '/not-found-no-body', function (req, res) { - req.pipe(concat(function () { - res.statusCode = 404 - res.end() - })) - }) - - var defaults = {} - client.request( - common.registry + '/request-defaults', - defaults, - function (er, data, raw, response) { - t.ifError(er, 'call worked') - t.deepEquals(data, { fetched: 'defaults' }, 'confirmed defaults work') - t.equal(response.headers.connection, 'keep-alive', 'keep-alive set') - } - ) - - var lastModified = { lastModified: 'test-last-modified' } - client.request(common.registry + '/last-modified', lastModified, function (er, data) { - t.ifError(er, 'call worked') - t.deepEquals(data, { fetched: 'last-modified' }, 'last-modified request sent') - }) - - var etagged = { etag: 'test-etag' } - client.request(common.registry + '/etag', etagged, function (er, data) { - t.ifError(er, 'call worked') - t.deepEquals(data, { fetched: 'etag' }, 'etag request sent') - }) - - var postEtagged = { - method: 'post', - etag: 'post-etag' - } - client.request(common.registry + '/etag-post', postEtagged, function (er, data) { - t.ifError(er, 'call worked') - t.deepEquals(data, { posted: 'etag' }, 'POST etag request sent') - }) - - var putStream = { - method: 'PUT', - body: new OneA(), - auth: AUTH - } - client.request(common.registry + '/body-stream', putStream, function (er, data) { - t.ifError(er, 'call worked') - t.deepEquals(data, { put: 'stream' }, 'PUT request with stream sent') - }) - - var putBuffer = { - method: 'PUT', - body: new Buffer('hi'), - auth: AUTH - } - client.request(common.registry + '/body-buffer', putBuffer, function (er, data) { - t.ifError(er, 'call worked') - t.deepEquals(data, { put: 'buffer' }, 'PUT request with buffer sent') - }) - - var putString = { - method: 'PUT', - body: 'erp', - auth: AUTH - } - client.request(common.registry + '/body-string', putString, function (er, data) { - t.ifError(er, 'call worked') - t.deepEquals(data, { put: 'string' }, 'PUT request with string sent') - }) - - var putObject = { - method: 'PUT', - body: { toJSON: function () { return ['tricky'] } }, - auth: AUTH - } - client.request(common.registry + '/body-object', putObject, function (er, data) { - t.ifError(er, 'call worked') - t.deepEquals(data, { put: 'object' }, 'PUT request with object sent') - }) - - client.request(common.registry + '/body-error-string', defaults, function (er) { - t.equal( - er && er.message, - 'not really an error unknown: body-error-string', - 'call worked' - ) - }) - - client.request(common.registry + '/body-error-object', defaults, function (er) { - t.ifError(er, 'call worked') - }) - - client.request(common.registry + '/@scoped%2Fpackage-failing', defaults, function (er) { - t.equals(er.message, 'payment required : @scoped/package-failing') - }) - - client.request(common.registry + '/not-found-no-body', defaults, function (er) { - t.equals(er.message, '404 Not Found') - t.equals(er.statusCode, 404, 'got back 404 as .statusCode') - t.equals(er.code, 'E404', 'got back expected string code') - t.notOk(er.pkgid, "no package name returned when there's no body on response") - t.ok(typeof er !== 'string', "Error shouldn't be returned as string.") - }) -}) - -test('outputs notice if npm-notice header is set', function (t) { - var client = common.freshClient({ - log: { - error: noop, - warn: function (prefix, msg) { - warnings.push(msg) - }, - info: noop, - verbose: noop, - silly: noop, - http: noop, - pause: noop, - resume: noop - } - }) - var message = 'notice me!' - var warnings = [] - - function noop () {} - - server.expect('GET', '/npm-notice', function (req, res) { - req.pipe(concat(function () { - res.statusCode = 200 - res.setHeader('npm-notice', message) - res.end() - })) - }) - - client.request(common.registry + '/npm-notice', {}, function (er) { - t.notEqual(warnings.indexOf(message), -1, 'notice not printed') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/retries.js b/deps/npm/node_modules/npm-registry-client/test/retries.js deleted file mode 100644 index a75cbf7e02..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/retries.js +++ /dev/null @@ -1,52 +0,0 @@ -var tap = require('tap') - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient({ - retry: { - retries: 6, - minTimeout: 10, - maxTimeout: 100 - } -}) - -var pkg = { - _id: 'some-package@1.2.3', - name: 'some-package', - version: '1.2.3' -} - -tap.test('create new user account', function (t) { - // first time, return a 408 - server.expect('GET', '/some-package/1.2.3', function (req, res) { - res.statusCode = 408 - res.end('Timeout') - }) - // then, slam the door in their face - server.expect('GET', '/some-package/1.2.3', function (req, res) { - res.destroy() - }) - // then, blame someone else - server.expect('GET', '/some-package/1.2.3', function (req, res) { - res.statusCode = 502 - res.end('Gateway Timeout') - }) - // 'No one's home right now, come back later' - server.expect('GET', '/some-package/1.2.3', function (req, res) { - res.statusCode = 503 - res.setHeader('retry-after', '10') - res.end('Come back later') - }) - // finally, you may enter. - server.expect('GET', '/some-package/1.2.3', function (req, res) { - res.statusCode = 200 - res.json(pkg) - }) - - client.get('http://localhost:1337/some-package/1.2.3', {}, function (er, data) { - if (er) throw er - t.deepEqual(data, pkg) - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/send-anon-metrics.js b/deps/npm/node_modules/npm-registry-client/test/send-anon-metrics.js deleted file mode 100644 index 7afa0542c4..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/send-anon-metrics.js +++ /dev/null @@ -1,78 +0,0 @@ -var test = require('tap').test - -var common = require('./lib/common.js') -var client = common.freshClient() -var server = require('./lib/server.js') - -function nop () {} - -var metricId = 'this-is-a-uuid' -var from = new Date() -var to = new Date() -var metricInfo = { - metricId: metricId, - metrics: [{ - from: from.toISOString(), - to: to.toISOString(), - successfulInstalls: 0, - failedInstalls: 1 - }] -} - -test('sendAnonymousCLIMetrics call contract', function (t) { - t.throws(function () { - client.sendAnonymousCLIMetrics(undefined, metricInfo, nop) - }, 'requires a URI') - - t.throws(function () { - client.sendAnonymousCLIMetrics([], metricInfo, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.sendAnonymousCLIMetrics(common.registry, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.sendAnonymousCLIMetrics(common.registry, '', nop) - }, 'params must be object') - - t.throws(function () { - client.sendAnonymousCLIMetrics(common.registry, metricInfo, undefined) - }, 'requires callback') - - t.throws(function () { - client.sendAnonymousCLIMetrics(common.registry, metricInfo, 'callback') - }, 'callback must be function') - - t.end() -}) - -test('sendAnonymousCLIMetrics', function (t) { - server.expect('PUT', '/-/npm/anon-metrics/v1/' + metricId, function (req, res) { - t.is(req.method, 'PUT') - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var d = JSON.parse(b) - t.isDeeply(d, metricInfo.metrics, 'PUT received metrics') - - res.statusCode = 200 - res.json({}) - }) - }) - - client.sendAnonymousCLIMetrics(common.registry, metricInfo, function (err, res) { - t.ifError(err, 'no errors') - t.isDeeply(res, {}, 'result ok') - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/star.js b/deps/npm/node_modules/npm-registry-client/test/star.js deleted file mode 100644 index e9e60266da..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/star.js +++ /dev/null @@ -1,176 +0,0 @@ -var test = require('tap').test -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() -var cache = require('./fixtures/underscore/cache.json') -var nock = require('nock') - -function nop () {} - -var URI = 'https://npm.registry:8043/rewrite' -var STARRED = true -var USERNAME = 'username' -var PASSWORD = '%1234@asdf%' -var EMAIL = 'i@izs.me' -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { - starred: STARRED, - auth: AUTH -} - -test('star call contract', function (t) { - t.throws(function () { - client.star(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - client.star([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.star(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.star(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.star(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.star(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { starred: STARRED } - client.star(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to star' }, - 'params must include auth' - ) - - t.end() -}) - -test('star a package', function (t) { - server.expect('GET', '/underscore?write=true', function (req, res) { - t.equal(req.method, 'GET') - - res.json(cache) - }) - - server.expect('PUT', '/underscore', function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var updated = JSON.parse(b) - - var already = [ - 'vesln', 'mvolkmann', 'lancehunt', 'mikl', 'linus', 'vasc', 'bat', - 'dmalam', 'mbrevoort', 'danielr', 'rsimoes', 'thlorenz' - ] - for (var i = 0; i < already.length; i++) { - var current = already[i] - t.ok( - updated.users[current], - current + ' still likes this package' - ) - } - t.ok(updated.users[USERNAME], 'user is in the starred list') - - res.statusCode = 201 - res.json({ starred: true }) - }) - }) - - var params = { starred: STARRED, auth: AUTH } - - client.star('http://localhost:1337/underscore', params, function (er, data) { - t.ifError(er, 'no errors') - t.ok(data.starred, 'was starred') - - t.end() - }) -}) - -test('if password auth, only sets authorization on put', function (t) { - var starGet = nock('http://localhost:1010') - .get('/underscore?write=true') - .reply(200, {}) - - var starPut = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Basic ' + new Buffer(AUTH.username + ':' + - AUTH.password).toString('base64') - } - }) - .put('/underscore') - .reply(200) - - var params = { starred: STARRED, auth: AUTH } - - client.star('http://localhost:1010/underscore', params, function (er) { - t.ifError(er, 'starred without issues') - starGet.done() - starPut.done() - t.end() - }) -}) - -test('if token auth, sets bearer on get and put', function (t) { - var starGet = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Bearer foo' - } - }) - .get('/underscore?write=true') - .reply(200, {}) - - var getUser = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Bearer foo' - } - }) - .get('/-/whoami') - .reply(200, { username: 'bcoe' }) - - var starPut = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Bearer foo' - } - }) - .put('/underscore') - .reply(200) - - var params = { - starred: STARRED, - auth: { - token: 'foo' - } - } - client.star('http://localhost:1010/underscore', params, function (er) { - t.ifError(er, 'starred without error') - starGet.done() - starPut.done() - getUser.done() - t.end() - }) -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/stars.js b/deps/npm/node_modules/npm-registry-client/test/stars.js deleted file mode 100644 index a5e713c58e..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/stars.js +++ /dev/null @@ -1,81 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var URI = 'https://npm.registry:8043/rewrite' -var USERNAME = 'sample' -var PASSWORD = '%1234@asdf%' -var EMAIL = 'i@izs.me' -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { - username: USERNAME, - auth: AUTH -} -var USERS = [ - 'benjamincoe', - 'seldo', - 'ceejbot' -] - -test('stars call contract', function (t) { - t.throws(function () { - client.stars(undefined, PARAMS, nop) - }, 'requires a URI') - - t.throws(function () { - client.stars([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.stars(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.stars(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.stars(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.stars(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.test('no username anywhere', function (t) { - var params = {} - client.stars(URI, params, function (err) { - t.equal( - err && err.message, - 'must pass either username or auth to stars', - 'username must not be empty') - t.end() - }) - }) - - t.end() -}) - -test('get the stars for a package', function (t) { - server.expect('GET', '/-/_view/starredByUser?key=%22sample%22', function (req, res) { - t.equal(req.method, 'GET') - - res.json(USERS) - }) - - client.stars('http://localhost:1337/', PARAMS, function (er, info) { - t.ifError(er, 'no errors') - t.deepEqual(info, USERS, 'got the list of users') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/tag.js b/deps/npm/node_modules/npm-registry-client/test/tag.js deleted file mode 100644 index e10490ee6c..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/tag.js +++ /dev/null @@ -1,108 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var URI = 'http://localhost:1337/underscore' -var USERNAME = 'username' -var PASSWORD = '%1234@asdf%' -var EMAIL = 'i@izs.me' -var VERSION = '1.3.2' -var TAG = 'not-lodash' -var AUTH = { - username: USERNAME, - password: PASSWORD, - email: EMAIL -} -var PARAMS = { - tag: TAG, - version: VERSION, - auth: AUTH -} - -test('tag call contract', function (t) { - t.throws(function () { - client.tag(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.tag([], AUTH, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.tag(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.tag(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.tag(URI, AUTH, undefined) - }, 'requires callback') - - t.throws(function () { - client.tag(URI, AUTH, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { tag: TAG, auth: AUTH } - client.tag(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass version to tag' }, - 'tag must include version' - ) - - t.throws( - function () { - var params = { version: VERSION, auth: AUTH } - client.tag(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass tag name to tag' }, - 'tag must include name' - ) - - t.throws( - function () { - var params = { version: VERSION, tag: TAG } - client.tag(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to tag' }, - 'params must include auth' - ) - - t.end() -}) - -test('tag a package', function (t) { - server.expect('PUT', '/underscore/not-lodash', function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var updated = JSON.parse(b) - - t.deepEqual(updated, '1.3.2') - - res.statusCode = 201 - res.json({ tagged: true }) - }) - }) - - client.tag(URI, PARAMS, function (error, data) { - t.ifError(error, 'no errors') - t.ok(data.tagged, 'was tagged') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/team.js b/deps/npm/node_modules/npm-registry-client/test/team.js deleted file mode 100644 index ffbd18fc83..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/team.js +++ /dev/null @@ -1,215 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var URI = 'http://localhost:1337' -var PARAMS = { - auth: { - token: 'foo' - }, - scope: 'myorg', - team: 'myteam' -} - -var commands = ['create', 'destroy', 'add', 'rm', 'ls'] - -test('team create basic', function (t) { - var teamData = { - name: PARAMS.team, - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: null - } - server.expect('PUT', '/-/org/myorg/team', function (req, res) { - t.equal(req.method, 'PUT') - onJsonReq(req, function (json) { - t.same(json, { name: PARAMS.team }) - res.statusCode = 200 - res.json(teamData) - }) - }) - client.team('create', URI, PARAMS, function (err, data) { - t.ifError(err, 'no errors') - t.same(data, teamData) - t.end() - }) -}) - -test('team destroy', function (t) { - var teamData = { - name: 'myteam', - scope_id: 1234, - created: '2015-07-23T18:07:49.959Z', - updated: '2015-07-23T18:07:49.959Z', - deleted: '2015-07-23T18:27:27.178Z' - } - server.expect('DELETE', '/-/team/myorg/myteam', function (req, res) { - t.equal(req.method, 'DELETE') - onJsonReq(req, function (json) { - t.same(json, undefined) - res.statusCode = 200 - res.json(teamData) - }) - }) - client.team('destroy', URI, PARAMS, function (err, data) { - t.ifError(err, 'no errors') - t.same(data, teamData) - t.end() - }) -}) - -test('team add basic', function (t) { - var params = Object.create(PARAMS) - params.user = 'zkat' - server.expect('PUT', '/-/team/myorg/myteam/user', function (req, res) { - t.equal(req.method, 'PUT') - onJsonReq(req, function (json) { - t.same(json, { user: params.user }) - res.statusCode = 200 - res.json(undefined) - }) - }) - client.team('add', URI, params, function (err, data) { - t.ifError(err, 'no errors') - t.same(data, undefined) - t.end() - }) -}) - -test('team add user not in org', function (t) { - var params = Object.create(PARAMS) - params.user = 'zkat' - var errMsg = 'user is already in team' - server.expect('PUT', '/-/team/myorg/myteam/user', function (req, res) { - t.equal(req.method, 'PUT') - res.statusCode = 400 - res.json({ - error: errMsg - }) - }) - client.team('add', URI, params, function (err, data) { - t.equal(err.message, errMsg + ' : ' + '-/team/myorg/myteam/user') - t.same(data, {error: errMsg}) - t.end() - }) -}) - -test('team rm basic', function (t) { - var params = Object.create(PARAMS) - params.user = 'bcoe' - server.expect('DELETE', '/-/team/myorg/myteam/user', function (req, res) { - t.equal(req.method, 'DELETE') - onJsonReq(req, function (json) { - t.same(json, params) - res.statusCode = 200 - res.json(undefined) - }) - }) - client.team('rm', URI, params, function (err, data) { - t.ifError(err, 'no errors') - t.same(data, undefined) - t.end() - }) -}) - -test('team ls (on org)', function (t) { - var params = Object.create(PARAMS) - params.team = null - var teams = ['myorg:team1', 'myorg:team2', 'myorg:team3'] - server.expect('GET', '/-/org/myorg/team?format=cli', function (req, res) { - t.equal(req.method, 'GET') - onJsonReq(req, function (json) { - t.same(json, undefined) - res.statusCode = 200 - res.json(teams) - }) - }) - client.team('ls', URI, params, function (err, data) { - t.ifError(err, 'no errors') - t.same(data, teams) - t.end() - }) -}) - -test('team ls (on team)', function (t) { - var uri = '/-/team/myorg/myteam/user?format=cli' - var users = ['zkat', 'bcoe'] - server.expect('GET', uri, function (req, res) { - t.equal(req.method, 'GET') - onJsonReq(req, function (json) { - t.same(json, undefined) - res.statusCode = 200 - res.json(users) - }) - }) - client.team('ls', URI, PARAMS, function (err, data) { - t.ifError(err, 'no errors') - t.same(data, users) - t.end() - }) -}) - -// test('team edit', function (t) { -// server.expect('PUT', '/-/org/myorg/team', function (req, res) { -// t.equal(req.method, 'PUT') -// res.statusCode = 201 -// res.json({}) -// }) -// client.team('create', URI, PARAMS, function (err, data) { -// t.ifError(err, 'no errors') -// t.end() -// }) -// }) - -test('team command base validation', function (t) { - t.throws(function () { - client.team(undefined, URI, PARAMS, nop) - }, 'command is required') - commands.forEach(function (cmd) { - t.throws(function () { - client.team(cmd, undefined, PARAMS, nop) - }, 'registry URI is required') - t.throws(function () { - client.team(cmd, URI, undefined, nop) - }, 'params is required') - t.throws(function () { - client.team(cmd, URI, {scope: 'o', team: 't'}, nop) - }, 'auth is required') - t.throws(function () { - client.team(cmd, URI, {auth: {token: 'f'}, team: 't'}, nop) - }, 'scope is required') - t.throws(function () { - client.team(cmd, URI, PARAMS, {}) - }, 'callback must be a function') - if (cmd !== 'ls') { - t.throws(function () { - client.team( - cmd, URI, {auth: {token: 'f'}, scope: 'o'}, nop) - }, 'team name is required') - } - if (cmd === 'add' || cmd === 'rm') { - t.throws(function () { - client.team( - cmd, URI, PARAMS, nop) - }, 'user is required') - } - }) - t.end() -}) - -test('cleanup', function (t) { - server.close() - t.end() -}) - -function onJsonReq (req, cb) { - var buffer = '' - req.setEncoding('utf8') - req.on('data', function (data) { buffer += data }) - req.on('end', function () { cb(buffer ? JSON.parse(buffer) : undefined) }) -} diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js deleted file mode 100644 index 26d4ac7b16..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js +++ /dev/null @@ -1,68 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var cache = require('./fixtures/@npm/npm-registry-client/cache.json') - -var REV = '/-rev/213-0a1049cf56172b7d9a1184742c6477b9' -var PACKAGE = '/@npm%2fnpm-registry-client' -var URI = common.registry + PACKAGE -var TOKEN = 'of-glad-tidings' -var VERSION = '3.0.6' -var AUTH = { - token: TOKEN -} -var PARAMS = { - version: VERSION, - auth: AUTH -} - -test('unpublish a package', function (t) { - server.expect('GET', '/@npm%2fnpm-registry-client?write=true', function (req, res) { - t.equal(req.method, 'GET') - - res.json(cache) - }) - - server.expect('PUT', '/@npm%2fnpm-registry-client' + REV, function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf-8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var updated = JSON.parse(b) - t.notOk(updated.versions[VERSION]) - }) - - res.json(cache) - }) - - server.expect('GET', PACKAGE, function (req, res) { - t.equal(req.method, 'GET') - - res.json(cache) - }) - - server.expect( - 'DELETE', - PACKAGE + '/-' + PACKAGE + '-' + VERSION + '.tgz' + REV, - function (req, res) { - t.equal(req.method, 'DELETE') - - res.json({ unpublished: true }) - } - ) - - client.unpublish(URI, PARAMS, function (er) { - t.ifError(er, 'no errors') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish.js b/deps/npm/node_modules/npm-registry-client/test/unpublish.js deleted file mode 100644 index 8a114c899b..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish.js +++ /dev/null @@ -1,104 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -var cache = require('./fixtures/underscore/cache.json') - -function nop () {} - -var REV = '/-rev/72-47f2986bfd8e8b55068b204588bbf484' -var URI = 'http://localhost:1337/underscore' -var TOKEN = 'of-glad-tidings' -var VERSION = '1.3.2' -var AUTH = { - token: TOKEN -} -var PARAMS = { - version: VERSION, - auth: AUTH -} - -test('unpublish call contract', function (t) { - t.throws(function () { - client.unpublish(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.unpublish([], AUTH, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.unpublish(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.unpublish(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.unpublish(URI, AUTH, undefined) - }, 'requires callback') - - t.throws(function () { - client.unpublish(URI, AUTH, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - version: VERSION - } - client.unpublish(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to unpublish' }, - 'must pass auth to unpublish' - ) - - t.end() -}) - -test('unpublish a package', function (t) { - server.expect('GET', '/underscore?write=true', function (req, res) { - t.equal(req.method, 'GET') - - res.json(cache) - }) - - server.expect('PUT', '/underscore' + REV, function (req, res) { - t.equal(req.method, 'PUT') - - var b = '' - req.setEncoding('utf-8') - req.on('data', function (d) { - b += d - }) - - req.on('end', function () { - var updated = JSON.parse(b) - t.notOk(updated.versions[VERSION]) - }) - - res.json(cache) - }) - - server.expect('GET', '/underscore', function (req, res) { - t.equal(req.method, 'GET') - - res.json(cache) - }) - - server.expect('DELETE', '/underscore/-/underscore-1.3.2.tgz' + REV, function (req, res) { - t.equal(req.method, 'DELETE') - - res.json({ unpublished: true }) - }) - - client.unpublish(URI, PARAMS, function (error) { - t.ifError(error, 'no errors') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/whoami.js b/deps/npm/node_modules/npm-registry-client/test/whoami.js deleted file mode 100644 index 80979ee978..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/whoami.js +++ /dev/null @@ -1,70 +0,0 @@ -var test = require('tap').test - -var server = require('./lib/server.js') -var common = require('./lib/common.js') -var client = common.freshClient() - -function nop () {} - -var WHOIAM = 'wombat' -var TOKEN = 'not-bad-meaning-bad-but-bad-meaning-wombat' -var AUTH = { token: TOKEN } -var PARAMS = { auth: AUTH } - -test('whoami call contract', function (t) { - t.throws(function () { - client.whoami(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.whoami([], AUTH, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.whoami(common.registry, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.whoami(common.registry, '', nop) - }, 'params must be object') - - t.throws(function () { - client.whoami(common.registry, AUTH, undefined) - }, 'requires callback') - - t.throws(function () { - client.whoami(common.registry, AUTH, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = {} - client.whoami(common.registry, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to whoami' }, - 'must pass auth to whoami' - ) - - t.end() -}) - -test('whoami', function (t) { - server.expect('GET', '/-/whoami', function (req, res) { - t.equal(req.method, 'GET') - // only available for token-based auth for now - t.equal( - req.headers.authorization, - 'Bearer not-bad-meaning-bad-but-bad-meaning-wombat' - ) - - res.json({ username: WHOIAM }) - }) - - client.whoami(common.registry, PARAMS, function (error, wombat) { - t.ifError(error, 'no errors') - t.equal(wombat, WHOIAM, 'im a wombat') - - server.close() - t.end() - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js b/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js deleted file mode 100644 index 16e4ee8a1d..0000000000 --- a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -var join = require('path').join -var rimraf = require('rimraf') -var tap = require('tap') - -tap.test('teardown', function (t) { - rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { - if (er) throw er - t.pass('cache cleaned') - t.end() - }) -}) diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json index 4d774accaa..d25c73197b 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json @@ -32,7 +32,7 @@ "_requiredBy": [ "/npmlog" ], - "_resolved": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", "_shrinkwrap": null, "_spec": "are-we-there-yet@~1.1.2", @@ -56,7 +56,7 @@ "directories": {}, "dist": { "shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", - "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz" + "tarball": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz" }, "gitHead": "dd5706e2204cb681e78031d0ffe156ed4cc75823", "homepage": "https://github.com/iarna/are-we-there-yet", diff --git a/deps/npm/node_modules/opener/README.md b/deps/npm/node_modules/opener/README.md new file mode 100644 index 0000000000..8a803f3384 --- /dev/null +++ b/deps/npm/node_modules/opener/README.md @@ -0,0 +1,57 @@ +# It Opens Stuff + +That is, in your desktop environment. This will make *actual windows pop up*, with stuff in them: + +```bash +npm install opener -g + +opener http://google.com +opener ./my-file.txt +opener firefox +opener npm run lint +``` + +Also if you want to use it programmatically you can do that too: + +```js +var opener = require("opener"); + +opener("http://google.com"); +opener("./my-file.txt"); +opener("firefox"); +opener("npm run lint"); +``` + +Plus, it returns the child process created, so you can do things like let your script exit while the window stays open: + +```js +var editor = opener("documentation.odt"); +editor.unref(); +// These other unrefs may be necessary if your OS's opener process +// exits before the process it started is complete. +editor.stdin.unref(); +editor.stdout.unref(); +editor.stderr.unref(); +``` + + +## Use It for Good + +Like opening the user's browser with a test harness in your package's test script: + +```json +{ + "scripts": { + "test": "opener ./test/runner.html" + }, + "devDependencies": { + "opener": "*" + } +} +``` + +## Why + +Because Windows has `start`, Macs have `open`, and *nix has `xdg-open`. At least +[according to some guy on StackOverflow](http://stackoverflow.com/q/1480971/3191). And I like things that work on all +three. Like Node.js. And Opener. diff --git a/deps/npm/node_modules/opener/package.json b/deps/npm/node_modules/opener/package.json index eb454487e1..27d4433ab4 100644 --- a/deps/npm/node_modules/opener/package.json +++ b/deps/npm/node_modules/opener/package.json @@ -2,39 +2,39 @@ "_args": [ [ { - "raw": "opener@1.4.2", + "raw": "opener@1.4.3", "scope": null, "escapedName": "opener", "name": "opener", - "rawSpec": "1.4.2", - "spec": "1.4.2", + "rawSpec": "1.4.3", + "spec": "1.4.3", "type": "version" }, "/Users/rebecca/code/npm" ] ], - "_from": "opener@1.4.2", - "_id": "opener@1.4.2", + "_from": "opener@1.4.3", + "_id": "opener@1.4.3", "_inCache": true, "_location": "/opener", - "_nodeVersion": "6.2.2", + "_nodeVersion": "7.2.1", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/opener-1.4.2.tgz_1473551216353_0.850118016358465" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/opener-1.4.3.tgz_1487118807602_0.517438261769712" }, "_npmUser": { "name": "domenic", "email": "d@domenic.me" }, - "_npmVersion": "3.9.5", + "_npmVersion": "3.10.10", "_phantomChildren": {}, "_requested": { - "raw": "opener@1.4.2", + "raw": "opener@1.4.3", "scope": null, "escapedName": "opener", "name": "opener", - "rawSpec": "1.4.2", - "spec": "1.4.2", + "rawSpec": "1.4.3", + "spec": "1.4.3", "type": "version" }, "_requiredBy": [ @@ -42,10 +42,10 @@ "/", "/tap" ], - "_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.2.tgz", - "_shasum": "b32582080042af8680c389a499175b4c54fff523", + "_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz", + "_shasum": "5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8", "_shrinkwrap": null, - "_spec": "opener@1.4.2", + "_spec": "opener@1.4.3", "_where": "/Users/rebecca/code/npm", "author": { "name": "Domenic Denicola", @@ -65,13 +65,13 @@ }, "directories": {}, "dist": { - "shasum": "b32582080042af8680c389a499175b4c54fff523", - "tarball": "https://registry.npmjs.org/opener/-/opener-1.4.2.tgz" + "shasum": "5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8", + "tarball": "https://registry.npmjs.org/opener/-/opener-1.4.3.tgz" }, "files": [ "opener.js" ], - "gitHead": "ef28bf7c20de6cea3ff0e9bf0294a78c237e716d", + "gitHead": "51a4058b9e5172d9b57fb5e5205bc3f7fb4ace6a", "homepage": "https://github.com/domenic/opener#readme", "license": "(WTFPL OR MIT)", "main": "opener.js", @@ -91,5 +91,5 @@ "scripts": { "lint": "jshint opener.js" }, - "version": "1.4.2" + "version": "1.4.3" } diff --git a/deps/npm/node_modules/read-installed/node_modules/util-extend/extend.js b/deps/npm/node_modules/read-installed/node_modules/util-extend/extend.js index ad1f4d5b9e..de9fcf471a 100644 --- a/deps/npm/node_modules/read-installed/node_modules/util-extend/extend.js +++ b/deps/npm/node_modules/read-installed/node_modules/util-extend/extend.js @@ -19,27 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - module.exports = extend; function extend(origin, add) { // Don't do anything if add isn't an object diff --git a/deps/npm/node_modules/read-package-json/README.md b/deps/npm/node_modules/read-package-json/README.md index 05ba112ccb..da1f63dc88 100644 --- a/deps/npm/node_modules/read-package-json/README.md +++ b/deps/npm/node_modules/read-package-json/README.md @@ -67,12 +67,6 @@ independent. Mix and match! -## readJson.cache - -The `lru-cache` object that readJson uses to not read the same file over -and over again. See -[lru-cache](https://github.com/isaacs/node-lru-cache) for details. - ## Other Relevant Files Besides `package.json` Some other files have an effect on the resulting data object, in the diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE deleted file mode 100644 index 19129e315f..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/README.md deleted file mode 100644 index 6960483bac..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/README.md +++ /dev/null @@ -1,359 +0,0 @@ -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* `cb` `{Function}` - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` `{String}` Pattern to be matched -* `options` `{Object}` -* return: `{Array}` filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` `{String}` pattern to search for -* `options` `{Object}` -* `cb` `{Function}` Called when an error occurs, or matches are found - * `err` `{Error | null}` - * `matches` `{Array}` filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'FILE'` - Path exists, and is not a directory - * `'DIR'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the specific - thing that matched. It is not deduplicated or resolved to a realpath. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of glob patterns to exclude matches. - Note: `ignore` patterns are *always* in `dot:true` mode, regardless - of any other settings. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -### Comments and Negation - -Previously, this module let you mark a pattern as a "comment" if it -started with a `#` character, or a "negated" pattern if it started -with a `!` character. - -These options were deprecated in version 5, and removed in version 6. - -To specify things that should not match, use the `ignore` option. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/common.js b/deps/npm/node_modules/read-package-json/node_modules/glob/common.js deleted file mode 100644 index c9127eb334..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/common.js +++ /dev/null @@ -1,226 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var isAbsolute = require("path-is-absolute") -var Minimatch = minimatch.Minimatch - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - return !(/\/$/.test(e)) - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js deleted file mode 100644 index a62da27ebd..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js +++ /dev/null @@ -1,765 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - var n = this.minimatch.set.length - this._processing = 0 - this.matches = new Array(n) - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - - function done () { - --self._processing - if (self._processing <= 0) - self._finish() - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - fs.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (this.matches[index][e]) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = this._makeAbs(e) - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - if (this.mark) - e = this._mark(e) - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er) - return cb() - - var isSym = lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && !stat.isDirectory()) - return cb(null, false, stat) - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return cb() - - return cb(null, c, stat) -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e315f..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index ad72b8133e..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,209 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instantiating the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index 5b5f8cf444..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,923 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } - - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md deleted file mode 100644 index 179392978d..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js deleted file mode 100644 index 955f27c817..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,201 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore deleted file mode 100644 index ae5d8c36ac..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -test -.gitignore -.travis.yml -Makefile -example.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md deleted file mode 100644 index 2cdc8e4148..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index 08e918c0db..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[
          , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index e8d8587020..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,58 +0,0 @@ -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index 743afb08f4..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "balanced-match@^0.4.1", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^0.4.1", - "spec": ">=0.4.1 <0.5.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ] - ], - "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.2", - "_inCache": true, - "_installable": true, - "_location": "/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "4.4.7", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" - }, - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "2.15.8", - "_phantomChildren": {}, - "_requested": { - "raw": "balanced-match@^0.4.1", - "scope": null, - "escapedName": "balanced-match", - "name": "balanced-match", - "rawSpec": "^0.4.1", - "spec": ">=0.4.1 <0.5.0", - "type": "range" - }, - "_requiredBy": [ - "/minimatch/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", - "_shrinkwrap": null, - "_spec": "balanced-match@^0.4.1", - "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "dependencies": {}, - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "devDependencies": { - "tape": "^4.6.0" - }, - "directories": {}, - "dist": { - "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" - }, - "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", - "homepage": "https://github.com/juliangruber/balanced-match", - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "balanced-match", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "test": "make test" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "0.4.2" -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml deleted file mode 100644 index f1d0f13c8a..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE deleted file mode 100644 index ee27ba4b44..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -This software is released under the MIT license: - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown deleted file mode 100644 index 408f70a1be..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +++ /dev/null @@ -1,62 +0,0 @@ -concat-map -========== - -Concatenative mapdashery. - -[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) - -[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) - -example -======= - -``` js -var concatMap = require('concat-map'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); -``` - -*** - -``` -[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] -``` - -methods -======= - -``` js -var concatMap = require('concat-map') -``` - -concatMap(xs, fn) ------------------ - -Return an array of concatenated elements by calling `fn(x, i)` for each element -`x` and each index `i` in the array `xs`. - -When `fn(x, i)` returns an array, its result will be concatenated with the -result array. If `fn(x, i)` returns anything else, that value will be pushed -onto the end of the result array. - -install -======= - -With [npm](http://npmjs.org) do: - -``` -npm install concat-map -``` - -license -======= - -MIT - -notes -===== - -This module was written while sitting high above the ground in a tree. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js deleted file mode 100644 index 33656217b6..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +++ /dev/null @@ -1,6 +0,0 @@ -var concatMap = require('../'); -var xs = [ 1, 2, 3, 4, 5, 6 ]; -var ys = concatMap(xs, function (x) { - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; -}); -console.dir(ys); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js deleted file mode 100644 index b29a7812e5..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json deleted file mode 100644 index 177d7a5f19..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "_args": [ - [ - "concat-map@0.0.1", - "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ], - [ - "concat-map@0.0.1", - "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ] - ], - "_from": "concat-map@0.0.1", - "_id": "concat-map@0.0.1", - "_inCache": true, - "_installable": true, - "_location": "/read-package-json/glob/minimatch/brace-expansion/concat-map", - "_npmUser": { - "email": "mail@substack.net", - "name": "substack" - }, - "_npmVersion": "1.3.21", - "_phantomChildren": {}, - "_requested": { - "name": "concat-map", - "raw": "concat-map@0.0.1", - "rawSpec": "0.0.1", - "scope": null, - "spec": "0.0.1", - "type": "version" - }, - "_requiredBy": [ - "/read-package-json/glob/minimatch/brace-expansion" - ], - "_shrinkwrap": null, - "_spec": "concat-map@0.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", - "author": { - "email": "mail@substack.net", - "name": "James Halliday", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "dependencies": {}, - "description": "concatenative mapdashery", - "devDependencies": { - "tape": "~2.4.0" - }, - "directories": { - "example": "example", - "test": "test" - }, - "dist": { - "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "homepage": "https://github.com/substack/node-concat-map", - "keywords": [ - "concat", - "concatMap", - "map", - "functional", - "higher-order" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "mail@substack.net", - "name": "substack" - } - ], - "name": "concat-map", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "browsers": { - "chrome": [ - 10, - 22 - ], - "ff": [ - 3.5, - 10, - 15 - ], - "ie": [ - 6, - 7, - 8, - 9 - ], - "opera": [ - 12 - ], - "safari": [ - 5.1 - ] - }, - "files": "test/*.js" - }, - "version": "0.0.1" -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js deleted file mode 100644 index fdbd7022f6..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +++ /dev/null @@ -1,39 +0,0 @@ -var concatMap = require('../'); -var test = require('tape'); - -test('empty or not', function (t) { - var xs = [ 1, 2, 3, 4, 5, 6 ]; - var ixes = []; - var ys = concatMap(xs, function (x, ix) { - ixes.push(ix); - return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; - }); - t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); - t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); - t.end(); -}); - -test('always something', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('scalars', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function (x) { - return x === 'b' ? [ 'B', 'B', 'B' ] : x; - }); - t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); - t.end(); -}); - -test('undefs', function (t) { - var xs = [ 'a', 'b', 'c', 'd' ]; - var ys = concatMap(xs, function () {}); - t.same(ys, [ undefined, undefined, undefined, undefined ]); - t.end(); -}); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json deleted file mode 100644 index e1ab2e2c70..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "brace-expansion@^1.0.0", - "scope": null, - "escapedName": "brace-expansion", - "name": "brace-expansion", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch" - ] - ], - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.6", - "_inCache": true, - "_installable": true, - "_location": "/minimatch/brace-expansion", - "_nodeVersion": "4.4.7", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" - }, - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "2.15.8", - "_phantomChildren": {}, - "_requested": { - "raw": "brace-expansion@^1.0.0", - "scope": null, - "escapedName": "brace-expansion", - "name": "brace-expansion", - "rawSpec": "^1.0.0", - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/minimatch" - ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", - "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", - "_shrinkwrap": null, - "_spec": "brace-expansion@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "dependencies": { - "balanced-match": "^0.4.1", - "concat-map": "0.0.1" - }, - "description": "Brace expansion as known from sh/bash", - "devDependencies": { - "tape": "^4.6.0" - }, - "directories": {}, - "dist": { - "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" - }, - "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", - "homepage": "https://github.com/juliangruber/brace-expansion", - "keywords": [], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - } - ], - "name": "brace-expansion", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "scripts": { - "gentest": "bash test/generate.sh", - "test": "tape test/*.js" - }, - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.1.6" -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index 46bf2540ca..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "minimatch@2 || 3", - "scope": null, - "escapedName": "minimatch", - "name": "minimatch", - "rawSpec": "2 || 3", - "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob" - ] - ], - "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "minimatch@3.0.3", - "_inCache": true, - "_installable": true, - "_location": "/minimatch", - "_nodeVersion": "4.4.4", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" - }, - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.10.6", - "_phantomChildren": {}, - "_requested": { - "raw": "minimatch@2 || 3", - "scope": null, - "escapedName": "minimatch", - "name": "minimatch", - "rawSpec": "2 || 3", - "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "#USER", - "/" - ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", - "_shrinkwrap": null, - "_spec": "minimatch@2 || 3", - "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "description": "a glob matcher in javascript", - "devDependencies": { - "standard": "^3.7.2", - "tap": "^5.6.0" - }, - "directories": {}, - "dist": { - "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", - "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" - }, - "engines": { - "node": "*" - }, - "files": [ - "minimatch.js" - ], - "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", - "homepage": "https://github.com/isaacs/minimatch#readme", - "license": "ISC", - "main": "minimatch.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "minimatch", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js" - }, - "version": "3.0.3" -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js deleted file mode 100644 index 19f103f908..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js +++ /dev/null @@ -1,20 +0,0 @@ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -}; - -function win32(path) { - // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = !!device && device.charAt(1) !== ':'; - - // UNC paths are always absolute - return !!result[2] || isUnc; -}; - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json deleted file mode 100644 index 2bff7fef55..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "_args": [ - [ - "path-is-absolute@^1.0.0", - "/Users/rebecca/code/npm/node_modules/glob" - ], - [ - "path-is-absolute@^1.0.0", - "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob" - ] - ], - "_from": "path-is-absolute@>=1.0.0 <2.0.0", - "_id": "path-is-absolute@1.0.0", - "_inCache": true, - "_installable": true, - "_location": "/read-package-json/glob/path-is-absolute", - "_nodeVersion": "0.12.0", - "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - }, - "_npmVersion": "2.5.1", - "_phantomChildren": {}, - "_requested": { - "name": "path-is-absolute", - "raw": "path-is-absolute@^1.0.0", - "rawSpec": "^1.0.0", - "scope": null, - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/read-package-json/glob" - ], - "_shrinkwrap": null, - "_spec": "path-is-absolute@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob", - "author": { - "email": "sindresorhus@gmail.com", - "name": "Sindre Sorhus", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/path-is-absolute/issues" - }, - "dependencies": {}, - "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", - "homepage": "https://github.com/sindresorhus/path-is-absolute", - "keywords": [ - "path", - "paths", - "file", - "dir", - "absolute", - "isabsolute", - "is-absolute", - "built-in", - "util", - "utils", - "core", - "ponyfill", - "polyfill", - "shim", - "is", - "detect", - "check" - ], - "license": "MIT", - "maintainers": [ - { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - } - ], - "name": "path-is-absolute", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/path-is-absolute.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md deleted file mode 100644 index cdf94f4309..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) - -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method - - -## Install - -``` -$ npm install --save path-is-absolute -``` - - -## Usage - -```js -var pathIsAbsolute = require('path-is-absolute'); - -// Linux -pathIsAbsolute('/home/foo'); -//=> true - -// Windows -pathIsAbsolute('C:/Users/'); -//=> true - -// Any OS -pathIsAbsolute.posix('/home/foo'); -//=> true -``` - - -## API - -See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). - -### pathIsAbsolute(path) - -### pathIsAbsolute.posix(path) - -The Posix specific version. - -### pathIsAbsolute.win32(path) - -The Windows specific version. - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/package.json deleted file mode 100644 index 6070250b20..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - "glob@^6.0.0", - "/Users/rebecca/code/npm/node_modules/read-package-json" - ] - ], - "_from": "glob@>=6.0.0 <7.0.0", - "_id": "glob@6.0.4", - "_inCache": true, - "_installable": true, - "_location": "/read-package-json/glob", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "glob", - "raw": "glob@^6.0.0", - "rawSpec": "^6.0.0", - "scope": null, - "spec": ">=6.0.0 <7.0.0", - "type": "range" - }, - "_requiredBy": [ - "/read-package-json" - ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", - "_shrinkwrap": null, - "_spec": "glob@^6.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/read-package-json", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "description": "a little globber", - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^5.0.0", - "tick": "0.0.6" - }, - "directories": {}, - "dist": { - "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", - "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" - }, - "engines": { - "node": "*" - }, - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", - "homepage": "https://github.com/isaacs/node-glob#readme", - "license": "ISC", - "main": "glob.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "glob", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "scripts": { - "bench": "bash benchmark.sh", - "benchclean": "node benchclean.js", - "prepublish": "npm run benchclean", - "prof": "bash prof.sh && cat profile.txt", - "profclean": "rm -f v8.log profile.txt", - "test": "tap test/*.js --cov", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" - }, - "version": "6.0.4" -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js deleted file mode 100644 index 09883d2ce0..0000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js +++ /dev/null @@ -1,460 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var isAbsolute = require('path-is-absolute') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = fs.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this.matches[index][e] = true - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - var abs = this._makeAbs(e) - if (this.mark) - e = this._mark(e) - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[this._makeAbs(e)] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - // lstat failed, doesn't exist - return null - } - - var isSym = lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this.matches[index][prefix] = true -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - return false - } - - if (lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index 28ee2746bf..2c1fe2d46c 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -1,93 +1,98 @@ { "_args": [ [ - "read-package-json@~2.0.3", - "/Users/rebecca/code/npm" + { + "raw": "read-package-json@latest", + "scope": null, + "escapedName": "read-package-json", + "name": "read-package-json", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "read-package-json@>=2.0.3 <2.1.0", - "_id": "read-package-json@2.0.4", + "_from": "read-package-json@latest", + "_id": "read-package-json@2.0.5", "_inCache": true, - "_installable": true, "_location": "/read-package-json", - "_nodeVersion": "5.6.0", + "_nodeVersion": "7.7.1", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/read-package-json-2.0.4.tgz_1461711438155_0.03128739935345948" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/read-package-json-2.0.5.tgz_1488934143541_0.7550096816848963" }, "_npmUser": { - "email": "kat@sykosomatic.org", - "name": "zkat" - }, - "_npmVersion": "3.8.7", - "_phantomChildren": { - "inflight": "1.0.4", - "inherits": "2.0.1", - "once": "1.3.3" + "name": "zkat", + "email": "kat@sykosomatic.org" }, + "_npmVersion": "4.1.2", + "_phantomChildren": {}, "_requested": { - "name": "read-package-json", - "raw": "read-package-json@~2.0.3", - "rawSpec": "~2.0.3", + "raw": "read-package-json@latest", "scope": null, - "spec": ">=2.0.3 <2.1.0", - "type": "range" + "escapedName": "read-package-json", + "name": "read-package-json", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ + "#USER", "/", "/init-package-json", "/read-installed", "/read-package-tree" ], - "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.4.tgz", - "_shasum": "61ed1b2256ea438d8008895090be84b8e799c853", + "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.5.tgz", + "_shasum": "f93a64e641529df68a08c64de46389e8a3f88845", "_shrinkwrap": null, - "_spec": "read-package-json@~2.0.3", - "_where": "/Users/rebecca/code/npm", + "_spec": "read-package-json@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { "url": "https://github.com/npm/read-package-json/issues" }, "dependencies": { - "glob": "^6.0.0", + "glob": "^7.1.1", "graceful-fs": "^4.1.2", "json-parse-helpfulerror": "^1.0.2", "normalize-package-data": "^2.0.0" }, "description": "The thing npm uses to read package.json files with semantics and defaults and validation", "devDependencies": { - "standard": "^5.3.1", - "tap": "^1.2.0" + "standard": "^9.0.1", + "tap": "^10.3.0" }, "directories": {}, "dist": { - "shasum": "61ed1b2256ea438d8008895090be84b8e799c853", - "tarball": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.4.tgz" + "shasum": "f93a64e641529df68a08c64de46389e8a3f88845", + "tarball": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.5.tgz" }, - "gitHead": "de5172a8ada18a2a906294216e22206bfa13321d", + "gitHead": "0b03bd75bda0540de4102b543b94ccaf3fb7c034", "homepage": "https://github.com/npm/read-package-json#readme", "license": "ISC", "main": "read-json.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "read-package-json", @@ -100,7 +105,7 @@ "url": "git+https://github.com/npm/read-package-json.git" }, "scripts": { - "test": "standard && tap test/*.js" + "test": "standard && tap -J test/*.js" }, - "version": "2.0.4" + "version": "2.0.5" } diff --git a/deps/npm/node_modules/read-package-json/read-json.js b/deps/npm/node_modules/read-package-json/read-json.js index b1888956c8..26986b2616 100644 --- a/deps/npm/node_modules/read-package-json/read-json.js +++ b/deps/npm/node_modules/read-package-json/read-json.js @@ -137,7 +137,7 @@ function scriptpath_ (key) { // This is never allowed, and only causes problems if (typeof s !== 'string') return delete this[key] - var spre = /^(\.[\/\\])?node_modules[\/\\].bin[\\\/]/ + var spre = /^(\.[/\\])?node_modules[/\\].bin[\\/]/ if (s.match(spre)) { this[key] = this[key].replace(spre, '') } @@ -276,7 +276,7 @@ function bins (file, data, cb) { } function bins_ (file, data, bins, cb) { - var m = data.directories && data.directories.bin || '.' + var m = (data.directories && data.directories.bin) || '.' data.bin = bins.reduce(function (acc, mf) { if (mf && mf.charAt(0) !== '.') { var f = path.basename(mf) diff --git a/deps/npm/node_modules/read-package-json/test/fixtures/not-json.css b/deps/npm/node_modules/read-package-json/test/fixtures/not-json.css index 41c91e96af..1a1b5672d6 100644 --- a/deps/npm/node_modules/read-package-json/test/fixtures/not-json.css +++ b/deps/npm/node_modules/read-package-json/test/fixtures/not-json.css @@ -1,5 +1,5 @@ body { - height: yo mama + height: super tall } /**package @@ -33,5 +33,5 @@ body { **/ html { - width: so fat + width: wow so wide } diff --git a/deps/npm/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/readable-stream/.travis.yml index 84504c98f5..76b4b0cfcb 100644 --- a/deps/npm/node_modules/readable-stream/.travis.yml +++ b/deps/npm/node_modules/readable-stream/.travis.yml @@ -28,8 +28,8 @@ matrix: env: TASK=test - node_js: 6 env: TASK=test - - node_js: 5 - env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" + - node_js: 7 + env: TASK=test - node_js: 5 env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" - node_js: 5 diff --git a/deps/npm/node_modules/readable-stream/CONTRIBUTING.md b/deps/npm/node_modules/readable-stream/CONTRIBUTING.md new file mode 100644 index 0000000000..f478d58dca --- /dev/null +++ b/deps/npm/node_modules/readable-stream/CONTRIBUTING.md @@ -0,0 +1,38 @@ +# Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +* (a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +* (b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +* (c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +* (d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. + +## Moderation Policy + +The [Node.js Moderation Policy] applies to this WG. + +## Code of Conduct + +The [Node.js Code of Conduct][] applies to this WG. + +[Node.js Code of Conduct]: +https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md +[Node.js Moderation Policy]: +https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md diff --git a/deps/npm/node_modules/readable-stream/GOVERNANCE.md b/deps/npm/node_modules/readable-stream/GOVERNANCE.md new file mode 100644 index 0000000000..16ffb93f24 --- /dev/null +++ b/deps/npm/node_modules/readable-stream/GOVERNANCE.md @@ -0,0 +1,136 @@ +### Streams Working Group + +The Node.js Streams is jointly governed by a Working Group +(WG) +that is responsible for high-level guidance of the project. + +The WG has final authority over this project including: + +* Technical direction +* Project governance and process (including this policy) +* Contribution policy +* GitHub repository hosting +* Conduct guidelines +* Maintaining the list of additional Collaborators + +For the current list of WG members, see the project +[README.md](./README.md#current-project-team-members). + +### Collaborators + +The readable-stream GitHub repository is +maintained by the WG and additional Collaborators who are added by the +WG on an ongoing basis. + +Individuals making significant and valuable contributions are made +Collaborators and given commit-access to the project. These +individuals are identified by the WG and their addition as +Collaborators is discussed during the WG meeting. + +_Note:_ If you make a significant contribution and are not considered +for commit-access log an issue or contact a WG member directly and it +will be brought up in the next WG meeting. + +Modifications of the contents of the readable-stream repository are +made on +a collaborative basis. Anybody with a GitHub account may propose a +modification via pull request and it will be considered by the project +Collaborators. All pull requests must be reviewed and accepted by a +Collaborator with sufficient expertise who is able to take full +responsibility for the change. In the case of pull requests proposed +by an existing Collaborator, an additional Collaborator is required +for sign-off. Consensus should be sought if additional Collaborators +participate and there is disagreement around a particular +modification. See _Consensus Seeking Process_ below for further detail +on the consensus model used for governance. + +Collaborators may opt to elevate significant or controversial +modifications, or modifications that have not found consensus to the +WG for discussion by assigning the ***WG-agenda*** tag to a pull +request or issue. The WG should serve as the final arbiter where +required. + +For the current list of Collaborators, see the project +[README.md](./README.md#members). + +### WG Membership + +WG seats are not time-limited. There is no fixed size of the WG. +However, the expected target is between 6 and 12, to ensure adequate +coverage of important areas of expertise, balanced with the ability to +make decisions efficiently. + +There is no specific set of requirements or qualifications for WG +membership beyond these rules. + +The WG may add additional members to the WG by unanimous consensus. + +A WG member may be removed from the WG by voluntary resignation, or by +unanimous consensus of all other WG members. + +Changes to WG membership should be posted in the agenda, and may be +suggested as any other agenda item (see "WG Meetings" below). + +If an addition or removal is proposed during a meeting, and the full +WG is not in attendance to participate, then the addition or removal +is added to the agenda for the subsequent meeting. This is to ensure +that all members are given the opportunity to participate in all +membership decisions. If a WG member is unable to attend a meeting +where a planned membership decision is being made, then their consent +is assumed. + +No more than 1/3 of the WG members may be affiliated with the same +employer. If removal or resignation of a WG member, or a change of +employment by a WG member, creates a situation where more than 1/3 of +the WG membership shares an employer, then the situation must be +immediately remedied by the resignation or removal of one or more WG +members affiliated with the over-represented employer(s). + +### WG Meetings + +The WG meets occasionally on a Google Hangout On Air. A designated moderator +approved by the WG runs the meeting. Each meeting should be +published to YouTube. + +Items are added to the WG agenda that are considered contentious or +are modifications of governance, contribution policy, WG membership, +or release process. + +The intention of the agenda is not to approve or review all patches; +that should happen continuously on GitHub and be handled by the larger +group of Collaborators. + +Any community member or contributor can ask that something be added to +the next meeting's agenda by logging a GitHub Issue. Any Collaborator, +WG member or the moderator can add the item to the agenda by adding +the ***WG-agenda*** tag to the issue. + +Prior to each WG meeting the moderator will share the Agenda with +members of the WG. WG members can add any items they like to the +agenda at the beginning of each meeting. The moderator and the WG +cannot veto or remove items. + +The WG may invite persons or representatives from certain projects to +participate in a non-voting capacity. + +The moderator is responsible for summarizing the discussion of each +agenda item and sends it as a pull request after the meeting. + +### Consensus Seeking Process + +The WG follows a +[Consensus +Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making) +decision-making model. + +When an agenda item has appeared to reach a consensus the moderator +will ask "Does anyone object?" as a final call for dissent from the +consensus. + +If an agenda item cannot reach a consensus a WG member can call for +either a closing vote or a vote to table the issue to the next +meeting. The call for a vote must be seconded by a majority of the WG +or else the discussion will continue. Simple majority wins. + +Note that changes to WG membership require a majority consensus. See +"WG Membership" above. diff --git a/deps/npm/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/readable-stream/LICENSE index e3d4e695a4..2873b3b2e5 100644 --- a/deps/npm/node_modules/readable-stream/LICENSE +++ b/deps/npm/node_modules/readable-stream/LICENSE @@ -1,3 +1,31 @@ +Node.js is licensed for use as follows: + +""" +Copyright Node.js contributors. All rights reserved. + +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. +""" + +This license applies to parts of Node.js originating from the +https://github.com/joyent/node repository: + +""" Copyright Joyent, Inc. and other Node contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to @@ -16,3 +44,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +""" diff --git a/deps/npm/node_modules/readable-stream/README.md b/deps/npm/node_modules/readable-stream/README.md index 9be2adb158..ff75b0d792 100644 --- a/deps/npm/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/readable-stream/README.md @@ -18,14 +18,31 @@ npm install --save readable-stream This package is a mirror of the Streams2 and Streams3 implementations in Node-core. -Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v7.1.0/docs/api/). +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v7.7.3/docs/api/). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -As of version 2.0.0 **readable-stream** uses semantic versioning. +As of version 2.0.0 **readable-stream** uses semantic versioning. -# Streams WG Team Members +# Streams Working Group + +`readable-stream` is maintained by the Streams Working Group, which +oversees the development and maintenance of the Streams API within +Node.js. The responsibilities of the Streams Working Group include: + +* Addressing stream issues on the Node.js issue tracker. +* Authoring and editing stream documentation within the Node.js project. +* Reviewing changes to stream subclasses within the Node.js project. +* Redirecting changes to streams from the Node.js project to this + project. +* Assisting in the implementation of stream providers within Node.js. +* Recommending versions of `readable-stream` to be included in Node.js. +* Messaging about the future of streams to give the community advance + notice of changes. + + +## Team Members * **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js index 2b86f23705..736693b840 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // a duplex stream is just a stream that is both readable and writable. // Since JS doesn't have multiple prototypal inheritance, this class // prototypally inherits from Readable, and then parasitically from diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js index a9c8358848..d06f71f186 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js index 78e248106a..13b5a7474d 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - 'use strict'; module.exports = Readable; @@ -113,7 +92,7 @@ function ReadableState(options, stream) { this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; + this.highWaterMark = ~~this.highWaterMark; // A linked list is used to store data chunks instead of an array because the // linked list can remove elements from the beginning faster than diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js index 244a308870..cd2583207f 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_transform.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js index fa5cb88701..575beb3c46 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_writable.js @@ -1,24 +1,3 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // A bit simpler than readable streams. // Implement an async ._write(chunk, encoding, cb), and it'll handle all // the drain event emission and buffering. @@ -98,7 +77,7 @@ function WritableState(options, stream) { this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; + this.highWaterMark = ~~this.highWaterMark; // drain event flag. this.needDrain = false; @@ -253,20 +232,16 @@ function writeAfterEnd(stream, cb) { processNextTick(cb, er); } -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; - // Always throw error if a null is written - // if we are not in object mode then throw - // if it is not a buffer, string, or undefined. + if (chunk === null) { er = new TypeError('May not write null values to stream'); - } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } if (er) { @@ -280,19 +255,20 @@ function validChunk(stream, state, chunk, cb) { Writable.prototype.write = function (chunk, encoding, cb) { var state = this._writableState; var ret = false; + var isBuf = Buffer.isBuffer(chunk); if (typeof encoding === 'function') { cb = encoding; encoding = null; } - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; if (typeof cb !== 'function') cb = nop; - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } return ret; @@ -332,10 +308,11 @@ function decodeChunk(state, chunk, encoding) { // if we're already writing something, then just put this // in the queue, and wait our turn. Otherwise, call _write // If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + chunk = decodeChunk(state, chunk, encoding); + if (Buffer.isBuffer(chunk)) encoding = 'buffer'; + } var len = state.objectMode ? 1 : chunk.length; state.length += len; @@ -404,8 +381,8 @@ function onwrite(stream, er) { asyncWrite(afterWrite, stream, state, finished, cb); /**/ } else { - afterWrite(stream, state, finished, cb); - } + afterWrite(stream, state, finished, cb); + } } } @@ -556,7 +533,6 @@ function CorkedRequest(state) { this.next = null; this.entry = null; - this.finish = function (err) { var entry = _this.entry; _this.entry = null; diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js index e6a92b7747..ff4c851c07 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ b/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -19,27 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. diff --git a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/readable-stream/node_modules/string_decoder/index.js index b4df147795..b00e54fb79 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/index.js +++ b/deps/npm/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -19,27 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - var Buffer = require('buffer').Buffer; var isBufferEncoding = Buffer.isEncoding diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json index bc5214bf18..6413787edb 100644 --- a/deps/npm/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/readable-stream/package.json @@ -2,61 +2,54 @@ "_args": [ [ { - "raw": "readable-stream@2.2.2", + "raw": "readable-stream@2.2.6", "scope": null, "escapedName": "readable-stream", "name": "readable-stream", - "rawSpec": "2.2.2", - "spec": "2.2.2", + "rawSpec": "2.2.6", + "spec": "2.2.6", "type": "version" }, - "/Users/rebecca/code/npm-latest" + "/Users/rebecca/code/npm" ] ], - "_from": "readable-stream@2.2.2", - "_id": "readable-stream@2.2.2", - "_inCache": true, + "_from": "readable-stream@2.2.6", + "_hasShrinkwrap": false, + "_id": "readable-stream@2.2.6", "_location": "/readable-stream", - "_nodeVersion": "7.1.0", - "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/readable-stream-2.2.2.tgz_1479128709230_0.5291099038440734" - }, - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "raw": "readable-stream@2.2.2", + "raw": "readable-stream@2.2.6", "scope": null, "escapedName": "readable-stream", "name": "readable-stream", - "rawSpec": "2.2.2", - "spec": "2.2.2", + "rawSpec": "2.2.6", + "spec": "2.2.6", "type": "version" }, "_requiredBy": [ "#USER", "/", "/fs-write-stream-atomic", + "/mississippi/concat-stream", "/mississippi/duplexify", "/mississippi/flush-write-stream", "/mississippi/from2", - "/node-gyp/npmlog/are-we-there-yet", - "/npm-registry-client/npmlog/are-we-there-yet", + "/mississippi/parallel-transform", + "/mississippi/through2", + "/npm-registry-client/concat-stream", "/npmlog/are-we-there-yet", "/sha", + "/standard/eslint/concat-stream", "/tap", "/tap/tap-mocha-reporter", "/tap/tap-parser" ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz", - "_shasum": "a9e6fec3c7dda85f8bb1b3ba7028604556fc825e", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.6.tgz", + "_shasum": "8b43aed76e71483938d12a8d46c6cf1a00b1f816", "_shrinkwrap": null, - "_spec": "readable-stream@2.2.2", - "_where": "/Users/rebecca/code/npm-latest", + "_spec": "readable-stream@2.2.6", + "_where": "/Users/rebecca/code/npm", "browser": { "util": false }, @@ -84,10 +77,9 @@ }, "directories": {}, "dist": { - "shasum": "a9e6fec3c7dda85f8bb1b3ba7028604556fc825e", - "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.2.tgz" + "shasum": "8b43aed76e71483938d12a8d46c6cf1a00b1f816", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.6.tgz" }, - "gitHead": "f239454e183d2032c0eb7d79a1c08f674fdd8db4", "homepage": "https://github.com/nodejs/readable-stream#readme", "keywords": [ "readable", @@ -96,24 +88,6 @@ ], "license": "MIT", "main": "readable.js", - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], "name": "readable-stream", "nyc": { "include": [ @@ -121,7 +95,11 @@ ] }, "optionalDependencies": {}, - "readme": "ERROR: No README data found!", + "react-native": { + "stream": false + }, + "readme": "# readable-stream\n\n***Node-core v7.0.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core.\n\nFull documentation may be found on the [Node.js website](https://nodejs.org/dist/v7.7.3/docs/api/).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning.\n\n# Streams Working Group\n\n`readable-stream` is maintained by the Streams Working Group, which\noversees the development and maintenance of the Streams API within\nNode.js. The responsibilities of the Streams Working Group include:\n\n* Addressing stream issues on the Node.js issue tracker.\n* Authoring and editing stream documentation within the Node.js project.\n* Reviewing changes to stream subclasses within the Node.js project.\n* Redirecting changes to streams from the Node.js project to this\n project.\n* Assisting in the implementation of stream providers within Node.js.\n* Recommending versions of `readable-stream` to be included in Node.js.\n* Messaging about the future of streams to give the community advance\n notice of changes.\n\n\n## Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>\n - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>\n - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>\n - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>\n* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>\n - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E\n", + "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/nodejs/readable-stream.git" @@ -134,5 +112,5 @@ "test": "tap test/parallel/*.js test/ours/*.js", "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" }, - "version": "2.2.2" + "version": "2.2.6" } diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index 7a9b2abf9e..af76719b4b 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,5 +1,22 @@ ## Change Log +### v2.81.0 (2017/03/09) +- [#2584](https://github.com/request/request/pull/2584) Security issue: Upgrade qs to version 6.4.0 (@sergejmueller) +- [#2574](https://github.com/request/request/pull/2574) Migrating to safe-buffer for improved security. (@mikeal) +- [#2573](https://github.com/request/request/pull/2573) fixes #2572 (@ahmadnassri) + +### v2.80.0 (2017/03/04) +- [#2571](https://github.com/request/request/pull/2571) Correctly format the Host header for IPv6 addresses (@JamesMGreene) +- [#2558](https://github.com/request/request/pull/2558) Update README.md example snippet (@FredKSchott) +- [#2221](https://github.com/request/request/pull/2221) Adding a simple Response object reference in argument specification (@calamarico) +- [#2452](https://github.com/request/request/pull/2452) Adds .timings array with DNC, TCP, request and response times (@nicjansma) +- [#2553](https://github.com/request/request/pull/2553) add ISSUE_TEMPLATE, move PR template (@FredKSchott) +- [#2539](https://github.com/request/request/pull/2539) Create PULL_REQUEST_TEMPLATE.md (@FredKSchott) +- [#2524](https://github.com/request/request/pull/2524) Update caseless to version 0.12.0 🚀 (@greenkeeperio-bot) +- [#2460](https://github.com/request/request/pull/2460) Fix wrong MIME type in example (@OwnageIsMagic) +- [#2514](https://github.com/request/request/pull/2514) Change tags to keywords in package.json (@humphd) +- [#2492](https://github.com/request/request/pull/2492) More lenient gzip decompression (@addaleax) + ### v2.79.0 (2016/11/18) - [#2368](https://github.com/request/request/pull/2368) Fix typeof check in test-pool.js (@forivall) - [#2394](https://github.com/request/request/pull/2394) Use `files` in package.json (@SimenB) @@ -108,7 +125,7 @@ - [#1902](https://github.com/request/request/pull/1902) node-uuid@1.4.7 breaks build 🚨 (@greenkeeperio-bot) - [#1894](https://github.com/request/request/pull/1894) Fix tunneling after redirection from https (Original: #1881) (@simov, @falms) - [#1893](https://github.com/request/request/pull/1893) Update eslint to version 1.9.0 🚀 (@greenkeeperio-bot) -- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @KoltesDigital) +- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @nsklkn, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @KoltesDigital) - [#1876](https://github.com/request/request/pull/1876) Implement loose matching for har mime types (@simov) - [#1875](https://github.com/request/request/pull/1875) Update bluebird to version 3.0.2 🚀 (@simov, @greenkeeperio-bot) - [#1871](https://github.com/request/request/pull/1871) Update browserify to version 12.0.1 🚀 (@greenkeeperio-bot) @@ -152,7 +169,7 @@ - [#1768](https://github.com/request/request/pull/1768) Add node 4.0 to the list of build targets (@simov) - [#1767](https://github.com/request/request/pull/1767) Query strings now cooperate with unix sockets (@JoshWillik) - [#1750](https://github.com/request/request/pull/1750) Revert doc about installation of tough-cookie added in #884 (@LoicMahieu) -- [#1746](https://github.com/request/request/pull/1746) Missed comma in Readme (@vladimirich) +- [#1746](https://github.com/request/request/pull/1746) Missed comma in Readme (@nsklkn) - [#1743](https://github.com/request/request/pull/1743) Fix options not being initialized in defaults method (@simov) ### v2.61.0 (2015/08/19) @@ -430,7 +447,7 @@ - [#1006](https://github.com/request/request/pull/1006) Migrate to caseless, fixes #1001 (@mikeal) - [#995](https://github.com/request/request/pull/995) Fix parsing array of objects (@sjonnet19) - [#999](https://github.com/request/request/pull/999) Fix fallback for browserify for optional modules. (@eiriksm) -- [#996](https://github.com/request/request/pull/996) Wrong oauth signature when multiple same param keys exist [updated] (@bengl, @hyjin) +- [#996](https://github.com/request/request/pull/996) Wrong oauth signature when multiple same param keys exist [updated] (@bengl) ### v2.40.0 (2014/08/06) - [#992](https://github.com/request/request/pull/992) Fix security vulnerability. Update qs (@poeticninja) @@ -496,15 +513,10 @@ - [#742](https://github.com/request/request/pull/742) Add note about JSON output body type (@iansltx) - [#741](https://github.com/request/request/pull/741) README example is using old cookie jar api (@emkay) - [#736](https://github.com/request/request/pull/736) Fix callback arguments documentation (@mmalecki) - -### v2.30.0 (2013/12/13) - [#732](https://github.com/request/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium) - [#730](https://github.com/request/request/pull/730) better HTTP DIGEST support (@dai-shi) - [#728](https://github.com/request/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow) - -### v2.29.0 (2013/12/06) - [#727](https://github.com/request/request/pull/727) fix requester bug (@jchris) -### v2.28.0 (2013/12/04) - [#724](https://github.com/request/request/pull/724) README.md: add custom HTTP Headers example. (@tcort) - [#719](https://github.com/request/request/pull/719) Made a comment gender neutral. (@unsetbit) - [#715](https://github.com/request/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub) @@ -538,10 +550,10 @@ - [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva) - [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath) - [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) -- [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421) +- [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway) - [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka) -- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421) -- [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421) +- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway) +- [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway) - [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun) - [#510](https://github.com/request/request/pull/510) Add HTTP Signature support. (@davidlehn) - [#502](https://github.com/request/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen) diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index 2ddfe72c53..2317391149 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -18,10 +18,10 @@ Request is designed to be the simplest way possible to make http calls. It suppo ```js var request = require('request'); request('http://www.google.com', function (error, response, body) { - if (!error && response.statusCode == 200) { - console.log(body) // Show the HTML for the Google homepage. - } -}) + console.log('error:', error); // Print the error if one occurred + console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received + console.log('body:', body); // Print the HTML for the Google homepage. +}); ``` @@ -185,7 +185,7 @@ var formData = { value: fs.createReadStream('/dev/urandom'), options: { filename: 'topsecret.jpg', - contentType: 'image/jpg' + contentType: 'image/jpeg' } } }; @@ -287,13 +287,13 @@ The method form takes parameters `auth(username, password, sendImmediately, bearer)`. `sendImmediately` defaults to `true`, which causes a basic or bearer -authentication header to be sent. If `sendImmediately` is `false`, then +authentication header to be sent. If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a `401` response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method). Note that you can also specify basic authentication using the URL itself, as -detailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the +detailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the `user:password` before the host with an `@` sign: ```js @@ -358,7 +358,7 @@ request(options, callback); ## OAuth Signing -[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The +[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The default signing algorithm is [HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2): @@ -477,7 +477,7 @@ See [the wikipedia page on HTTP Tunneling](https://en.wikipedia.org/wiki/HTTP_tu for more information. By default, when proxying `http` traffic, request will simply make a -standard proxied `http` request. This is done by making the `url` +standard proxied `http` request. This is done by making the `url` section of the initial line of the request a fully qualified url to the endpoint. @@ -493,7 +493,7 @@ request body or whatever Because a pure "http over http" tunnel offers no additional security or other features, it is generally simpler to go with a -straightforward HTTP proxy in this case. However, if you would like +straightforward HTTP proxy in this case. However, if you would like to force a tunneling proxy, you may set the `tunnel` option to `true`. You can also make a standard proxied `http` request by explicitly setting @@ -717,7 +717,7 @@ a validation step will check if the HAR Request format matches the latest spec ( The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional. - `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()` -- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string. +- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string. - `method` - http method (default: `"GET"`) - `headers` - http headers (default: `{}`) @@ -727,7 +727,7 @@ The first argument can be either a `url` or an `options` object. The only requir - `qsParseOptions` - object containing options to pass to the [qs.parse](https://github.com/hapijs/qs#parsing-objects) method. Alternatively pass options to the [querystring.parse](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}` - `qsStringifyOptions` - object containing options to pass to the [qs.stringify](https://github.com/hapijs/qs#stringifying) method. Alternatively pass options to the [querystring.stringify](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}`. For example, to change the way arrays are converted to query strings using the `qs` module pass the `arrayFormat` option with one of `indices|brackets|repeat` - `useQuerystring` - If true, use `querystring` to stringify and parse - querystrings, otherwise use `qs` (default: `false`). Set this option to + querystrings, otherwise use `qs` (default: `false`). Set this option to `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the default `foo[0]=bar&foo[1]=baz`. @@ -746,13 +746,13 @@ The first argument can be either a `url` or an `options` object. The only requir In non-chunked requests, data items with body streams are not allowed. - `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request. - `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. -- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. +- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. - `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body. - `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body. --- -- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. +- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. - `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above. - `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example). - `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`, and optionally `session` (note that this only works for services that require session as part of the canonical string). Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services). If you want to use AWS sign version 4 use the parameter `sign_version` with value `4` otherwise the default is version 2. **Note:** you need to `npm install aws4` first. @@ -769,7 +769,7 @@ The first argument can be either a `url` or an `options` object. The only requir --- - `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.) -- `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below. +- `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below. - `jar` - If `true`, remember cookies for future use (or define your custom cookie jar; see examples section) --- @@ -781,7 +781,7 @@ The first argument can be either a `url` or an `options` object. The only requir - `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as your options allow for it). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. **Note:** `pool` is used only when the `agent` option is not specified. - A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`). - Note that if you are sending multiple requests in a loop and creating - multiple new `pool` objects, `maxSockets` will not work as intended. To + multiple new `pool` objects, `maxSockets` will not work as intended. To work around this, either use [`request.defaults`](#requestdefaultsoptions) with your pool options or create the pool object with the `maxSockets` property outside of the loop. @@ -812,14 +812,31 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]). --- -- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's `elapsedTime` property. The `responseStartTime` property is also available to indicate the timestamp when the response begins. +- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution. When set, the following properties are added to the response object: + - `elapsedTime` Duration of the entire request/response in milliseconds (*deprecated*). + - `responseStartTime` Timestamp when the response began (in Unix Epoch milliseconds) (*deprecated*). + - `timingStart` Timestamp of the start of the request (in Unix Epoch milliseconds). + - `timings` Contains event timestamps in millisecond resolution relative to `timingStart`. If there were redirects, the properties reflect the timings of the final request in the redirect chain: + - `socket` Relative timestamp when the [`http`](https://nodejs.org/api/http.html#http_event_socket) module's `socket` event fires. This happens when the socket is assigned to the request. + - `lookup` Relative timestamp when the [`net`](https://nodejs.org/api/net.html#net_event_lookup) module's `lookup` event fires. This happens when the DNS has been resolved. + - `connect`: Relative timestamp when the [`net`](https://nodejs.org/api/net.html#net_event_connect) module's `connect` event fires. This happens when the server acknowledges the TCP connection. + - `response`: Relative timestamp when the [`http`](https://nodejs.org/api/http.html#http_event_response) module's `response` event fires. This happens when the first bytes are received from the server. + - `end`: Relative timestamp when the last bytes of the response are received. + - `timingPhases` Contains the durations of each request phase. If there were redirects, the properties reflect the timings of the final request in the redirect chain: + - `wait`: Duration of socket initialization (`timings.socket`) + - `dns`: Duration of DNS lookup (`timings.lookup` - `timings.socket`) + - `tcp`: Duration of TCP connection (`timings.connect` - `timings.socket`) + - `firstByte`: Duration of HTTP server response (`timings.response` - `timings.connect`) + - `download`: Duration of HTTP download (`timings.end` - `timings.response`) + - `total`: Duration entire HTTP round-trip (`timings.end`) + - `har` - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)* - `callback` - alternatively pass the request's callback in the options object The callback argument gets 3 arguments: 1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object) -2. An [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) object +2. An [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) object (Response object) 3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied) [back to top](#table-of-contents) @@ -1002,7 +1019,7 @@ request.get('http://10.255.255.1', {timeout: 1500}, function(err) { ``` For backwards-compatibility, response compression is not supported by default. -To accept gzip-compressed responses, set the `gzip` option to `true`. Note +To accept gzip-compressed responses, set the `gzip` option to `true`. Note that the body data passed through `request` is automatically decompressed while the response object is unmodified and will contain compressed data if the server sent a compressed response. diff --git a/deps/npm/node_modules/request/lib/helpers.js b/deps/npm/node_modules/request/lib/helpers.js index f9d727e382..05c77a0bdd 100644 --- a/deps/npm/node_modules/request/lib/helpers.js +++ b/deps/npm/node_modules/request/lib/helpers.js @@ -2,6 +2,7 @@ var jsonSafeStringify = require('json-stringify-safe') , crypto = require('crypto') + , Buffer = require('safe-buffer').Buffer var defer = typeof setImmediate === 'undefined' ? process.nextTick @@ -35,7 +36,7 @@ function isReadStream (rs) { } function toBase64 (str) { - return (new Buffer(str || '', 'utf8')).toString('base64') + return Buffer.from(str || '', 'utf8').toString('base64') } function copy (obj) { diff --git a/deps/npm/node_modules/request/lib/multipart.js b/deps/npm/node_modules/request/lib/multipart.js index 3b605bd47b..fc7b50276e 100644 --- a/deps/npm/node_modules/request/lib/multipart.js +++ b/deps/npm/node_modules/request/lib/multipart.js @@ -3,6 +3,7 @@ var uuid = require('uuid') , CombinedStream = require('combined-stream') , isstream = require('isstream') + , Buffer = require('safe-buffer').Buffer function Multipart (request) { @@ -71,7 +72,7 @@ Multipart.prototype.build = function (parts, chunked) { if (typeof part === 'number') { part = part.toString() } - return chunked ? body.append(part) : body.push(new Buffer(part)) + return chunked ? body.append(part) : body.push(Buffer.from(part)) } if (self.request.preambleCRLF) { diff --git a/deps/npm/node_modules/request/lib/oauth.js b/deps/npm/node_modules/request/lib/oauth.js index 56b39b0f51..13b693773e 100644 --- a/deps/npm/node_modules/request/lib/oauth.js +++ b/deps/npm/node_modules/request/lib/oauth.js @@ -6,6 +6,7 @@ var url = require('url') , uuid = require('uuid') , oauth = require('oauth-sign') , crypto = require('crypto') + , Buffer = require('safe-buffer').Buffer function OAuth (request) { @@ -70,7 +71,7 @@ OAuth.prototype.buildBodyHash = function(_oauth, body) { shasum.update(body || '') var sha1 = shasum.digest('hex') - return new Buffer(sha1).toString('base64') + return Buffer.from(sha1).toString('base64') } OAuth.prototype.concatParams = function (oa, sep, wrap) { diff --git a/deps/npm/node_modules/request/node_modules/aws4/aws4.js b/deps/npm/node_modules/request/node_modules/aws4/aws4.js index a54318065b..0cff0f0ea3 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/aws4.js +++ b/deps/npm/node_modules/request/node_modules/aws4/aws4.js @@ -118,14 +118,14 @@ RequestSigner.prototype.prepareRequest = function() { if (request.body && !headers['Content-Length'] && !headers['content-length']) headers['Content-Length'] = Buffer.byteLength(request.body) - if (this.credentials.sessionToken) + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) headers['X-Amz-Security-Token'] = this.credentials.sessionToken - if (this.service === 's3') + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') - if (headers['X-Amz-Date']) - this.datetime = headers['X-Amz-Date'] + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] else headers['X-Amz-Date'] = this.getDateTime() } @@ -202,13 +202,22 @@ RequestSigner.prototype.canonicalString = function() { var pathStr = this.parsedPath.path, query = this.parsedPath.query, + headers = this.request.headers, queryStr = '', normalizePath = this.service !== 's3', decodePath = this.service === 's3' || this.request.doNotEncodePath, decodeSlashesInPath = this.service === 's3', firstValOnly = this.service === 's3', - bodyHash = this.service === 's3' && this.request.signQuery ? 'UNSIGNED-PAYLOAD' : - (this.isCodeCommitGit ? '' : hash(this.request.body || '', 'hex')) + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' + } else { + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } if (query) { queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { diff --git a/deps/npm/node_modules/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json index 4e7caf0d30..65b973a7b3 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/package.json +++ b/deps/npm/node_modules/request/node_modules/aws4/package.json @@ -10,23 +10,23 @@ "spec": ">=1.2.1 <2.0.0", "type": "range" }, - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + "/Users/zkat/Documents/code/npm/node_modules/request" ] ], "_from": "aws4@>=1.2.1 <2.0.0", - "_id": "aws4@1.5.0", + "_id": "aws4@1.6.0", "_inCache": true, "_location": "/request/aws4", "_nodeVersion": "4.5.0", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/aws4-1.5.0.tgz_1476226259635_0.2796843808609992" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/aws4-1.6.0.tgz_1486481933920_0.6127187723759562" }, "_npmUser": { "name": "hichaelmart", "email": "michael.hart.au@gmail.com" }, - "_npmVersion": "2.15.11", + "_npmVersion": "4.0.5", "_phantomChildren": {}, "_requested": { "raw": "aws4@^1.2.1", @@ -40,11 +40,11 @@ "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz", - "_shasum": "0a29ffb79c31c9e712eeb087e8e7a64b4a56d755", + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "_shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e", "_shrinkwrap": null, "_spec": "aws4@^1.2.1", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/zkat/Documents/code/npm/node_modules/request", "author": { "name": "Michael Hart", "email": "michael.hart.au@gmail.com", @@ -61,10 +61,10 @@ }, "directories": {}, "dist": { - "shasum": "0a29ffb79c31c9e712eeb087e8e7a64b4a56d755", - "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.5.0.tgz" + "shasum": "83ef5ca860b2b32e4a0deedee8c771b9db57471e", + "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz" }, - "gitHead": "ba136334ee08884c6042c8578a22e376233eef34", + "gitHead": "74bf0b64d1e8cbcd184964999c7ef53f52d7ad32", "homepage": "https://github.com/mhart/aws4#readme", "keywords": [ "amazon", @@ -136,5 +136,5 @@ "scripts": { "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" }, - "version": "1.5.0" + "version": "1.6.0" } diff --git a/deps/npm/node_modules/request/node_modules/caseless/index.js b/deps/npm/node_modules/request/node_modules/caseless/index.js index d86a70eca1..b194734ee4 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/index.js +++ b/deps/npm/node_modules/request/node_modules/caseless/index.js @@ -36,6 +36,7 @@ Caseless.prototype.get = function (name) { } Caseless.prototype.swap = function (name) { var has = this.has(name) + if (has === name) return if (!has) throw new Error('There is no header than matches "'+name+'"') this.dict[name] = this.dict[has] delete this.dict[has] diff --git a/deps/npm/node_modules/request/node_modules/caseless/package.json b/deps/npm/node_modules/request/node_modules/caseless/package.json index 7470678232..9fa56f9e93 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/package.json +++ b/deps/npm/node_modules/request/node_modules/caseless/package.json @@ -2,46 +2,49 @@ "_args": [ [ { - "raw": "caseless@~0.11.0", + "raw": "caseless@~0.12.0", "scope": null, "escapedName": "caseless", "name": "caseless", - "rawSpec": "~0.11.0", - "spec": ">=0.11.0 <0.12.0", + "rawSpec": "~0.12.0", + "spec": ">=0.12.0 <0.13.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/request" + "/Users/zkat/Documents/code/npm/node_modules/request" ] ], - "_from": "caseless@>=0.11.0 <0.12.0", - "_id": "caseless@0.11.0", + "_from": "caseless@>=0.12.0 <0.13.0", + "_id": "caseless@0.12.0", "_inCache": true, - "_installable": true, "_location": "/request/caseless", - "_nodeVersion": "1.8.1", + "_nodeVersion": "6.9.2", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/caseless-0.12.0.tgz_1485466648253_0.3714302028529346" + }, "_npmUser": { "name": "mikeal", "email": "mikeal.rogers@gmail.com" }, - "_npmVersion": "2.8.3", + "_npmVersion": "3.10.9", "_phantomChildren": {}, "_requested": { - "raw": "caseless@~0.11.0", + "raw": "caseless@~0.12.0", "scope": null, "escapedName": "caseless", "name": "caseless", - "rawSpec": "~0.11.0", - "spec": ">=0.11.0 <0.12.0", + "rawSpec": "~0.12.0", + "spec": ">=0.12.0 <0.13.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "_shasum": "1b681c21ff84033c826543090689420d187151dc", "_shrinkwrap": null, - "_spec": "caseless@~0.11.0", - "_where": "/Users/rebecca/code/npm/node_modules/request", + "_spec": "caseless@~0.12.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" @@ -56,10 +59,10 @@ }, "directories": {}, "dist": { - "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", - "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + "shasum": "1b681c21ff84033c826543090689420d187151dc", + "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz" }, - "gitHead": "c578232a02cc2b46b6da8851caf57fdbfac89ff5", + "gitHead": "af91df7878a8b53cf3dc2e9a086dc57ba8301649", "homepage": "https://github.com/mikeal/caseless#readme", "keywords": [ "headers", @@ -93,5 +96,5 @@ "test": "node test.js" }, "test": "node test.js", - "version": "0.11.0" + "version": "0.12.0" } diff --git a/deps/npm/node_modules/request/node_modules/caseless/test.js b/deps/npm/node_modules/request/node_modules/caseless/test.js index 084bbaf5e9..f55196cc07 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/test.js +++ b/deps/npm/node_modules/request/node_modules/caseless/test.js @@ -38,3 +38,30 @@ tape('set get has', function (t) { t.equal(c.get('tva'), 'test1') }) + +tape('swap', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(4) + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) + // Set Header. + c.set('content-type', 'application/json') + // Swap Header With Itself. + c.swap('content-type') + // Does Not Delete Itself. + t.ok(c.has('content-type')) + // Swap Header With a Different Header. + c.swap('Content-Type') + // Still Has Header. + t.ok(c.has('Content-Type')) + // Delete Header. + c.del('Content-Type') + // No Header to Swap. + t.throws(function () { + c.swap('content-type') + }) +}) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/README.md b/deps/npm/node_modules/request/node_modules/har-validator/README.md index 91526e6ddb..77ff935018 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/README.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/README.md @@ -1,285 +1,60 @@ # HAR Validator [![version][npm-version]][npm-url] [![License][npm-license]][license-url] -Extremely fast HTTP Archive ([HAR](http://www.softwareishard.com/blog/har-12-spec/)) validator using JSON Schema. +> Extremely fast HTTP Archive ([HAR](https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md)) validator using JSON Schema. [![Build Status][travis-image]][travis-url] [![Downloads][npm-downloads]][npm-url] [![Code Climate][codeclimate-quality]][codeclimate-url] [![Coverage Status][codeclimate-coverage]][codeclimate-url] +[![Dependency Status][dependencyci-image]][dependencyci-url] [![Dependencies][david-image]][david-url] ## Install -```shell -# to use in cli -npm install --global har-validator - -# to use as a module -npm install --save har-validator +```bash +npm install --only=production --save har-validator ``` ## Usage -``` - - Usage: har-validator [options] - - Options: - - -h, --help output usage information - -V, --version output the version number - -s, --schema [name] validate schema name (log, request, response, etc ...) - -``` - -###### Example - -```shell -har-validator har.json - -har-validator --schema request request.json -``` - -## API - -**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability with `v1.x` an [async/callback API](#callback-api) is provided* - -### Validate(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object - -```js -validate(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.log(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object - -```js -validate.log(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.cache(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object - -```js -validate.cache(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.cacheEntry(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects - -```js -validate.cacheEntry(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.content(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object - -```js -validate.content(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.cookie(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object - -```js -validate.cookie(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.creator(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object - -```js -validate.creator(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.entry(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object - -```js -validate.entry(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.log(data) - -alias of [`Validate(data)`](#validate-data-callback-) - -### Validate.page(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object - -```js -validate.page(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.pageTimings(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object - -```js -validate.pageTimings(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.postData(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object - -```js -validate.postData(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.record(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object - -```js -validate.record(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.request(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object +I recommend using an optimized build matching your Node.js environment version, otherwise, the standard `require` would work just fine with any version of Node `>= v4.0` . ```js -validate.request(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - -### Validate.response(data) +/* + * Node 7 + */ +const validate = require('har-validator/lib/node7') -> Returns a promise that resolves to the valid object. +/* + * Node 6 + */ +const validate = require('har-validator/lib/node6') -- **data**: `Object` *(Required)* - a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object - -```js -validate.cacheEntry(data) - .then(data => console.log('horray!')) - .catch(console.error) +/* + * Node 4 (Default) + */ +var validate = require('har-validator') ``` -### Validate.timings(data) - -> Returns a promise that resolves to the valid object. - -- **data**: `Object` *(Required)* - a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object - -```js -validate.timings(data) - .then(data => console.log('horray!')) - .catch(console.error) -``` - ----- +## CLI Usage -## Callback API +Please refer to [`har-cli`](https://github.com/ahmadnassri/har-cli) for more info. -### Validate(data [, callback]) - -> Returns `true` or `false`. - -```js -var HAR = require('./har.json'); -var validate = require('har-validator/lib/async'); - -validate(HAR, function (e, valid) { - if (e) console.log(e.errors) +## API - if (valid) console.log('horray!'); -}); +**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability with `v1.x` an [async/callback API](docs/async.md) is also provided* -``` -The async API provides exactly the same methods as the [Promise API](#promise-api) +- [async API](docs/async.md) +- [callback API](docs/async.md) +- [Promise API](docs/promise.md) *(default)* ---- +> :copyright: [ahmadnassri.com](https://www.ahmadnassri.com/)  ·  +> License: [ISC][license-url]  ·  +> Github: [@ahmadnassri](https://github.com/ahmadnassri)  ·  +> Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri) -## Support - -Donations are welcome to help support the continuous development of this project. - -[![Gratipay][gratipay-image]][gratipay-url] -[![PayPal][paypal-image]][paypal-url] -[![Flattr][flattr-image]][flattr-url] -[![Bitcoin][bitcoin-image]][bitcoin-url] - -## License - -[ISC License](LICENSE) © [Ahmad Nassri](https://www.ahmadnassri.com/) - -[license-url]: https://github.com/ahmadnassri/har-validator/blob/master/LICENSE +[license-url]: http://choosealicense.com/licenses/isc/ [travis-url]: https://travis-ci.org/ahmadnassri/har-validator [travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square @@ -296,14 +71,5 @@ Donations are welcome to help support the continuous development of this project [david-url]: https://david-dm.org/ahmadnassri/har-validator [david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square -[gratipay-url]: https://www.gratipay.com/ahmadnassri/ -[gratipay-image]: https://img.shields.io/gratipay/ahmadnassri.svg?style=flat-square - -[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UJ2B2BTK9VLRS&on0=project&os0=har-validator -[paypal-image]: http://img.shields.io/badge/paypal-donate-green.svg?style=flat-square - -[flattr-url]: https://flattr.com/submit/auto?user_id=ahmadnassri&url=https://github.com/ahmadnassri/har-validator&title=har-validator&language=&tags=github&category=software -[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square - -[bitcoin-image]: http://img.shields.io/badge/bitcoin-1Nb46sZRVG3or7pNaDjthcGJpWhvoPpCxy-green.svg?style=flat-square -[bitcoin-url]: https://www.coinbase.com/checkouts/ae383ae6bb931a2fa5ad11cec115191e?name=har-validator +[dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-validator +[dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-validator/badge?style=flat-square diff --git a/deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator b/deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator deleted file mode 100755 index fd7cc0d34d..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -var chalk = require('chalk') -var cmd = require('commander') -var fs = require('fs') -var path = require('path') -var pkg = require('../package.json') -var Promise = require('pinkie-promise') -var validate = require('..') -var ValidationError = require('../lib/error') - -cmd - .version(pkg.version) - .usage('[options] ') - .option('-s, --schema [name]', 'validate schema name (log, request, response, etc ...)') - .parse(process.argv) - -if (!cmd.args.length) { - cmd.help() -} - -cmd.args.map(function (fileName) { - var file = chalk.yellow.italic(path.basename(fileName)) - - new Promise(function (resolve, reject) { - fs.readFile(fileName, function (err, data) { - return err === null ? resolve(data) : reject(err) - }) - }) - - .then(JSON.parse) - - .then(cmd.schema ? validate[cmd.schema] : validate) - - .then(function (data) { - console.log('%s [%s] is valid', chalk.green('✓'), file) - }) - - .catch(function (err) { - if (err instanceof SyntaxError) { - return console.error('%s [%s] failed to read JSON: %s', chalk.red('✖'), file, chalk.red(err.message)) - } - - if (err instanceof ValidationError) { - err.errors.forEach(function (details) { - console.error('%s [%s] failed validation: (%s: %s) %s', chalk.red('✖'), file, chalk.cyan.italic(details.field), chalk.magenta.italic(details.value), chalk.red(details.message)) - }) - - return - } - - console.error('%s [%s] an unknown error has occured: %s', chalk.red('✖'), file, chalk.red(err.message)) - }) -}) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/async.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/async.js deleted file mode 100644 index 77b99a7db7..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/async.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -var runner = require('./runner') -var schemas = require('./schemas') - -module.exports = function (data, cb) { - return runner(schemas.har, data, cb) -} - -Object.keys(schemas).map(function (name) { - module.exports[name] = function (data, cb) { - return runner(schemas[name], data, cb) - } -}) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/async.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/async.js new file mode 100644 index 0000000000..676356aafd --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/async.js @@ -0,0 +1,96 @@ +import * as schemas from 'har-schema'; +import Ajv from 'ajv'; +import HARError from './error'; + +let ajv; + +export function validate(name, data = {}, next) { + // validator config + ajv = ajv || new Ajv({ + allErrors: true, + schemas: schemas + }); + + let validate = ajv.getSchema(name + '.json'); + + let valid = validate(data); + + // callback? + if (typeof next === 'function') { + return next(!valid ? new HARError(validate.errors) : null, valid); + } + + return valid; +} + +export function afterRequest(data, next) { + return validate('afterRequest', data, next); +} + +export function beforeRequest(data, next) { + return validate('beforeRequest', data, next); +} + +export function browser(data, next) { + return validate('browser', data, next); +} + +export function cache(data, next) { + return validate('cache', data, next); +} + +export function content(data, next) { + return validate('content', data, next); +} + +export function cookie(data, next) { + return validate('cookie', data, next); +} + +export function creator(data, next) { + return validate('creator', data, next); +} + +export function entry(data, next) { + return validate('entry', data, next); +} + +export function har(data, next) { + return validate('har', data, next); +} + +export function header(data, next) { + return validate('header', data, next); +} + +export function log(data, next) { + return validate('log', data, next); +} + +export function page(data, next) { + return validate('page', data, next); +} + +export function pageTimings(data, next) { + return validate('pageTimings', data, next); +} + +export function postData(data, next) { + return validate('postData', data, next); +} + +export function query(data, next) { + return validate('query', data, next); +} + +export function request(data, next) { + return validate('request', data, next); +} + +export function response(data, next) { + return validate('response', data, next); +} + +export function timings(data, next) { + return validate('timings', data, next); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/error.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/error.js new file mode 100644 index 0000000000..f49fcf231a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/error.js @@ -0,0 +1,15 @@ +export default function HARError(errors) { + let message = 'validation failed'; + + this.name = 'HARError'; + this.message = message; + this.errors = errors; + + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } +} + +HARError.prototype = Error.prototype; \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/promise.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/promise.js new file mode 100644 index 0000000000..bc1b18c3f7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/browser/promise.js @@ -0,0 +1,93 @@ +import * as schemas from 'har-schema'; +import Ajv from 'ajv'; +import HARError from './error'; + +let ajv; + +export function validate(name, data = {}) { + // validator config + ajv = ajv || new Ajv({ + allErrors: true, + schemas: schemas + }); + + let validate = ajv.getSchema(name + '.json'); + + return new Promise((resolve, reject) => { + let valid = validate(data); + + !valid ? reject(new HARError(validate.errors)) : resolve(data); + }); +} + +export function afterRequest(data) { + return validate('afterRequest', data); +} + +export function beforeRequest(data) { + return validate('beforeRequest', data); +} + +export function browser(data) { + return validate('browser', data); +} + +export function cache(data) { + return validate('cache', data); +} + +export function content(data) { + return validate('content', data); +} + +export function cookie(data) { + return validate('cookie', data); +} + +export function creator(data) { + return validate('creator', data); +} + +export function entry(data) { + return validate('entry', data); +} + +export function har(data) { + return validate('har', data); +} + +export function header(data) { + return validate('header', data); +} + +export function log(data) { + return validate('log', data); +} + +export function page(data) { + return validate('page', data); +} + +export function pageTimings(data) { + return validate('pageTimings', data); +} + +export function postData(data) { + return validate('postData', data); +} + +export function query(data) { + return validate('query', data); +} + +export function request(data) { + return validate('request', data); +} + +export function response(data) { + return validate('response', data); +} + +export function timings(data) { + return validate('timings', data); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/error.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/error.js deleted file mode 100644 index fc08a87218..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/error.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict' - -function ValidationError (errors) { - this.name = 'ValidationError' - this.errors = errors -} - -ValidationError.prototype = Error.prototype - -module.exports = ValidationError diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/index.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/index.js deleted file mode 100644 index e8351b8d56..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/index.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict' - -var Promise = require('pinkie-promise') -var runner = require('./runner') -var schemas = require('./schemas') - -var promisify = function (schema) { - return function (data) { - return new Promise(function (resolve, reject) { - runner(schema, data, function (err, valid) { - return err === null ? resolve(data) : reject(err) - }) - }) - } -} - -module.exports = promisify(schemas.har) - -// utility methods for all parts of the schema -Object.keys(schemas).map(function (name) { - module.exports[name] = promisify(schemas[name]) -}) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/async.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/async.js new file mode 100644 index 0000000000..e9c4854307 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/async.js @@ -0,0 +1,136 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.afterRequest = afterRequest; +exports.beforeRequest = beforeRequest; +exports.browser = browser; +exports.cache = cache; +exports.content = content; +exports.cookie = cookie; +exports.creator = creator; +exports.entry = entry; +exports.har = har; +exports.header = header; +exports.log = log; +exports.page = page; +exports.pageTimings = pageTimings; +exports.postData = postData; +exports.query = query; +exports.request = request; +exports.response = response; +exports.timings = timings; + +var _harSchema = require('har-schema'); + +var schemas = _interopRequireWildcard(_harSchema); + +var _ajv = require('ajv'); + +var _ajv2 = _interopRequireDefault(_ajv); + +var _error = require('./error'); + +var _error2 = _interopRequireDefault(_error); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +var ajv = void 0; + +function validate(name) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var next = arguments[2]; + + // validator config + ajv = ajv || new _ajv2.default({ + allErrors: true, + schemas: schemas + }); + + var validate = ajv.getSchema(name + '.json'); + + var valid = validate(data); + + // callback? + if (typeof next === 'function') { + return next(!valid ? new _error2.default(validate.errors) : null, valid); + } + + return valid; +} + +function afterRequest(data, next) { + return validate('afterRequest', data, next); +} + +function beforeRequest(data, next) { + return validate('beforeRequest', data, next); +} + +function browser(data, next) { + return validate('browser', data, next); +} + +function cache(data, next) { + return validate('cache', data, next); +} + +function content(data, next) { + return validate('content', data, next); +} + +function cookie(data, next) { + return validate('cookie', data, next); +} + +function creator(data, next) { + return validate('creator', data, next); +} + +function entry(data, next) { + return validate('entry', data, next); +} + +function har(data, next) { + return validate('har', data, next); +} + +function header(data, next) { + return validate('header', data, next); +} + +function log(data, next) { + return validate('log', data, next); +} + +function page(data, next) { + return validate('page', data, next); +} + +function pageTimings(data, next) { + return validate('pageTimings', data, next); +} + +function postData(data, next) { + return validate('postData', data, next); +} + +function query(data, next) { + return validate('query', data, next); +} + +function request(data, next) { + return validate('request', data, next); +} + +function response(data, next) { + return validate('response', data, next); +} + +function timings(data, next) { + return validate('timings', data, next); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/error.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/error.js new file mode 100644 index 0000000000..0ae01bd18c --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/error.js @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = HARError; +function HARError(errors) { + var message = 'validation failed'; + + this.name = 'HARError'; + this.message = message; + this.errors = errors; + + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } +} + +HARError.prototype = Error.prototype; +module.exports = exports['default']; \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/promise.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/promise.js new file mode 100644 index 0000000000..d37ca52ad7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node4/promise.js @@ -0,0 +1,132 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.afterRequest = afterRequest; +exports.beforeRequest = beforeRequest; +exports.browser = browser; +exports.cache = cache; +exports.content = content; +exports.cookie = cookie; +exports.creator = creator; +exports.entry = entry; +exports.har = har; +exports.header = header; +exports.log = log; +exports.page = page; +exports.pageTimings = pageTimings; +exports.postData = postData; +exports.query = query; +exports.request = request; +exports.response = response; +exports.timings = timings; + +var _harSchema = require('har-schema'); + +var schemas = _interopRequireWildcard(_harSchema); + +var _ajv = require('ajv'); + +var _ajv2 = _interopRequireDefault(_ajv); + +var _error = require('./error'); + +var _error2 = _interopRequireDefault(_error); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +var ajv = void 0; + +function validate(name) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + // validator config + ajv = ajv || new _ajv2.default({ + allErrors: true, + schemas: schemas + }); + + var validate = ajv.getSchema(name + '.json'); + + return new Promise(function (resolve, reject) { + var valid = validate(data); + + !valid ? reject(new _error2.default(validate.errors)) : resolve(data); + }); +} + +function afterRequest(data) { + return validate('afterRequest', data); +} + +function beforeRequest(data) { + return validate('beforeRequest', data); +} + +function browser(data) { + return validate('browser', data); +} + +function cache(data) { + return validate('cache', data); +} + +function content(data) { + return validate('content', data); +} + +function cookie(data) { + return validate('cookie', data); +} + +function creator(data) { + return validate('creator', data); +} + +function entry(data) { + return validate('entry', data); +} + +function har(data) { + return validate('har', data); +} + +function header(data) { + return validate('header', data); +} + +function log(data) { + return validate('log', data); +} + +function page(data) { + return validate('page', data); +} + +function pageTimings(data) { + return validate('pageTimings', data); +} + +function postData(data) { + return validate('postData', data); +} + +function query(data) { + return validate('query', data); +} + +function request(data) { + return validate('request', data); +} + +function response(data) { + return validate('response', data); +} + +function timings(data) { + return validate('timings', data); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/async.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/async.js new file mode 100644 index 0000000000..e707043adf --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/async.js @@ -0,0 +1,133 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.afterRequest = afterRequest; +exports.beforeRequest = beforeRequest; +exports.browser = browser; +exports.cache = cache; +exports.content = content; +exports.cookie = cookie; +exports.creator = creator; +exports.entry = entry; +exports.har = har; +exports.header = header; +exports.log = log; +exports.page = page; +exports.pageTimings = pageTimings; +exports.postData = postData; +exports.query = query; +exports.request = request; +exports.response = response; +exports.timings = timings; + +var _harSchema = require('har-schema'); + +var schemas = _interopRequireWildcard(_harSchema); + +var _ajv = require('ajv'); + +var _ajv2 = _interopRequireDefault(_ajv); + +var _error = require('./error'); + +var _error2 = _interopRequireDefault(_error); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +let ajv; + +function validate(name, data = {}, next) { + // validator config + ajv = ajv || new _ajv2.default({ + allErrors: true, + schemas: schemas + }); + + let validate = ajv.getSchema(name + '.json'); + + let valid = validate(data); + + // callback? + if (typeof next === 'function') { + return next(!valid ? new _error2.default(validate.errors) : null, valid); + } + + return valid; +} + +function afterRequest(data, next) { + return validate('afterRequest', data, next); +} + +function beforeRequest(data, next) { + return validate('beforeRequest', data, next); +} + +function browser(data, next) { + return validate('browser', data, next); +} + +function cache(data, next) { + return validate('cache', data, next); +} + +function content(data, next) { + return validate('content', data, next); +} + +function cookie(data, next) { + return validate('cookie', data, next); +} + +function creator(data, next) { + return validate('creator', data, next); +} + +function entry(data, next) { + return validate('entry', data, next); +} + +function har(data, next) { + return validate('har', data, next); +} + +function header(data, next) { + return validate('header', data, next); +} + +function log(data, next) { + return validate('log', data, next); +} + +function page(data, next) { + return validate('page', data, next); +} + +function pageTimings(data, next) { + return validate('pageTimings', data, next); +} + +function postData(data, next) { + return validate('postData', data, next); +} + +function query(data, next) { + return validate('query', data, next); +} + +function request(data, next) { + return validate('request', data, next); +} + +function response(data, next) { + return validate('response', data, next); +} + +function timings(data, next) { + return validate('timings', data, next); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/error.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/error.js new file mode 100644 index 0000000000..4149ed7371 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/error.js @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = HARError; +function HARError(errors) { + let message = 'validation failed'; + + this.name = 'HARError'; + this.message = message; + this.errors = errors; + + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } +} + +HARError.prototype = Error.prototype; +module.exports = exports['default']; \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/promise.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/promise.js new file mode 100644 index 0000000000..be7017ae05 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node6/promise.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.afterRequest = afterRequest; +exports.beforeRequest = beforeRequest; +exports.browser = browser; +exports.cache = cache; +exports.content = content; +exports.cookie = cookie; +exports.creator = creator; +exports.entry = entry; +exports.har = har; +exports.header = header; +exports.log = log; +exports.page = page; +exports.pageTimings = pageTimings; +exports.postData = postData; +exports.query = query; +exports.request = request; +exports.response = response; +exports.timings = timings; + +var _harSchema = require('har-schema'); + +var schemas = _interopRequireWildcard(_harSchema); + +var _ajv = require('ajv'); + +var _ajv2 = _interopRequireDefault(_ajv); + +var _error = require('./error'); + +var _error2 = _interopRequireDefault(_error); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +let ajv; + +function validate(name, data = {}) { + // validator config + ajv = ajv || new _ajv2.default({ + allErrors: true, + schemas: schemas + }); + + let validate = ajv.getSchema(name + '.json'); + + return new Promise((resolve, reject) => { + let valid = validate(data); + + !valid ? reject(new _error2.default(validate.errors)) : resolve(data); + }); +} + +function afterRequest(data) { + return validate('afterRequest', data); +} + +function beforeRequest(data) { + return validate('beforeRequest', data); +} + +function browser(data) { + return validate('browser', data); +} + +function cache(data) { + return validate('cache', data); +} + +function content(data) { + return validate('content', data); +} + +function cookie(data) { + return validate('cookie', data); +} + +function creator(data) { + return validate('creator', data); +} + +function entry(data) { + return validate('entry', data); +} + +function har(data) { + return validate('har', data); +} + +function header(data) { + return validate('header', data); +} + +function log(data) { + return validate('log', data); +} + +function page(data) { + return validate('page', data); +} + +function pageTimings(data) { + return validate('pageTimings', data); +} + +function postData(data) { + return validate('postData', data); +} + +function query(data) { + return validate('query', data); +} + +function request(data) { + return validate('request', data); +} + +function response(data) { + return validate('response', data); +} + +function timings(data) { + return validate('timings', data); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/async.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/async.js new file mode 100644 index 0000000000..e707043adf --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/async.js @@ -0,0 +1,133 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.afterRequest = afterRequest; +exports.beforeRequest = beforeRequest; +exports.browser = browser; +exports.cache = cache; +exports.content = content; +exports.cookie = cookie; +exports.creator = creator; +exports.entry = entry; +exports.har = har; +exports.header = header; +exports.log = log; +exports.page = page; +exports.pageTimings = pageTimings; +exports.postData = postData; +exports.query = query; +exports.request = request; +exports.response = response; +exports.timings = timings; + +var _harSchema = require('har-schema'); + +var schemas = _interopRequireWildcard(_harSchema); + +var _ajv = require('ajv'); + +var _ajv2 = _interopRequireDefault(_ajv); + +var _error = require('./error'); + +var _error2 = _interopRequireDefault(_error); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +let ajv; + +function validate(name, data = {}, next) { + // validator config + ajv = ajv || new _ajv2.default({ + allErrors: true, + schemas: schemas + }); + + let validate = ajv.getSchema(name + '.json'); + + let valid = validate(data); + + // callback? + if (typeof next === 'function') { + return next(!valid ? new _error2.default(validate.errors) : null, valid); + } + + return valid; +} + +function afterRequest(data, next) { + return validate('afterRequest', data, next); +} + +function beforeRequest(data, next) { + return validate('beforeRequest', data, next); +} + +function browser(data, next) { + return validate('browser', data, next); +} + +function cache(data, next) { + return validate('cache', data, next); +} + +function content(data, next) { + return validate('content', data, next); +} + +function cookie(data, next) { + return validate('cookie', data, next); +} + +function creator(data, next) { + return validate('creator', data, next); +} + +function entry(data, next) { + return validate('entry', data, next); +} + +function har(data, next) { + return validate('har', data, next); +} + +function header(data, next) { + return validate('header', data, next); +} + +function log(data, next) { + return validate('log', data, next); +} + +function page(data, next) { + return validate('page', data, next); +} + +function pageTimings(data, next) { + return validate('pageTimings', data, next); +} + +function postData(data, next) { + return validate('postData', data, next); +} + +function query(data, next) { + return validate('query', data, next); +} + +function request(data, next) { + return validate('request', data, next); +} + +function response(data, next) { + return validate('response', data, next); +} + +function timings(data, next) { + return validate('timings', data, next); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/error.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/error.js new file mode 100644 index 0000000000..4149ed7371 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/error.js @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = HARError; +function HARError(errors) { + let message = 'validation failed'; + + this.name = 'HARError'; + this.message = message; + this.errors = errors; + + if (typeof Error.captureStackTrace === 'function') { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error(message).stack; + } +} + +HARError.prototype = Error.prototype; +module.exports = exports['default']; \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/promise.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/promise.js new file mode 100644 index 0000000000..be7017ae05 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/node7/promise.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.validate = validate; +exports.afterRequest = afterRequest; +exports.beforeRequest = beforeRequest; +exports.browser = browser; +exports.cache = cache; +exports.content = content; +exports.cookie = cookie; +exports.creator = creator; +exports.entry = entry; +exports.har = har; +exports.header = header; +exports.log = log; +exports.page = page; +exports.pageTimings = pageTimings; +exports.postData = postData; +exports.query = query; +exports.request = request; +exports.response = response; +exports.timings = timings; + +var _harSchema = require('har-schema'); + +var schemas = _interopRequireWildcard(_harSchema); + +var _ajv = require('ajv'); + +var _ajv2 = _interopRequireDefault(_ajv); + +var _error = require('./error'); + +var _error2 = _interopRequireDefault(_error); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +let ajv; + +function validate(name, data = {}) { + // validator config + ajv = ajv || new _ajv2.default({ + allErrors: true, + schemas: schemas + }); + + let validate = ajv.getSchema(name + '.json'); + + return new Promise((resolve, reject) => { + let valid = validate(data); + + !valid ? reject(new _error2.default(validate.errors)) : resolve(data); + }); +} + +function afterRequest(data) { + return validate('afterRequest', data); +} + +function beforeRequest(data) { + return validate('beforeRequest', data); +} + +function browser(data) { + return validate('browser', data); +} + +function cache(data) { + return validate('cache', data); +} + +function content(data) { + return validate('content', data); +} + +function cookie(data) { + return validate('cookie', data); +} + +function creator(data) { + return validate('creator', data); +} + +function entry(data) { + return validate('entry', data); +} + +function har(data) { + return validate('har', data); +} + +function header(data) { + return validate('header', data); +} + +function log(data) { + return validate('log', data); +} + +function page(data) { + return validate('page', data); +} + +function pageTimings(data) { + return validate('pageTimings', data); +} + +function postData(data) { + return validate('postData', data); +} + +function query(data) { + return validate('query', data); +} + +function request(data) { + return validate('request', data); +} + +function response(data) { + return validate('response', data); +} + +function timings(data) { + return validate('timings', data); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/runner.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/runner.js deleted file mode 100644 index f0ed484e15..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/runner.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -var schemas = require('./schemas') -var ValidationError = require('./error') -var validator = require('is-my-json-valid') - -module.exports = function (schema, data, cb) { - // default value - var valid = false - - // validator config - var validate = validator(schema, { - greedy: true, - verbose: true, - schemas: schemas - }) - - // execute is-my-json-valid - if (data !== undefined) { - valid = validate(data) - } - - // callback? - if (typeof cb === 'function') { - return cb(validate.errors ? new ValidationError(validate.errors) : null, valid) - } - - return valid -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cache.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cache.json deleted file mode 100644 index a3ab682d53..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cache.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "properties": { - "beforeRequest": { - "$ref": "#cacheEntry" - }, - "afterRequest": { - "$ref": "#cacheEntry" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json deleted file mode 100644 index a397439fd9..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cacheEntry.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "oneOf": [{ - "type": "object", - "optional": true, - "required": [ - "lastAccess", - "eTag", - "hitCount" - ], - "properties": { - "expires": { - "type": "string" - }, - "lastAccess": { - "type": "string" - }, - "eTag": { - "type": "string" - }, - "hitCount": { - "type": "integer" - }, - "comment": { - "type": "string" - } - } - }, { - "type": null, - "additionalProperties": false - }] -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/content.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/content.json deleted file mode 100644 index 3710d7939b..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/content.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "type": "object", - "required": [ - "size", - "mimeType" - ], - "properties": { - "size": { - "type": "integer" - }, - "compression": { - "type": "integer" - }, - "mimeType": { - "type": "string" - }, - "text": { - "type": "string" - }, - "encoding": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json deleted file mode 100644 index 5768181838..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/cookie.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "object", - "required": [ - "name", - "value" - ], - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - }, - "path": { - "type": "string" - }, - "domain": { - "type": "string" - }, - "expires": { - "type": ["string", "null"], - "format": "date-time" - }, - "httpOnly": { - "type": "boolean" - }, - "secure": { - "type": "boolean" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/creator.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/creator.json deleted file mode 100644 index 5058600646..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/creator.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "object", - "required": [ - "name", - "version" - ], - "properties": { - "name": { - "type": "string" - }, - "version": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/entry.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/entry.json deleted file mode 100644 index 8a9c022bda..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/entry.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "object", - "optional": true, - "required": [ - "startedDateTime", - "time", - "request", - "response", - "cache", - "timings" - ], - "properties": { - "pageref": { - "type": "string" - }, - "startedDateTime": { - "type": "string", - "format": "date-time", - "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" - }, - "time": { - "type": "number", - "min": 0 - }, - "request": { - "$ref": "#request" - }, - "response": { - "$ref": "#response" - }, - "cache": { - "$ref": "#cache" - }, - "timings": { - "$ref": "#timings" - }, - "serverIPAddress": { - "type": "string", - "oneOf": [ - { "format": "ipv4" }, - { "format": "ipv6" } - ] - }, - "connection": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/har.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/har.json deleted file mode 100644 index b542782db4..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/har.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "type": "object", - "required": [ - "log" - ], - "properties": { - "log": { - "$ref": "#log" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/index.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/index.js deleted file mode 100644 index 7b6db7dabb..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/index.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict' - -var schemas = { - cache: require('./cache.json'), - cacheEntry: require('./cacheEntry.json'), - content: require('./content.json'), - cookie: require('./cookie.json'), - creator: require('./creator.json'), - entry: require('./entry.json'), - har: require('./har.json'), - log: require('./log.json'), - page: require('./page.json'), - pageTimings: require('./pageTimings.json'), - postData: require('./postData.json'), - record: require('./record.json'), - request: require('./request.json'), - response: require('./response.json'), - timings: require('./timings.json') -} - -// is-my-json-valid does not provide meaningful error messages for external schemas -// this is a workaround -schemas.cache.properties.beforeRequest = schemas.cacheEntry -schemas.cache.properties.afterRequest = schemas.cacheEntry - -schemas.page.properties.pageTimings = schemas.pageTimings - -schemas.request.properties.cookies.items = schemas.cookie -schemas.request.properties.headers.items = schemas.record -schemas.request.properties.queryString.items = schemas.record -schemas.request.properties.postData = schemas.postData - -schemas.response.properties.cookies.items = schemas.cookie -schemas.response.properties.headers.items = schemas.record -schemas.response.properties.content = schemas.content - -schemas.entry.properties.request = schemas.request -schemas.entry.properties.response = schemas.response -schemas.entry.properties.cache = schemas.cache -schemas.entry.properties.timings = schemas.timings - -schemas.log.properties.creator = schemas.creator -schemas.log.properties.browser = schemas.creator -schemas.log.properties.pages.items = schemas.page -schemas.log.properties.entries.items = schemas.entry - -schemas.har.properties.log = schemas.log - -module.exports = schemas diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/log.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/log.json deleted file mode 100644 index 0c91d38bf5..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/log.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "object", - "required": [ - "version", - "creator", - "entries" - ], - "properties": { - "version": { - "type": "string" - }, - "creator": { - "$ref": "#creator" - }, - "browser": { - "$ref": "#creator" - }, - "pages": { - "type": "array", - "items": { - "$ref": "#page" - } - }, - "entries": { - "type": "array", - "items": { - "$ref": "#entry" - } - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/page.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/page.json deleted file mode 100644 index ef64abe5c5..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/page.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "type": "object", - "optional": true, - "required": [ - "startedDateTime", - "id", - "title", - "pageTimings" - ], - "properties": { - "startedDateTime": { - "type": "string", - "format": "date-time", - "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))" - }, - "id": { - "type": "string", - "unique": true - }, - "title": { - "type": "string" - }, - "pageTimings": { - "$ref": "#pageTimings" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json deleted file mode 100644 index adc83cccd0..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/pageTimings.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "object", - "properties": { - "onContentLoad": { - "type": "number", - "min": -1 - }, - "onLoad": { - "type": "number", - "min": -1 - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/postData.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/postData.json deleted file mode 100644 index 91958b64a5..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/postData.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "type": "object", - "optional": true, - "required": [ - "mimeType" - ], - "properties": { - "mimeType": { - "type": "string" - }, - "text": { - "type": "string" - }, - "params": { - "type": "array", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - }, - "fileName": { - "type": "string" - }, - "contentType": { - "type": "string" - }, - "comment": { - "type": "string" - } - } - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/record.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/record.json deleted file mode 100644 index 04acd51948..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/record.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "type": "object", - "required": [ - "name", - "value" - ], - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": "string" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/request.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/request.json deleted file mode 100644 index 639af06dc2..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/request.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "type": "object", - "required": [ - "method", - "url", - "httpVersion", - "cookies", - "headers", - "queryString", - "headersSize", - "bodySize" - ], - "properties": { - "method": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - }, - "httpVersion": { - "type": "string" - }, - "cookies": { - "type": "array", - "items": { - "$ref": "#cookie" - } - }, - "headers": { - "type": "array", - "items": { - "$ref": "#record" - } - }, - "queryString": { - "type": "array", - "items": { - "$ref": "#record" - } - }, - "postData": { - "$ref": "#postData" - }, - "headersSize": { - "type": "integer" - }, - "bodySize": { - "type": "integer" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/response.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/response.json deleted file mode 100644 index de99c55bb9..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/response.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "type": "object", - "required": [ - "status", - "statusText", - "httpVersion", - "cookies", - "headers", - "content", - "redirectURL", - "headersSize", - "bodySize" - ], - "properties": { - "status": { - "type": "integer" - }, - "statusText": { - "type": "string" - }, - "httpVersion": { - "type": "string" - }, - "cookies": { - "type": "array", - "items": { - "$ref": "#cookie" - } - }, - "headers": { - "type": "array", - "items": { - "$ref": "#record" - } - }, - "content": { - "$ref": "#content" - }, - "redirectURL": { - "type": "string" - }, - "headersSize": { - "type": "integer" - }, - "bodySize": { - "type": "integer" - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/timings.json b/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/timings.json deleted file mode 100644 index 066ef71a14..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/schemas/timings.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "required": [ - "send", - "wait", - "receive" - ], - "properties": { - "dns": { - "type": "number", - "min": -1 - }, - "connect": { - "type": "number", - "min": -1 - }, - "blocked": { - "type": "number", - "min": -1 - }, - "send": { - "type": "number", - "min": -1 - }, - "wait": { - "type": "number", - "min": -1 - }, - "receive": { - "type": "number", - "min": -1 - }, - "ssl": { - "type": "number", - "min": -1 - }, - "comment": { - "type": "string" - } - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/.tonic_example.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/.tonic_example.js new file mode 100644 index 0000000000..0c3cc86ce3 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/.tonic_example.js @@ -0,0 +1,20 @@ +var Ajv = require('ajv'); +var ajv = Ajv({allErrors: true}); + +var schema = { + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "number", "maximum": 3 } + } +}; + +var validate = ajv.compile(schema); + +test({"foo": "abc", "bar": 2}); +test({"foo": 2, "bar": 4}); + +function test(data) { + var valid = validate(data); + if (valid) console.log('Valid!'); + else console.log('Invalid: ' + ajv.errorsText(validate.errors)); +} \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/LICENSE b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/LICENSE new file mode 100644 index 0000000000..09f090263b --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Evgeny Poberezkin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/README.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/README.md new file mode 100644 index 0000000000..f6ed67b4d1 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/README.md @@ -0,0 +1,1207 @@ +# Ajv: Another JSON Schema Validator + +The fastest JSON Schema validator for node.js and browser. Supports [v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals). + + +[![Build Status](https://travis-ci.org/epoberezkin/ajv.svg?branch=master)](https://travis-ci.org/epoberezkin/ajv) +[![npm version](https://badge.fury.io/js/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Code Climate](https://codeclimate.com/github/epoberezkin/ajv/badges/gpa.svg)](https://codeclimate.com/github/epoberezkin/ajv) +[![Coverage Status](https://coveralls.io/repos/epoberezkin/ajv/badge.svg?branch=master&service=github)](https://coveralls.io/github/epoberezkin/ajv?branch=master) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) + + +__Please note__: You can start using NEW beta version [5.0.3](https://github.com/epoberezkin/ajv/releases/tag/5.0.3-beta.0) (see [migration guide from 4.x.x](https://github.com/epoberezkin/ajv/releases/tag/5.0.1-beta.0)) with the support of JSON-Schema draft-06 (not officially published yet): `npm install ajv@^5.0.3-beta`. + +Also see [docs](https://github.com/epoberezkin/ajv/tree/5.0.3-beta.0) for 5.0.3. + + +## Contents + +- [Performance](#performance) +- [Features](#features) +- [Getting started](#getting-started) +- [Frequently Asked Questions](https://github.com/epoberezkin/ajv/blob/master/FAQ.md) +- [Using in browser](#using-in-browser) +- [Command line interface](#command-line-interface) +- Validation + - [Keywords](#validation-keywords) + - [Formats](#formats) + - [$data reference](#data-reference) + - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) + - [Defining custom keywords](#defining-custom-keywords) + - [Asynchronous schema compilation](#asynchronous-compilation) + - [Asynchronous validation](#asynchronous-validation) +- Modifying data during validation + - [Filtering data](#filtering-data) + - [Assigning defaults](#assigning-defaults) + - [Coercing data types](#coercing-data-types) +- API + - [Methods](#api) + - [Options](#options) + - [Validation errors](#validation-errors) +- [Related packages](#related-packages) +- [Packages using Ajv](#some-packages-using-ajv) +- [Tests, Contributing, History, License](#tests) + + +## Performance + +Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + + +Performace of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:%7Cajv%7Cis-my-json-valid%7Cjsen%7Cschemasaurus%7Cthemis%7Cz-schema%7Cjsck%7Cjsonschema%7Cskeemas%7Ctv4%7Cjayschema&chd=t:100,68,61,22.8,17.6,6.6,2.7,0.9,0.7,0.4,0.1)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + + +## Features + +- Ajv implements full [JSON Schema draft 4](http://json-schema.org/) standard: + - all validation keywords (see [JSON-Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md)) + - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) + - support of circular references between schemas + - correct string lengths for strings with unicode pairs (can be turned off) + - [formats](#formats) defined by JSON Schema draft 4 standard and custom formats (can be turned off) + - [validates schemas against meta-schema](#api-validateschema) +- supports [browsers](#using-in-browser) and nodejs 0.10-6.x +- [asynchronous loading](#asynchronous-compilation) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](#options) +- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages +- i18n error messages support with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package +- [filtering data](#filtering-data) from additional properties +- [assigning defaults](#assigning-defaults) to missing properties and items +- [coercing data](#coercing-data-types) to the types specified in `type` keywords +- [custom keywords](#defining-custom-keywords) +- keywords `switch`, `constant`, `contains`, `patternGroups`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON-schema v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [option v5](#options) +- [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#) for schemas using v5 keywords +- [v5 $data reference](#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](#asynchronous-validation) of custom formats and keywords + +Currently Ajv is the only validator that passes all the tests from [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (according to [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark), apart from the test that requires that `1.0` is not an integer that is impossible to satisfy in JavaScript). + + +## Install + +``` +npm install ajv +``` + +To install a stable beta version [5.0.3](https://github.com/epoberezkin/ajv/releases/tag/5.0.3-beta.0) (see [migration guide from 4.x.x](https://github.com/epoberezkin/ajv/releases/tag/5.0.1-beta.0)): + +``` +npm install ajv@^5.0.3-beta +``` + + +## Getting started + +Try it in the node REPL: https://tonicdev.com/npm/ajv + + +The fastest validation call: + +```javascript +var Ajv = require('ajv'); +var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} +var validate = ajv.compile(schema); +var valid = validate(data); +if (!valid) console.log(validate.errors); +``` + +or with less code + +```javascript +// ... +var valid = ajv.validate(schema, data); +if (!valid) console.log(ajv.errors); +// ... +``` + +or + +```javascript +// ... +ajv.addSchema(schema, 'mySchema'); +var valid = ajv.validate('mySchema', data); +if (!valid) console.log(ajv.errorsText()); +// ... +``` + +See [API](#api) and [Options](#options) for more details. + +Ajv compiles schemas to functions and caches them in all cases (using schema stringified with [json-stable-stringify](https://github.com/substack/json-stable-stringify) as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. + +The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). + +__Please note__: every time validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) + + +## Using in browser + +You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. + +If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). + +Then you need to load Ajv in the browser: +```html + +``` + +This bundle can be used with different module systems or creates global `Ajv` if no module system is found. + +The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). + +Ajv is tested with these browsers: + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) + +__Please note__: some frameworks, e.g. Dojo, may redifine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/epoberezkin/ajv/issues/234)). + + +## Command line interface + +CLI is available as a separate npm package [ajv-cli](https://github.com/jessedc/ajv-cli). It supports: + +- compiling JSON-schemas to test their validity +- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/epoberezkin/ajv-pack)) +- validating data file(s) against JSON-schema +- testing expected validity of data against JSON-schema +- referenced schemas +- custom meta-schemas +- files in JSON and JavaScript format +- all Ajv options +- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format + + +## Validation keywords + +Ajv supports all validation keywords from draft 4 of JSON-schema standard: + +- [type](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#type) +- [for numbers](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf +- [for strings](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format +- [for arrays](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems +- [for objects](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minproperties, required, properties, patternProperties, additionalProperties, dependencies +- [compound keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, not, oneOf, anyOf, allOf + +With option `v5: true` Ajv also supports all validation keywords and [$data reference](#data-reference) from [v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON-schema standard: + +- [switch](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#switch-v5-proposal) - conditional validation with a sequence of if/then clauses +- [contains](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#contains-v5-proposal) - check that array contains a valid item +- [constant](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#constant-v5-proposal) - check that data is equal to some value +- [patternGroups](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#patterngroups-v5-proposal) - a more powerful alternative to patternProperties +- [patternRequired](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#patternrequired-v5-proposal) - like `required` but with patterns that some property should match. +- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-v5-proposal) - setting limits for date, time, etc. + +See [JSON-Schema validation keywords](https://github.com/epoberezkin/ajv/blob/master/KEYWORDS.md) for more details. + + +## Formats + +The following formats are supported for string validation with "format" keyword: + +- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). +- _time_: time with optional time-zone. +- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). +- _uri_: full uri with optional protocol. +- _email_: email address. +- _hostname_: host name acording to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). +- _ipv4_: IP address v4. +- _ipv6_: IP address v6. +- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. +- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). +- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). +- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). + +There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `email`, and `hostname`. See [Options](#options) for details. + +You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. + +The option `unknownFormats` allows to change the behaviour in case an unknown format is encountered - Ajv can either ignore them (default now) or fail schema compilation (will be the default in 5.0.0). + +You can find patterns used for format validation and the sources that were used in [formats.js](https://github.com/epoberezkin/ajv/blob/master/lib/compile/formats.js). + + +## $data reference + +With `v5` option you can use values from the validated data as the values for the schema keywords. See [v5 proposal](https://github.com/json-schema/json-schema/wiki/$data-(v5-proposal)) for more information about how it works. + +`$data` reference is supported in the keywords: constant, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. + +The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). + +Examples. + +This schema requires that the value in property `smaller` is less or equal than the value in the property larger: + +```javascript +var schema = { + "properties": { + "smaller": { + "type": "number", + "maximum": { "$data": "1/larger" } + }, + "larger": { "type": "number" } + } +}; + +var validData = { + smaller: 5, + larger: 7 +}; +``` + +This schema requires that the properties have the same format as their field names: + +```javascript +var schema = { + "additionalProperties": { + "type": "string", + "format": { "$data": "0#" } + } +}; + +var validData = { + 'date-time': '1963-06-19T08:30:06.283185Z', + email: 'joe.bloggs@example.com' +} +``` + +`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `constant` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. + + +## $merge and $patch keywords + +With v5 option and the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON-schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). + +To add keywords `$merge` and `$patch` to Ajv instance use this code: + +```javascript +require('ajv-merge-patch')(ajv); +``` + +Examples. + +Using `$merge`: + +```json +{ + "$merge": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": { + "properties": { "q": { "type": "number" } } + } + } +} +``` + +Using `$patch`: + +```json +{ + "$patch": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": [ + { "op": "add", "path": "/properties/q", "value": { "type": "number" } } + ] + } +} +``` + +The schemas above are equivalent to this schema: + +```json +{ + "type": "object", + "properties": { + "p": { "type": "string" }, + "q": { "type": "number" } + }, + "additionalProperties": false +} +``` + +The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. + +See the package [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) for more information. + + +## Defining custom keywords + +The advantages of using custom keywords are: + +- allow creating validation scenarios that cannot be expressed using JSON-Schema +- simplify your schemas +- help bringing a bigger part of the validation logic to your schemas +- make your schemas more expressive, less verbose and closer to your application domain +- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated + +If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). + +The concerns you have to be aware of when extending JSON-schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. + +You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. + +Ajv allows defining keywords with: +- validation function +- compilation function +- macro function +- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. + +Example. `range` and `exclusiveRange` keywords using compiled schema: + +```javascript +ajv.addKeyword('range', { type: 'number', compile: function (sch, parentSchema) { + var min = sch[0]; + var max = sch[1]; + + return parentSchema.exclusiveRange === true + ? function (data) { return data > min && data < max; } + : function (data) { return data >= min && data <= max; } +} }); + +var schema = { "range": [2, 4], "exclusiveRange": true }; +var validate = ajv.compile(schema); +console.log(validate(2.01)); // true +console.log(validate(3.99)); // true +console.log(validate(2)); // false +console.log(validate(4)); // false +``` + +Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. + +See [Defining custom keywords](https://github.com/epoberezkin/ajv/blob/master/CUSTOM.md) for more details. + + +## Asynchronous compilation + +During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` method and `loadSchema` [option](#options). + +Example: + +```javascript +var ajv = new Ajv({ loadSchema: loadSchema }); + +ajv.compileAsync(schema, function (err, validate) { + if (err) return; + var valid = validate(data); +}); + +function loadSchema(uri, callback) { + request.json(uri, function(err, res, body) { + if (err || res.statusCode >= 400) + callback(err || new Error('Loading error: ' + res.statusCode)); + else + callback(null, body); + }); +} +``` + +__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. + + +## Asynchronous validation + +Example in node REPL: https://tonicdev.com/esp/ajv-asynchronous-validation + +You can define custom formats and keywords that perform validation asyncronously by accessing database or some service. You should add `async: true` in the keyword or format defnition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). + +If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. + +__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. + +Validation function for an asynchronous custom format/keyword should return a promise that resolves to `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). Ajv compiles asynchronous schemas to either [generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) (default) that can be optionally transpiled with [regenerator](https://github.com/facebook/regenerator) or to [es7 async function](http://tc39.github.io/ecmascript-asyncawait/) that can be transpiled with [nodent](https://github.com/MatAtBread/nodent) or with regenerator as well. You can also supply any other transpiler as a function. See [Options](#options). + +The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both syncronous and asynchronous schemas. + +If you are using generators, the compiled validation function can be either wrapped with [co](https://github.com/tj/co) (default) or returned as generator function, that can be used directly, e.g. in [koa](http://koajs.com/) 1.0. `co` is a small library, it is included in Ajv (both as npm dependency and in the browser bundle). + +Generator functions are currently supported in Chrome, Firefox and node.js (0.11+); if you are using Ajv in other browsers or in older versions of node.js you should use one of available transpiling options. All provided async modes use global Promise class. If your platform does not have Promise you should use a polyfill that defines it. + +Validation result will be a promise that resolves to `true` or rejects with an exception `Ajv.ValidationError` that has the array of validation errors in `errors` property. + + +Example: + +```javascript +/** + * without "async" and "transpile" options (or with option {async: true}) + * Ajv will choose the first supported/installed option in this order: + * 1. native generator function wrapped with co + * 2. es7 async functions transpiled with nodent + * 3. es7 async functions transpiled with regenerator + */ + +var ajv = new Ajv; + +ajv.addKeyword('idExists', { + async: true, + type: 'number', + validate: checkIdExists +}); + + +function checkIdExists(schema, data) { + return knex(schema.table) + .select('id') + .where('id', data) + .then(function (rows) { + return !!rows.length; // true if record is found + }); +} + +var schema = { + "$async": true, + "properties": { + "userId": { + "type": "integer", + "idExists": { "table": "users" } + }, + "postId": { + "type": "integer", + "idExists": { "table": "posts" } + } + } +}; + +var validate = ajv.compile(schema); + +validate({ userId: 1, postId: 19 })) +.then(function (valid) { + // "valid" is always true here + console.log('Data is valid'); +}) +.catch(function (err) { + if (!(err instanceof Ajv.ValidationError)) throw err; + // data is invalid + console.log('Validation errors:', err.errors); +}); + +``` + +### Using transpilers with asyncronous validation functions. + +To use a transpiler you should separately install it (or load its bundle in the browser). + +Ajv npm package includes minified browser bundles of regenerator and nodent in dist folder. + + +#### Using nodent + +```javascript +var ajv = new Ajv({ /* async: 'es7', */ transpile: 'nodent' }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +`npm install nodent` or use `nodent.min.js` from dist folder of npm package. + + +#### Using regenerator + +```javascript +var ajv = new Ajv({ /* async: 'es7', */ transpile: 'regenerator' }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +`npm install regenerator` or use `regenerator.min.js` from dist folder of npm package. + + +#### Using other transpilers + +```javascript +var ajv = new Ajv({ async: 'es7', transpile: transpileFunc }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +See [Options](#options). + + +#### Comparison of async modes + +|mode|transpile
          speed*|run-time
          speed*|bundle
          size| +|---|:-:|:-:|:-:| +|generators
          (native)|-|1.0|-| +|es7.nodent|1.35|1.1|183Kb| +|es7.regenerator|1.0|2.7|322Kb| +|regenerator|1.0|3.2|322Kb| + +\* Relative performance in node v.4, smaller is better. + +[nodent](https://github.com/MatAtBread/nodent) has several advantages: + +- much smaller browser bundle than regenerator +- almost the same performance of generated code as native generators in nodejs and the latest Chrome +- much better performace than native generators in other browsers +- works in IE 9 (regenerator does not) + +[regenerator](https://github.com/facebook/regenerator) is a more widely adopted alternative. + + +## Filtering data + +With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. + +This option modifies original data. + +Example: + +```javascript +var ajv = new Ajv({ removeAdditional: true }); +var schema = { + "additionalProperties": false, + "properties": { + "foo": { "type": "number" }, + "bar": { + "additionalProperties": { "type": "number" }, + "properties": { + "baz": { "type": "string" } + } + } + } +} + +var data = { + "foo": 0, + "additional1": 1, // will be removed; `additionalProperties` == false + "bar": { + "baz": "abc", + "additional2": 2 // will NOT be removed; `additionalProperties` != false + }, +} + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } +``` + +If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. + +If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). + +__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: + +```JSON +{ + "type": "object", + "oneOf": [ + { + "properties": { + "foo": { "type": "string" } + }, + "required": [ "foo" ], + "additionalProperties": false + }, + { + "properties": { + "bar": { "type": "integer" } + }, + "required": [ "bar" ], + "additionalProperties": false + } + ] +} +``` + +The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. + +With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). + +While this behaviour is unexpected (issues [#129](https://github.com/epoberezkin/ajv/issues/129), [#134](https://github.com/epoberezkin/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: + +```JSON +{ + "type": "object", + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "integer" } + }, + "additionalProperties": false, + "oneOf": [ + { "required": [ "foo" ] }, + { "required": [ "bar" ] } + ] +} +``` + +The schema above is also more efficient - it will compile into a faster function. + + +## Assigning defaults + +With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. + +This option modifies original data. + +__Please note__: by default the default value is inserted in the generated validation code as a literal (starting from v4.0), so the value inserted in the data will be the deep clone of the default in the schema. + +If you need to insert the default value in the data by reference pass the option `useDefaults: "shared"`. + +Inserting defaults by reference can be faster (in case you have an object in `default`) and it allows to have dynamic values in defaults, e.g. timestamp, without recompiling the schema. The side effect is that modifying the default value in any validated data instance will change the default in the schema and in other validated data instances. See example 3 below. + + +Example 1 (`default` in `properties`): + +```javascript +var ajv = new Ajv({ useDefaults: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "string", "default": "baz" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": 1 }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": "baz" } +``` + +Example 2 (`default` in `items`): + +```javascript +var schema = { + "type": "array", + "items": [ + { "type": "number" }, + { "type": "string", "default": "foo" } + ] +} + +var data = [ 1 ]; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // [ 1, "foo" ] +``` + +Example 3 (inserting "defaults" by reference): + +```javascript +var ajv = new Ajv({ useDefaults: 'shared' }); + +var schema = { + properties: { + foo: { + default: { bar: 1 } + } + } +} + +var validate = ajv.compile(schema); + +var data = {}; +console.log(validate(data)); // true +console.log(data); // { foo: { bar: 1 } } + +data.foo.bar = 2; + +var data2 = {}; +console.log(validate(data2)); // true +console.log(data2); // { foo: { bar: 2 } } +``` + +`default` keywords in other cases are ignored: + +- not in `properties` or `items` subschemas +- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/epoberezkin/ajv/issues/42)) +- in `if` subschema of v5 `switch` keyword +- in schemas generated by custom macro keywords + + +## Coercing data types + +When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. + +This option modifies original data. + +__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. + + +Example 1: + +```javascript +var ajv = new Ajv({ coerceTypes: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "boolean" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": "1", "bar": "false" }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": false } +``` + +Example 2 (array coercions): + +```javascript +var ajv = new Ajv({ coerceTypes: 'array' }); +var schema = { + "properties": { + "foo": { "type": "array", "items": { "type": "number" } }, + "bar": { "type": "boolean" } + } +}; + +var data = { "foo": "1", "bar": ["false"] }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": [1], "bar": false } +``` + +The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). + +See [Coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md) for details. + + +## API + +##### new Ajv(Object options) -> Object + +Create Ajv instance. + +All the instance methods below are bound to the instance, so they can be used without the instance. + + +##### .compile(Object schema) -> Function<Object data> + +Generate validating function and cache the compiled schema for future use. + +Validating function returns boolean and has properties `errors` with the errors from the last validation (`null` if there were no errors) and `schema` with the reference to the original schema. + +Unless the option `validateSchema` is false, the schema will be validated against meta-schema and if schema is invalid the error will be thrown. See [options](#options). + + +##### .compileAsync(Object schema, Function callback) + +Asyncronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. Callback will always be called with 2 parameters: error (or null) and validating function. Error will be not null in the following cases: + +- missing schema can't be loaded (`loadSchema` calls callback with error). +- the schema containing missing reference is loaded, but the reference cannot be resolved. +- schema (or some referenced schema) is invalid. + +The function compiles schema and loads the first missing schema multiple times, until all missing schemas are loaded. + +See example in [Asynchronous compilation](#asynchronous-compilation). + + +##### .validate(Object schema|String key|String ref, data) -> Boolean + +Validate data using passed schema (it will be compiled and cached). + +Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. + +Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). + +__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. + +If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). + + +##### .addSchema(Array<Object>|Object schema [, String key]) + +Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. + +Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. + +Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. + + +Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. + +Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. + +By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. + + +##### .addMetaSchema(Array<Object>|Object schema [, String key]) + +Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). + +There is no need to explicitly add draft 4 meta schema (http://json-schema.org/draft-04/schema and http://json-schema.org/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. + +With option `v5: true` [meta-schema that includes v5 keywords](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json) also added. + + +##### .validateSchema(Object schema) -> Boolean + +Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON-Schema standard. + +By default this method is called automatically when the schema is added, so you rarely need to use it directly. + +If schema doesn't have `$schema` property it is validated against draft 4 meta-schema (option `meta` should not be false) or against [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#) if option `v5` is true. + +If schema has `$schema` property then the schema with this id (that should be previously added) is used to validate passed schema. + +Errors will be available at `ajv.errors`. + + +##### .getSchema(String key) -> Function<Object data> + +Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). Returned validating function has `schema` property with the reference to the original schema. + + +##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) + +Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. + +Schema can be removed using: +- key passed to `addSchema` +- it's full reference (id) +- RegExp that should match schema id or key (meta-schemas won't be removed) +- actual schema object that will be stable-stringified to remove schema from cache + +If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. + + +##### .addFormat(String name, String|RegExp|Function|Object format) + +Add custom format to validate strings. It can also be used to replace pre-defined formats for Ajv instance. + +Strings are converted to RegExp. + +Function should return validation result as `true` or `false`. + +If object is passed it should have properties `validate`, `compare` and `async`: + +- _validate_: a string, RegExp or a function as described above. +- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (from [v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) - `v5` option should be used). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. +- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. + +Custom formats can be also added via `formats` option. + + +##### .addKeyword(String keyword, Object definition) + +Add custom validation keyword to Ajv instance. + +Keyword should be different from all standard JSON schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. + +Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. +It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. + +Example Keywords: +- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. +- `"example"`: valid, but not recommended as it could collide with future versions of JSON schema etc. +- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword + +Keyword definition is an object with the following properties: + +- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. +- _validate_: validating function +- _compile_: compiling function +- _macro_: macro function +- _inline_: compiling function that returns code (as string) +- _schema_: an optional `false` value used with "validate" keyword to not pass schema +- _metaSchema_: an optional meta-schema for keyword schema +- _modifying_: `true` MUST be passed if keyword modifies data +- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. +- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). +- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. +- _errors_: an optional boolean indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. + +_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. + +__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. + +See [Defining custom keywords](#defining-custom-keywords) for more details. + + +##### .getKeyword(String keyword) -> Object|Boolean + +Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. + + +##### .removeKeyword(String keyword) + +Removes custom or pre-defined keyword so you can redefine them. + +While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. + +__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. + + +##### .errorsText([Array<Object> errors [, Object options]]) -> String + +Returns the text with all errors in a String. + +Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). + + +## Options + +Defaults: + +```javascript +{ + // validation and reporting options: + v5: false, + allErrors: false, + verbose: false, + jsonPointers: false, + uniqueItems: true, + unicode: true, + format: 'fast', + formats: {}, + unknownFormats: 'ignore', + schemas: {}, + // referenced schema options: + missingRefs: true, + extendRefs: true, + loadSchema: undefined, // function(uri, cb) { /* ... */ cb(err, schema); }, + // options to modify validated data: + removeAdditional: false, + useDefaults: false, + coerceTypes: false, + // asynchronous validation options: + async: undefined, + transpile: undefined, + // advanced options: + meta: true, + validateSchema: true, + addUsedSchema: true, + inlineRefs: true, + passContext: false, + loopRequired: Infinity, + ownProperties: false, + multipleOfPrecision: false, + errorDataPath: 'object', + sourceCode: true, + messages: true, + beautify: false, + cache: new Cache +} +``` + +##### Validation and reporting options + +- _v5_: add keywords `switch`, `constant`, `contains`, `patternGroups`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON-schema v5 proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals). With this option added schemas without `$schema` property are validated against [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#). `false` by default. +- _allErrors_: check all rules collecting all errors. Default is to return after the first error. +- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). +- _jsonPointers_: set `dataPath` propery of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. +- _uniqueItems_: validate `uniqueItems` keyword (true by default). +- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. +- _format_: formats validation mode ('fast' by default). Pass 'full' for more correct and slow validation or `false` not to validate formats at all. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. +- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. +- _unknownFormats_: handling of unknown formats. Option values: + - `true` (will be default in 5.0.0) - if the unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [v5 $data reference](#data-reference) and it is unknown the validation will fail. + - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if some other unknown format is used. If `format` keyword value is [v5 $data reference](#data-reference) and it is not in this array the validation will fail. + - `"ignore"` (default now) - to log warning during schema compilation and always pass validation. This option is not recommended, as it allows to mistype format name. This behaviour is required by JSON-schema specification. +- _schemas_: an array or object of schemas that will be added to the instance. If the order is important, pass array. In this case schemas must have IDs in them. Otherwise the object can be passed - `addSchema(value, key)` will be called for each schema in this object. + + +##### Referenced schema options + +- _missingRefs_: handling of missing referenced schemas. Option values: + - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). + - `"ignore"` - to log error during compilation and always pass validation. + - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. +- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: + - `true` (default) - validate all keywords in the schemas with `$ref`. + - `"ignore"` - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. + - `"fail"` - if other validation keywords are used together with `$ref` the exception will be throw when the schema is compiled. +- _loadSchema_: asynchronous function that will be used to load remote schemas when the method `compileAsync` is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept 2 parameters: remote schema uri and node-style callback. See example in [Asynchronous compilation](#asynchronous-compilation). + + +##### Options to modify validated data + +- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: + - `false` (default) - not to remove additional properties + - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). + - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. + - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). +- _useDefaults_: replace missing properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: + - `false` (default) - do not use defaults + - `true` - insert defaults by value (safer and slower, object literal is used). + - `"shared"` - insert defaults by reference (faster). If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. +- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/epoberezkin/ajv/blob/master/COERCION.md). Option values: + - `false` (default) - no type coercion. + - `true` - coerce scalar data types. + - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). + + +##### Asynchronous validation options + +- _async_: determines how Ajv compiles asynchronous schemas (see [Asynchronous validation](#asynchronous-validation)) to functions. Option values: + - `"*"` / `"co*"` - compile to generator function ("co*" - wrapped with `co.wrap`). If generators are not supported and you don't provide `transpile` option, the exception will be thrown when Ajv instance is created. + - `"es7"` - compile to es7 async function. Unless your platform supports them you need to provide `transpile` option. Currently only MS Edge 13 with flag supports es7 async functions according to [compatibility table](http://kangax.github.io/compat-table/es7/)). + - `true` - if transpile option is not passed Ajv will choose the first supported/installed async/transpile modes in this order: "co*" (native generator with co.wrap), "es7"/"nodent", "co*"/"regenerator" during the creation of the Ajv instance. If none of the options is available the exception will be thrown. + - `undefined`- Ajv will choose the first available async mode in the same way as with `true` option but when the first asynchronous schema is compiled. +- _transpile_: determines whether Ajv transpiles compiled asynchronous validation function. Option values: + - `"nodent"` - transpile with [nodent](https://github.com/MatAtBread/nodent). If nodent is not installed, the exception will be thrown. nodent can only transpile es7 async functions; it will enforce this mode. + - `"regenerator"` - transpile with [regenerator](https://github.com/facebook/regenerator). If regenerator is not installed, the exception will be thrown. + - a function - this function should accept the code of validation function as a string and return transpiled code. This option allows you to use any other transpiler you prefer. + + +##### Advanced options + +- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). With option `v5: true` [v5 meta-schema](https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#) will be added as well. If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. +- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can either be http://json-schema.org/schema or http://json-schema.org/draft-04/schema or absent (draft-4 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: + - `true` (default) - if the validation fails, throw the exception. + - `"log"` - if the validation fails, log error. + - `false` - skip schema validation. +- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `id` property that doesn't start with "#". If `id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `id` uniqueness check when these methods are used. This option does not affect `addSchema` method. +- _inlineRefs_: Affects compilation of referenced schemas. Option values: + - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. + - `false` - to not inline referenced schemas (they will be compiled as separate functions). + - integer number - to limit the maximum number of keywords of the schema that will be inlined. +- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. +- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. +- _ownProperties_: by default ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. +- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/epoberezkin/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). +- _errorDataPath_: set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. +- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). +- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/epoberezkin/ajv-i18n)). +- _beautify_: format the generated function with [js-beautify](https://github.com/beautify-web/js-beautify) (the validating function is generated without line-breaks). `npm install js-beautify` to use this option. `true` or js-beautify options can be passed. +- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. + + +## Validation errors + +In case of validation failure Ajv assigns the array of errors to `.errors` property of validation function (or to `.errors` property of Ajv instance in case `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation) the returned promise is rejected with the exception of the class `Ajv.ValidationError` that has `.errors` poperty. + + +### Error objects + +Each error is an object with the following properties: + +- _keyword_: validation keyword. +- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). +- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. +- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) package). See below for parameters set by all keywords. +- _message_: the standard error message (can be excluded with option `messages` set to false). +- _schema_: the schema of the keyword (added with `verbose` option). +- _parentSchema_: the schema containing the keyword (added with `verbose` option) +- _data_: the data validated by the keyword (added with `verbose` option). + + +### Error parameters + +Properties of `params` object in errors depend on the keyword that failed validation. + +- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). +- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). +- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). +- `patternGroups` (with v5 option) - properties: + - `pattern` + - `reason` ("minimum"/"maximum"), + - `limit` (max/min allowed number of properties matching number) +- `dependencies` - properties: + - `property` (dependent property), + - `missingProperty` (required missing dependency - only the first one is reported currently) + - `deps` (required dependencies, comma separated list as a string), + - `depsCount` (the number of required dependedncies). +- `format` - property `format` (the schema of the keyword). +- `maximum`, `minimum` - properties: + - `limit` (number, the schema of the keyword), + - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), + - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") +- `multipleOf` - property `multipleOf` (the schema of the keyword) +- `pattern` - property `pattern` (the schema of the keyword) +- `required` - property `missingProperty` (required property that is missing). +- `patternRequired` (with v5 option) - property `missingPattern` (required pattern that did not match any property). +- `type` - property `type` (required type(s), a string, can be a comma-separated list) +- `uniqueItems` - properties `i` and `j` (indices of duplicate items). +- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). +- `$ref` - property `ref` with the referenced schema URI. +- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). + + +## Related packages + +- [ajv-cli](https://github.com/epoberezkin/ajv-cli) - command line interface for Ajv +- [ajv-i18n](https://github.com/epoberezkin/ajv-i18n) - internationalised error messages +- [ajv-merge-patch](https://github.com/epoberezkin/ajv-merge-patch) - keywords $merge and $patch from v5 proposals. +- [ajv-keywords](https://github.com/epoberezkin/ajv-keywords) - several custom keywords that can be used with Ajv (typeof, instanceof, range, propertyNames) + + +## Some packages using Ajv + +- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services +- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition +- [jsoneditor](https://github.com/josdejong/jsoneditor) - A web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - A web tool to validate JSON/YAML document against a single JSON-schema http://jsonschemalint.com +- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for node.js +- [table](https://github.com/gajus/table) - formats data into a string table +- [ripple-lib](https://github.com/ripple/ripple-lib) - A JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser +- [restbase](https://github.com/wikimedia/restbase) - Distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content +- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation +- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation +- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - A schema definition module for RabbitMQ graphs and messages +- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON-schema with expect in mocha tests +- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON-Schema +- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter +- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages + + +## Tests + +``` +npm install +git submodule update --init +npm test +``` + +## Contributing + +All validation functions are generated using doT templates in [dot](https://github.com/epoberezkin/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. + +`npm run build` - compiles templates to [dotjs](https://github.com/epoberezkin/ajv/tree/master/lib/dotjs) folder. + +`npm run watch` - automatically compiles templates when files in dot folder change + +Please see [Contributing guidelines](https://github.com/epoberezkin/ajv/blob/master/CONTRIBUTING.md) + + +## Changes history + +See https://github.com/epoberezkin/ajv/releases + +__Please note__: [Changes in version 5.0.1-beta](https://github.com/epoberezkin/ajv/releases/tag/5.0.1-beta.0). + +[Changes in version 4.6.0](https://github.com/epoberezkin/ajv/releases/tag/4.6.0). + +[Changes in version 4.0.0](https://github.com/epoberezkin/ajv/releases/tag/4.0.0). + +[Changes in version 3.0.0](https://github.com/epoberezkin/ajv/releases/tag/3.0.0). + +[Changes in version 2.0.0](https://github.com/epoberezkin/ajv/releases/tag/2.0.0). + + +## License + +[MIT](https://github.com/epoberezkin/ajv/blob/master/LICENSE) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/ajv.bundle.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/ajv.bundle.js new file mode 100644 index 0000000000..ce77b83b33 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/ajv.bundle.js @@ -0,0 +1,8041 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +function hostname(str) { + // https://tools.ietf.org/html/rfc1034#section-3.5 + // https://tools.ietf.org/html/rfc1123#section-2 + return str.length <= 255 && HOSTNAME.test(str); +} + + +var NOT_URI_FRAGMENT = /\/|\:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +function regex(str) { + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + + +function compareDate(d1, d2) { + if (!(d1 && d2)) return; + if (d1 > d2) return 1; + if (d1 < d2) return -1; + if (d1 === d2) return 0; +} + + +function compareTime(t1, t2) { + if (!(t1 && t2)) return; + t1 = t1.match(TIME); + t2 = t2.match(TIME); + if (!(t1 && t2)) return; + t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); + t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); + if (t1 > t2) return 1; + if (t1 < t2) return -1; + if (t1 === t2) return 0; +} + + +function compareDateTime(dt1, dt2) { + if (!(dt1 && dt2)) return; + dt1 = dt1.split(DATE_TIME_SEPARATOR); + dt2 = dt2.split(DATE_TIME_SEPARATOR); + var res = compareDate(dt1[0], dt2[0]); + if (res === undefined) return; + return res || compareTime(dt1[1], dt2[1]); +} + +},{"./util":11}],6:[function(require,module,exports){ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , stableStringify = require('json-stable-stringify') + , async = require('../async'); + +var beautify; + +function loadBeautify(){ + if (beautify === undefined) { + var name = 'js-beautify'; + try { beautify = require(name).js_beautify; } + catch(e) { beautify = false; } + } +} + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var co = require('co'); +var ucs2length = util.ucs2length; +var equal = require('./equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = require('./validation_error'); + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = [] + , keepSourceCode = opts.sourceCode !== false; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (keepSourceCode) cv.sourceCode = v.sourceCode; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + function callValidate() { + var validate = compilation.validate; + var result = validate.apply(null, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + if ($async && !opts.transpile) async.setup(opts); + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.beautify) { + loadBeautify(); + /* istanbul ignore else */ + if (beautify) sourceCode = beautify(sourceCode, opts.beautify); + else console.error('"npm install js-beautify" to use beautify option'); + } + // console.log('\n\n\n *** \n', sourceCode); + var validate, validateCode + , transpile = opts._transpileFunc; + try { + validateCode = $async && transpile + ? transpile(sourceCode) + : sourceCode; + + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'co', + 'equal', + 'ucs2length', + 'ValidationError', + validateCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + co, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + console.error('Error compiling schema, function code:', validateCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (keepSourceCode) validate.sourceCode = sourceCode; + if (opts.sourceCode === true) { + validate.source = { + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (!v) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v) { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + var validateSchema = rule.definition.validateSchema; + if (validateSchema && self._opts.validateSchema !== false) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') console.error(message); + else throw new Error(message); + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + } + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; + +},{}],11:[function(require,module,exports){ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + cleanUpVarErrors: cleanUpVarErrors, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + stableStringify: require('json-stable-stringify'), + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i', + $result = 'result' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); + if (!$exclusive) { + out += '='; + } + out += ' 0;'; + } + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '}'; + return out; +} + +},{}],14:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limit(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<'; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var exclusive' + ($lvl) + '; if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && typeof ' + ($schemaValueExcl) + ' != \'undefined\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ((exclusive' + ($lvl) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ') || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = exclusive' + ($lvl) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp); + if ($exclusive) { + out += '='; + } + out += ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') {'; + } + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],15:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],16:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitLength(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],17:[function(require,module,exports){ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],18:[function(require,module,exports){ +'use strict'; +module.exports = function generate_allOf(it, $keyword) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],19:[function(require,module,exports){ +'use strict'; +module.exports = function generate_anyOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return it.util.schemaHasRules($sch, it.RULES.all); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],20:[function(require,module,exports){ +'use strict'; +module.exports = function generate_constant(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'constant') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + return out; +} + +},{}],21:[function(require,module,exports){ +'use strict'; +module.exports = function generate_custom(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $validate = $rDef.validate, + $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($validateSchema) { + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') {'; + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += '' + (it.yieldAwait); + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + if ($validateSchema) { + out += ' }'; + } + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],26:[function(require,module,exports){ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],27:[function(require,module,exports){ +'use strict'; +module.exports = function generate_not(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} + +},{}],28:[function(require,module,exports){ +'use strict'; +module.exports = function generate_oneOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; + var $currentBaseId = $it.baseId; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} + +},{}],29:[function(require,module,exports){ +'use strict'; +module.exports = function generate_pattern(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + +},{}],30:[function(require,module,exports){ +'use strict'; +module.exports = function generate_patternRequired(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $key = 'key' + $lvl, + $matched = 'patternMatched' + $lvl, + $closingBraces = '', + $ownProperties = it.opts.ownProperties; + out += 'var ' + ($valid) + ' = true;'; + var arr1 = $schema; + if (arr1) { + var $pProperty, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $pProperty = arr1[i1 += 1]; + out += ' var ' + ($matched) + ' = false; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } '; + var $missingPattern = it.util.escapeQuotes($pProperty); + out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'patternRequired') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \'' + ($missingPattern) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should have property matching pattern \\\'' + ($missingPattern) + '\\\'\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + } + out += '' + ($closingBraces); + return out; +} + +},{}],31:[function(require,module,exports){ +'use strict'; +module.exports = function generate_properties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt; + var $schemaKeys = Object.keys($schema || {}), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); + if (it.opts.v5) { + var $pgProperties = it.schema.patternGroups || {}, + $pgPropertyKeys = Object.keys($pgProperties); + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($checkAdditional) { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 5) { + out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + if (it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length) { + var arr3 = $pgPropertyKeys; + if (arr3) { + var $pgProperty, $i = -1, + l3 = arr3.length - 1; + while ($i < l3) { + $pgProperty = arr3[$i += 1]; + out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have additional properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr4 = $schemaKeys; + if (arr4) { + var $propertyKey, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $propertyKey = arr4[i4 += 1]; + var $sch = $schema[$propertyKey]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + var arr5 = $pPropertyKeys; + if (arr5) { + var $pProperty, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $pProperty = arr5[i5 += 1]; + var $sch = $pProperties[$pProperty]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (it.opts.v5) { + var arr6 = $pgPropertyKeys; + if (arr6) { + var $pgProperty, i6 = -1, + l6 = arr6.length - 1; + while (i6 < l6) { + $pgProperty = arr6[i6 += 1]; + var $pgSchema = $pgProperties[$pgProperty], + $sch = $pgSchema.schema; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; + $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; + out += ' var pgPropCount' + ($lvl) + ' = 0; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + var $pgMin = $pgSchema.minimum, + $pgMax = $pgSchema.maximum; + if ($pgMin !== undefined || $pgMax !== undefined) { + out += ' var ' + ($valid) + ' = true; '; + var $currErrSchemaPath = $errSchemaPath; + if ($pgMin !== undefined) { + var $limit = $pgMin, + $reason = 'minimum', + $moreOrLess = 'less'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($pgMax !== undefined) { + out += ' else '; + } + } + if ($pgMax !== undefined) { + var $limit = $pgMax, + $reason = 'maximum', + $moreOrLess = 'more'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} + +},{}],32:[function(require,module,exports){ +'use strict'; +module.exports = function generate_ref(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $async, $refCode; + if ($schema == '#' || $schema == '#/') { + if (it.isRoot) { + $async = it.async; + $refCode = 'validate'; + } else { + $async = it.root.schema.$async === true; + $refCode = 'root.refVal[0]'; + } + } else { + var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); + if ($refVal === undefined) { + var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; + if (it.opts.missingRefs == 'fail') { + console.log($message); + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; + } + if (it.opts.verbose) { + out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + if ($breakOnError) { + out += ' if (false) { '; + } + } else if (it.opts.missingRefs == 'ignore') { + console.log($message); + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + var $error = new Error($message); + $error.missingRef = it.resolve.url(it.baseId, $schema); + $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); + throw $error; + } + } else if ($refVal.inline) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $refVal.schema; + $it.schemaPath = ''; + $it.errSchemaPath = $schema; + var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); + out += ' ' + ($code) + ' '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + } + } else { + $async = $refVal.$async === true; + $refCode = $refVal.code; + } + } + if ($refCode) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + if (it.opts.passContext) { + out += ' ' + ($refCode) + '.call(this, '; + } else { + out += ' ' + ($refCode) + '( '; + } + out += ' ' + ($data) + ', (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; + var __callValidate = out; + out = $$outStack.pop(); + if ($async) { + if (!it.async) throw new Error('async schema referenced by sync schema'); + out += ' try { '; + if ($breakOnError) { + out += 'var ' + ($valid) + ' ='; + } + out += ' ' + (it.yieldAwait) + ' ' + (__callValidate) + '; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + } + } else { + out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' else { '; + } + } + } + return out; +} + +},{}],33:[function(require,module,exports){ +'use strict'; +module.exports = function generate_required(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $vSchema = 'schema' + $lvl; + if (!$isData) { + if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { + var $required = []; + var arr1 = $schema; + if (arr1) { + var $property, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $property = arr1[i1 += 1]; + var $propertySch = it.schema.properties[$property]; + if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var _$property, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + _$property = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty(_$property); + out += ' ( ' + ($data) + ($prop) + ' === undefined && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $reqProperty, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $reqProperty = arr3[i3 += 1]; + var $prop = it.util.getProperty($reqProperty), + $missingProperty = it.util.escapeQuotes($reqProperty); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + } + out += ' if (' + ($data) + ($prop) + ' === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} + +},{}],34:[function(require,module,exports){ +'use strict'; +module.exports = function generate_switch(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $ifPassed = 'ifPassed' + it.level, + $currentBaseId = $it.baseId, + $shouldContinue; + out += 'var ' + ($ifPassed) + ';'; + var arr1 = $schema; + if (arr1) { + var $sch, $caseIndex = -1, + l1 = arr1.length - 1; + while ($caseIndex < l1) { + $sch = arr1[$caseIndex += 1]; + if ($caseIndex && !$shouldContinue) { + out += ' if (!' + ($ifPassed) + ') { '; + $closingBraces += '}'; + } + if ($sch.if && it.util.schemaHasRules($sch.if, it.RULES.all)) { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + $it.schema = $sch.if; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } '; + } else { + out += ' ' + ($ifPassed) + ' = true; '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + } + $shouldContinue = $sch.continue + } + } + out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + '; '; + out = it.util.cleanUpCode(out); + return out; +} + +},{}],35:[function(require,module,exports){ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} + +},{}],36:[function(require,module,exports){ +'use strict'; +module.exports = function generate_validate(it, $keyword) { + var out = ''; + var $async = it.schema.$async === true; + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.root.schema.id); + it.baseId = it.baseId || it.rootId; + if ($async) { + it.async = true; + var $es7 = it.opts.async == 'es7'; + it.yieldAwait = $es7 ? 'await' : 'yield'; + } + delete it.isTop; + it.dataPathArr = [undefined]; + out += ' var validate = '; + if ($async) { + if ($es7) { + out += ' (async function '; + } else { + if (it.opts.async == 'co*') { + out += 'co.wrap'; + } + out += '(function* '; + } + } else { + out += ' (function '; + } + out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data;'; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if (it.schema.id) it.baseId = it.resolve.url(it.baseId, it.schema.id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = '', + $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + if ($coerceToTypes) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + } + out += ' var ' + ($coerced) + ' = undefined; '; + var $bracesCoercion = ''; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += ' if (' + ($coerced) + ' === undefined) { '; + $bracesCoercion += '}'; + } + if (it.opts.coerceTypes == 'array' && $type != 'array') { + out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; + } + if ($type == 'string') { + out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } } '; + } + } + var $refKeywords; + if (it.schema.$ref && ($refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'))) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs == 'ignore') { + $refKeywords = false; + console.log('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs !== true) { + console.log('$ref: all keywords used in schema at path "' + it.errSchemaPath + '". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour'); + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + } + if (it.opts.useDefaults && !it.compositeRule) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + out += ' ' + ($rule.code(it, $rule.keyword)) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type) { + var $typeChecked = true; + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($typeSchema && !$typeChecked && !(it.opts.coerceTypes && $coerceToTypes)) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return true; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }); return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + out = it.util.cleanUpCode(out); + if ($top && $breakOnError) { + out = it.util.cleanUpVarErrors(out, $async); + } + + function $shouldUseGroup($rulesGroup) { + for (var i = 0; i < $rulesGroup.rules.length; i++) + if ($shouldUseRule($rulesGroup.rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.keyword == 'properties' && (it.schema.additionalProperties === false || typeof it.schema.additionalProperties == 'object' || (it.schema.patternProperties && Object.keys(it.schema.patternProperties).length) || (it.opts.v5 && it.schema.patternGroups && Object.keys(it.schema.patternGroups).length))); + } + return out; +} + +},{}],37:[function(require,module,exports){ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$\-]*$/i; +var customRuleCode = require('./dotjs/custom'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword +}; + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + if (definition.macro && definition.valid !== undefined) + throw new Error('"valid" option cannot be used with macro keywords'); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + var i, len = dataType.length; + for (i=0; i= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && freeModule) { + if (module.exports == freeExports) { + // in Node.js, io.js, or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { + // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { + // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],42:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +},{}],43:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; + +},{}],44:[function(require,module,exports){ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); + +},{"./decode":42,"./encode":43}],45:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var punycode = require('punycode'); +var util = require('./util'); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; + +},{"./util":46,"punycode":41,"querystring":44}],46:[function(require,module,exports){ +'use strict'; + +module.exports = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } +}; + +},{}],47:[function(require,module,exports){ + +/** + * slice() reference. + */ + +var slice = Array.prototype.slice; + +/** + * Expose `co`. + */ + +module.exports = co['default'] = co.co = co; + +/** + * Wrap the given generator `fn` into a + * function that returns a promise. + * This is a separate function so that + * every `co()` call doesn't create a new, + * unnecessary closure. + * + * @param {GeneratorFunction} fn + * @return {Function} + * @api public + */ + +co.wrap = function (fn) { + createPromise.__generatorFunction__ = fn; + return createPromise; + function createPromise() { + return co.call(this, fn.apply(this, arguments)); + } +}; + +/** + * Execute the generator function or a generator + * and return a promise. + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +function co(gen) { + var ctx = this; + var args = slice.call(arguments, 1) + + // we wrap everything in a promise to avoid promise chaining, + // which leads to memory leak errors. + // see https://github.com/tj/co/issues/180 + return new Promise(function(resolve, reject) { + if (typeof gen === 'function') gen = gen.apply(ctx, args); + if (!gen || typeof gen.next !== 'function') return resolve(gen); + + onFulfilled(); + + /** + * @param {Mixed} res + * @return {Promise} + * @api private + */ + + function onFulfilled(res) { + var ret; + try { + ret = gen.next(res); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * @param {Error} err + * @return {Promise} + * @api private + */ + + function onRejected(err) { + var ret; + try { + ret = gen.throw(err); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * Get the next value in the generator, + * return a promise. + * + * @param {Object} ret + * @return {Promise} + * @api private + */ + + function next(ret) { + if (ret.done) return resolve(ret.value); + var value = toPromise.call(ctx, ret.value); + if (value && isPromise(value)) return value.then(onFulfilled, onRejected); + return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' + + 'but the following object was passed: "' + String(ret.value) + '"')); + } + }); +} + +/** + * Convert a `yield`ed value into a promise. + * + * @param {Mixed} obj + * @return {Promise} + * @api private + */ + +function toPromise(obj) { + if (!obj) return obj; + if (isPromise(obj)) return obj; + if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); + if ('function' == typeof obj) return thunkToPromise.call(this, obj); + if (Array.isArray(obj)) return arrayToPromise.call(this, obj); + if (isObject(obj)) return objectToPromise.call(this, obj); + return obj; +} + +/** + * Convert a thunk to a promise. + * + * @param {Function} + * @return {Promise} + * @api private + */ + +function thunkToPromise(fn) { + var ctx = this; + return new Promise(function (resolve, reject) { + fn.call(ctx, function (err, res) { + if (err) return reject(err); + if (arguments.length > 2) res = slice.call(arguments, 1); + resolve(res); + }); + }); +} + +/** + * Convert an array of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Array} obj + * @return {Promise} + * @api private + */ + +function arrayToPromise(obj) { + return Promise.all(obj.map(toPromise, this)); +} + +/** + * Convert an object of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Object} obj + * @return {Promise} + * @api private + */ + +function objectToPromise(obj){ + var results = new obj.constructor(); + var keys = Object.keys(obj); + var promises = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var promise = toPromise.call(this, obj[key]); + if (promise && isPromise(promise)) defer(promise, key); + else results[key] = obj[key]; + } + return Promise.all(promises).then(function () { + return results; + }); + + function defer(promise, key) { + // predefine the key in the result + results[key] = undefined; + promises.push(promise.then(function (res) { + results[key] = res; + })); + } +} + +/** + * Check if `obj` is a promise. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + +function isPromise(obj) { + return 'function' == typeof obj.then; +} + +/** + * Check if `obj` is a generator. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGenerator(obj) { + return 'function' == typeof obj.next && 'function' == typeof obj.throw; +} + +/** + * Check if `obj` is a generator function. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ +function isGeneratorFunction(obj) { + var constructor = obj.constructor; + if (!constructor) return false; + if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; + return isGenerator(constructor.prototype); +} + +/** + * Check for plain object. + * + * @param {Mixed} val + * @return {Boolean} + * @api private + */ + +function isObject(val) { + return Object == val.constructor; +} + +},{}],48:[function(require,module,exports){ +var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); + +module.exports = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var space = opts.space || ''; + if (typeof space === 'number') space = Array(space+1).join(' '); + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + var replacer = opts.replacer || function(key, value) { return value; }; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (parent, key, node, level) { + var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; + var colonSeparator = space ? ': ' : ':'; + + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + node = replacer.call(parent, key, node); + + if (node === undefined) { + return; + } + if (typeof node !== 'object' || node === null) { + return json.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + var item = stringify(node, i, node[i], level+1) || json.stringify(null); + out.push(indent + space + item); + } + return '[' + out.join(',') + indent + ']'; + } + else { + if (seen.indexOf(node) !== -1) { + if (cycles) return json.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + else seen.push(node); + + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node, key, node[key], level+1); + + if(!value) continue; + + var keyValue = json.stringify(key) + + colonSeparator + + value; + ; + out.push(indent + space + keyValue); + } + seen.splice(seen.indexOf(node), 1); + return '{' + out.join(',') + indent + '}'; + } + })({ '': obj }, '', obj, 0); +}; + +var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; +}; + +var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; +}; + +},{"jsonify":49}],49:[function(require,module,exports){ +exports.parse = require('./lib/parse'); +exports.stringify = require('./lib/stringify'); + +},{"./lib/parse":50,"./lib/stringify":51}],50:[function(require,module,exports){ +var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + +value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } +}; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + +module.exports = function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + + // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; +}; + +},{}],51:[function(require,module,exports){ +var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + +function quote(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; +} + +function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } +} + +module.exports = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); +}; + +},{}],"ajv":[function(require,module,exports){ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , v5 = require('./v5') + , util = require('./compile/util') + , async = require('./async') + , co = require('co'); + +module.exports = Ajv; + +Ajv.prototype.compileAsync = async.compile; + +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.ValidationError = require('./compile/validation_error'); + +var META_SCHEMA_ID = 'http://json-schema.org/draft-04/schema'; +var SCHEMA_URI_FORMAT = /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i; +function SCHEMA_URI_FORMAT_FUNC(str) { + return SCHEMA_URI_FORMAT.test(str); +} + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + var self = this; + + opts = this._opts = util.copy(opts) || {}; + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + + // this is done on purpose, so that methods are bound to the instance + // (without using bind) so that they can be used without the instance + this.validate = validate; + this.compile = compile; + this.addSchema = addSchema; + this.addMetaSchema = addMetaSchema; + this.validateSchema = validateSchema; + this.getSchema = getSchema; + this.removeSchema = removeSchema; + this.addFormat = addFormat; + this.errorsText = errorsText; + + this._addSchema = _addSchema; + this._compile = _compile; + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.async || opts.transpile) async.setup(opts); + if (opts.beautify === true) opts.beautify = { indent_size: 2 }; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + this._metaOpts = getMetaSchemaOptions(); + + if (opts.formats) addInitialFormats(); + addDraft4MetaSchema(); + if (opts.v5) v5.enable(this); + if (typeof opts.meta == 'object') addMetaSchema(opts.meta); + addInitialSchemas(); + + + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize. + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = _addSchema(schemaKeyRef); + v = schemaObj.validate || _compile(schemaObj); + } + + var valid = v(data); + if (v.$async === true) + return self._opts.async == '*' ? co(valid) : valid; + self.errors = v.errors; + return valid; + } + + + /** + * Create validating function for passed schema. + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ + function compile(schema, _meta) { + var schemaObj = _addSchema(schema, undefined, _meta); + return schemaObj.validate || _compile(schemaObj); + } + + + /** + * Adds schema to the instance. + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + */ + function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ + function errorsText(errors, options) { + errors = errors || self.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i=1&&t<=12&&a>=1&&a<=m[t]}function o(e,r){var t=e.match(v);if(!t)return!1;var a=t[1],s=t[2],o=t[3],i=t[5];return a<=23&&s<=59&&o<=59&&(!r||i)}function i(e){var r=e.split(w);return 2==r.length&&s(r[0])&&o(r[1],!0)}function n(e){return e.length<=255&&y.test(e)}function l(e){return j.test(e)&&g.test(e)}function c(e){try{return new RegExp(e),!0}catch(e){return!1}}function h(e,r){if(e&&r)return e>r?1:er?1:e=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:r,baseId:t},{index:a,compiling:!1})}function i(e,r,t){var a=n.call(this,e,r,t);a>=0&&this._compilations.splice(a,1)}function n(e,r,t){for(var a=0;a=55296&&r<=56319&&s=r)throw new Error("Cannot access property/index "+a+" levels up, current level is "+r);return t[r-a]}if(a>r)throw new Error("Cannot access data "+a+" levels up, current level is "+r);if(o="data"+(r-a||""),!s)return o}for(var n=o,c=s.split("/"),h=0;h",S="result"+s,$=e.opts.v5&&i&&i.$data;if($?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ",g="schema"+s):g=i,w){var x=e.util.getData(b.$data,o,e.dataPathArr),_="exclusive"+s,O="op"+s,R="' + "+O+" + '";a+=" var schemaExcl"+s+" = "+x+"; ",x="schemaExcl"+s,a+=" if (typeof "+x+" != 'boolean' && "+x+" !== undefined) { "+u+" = false; ";var t=E,I=I||[];I.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(t||"_formatExclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: '"+E+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var A=a;a=I.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+A+"]); ":" validate.errors = ["+A+"]; return false; ":" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",c&&(p+="}",a+=" else { "),$&&(a+=" if ("+g+" === undefined) "+u+" = true; else if (typeof "+g+" != 'string') "+u+" = false; else { ",p+="}"),d&&(a+=" if (!"+y+") "+u+" = true; else { ",p+="}"),a+=" var "+S+" = "+y+"("+h+", ",a+=$?""+g:""+e.util.toQuotedString(i),a+=" ); if ("+S+" === undefined) "+u+" = false; var "+_+" = "+x+" === true; if ("+u+" === undefined) { "+u+" = "+_+" ? "+S+" "+j+" 0 : "+S+" "+j+"= 0; } if (!"+u+") var op"+s+" = "+_+" ? '"+j+"' : '"+j+"=';"}else{var _=b===!0,R=j;_||(R+="=");var O="'"+R+"'";$&&(a+=" if ("+g+" === undefined) "+u+" = true; else if (typeof "+g+" != 'string') "+u+" = false; else { ",p+="}"),d&&(a+=" if (!"+y+") "+u+" = true; else { ",p+="}"),a+=" var "+S+" = "+y+"("+h+", ",a+=$?""+g:""+e.util.toQuotedString(i),a+=" ); if ("+S+" === undefined) "+u+" = false; if ("+u+" === undefined) "+u+" = "+S+" "+j,_||(a+="="),a+=" 0;"}a+=""+p+"if (!"+u+") { ";var t=r,I=I||[];I.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(t||"_formatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { comparison: "+O+", limit: ",a+=$?""+g:""+e.util.toQuotedString(i),a+=" , exclusive: "+_+" } ",e.opts.messages!==!1&&(a+=" , message: 'should be "+R+' "',a+=$?"' + "+g+" + '":""+e.util.escapeQuotes(i),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=$?"validate.schema"+n:""+e.util.toQuotedString(i),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var A=a;return a=I.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+A+"]); ":" validate.errors = ["+A+"]; return false; ":" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="}"}},{}],14:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maximum"==r,p=d?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[p],v=e.opts.v5&&m&&m.$data,y=d?"<":">",g=d?">":"<";if(v){var P=e.util.getData(m.$data,i,e.dataPathArr),E="exclusive"+o,b="op"+o,w="' + "+b+" + '";s+=" var schemaExcl"+o+" = "+P+"; ",P="schemaExcl"+o,s+=" var exclusive"+o+"; if (typeof "+P+" != 'boolean' && typeof "+P+" != 'undefined') { ";var t=p,j=j||[];j.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(t||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: {} ",e.opts.messages!==!1&&(s+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var S=s;s=j.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } else if( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" ((exclusive"+o+" = "+P+" === true) ? "+u+" "+g+"= "+a+" : "+u+" "+g+" "+a+") || "+u+" !== "+u+") { var op"+o+" = exclusive"+o+" ? '"+y+"' : '"+y+"=';"}else{var E=m===!0,w=y;E||(w+="=");var b="'"+w+"'";s+=" if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+u+" "+g,E&&(s+="="),s+=" "+a+" || "+u+" !== "+u+") {"}var t=r,j=j||[];j.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(t||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { comparison: "+b+", limit: "+a+", exclusive: "+E+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be "+w+" ",s+=f?"' + "+a:""+n+"'"),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var S=s;return s=j.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",h&&(s+=" else { "),s}},{}],15:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maxItems"==r?">":"<";s+="if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" "+u+".length "+d+" "+a+") { ";var t=r,p=p||[];p.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(t||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",s+="maxItems"==r?"more":"less",s+=" than ",s+=f?"' + "+a+" + '":""+n,s+=" items' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",h&&(s+=" else { "),s}},{}],16:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maxLength"==r?">":"<";s+="if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=e.opts.unicode===!1?" "+u+".length ":" ucs2length("+u+") ",s+=" "+d+" "+a+") { ";var t=r,p=p||[];p.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(t||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT be ",s+="maxLength"==r?"longer":"shorter",s+=" than ",s+=f?"' + "+a+" + '":""+n,s+=" characters' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n, +s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",h&&(s+=" else { "),s}},{}],17:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n;var d="maxProperties"==r?">":"<";s+="if ( ",f&&(s+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),s+=" Object.keys("+u+").length "+d+" "+a+") { ";var t=r,p=p||[];p.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(t||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+a+" } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have ",s+="maxProperties"==r?"more":"less",s+=" than ",s+=f?"' + "+a+" + '":""+n,s+=" properties' "),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;return s=p.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",h&&(s+=" else { "),s}},{}],18:[function(e,r,t){"use strict";r.exports=function(e,r){var t=" ",a=e.schema[r],s=e.schemaPath+e.util.getProperty(r),o=e.errSchemaPath+"/"+r,i=!e.opts.allErrors,n=e.util.copy(e),l="";n.level++;var c="valid"+n.level,h=n.baseId,u=!0,f=a;if(f)for(var d,p=-1,m=f.length-1;p "+x+") { ";var O=h+"["+x+"]";d.schema=$,d.schemaPath=n+"["+x+"]",d.errSchemaPath=l+"/"+x,d.errorPath=e.util.getPathExpr(e.errorPath,x,e.opts.jsonPointers,!0),d.dataPathArr[y]=x;var R=e.validate(d);d.baseId=P,a+=e.util.varOccurences(R,g)<2?" "+e.util.varReplace(R,g,O)+" ":" var "+g+" = "+O+"; "+R+" ",a+=" } ",c&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof E&&e.util.schemaHasRules(E,e.RULES.all)){d.schema=E,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+h+".length > "+i.length+") { for (var "+v+" = "+i.length+"; "+v+" < "+h+".length; "+v+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var O=h+"["+v+"]";d.dataPathArr[y]=v;var R=e.validate(d);d.baseId=P,a+=e.util.varOccurences(R,g)<2?" "+e.util.varReplace(R,g,O)+" ":" var "+g+" = "+O+"; "+R+" ",c&&(a+=" if (!"+m+") break; "),a+=" } } ",c&&(a+=" if ("+m+") { ",p+="}")}}else if(e.util.schemaHasRules(i,e.RULES.all)){d.schema=i,d.schemaPath=n,d.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+h+".length; "+v+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var O=h+"["+v+"]";d.dataPathArr[y]=v;var R=e.validate(d);d.baseId=P,a+=e.util.varOccurences(R,g)<2?" "+e.util.varReplace(R,g,O)+" ":" var "+g+" = "+O+"; "+R+" ",c&&(a+=" if (!"+m+") break; "),a+=" } ",c&&(a+=" if ("+m+") { ",p+="}")}return c&&(a+=" "+p+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},{}],26:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(i||""),f=e.opts.v5&&n&&n.$data;f?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ",a="schema"+o):a=n,s+="var division"+o+";if (",f&&(s+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),s+=" (division"+o+" = "+u+" / "+a+", ",s+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+o+" !== parseInt(division"+o+") ",s+=" ) ",f&&(s+=" ) "),s+=" ) { ";var d=d||[];d.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(t||"multipleOf")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { multipleOf: "+a+" } ",e.opts.messages!==!1&&(s+=" , message: 'should be multiple of ",s+=f?"' + "+a:""+n+"'"),e.opts.verbose&&(s+=" , schema: ",s+=f?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var p=s;return s=d.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+="} ",h&&(s+=" else { "),s}},{}],27:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(o||""),u="errs__"+s,f=e.util.copy(e);f.level++;var d="valid"+f.level;if(e.util.schemaHasRules(i,e.RULES.all)){f.schema=i,f.schemaPath=n,f.errSchemaPath=l,a+=" var "+u+" = errors; ";var p=e.compositeRule;e.compositeRule=f.compositeRule=!0,f.createErrors=!1;var m;f.opts.allErrors&&(m=f.opts.allErrors,f.opts.allErrors=!1),a+=" "+e.validate(f)+" ",f.createErrors=!0,m&&(f.opts.allErrors=m),e.compositeRule=f.compositeRule=p,a+=" if ("+d+") { ";var v=v||[];v.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(t||"not")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var y=a;a=v.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+y+"]); ":" validate.errors = ["+y+"]; return false; ":" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",e.createErrors!==!1?(a+=" { keyword: '"+(t||"not")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",e.opts.messages!==!1&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(a+=" if (false) { ");return a}},{}],28:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(o||""),u="valid"+s,f="errs__"+s,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level;a+="var "+f+" = errors;var prevValid"+s+" = false;var "+u+" = false;";var v=d.baseId,y=e.compositeRule;e.compositeRule=d.compositeRule=!0;var g=i;if(g)for(var P,E=-1,b=g.length-1;E5)a+=" || validate.schema"+n+"["+v+"] ";else{var D=P;if(D)for(var L,Q=-1,C=D.length-1;Q= "+me+"; ",l=e.errSchemaPath+"/patternGroups/minimum",a+=" if (!"+u+") { ";var K=K||[];K.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(t||"patternGroups")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(N)+"' } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have "+Pe+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(N)+"\"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var B=a;a=K.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+B+"]); ":" validate.errors = ["+B+"]; return false; ":" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",void 0!==ve&&(a+=" else ")}if(void 0!==ve){var ye=ve,ge="maximum",Pe="more";a+=" "+u+" = pgPropCount"+s+" <= "+ve+"; ",l=e.errSchemaPath+"/patternGroups/maximum",a+=" if (!"+u+") { ";var K=K||[];K.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(t||"patternGroups")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(N)+"' } ",e.opts.messages!==!1&&(a+=" , message: 'should NOT have "+Pe+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(N)+"\"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var B=a;a=K.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+B+"]); ":" validate.errors = ["+B+"]; return false; ":" var err = "+B+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } "}l=G,c&&(a+=" if ("+u+") { ",p+="}")}}}}return c&&(a+=" "+p+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},{}],32:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a,s,o=" ",i=e.level,n=e.dataLevel,l=e.schema[r],c=e.errSchemaPath+"/"+r,h=!e.opts.allErrors,u="data"+(n||""),f="valid"+i;if("#"==l||"#/"==l)e.isRoot?(a=e.async,s="validate"):(a=e.root.schema.$async===!0,s="root.refVal[0]");else{var d=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===d){var p="can't resolve reference "+l+" from id "+e.baseId;if("fail"==e.opts.missingRefs){console.log(p);var m=m||[];m.push(o),o="",e.createErrors!==!1?(o+=" { keyword: '"+(t||"$ref")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",e.opts.messages!==!1&&(o+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(o+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),o+=" } "):o+=" {} ";var v=o;o=m.pop(),o+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+v+"]); ":" validate.errors = ["+v+"]; return false; ":" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(o+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs){var y=new Error(p);throw y.missingRef=e.resolve.url(e.baseId,l),y.missingSchema=e.resolve.normalizeId(e.resolve.fullPath(y.missingRef)),y}console.log(p),h&&(o+=" if (true) { ")}}else if(d.inline){var g=e.util.copy(e);g.level++;var P="valid"+g.level;g.schema=d.schema,g.schemaPath="",g.errSchemaPath=l;var E=e.validate(g).replace(/validate\.schema/g,d.code);o+=" "+E+" ",h&&(o+=" if ("+P+") { ")}else a=d.$async===!0,s=d.code}if(s){var m=m||[];m.push(o),o="",o+=e.opts.passContext?" "+s+".call(this, ":" "+s+"( ",o+=" "+u+", (dataPath || '')",'""'!=e.errorPath&&(o+=" + "+e.errorPath);o+=" , "+(n?"data"+(n-1||""):"parentData")+" , "+(n?e.dataPathArr[n]:"parentDataProperty")+", rootData) ";var b=o;if(o=m.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");o+=" try { ",h&&(o+="var "+f+" ="),o+=" "+e.yieldAwait+" "+b+"; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } ",h&&(o+=" if ("+f+") { ")}else o+=" if (!"+b+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",h&&(o+=" else { ")}return o}},{}],33:[function(e,r,t){"use strict";r.exports=function(e,r){var t,a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,h="data"+(o||""),u="valid"+s,f=e.opts.v5&&i&&i.$data;f&&(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ");var d="schema"+s;if(!f)if(i.length=e.opts.loopRequired;if(c)if(a+=" var missing"+s+"; ",b){f||(a+=" var "+d+" = validate.schema"+n+"; ");var w="i"+s,j="schema"+s+"["+w+"]",S="' + "+j+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(E,j,e.opts.jsonPointers)),a+=" var "+u+" = true; ",f&&(a+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),a+=" for (var "+w+" = 0; "+w+" < "+d+".length; "+w+"++) { "+u+" = "+h+"["+d+"["+w+"]] !== undefined; if (!"+u+") break; } ",f&&(a+=" } "),a+=" if (!"+u+") { ";var $=$||[];$.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(t||"required")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+S+"' } ",e.opts.messages!==!1&&(a+=" , message: '",a+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+S+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),a+=" } "):a+=" {} ";var x=a;a=$.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var _=p;if(_)for(var O,w=-1,R=_.length-1;w 1) { var i = "+u+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+f+" = false; break outer; } } } } ",d&&(s+=" } "),s+=" if (!"+f+") { ";var p=p||[];p.push(s),s="",e.createErrors!==!1?(s+=" { keyword: '"+(t||"uniqueItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s+=" , schema: ",s+=d?"validate.schema"+l:""+n,s+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ";var m=s;s=p.pop(),s+=!e.compositeRule&&h?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s+=" } ",h&&(s+=" else { ")}else h&&(s+=" if (true) { ");return s}},{}],36:[function(e,r,t){"use strict";r.exports=function(e,r){function t(e){for(var r=0;r1&&(a=t[0]+"@",e=t[1]),e=e.replace(q,"."),a+i(e.split("."),r).join(".")}function l(e){for(var r,t,a=[],s=0,o=e.length;s=55296&&r<=56319&&s65535&&(e-=65536,r+=C(e>>>10&1023|55296),e=56320|1023&e),r+=C(e)}).join("")}function h(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:j}function u(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function f(e,r,t){var a=0;for(e=t?Q(e/_):e>>1,e+=Q(e/r);e>L*$>>1;a+=j)e=Q(e/L);return Q(a+(L+1)*e/(e+x))}function d(e){var r,t,a,s,i,n,l,u,d,p,m=[],v=e.length,y=0,g=R,P=O;for(t=e.lastIndexOf(I),t<0&&(t=0),a=0;a=128&&o("not-basic"),m.push(e.charCodeAt(a));for(s=t>0?t+1:0;s=v&&o("invalid-input"),u=h(e.charCodeAt(s++)),(u>=j||u>Q((w-y)/n))&&o("overflow"),y+=u*n,d=l<=P?S:l>=P+$?$:l-P,!(uQ(w/p)&&o("overflow"),n*=p;r=m.length+1,P=f(y-i,r,0==i),Q(y/r)>w-g&&o("overflow"),g+=Q(y/r),y%=r,m.splice(y++,0,g)}return c(m)}function p(e){var r,t,a,s,i,n,c,h,d,p,m,v,y,g,P,E=[];for(e=l(e),v=e.length,r=R,t=0,i=O,n=0;n=r&&mQ((w-t)/y)&&o("overflow"),t+=(c-r)*y,r=c,n=0;nw&&o("overflow"),m==r){for(h=t,d=j;p=d<=i?S:d>=i+$?$:d-i,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=j-S,Q=Math.floor,C=String.fromCharCode;if(E={version:"1.4.1",ucs2:{decode:l,encode:c},decode:d,encode:p,toASCII:v,toUnicode:m},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return E});else if(y&&g)if(t.exports==y)g.exports=E;else for(b in E)E.hasOwnProperty(b)&&(y[b]=E[b]);else s.punycode=E}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],42:[function(e,r,t){"use strict";function a(e,r){return Object.prototype.hasOwnProperty.call(e,r)}r.exports=function(e,r,t,o){r=r||"&",t=t||"=";var i={};if("string"!=typeof e||0===e.length)return i;var n=/\+/g;e=e.split(r);var l=1e3;o&&"number"==typeof o.maxKeys&&(l=o.maxKeys);var c=e.length;l>0&&c>l&&(c=l);for(var h=0;h=0?(u=m.substr(0,v),f=m.substr(v+1)):(u=m,f=""),d=decodeURIComponent(u),p=decodeURIComponent(f),a(i,d)?s(i[d])?i[d].push(p):i[d]=[i[d],p]:i[d]=p}return i};var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],43:[function(e,r,t){"use strict";function a(e,r){if(e.map)return e.map(r);for(var t=[],a=0;a",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),v=["%","/","?",";","#"].concat(m),y=["/","?","#"],g=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},j=e("querystring");a.prototype.parse=function(e,r,t){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),s=a!==-1&&a127?"x":k[D];if(!q.match(g)){var Q=I.slice(0,$),C=I.slice($+1),V=k.match(P);V&&(Q.push(V[1]),C.unshift(V[2])),C.length&&(i="/"+C.join(".")+i),this.hostname=Q.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),R||(this.hostname=l.toASCII(this.hostname));var z=this.port?":"+this.port:"";this.host=(this.hostname||"")+z,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==i[0]&&(i="/"+i))}if(!E[d])for(var $=0,A=m.length;$0)&&t.host.split("@");j&&(t.auth=j.shift(),t.host=t.hostname=j.shift())}return t.search=e.search,t.query=e.query,c.isNull(t.pathname)&&c.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!P.length)return t.pathname=null,t.path=t.search?"/"+t.search:null,t.href=t.format(),t;for(var S=P.slice(-1)[0],$=(t.host||e.host||P.length>1)&&("."===S||".."===S)||""===S,x=0,_=P.length;_>=0;_--)S=P[_],"."===S?P.splice(_,1):".."===S?(P.splice(_,1),x++):x&&(P.splice(_,1),x--);if(!y&&!g)for(;x--;x)P.unshift("..");!y||""===P[0]||P[0]&&"/"===P[0].charAt(0)||P.unshift(""),$&&"/"!==P.join("/").substr(-1)&&P.push("");var O=""===P[0]||P[0]&&"/"===P[0].charAt(0);if(E){t.hostname=t.host=O?"":P.length?P.shift():"";var j=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@");j&&(t.auth=j.shift(),t.host=t.hostname=j.shift())}return y=y||t.host&&P.length,y&&!O&&P.unshift(""),P.length?t.pathname=P.join("/"):(t.pathname=null,t.path=null),c.isNull(t.pathname)&&c.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},a.prototype.parseHost=function(){var e=this.host,r=u.exec(e);r&&(r=r[0],":"!==r&&(this.port=r.substr(1)),e=e.substr(0,e.length-r.length)),e&&(this.hostname=e)}},{"./util":46,punycode:41,querystring:44}],46:[function(e,r,t){"use strict";r.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],47:[function(e,r,t){function a(e){var r=this,t=f.call(arguments,1);return new Promise(function(a,o){function i(r){var t;try{t=e.next(r)}catch(e){return o(e)}c(t)}function n(r){var t;try{t=e.throw(r)}catch(e){return o(e)}c(t)}function c(e){if(e.done)return a(e.value);var t=s.call(r,e.value);return t&&l(t)?t.then(i,n):n(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(e.value)+'"'))}if("function"==typeof e&&(e=e.apply(r,t)),!e||"function"!=typeof e.next)return a(e);i()})}function s(e){return e?l(e)?e:h(e)||c(e)?a.call(this,e):"function"==typeof e?o.call(this,e):Array.isArray(e)?i.call(this,e):u(e)?n.call(this,e):e:e}function o(e){var r=this;return new Promise(function(t,a){e.call(r,function(e,r){if(e)return a(e);arguments.length>2&&(r=f.call(arguments,1)),t(r)})})}function i(e){return Promise.all(e.map(s,this))}function n(e){function r(e,r){t[r]=void 0,o.push(e.then(function(e){t[r]=e}))}for(var t=new e.constructor,a=Object.keys(e),o=[],i=0;i="0"&&s<="9";)r+=s,c();if("."===s)for(r+=".";c()&&s>="0"&&s<="9";)r+=s;if("e"===s||"E"===s)for(r+=s,c(),"-"!==s&&"+"!==s||(r+=s,c());s>="0"&&s<="9";)r+=s,c();if(e=+r,isFinite(e))return e;l("Bad number")},u=function(){var e,r,t,a="";if('"'===s)for(;c();){if('"'===s)return c(),a;if("\\"===s)if(c(),"u"===s){for(t=0,r=0;r<4&&(e=parseInt(c(),16),isFinite(e));r+=1)t=16*t+e;a+=String.fromCharCode(t)}else{if("string"!=typeof n[s])break;a+=n[s]}else a+=s}l("Bad string")},f=function(){for(;s&&s<=" ";)c()},d=function(){switch(s){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null}l("Unexpected '"+s+"'")},p=function(){var e=[];if("["===s){if(c("["),f(),"]"===s)return c("]"),e;for(;s;){if(e.push(i()),f(),"]"===s)return c("]"),e;c(","),f()}}l("Bad array")},m=function(){var e,r={};if("{"===s){if(c("{"),f(),"}"===s)return c("}"),r;for(;s;){if(e=u(),f(),c(":"),Object.hasOwnProperty.call(r,e)&&l('Duplicate key "'+e+'"'),r[e]=i(),f(),"}"===s)return c("}"),r;c(","),f()}}l("Bad object")};i=function(){switch(f(),s){case"{":return m();case"[":return p();case'"':return u();case"-":return h();default:return s>="0"&&s<="9"?h():d()}},r.exports=function(e,r){var t;return o=e,a=0,s=" ",t=i(),f(),s&&l("Syntax error"),"function"==typeof r?function e(t,a){var s,o,i=t[a];if(i&&"object"==typeof i)for(s in i)Object.prototype.hasOwnProperty.call(i,s)&&(o=e(i,s),void 0!==o?i[s]=o:delete i[s]);return r.call(t,a,i)}({"":t},""):t}},{}],51:[function(e,r,t){function a(e){return l.lastIndex=0,l.test(e)?'"'+e.replace(l,function(e){var r=c[e];return"string"==typeof r?r:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function s(e,r){var t,l,c,h,u,f=o,d=r[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),"function"==typeof n&&(d=n.call(r,e,d)),typeof d){case"string":return a(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(o+=i,u=[],"[object Array]"===Object.prototype.toString.apply(d)){for(h=d.length,t=0;t=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function g(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return z(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return P(this,t,n);case"ascii":return R(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return L(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function x(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,r,i){function s(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,a=e.length,u=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,u/=2,n/=2}var c;if(i){var l=-1;for(c=n;ca&&(n=a-u),c=n;c>=0;c--){for(var p=!0,h=0;hi&&(r=i)):r=i;var s=t.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o239?4:s>223?3:s>191?2:1;if(i+a<=n){var u,c,l,p;switch(a){case 1:s<128&&(o=s);break;case 2:u=e[i+1],128===(192&u)&&(p=(31&s)<<6|63&u,p>127&&(o=p));break;case 3:u=e[i+1],c=e[i+2],128===(192&u)&&128===(192&c)&&(p=(15&s)<<12|(63&u)<<6|63&c,p>2047&&(p<55296||p>57343)&&(o=p));break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(p=(15&s)<<18|(63&u)<<12|(63&c)<<6|63&l,p>65535&&p<1114112&&(o=p))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return T(r)}function T(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function B(e,t,n,r,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function I(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,s=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,s=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function M(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||M(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(e,t,n,r,23,4),n+4}function V(e,t,n,r,i){return i||M(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(e,t,n,r,52,8),n+8}function U(e){if(e=q(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){t=t||1/0;for(var n,r=e.length,i=null,s=[],o=0;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function Y(e){for(var t=[],n=0;n>8,i=n%256,s.push(i),s.push(r);return s}function J(e){return X.toByteArray(U(e))}function H(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Q(e){return e!==e}var X=e("base64-js"),Z=e("ieee754"),K=e("isarray");n.Buffer=o,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=i(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return c(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,s=Math.min(n,r);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var s=i-r,a=n-t,u=Math.min(s,a),c=this.slice(r,i),l=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return A(this,e,t,n);case"base64":return _(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||$(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||$(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||$(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||$(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||$(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||$(e,t,this.length);for(var r=this[e],i=1,s=0;++s=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||$(e,t,this.length);for(var r=t,i=1,s=this[e+--r];r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return t||$(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){t||$(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||$(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||$(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||$(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||$(e,4,this.length),Z.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||$(e,4,this.length),Z.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||$(e,8,this.length),Z.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||$(e,8,this.length),Z.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){B(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+i]=e/s&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=0,o=1,a=0;for(this[t]=255&e;++s>0)-a&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);B(this,e,t,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function s(e){var t,n,i,s,o,a,u=e.length;o=r(e),a=new p(3*u/4-o),i=o>0?u-4:u;var c=0;for(t=0,n=0;t>16&255,a[c++]=s>>8&255,a[c++]=255&s;return 2===o?(s=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,a[c++]=255&s):1===o&&(s=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,a[c++]=s>>8&255,a[c++]=255&s),a}function o(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function a(e,t,n){for(var r,i=[],s=t;sl?l:u+o));return 1===r?(t=e[n-1],i+=c[t>>2],i+=c[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=c[t>>10],i+=c[t>>4&63],i+=c[t<<2&63],i+="="),s.push(i),s.join("")}n.byteLength=i,n.toByteArray=s,n.fromByteArray=u;for(var c=[],l=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;f>1,l=-7,p=n?i-1:0,h=n?-1:1,f=e[t+p];for(p+=h,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+e[t+p],p+=h,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+e[t+p],p+=h,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:(f?-1:1)*(1/0);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},n.write=function(e,t,n,r,i,s){var o,a,u,c=8*s-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),t+=o+p>=1?h/u:h*Math.pow(2,1-p),t*u>=2&&(o++,u/=2),o+p>=l?(a=0,o=l):o+p>=1?(a=(t*u-1)*Math.pow(2,i),o+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&a,f+=d,a/=256,i-=8);for(o=o<0;e[n+f]=255&o,f+=d,o/=256,c-=8);e[n+f-d]|=128*y}},{}],5:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],6:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;s--){var o=s>=0?arguments[s]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(n=o+"/"+n,i="/"===o.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(e){var i=n.isAbsolute(e),s="/"===o(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&s&&(e+="/"),(i?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var i=r(e.split("/")),s=r(t.split("/")),o=Math.min(i.length,s.length),a=o,u=0;u1)for(var n=1;n]*>)(.*)/i,/(.*)(<\/script>)(.*)/i],o=0,a=!0;t=t.split("\n");for(var u=0;u0){if(!a(e).isAsync)return t(e);delete e.async}return e.type="ReturnStatement",e.$mapped=!0,void(e.argument={type:"CallExpression",callee:_(i,[n]).$error,arguments:[e.argument]})}return a(e).isFunction?(r++,t(e),void r--):void t(e)}if(r>0){if(!a(e).isAsync)return t(e);delete e.async} +return e.$mapped=!0,void(a(e.argument).isUnaryExpression&&"void"===e.argument.operator?e.argument=e.argument.argument:e.argument={type:"CallExpression",callee:_(i,[n]).$return,arguments:e.argument?[e.argument]:[]})},t)}function N(e,t){return Array.isArray(e)?e.map(function(e){return N(e,t)}):(m.treeWalker(e,function(e,t,n){if(t(),"ConditionalExpression"===e.type&&(c(e.alternate)||c(e.consequent))){f(S("condOp"));s(e,P(m.part("if ($0) return $1 ; return $2",[e.test,e.consequent,e.alternate]).body))}},t),e)}function $(e,t){return Array.isArray(e)?e.map(function(e){return $(e,t)}):(m.treeWalker(e,function(e,t,n){if(t(),"LogicalExpression"===e.type&&c(e.right)){var r,i=f(S("logical"+("&&"===e.operator?"And":"Or")));if("||"===e.operator)r="var $0; if (!($0 = $1)) {$0 = $2} return $0";else{if("&&"!==e.operator)throw new Error(b(e)+"Illegal logical operator: "+e.operator);r="var $0; if ($0 = $1) {$0 = $2} return $0"}s(e,P(m.part(r,[i,e.left,e.right]).body))}},t),e)}function B(e,t,n){if("SwitchCase"!==e.type&&a(e).isBlockStatement)for(var r=0;r0&&a(e).isAsync)return delete e.async,e.argument={type:"CallExpression",callee:"ThrowStatement"===e.type?ge.error:ge.return,arguments:e.argument?[e.argument]:[]},void(e.type="ReturnStatement");n(e)})}function ee(e,t){if(n.noRuntime)throw new Error("Nodent: 'noRuntime' option only compatible with -promise and -engine modes");return m.part("{ return (function*($return,$error){ $:body }).$asyncspawn(Promise,this) }",{return:ge.return,error:ge.error,asyncspawn:ge.asyncspawn,body:K(e).concat(t?[{type:"ReturnStatement",argument:ge.return}]:[])}).body[0]}function te(e){e.$asyncgetwarninig||(e.$asyncgetwarninig=!0,y(b(e)+"'async get "+r(e)+"(){...}' is non-standard. See https://github.com/MatAtBread/nodent#differences-from-the-es7-specification"))}function ne(e,t){function r(e,t){m.treeWalker(e,function(n,r,i){n!==e&&a(n).isFunction||(a(n).isAwait?t?(n.$hidden=!0,r()):(delete n.operator,n.delegate=!1,n.type="YieldExpression",r()):r())})}function o(e){var t=n.promises;n.promises=!0,C(e,!0),n.promises=t}function u(e){return"BlockStatement"!==e.body.type&&(e.body={type:"BlockStatement",body:[{type:"ReturnStatement",argument:e.body}]}),e}function c(e,n){n.$asyncexitwarninig||(n.$asyncexitwarninig=!0,y(b(e)+"'async "+{ReturnStatement:"return",ThrowStatement:"throw"}[e.type]+"' not possible in "+(t?"engine":"generator")+" mode. Using Promises for function at "+b(n)))}m.treeWalker(e,function(e,n,i){n();var l,p,h;if(a(e).isAsync&&a(e).isFunction){var f;(f=w(i[0].parent))&&a(f).isAsync&&"get"===i[0].parent.kind&&te(i[0].parent.key),(p=Q(e.body))?(c(p,e.body),o(e)):t?"get"!==i[0].parent.kind&&r(e,!0):(l=e,delete l.async,h=E(l),r(l,!1),l=u(l),l.body=ee(l.body.body,p),h&&V(l.body.body,[ve]),l.id&&"ExpressionStatement"===i[0].parent.type?(l.type="FunctionDeclaration",i[1].replace(l)):i[0].replace(l))}else(l=w(e))&&a(l).isAsync&&((p=Q(l))?(c(p,l),o(e)):t&&"get"!==e.kind||(t?o(e):(e.async=!1,h=E(l),r(l,!1),s(l,u(l)),l.body=ee(l.body.body,p)),h&&V(l.body.body,[ve])))});var l=i(n);return n.engine=!1,n.generators=!1,le(e),ae(e),D(e,l.engine),$(e),N(e),W(e,[q,J,I,j,B]),z(e,"warn"),n.engine=l.engine,n.generators=l.generators,e}function re(e,t,n){var r=[];return m.treeWalker(e,function(i,s,o){return i===e?s():t(i,o)?void r.push([].concat(o)):void(n||a(i).isScope||s())}),r}function ie(e,t){var n=[],r={};if(e=e.filter(function(e){return"ExportNamedDeclaration"!==e[0].parent.type}),e.length){var s={};e.forEach(function(e){function t(e){e in s?r[e]=o.declarations[u]:s[e]=o.declarations[u]}for(var n=e[0],o=n.self,a=(o.kind,[]),u=0;u1?{type:"SequenceExpression",expressions:a}:a[0];"For"!==n.parent.type.slice(0,3)&&(p={type:"ExpressionStatement",expression:p}),n.replace(p)}});var o=Object.keys(s);o.length&&(o=o.map(function(e){return{type:"VariableDeclarator",id:f(e),loc:s[e].loc,start:s[e].start,end:s[e].end}}),n[0]&&"VariableDeclaration"===n[0].type?n[0].declarations=n[0].declarations.concat(o):n.unshift({type:"VariableDeclaration",kind:t,declarations:o}))}return{decls:n,duplicates:r}}function se(e){if(!e)return[];if(Array.isArray(e))return e.reduce(function(e,t){return e.concat(se(t.id))},[]);switch(e.type){case"Identifier":return[e.name];case"ArrayPattern":return e.elements.reduce(function(e,t){return e.concat(se(t))},[]);case"ObjectPattern":return e.properties.reduce(function(e,t){return e.concat(se(t))},[]);case"ObjectProperty":case"Property":return se(e.value);case"RestElement":case"RestProperty":return se(e.argument)}}function oe(e){function t(e){y(b(e)+"Possible assignment to 'const "+r(e)+"'")}function n(e){switch(e.type){case"Identifier":"const"===i[e.name]&&t(e);break;case"ArrayPattern":e.elements.forEach(function(e){"const"===i[e.name]&&t(e)});break;case"ObjectPattern":e.properties.forEach(function(e){"const"===i[e.key.name]&&t(e)})}}var i={};m.treeWalker(e,function(e,t,r){var s=a(e).isBlockStatement;if(s){i=Object.create(i);for(var o=0;o=0){var r=n[0];return("left"!=r.field||"ForInStatement"!==r.parent.type&&"ForOfStatement"!==r.parent.type)&&("init"!=r.field||"ForStatement"!==r.parent.type||"const"!==t.kind&&"let"!==t.kind)}}}function n(e,t){return!("FunctionDeclaration"!==e.type||!e.id)&&(a(e).isAsync||!e.$continuation)}oe(e);var i=!1;return m.treeWalker(e,function(e,s,o){var u=i;if(i=i||he(e),a(e).isBlockStatement){if(c(e)){var l,p,h,d,m,g=!o[0].parent||a(o[0].parent).isScope;if(g){p=re(e,t(["const"]),!1);var v={},x={};p.forEach(function(e){e[0].self.declarations.forEach(function(e){se(e.id).forEach(function(t){v[t]||x[t]?(delete v[t],x[t]=e):v[t]=e})})}),p.forEach(function(e){for(var t=0;t=0&&"ReturnStatement"===r[1].self.type){var s=e.$thisCallName,o=i(ye[s].def.body.body);ye[s].$inlined=!0,a(r[1].self).isJump||o.push({type:"ReturnStatement"}),r[1].replace(o)}});var n=Object.keys(ye).map(function(e){return ye[e].$inlined&&ye[e].def});m.treeWalker(e,function(e,t,r){t(),n.indexOf(e)>=0&&r[0].remove()})}if("Program"!==e.type&&"module"!==e.sourceType||!u(e,function(e){return a(e).isES6},!0)){var r=he(e);!function(e){m.treeWalker(e,function(e,t,n){if("Program"===e.type||"FunctionDeclaration"===e.type||"FunctionExpression"===e.type){var i=r;if(r=r||he(e)){t();var s="Program"===e.type?e:e.body,o=re(s,function(e,t){if("FunctionDeclaration"===e.type)return t[0].parent!==s});o=o.map(function(e){return e[0].remove()}),[].push.apply(s.body,o)}else t();r=i}else t()})}(e)}return m.treeWalker(e,function(e,t,n){t(),Object.keys(e).filter(function(e){return"$"===e[0]}).forEach(function(t){delete e[t]})}),e}var ye={},me=1,ge={};Object.keys(n).filter(function(e){return"$"===e[0]}).forEach(function(e){ge[e.slice(1)]=f(n[e])});var ve=m.part("var $0 = arguments",[ge.arguments]).body[0];return n.engine?(e.ast=ce(e.ast,!0),e.ast=ne(e.ast,n.engine),e.ast=pe(e.ast),de(e.ast)):n.generators?(e.ast=ce(e.ast),e.ast=ne(e.ast),e.ast=pe(e.ast),de(e.ast)):(e.ast=ce(e.ast),C(e.ast)),n.babelTree&&m.treeWalker(e.ast,function(e,t,n){t(),"Literal"===e.type&&s(e,x(e.value))}),e}var m=e("./parser"),g=e("./output"),v={start:!0,end:!0,loc:!0,range:!0},b={getScope:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type&&"BlockStatement"===this.node.body.type?this.node.body.body:"Program"===this.node.type?this.node.body:null},isScope:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"Program"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type&&"BlockStatement"===this.node.body.type},isFunction:function(){return"FunctionDeclaration"===this.node.type||"FunctionExpression"===this.node.type||"Function"===this.node.type||"ObjectMethod"===this.node.type||"ClassMethod"===this.node.type||"ArrowFunctionExpression"===this.node.type},isClass:function(){return"ClassDeclaration"===this.node.type||"ClassExpression"===this.node.type},isBlockStatement:function(){return"ClassBody"===this.node.type||"Program"===this.node.type||"BlockStatement"===this.node.type?this.node.body:"SwitchCase"===this.node.type&&this.node.consequent},isExpressionStatement:function(){return"ExpressionStatement"===this.node.type},isLiteral:function(){return"Literal"===this.node.type||"BooleanLiteral"===this.node.type||"RegExpLiteral"===this.node.type||"NumericLiteral"===this.node.type||"StringLiteral"===this.node.type||"NullLiteral"===this.node.type},isDirective:function(){return"ExpressionStatement"===this.node.type&&("StringLiteral"===this.node.expression.type||"Literal"===this.node.expression.type&&"string"==typeof this.node.expression.value)},isUnaryExpression:function(){return"UnaryExpression"===this.node.type},isAwait:function(){return"AwaitExpression"===this.node.type&&!this.node.$hidden},isAsync:function(){return this.node.async},isStatement:function(){return null!==this.node.type.match(/[a-zA-Z]+Declaration/)||null!==this.node.type.match(/[a-zA-Z]+Statement/)},isExpression:function(){return null!==this.node.type.match(/[a-zA-Z]+Expression/)},isLoop:function(){return"ForStatement"===this.node.type||"WhileStatement"===this.node.type||"DoWhileStatement"===this.node.type},isJump:function(){return"ReturnStatement"===this.node.type||"ThrowStatement"===this.node.type||"BreakStatement"===this.node.type||"ContinueStatement"===this.node.type},isES6:function(){switch(this.node.type){case"ExportNamedDeclaration":case"ExportSpecifier":case"ExportDefaultDeclaration":case"ExportAllDeclaration":case"ImportDeclaration":case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ArrowFunctionExpression":case"ForOfStatement":case"YieldExpression":case"Super":case"RestElement":case"RestProperty":case"SpreadElement":case"TemplateLiteral":case"ClassDeclaration":case"ClassExpression":return!0;case"VariableDeclaration":return this.node.kind&&"var"!==this.node.kind;case"FunctionDeclaration":case"FunctionExpression":return!!this.node.generator}}},x={};Object.keys(b).forEach(function(e){Object.defineProperty(x,e,{get:b[e]})}),t.exports={printNode:r,babelLiteralNode:h,asynchronize:function(e,t,n,r){try{return y(e,t,n,r)}catch(t){if(t instanceof SyntaxError){var i=e.origCode.substr(t.pos-t.loc.column);i=i.split("\n")[0],t.message+=" (nodent)\n"+i+"\n"+i.replace(/[\S ]/g,"-").substring(0,t.loc.column)+"^",t.stack=""}throw t}}}},{"./output":10,"./parser":11}],10:[function(e,t,n){"use strict";function r(e){var t=y[e.type]||y[e.type+e.operator]||y[e.type+e.operator+(e.prefix?"prefix":"")];return void 0!==t?t:20} +function i(e,t,n){var r=this[n||e.type];r?r.call(this,e,t):t.write(e,"/*"+e.type+"?*/ "+t.sourceAt(e.start,e.end))}function s(e,t,n,i){2===i||r(n)0){this.out(e[0],t,e[0].type);for(var r=1,i=e.length;r>":13,"BinaryExpression>>>":13,"BinaryExpression<":12,"BinaryExpression<=":12,"BinaryExpression>":12,"BinaryExpression>=":12,BinaryExpressionin:12,BinaryExpressioninstanceof:12,"BinaryExpression==":11,"BinaryExpression===":11,"BinaryExpression!=":11,"BinaryExpression!==":11,"BinaryExpression&":10,"BinaryExpression^":9,"BinaryExpression|":8,"LogicalExpression&&":7,"LogicalExpression||":6,ConditionalExpression:5,AssignmentPattern:4,AssignmentExpression:4,yield:3,YieldExpression:3,SpreadElement:2,"comma-separated-list":1.5,SequenceExpression:1},m={type:"comma-separated-list"},g={out:i,expr:s,formatParameters:o,Program:function(e,t){var n,r,i=h(t.indent,t.indentLevel),s=t.lineEnd;n=e.body;for(var o=0,a=n.length;o0){t.write(null,s);for(var a=0,u=n.length;a0){this.out(n[0],t,"VariableDeclarator");for(var i=1;i0){for(var n=0;n0)for(var r=0;r "),"ObjectExpression"===e.body.type||"SequenceExpression"===e.body.type?(t.write(null,"("),this.out(e.body,t,e.body.type),t.write(null,")")):this.out(e.body,t,e.body.type)},ThisExpression:function(e,t){t.write(e,"this")},Super:function(e,t){t.write(e,"super")},RestElement:u=function(e,t){t.write(e,"..."),this.out(e.argument,t,e.argument.type)},SpreadElement:u,YieldExpression:function(e,t){t.write(e,e.delegate?"yield*":"yield"),e.argument&&(t.write(null," "),this.expr(t,e,e.argument))},AwaitExpression:function(e,t){t.write(e,"await "),this.expr(t,e,e.argument)},TemplateLiteral:function(e,t){var n,r=e.quasis,i=e.expressions;t.write(e,"`");for(var s=0,o=i.length;s0)for(var n=e.elements,r=n.length,i=0;;){var s=n[i];if(s&&this.expr(t,m,s),i+=1,(i=r)break;t.lineLength()>t.wrapColumn&&t.write(null,t.lineEnd,h(t.indent,t.indentLevel+1))}t.write(null,"]")},ArrayPattern:l,ObjectExpression:function(e,t){var n,r=h(t.indent,t.indentLevel++),i=t.lineEnd,s=r+t.indent;if(t.write(e,"{"),e.properties.length>0){t.write(null,i);for(var o=e.properties,a=o.length,u=0;n=o[u],t.write(null,s),this.out(n,t,"Property"),++ut.wrapColumn&&t.write(null,t.lineEnd,h(t.indent,t.indentLevel+1));t.write(null,i,r,"}")}else t.write(null,"}");t.indentLevel--},Property:function(e,t){e.method||"get"===e.kind||"set"===e.kind?this.MethodDefinition(e,t):(e.shorthand||(e.computed?(t.write(null,"["),this.out(e.key,t,e.key.type),t.write(null,"]")):this.out(e.key,t,e.key.type),t.write(null,": ")),this.expr(t,m,e.value))},ObjectPattern:function(e,t){if(t.write(e,"{"),e.properties.length>0)for(var n=e.properties,r=n.length,i=0;this.out(n[i],t,"Property"),++i0)for(var i=r.length,s=0;s1&&t.write(e," "),this.expr(t,e,e.argument,!0)):(this.expr(t,e,e.argument),t.write(e,e.operator))},UpdateExpression:function(e,t){e.prefix?(t.write(e,e.operator),this.out(e.argument,t,e.argument.type)):(this.out(e.argument,t,e.argument.type),t.write(e,e.operator))},BinaryExpression:c=function(e,t){var n=e.operator;"in"===n&&t.inForInit&&t.write(null,"("),this.expr(t,e,e.left),t.write(e," ",n," "),this.expr(t,e,e.right,"ArrowFunctionExpression"===e.right.type?2:0),"in"===n&&t.inForInit&&t.write(null,")")},LogicalExpression:c,AssignmentExpression:function(e,t){"ObjectPattern"===e.left.type&&t.write(null,"("),this.BinaryExpression(e,t),"ObjectPattern"===e.left.type&&t.write(null,")")},AssignmentPattern:function(e,t){this.expr(t,e,e.left),t.write(e," = "),this.expr(t,e,e.right)},ConditionalExpression:function(e,t){this.expr(t,e,e.test,!0),t.write(e," ? "),this.expr(t,e,e.consequent),t.write(null," : "),this.expr(t,e,e.alternate)},NewExpression:function(e,t){t.write(e,"new "),this.out(e,t,"CallExpression")},CallExpression:function(e,t){this.expr(t,e,e.callee,"ObjectExpression"===e.callee.type?2:0),t.write(e,"(");var n=e.arguments;if(n.length>0)for(var r=n.length,i=0;i=0&&r({self:i,parent:e,field:a[u],index:!0}):c instanceof Object&&i===c&&r({self:i,parent:e,field:a[u]})}})}return n||(n=[{self:e}],n.replace=function(e,t){n[e].replace(t)}),t(e,s,n),e}function s(e,t){var n=[],r={plugins:{asyncawait:{asyncExits:!0,awaitAnywhere:!0}},ecmaVersion:8,allowHashBang:!0,allowReturnOutsideFunction:!0,allowImportExportEverywhere:!0,locations:!0,onComment:n};if(t)for(var s in t)r[s]=t[s];var o=a.parse(e,r);return i(o,function(e,t,r){for(t();n.length&&e.loc&&e.loc.start.line>=n[0].loc.start.line&&e.loc.end.line>=n[0].loc.end.line;)e.$comments=e.$comments||[],e.$comments.push(n.shift())}),o}function o(e,t){function n(e,r){if(Array.isArray(r)&&!Array.isArray(e))throw new Error("Can't substitute an array for a node");return r=r||{},Object.keys(e).forEach(function(i){function s(e){return"function"==typeof e&&(e=e()),r=r.concat(e)}function o(e){return"function"==typeof e&&(e=e()),r[i]=e,r}if(!(e[i]instanceof Object))return r[i]=e[i];if(Array.isArray(e[i]))return r[i]=n(e[i],[]);var a;if(a=Array.isArray(r)?s:o,"Identifier"===e[i].type&&"$"===e[i].name[0])return a(t[e[i].name.slice(1)]);if("LabeledStatement"===e[i].type&&"$"===e[i].label.name){var u=e[i].body.expression;return a(t[u.name||u.value])}return a("LabeledStatement"===e[i].type&&"$$"===e[i].label.name.slice(0,2)?t[e[i].label.name.slice(2)](n(e[i]).body):n(e[i]))}),r}h[e]||(h[e]=s(e,{locations:!1,ranges:!1,onComment:null}));var r=n(h[e]);return{body:r.body,expr:"ExpressionStatement"===r.body[0].type?r.body[0].expression:null}}var a=e("acorn"),u=e("acorn/dist/walk"),c={AwaitExpression:function(e,t,n){n(e.argument,t,"Expression")},SwitchStatement:function(e,t,n){n(e.discriminant,t,"Expression");for(var r=0;r=t}function i(e,t,n){var r=t.input.slice(t.start);return n&&(r=r.replace(p,"$1 $3")),e.test(r)}function s(e,t,n,r){var i=new e.constructor(e.options,e.input,t);if(n)for(var s in n)i[s]=n[s];var o=e,a=i;return["inFunction","inAsyncFunction","inAsync","inGenerator","inModule"].forEach(function(e){e in o&&(a[e]=o[e])}),r&&(i.options.preserveParens=!0),i.nextToken(),i}function o(e,t){var n=function(){};e.extend("initialContext",function(r){return function(){return this.options.ecmaVersion<7&&(n=function(t){e.raise(t.start,"async/await keywords only available when ecmaVersion>=7")}),this.reservedWords=new RegExp(this.reservedWords.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.reservedWordsStrict=new RegExp(this.reservedWordsStrict.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.reservedWordsStrictBind=new RegExp(this.reservedWordsStrictBind.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")),this.inAsyncFunction=t.inAsyncFunction,t.awaitAnywhere&&t.inAsyncFunction&&e.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive"),r.apply(this,arguments)}}),e.extend("shouldParseExportStatement",function(e){return function(){return!("name"!==this.type.label||"async"!==this.value||!i(c,this))||e.apply(this,arguments)}}),e.extend("parseStatement",function(e){return function(n,r){var s=this.start,o=this.startLoc;if("name"===this.type.label)if(i(c,this,!0)){var a=this.inAsyncFunction;try{this.inAsyncFunction=!0,this.next();var l=this.parseStatement(n,r);return l.async=!0,l.start=s,l.loc&&(l.loc.start=o),l.range&&(l.range[0]=s),l}finally{this.inAsyncFunction=a}}else if("object"==typeof t&&t.asyncExits&&i(u,this)){this.next();var l=this.parseStatement(n,r);return l.async=!0,l.start=s,l.loc&&(l.loc.start=o),l.range&&(l.range[0]=s),l}return e.apply(this,arguments)}}),e.extend("parseIdent",function(e){return function(t){var n=e.apply(this,arguments);return this.inAsyncFunction&&"await"===n.name&&0===arguments.length&&this.raise(n.start,"'await' is reserved within async functions"),n}}),e.extend("parseExprAtom",function(e){return function(i){var o,u=this.start,c=this.startLoc,p=e.apply(this,arguments);if("Identifier"===p.type)if("async"!==p.name||r(this,p.end)){if("await"===p.name){var h=this.startNodeAt(p.start,p.loc&&p.loc.start);if(this.inAsyncFunction)return o=this.parseExprSubscripts(),h.operator="await",h.argument=o,h=this.finishNodeAt(h,"AwaitExpression",o.end,o.loc&&o.loc.end),n(h),h;if(this.input.slice(p.end).match(l))return t.awaitAnywhere||"module"!==this.options.sourceType?p:this.raise(p.start,"'await' is reserved within modules");if("object"==typeof t&&t.awaitAnywhere&&(u=this.start,o=s(this,u-4).parseExprSubscripts(),o.end<=u))return o=s(this,u).parseExprSubscripts(),h.operator="await",h.argument=o,h=this.finishNodeAt(h,"AwaitExpression",o.end,o.loc&&o.loc.end),this.pos=o.end,this.end=o.end,this.endLoc=o.endLoc,this.next(),n(h),h;if(!t.awaitAnywhere&&"module"===this.options.sourceType)return this.raise(p.start,"'await' is reserved within modules")}}else{var f=this.inAsyncFunction;try{this.inAsyncFunction=!0;var d=this,y=!1,m={parseFunctionBody:function(e,t){try{var n=y;return y=!0,d.parseFunctionBody.apply(this,arguments)}finally{y=n}},raise:function(){try{return d.raise.apply(this,arguments)}catch(e){throw y?e:a}}};if(o=s(this,this.start,m,!0).parseExpression(),"SequenceExpression"===o.type&&(o=o.expressions[0]),"FunctionExpression"===o.type||"FunctionDeclaration"===o.type||"ArrowFunctionExpression"===o.type)return o=s(this,this.start,m).parseExpression(),"SequenceExpression"===o.type&&(o=o.expressions[0]),o.async=!0,o.start=u,o.loc&&(o.loc.start=c),o.range&&(o.range[0]=u),this.pos=o.end,this.end=o.end,this.endLoc=o.endLoc,this.next(),n(o),o}catch(e){if(e!==a)throw e}finally{this.inAsyncFunction=f}}return p}}),e.extend("finishNodeAt",function(e){return function(t,n,r,i){return t.__asyncValue&&(delete t.__asyncValue,t.value.async=!0),e.apply(this,arguments)}}),e.extend("finishNode",function(e){return function(t,n){return t.__asyncValue&&(delete t.__asyncValue,t.value.async=!0),e.apply(this,arguments)}});e.extend("parsePropertyName",function(e){return function(t){var i=(t.key&&t.key.name,e.apply(this,arguments));return"Identifier"!==i.type||"async"!==i.name||r(this,i.end)||this.input.slice(i.end).match(l)||(h.test(this.input.slice(i.end))?(i=e.apply(this,arguments),t.__asyncValue=!0):(n(t),"set"===t.kind&&this.raise(i.start,"'set (value)' cannot be be async"),i=e.apply(this,arguments),"Identifier"===i.type&&"set"===i.name&&this.raise(i.start,"'set (value)' cannot be be async"),t.__asyncValue=!0)),i}}),e.extend("parseClassMethod",function(e){return function(t,n,r){var i;n.__asyncValue&&("constructor"===n.kind&&this.raise(n.start,"class constructor() cannot be be async"),i=this.inAsyncFunction,this.inAsyncFunction=!0);var s=e.apply(this,arguments);return this.inAsyncFunction=i,s}}),e.extend("parseMethod",function(e){return function(t){var n;this.__currentProperty&&this.__currentProperty.__asyncValue&&(n=this.inAsyncFunction,this.inAsyncFunction=!0);var r=e.apply(this,arguments);return this.inAsyncFunction=n,r}}),e.extend("parsePropertyValue",function(e){return function(t,n,r,i,s,o){var a=this.__currentProperty;this.__currentProperty=t;var u;t.__asyncValue&&(u=this.inAsyncFunction,this.inAsyncFunction=!0);var c=e.apply(this,arguments);return this.inAsyncFunction=u,this.__currentProperty=a,c}})}var a={},u=/^async[\t ]+(return|throw)/,c=/^async[\t ]+function/,l=/^\s*[():;]/,p=/([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g,h=/\s*(get|set)\s*\(/;t.exports=o},{}],14:[function(e,t,n){function r(e,t){return e.lineStart>=t}function i(e,t,n){var r=t.input.slice(t.start);return n&&(r=r.replace(c,"$1 $3")),e.test(r)}function s(e,t,n){var r=new e.constructor(e.options,e.input,t);if(n)for(var i in n)r[i]=n[i];var s=e,o=r;return["inFunction","inAsync","inGenerator","inModule"].forEach(function(e){e in s&&(o[e]=s[e])}),r.nextToken(),r}function o(e,t){t&&"object"==typeof t||(t={}),e.extend("parse",function(n){return function(){return this.inAsync=t.inAsyncFunction,t.awaitAnywhere&&t.inAsyncFunction&&e.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive"),n.apply(this,arguments)}}),e.extend("parseStatement",function(e){return function(n,r){var s=this.start,o=this.startLoc;if("name"===this.type.label&&t.asyncExits&&i(a,this)){this.next();var u=this.parseStatement(n,r);return u.async=!0,u.start=s,u.loc&&(u.loc.start=o),u.range&&(u.range[0]=s),u}return e.apply(this,arguments)}}),e.extend("parseIdent",function(e){return function(n){return"module"===this.options.sourceType&&this.options.ecmaVersion>=8&&t.awaitAnywhere?e.call(this,!0):e.apply(this,arguments)}}),e.extend("parseExprAtom",function(e){var n={};return function(r){var i,o=this.start,a=(this.startLoc,e.apply(this,arguments));if("Identifier"===a.type&&"await"===a.name&&!this.inAsync&&t.awaitAnywhere){var u=this.startNodeAt(a.start,a.loc&&a.loc.start);o=this.start;var c={raise:function(){try{return pp.raise.apply(this,arguments)}catch(e){throw n}}};try{if(i=s(this,o-4,c).parseExprSubscripts(),i.end<=o)return i=s(this,o,c).parseExprSubscripts(),u.argument=i,u=this.finishNodeAt(u,"AwaitExpression",i.end,i.loc&&i.loc.end),this.pos=i.end,this.end=i.end,this.endLoc=i.endLoc,this.next(),u}catch(e){if(e===n)return a;throw e}}return a}});var n={undefined:!0,get:!0,set:!0,static:!0,async:!0,constructor:!0};e.extend("parsePropertyName",function(e){return function(t){var i=t.key&&t.key.name,s=e.apply(this,arguments);return"get"===this.value&&(t.__maybeStaticAsyncGetter=!0),n[this.value]?s:("Identifier"!==s.type||"async"!==s.name&&"async"!==i||r(this,s.end)||this.input.slice(s.end).match(u)?delete t.__maybeStaticAsyncGetter:"set"===t.kind||"set"===s.name?this.raise(s.start,"'set (value)' cannot be be async"):(this.__isAsyncProp=!0,s=e.apply(this,arguments),"Identifier"===s.type&&"set"===s.name&&this.raise(s.start,"'set (value)' cannot be be async")),s)}}),e.extend("parseClassMethod",function(e){return function(t,n,r){var i=e.apply(this,arguments);return n.__maybeStaticAsyncGetter&&(delete n.__maybeStaticAsyncGetter,n.kind="get"),i}}),e.extend("parseFunctionBody",function(e){return function(t,n){var r=this.inAsync;this.__isAsyncProp&&(t.async=!0,this.inAsync=!0,delete this.__isAsyncProp);var i=e.apply(this,arguments);return this.inAsync=r,i}})}var a=/^async[\t ]+(return|throw)/,u=/^\s*[):;]/,c=/([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g;t.exports=o},{}],15:[function(e,t,n){!function(e,r){"object"==typeof n&&void 0!==t?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r(e.acorn=e.acorn||{})}(this,function(e){"use strict";function t(e,t){for(var n=65536,r=0;re)return!1;if(n+=t[r+1],n>=e)return!0}}function n(e,n){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&A.test(String.fromCharCode(e)):n!==!1&&t(e,C)))}function r(e,n){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&_.test(String.fromCharCode(e)):n!==!1&&(t(e,C)||t(e,L)))))}function i(e,t){return new P(e,{beforeExpr:!0,binop:t})}function s(e,t){return void 0===t&&(t={}),t.keyword=e,O[e]=new P(e,t)}function o(e){return 10===e||13===e||8232===e||8233===e}function a(e){return"[object Array]"===Object.prototype.toString.call(e)}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var n=1,r=0;;){$.lastIndex=r;var i=$.exec(e);if(!(i&&i.index=2015&&(t.ecmaVersion-=2009),null==t.allowReserved&&(t.allowReserved=t.ecmaVersion<5),a(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}return a(t.onComment)&&(t.onComment=p(t,t.onComment)),t}function p(e,t){return function(n,r,i,s,o,a){var u={type:n?"Block":"Line",value:r,start:i,end:s};e.locations&&(u.loc=new M(this,o,a)),e.ranges&&(u.range=[i,s]),t.push(u)}}function h(e){return new RegExp("^("+e.replace(/ /g,"|")+")$")}function f(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}function d(e,t,n,r){try{return new RegExp(e,t)}catch(e){if(void 0!==n)throw e instanceof SyntaxError&&r.raise(n,"Error parsing regular expression: "+e.message),e}}function y(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(1023&e)+56320))}function m(e,t){return new U(t,e).parse()}function g(e,t,n){var r=new U(n,e,t);return r.nextToken(),r.parseExpression()}function v(e,t){return new U(t,e)}function b(t,n,r){e.parse_dammit=t,e.LooseParser=n,e.pluginsLoose=r}var x={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},w="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",E={5:w,6:w+" const class extends export import super" +},S="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",k="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",A=new RegExp("["+S+"]"),_=new RegExp("["+S+k+"]");S=k=null;var C=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],L=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],P=function(e,t){void 0===t&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null},T={beforeExpr:!0},R={startsExpr:!0},O={},F={num:new P("num",R),regexp:new P("regexp",R),string:new P("string",R),name:new P("name",R),eof:new P("eof"),bracketL:new P("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new P("]"),braceL:new P("{",{beforeExpr:!0,startsExpr:!0}),braceR:new P("}"),parenL:new P("(",{beforeExpr:!0,startsExpr:!0}),parenR:new P(")"),comma:new P(",",T),semi:new P(";",T),colon:new P(":",T),dot:new P("."),question:new P("?",T),arrow:new P("=>",T),template:new P("template"),ellipsis:new P("...",T),backQuote:new P("`",R),dollarBraceL:new P("${",{beforeExpr:!0,startsExpr:!0}),eq:new P("=",{beforeExpr:!0,isAssign:!0}),assign:new P("_=",{beforeExpr:!0,isAssign:!0}),incDec:new P("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new P("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:i("||",1),logicalAND:i("&&",2),bitwiseOR:i("|",3),bitwiseXOR:i("^",4),bitwiseAND:i("&",5),equality:i("==/!=",6),relational:i("",7),bitShift:i("<>",8),plusMin:new P("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:i("%",10),star:i("*",10),slash:i("/",10),starstar:new P("**",{beforeExpr:!0}),_break:s("break"),_case:s("case",T),_catch:s("catch"),_continue:s("continue"),_debugger:s("debugger"),_default:s("default",T),_do:s("do",{isLoop:!0,beforeExpr:!0}),_else:s("else",T),_finally:s("finally"),_for:s("for",{isLoop:!0}),_function:s("function",R),_if:s("if"),_return:s("return",T),_switch:s("switch"),_throw:s("throw",T),_try:s("try"),_var:s("var"),_const:s("const"),_while:s("while",{isLoop:!0}),_with:s("with"),_new:s("new",{beforeExpr:!0,startsExpr:!0}),_this:s("this",R),_super:s("super",R),_class:s("class"),_extends:s("extends",T),_export:s("export"),_import:s("import"),_null:s("null",R),_true:s("true",R),_false:s("false",R),_in:s("in",{beforeExpr:!0,binop:7}),_instanceof:s("instanceof",{beforeExpr:!0,binop:7}),_typeof:s("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:s("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:s("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},N=/\r\n?|\n|\u2028|\u2029/,$=new RegExp(N.source,"g"),B=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,I=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,j=function(e,t){this.line=e,this.column=t};j.prototype.offset=function(e){return new j(this.line,this.column+e)};var M=function(e,t,n){this.start=t,this.end=n,null!==e.sourceFile&&(this.source=e.sourceFile)},D={ecmaVersion:7,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowHashBang:!1,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1,plugins:{}},V={},U=function(e,t,n){this.options=e=l(e),this.sourceFile=e.sourceFile,this.keywords=h(E[e.ecmaVersion>=6?6:5]);var r="";if(!e.allowReserved){for(var i=e.ecmaVersion;!(r=x[i]);i--);"module"==e.sourceType&&(r+=" await")}this.reservedWords=h(r);var s=(r?r+" ":"")+x.strict;this.reservedWordsStrict=h(s),this.reservedWordsStrictBind=h(s+" "+x.strictBind),this.input=String(t),this.containsEsc=!1,this.loadPlugins(e.plugins),n?(this.pos=n,this.lineStart=this.input.lastIndexOf("\n",n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(N).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=F.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.strict=this.inModule="module"===e.sourceType,this.potentialArrowAt=-1,this.inFunction=this.inGenerator=this.inAsync=!1,this.yieldPos=this.awaitPos=0,this.labels=[],0===this.pos&&e.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2)};U.prototype.isKeyword=function(e){return this.keywords.test(e)},U.prototype.isReservedWord=function(e){return this.reservedWords.test(e)},U.prototype.extend=function(e,t){this[e]=t(this[e])},U.prototype.loadPlugins=function(e){var t=this;for(var n in e){var r=V[n];if(!r)throw new Error("Plugin '"+n+"' not found");r(t,e[n])}},U.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)};var q=U.prototype;q.isUseStrict=function(e){return this.options.ecmaVersion>=5&&"ExpressionStatement"===e.type&&"Literal"===e.expression.type&&"use strict"===e.expression.raw.slice(1,-1)},q.eat=function(e){return this.type===e&&(this.next(),!0)},q.isContextual=function(e){return this.type===F.name&&this.value===e},q.eatContextual=function(e){return this.value===e&&this.eat(F.name)},q.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},q.canInsertSemicolon=function(){return this.type===F.eof||this.type===F.braceR||N.test(this.input.slice(this.lastTokEnd,this.start))},q.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},q.semicolon=function(){this.eat(F.semi)||this.insertSemicolon()||this.unexpected()},q.afterTrailingComma=function(e,t){if(this.type==e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},q.expect=function(e){this.eat(e)||this.unexpected()},q.unexpected=function(e){this.raise(null!=e?e:this.start,"Unexpected token")};var W=function(){this.shorthandAssign=0,this.trailingComma=0};q.checkPatternErrors=function(e,t){var n=e&&e.trailingComma;if(!t)return!!n;n&&this.raise(n,"Comma is not permitted after the rest element")},q.checkExpressionErrors=function(e,t){var n=e&&e.shorthandAssign;if(!t)return!!n;n&&this.raise(n,"Shorthand property assignments are valid only in destructuring patterns")},q.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos=6&&(e.sourceType=this.options.sourceType),this.finishNode(e,"Program")};var Y={kind:"loop"},G={kind:"switch"};z.isLet=function(){if(this.type!==F.name||this.options.ecmaVersion<6||"let"!=this.value)return!1;I.lastIndex=this.pos;var e=I.exec(this.input),t=this.pos+e[0].length,i=this.input.charCodeAt(t);if(91===i||123==i)return!0;if(n(i,!0)){for(var s=t+1;r(this.input.charCodeAt(s),!0);++s);var o=this.input.slice(t,s);if(!this.isKeyword(o))return!0}return!1},z.isAsyncFunction=function(){if(this.type!==F.name||this.options.ecmaVersion<8||"async"!=this.value)return!1;I.lastIndex=this.pos;var e=I.exec(this.input),t=this.pos+e[0].length;return!(N.test(this.input.slice(this.pos,t))||"function"!==this.input.slice(t,t+8)||t+8!=this.input.length&&r(this.input.charAt(t+8)))},z.parseStatement=function(e,t,n){var r,i=this.type,s=this.startNode();switch(this.isLet()&&(i=F._var,r="let"),i){case F._break:case F._continue:return this.parseBreakContinueStatement(s,i.keyword);case F._debugger:return this.parseDebuggerStatement(s);case F._do:return this.parseDoStatement(s);case F._for:return this.parseForStatement(s);case F._function:return!e&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1);case F._class:return e||this.unexpected(),this.parseClass(s,!0);case F._if:return this.parseIfStatement(s);case F._return:return this.parseReturnStatement(s);case F._switch:return this.parseSwitchStatement(s);case F._throw:return this.parseThrowStatement(s);case F._try:return this.parseTryStatement(s);case F._const:case F._var:return r=r||this.value,e||"var"==r||this.unexpected(),this.parseVarStatement(s,r);case F._while:return this.parseWhileStatement(s);case F._with:return this.parseWithStatement(s);case F.braceL:return this.parseBlock();case F.semi:return this.parseEmptyStatement(s);case F._export:case F._import:return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),i===F._import?this.parseImport(s):this.parseExport(s,n);default:if(this.isAsyncFunction()&&e)return this.next(),this.parseFunctionStatement(s,!0);var o=this.value,a=this.parseExpression();return i===F.name&&"Identifier"===a.type&&this.eat(F.colon)?this.parseLabeledStatement(s,o,a):this.parseExpressionStatement(s,a)}},z.parseBreakContinueStatement=function(e,t){var n=this,r="break"==t;this.next(),this.eat(F.semi)||this.insertSemicolon()?e.label=null:this.type!==F.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var i=0;i=6?this.eat(F.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")},z.parseForStatement=function(e){if(this.next(),this.labels.push(Y),this.expect(F.parenL),this.type===F.semi)return this.parseFor(e,null);var t=this.isLet();if(this.type===F._var||this.type===F._const||t){var n=this.startNode(),r=t?"let":this.value;return this.next(),this.parseVar(n,!0,r),this.finishNode(n,"VariableDeclaration"),!(this.type===F._in||this.options.ecmaVersion>=6&&this.isContextual("of"))||1!==n.declarations.length||"var"!==r&&n.declarations[0].init?this.parseFor(e,n):this.parseForIn(e,n)}var i=new W,s=this.parseExpression(!0,i);return this.type===F._in||this.options.ecmaVersion>=6&&this.isContextual("of")?(this.checkPatternErrors(i,!0),this.toAssignable(s),this.checkLVal(s),this.parseForIn(e,s)):(this.checkExpressionErrors(i,!0),this.parseFor(e,s))},z.parseFunctionStatement=function(e,t){return this.next(),this.parseFunction(e,!0,!1,t)},z.isFunction=function(){return this.type===F._function||this.isAsyncFunction()},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(!this.strict&&this.isFunction()),e.alternate=this.eat(F._else)?this.parseStatement(!this.strict&&this.isFunction()):null,this.finishNode(e,"IfStatement")},z.parseReturnStatement=function(e){return this.inFunction||this.options.allowReturnOutsideFunction||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(F.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")},z.parseSwitchStatement=function(e){var t=this;this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(F.braceL),this.labels.push(G);for(var n,r=!1;this.type!=F.braceR;)if(t.type===F._case||t.type===F._default){var i=t.type===F._case;n&&t.finishNode(n,"SwitchCase"),e.cases.push(n=t.startNode()),n.consequent=[],t.next(),i?n.test=t.parseExpression():(r&&t.raiseRecoverable(t.lastTokStart,"Multiple default clauses"),r=!0,n.test=null),t.expect(F.colon)}else n||t.unexpected(),n.consequent.push(t.parseStatement(!0));return n&&this.finishNode(n,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")},z.parseThrowStatement=function(e){return this.next(),N.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var J=[];z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===F._catch){var t=this.startNode();this.next(),this.expect(F.parenL),t.param=this.parseBindingAtom(),this.checkLVal(t.param,!0),this.expect(F.parenR),t.body=this.parseBlock(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(F._finally)?this.parseBlock():null,e.handler||e.finalizer||this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")},z.parseVarStatement=function(e,t){return this.next(),this.parseVar(e,!1,t),this.semicolon(),this.finishNode(e,"VariableDeclaration")},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Y),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"WhileStatement")},z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(!1),this.finishNode(e,"WithStatement")},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")},z.parseLabeledStatement=function(e,t,n){for(var r=this,i=0;i=0;o--){var a=r.labels[o];if(a.statementStart!=e.start)break;a.statementStart=r.start,a.kind=s}return this.labels.push({name:t,kind:s,statementStart:this.start}),e.body=this.parseStatement(!0),this.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},z.parseBlock=function(e){var t,n=this,r=this.startNode(),i=!0;for(r.body=[],this.expect(F.braceL);!this.eat(F.braceR);){var s=n.parseStatement(!0);r.body.push(s),i&&e&&n.isUseStrict(s)&&(t=n.strict,n.setStrict(n.strict=!0)),i=!1}return t===!1&&this.setStrict(!1),this.finishNode(r,"BlockStatement")},z.parseFor=function(e,t){return e.init=t,this.expect(F.semi),e.test=this.type===F.semi?null:this.parseExpression(),this.expect(F.semi),e.update=this.type===F.parenR?null:this.parseExpression(),this.expect(F.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,"ForStatement")},z.parseForIn=function(e,t){var n=this.type===F._in?"ForInStatement":"ForOfStatement";return this.next(),e.left=t,e.right=this.parseExpression(),this.expect(F.parenR),e.body=this.parseStatement(!1),this.labels.pop(),this.finishNode(e,n)},z.parseVar=function(e,t,n){var r=this;for(e.declarations=[],e.kind=n;;){var i=r.startNode();if(r.parseVarId(i),r.eat(F.eq)?i.init=r.parseMaybeAssign(t):"const"!==n||r.type===F._in||r.options.ecmaVersion>=6&&r.isContextual("of")?"Identifier"==i.id.type||t&&(r.type===F._in||r.isContextual("of"))?i.init=null:r.raise(r.lastTokEnd,"Complex binding patterns require an initialization value"):r.unexpected(),e.declarations.push(r.finishNode(i,"VariableDeclarator")),!r.eat(F.comma))break}return e},z.parseVarId=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0)},z.parseFunction=function(e,t,n,r){this.initFunction(e),this.options.ecmaVersion>=6&&!r&&(e.generator=this.eat(F.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&&(e.id=this.parseIdent());var i=this.inGenerator,s=this.inAsync,o=this.yieldPos,a=this.awaitPos;return this.inGenerator=e.generator,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,t||this.type!==F.name||(e.id=this.parseIdent()),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.inGenerator=i,this.inAsync=s,this.yieldPos=o,this.awaitPos=a,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},z.parseFunctionParams=function(e){this.expect(F.parenL),e.params=this.parseBindingList(F.parenR,!1,this.options.ecmaVersion>=8,!0),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(e,t){var n=this;this.next(),this.parseClassId(e,t),this.parseClassSuper(e);var r=this.startNode(),i=!1;for(r.body=[],this.expect(F.braceL);!this.eat(F.braceR);)if(!n.eat(F.semi)){var s=n.startNode(),o=n.eat(F.star),a=!1,u=n.type===F.name&&"static"===n.value;n.parsePropertyName(s),s.static=u&&n.type!==F.parenL,s.static&&(o&&n.unexpected(),o=n.eat(F.star),n.parsePropertyName(s)),n.options.ecmaVersion>=8&&!o&&!s.computed&&"Identifier"===s.key.type&&"async"===s.key.name&&n.type!==F.parenL&&!n.canInsertSemicolon()&&(a=!0,n.parsePropertyName(s)),s.kind="method";var c=!1;if(!s.computed){var l=s.key;o||a||"Identifier"!==l.type||n.type===F.parenL||"get"!==l.name&&"set"!==l.name||(c=!0,s.kind=l.name,l=n.parsePropertyName(s)),!s.static&&("Identifier"===l.type&&"constructor"===l.name||"Literal"===l.type&&"constructor"===l.value)&&(i&&n.raise(l.start,"Duplicate constructor in the same class"),c&&n.raise(l.start,"Constructor can't have get/set modifier"),o&&n.raise(l.start,"Constructor can't be a generator"),a&&n.raise(l.start,"Constructor can't be an async method"),s.kind="constructor",i=!0)}if(n.parseClassMethod(r,s,o,a),c){var p="get"===s.kind?0:1;if(s.value.params.length!==p){var h=s.value.start;"get"===s.kind?n.raiseRecoverable(h,"getter should have no params"):n.raiseRecoverable(h,"setter should have exactly one param")}else"set"===s.kind&&"RestElement"===s.value.params[0].type&&n.raiseRecoverable(s.value.params[0].start,"Setter cannot use rest params")}}return e.body=this.finishNode(r,"ClassBody"),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},z.parseClassMethod=function(e,t,n,r){t.value=this.parseMethod(n,r),e.body.push(this.finishNode(t,"MethodDefinition"))},z.parseClassId=function(e,t){e.id=this.type===F.name?this.parseIdent():t?this.unexpected():null},z.parseClassSuper=function(e){e.superClass=this.eat(F._extends)?this.parseExprSubscripts():null},z.parseExport=function(e,t){var n=this;if(this.next(),this.eat(F.star))return this.expectContextual("from"),e.source=this.type===F.string?this.parseExprAtom():this.unexpected(),this.semicolon(),this.finishNode(e,"ExportAllDeclaration");if(this.eat(F._default)){this.checkExport(t,"default",this.lastTokStart);var r=this.type==F.parenL,i=this.parseMaybeAssign(),s=!0;return r||"FunctionExpression"!=i.type&&"ClassExpression"!=i.type||(s=!1,i.id&&(i.type="FunctionExpression"==i.type?"FunctionDeclaration":"ClassDeclaration")),e.declaration=i,s&&this.semicolon(),this.finishNode(e,"ExportDefaultDeclaration")}if(this.shouldParseExportStatement())e.declaration=this.parseStatement(!0),"VariableDeclaration"===e.declaration.type?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id.name,e.declaration.id.start),e.specifiers=[],e.source=null;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))e.source=this.type===F.string?this.parseExprAtom():this.unexpected();else{for(var o=0;o=6&&e)switch(e.type){case"Identifier":this.inAsync&&"await"===e.name&&this.raise(e.start,"Can not use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var r=0;r=8&&"async"===o.name&&!this.canInsertSemicolon()&&this.eat(F._function))return this.parseFunction(this.startNodeAt(i,s),!1,!1,!0);if(n&&!this.canInsertSemicolon()){if(this.eat(F.arrow))return this.parseArrowExpression(this.startNodeAt(i,s),[o],!1);if(this.options.ecmaVersion>=8&&"async"===o.name&&this.type===F.name)return o=this.parseIdent(),!this.canInsertSemicolon()&&this.eat(F.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(i,s),[o],!0)}return o;case F.regexp:var a=this.value;return t=this.parseLiteral(a.value),t.regex={pattern:a.pattern,flags:a.flags},t;case F.num:case F.string:return this.parseLiteral(this.value);case F._null:case F._true:case F._false:return t=this.startNode(),t.value=this.type===F._null?null:this.type===F._true,t.raw=this.type.keyword,this.next(),this.finishNode(t,"Literal");case F.parenL:return this.parseParenAndDistinguishExpression(n);case F.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(F.bracketR,!0,!0,e),this.finishNode(t,"ArrayExpression");case F.braceL:return this.parseObj(!1,e);case F._function:return t=this.startNode(),this.next(),this.parseFunction(t,!1);case F._class:return this.parseClass(this.startNode(),!1);case F._new:return this.parseNew();case F.backQuote:return this.parseTemplate();default:this.unexpected()}},Q.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),this.next(),this.finishNode(t,"Literal")},Q.parseParenExpression=function(){this.expect(F.parenL);var e=this.parseExpression();return this.expect(F.parenR),e},Q.parseParenAndDistinguishExpression=function(e){var t,n=this,r=this.start,i=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a,u=this.start,c=this.startLoc,l=[],p=!0,h=!1,f=new W,d=this.yieldPos,y=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==F.parenR;){if(p?p=!1:n.expect(F.comma),s&&n.afterTrailingComma(F.parenR,!0)){h=!0;break}if(n.type===F.ellipsis){o=n.start,l.push(n.parseParenItem(n.parseRest())),n.type===F.comma&&n.raise(n.start,"Comma is not permitted after the rest element");break}n.type!==F.parenL||a||(a=n.start),l.push(n.parseMaybeAssign(!1,f,n.parseParenItem))}var m=this.start,g=this.startLoc;if(this.expect(F.parenR),e&&!this.canInsertSemicolon()&&this.eat(F.arrow))return this.checkPatternErrors(f,!0),this.checkYieldAwaitInDefaultParams(),a&&this.unexpected(a),this.yieldPos=d,this.awaitPos=y,this.parseParenArrowList(r,i,l);l.length&&!h||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(f,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=y||this.awaitPos,l.length>1?(t=this.startNodeAt(u,c),t.expressions=l,this.finishNodeAt(t,"SequenceExpression",m,g)):t=l[0]}else t=this.parseParenExpression();if(this.options.preserveParens){var v=this.startNodeAt(r,i);return v.expression=t,this.finishNode(v,"ParenthesizedExpression")}return t},Q.parseParenItem=function(e){return e},Q.parseParenArrowList=function(e,t,n){return this.parseArrowExpression(this.startNodeAt(e,t),n)};var X=[];Q.parseNew=function(){var e=this.startNode(),t=this.parseIdent(!0);if(this.options.ecmaVersion>=6&&this.eat(F.dot))return e.meta=t,e.property=this.parseIdent(!0),"target"!==e.property.name&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is new.target"),this.inFunction||this.raiseRecoverable(e.start,"new.target can only be used in functions"),this.finishNode(e,"MetaProperty");var n=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(),n,r,!0),this.eat(F.parenL)?e.arguments=this.parseExprList(F.parenR,this.options.ecmaVersion>=8,!1):e.arguments=X,this.finishNode(e,"NewExpression")},Q.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),e.tail=this.type===F.backQuote,this.finishNode(e,"TemplateElement")},Q.parseTemplate=function(){var e=this,t=this.startNode();this.next(),t.expressions=[];var n=this.parseTemplateElement();for(t.quasis=[n];!n.tail;)e.expect(F.dollarBraceL),t.expressions.push(e.parseExpression()),e.expect(F.braceR),t.quasis.push(n=e.parseTemplateElement());return this.next(),this.finishNode(t,"TemplateLiteral")},Q.parseObj=function(e,t){var n=this,r=this.startNode(),i=!0,s={};for(r.properties=[],this.next();!this.eat(F.braceR);){if(i)i=!1;else if(n.expect(F.comma),n.afterTrailingComma(F.braceR))break;var o,a,u,c,l=n.startNode();n.options.ecmaVersion>=6&&(l.method=!1,l.shorthand=!1,(e||t)&&(u=n.start,c=n.startLoc),e||(o=n.eat(F.star))),n.parsePropertyName(l),e||!(n.options.ecmaVersion>=8)||o||l.computed||"Identifier"!==l.key.type||"async"!==l.key.name||n.type===F.parenL||n.type===F.colon||n.canInsertSemicolon()?a=!1:(a=!0,n.parsePropertyName(l,t)),n.parsePropertyValue(l,e,o,a,u,c,t),n.checkPropClash(l,s),r.properties.push(n.finishNode(l,"Property"))}return this.finishNode(r,e?"ObjectPattern":"ObjectExpression")},Q.parsePropertyValue=function(e,t,n,r,i,s,o){if((n||r)&&this.type===F.colon&&this.unexpected(),this.eat(F.colon))e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===F.parenL)t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(n,r);else if(this.options.ecmaVersion>=5&&!e.computed&&"Identifier"===e.key.type&&("get"===e.key.name||"set"===e.key.name)&&this.type!=F.comma&&this.type!=F.braceR){(n||r||t)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var a="get"===e.kind?0:1;if(e.value.params.length!==a){var u=e.value.start;"get"===e.kind?this.raiseRecoverable(u,"getter should have no params"):this.raiseRecoverable(u,"setter should have exactly one param")}else"set"===e.kind&&"RestElement"===e.value.params[0].type&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")}else this.options.ecmaVersion>=6&&!e.computed&&"Identifier"===e.key.type?((this.keywords.test(e.key.name)||(this.strict?this.reservedWordsStrict:this.reservedWords).test(e.key.name)||this.inGenerator&&"yield"==e.key.name||this.inAsync&&"await"==e.key.name)&&this.raiseRecoverable(e.key.start,"'"+e.key.name+"' can not be used as shorthand property"),e.kind="init",t?e.value=this.parseMaybeDefault(i,s,e.key):this.type===F.eq&&o?(o.shorthandAssign||(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,s,e.key)):e.value=e.key,e.shorthand=!0):this.unexpected()},Q.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(F.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(F.bracketR),e.key;e.computed=!1}return e.key=this.type===F.num||this.type===F.string?this.parseExprAtom():this.parseIdent(!0)},Q.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=!1,e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},Q.parseMethod=function(e,t){var n=this.startNode(),r=this.inGenerator,i=this.inAsync,s=this.yieldPos,o=this.awaitPos;return this.initFunction(n),this.options.ecmaVersion>=6&&(n.generator=e),this.options.ecmaVersion>=8&&(n.async=!!t),this.inGenerator=n.generator,this.inAsync=n.async,this.yieldPos=0,this.awaitPos=0,this.expect(F.parenL),n.params=this.parseBindingList(F.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(n,!1),this.inGenerator=r,this.inAsync=i,this.yieldPos=s,this.awaitPos=o,this.finishNode(n,"FunctionExpression")},Q.parseArrowExpression=function(e,t,n){var r=this.inGenerator,i=this.inAsync,s=this.yieldPos,o=this.awaitPos;return this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.inGenerator=!1,this.inAsync=e.async,this.yieldPos=0,this.awaitPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0),this.inGenerator=r,this.inAsync=i,this.yieldPos=s,this.awaitPos=o,this.finishNode(e,"ArrowFunctionExpression")},Q.parseFunctionBody=function(e,t){var n=t&&this.type!==F.braceL;if(n)e.body=this.parseMaybeAssign(),e.expression=!0;else{var r=this.inFunction,i=this.labels;this.inFunction=!0,this.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.inFunction=r,this.labels=i}var s=!n&&e.body.body.length&&this.isUseStrict(e.body.body[0])?e.body.body[0]:null;if(s&&this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params)&&this.raiseRecoverable(s.start,"Illegal 'use strict' directive in function with non-simple parameter list"),this.strict||s){var o=this.strict;this.strict=!0,e.id&&this.checkLVal(e.id,!0),this.checkParams(e),this.strict=o}else!t&&this.isSimpleParamList(e.params)||this.checkParams(e)},Q.isSimpleParamList=function(e){for(var t=0;t=6||this.input.slice(this.start,this.end).indexOf("\\")==-1)&&this.raiseRecoverable(this.start,"The keyword '"+this.value+"' is reserved"),this.inGenerator&&"yield"===this.value&&this.raiseRecoverable(this.start,"Can not use 'yield' as identifier inside a generator"),this.inAsync&&"await"===this.value&&this.raiseRecoverable(this.start,"Can not use 'await' as identifier inside an async function"),t.name=this.value):e&&this.type.keyword?t.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(t,"Identifier")},Q.parseYield=function(){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type==F.semi||this.canInsertSemicolon()||this.type!=F.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(F.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")},Q.parseAwait=function(){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0),this.finishNode(e,"AwaitExpression")};var Z=U.prototype;Z.raise=function(e,t){var n=c(this.input,e);t+=" ("+n.line+":"+n.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},Z.raiseRecoverable=Z.raise,Z.curPosition=function(){if(this.options.locations)return new j(this.curLine,this.pos-this.lineStart)};var K=function(e,t,n){this.type="",this.start=t,this.end=0,e.options.locations&&(this.loc=new M(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},ee=U.prototype;ee.startNode=function(){return new K(this,this.start,this.startLoc)},ee.startNodeAt=function(e,t){return new K(this,e,t)},ee.finishNode=function(e,t){return f.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},ee.finishNodeAt=function(e,t,n,r){return f.call(this,e,t,n,r)};var te=function(e,t,n,r){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r},ne={b_stat:new te("{",!1),b_expr:new te("{",!0),b_tmpl:new te("${",!0),p_stat:new te("(",!1),p_expr:new te("(",!0),q_tmpl:new te("`",!0,!0,function(e){return e.readTmplToken()}),f_expr:new te("function",!0)},re=U.prototype;re.initialContext=function(){return[ne.b_stat]},re.braceIsBlock=function(e){if(e===F.colon){var t=this.curContext();if(t===ne.b_stat||t===ne.b_expr)return!t.isExpr}return e===F._return?N.test(this.input.slice(this.lastTokEnd,this.start)):e===F._else||e===F.semi||e===F.eof||e===F.parenR||(e==F.braceL?this.curContext()===ne.b_stat:!this.exprAllowed)},re.updateContext=function(e){var t,n=this.type;n.keyword&&e==F.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},F.parenR.updateContext=F.braceR.updateContext=function(){if(1==this.context.length)return void(this.exprAllowed=!0);var e=this.context.pop();e===ne.b_stat&&this.curContext()===ne.f_expr?(this.context.pop(),this.exprAllowed=!1):e===ne.b_tmpl?this.exprAllowed=!0:this.exprAllowed=!e.isExpr},F.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?ne.b_stat:ne.b_expr),this.exprAllowed=!0},F.dollarBraceL.updateContext=function(){this.context.push(ne.b_tmpl),this.exprAllowed=!0},F.parenL.updateContext=function(e){var t=e===F._if||e===F._for||e===F._with||e===F._while;this.context.push(t?ne.p_stat:ne.p_expr),this.exprAllowed=!0},F.incDec.updateContext=function(){},F._function.updateContext=function(e){e.beforeExpr&&e!==F.semi&&e!==F._else&&(e!==F.colon&&e!==F.braceL||this.curContext()!==ne.b_stat)&&this.context.push(ne.f_expr),this.exprAllowed=!1},F.backQuote.updateContext=function(){this.curContext()===ne.q_tmpl?this.context.pop():this.context.push(ne.q_tmpl),this.exprAllowed=!1};var ie=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new M(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},se=U.prototype,oe="object"==typeof Packages&&"[object JavaPackage]"==Object.prototype.toString.call(Packages);se.next=function(){this.options.onToken&&this.options.onToken(new ie(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},se.getToken=function(){return this.next(),new ie(this)},"undefined"!=typeof Symbol&&(se[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===F.eof,value:t}}}}),se.setStrict=function(e){var t=this;if(this.strict=e,this.type===F.num||this.type===F.string){if(this.pos=this.start,this.options.locations)for(;this.pos=this.input.length?this.finishToken(F.eof):e.override?e.override(this):void this.readToken(this.fullCharCodeAtPos())},se.readToken=function(e){return n(e,this.options.ecmaVersion>=6)||92===e?this.readWord():this.getTokenFromCode(e)},se.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.pos+1)-56613888},se.skipBlockComment=function(){var e=this,t=this.options.onComment&&this.curPosition(),n=this.pos,r=this.input.indexOf("*/",this.pos+=2);if(r===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=r+2,this.options.locations){$.lastIndex=n;for(var i;(i=$.exec(this.input))&&i.index8&&t<14||t>=5760&&B.test(String.fromCharCode(t))))break e;++e.pos}}},se.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},se.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===e&&46===t?(this.pos+=3,this.finishToken(F.ellipsis)):(++this.pos,this.finishToken(F.dot))},se.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===e?this.finishOp(F.assign,2):this.finishOp(F.slash,1)},se.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=42===e?F.star:F.modulo;return this.options.ecmaVersion>=7&&42===t&&(++n,r=F.starstar,t=this.input.charCodeAt(this.pos+2)),61===t?this.finishOp(F.assign,n+1):this.finishOp(r,n)},se.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.finishOp(124===e?F.logicalOR:F.logicalAND,2):61===t?this.finishOp(F.assign,2):this.finishOp(124===e?F.bitwiseOR:F.bitwiseAND,1)},se.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(F.assign,2):this.finishOp(F.bitwiseXOR,1)},se.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?45==t&&62==this.input.charCodeAt(this.pos+2)&&N.test(this.input.slice(this.lastTokEnd,this.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(F.incDec,2):61===t?this.finishOp(F.assign,2):this.finishOp(F.plusMin,1)},se.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+n)?this.finishOp(F.assign,n+1):this.finishOp(F.bitShift,n)):33==t&&60==e&&45==this.input.charCodeAt(this.pos+2)&&45==this.input.charCodeAt(this.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(n=2),this.finishOp(F.relational,n))},se.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return 61===t?this.finishOp(F.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===e&&62===t&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(F.arrow)):this.finishOp(61===e?F.eq:F.prefix,1)},se.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(F.parenL);case 41:return++this.pos,this.finishToken(F.parenR);case 59:return++this.pos,this.finishToken(F.semi);case 44:return++this.pos,this.finishToken(F.comma);case 91:return++this.pos,this.finishToken(F.bracketL);case 93:return++this.pos,this.finishToken(F.bracketR);case 123:return++this.pos,this.finishToken(F.braceL);case 125:return++this.pos,this.finishToken(F.braceR);case 58:return++this.pos,this.finishToken(F.colon);case 63:return++this.pos,this.finishToken(F.question);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(F.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(F.prefix,1)}this.raise(this.pos,"Unexpected character '"+y(e)+"'")},se.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)};var ae=!!d("￿","u");se.readRegexp=function(){for(var e,t,n=this,r=this.pos;;){n.pos>=n.input.length&&n.raise(r,"Unterminated regular expression");var i=n.input.charAt(n.pos);if(N.test(i)&&n.raise(r,"Unterminated regular expression"),e)e=!1;else{if("["===i)t=!0;else if("]"===i&&t)t=!1;else if("/"===i&&!t)break;e="\\"===i}++n.pos}var s=this.input.slice(r,this.pos);++this.pos;var o=this.readWord1(),a=s,u="";if(o){var c=/^[gim]*$/;this.options.ecmaVersion>=6&&(c=/^[gimuy]*$/),c.test(o)||this.raise(r,"Invalid regular expression flag"),o.indexOf("u")>=0&&(ae?u="u":(a=a.replace(/\\u\{([0-9a-fA-F]+)\}/g,function(e,t,i){return t=Number("0x"+t),t>1114111&&n.raise(r+i+3,"Code point out of bounds"),"x"}),a=a.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"),u=u.replace("u","")))}var l=null;return oe||(d(a,u,r,this),l=d(s,o)),this.finishToken(F.regexp,{pattern:s,flags:o,value:l})},se.readInt=function(e,t){for(var n=this,r=this.pos,i=0,s=0,o=null==t?1/0:t;s=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,a>=e)break;++n.pos,i=i*e+a}return this.pos===r||null!=t&&this.pos-r!==t?null:i},se.readRadixNumber=function(e){this.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.start+2,"Expected number in radix "+e),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(F.num,t)},se.readNumber=function(e){var t=this.pos,r=!1,i=48===this.input.charCodeAt(this.pos);e||null!==this.readInt(10)||this.raise(t,"Invalid number"),i&&this.pos==t+1&&(i=!1);var s=this.input.charCodeAt(this.pos);46!==s||i||(++this.pos,this.readInt(10),r=!0,s=this.input.charCodeAt(this.pos)),69!==s&&101!==s||i||(s=this.input.charCodeAt(++this.pos),43!==s&&45!==s||++this.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),r=!0),n(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var o,a=this.input.slice(t,this.pos);return r?o=parseFloat(a):i&&1!==a.length?/[89]/.test(a)||this.strict?this.raise(t,"Invalid number"):o=parseInt(a,8):o=parseInt(a,10),this.finishToken(F.num,o)},se.readCodePoint=function(){var e,t=this.input.charCodeAt(this.pos);if(123===t){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111&&this.raise(n,"Code point out of bounds")}else e=this.readHexChar(4);return e},se.readString=function(e){for(var t=this,n="",r=++this.pos;;){t.pos>=t.input.length&&t.raise(t.start,"Unterminated string constant");var i=t.input.charCodeAt(t.pos);if(i===e)break;92===i?(n+=t.input.slice(r,t.pos),n+=t.readEscapedChar(!1),r=t.pos):(o(i)&&t.raise(t.start,"Unterminated string constant"),++t.pos)}return n+=this.input.slice(r,this.pos++),this.finishToken(F.string,n)},se.readTmplToken=function(){for(var e=this,t="",n=this.pos;;){e.pos>=e.input.length&&e.raise(e.start,"Unterminated template");var r=e.input.charCodeAt(e.pos);if(96===r||36===r&&123===e.input.charCodeAt(e.pos+1))return e.pos===e.start&&e.type===F.template?36===r?(e.pos+=2,e.finishToken(F.dollarBraceL)):(++e.pos,e.finishToken(F.backQuote)):(t+=e.input.slice(n,e.pos),e.finishToken(F.template,t));if(92===r)t+=e.input.slice(n,e.pos),t+=e.readEscapedChar(!0),n=e.pos;else if(o(r)){switch(t+=e.input.slice(n,e.pos),++e.pos,r){case 13:10===e.input.charCodeAt(e.pos)&&++e.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(r)}e.options.locations&&(++e.curLine,e.lineStart=e.pos),n=e.pos}else++e.pos}},se.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return y(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";default:if(t>=48&&t<=55){var n=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(n,8);return r>255&&(n=n.slice(0,-1),r=parseInt(n,8)),"0"!==n&&(this.strict||e)&&this.raise(this.pos-2,"Octal literal in strict mode"),this.pos+=n.length-1,String.fromCharCode(r)}return String.fromCharCode(t)}},se.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return null===n&&this.raise(t,"Bad character escape sequence"),n},se.readWord1=function(){var e=this;this.containsEsc=!1;for(var t="",i=!0,s=this.pos,o=this.options.ecmaVersion>=6;this.pos=6||!this.containsEsc)&&this.keywords.test(e)&&(t=O[e]),this.finishToken(t,e)},e.version="4.0.4",e.parse=m,e.parseExpressionAt=g,e.tokenizer=v,e.addLooseExports=b,e.Parser=U,e.plugins=V,e.defaultOptions=D,e.Position=j,e.SourceLocation=M,e.getLineInfo=c,e.Node=K,e.TokenType=P,e.tokTypes=F,e.TokContext=te,e.tokContexts=ne,e.isIdentifierChar=r,e.isIdentifierStart=n,e.Token=ie,e.isNewLine=o,e.lineBreak=N,e.lineBreakG=$,Object.defineProperty(e,"__esModule",{value:!0})})},{}],16:[function(e,t,n){!function(e,r){"object"==typeof n&&void 0!==t?r(n):"function"==typeof define&&define.amd?define(["exports"],r):r((e.acorn=e.acorn||{},e.acorn.walk=e.acorn.walk||{}))}(this,function(e){"use strict";function t(t,n,r,i,s){r||(r=e.base),function e(t,i,s){var o=s||t.type,a=n[o];r[o](t,i,e),a&&a(t,i)}(t,i,s)}function n(t,n,r,i){r||(r=e.base);var s=[];!function e(t,i,o){var a=o||t.type,u=n[a],c=t!=s[s.length-1];c&&s.push(t),r[a](t,i,e),u&&u(t,i||s,s),c&&s.pop()}(t,i)}function r(t,n,r,i,s){var o=r?e.make(r,i):i;!function e(t,n,r){o[r||t.type](t,n,e)}(t,n,s)}function i(e){return"string"==typeof e?function(t){return t==e}:e?e:function(){return!0}}function s(t,n,r,s,o,a){s=i(s),o||(o=e.base);try{!function e(t,i,a){var u=a||t.type;if((null==n||t.start<=n)&&(null==r||t.end>=r)&&o[u](t,i,e),(null==n||t.start==n)&&(null==r||t.end==r)&&s(u,t))throw new h(t,i)}(t,a)}catch(e){if(e instanceof h)return e;throw e}}function o(t,n,r,s,o){r=i(r),s||(s=e.base);try{!function e(t,i,o){var a=o||t.type;if(!(t.start>n||t.end=n&&r(a,t))throw new h(t,i);s[a](t,i,e)}}(t,o)}catch(e){if(e instanceof h)return e;throw e}}function u(t,n,r,s,o){r=i(r),s||(s=e.base);var a;return function e(t,i,o){if(!(t.start>n)){var u=o||t.type;t.end<=n&&(!a||a.node.end=(t[n]||0))return!0;return!1}var i=n.versions.node.split("."),s=e("./core.json"),o={};for(var a in s)if(Object.prototype.hasOwnProperty.call(s,a)&&r(a))for(var u=0;u=0;c--)i.indexOf(a[c])===-1&&(u=u.concat(i.map(function(e){return s+r.join(r.join.apply(r,a.slice(0,c+1)),e)})));return"win32"===n.platform&&(u[u.length-1]=u[u.length-1].replace(":",":\\")),u.concat(t.paths)}}).call(this,e("_process"))},{_process:7,path:6}],26:[function(e,t,n){var r=e("./core"),i=e("fs"),s=e("path"),o=e("./caller.js"),a=e("./node-modules-paths.js");t.exports=function(e,t){function n(e){if(l(e))return e;for(var t=0;t=0&&e>1;return t?-n:n}var s=e("./base64"),o=5,a=1<>>=o,i>0&&(t|=c),n+=s.encode(t);while(i>0);return n},n.decode=function(e,t,n){var r,a,l=e.length,p=0,h=0;do{if(t>=l)throw new Error("Expected more digits in base 64 VLQ value.");if(a=s.decode(e.charCodeAt(t++)),a===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(a&c),a&=u,p+=a<0?t-u>1?r(u,t,i,s,o,a):a==n.LEAST_UPPER_BOUND?t1?r(e,u,i,s,o,a):a==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,i,s){if(0===t.length)return-1;var o=r(-1,t.length,e,t,i,s||n.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&0===i(t[o],t[o-1],!0);)--o;return o}},{}],31:[function(e,t,n){function r(e,t){var n=e.generatedLine,r=t.generatedLine,i=e.generatedColumn,o=t.generatedColumn;return r>n||r==n&&o>=i||s.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var s=e("./util");i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){r(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(s.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=i},{"./util":36}],32:[function(e,t,n){function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function i(e,t){return Math.round(e+Math.random()*(t-e))}function s(e,t,n,o){if(n=0){var s=this._originalMappings[i];if(void 0===e.column)for(var o=s.originalLine;s&&s.originalLine===o;)r.push({line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i];else for(var c=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==c;)r.push({line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++i]}return r},n.SourceMapConsumer=r,i.prototype=Object.create(r.prototype),i.prototype.consumer=r,i.fromSourceMap=function(e){var t=Object.create(i.prototype),n=t._names=c.fromArray(e._names.toArray(),!0),r=t._sources=c.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var o=e._mappings.toArray().slice(),u=t.__generatedMappings=[],l=t.__originalMappings=[],h=0,f=o.length;h1&&(n.source=y+i[1],y+=i[1],n.originalLine=f+i[2],f=n.originalLine,n.originalLine+=1,n.originalColumn=d+i[3],d=n.originalColumn,i.length>4&&(n.name=m+i[4],m+=i[4])),E.push(n),"number"==typeof n.originalLine&&w.push(n)}p(E,a.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,p(w,a.compareByOriginalPositions),this.__originalMappings=w},i.prototype._findMapping=function(e,t,n,r,i,s){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,i,s)},i.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var s=a.getArg(i,"source",null);null!==s&&(s=this._sources.at(s),null!=this.sourceRoot&&(s=a.join(this.sourceRoot,s)));var o=a.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:s,line:a.getArg(i,"originalLine",null),column:a.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=a.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=a.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=a.getArg(e,"source");if(null!=this.sourceRoot&&(t=a.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var n={source:t,originalLine:a.getArg(e,"line"),originalColumn:a.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",a.compareByOriginalPositions,a.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:a.getArg(s,"generatedLine",null),column:a.getArg(s,"generatedColumn",null),lastColumn:a.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=i,o.prototype=Object.create(r.prototype),o.prototype.constructor=r,o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){for(var e=[],t=0;t0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},r.prototype._serializeMappings=function(){for(var e,t,n,r,o=0,a=1,u=0,c=0,l=0,p=0,h="",f=this._mappings.toArray(),d=0,y=f.length;d0){if(!s.compareByGeneratedPositionsInflated(t,f[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=i.encode(r-p),p=r,e+=i.encode(t.originalLine-1-c),c=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-l),l=n)),h+=e}return h},r.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=s.relative(t,e));var n=s.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},r.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},r.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=r},{"./array-set":27,"./base64-vlq":28,"./mapping-list":31,"./util":36}],35:[function(e,t,n){function r(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==i?null:i,this[a]=!0,null!=r&&this.add(r)}var i=e("./source-map-generator").SourceMapGenerator,s=e("./util"),o=/(\r?\n)/,a="$$$isSourceNode$$$";r.fromStringWithSourceMap=function(e,t,n){function i(e,t){if(null===e||void 0===e.source)a.add(t);else{var i=n?s.join(n,e.source):e.source;a.add(new r(e.originalLine,e.originalColumn,i,t,e.name))}}var a=new r,u=e.split(o),c=function(){return u.shift()+(u.shift()||"")},l=1,p=0,h=null;return t.eachMapping(function(e){if(null!==h){if(!(l0&&(h&&i(h,c()),a.add(u.join(""))),t.sources.forEach(function(e){var r=t.sourceContentFor(e);null!=r&&(null!=n&&(e=s.join(n,e)),a.setSourceContent(e,r))}),a},r.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},r.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[a]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},r.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n0){for(t=[],n=0;n=0;l--)o=u[l],"."===o?u.splice(l,1):".."===o?c++:c>0&&(""===o?(u.splice(l+1,c),c=0):(u.splice(l,2),c--));return t=u.join("/"),""===t&&(t=a?"/":"."),r?(r.path=t,s(r)):t}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=i(t),r=i(e);if(r&&(e=r.path||"/"),n&&!n.scheme)return r&&(n.scheme=r.scheme),s(n);if(n||t.match(v))return t;if(r&&!r.host&&!r.path)return r.host=t,s(r);var a="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=a,s(r)):a}function u(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function c(e){return e}function l(e){return h(e)?"$"+e:e}function p(e){return h(e)?e.slice(1):e}function h(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t,n){var r=e.source-t.source;return 0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r||n?r:(r=e.generatedColumn-t.generatedColumn,0!==r?r:(r=e.generatedLine-t.generatedLine,0!==r?r:e.name-t.name))))}function d(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:(r=e.generatedColumn-t.generatedColumn,0!==r||n?r:(r=e.source-t.source,0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r?r:e.name-t.name))))}function y(e,t){return e===t?0:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=y(e.source,t.source),0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:y(e.name,t.name)))))}n.getArg=r;var g=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,v=/^data:.+\,.+$/;n.urlParse=i,n.urlGenerate=s,n.normalize=o,n.join=a,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(g)},n.relative=u;var b=function(){return!("__proto__"in Object.create(null))}();n.toSetString=b?c:l,n.fromSetString=b?c:p,n.compareByOriginalPositions=f,n.compareByGeneratedPositionsDeflated=d,n.compareByGeneratedPositionsInflated=m},{}],37:[function(e,t,n){n.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,n.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,n.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":33,"./lib/source-map-generator":34,"./lib/source-node":35}],38:[function(e,t,n){t.exports={name:"nodent",version:"3.0.7",description:"NoDent - Asynchronous Javascript language extensions",main:"nodent.js",scripts:{cover:"istanbul cover ./nodent.js tests -- --quick --syntax --forceStrict ; open ./coverage/lcov-report/index.html",test:"cd tests && npm i --prod && cd .. && node --expose-gc ./nodent.js tests --syntax --quick","test-loader":"cd tests/loader/app && npm test && cd ../../..",start:"./nodent.js"},bin:{nodentjs:"./nodent.js"},dependencies:{acorn:">=2.5.2","acorn-es7-plugin":"^1.1.3","nodent-runtime":"^3.0.3",resolve:"^1.1.7","source-map":"0.5.6"},repository:{type:"git",url:"git+https://github.com/MatAtBread/nodent.git"},engines:"node >= 0.10.0",keywords:["Javascript","ES7","async","await","language","extensions","Node","callback","generator","Promise","asynchronous"],author:{name:"Mat At Bread",email:"nodent@mailed.me.uk"},license:"BSD-2-Clause",bugs:{url:"https://github.com/MatAtBread/nodent/issues"},gitHead:"8ea9feab498470d7a2c3c09326a1c17e8eeb332a",homepage:"https://github.com/MatAtBread/nodent#readme",_id:"nodent@3.0.7",_shasum:"08dd540baf834c136648aeaa9ae8ecd4bf92aa52",_from:"nodent@>=3.0.2 <4.0.0",_npmVersion:"3.10.3",_nodeVersion:"6.7.0",_npmUser:{name:"matatbread",email:"npm@mailed.me.uk"},maintainers:[{name:"matatbread",email:"npm@mailed.me.uk"}],dist:{shasum:"08dd540baf834c136648aeaa9ae8ecd4bf92aa52",tarball:"https://registry.npmjs.org/nodent/-/nodent-3.0.7.tgz"},_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/nodent-3.0.7.tgz_1477471431033_0.10623699799180031"},directories:{},_resolved:"https://registry.npmjs.org/nodent/-/nodent-3.0.7.tgz",readme:"ERROR: No README data found!"}},{}],nodent:[function(e,t,n){(function(n,r,i,s,o,a,u,c){"use strict";function l(e){var t={};return e.forEach(function(e){if(e&&"object"==typeof e)for(var n in e)t[n]=e[n]}),t}function p(e){throw e}function h(){}function f(e){return"ExpressionStatement"===e.type&&("StringLiteral"===e.expression.type||"Literal"===e.expression.type&&"string"==typeof e.expression.value)}function d(t,n,r){n||(n=console.warn.bind(console));var i,s,o={};if("string"==typeof t)(i=t.match(M))&&(s=i[1]||"default");else for(var a=0;a"))}return o.promises||o.es7||o.generators||o.engine?((o.promises||o.es7)&&o.generators&&(n("No valid 'use nodent' directive, assumed -es7 mode"),o=j.es7),(o.generators||o.engine)&&(o.promises=!0),o.promises&&(o.es7=!0),o):null}function y(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),"#!"===e.substring(0,2)&&(e="//"+e),e}function m(e){var t;return t=e instanceof i?e:new i(e.toString(),"binary"),t.toString("base64")}function g(e,t){return t=t||e.log,function(n,r,i){var s=y(R.readFileSync(r,"utf8")),o=e.parse(s,r,i);i=i||d(o.ast,t,r),e.asynchronize(o,void 0,i,t),e.prettyPrint(o,i),n._compile(o.code,o.filename)}}function v(e){return e=e||q,function(t,n,r){if(Array.isArray(n)){var i=n;n=function(e,t){return i.indexOf(e)>=0}}else n=n||function(e,t){return!(e.match(/Sync$/)&&e.replace(/Sync$/,"")in t)};r||(r="");var s=Object.create(t);for(var o in s)!function(){var i=o;try{"function"!=typeof t[i]||s[i+r]&&s[i+r].isAsync||!n(i,s)||(s[i+r]=function(){var n=Array.prototype.slice.call(arguments);return new e(function(e,r){var s=function(t,n){if(t)return r(t);switch(arguments.length){case 0:return e();case 2:return e(n);default:return e(Array.prototype.slice.call(arguments,1))}};n.length>t[i].length?n.push(s):n[t[i].length-1]=s;t[i].apply(t,n)})},s[i+r].isAsync=!0)}catch(e){}}();return s.super=t,s}}function b(t,n){var r=t.filename.split("/"),i=r.pop(),s=O(t.ast,n&&n.sourcemap?{map:{startLine:n.mapStartLine||0,file:i+"(original)",sourceMapRoot:r.join("/"),sourceContent:t.origCode}}:null,t.origCode);if(n&&n.sourcemap)try{var o="",a=s.map.toJSON();if(a){var u=e("source-map").SourceMapConsumer;t.sourcemap=a,T[t.filename]={map:a,smc:new u(a)},o="\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,"+m(JSON.stringify(a))+"\n"}t.code=s.code+o}catch(e){t.code=s}else t.code=s;return t}function x(e,t,n,r){"object"==typeof n&&void 0===r&&(r=n);var i={origCode:e.toString(),filename:t};try{return i.ast=F.parse(i.origCode,r&&r.parser),r.babelTree&&F.treeWalker(i.ast,function(e,t,n){"Literal"===e.type?n[0].replace(N.babelLiteralNode(e.value)):"Property"===e.type&&("ClassBody"===n[0].parent.type?e.type="ClassProperty":e.type="ObjectProperty"),t()}),i}catch(e){if(e instanceof SyntaxError){var s=i.origCode.substr(e.pos-e.loc.column);s=s.split("\n")[0],e.message+=" "+t+" (nodent)\n"+s+"\n"+s.replace(/[\S ]/g,"-").substring(0,e.loc.column)+"^",e.stack=""}throw e}}function w(t,n){n=n||{};var r=t+"|"+Object.keys(n).sort().reduce(function(e,t){return e+t+JSON.stringify(n[t])},"");return this.covers[r]||(t.indexOf("/")>=0?this.covers[r]=e(t):this.covers[r]=e(c+"/covers/"+t)),this.covers[r](this,n)}function E(e,t,n,r){"object"==typeof n&&void 0===r&&(r=n),r=r||{};for(var i in I)i in r||(r[i]=I[i]);var s=this.parse(e,t,null,r);return this.asynchronize(s,null,r,this.log||h),this.prettyPrint(s,r),s}function S(t,n,r){var i={},s=this;n||(n=/\.njs$/),r?r.compiler||(r.compiler={}):r={compiler:{}};var o=l([B,r.compiler]);return function(a,u,c){function l(e){u.statusCode=500,u.write(e.toString()),u.end()}if(i[a.url])return u.setHeader("Content-Type",i[a.url].contentType),r.setHeaders&&r.setHeaders(u),u.write(i[a.url].output),void u.end();if(!(a.url.match(n)||r.htmlScriptRegex&&a.url.match(r.htmlScriptRegex)))return c&&c();var p=t+a.url;if(r.extensions&&!R.existsSync(p))for(var h=0;h …"+n.source+":"+n.line+":"+n.column+(e.getFunctionName()?")":"")}}return"\n at "+e}return e+t.map(n).join("")}function _(e){var t={};t[I.$asyncbind]={value:V,writable:!0,enumerable:!1,configurable:!0},t[I.$asyncspawn]={value:U,writable:!0,enumerable:!1,configurable:!0};try{Object.defineProperties(Function.prototype,t)}catch(t){e.log("Function prototypes already assigned: ",t.messsage)}I[I.$error]in r||(r[I[I.$error]]=p),e.augmentObject&&Object.defineProperties(Object.prototype,{asyncify:{value:function(e,t,n){return v(e)(this,t,n)},writable:!0,configurable:!0},isThenable:{value:function(){return q.isThenable(this)},writable:!0,configurable:!0}}),Object[I.$makeThenable]=q.resolve}function C(t){function n(e,t){e=e.split("."),t=t.split(".");for(var n=0;n<3;n++){if(e[n]t[n])return 1}return 0}function r(i,s){if(!s.match(/nodent\/nodent\.js$/)){if(s.match(/node_modules\/nodent\/.*\.js$/))return P(i,s);for(var u=0;u=3&&L()}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/nodent")},{"./htmlScriptParser":8,"./lib/arboriculture":9,"./lib/output":10,"./lib/parser":11,"./package.json":38,_process:7,buffer:2,fs:1,"nodent-runtime":17,path:6,resolve:20,"source-map":37}]},{},[]); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/regenerator.min.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/regenerator.min.js new file mode 100644 index 0000000000..83b02b98af --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/dist/regenerator.min.js @@ -0,0 +1,36 @@ +/* regenerator 0.9.5: Source transformer enabling ECMAScript 6 generator functions (yield) in JavaScript-of-today (ES5) */ +require=function e(t,n,r){function i(s,o){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!o&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var a="function"==typeof require&&require,s=0;s=0;a--)if(s[a]!=o[a])return!1;for(a=s.length-1;a>=0;a--)if(i=s[a],!u(e[i],t[i]))return!1;return!0}function p(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||t.call({},e)===!0)}function f(e,t,n,r){var i;h.isString(n)&&(r=n,n=null);try{t()}catch(e){i=e}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&s(i,n,"Missing expected exception"+r),!e&&p(i,n)&&s(i,n,"Got unwanted exception"+r),e&&i&&n&&!p(i,n)||!e&&i)throw i}var h=e("util/"),d=Array.prototype.slice,y=Object.prototype.hasOwnProperty,m=t.exports=o;m.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=a(this),this.generatedMessage=!0);var t=e.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=t.name,o=r.indexOf("\n"+i);if(o>=0){var u=r.indexOf("\n",o+1);r=r.substring(u+1)}this.stack=r}}},h.inherits(m.AssertionError,Error),m.fail=s,m.ok=o,m.equal=function(e,t,n){e!=t&&s(e,t,n,"==",m.equal)},m.notEqual=function(e,t,n){e==t&&s(e,t,n,"!=",m.notEqual)},m.deepEqual=function(e,t,n){u(e,t)||s(e,t,n,"deepEqual",m.deepEqual)},m.notDeepEqual=function(e,t,n){u(e,t)&&s(e,t,n,"notDeepEqual",m.notDeepEqual)},m.strictEqual=function(e,t,n){e!==t&&s(e,t,n,"===",m.strictEqual)},m.notStrictEqual=function(e,t,n){e===t&&s(e,t,n,"!==",m.notStrictEqual)},m.throws=function(e,t,n){f.apply(this,[!0].concat(d.call(arguments)))},m.doesNotThrow=function(e,t){f.apply(this,[!1].concat(d.call(arguments)))},m.ifError=function(e){if(e)throw e};var b=Object.keys||function(e){var t=[];for(var n in e)y.call(e,n)&&t.push(n);return t}},{"util/":35}],3:[function(e,t,n){arguments[4][1][0].apply(n,arguments)},{dup:1}],4:[function(e,t,n){(function(t){"use strict";function r(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function i(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(i()=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),s.alloc(+e)}function b(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return X(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return X(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,n);case"utf8":case"utf-8":return F(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return j(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function x(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:_(e,t,n,r,i);if("number"==typeof t)return t&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):_(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,n,r,i){function a(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,o=e.length,u=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,u/=2,n/=2}var l;if(i){var c=-1;for(l=n;lo&&(n=o-u),l=n;l>=0;l--){for(var p=!0,f=0;fi&&(r=i)):r=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var s=0;s239?4:a>223?3:a>191?2:1;if(i+o<=n){var u,l,c,p;switch(o){case 1:a<128&&(s=a);break;case 2:u=e[i+1],128===(192&u)&&(p=(31&a)<<6|63&u,p>127&&(s=p));break;case 3:u=e[i+1],l=e[i+2],128===(192&u)&&128===(192&l)&&(p=(15&a)<<12|(63&u)<<6|63&l,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128===(192&u)&&128===(192&l)&&128===(192&c)&&(p=(15&a)<<18|(63&u)<<12|(63&l)<<6|63&c,p>65535&&p<1114112&&(s=p))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=o}return T(r)}function T(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,a){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function R(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function U(e,t,n,r,i){return i||R(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(e,t,n,r,23,4),n+4}function V(e,t,n,r,i){return i||R(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(e,t,n,r,52,8),n+8}function G(e){if(e=q(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function q(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function K(e){return e<16?"0"+e.toString(16):e.toString(16)}function X(e,t){t=t||1/0;for(var n,r=e.length,i=null,a=[],s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function J(e){for(var t=[],n=0;n>8,i=n%256,a.push(i),a.push(r);return a}function z(e){return $.toByteArray(G(e))}function Y(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function H(e){return e!==e}var $=e("base64-js"),Q=e("ieee754"),Z=e("isarray");n.Buffer=s,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:r(),n.kMaxLength=i(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return o(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return l(null,e,t,n)},s.allocUnsafe=function(e){return c(null,e)},s.allocUnsafeSlow=function(e){return c(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},s.prototype.compare=function(e,t,n,r,i){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,o=n-t,u=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return A(this,e,t,n);case"ascii":return D(this,e,t,n);case"latin1":case"binary":return C(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUInt8=function(e,t){return t||I(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||I(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||I(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=this[e],i=1,a=0;++a=i&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||I(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},s.prototype.readInt8=function(e,t){return t||I(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){t||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||I(e,4,this.length),Q.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||I(e,8,this.length),Q.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){N(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return V(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return V(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function a(e){var t,n,i,a,s,o,u=e.length;s=r(e),o=new p(3*u/4-s),i=s>0?u-4:u;var l=0;for(t=0,n=0;t>16&255,o[l++]=a>>8&255,o[l++]=255&a;return 2===s?(a=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[l++]=255&a):1===s&&(a=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[l++]=a>>8&255,o[l++]=255&a),o}function s(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[63&e]}function o(e,t,n){for(var r,i=[],a=t;ac?c:u+s));return 1===r?(t=e[n-1],i+=l[t>>2],i+=l[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=l[t>>10],i+=l[t>>4&63],i+=l[t<<2&63],i+="="),a.push(i),a.join("")}n.byteLength=i,n.toByteArray=a,n.fromByteArray=u;for(var l=[],c=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,d=f.length;h>1,c=-7,p=n?i-1:0,f=n?-1:1,h=e[t+p];for(p+=f,a=h&(1<<-c)-1,h>>=-c,c+=o;c>0;a=256*a+e[t+p],p+=f,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+p],p+=f,c-=8);if(0===a)a=1-l;else{if(a===u)return s?NaN:(h?-1:1)*(1/0);s+=Math.pow(2,r),a-=l}return(h?-1:1)*s*Math.pow(2,a-r)},n.write=function(e,t,n,r,i,a){var s,o,u,l=8*a-i-1,c=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:a-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+p>=1?f/u:f*Math.pow(2,1-p),t*u>=2&&(s++,u/=2),s+p>=c?(o=0,s=c):s+p>=1?(o=(t*u-1)*Math.pow(2,i),s+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+h]=255&o,h+=d,o/=256,i-=8);for(s=s<0;e[n+h]=255&s,h+=d,s/=256,l-=8);e[n+h-d]|=128*y}},{}],7:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],8:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function a(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!a(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,a,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],o(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(s(n))for(a=Array.prototype.slice.call(arguments,1),l=n.slice(),r=l.length,u=0;u0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,a,o;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(o=a;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],9:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],10:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}t.exports=function(e){return null!=e&&(r(e)||i(e)||!!e._isBuffer)}},{}],11:[function(e,t,n){n.endianness=function(){return"LE"},n.hostname=function(){return"undefined"!=typeof location?location.hostname:""},n.loadavg=function(){return[]},n.uptime=function(){return 0},n.freemem=function(){return Number.MAX_VALUE},n.totalmem=function(){return Number.MAX_VALUE},n.cpus=function(){return[]},n.type=function(){return"Browser"},n.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},n.networkInterfaces=n.getNetworkInterfaces=function(){return{}},n.arch=function(){return"javascript"},n.platform=function(){return"browser"},n.tmpdir=n.tmpDir=function(){return"/tmp"},n.EOL="\n"},{}],12:[function(e,t,n){(function(e){function t(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;a--){var s=a>=0?arguments[a]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,i="/"===s.charAt(0))}return n=t(r(n.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(e){var i=n.isAbsolute(e),a="/"===s(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&a&&(e+="/"),(i?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(r(e,function(e,t){ +if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var i=r(e.split("/")),a=r(t.split("/")),s=Math.min(i.length,a.length),o=s,u=0;u1)for(var n=1;n0)if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var l;!t.decoder||i||r||(n=t.decoder.write(n),l=!t.objectMode&&0===n.length),i||(t.reading=!1),l||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&f(e))),d(e,t)}else i||(t.reading=!1);return o(t)}function o(e){return!e.ended&&(e.needReadable||e.length=V?e=V:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function l(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=u(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function c(e,t){var n=null;return O.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function p(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,f(e)}}function f(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(M("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?T(h,e):h(e))}function h(e){M("emit readable"),e.emit("readable"),x(e)}function d(e,t){t.readingMore||(t.readingMore=!0,T(y,e,t))}function y(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=E(e,t.buffer,t.decoder),n}function E(e,t,n){var r;return ea.length?a.length:e;if(i+=s===a.length?a:a.slice(0,e),e-=s,0===e){s===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(s));break}++r}return t.length-=r,i}function D(e,t){var n=I.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var a=r.data,s=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,s),e-=s,0===e){s===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(s));break}++i}return t.length-=i,n}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,T(S,t,e))}function S(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function w(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return M("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):f(this),null;if(e=l(e,t),0===e&&t.ended)return 0===t.length&&C(this),null;var r=t.needReadable;M("need readable",r),(0===t.length||t.length-e0?_(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&C(this)),null!==i&&this.emit("data",i),i},a.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(e,t){function i(e){M("onunpipe"),e===f&&s()}function a(){M("onend"),e.end()}function s(){M("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",b),e.removeListener("error",u),e.removeListener("unpipe",i),f.removeListener("end",a),f.removeListener("end",s),f.removeListener("data",o),g=!0,!h.awaitDrain||e._writableState&&!e._writableState.needDrain||b()}function o(t){M("ondata"),v=!1,!1!==e.write(t)||v||((1===h.pipesCount&&h.pipes===e||h.pipesCount>1&&k(h.pipes,e)!==-1)&&!g&&(M("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,v=!0),f.pause())}function u(t){M("onerror",t),p(),e.removeListener("error",u),0===B(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",c),p()}function c(){M("onfinish"),e.removeListener("close",l),p()}function p(){M("unpipe"),f.unpipe(e)}var f=this,h=this._readableState;switch(h.pipesCount){case 0:h.pipes=e;break;case 1:h.pipes=[h.pipes,e];break;default:h.pipes.push(e)}h.pipesCount+=1,M("pipe count=%d opts=%j",h.pipesCount,t);var d=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,y=d?a:s;h.endEmitted?T(y):f.once("end",y),e.on("unpipe",i);var b=m(f);e.on("drain",b);var g=!1,v=!1;return f.on("data",o),r(e,"error",u),e.once("close",l),e.once("finish",c),e.emit("pipe",f),h.flowing||(M("pipe resume"),f.resume()),e},a.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1?setImmediate:D;s.WritableState=a;var S=e("core-util-is");S.inherits=e("inherits");var w,k={deprecate:e("util-deprecate")};!function(){try{w=e("stream")}catch(e){}finally{w||(w=e("events").EventEmitter)}}();var F=e("buffer").Buffer,T=e("buffer-shims");S.inherits(s,w),a.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(a.prototype,"buffer",{get:k.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var P;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(P=Function.prototype[Symbol.hasInstance],Object.defineProperty(s,Symbol.hasInstance,{value:function(e){return!!P.call(this,e)||e&&e._writableState instanceof a}})):P=function(e){return e instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(e,t,n){var i=this._writableState,a=!1;return"function"==typeof t&&(n=t,t=null),F.isBuffer(e)?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=r),i.ended?o(this,n):u(this,i,e,n)&&(i.pendingcb++,a=c(this,i,e,t,n)),a},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||b(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},s.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||_(this,r,n)}}).call(this,e("_process"))},{"./_stream_duplex":15,_process:13,buffer:4,"buffer-shims":21,"core-util-is":22,events:8,inherits:9,"process-nextick-args":24,"util-deprecate":25}],20:[function(e,t,n){"use strict";function r(){this.head=null,this.tail=null,this.length=0}var i=(e("buffer").Buffer,e("buffer-shims"));t.exports=r,r.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},r.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},r.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},r.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t=i.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t}},{buffer:4,"buffer-shims":21}],21:[function(e,t,n){(function(t){"use strict";var r=e("buffer"),i=r.Buffer,a=r.SlowBuffer,s=r.kMaxLength||2147483647;n.alloc=function(e,t,n){if("function"==typeof i.alloc)return i.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>s)throw new RangeError("size is too large");var r=n,a=t;void 0===a&&(r=void 0,a=0);var o=new i(e);if("string"==typeof a)for(var u=new i(a,r),l=u.length,c=-1;++cs)throw new RangeError("size is too large");return new i(e)},n.from=function(e,n,r){if("function"==typeof i.from&&(!t.Uint8Array||Uint8Array.from!==i.from))return i.from(e,n,r);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new i(e,n);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var a=n;if(1===arguments.length)return new i(e);void 0===a&&(a=0);var s=r;if(void 0===s&&(s=e.byteLength-a),a>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(s>e.byteLength-a)throw new RangeError("'length' is out of bounds");return new i(e.slice(a,a+s))}if(i.isBuffer(e)){var o=new i(e.length);return e.copy(o,0,0,e.length),o}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new i(e);if("Buffer"===e.type&&Array.isArray(e.data))return new i(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},n.allocUnsafeSlow=function(e){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=s)throw new RangeError("size is too large");return new a(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:4}],22:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===m(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function a(e){return null==e}function s(e){return"number"==typeof e}function o(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function l(e){return void 0===e}function c(e){return"[object RegExp]"===m(e)}function p(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===m(e)}function h(e){return"[object Error]"===m(e)||e instanceof Error}function d(e){return"function"==typeof e}function y(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function m(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=i,n.isNullOrUndefined=a,n.isNumber=s,n.isString=o,n.isSymbol=u,n.isUndefined=l,n.isRegExp=c,n.isObject=p,n.isDate=f,n.isError=h,n.isFunction=d,n.isPrimitive=y,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../../../insert-module-globals/node_modules/is-buffer/index.js")})},{"../../../../insert-module-globals/node_modules/is-buffer/index.js":10}],23:[function(e,t,n){arguments[4][7][0].apply(n,arguments)},{dup:7}],24:[function(e,t,n){(function(e){"use strict";function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var a,s,o=arguments.length;switch(o){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(a=new Array(o-1),s=0;s=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),e.copy(this.charBuffer,0,0,a),t.substring(0,i)}return t},l.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},l.prototype.end=function(e){ +var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{buffer:4}],32:[function(e,t,n){function r(){throw new Error("tty.ReadStream is not implemented")}function i(){throw new Error("tty.ReadStream is not implemented")}n.isatty=function(){return!1},n.ReadStream=r,n.WriteStream=i},{}],33:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],34:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],35:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),u(r,e,r.depth)}function a(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function o(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return v(i)||(i=u(e,i,r)),i}var a=l(e,t);if(a)return a;var s=Object.keys(t),y=o(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),C(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(t);if(0===s.length){if(S(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(D(t))return e.stylize(Date.prototype.toString.call(t),"date");if(C(t))return c(t)}var b="",g=!1,x=["{","}"];if(d(t)&&(g=!0,x=["[","]"]),S(t)){b=" [Function"+(t.name?": "+t.name:"")+"]"}if(E(t)&&(b=" "+RegExp.prototype.toString.call(t)),D(t)&&(b=" "+Date.prototype.toUTCString.call(t)),C(t)&&(b=" "+c(t)),0===s.length&&(!g||0==t.length))return x[0]+b+x[1];if(r<0)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var _;return _=g?p(e,t,r,y,s):s.map(function(n){return f(e,t,r,y,n,g)}),e.seen.pop(),h(_,b,x)}function l(e,t){if(_(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i){for(var a=[],s=0,o=t.length;s-1&&(o=a?o.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return" "+e}).join("\n"))):o=e.stylize("[Circular]","special")),_(s)){if(a&&i.match(/^\d+$/))return o;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+o}function h(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return null==e}function g(e){return"number"==typeof e}function v(e){return"string"==typeof e}function x(e){return"symbol"==typeof e}function _(e){return void 0===e}function E(e){return A(e)&&"[object RegExp]"===k(e)}function A(e){return"object"==typeof e&&null!==e}function D(e){return A(e)&&"[object Date]"===k(e)}function C(e){return A(e)&&("[object Error]"===k(e)||e instanceof Error)}function S(e){return"function"==typeof e}function w(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function k(e){return Object.prototype.toString.call(e)}function F(e){return e<10?"0"+e.toString(10):e.toString(10)}function T(){var e=new Date,t=[F(e.getHours()),F(e.getMinutes()),F(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var j=/%[sdj%]/g;n.format=function(e){if(!v(e)){for(var t=[],n=0;n=a)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),o=r[n];n1&&void 0!==arguments[1]?arguments[1]:{};return t.filename=e,T(m.default.readFileSync(e,"utf8"),t)}n.__esModule=!0,n.transformFromAst=n.transform=n.analyse=n.Pipeline=n.OptionManager=n.traverse=n.types=n.messages=n.util=n.version=n.template=n.buildExternalHelpers=n.options=n.File=void 0;var u=e("../transformation/file");Object.defineProperty(n,"File",{enumerable:!0,get:function(){return i(u).default}});var l=e("../transformation/file/options/config");Object.defineProperty(n,"options",{enumerable:!0,get:function(){return i(l).default}});var c=e("../tools/build-external-helpers");Object.defineProperty(n,"buildExternalHelpers",{enumerable:!0,get:function(){return i(c).default}});var p=e("babel-template");Object.defineProperty(n,"template",{enumerable:!0,get:function(){return i(p).default}});var f=e("../../package");Object.defineProperty(n,"version",{enumerable:!0,get:function(){return f.version}}),n.Plugin=a,n.transformFile=s,n.transformFileSync=o;var h=e("lodash/isFunction"),d=i(h),y=e("fs"),m=i(y),b=e("../util"),g=r(b),v=e("babel-messages"),x=r(v),_=e("babel-types"),E=r(_),A=e("babel-traverse"),D=i(A),C=e("../transformation/file/options/option-manager"),S=i(C),w=e("../transformation/pipeline"),k=i(w);n.util=g,n.messages=x,n.types=E,n.traverse=D.default,n.OptionManager=S.default,n.Pipeline=k.default;var F=new k.default,T=(n.analyse=F.analyse.bind(F),n.transform=F.transform.bind(F));n.transformFromAst=F.transformFromAst.bind(F)},{"../../package":528,"../tools/build-external-helpers":44,"../transformation/file":45,"../transformation/file/options/config":49,"../transformation/file/options/option-manager":51,"../transformation/pipeline":56,"../util":59,"babel-messages":99,"babel-template":225,"babel-traverse":229,"babel-types":265,fs:1,"lodash/isFunction":480}],40:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-runtime/core-js/get-iterator"),a=r(i);n.default=function(e,t){if(e&&t)return(0,o.default)(e,t,function(e,t){if(t&&Array.isArray(e)){for(var n=t.slice(0),r=e,i=Array.isArray(r),s=0,r=i?r:(0,a.default)(r);;){var o;if(i){if(s>=r.length)break;o=r[s++]}else{if(s=r.next(),s.done)break;o=s.value}var u=o;n.indexOf(u)<0&&n.push(u)}return n}})};var s=e("lodash/mergeWith"),o=r(s);t.exports=n.default},{"babel-runtime/core-js/get-iterator":100,"lodash/mergeWith":495}],41:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}n.__esModule=!0,n.default=function(e,t,n){if(e){if("Program"===e.type)return a.file(e,t||[],n||[]);if("File"===e.type)return e}throw new Error("Not a valid ast?")};var i=e("babel-types"),a=r(i);t.exports=n.default},{"babel-types":265}],42:[function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var a=e("babel-runtime/helpers/typeof"),s=i(a);n.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.cwd();if("object"===(void 0===u.default?"undefined":(0,s.default)(u.default)))return null;var n=p[t];if(!n){n=new u.default;var i=c.default.join(t,".babelrc");n.id=i,n.filename=i,n.paths=u.default._nodeModulePaths(t),p[t]=n}try{return u.default._resolveFilename(e,n)}catch(e){return null}};var o=e("module"),u=i(o),l=e("path"),c=i(l),p={};t.exports=n.default}).call(this,e("_process"))},{_process:13,"babel-runtime/helpers/typeof":118,module:1,path:12}],43:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-runtime/core-js/map"),a=r(i),s=e("babel-runtime/helpers/classCallCheck"),o=r(s),u=e("babel-runtime/helpers/possibleConstructorReturn"),l=r(u),c=e("babel-runtime/helpers/inherits"),p=r(c),f=function(e){function t(){(0,o.default)(this,t);var n=(0,l.default)(this,e.call(this));return n.dynamicData={},n}return(0,p.default)(t,e),t.prototype.setDynamic=function(e,t){this.dynamicData[e]=t},t.prototype.get=function(t){if(this.has(t))return e.prototype.get.call(this,t);if(Object.prototype.hasOwnProperty.call(this.dynamicData,t)){var n=this.dynamicData[t]();return this.set(t,n),n}},t}(a.default);n.default=f,t.exports=n.default},{"babel-runtime/core-js/map":102,"babel-runtime/helpers/classCallCheck":114,"babel-runtime/helpers/inherits":115,"babel-runtime/helpers/possibleConstructorReturn":117}],44:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){var n=[],r=x.functionExpression(null,[x.identifier("global")],x.blockStatement(n)),i=x.program([x.expressionStatement(x.callExpression(r,[c.get("selfGlobal")]))]);return n.push(x.variableDeclaration("var",[x.variableDeclarator(e,x.assignmentExpression("=",x.memberExpression(x.identifier("global"),e),x.objectExpression([])))])),t(n),i}function s(e,t){var n=[];return n.push(x.variableDeclaration("var",[x.variableDeclarator(e,x.identifier("global"))])),t(n),x.program([_({FACTORY_PARAMETERS:x.identifier("global"),BROWSER_ARGUMENTS:x.assignmentExpression("=",x.memberExpression(x.identifier("root"),e),x.objectExpression([])),COMMON_ARGUMENTS:x.identifier("exports"),AMD_ARGUMENTS:x.arrayExpression([x.stringLiteral("exports")]),FACTORY_BODY:n,UMD_ROOT:x.identifier("this")})])}function o(e,t){var n=[];return n.push(x.variableDeclaration("var",[x.variableDeclarator(e,x.objectExpression([]))])),t(n),n.push(x.expressionStatement(e)),x.program(n)}function u(e,t,n){(0,g.default)(c.list,function(r){if(!(n&&n.indexOf(r)<0)){var i=x.identifier(r);e.push(x.expressionStatement(x.assignmentExpression("=",x.memberExpression(t,i),c.get(r))))}})}n.__esModule=!0,n.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"global",n=x.identifier("babelHelpers"),r=function(t){return u(t,n,e)},i=void 0,l={global:a,umd:s,var:o}[t];if(!l)throw new Error(d.get("unsupportedOutputType",t));return i=l(n,r),(0,f.default)(i).code};var l=e("babel-helpers"),c=i(l),p=e("babel-generator"),f=r(p),h=e("babel-messages"),d=i(h),y=e("babel-template"),m=r(y),b=e("lodash/each"),g=r(b),v=e("babel-types"),x=i(v),_=(0,m.default)('\n (function (root, factory) {\n if (typeof define === "function" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === "object") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n');t.exports=n.default},{"babel-generator":85,"babel-helpers":98,"babel-messages":99,"babel-template":225,"babel-types":265,"lodash/each":461}],45:[function(e,t,n){(function(t){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0,n.File=void 0;var a=e("babel-runtime/helpers/typeof"),s=i(a),o=e("babel-runtime/core-js/get-iterator"),u=i(o),l=e("babel-runtime/core-js/object/create"),c=i(l),p=e("babel-runtime/core-js/object/assign"),f=i(p),h=e("babel-runtime/helpers/classCallCheck"),d=i(h),y=e("babel-runtime/helpers/possibleConstructorReturn"),m=i(y),b=e("babel-runtime/helpers/inherits"),g=i(b),v=e("babel-helpers"),x=i(v),_=e("./metadata"),E=r(_),A=e("convert-source-map"),D=i(A),C=e("./options/option-manager"),S=i(C),w=e("../plugin-pass"),k=i(w),F=e("babel-traverse"),T=i(F),P=e("source-map"),j=i(P),B=e("babel-generator"),O=i(B),I=e("babel-code-frame"),N=i(I),L=e("lodash/defaults"),M=i(L),R=e("./logger"),U=i(R),V=e("../../store"),G=i(V),q=e("babylon"),K=e("../../util"),X=r(K),J=e("path"),W=i(J),z=e("babel-types"),Y=r(z),H=e("../../helpers/resolve"),$=i(H),Q=e("../internal-plugins/block-hoist"),Z=i(Q),ee=e("../internal-plugins/shadow-functions"),te=i(ee),ne=/^#!.*/,re=[[Z.default],[te.default]],ie={enter:function(e,t){var n=e.node.loc;n&&(t.loc=n,e.stop())}},ae=function(n){function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];(0,d.default)(this,r);var i=(0,m.default)(this,n.call(this));return i.pipeline=t,i.log=new U.default(i,e.filename||"unknown"),i.opts=i.initOptions(e),i.parserOpts={sourceType:i.opts.sourceType,sourceFileName:i.opts.filename,plugins:[]},i.pluginVisitors=[],i.pluginPasses=[],i.buildPluginsForOptions(i.opts),i.opts.passPerPreset&&(i.perPresetOpts=[],i.opts.presets.forEach(function(e){var t=(0,f.default)((0,c.default)(i.opts),e);i.perPresetOpts.push(t),i.buildPluginsForOptions(t)})),i.metadata={usedHelpers:[],marked:[],modules:{imports:[],exports:{exported:[],specifiers:[]}}},i.dynamicImportTypes={},i.dynamicImportIds={},i.dynamicImports=[],i.declarations={},i.usedHelpers={},i.path=null,i.ast={},i.code="",i.shebang="",i.hub=new F.Hub(i),i}return(0,g.default)(r,n),r.prototype.getMetadata=function(){for(var e=!1,t=this.ast.program.body,n=Array.isArray(t),r=0,t=n?t:(0,u.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i;if(Y.isModuleDeclaration(a)){e=!0;break}}e&&this.path.traverse(E,this)},r.prototype.initOptions=function(e){e=new S.default(this.log,this.pipeline).init(e),e.inputSourceMap&&(e.sourceMaps=!0),e.moduleId&&(e.moduleIds=!0),e.basename=W.default.basename(e.filename,W.default.extname(e.filename)),e.ignore=X.arrayify(e.ignore,X.regexify),e.only&&(e.only=X.arrayify(e.only,X.regexify)),(0,M.default)(e,{moduleRoot:e.sourceRoot}),(0,M.default)(e,{sourceRoot:e.moduleRoot}),(0,M.default)(e,{filenameRelative:e.filename});var t=W.default.basename(e.filenameRelative);return(0,M.default)(e,{sourceFileName:t,sourceMapTarget:t}),e},r.prototype.buildPluginsForOptions=function(e){if(Array.isArray(e.plugins)){for(var t=e.plugins.concat(re),n=[],r=[],i=t,a=Array.isArray(i),s=0,i=a?i:(0,u.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var l=o,c=l[0],p=l[1];n.push(c.visitor),r.push(new k.default(this,c,p)),c.manipulateOptions&&c.manipulateOptions(e,this.parserOpts,this)}this.pluginVisitors.push(n),this.pluginPasses.push(r)}},r.prototype.getModuleName=function(){var e=this.opts;if(!e.moduleIds)return null;if(null!=e.moduleId&&!e.getModuleId)return e.moduleId;var t=e.filenameRelative,n="";if(null!=e.moduleRoot&&(n=e.moduleRoot+"/"),!e.filenameRelative)return n+e.filename.replace(/^\//,"");if(null!=e.sourceRoot){var r=new RegExp("^"+e.sourceRoot+"/?");t=t.replace(r,"")}return t=t.replace(/\.(\w*?)$/,""),n+=t,n=n.replace(/\\/g,"/"),e.getModuleId?e.getModuleId(n)||n:n},r.prototype.resolveModuleSource=function e(t){var e=this.opts.resolveModuleSource;return e&&(t=e(t,this.opts.filename)),t},r.prototype.addImport=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e+":"+t,i=this.dynamicImportIds[r];if(!i){e=this.resolveModuleSource(e),i=this.dynamicImportIds[r]=this.scope.generateUidIdentifier(n);var a=[];"*"===t?a.push(Y.importNamespaceSpecifier(i)):"default"===t?a.push(Y.importDefaultSpecifier(i)):a.push(Y.importSpecifier(i,Y.identifier(t)));var s=Y.importDeclaration(a,Y.stringLiteral(e));s._blockHoist=3,this.path.unshiftContainer("body",s)}return i},r.prototype.addHelper=function(e){var t=this.declarations[e];if(t)return t;this.usedHelpers[e]||(this.metadata.usedHelpers.push(e),this.usedHelpers[e]=!0);var n=this.get("helperGenerator"),r=this.get("helpersNamespace");if(n){var i=n(e);if(i)return i}else if(r)return Y.memberExpression(r,Y.identifier(e));var a=(0,x.default)(e),s=this.declarations[e]=this.scope.generateUidIdentifier(e);return Y.isFunctionExpression(a)&&!a.id?(a.body._compact=!0,a._generated=!0,a.id=s,a.type="FunctionDeclaration",this.path.unshiftContainer("body",a)):(a._compact=!0,this.scope.push({id:s,init:a,unique:!0})),s},r.prototype.addTemplateObject=function(e,t,n){var r=n.elements.map(function(e){return e.value}),i=e+"_"+n.elements.length+"_"+r.join(","),a=this.declarations[i];if(a)return a;var s=this.declarations[i]=this.scope.generateUidIdentifier("templateObject"),o=this.addHelper(e),u=Y.callExpression(o,[t,n]);return u._compact=!0,this.scope.push({id:s,init:u,_blockHoist:1.9}),s},r.prototype.buildCodeFrameError=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:SyntaxError,r=e&&(e.loc||e._loc),i=new n(t);return r?i.loc=r.start:((0,T.default)(e,ie,this.scope,i),i.message+=" (This is an error on an internal node. Probably an internal error",i.loc&&(i.message+=". Location has been estimated."),i.message+=")"),i},r.prototype.mergeSourceMap=function(e){var t=this.opts.inputSourceMap;if(!t)return e;var n=function(){var n=new j.default.SourceMapConsumer(t),r=new j.default.SourceMapConsumer(e),i=new j.default.SourceMapGenerator({file:n.file,sourceRoot:n.sourceRoot}),a=r.sources[0];n.eachMapping(function(e){var t=r.generatedPositionFor({line:e.generatedLine,column:e.generatedColumn,source:a});null!=t.column&&i.addMapping({source:e.source,original:null==e.source?null:{line:e.originalLine,column:e.originalColumn},generated:t})});var s=i.toJSON();return t.mappings=s.mappings,{v:t}}();return"object"===(void 0===n?"undefined":(0,s.default)(n))?n.v:void 0},r.prototype.parse=function(n){var r=q.parse,i=this.opts.parserOpts;if(i&&(i=(0,f.default)({},this.parserOpts,i),i.parser)){if("string"==typeof i.parser){var a=W.default.dirname(this.opts.filename)||t.cwd(),s=(0,$.default)(i.parser,a);if(!s)throw new Error("Couldn't find parser "+i.parser+' with "parse" method relative to directory '+a);r=e(s).parse}else r=i.parser;i.parser={parse:function(e){return(0,q.parse)(e,i)}}}this.log.debug("Parse start");var o=r(n,i||this.parserOpts);return this.log.debug("Parse stop"),o},r.prototype._addAst=function(e){this.path=F.NodePath.get({hub:this.hub,parentPath:null,parent:e,container:e,key:"program"}).setContext(),this.scope=this.path.scope,this.ast=e,this.getMetadata()},r.prototype.addAst=function(e){this.log.debug("Start set AST"),this._addAst(e),this.log.debug("End set AST")},r.prototype.transform=function(){for(var e=0;e=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a,o=s.plugin,l=o[e];l&&l.call(s,this)}},r.prototype.parseInputSourceMap=function(e){var t=this.opts;if(t.inputSourceMap!==!1){var n=D.default.fromSource(e);n&&(t.inputSourceMap=n.toObject(),e=D.default.removeComments(e))}return e},r.prototype.parseShebang=function(){var e=ne.exec(this.code);e&&(this.shebang=e[0],this.code=this.code.replace(ne,""))},r.prototype.makeResult=function(e){var t=e.code,n=e.map,r=e.ast,i=e.ignored,a={metadata:null,options:this.opts,ignored:!!i,code:null,ast:null,map:n||null};return this.opts.code&&(a.code=t),this.opts.ast&&(a.ast=r),this.opts.metadata&&(a.metadata=this.metadata),a},r.prototype.generate=function(){var n=this.opts,r=this.ast,i={ast:r};if(!n.code)return this.makeResult(i);var a=O.default;if(n.generatorOpts.generator&&(a=n.generatorOpts.generator,"string"==typeof a)){var s=W.default.dirname(this.opts.filename)||t.cwd(),o=(0,$.default)(a,s);if(!o)throw new Error("Couldn't find generator "+a+' with "print" method relative to directory '+s);a=e(o).print}this.log.debug("Generation start");var u=a(r,n.generatorOpts?(0,f.default)(n,n.generatorOpts):n,this.code);return i.code=u.code,i.map=u.map,this.log.debug("Generation end"),this.shebang&&(i.code=this.shebang+"\n"+i.code),i.map&&(i.map=this.mergeSourceMap(i.map)),"inline"!==n.sourceMaps&&"both"!==n.sourceMaps||(i.code+="\n"+D.default.fromObject(i.map).toComment()),"inline"===n.sourceMaps&&(i.map=null),this.makeResult(i)},r}(G.default);n.default=ae,n.File=ae}).call(this,e("_process"))},{"../../helpers/resolve":42,"../../store":43,"../../util":59,"../internal-plugins/block-hoist":54,"../internal-plugins/shadow-functions":55,"../plugin-pass":57,"./logger":46,"./metadata":47,"./options/option-manager":51,_process:13,"babel-code-frame":60,"babel-generator":85,"babel-helpers":98,"babel-runtime/core-js/get-iterator":100,"babel-runtime/core-js/object/assign":104,"babel-runtime/core-js/object/create":105,"babel-runtime/helpers/classCallCheck":114,"babel-runtime/helpers/inherits":115,"babel-runtime/helpers/possibleConstructorReturn":117,"babel-runtime/helpers/typeof":118,"babel-traverse":229,"babel-types":265,babylon:274,"convert-source-map":275,"lodash/defaults":460,path:12,"source-map":527}],46:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),a=r(i),s=e("debug/node"),o=r(s),u=(0,o.default)("babel:verbose"),l=(0,o.default)("babel"),c=[],p=function(){function e(t,n){(0,a.default)(this,e),this.filename=n,this.file=t}return e.prototype._buildMessage=function(e){var t="[BABEL] "+this.filename;return e&&(t+=": "+e),t},e.prototype.warn=function(e){console.warn(this._buildMessage(e))},e.prototype.error=function(e){throw new(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Error)(this._buildMessage(e))},e.prototype.deprecate=function(e){this.file.opts&&this.file.opts.suppressDeprecationMessages||(e=this._buildMessage(e),c.indexOf(e)>=0||(c.push(e),console.error(e)))},e.prototype.verbose=function(e){u.enabled&&u(this._buildMessage(e))},e.prototype.debug=function(e){l.enabled&&l(this._buildMessage(e))},e.prototype.deopt=function(e,t){this.debug(t)},e}();n.default=p,t.exports=n.default},{"babel-runtime/helpers/classCallCheck":114,"debug/node":276}],47:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n=e.node,r=n.source?n.source.value:null,i=t.metadata.modules.exports,a=e.get("declaration");if(a.isStatement()){var s=a.getBindingIdentifiers();for(var o in s)i.exported.push(o),i.specifiers.push({kind:"local",local:o,exported:e.isExportDefaultDeclaration()?"default":o})}if(e.isExportNamedDeclaration()&&n.specifiers)for(var l=n.specifiers,p=Array.isArray(l),f=0,l=p?l:(0,u.default)(l);;){var h;if(p){if(f>=l.length)break;h=l[f++]}else{if(f=l.next(),f.done)break;h=f.value}var d=h,y=d.exported.name;i.exported.push(y),c.isExportDefaultSpecifier(d)&&i.specifiers.push({kind:"external",local:y,exported:y,source:r}),c.isExportNamespaceSpecifier(d)&&i.specifiers.push({kind:"external-namespace",exported:y,source:r});var m=d.local;m&&(r&&i.specifiers.push({kind:"external",local:m.name,exported:y,source:r}),r||i.specifiers.push({kind:"local",local:m.name,exported:y}))}e.isExportAllDeclaration()&&i.specifiers.push({kind:"external-all",source:r})}function s(e){e.skip()}n.__esModule=!0,n.ImportDeclaration=n.ModuleDeclaration=void 0;var o=e("babel-runtime/core-js/get-iterator"),u=i(o);n.ExportDeclaration=a,n.Scope=s;var l=e("babel-types"),c=r(l);n.ModuleDeclaration={enter:function(e,t){var n=e.node;n.source&&(n.source.value=t.resolveModuleSource(n.source.value))}},n.ImportDeclaration={exit:function(e,t){var n=e.node,r=[],i=[];t.metadata.modules.imports.push({source:n.source.value,imported:i,specifiers:r});for(var a=e.get("specifiers"),s=Array.isArray(a),o=0,a=s?a:(0,u.default)(a);;){var l;if(s){if(o>=a.length)break;l=a[o++]}else{if(o=a.next(),o.done)break;l=o.value}var c=l,p=c.node.local.name;if(c.isImportDefaultSpecifier()&&(i.push("default"),r.push({kind:"named",imported:"default",local:p})),c.isImportSpecifier()){var f=c.node.imported.name;i.push(f),r.push({kind:"named",imported:f,local:p})}c.isImportNamespaceSpecifier()&&(i.push("*"),r.push({kind:"namespace",local:p}))}}}},{"babel-runtime/core-js/get-iterator":100,"babel-types":265}],48:[function(e,t,n){(function(r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=_[e];return null==t?_[e]=x.default.existsSync(e):t}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1],n=e.filename,r=new S(t);return e.babelrc!==!1&&r.findConfigs(n),r.mergeConfig({options:e,alias:"base",dirname:n&&g.default.dirname(n)}),r.configs}n.__esModule=!0;var o=e("babel-runtime/core-js/object/assign"),u=i(o),l=e("babel-runtime/helpers/classCallCheck"),c=i(l);n.default=s;var p=e("../../../helpers/resolve"),f=i(p),h=e("json5"),d=i(h),y=e("path-is-absolute"),m=i(y),b=e("path"),g=i(b),v=e("fs"),x=i(v),_={},E={},A=".babelignore",D=".babelrc",C="package.json",S=function(){function e(t){(0,c.default)(this,e),this.resolvedConfigs=[],this.configs=[],this.log=t}return e.prototype.findConfigs=function(e){if(e){(0,m.default)(e)||(e=g.default.join(r.cwd(),e));for(var t=!1,n=!1;e!==(e=g.default.dirname(e));){if(!t){var i=g.default.join(e,D);a(i)&&(this.addConfig(i),t=!0);var s=g.default.join(e,C);!t&&a(s)&&(t=this.addConfig(s,"babel",JSON))}if(!n){var o=g.default.join(e,A);a(o)&&(this.addIgnoreConfig(o),n=!0)}if(n&&t)return}}},e.prototype.addIgnoreConfig=function(e){var t=x.default.readFileSync(e,"utf8"),n=t.split("\n");n=n.map(function(e){return e.replace(/#(.*?)$/,"").trim()}).filter(function(e){return!!e}),n.length&&this.mergeConfig({options:{ignore:n},alias:e,dirname:g.default.dirname(e)})},e.prototype.addConfig=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:d.default;if(this.resolvedConfigs.indexOf(e)>=0)return!1;this.resolvedConfigs.push(e);var r=x.default.readFileSync(e,"utf8"),i=void 0;try{i=E[r]=E[r]||n.parse(r),t&&(i=i[t])}catch(t){throw t.message=e+": Error while parsing JSON - "+t.message,t}return this.mergeConfig({options:i,alias:e,dirname:g.default.dirname(e)}),!!i},e.prototype.mergeConfig=function(e){var t=e.options,n=e.alias,i=e.loc,a=e.dirname;if(!t)return!1 +;if(t=(0,u.default)({},t),a=a||r.cwd(),i=i||n,t.extends){var s=(0,f.default)(t.extends,a);s?this.addConfig(s):this.log&&this.log.error("Couldn't resolve extends clause of "+t.extends+" in "+n),delete t.extends}this.configs.push({options:t,alias:n,loc:i,dirname:a});var o=void 0,l=r.env.BABEL_ENV||r.env.NODE_ENV||"development";t.env&&(o=t.env[l],delete t.env),this.mergeConfig({options:o,alias:n+".env."+l,dirname:a})},e}();t.exports=n.default}).call(this,e("_process"))},{"../../../helpers/resolve":42,_process:13,"babel-runtime/core-js/object/assign":104,"babel-runtime/helpers/classCallCheck":114,fs:1,json5:281,path:12,"path-is-absolute":515}],49:[function(e,t,n){"use strict";t.exports={filename:{type:"filename",description:"filename to use when reading from stdin - this will be used in source-maps, errors etc",default:"unknown",shorthand:"f"},filenameRelative:{hidden:!0,type:"string"},inputSourceMap:{hidden:!0},env:{hidden:!0,default:{}},mode:{description:"",hidden:!0},retainLines:{type:"boolean",default:!1,description:"retain line numbers - will result in really ugly code"},highlightCode:{description:"enable/disable ANSI syntax highlighting of code frames (on by default)",type:"boolean",default:!0},suppressDeprecationMessages:{type:"boolean",default:!1,hidden:!0},presets:{type:"list",description:"",default:[]},plugins:{type:"list",default:[],description:""},ignore:{type:"list",description:"list of glob paths to **not** compile",default:[]},only:{type:"list",description:"list of glob paths to **only** compile"},code:{hidden:!0,default:!0,type:"boolean"},metadata:{hidden:!0,default:!0,type:"boolean"},ast:{hidden:!0,default:!0,type:"boolean"},extends:{type:"string",hidden:!0},comments:{type:"boolean",default:!0,description:"write comments to generated output (true by default)"},shouldPrintComment:{hidden:!0,description:"optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"},wrapPluginVisitorMethod:{hidden:!0,description:"optional callback to wrap all visitor methods"},compact:{type:"booleanString",default:"auto",description:"do not include superfluous whitespace characters and line terminators [true|false|auto]"},minified:{type:"boolean",default:!1,description:"save as much bytes when printing [true|false]"},sourceMap:{alias:"sourceMaps",hidden:!0},sourceMaps:{type:"booleanString",description:"[true|false|inline]",default:!1,shorthand:"s"},sourceMapTarget:{type:"string",description:"set `file` on returned source map"},sourceFileName:{type:"string",description:"set `sources[0]` on returned source map"},sourceRoot:{type:"filename",description:"the root from which all sources are relative"},babelrc:{description:"Whether or not to look up .babelrc and .babelignore files",type:"boolean",default:!0},sourceType:{description:"",default:"module"},auxiliaryCommentBefore:{type:"string",description:"print a comment before any injected non-user code"},auxiliaryCommentAfter:{type:"string",description:"print a comment after any injected non-user code"},resolveModuleSource:{hidden:!0},getModuleId:{hidden:!0},moduleRoot:{type:"filename",description:"optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"},moduleIds:{type:"boolean",default:!1,shorthand:"M",description:"insert an explicit id for modules"},moduleId:{description:"specify a custom name for module ids",type:"string"},passPerPreset:{description:"Whether to spawn a traversal pass per a preset. By default all presets are merged.",type:"boolean",default:!1,hidden:!0},parserOpts:{description:"Options to pass into the parser, or to change parsers (parserOpts.parser)",default:!1},generatorOpts:{description:"Options to pass into the generator, or to change generators (generatorOpts.generator)",default:!1}}},{}],50:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var t in e){var n=e[t];if(null!=n){var r=l.default[t];if(r&&r.alias&&(r=l.default[r.alias]),r){var i=o[r.type];i&&(n=i(n)),e[t]=n}}}return e}n.__esModule=!0,n.config=void 0,n.normaliseOptions=a;var s=e("./parsers"),o=i(s),u=e("./config"),l=r(u);n.config=l.default},{"./config":49,"./parsers":52}],51:[function(e,t,n){(function(r){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var s=e("babel-runtime/helpers/objectWithoutProperties"),o=a(s),u=e("babel-runtime/core-js/json/stringify"),l=a(u),c=e("babel-runtime/core-js/object/assign"),p=a(c),f=e("babel-runtime/core-js/get-iterator"),h=a(f),d=e("babel-runtime/helpers/typeof"),y=a(d),m=e("babel-runtime/helpers/classCallCheck"),b=a(m),g=e("../../../api/node"),v=i(g),x=e("../../plugin"),_=a(x),E=e("babel-messages"),A=i(E),D=e("./index"),C=e("../../../helpers/resolve"),S=a(C),w=e("lodash/cloneDeepWith"),k=a(w),F=e("lodash/clone"),T=a(F),P=e("../../../helpers/merge"),j=a(P),B=e("./config"),O=a(B),I=e("./removed"),N=a(I),L=e("./build-config-chain"),M=a(L),R=e("path"),U=a(R),V=function(){function t(e){(0,b.default)(this,t),this.resolvedConfigs=[],this.options=t.createBareOptions(),this.log=e}return t.memoisePluginContainer=function(e,n,r,i){for(var a=t.memoisedPlugins,s=Array.isArray(a),o=0,a=s?a:(0,h.default)(a);;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;if(l.container===e)return l.plugin}var c=void 0;if(c="function"==typeof e?e(v):e,"object"===(void 0===c?"undefined":(0,y.default)(c))){var p=new _.default(c,i);return t.memoisedPlugins.push({container:e,plugin:p}),p}throw new TypeError(A.get("pluginNotObject",n,r,void 0===c?"undefined":(0,y.default)(c))+n+r)},t.createBareOptions=function(){var e={};for(var t in O.default){var n=O.default[t];e[t]=(0,T.default)(n.default)}return e},t.normalisePlugin=function(e,n,r,i){if(e=e.__esModule?e.default:e,!(e instanceof _.default)){if("function"!=typeof e&&"object"!==(void 0===e?"undefined":(0,y.default)(e)))throw new TypeError(A.get("pluginNotFunction",n,r,void 0===e?"undefined":(0,y.default)(e)));e=t.memoisePluginContainer(e,n,r,i)}return e.init(n,r),e},t.normalisePlugins=function(n,r,i){return i.map(function(i,a){var s=void 0,o=void 0;if(!i)throw new TypeError("Falsy value found in plugins");Array.isArray(i)?(s=i[0],o=i[1]):s=i;var u="string"==typeof s?s:n+"$"+a;if("string"==typeof s){var l=(0,S.default)("babel-plugin-"+s,r)||(0,S.default)(s,r);if(!l)throw new ReferenceError(A.get("pluginUnknown",s,n,a,r));s=e(l)}return s=t.normalisePlugin(s,n,a,u),[s,o]})},t.prototype.mergeOptions=function(e){var n=this,i=e.options,a=e.extending,s=e.alias,o=e.loc,u=e.dirname;if(s=s||"foreign",i){("object"!==(void 0===i?"undefined":(0,y.default)(i))||Array.isArray(i))&&this.log.error("Invalid options type for "+s,TypeError);var l=(0,k.default)(i,function(e){if(e instanceof _.default)return e});u=u||r.cwd(),o=o||s;for(var c in l){if(!O.default[c]&&this.log)if(N.default[c])this.log.error("Using removed Babel 5 option: "+s+"."+c+" - "+N.default[c].message,ReferenceError);else{var f="Unknown option: "+s+"."+c+". Check out http://babeljs.io/docs/usage/options/ for more information about options.",h="A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.";this.log.error(f+"\n\n"+h,ReferenceError)}}(0,D.normaliseOptions)(l),l.plugins&&(l.plugins=t.normalisePlugins(o,u,l.plugins)),l.presets&&(l.passPerPreset?l.presets=this.resolvePresets(l.presets,u,function(e,t){n.mergeOptions({options:e,extending:e,alias:t,loc:t,dirname:u})}):(this.mergePresets(l.presets,u),delete l.presets)),i===a?(0,p.default)(a,l):(0,j.default)(a||this.options,l)}},t.prototype.mergePresets=function(e,t){var n=this;this.resolvePresets(e,t,function(e,t){n.mergeOptions({options:e,alias:t,loc:t,dirname:U.default.dirname(t||"")})})},t.prototype.resolvePresets=function(t,n,r){return t.map(function(t){var i=void 0;if(Array.isArray(t)){if(t.length>2)throw new Error("Unexpected extra options "+(0,l.default)(t.slice(2))+" passed to preset.");var a=t;t=a[0],i=a[1]}var s=void 0;try{if("string"==typeof t){if(s=(0,S.default)("babel-preset-"+t,n)||(0,S.default)(t,n),!s){var u=t.match(/^(@[^\/]+)\/(.+)$/);if(u){t=u[1]+"/babel-preset-"+u[2],s=(0,S.default)(t,n)}}if(!s)throw new Error("Couldn't find preset "+(0,l.default)(t)+" relative to directory "+(0,l.default)(n));t=e(s)}if("object"===(void 0===t?"undefined":(0,y.default)(t))&&t.__esModule)if(t.default)t=t.default;else{var c=t,p=(c.__esModule,(0,o.default)(c,["__esModule"]));t=p}if("object"===(void 0===t?"undefined":(0,y.default)(t))&&t.buildPreset&&(t=t.buildPreset),"function"!=typeof t&&void 0!==i)throw new Error("Options "+(0,l.default)(i)+" passed to "+(s||"a preset")+" which does not accept options.");if("function"==typeof t&&(t=t(v,i)),"object"!==(void 0===t?"undefined":(0,y.default)(t)))throw new Error("Unsupported preset format: "+t+".");r&&r(t,s)}catch(e){throw s&&(e.message+=" (While processing preset: "+(0,l.default)(s)+")"),e}return t})},t.prototype.normaliseOptions=function(){var e=this.options;for(var t in O.default){var n=O.default[t],r=e[t];!r&&n.optional||(n.alias?e[n.alias]=e[n.alias]||r:e[t]=r)}},t.prototype.init=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,M.default)(e,this.log),n=Array.isArray(t),r=0,t=n?t:(0,h.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i;this.mergeOptions(a)}return this.normaliseOptions(e),this.options},t}();n.default=V,V.memoisedPlugins=[],t.exports=n.default}).call(this,e("_process"))},{"../../../api/node":39,"../../../helpers/merge":40,"../../../helpers/resolve":42,"../../plugin":58,"./build-config-chain":48,"./config":49,"./index":50,"./removed":53,_process:13,"babel-messages":99,"babel-runtime/core-js/get-iterator":100,"babel-runtime/core-js/json/stringify":101,"babel-runtime/core-js/object/assign":104,"babel-runtime/helpers/classCallCheck":114,"babel-runtime/helpers/objectWithoutProperties":116,"babel-runtime/helpers/typeof":118,"lodash/clone":455,"lodash/cloneDeepWith":457,path:12}],52:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return!!e}function s(e){return p.booleanify(e)}function o(e){return p.list(e)}n.__esModule=!0,n.filename=void 0,n.boolean=a,n.booleanString=s,n.list=o;var u=e("slash"),l=i(u),c=e("../../../util"),p=r(c);n.filename=l.default},{"../../../util":59,slash:516}],53:[function(e,t,n){"use strict";t.exports={auxiliaryComment:{message:"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"},blacklist:{message:"Put the specific transforms you want in the `plugins` option"},breakConfig:{message:"This is not a necessary option in Babel 6"},experimental:{message:"Put the specific transforms you want in the `plugins` option"},externalHelpers:{message:"Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"},extra:{message:""},jsxPragma:{message:"use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"},loose:{message:"Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."},metadataUsedHelpers:{message:"Not required anymore as this is enabled by default"},modules:{message:"Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"},nonStandard:{message:"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"},optional:{message:"Put the specific transforms you want in the `plugins` option"},sourceMapName:{message:"Use the `sourceMapTarget` option"},stage:{message:"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"},whitelist:{message:"Put the specific transforms you want in the `plugins` option"}}},{}],54:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("../plugin"),a=r(i),s=e("lodash/sortBy"),o=r(s);n.default=new a.default({name:"internal.blockHoist",visitor:{Block:{exit:function(e){for(var t=e.node,n=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return t.code=!1,t.mode="lint",this.transform(e,t)},e.prototype.pretransform=function(e,t){var n=new p.default(t,this);return n.wrap(e,function(){return n.addCode(e),n.parseCode(e),n})},e.prototype.transform=function(e,t){var n=new p.default(t,this);return n.wrap(e,function(){return n.addCode(e),n.parseCode(e),n.transform()})},e.prototype.analyse=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];return t.code=!1,n&&(t.plugins=t.plugins||[],t.plugins.push(new l.default({visitor:n}))),this.transform(e,t).metadata},e.prototype.transformFromAst=function(e,t,n){e=(0,o.default)(e);var r=new p.default(n,this);return r.wrap(t,function(){return r.addCode(t),r.addAst(e),r.transform()})},e}();n.default=f,t.exports=n.default},{"../helpers/normalize-ast":41,"./file":45,"./plugin":58,"babel-runtime/helpers/classCallCheck":114}],57:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),a=r(i),s=e("babel-runtime/helpers/possibleConstructorReturn"),o=r(s),u=e("babel-runtime/helpers/inherits"),l=r(u),c=e("../store"),p=r(c),f=e("./file"),h=(r(f),function(e){function t(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,a.default)(this,t);var s=(0,o.default)(this,e.call(this));return s.plugin=r,s.key=r.key,s.file=n,s.opts=i,s}return(0,l.default)(t,e),t.prototype.addHelper=function(){var e;return(e=this.file).addHelper.apply(e,arguments)},t.prototype.addImport=function(){var e;return(e=this.file).addImport.apply(e,arguments)},t.prototype.getModuleName=function(){var e;return(e=this.file).getModuleName.apply(e,arguments)},t.prototype.buildCodeFrameError=function(){var e;return(e=this.file).buildCodeFrameError.apply(e,arguments)},t}(p.default));n.default=h,t.exports=n.default},{"../store":43,"./file":45,"babel-runtime/helpers/classCallCheck":114,"babel-runtime/helpers/inherits":115,"babel-runtime/helpers/possibleConstructorReturn":117}],58:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var a=e("babel-runtime/core-js/get-iterator"),s=i(a),o=e("babel-runtime/helpers/classCallCheck"),u=i(o),l=e("babel-runtime/helpers/possibleConstructorReturn"),c=i(l),p=e("babel-runtime/helpers/inherits"),f=i(p),h=e("./file/options/option-manager"),d=i(h),y=e("babel-messages"),m=r(y),b=e("../store"),g=i(b),v=e("babel-traverse"),x=i(v),_=e("lodash/assign"),E=i(_),A=e("lodash/clone"),D=i(A),C=["enter","exit"],S=function(e){function t(n,r){(0,u.default)(this,t);var i=(0,c.default)(this,e.call(this));return i.initialized=!1,i.raw=(0,E.default)({},n),i.key=i.take("name")||r,i.manipulateOptions=i.take("manipulateOptions"),i.post=i.take("post"),i.pre=i.take("pre"),i.visitor=i.normaliseVisitor((0,D.default)(i.take("visitor"))||{}),i}return(0,f.default)(t,e),t.prototype.take=function(e){var t=this.raw[e];return delete this.raw[e],t},t.prototype.chain=function(e,t){if(!e[t])return this[t];if(!this[t])return e[t];var n=[e[t],this[t]];return function(){for(var e=void 0,t=arguments.length,r=Array(t),i=0;i=a.length)break;l=a[u++]}else{if(u=a.next(),u.done)break;l=u.value}var c=l;if(c){var p=c.apply(this,r);null!=p&&(e=p)}}return e}},t.prototype.maybeInherit=function(e){var t=this.take("inherits");t&&(t=d.default.normalisePlugin(t,e,"inherits"),this.manipulateOptions=this.chain(t,"manipulateOptions"),this.post=this.chain(t,"post"),this.pre=this.chain(t,"pre"),this.visitor=x.default.visitors.merge([t.visitor,this.visitor]))},t.prototype.init=function(e,t){if(!this.initialized){this.initialized=!0,this.maybeInherit(e);for(var n in this.raw)throw new Error(m.get("pluginInvalidProperty",e,t,n))}},t.prototype.normaliseVisitor=function(e){for(var t=C,n=Array.isArray(t),r=0,t=n?t:(0,s.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}if(e[i])throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. Please target individual nodes.")}return x.default.explode(e),e},t}(g.default);n.default=S,t.exports=n.default},{"../store":43,"./file/options/option-manager":51,"babel-messages":99,"babel-runtime/core-js/get-iterator":100,"babel-runtime/helpers/classCallCheck":114,"babel-runtime/helpers/inherits":115,"babel-runtime/helpers/possibleConstructorReturn":117,"babel-traverse":229,"lodash/assign":453,"lodash/clone":455}],59:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=t||i.EXTENSIONS,r=F.default.extname(e);return(0,A.default)(n,r)}function a(e){return e?Array.isArray(e)?e:"string"==typeof e?e.split(","):[e]:[]}function s(e){if(!e)return new RegExp(/.^/);if(Array.isArray(e)&&(e=new RegExp(e.map(y.default).join("|"),"i")),"string"==typeof e){e=(0,P.default)(e),((0,b.default)(e,"./")||(0,b.default)(e,"*/"))&&(e=e.slice(2)),(0,b.default)(e,"**/")&&(e=e.slice(3));var t=_.default.makeRe(e,{nocase:!0});return new RegExp(t.source.slice(1,-1),"i")}if((0,w.default)(e))return e;throw new TypeError("illegal type for regexify")}function o(e,t){return e?(0,v.default)(e)?o([e],t):(0,C.default)(e)?o(a(e),t):Array.isArray(e)?(t&&(e=e.map(t)),e):[e]:[]}function u(e){return"true"===e||1==e||!("false"===e||0==e||!e)&&e}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2];if(e=e.replace(/\\/g,"/"),n){for(var r=n,i=Array.isArray(r),a=0,r=i?r:(0,f.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}if(c(s,e))return!1}return!0}if(t.length)for(var o=t,u=Array.isArray(o),l=0,o=u?o:(0,f.default)(o);;){var p;if(u){if(l>=o.length)break;p=o[l++]}else{if(l=o.next(),l.done)break;p=l.value}var h=p;if(c(h,e))return!0}return!1}function c(e,t){return"function"==typeof e?e(t):e.test(t)}n.__esModule=!0,n.inspect=n.inherits=void 0;var p=e("babel-runtime/core-js/get-iterator"),f=r(p),h=e("util");Object.defineProperty(n,"inherits",{enumerable:!0,get:function(){return h.inherits}}),Object.defineProperty(n,"inspect",{enumerable:!0,get:function(){return h.inspect}}),n.canCompile=i,n.list=a,n.regexify=s,n.arrayify=o,n.booleanify=u,n.shouldIgnore=l;var d=e("lodash/escapeRegExp"),y=r(d),m=e("lodash/startsWith"),b=r(m),g=e("lodash/isBoolean"),v=r(g),x=e("minimatch"),_=r(x),E=e("lodash/includes"),A=r(E),D=e("lodash/isString"),C=r(D),S=e("lodash/isRegExp"),w=r(S),k=e("path"),F=r(k),T=e("slash"),P=r(T);i.EXTENSIONS=[".js",".jsx",".es6",".es"]},{"babel-runtime/core-js/get-iterator":100,"lodash/escapeRegExp":463,"lodash/includes":473,"lodash/isBoolean":478,"lodash/isRegExp":487,"lodash/isString":488,"lodash/startsWith":500,minimatch:511,path:12,slash:516,util:35}],60:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){return{keyword:e.cyan,capitalized:e.yellow,jsx_tag:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.grey,invalid:e.white.bgRed.bold,gutter:e.grey,marker:e.red.bold}}function a(e){var t=e.slice(-2),n=t[0],r=t[1],i=u.default.matchToToken(e);if("name"===i.type){if(c.default.keyword.isReservedWordES6(i.value))return"keyword";if(d.test(i.value)&&("<"===r[n-1]||"3&&void 0!==arguments[3]?arguments[3]:{};n=Math.max(n,0);var a=r.highlightCode&&f.default.supportsColor||r.forceColor,o=f.default;r.forceColor&&(o=new f.default.constructor({enabled:!0}));var u=function(e,t){return a?e(t):t},l=i(o);a&&(e=s(l,e));var c=r.linesAbove||2,p=r.linesBelow||3,d=e.split(h),y=Math.max(t-(c+1),0),m=Math.min(d.length,t+p);t||n||(y=0,m=d.length);var b=String(m).length,g=d.slice(y,m).map(function(e,r){var i=y+1+r,a=(" "+i).slice(-b),s=" "+a+" | ";if(i===t){var o="";if(n){var c=e.slice(0,n-1).replace(/[^\t]/g," ");o=["\n ",u(l.gutter,s.replace(/\d/g," ")),c,u(l.marker,"^")].join("")}return[u(l.marker,">"),u(l.gutter,s),e,o].join("")}return" "+u(l.gutter,s)+e}).join("\n");return a?o.reset(g):g};var o=e("js-tokens"),u=r(o),l=e("esutils"),c=r(l),p=e("chalk"),f=r(p),h=/\r\n|[\n\r\u2028\u2029]/,d=/^[a-z][\w-]*$/i,y=/^[()\[\]{}]$/;t.exports=n.default},{chalk:61,esutils:72,"js-tokens":73}],61:[function(e,t,n){(function(n){"use strict";function r(e){this.enabled=e&&void 0!==e.enabled?e.enabled:p}function i(e){var t=function(){return a.apply(t,arguments)};return t._styles=e,t.enabled=this.enabled,t.__proto__=y,t}function a(){var e=arguments,t=e.length,n=0!==t&&String(arguments[0]);if(t>1)for(var r=1;r<]/g}},{}],66:[function(e,t,n){"use strict";var r=e("ansi-regex")();t.exports=function(e){return"string"==typeof e?e.replace(r,""):e}},{"ansi-regex":67}],67:[function(e,t,n){arguments[4][65][0].apply(n,arguments)},{dup:65}],68:[function(e,t,n){(function(e){"use strict";var n=e.argv,r=n.indexOf("--"),i=function(e){e="--"+e;var t=n.indexOf(e);return t!==-1&&(r===-1||t=48&&e<=55}function i(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&h.indexOf(e)>=0}function a(e){return 10===e||13===e||8232===e||8233===e}function s(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(Math.floor((e-65536)/1024)+55296)+String.fromCharCode((e-65536)%1024+56320)}function o(e){return e<128?d[e]:f.NonAsciiIdentifierStart.test(s(e))}function u(e){return e<128?y[e]:f.NonAsciiIdentifierPart.test(s(e))}function l(e){return e<128?d[e]:p.NonAsciiIdentifierStart.test(s(e))}function c(e){return e<128?y[e]:p.NonAsciiIdentifierPart.test(s(e))}var p,f,h,d,y,m;for(f={ +NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,NonAsciiIdentifierPart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/},p={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},h=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279],d=new Array(128),m=0;m<128;++m)d[m]=m>=97&&m<=122||m>=65&&m<=90||36===m||95===m;for(y=new Array(128),m=0;m<128;++m)y[m]=m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||36===m||95===m;t.exports={isDecimalDigit:e,isHexDigit:n,isOctalDigit:r,isWhiteSpace:i,isLineTerminator:a,isIdentifierStartES5:o,isIdentifierPartES5:u,isIdentifierStartES6:l,isIdentifierPartES6:c}}()},{}],71:[function(e,t,n){!function(){"use strict";function n(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"let":return!0;default:return!1}}function r(e,t){return!(!t&&"yield"===e)&&i(e,t)}function i(e,t){if(t&&n(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function a(e,t){return"null"===e||"true"===e||"false"===e||r(e,t)}function s(e,t){return"null"===e||"true"===e||"false"===e||i(e,t)}function o(e){return"eval"===e||"arguments"===e}function u(e){var t,n,r;if(0===e.length)return!1;if(r=e.charCodeAt(0),!h.isIdentifierStartES5(r))return!1;for(t=1,n=e.length;t=n)return!1;if(i=e.charCodeAt(t),!(56320<=i&&i<=57343))return!1;r=l(r,i)}if(!a(r))return!1;a=h.isIdentifierPartES6}return!0}function p(e,t){return u(e)&&!a(e,t)}function f(e,t){return c(e)&&!s(e,t)}var h=e("./code");t.exports={isKeywordES5:r,isKeywordES6:i,isReservedWordES5:a,isReservedWordES6:s,isRestrictedWord:o,isIdentifierNameES5:u,isIdentifierNameES6:c,isIdentifierES5:p,isIdentifierES6:f}}()},{"./code":70}],72:[function(e,t,n){!function(){"use strict";n.ast=e("./ast"),n.code=e("./code"),n.keyword=e("./keyword")}()},{"./ast":69,"./code":70,"./keyword":71}],73:[function(e,t,n){t.exports=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyu]{1,5}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]{1,6}\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,t.exports.matchToToken=function(e){var t={type:"invalid",value:e[0]};return e[1]?(t.type="string",t.closed=!(!e[3]&&!e[4])):e[5]?t.type="comment":e[6]?(t.type="comment",t.closed=!!e[7]):e[8]?t.type="regex":e[9]?t.type="number":e[10]?t.type="name":e[11]?t.type="punctuator":e[12]&&(t.type="whitespace"),t}},{}],74:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),a=r(i),s=e("lodash/trimEnd"),o=r(s),u=/^[ \t]+$/,l=function(){function e(t){(0,a.default)(this,e),this._map=null,this._buf=[],this._last="",this._queue=[],this._position={line:1,column:0},this._sourcePosition={identifierName:null,line:null,column:null,filename:null},this._map=t}return e.prototype.get=function(){this._flush();var e=this._map,t={code:(0,o.default)(this._buf.join("")),map:null,rawMappings:e&&e.getRawMappings()};return e&&Object.defineProperty(t,"map",{configurable:!0,enumerable:!0,get:function(){return this.map=e.get()},set:function(e){Object.defineProperty(this,"map",{value:e,writable:!0})}}),t},e.prototype.append=function(e){this._flush();var t=this._sourcePosition,n=t.line,r=t.column,i=t.filename,a=t.identifierName;this._append(e,n,r,a,i)},e.prototype.queue=function(e){if("\n"===e)for(;this._queue.length>0&&u.test(this._queue[0][0]);)this._queue.shift();var t=this._sourcePosition,n=t.line,r=t.column,i=t.filename,a=t.identifierName;this._queue.unshift([e,n,r,a,i])},e.prototype._flush=function(){for(var e=void 0;e=this._queue.pop();)this._append.apply(this,e)},e.prototype._append=function(e,t,n,r,i){this._map&&"\n"!==e[0]&&this._map.mark(this._position.line,this._position.column,t,n,r,i),this._buf.push(e),this._last=e[e.length-1];for(var a=0;a0&&"\n"===this._queue[0][0]&&this._queue.shift()},e.prototype.removeLastSemicolon=function(){this._queue.length>0&&";"===this._queue[0][0]&&this._queue.shift()},e.prototype.endsWith=function(e){if(1===e.length){var t=void 0;if(this._queue.length>0){var n=this._queue[0][0];t=n[n.length-1]}else t=this._last;return t===e}var r=this._last+this._queue.reduce(function(e,t){return t[0]+e},"");return e.length<=r.length&&r.slice(-e.length)===e},e.prototype.hasContent=function(){return this._queue.length>0||!!this._last},e.prototype.source=function(e,t){if(!e||t){var n=t?t[e]:null;this._sourcePosition.identifierName=t&&t.identifierName||null,this._sourcePosition.line=n?n.line:null,this._sourcePosition.column=n?n.column:null,this._sourcePosition.filename=t&&t.filename||null}},e.prototype.withSource=function(e,t,n){if(!this._map)return n();var r=this._sourcePosition.line,i=this._sourcePosition.column,a=this._sourcePosition.filename,s=this._sourcePosition.identifierName;this.source(e,t),n(),this._sourcePosition.line=r,this._sourcePosition.column=i,this._sourcePosition.filename=a,this._sourcePosition.identifierName=s},e.prototype.getCurrentColumn=function(){var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=e.lastIndexOf("\n");return t===-1?this._position.column+e.length:e.length-1-t},e.prototype.getCurrentLine=function(){for(var e=this._queue.reduce(function(e,t){return t[0]+e},""),t=0,n=0;n")),this.space(),this.print(e.returnType,e)}function b(e){this.print(e.name,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.typeAnnotation,e)}function g(e){this.print(e.id,e),this.print(e.typeParameters,e)}function v(e){this.print(e.id,e),this.print(e.typeParameters,e),e.extends.length&&(this.space(),this.word("extends"),this.space(),this.printList(e.extends,e)),e.mixins&&e.mixins.length&&(this.space(),this.word("mixins"),this.space(),this.printList(e.mixins,e)),this.space(),this.print(e.body,e)}function x(e){"plus"===e.variance?this.token("+"):"minus"===e.variance&&this.token("-")}function _(e){this.word("interface"),this.space(),this._interfaceish(e)}function E(){this.space(),this.token("&"),this.space()}function A(e){this.printJoin(e.types,e,{separator:E})}function D(){this.word("mixed")}function C(){this.word("empty")}function S(e){this.token("?"),this.print(e.typeAnnotation,e)}function w(){this.word("number")}function k(){this.word("string")}function F(){this.word("this")}function T(e){this.token("["),this.printList(e.types,e),this.token("]")}function P(e){this.word("typeof"),this.space(),this.print(e.argument,e)}function j(e){this.word("type"),this.space(),this.print(e.id,e),this.print(e.typeParameters,e),this.space(),this.token("="),this.space(),this.print(e.right,e),this.semicolon()}function B(e){this.token(":"),this.space(),e.optional&&this.token("?"),this.print(e.typeAnnotation,e)}function O(e){this._variance(e),this.word(e.name),e.bound&&this.print(e.bound,e),e.default&&(this.space(),this.token("="),this.space(),this.print(e.default,e))}function I(e){this.token("<"),this.printList(e.params,e,{}),this.token(">")}function N(e){var t=this;e.exact?this.token("{|"):this.token("{");var n=e.properties.concat(e.callProperties,e.indexers);n.length&&(this.space(),this.printJoin(n,e,{addNewlines:function(e){if(e&&!n[0])return 1},indent:!0,statement:!0,iterator:function(){1!==n.length&&(t.format.flowCommaSeparator?t.token(","):t.semicolon(),t.space())}}),this.space()),e.exact?this.token("|}"):this.token("}")}function L(e){e.static&&(this.word("static"),this.space()),this.print(e.value,e)}function M(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.token("["),this.print(e.id,e),this.token(":"),this.space(),this.print(e.key,e),this.token("]"),this.token(":"),this.space(),this.print(e.value,e)}function R(e){e.static&&(this.word("static"),this.space()),this._variance(e),this.print(e.key,e),e.optional&&this.token("?"),this.token(":"),this.space(),this.print(e.value,e)}function U(e){this.print(e.qualification,e),this.token("."),this.print(e.id,e)}function V(){this.space(),this.token("|"),this.space()}function G(e){this.printJoin(e.types,e,{separator:V})}function q(e){this.token("("),this.print(e.expression,e),this.print(e.typeAnnotation,e),this.token(")")}function K(){this.word("void")}n.__esModule=!0,n.AnyTypeAnnotation=r,n.ArrayTypeAnnotation=i,n.BooleanTypeAnnotation=a,n.BooleanLiteralTypeAnnotation=s,n.NullLiteralTypeAnnotation=o,n.DeclareClass=u,n.DeclareFunction=l,n.DeclareInterface=c,n.DeclareModule=p,n.DeclareModuleExports=f,n.DeclareTypeAlias=h,n.DeclareVariable=d,n.ExistentialTypeParam=y,n.FunctionTypeAnnotation=m,n.FunctionTypeParam=b,n.InterfaceExtends=g,n._interfaceish=v,n._variance=x,n.InterfaceDeclaration=_,n.IntersectionTypeAnnotation=A,n.MixedTypeAnnotation=D,n.EmptyTypeAnnotation=C,n.NullableTypeAnnotation=S;var X=e("./types");Object.defineProperty(n,"NumericLiteralTypeAnnotation",{enumerable:!0,get:function(){return X.NumericLiteral}}),Object.defineProperty(n,"StringLiteralTypeAnnotation",{enumerable:!0,get:function(){return X.StringLiteral}}),n.NumberTypeAnnotation=w,n.StringTypeAnnotation=k,n.ThisTypeAnnotation=F,n.TupleTypeAnnotation=T,n.TypeofTypeAnnotation=P,n.TypeAlias=j,n.TypeAnnotation=B,n.TypeParameter=O,n.TypeParameterInstantiation=I,n.ObjectTypeAnnotation=N,n.ObjectTypeCallProperty=L,n.ObjectTypeIndexer=M,n.ObjectTypeProperty=R,n.QualifiedTypeIdentifier=U,n.UnionTypeAnnotation=G,n.TypeCastExpression=q,n.VoidTypeAnnotation=K,n.ClassImplements=g,n.GenericTypeAnnotation=g,n.TypeParameterDeclaration=I},{"./types":84}],79:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){this.print(e.name,e),e.value&&(this.token("="),this.print(e.value,e))}function a(e){this.word(e.name)}function s(e){this.print(e.namespace,e),this.token(":"),this.print(e.name,e)}function o(e){this.print(e.object,e),this.token("."),this.print(e.property,e)}function u(e){this.token("{"),this.token("..."),this.print(e.argument,e),this.token("}")}function l(e){this.token("{"),this.print(e.expression,e),this.token("}")}function c(e){this.token("{"),this.token("..."),this.print(e.expression,e),this.token("}")}function p(e){this.token(e.value)}function f(e){var t=e.openingElement;if(this.print(t,e),!t.selfClosing){this.indent();for(var n=e.children,r=Array.isArray(n),i=0,n=r?n:(0,g.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a;this.print(s,e)}this.dedent(),this.print(e.closingElement,e)}}function h(){this.space()}function d(e){this.token("<"),this.print(e.name,e),e.attributes.length>0&&(this.space(),this.printJoin(e.attributes,e,{separator:h})),e.selfClosing?(this.space(),this.token("/>")):this.token(">")}function y(e){this.token("")}function m(){}n.__esModule=!0;var b=e("babel-runtime/core-js/get-iterator"),g=r(b);n.JSXAttribute=i,n.JSXIdentifier=a,n.JSXNamespacedName=s,n.JSXMemberExpression=o,n.JSXSpreadAttribute=u,n.JSXExpressionContainer=l,n.JSXSpreadChild=c,n.JSXText=p,n.JSXElement=f,n.JSXOpeningElement=d,n.JSXClosingElement=y,n.JSXEmptyExpression=m},{"babel-runtime/core-js/get-iterator":100}],80:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){var t=this;this.print(e.typeParameters,e),this.token("("),this.printList(e.params,e,{iterator:function(e){e.optional&&t.token("?"),t.print(e.typeAnnotation,e)}}),this.token(")"),e.returnType&&this.print(e.returnType,e)}function a(e){var t=e.kind,n=e.key;"method"!==t&&"init"!==t||e.generator&&this.token("*"),"get"!==t&&"set"!==t||(this.word(t),this.space()),e.async&&(this.word("async"),this.space()),e.computed?(this.token("["),this.print(n,e),this.token("]")):this.print(n,e),this._params(e),this.space(),this.print(e.body,e)}function s(e){e.async&&(this.word("async"),this.space()),this.word("function"),e.generator&&this.token("*"),e.id?(this.space(),this.print(e.id,e)):this.space(),this._params(e),this.space(),this.print(e.body,e)}function o(e){e.async&&(this.word("async"),this.space());var t=e.params[0];1===e.params.length&&c.isIdentifier(t)&&!u(e,t)?this.print(t,e):this._params(e),this.space(),this.token("=>"),this.space(),this.print(e.body,e)}function u(e,t){return e.typeParameters||e.returnType||t.typeAnnotation||t.optional||t.trailingComments}n.__esModule=!0,n.FunctionDeclaration=void 0,n._params=i,n._method=a,n.FunctionExpression=s,n.ArrowFunctionExpression=o;var l=e("babel-types"),c=r(l);n.FunctionDeclaration=s},{"babel-types":265}],81:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){this.print(e.imported,e),e.local&&e.local.name!==e.imported.name&&(this.space(),this.word("as"),this.space(),this.print(e.local,e))}function a(e){this.print(e.local,e)}function s(e){this.print(e.exported,e)}function o(e){this.print(e.local,e),e.exported&&e.local.name!==e.exported.name&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e))}function u(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.exported,e)}function l(e){this.word("export"),this.space(),this.token("*"),e.exported&&(this.space(),this.word("as"),this.space(),this.print(e.exported,e)),this.space(),this.word("from"),this.space(),this.print(e.source,e),this.semicolon()}function c(){this.word("export"),this.space(),f.apply(this,arguments)}function p(){this.word("export"),this.space(),this.word("default"),this.space(),f.apply(this,arguments)}function f(e){if(e.declaration){var t=e.declaration;this.print(t,e),m.isStatement(t)||this.semicolon()}else{"type"===e.exportKind&&(this.word("type"),this.space());for(var n=e.specifiers.slice(0),r=!1;;){var i=n[0];if(!m.isExportDefaultSpecifier(i)&&!m.isExportNamespaceSpecifier(i))break;r=!0,this.print(n.shift(),e),n.length&&(this.token(","),this.space())}(n.length||!n.length&&!r)&&(this.token("{"),n.length&&(this.space(),this.printList(n,e),this.space()),this.token("}")),e.source&&(this.space(),this.word("from"),this.space(),this.print(e.source,e)),this.semicolon()}}function h(e){this.word("import"),this.space(),"type"!==e.importKind&&"typeof"!==e.importKind||(this.word(e.importKind),this.space());var t=e.specifiers.slice(0);if(t&&t.length){for(;;){var n=t[0];if(!m.isImportDefaultSpecifier(n)&&!m.isImportNamespaceSpecifier(n))break;this.print(t.shift(),e),t.length&&(this.token(","),this.space())}t.length&&(this.token("{"),this.space(),this.printList(t,e),this.space(),this.token("}")),this.space(),this.word("from"),this.space()}this.print(e.source,e),this.semicolon()}function d(e){this.token("*"),this.space(),this.word("as"),this.space(),this.print(e.local,e)}n.__esModule=!0,n.ImportSpecifier=i,n.ImportDefaultSpecifier=a,n.ExportDefaultSpecifier=s,n.ExportSpecifier=o,n.ExportNamespaceSpecifier=u,n.ExportAllDeclaration=l,n.ExportNamedDeclaration=c,n.ExportDefaultDeclaration=p,n.ImportDeclaration=h,n.ImportNamespaceSpecifier=d;var y=e("babel-types"),m=r(y)},{"babel-types":265}],82:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){this.word("with"),this.space(),this.token("("),this.print(e.object,e),this.token(")"),this.printBlock(e)}function s(e){this.word("if"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.space();var t=e.alternate&&C.isIfStatement(o(e.consequent));t&&(this.token("{"),this.newline(),this.indent()),this.printAndIndentOnComments(e.consequent,e),t&&(this.dedent(),this.newline(),this.token("}")),e.alternate&&(this.endsWith("}")&&this.space(),this.word("else"),this.space(),this.printAndIndentOnComments(e.alternate,e))}function o(e){return C.isStatement(e.body)?o(e.body):e}function u(e){this.word("for"),this.space(),this.token("("),this.inForStatementInitCounter++,this.print(e.init,e),this.inForStatementInitCounter--,this.token(";"),e.test&&(this.space(),this.print(e.test,e)),this.token(";"),e.update&&(this.space(),this.print(e.update,e)),this.token(")"),this.printBlock(e)}function l(e){this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.printBlock(e)}function c(e){this.word("do"),this.space(),this.print(e.body,e),this.space(),this.word("while"),this.space(),this.token("("),this.print(e.test,e),this.token(")"),this.semicolon()}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"label";return function(n){this.word(e);var r=n[t];if(r){this.space();var i=this.startTerminatorless();this.print(r,n),this.endTerminatorless(i)}this.semicolon()}}function f(e){this.print(e.label,e),this.token(":"),this.space(),this.print(e.body,e)}function h(e){this.word("try"),this.space(),this.print(e.block,e),this.space(),e.handlers?this.print(e.handlers[0],e):this.print(e.handler,e),e.finalizer&&(this.space(),this.word("finally"),this.space(),this.print(e.finalizer,e))}function d(e){this.word("catch"),this.space(),this.token("("),this.print(e.param,e),this.token(")"),this.space(),this.print(e.body,e)}function y(e){this.word("switch"),this.space(),this.token("("),this.print(e.discriminant,e),this.token(")"),this.space(),this.token("{"),this.printSequence(e.cases,e,{indent:!0,addNewlines:function(t,n){if(!t&&e.cases[e.cases.length-1]===n)return-1}}),this.token("}")}function m(e){e.test?(this.word("case"),this.space(),this.print(e.test,e),this.token(":")):(this.word("default"),this.token(":")),e.consequent.length&&(this.newline(),this.printSequence(e.consequent,e,{indent:!0}))}function b(){this.word("debugger"),this.semicolon()}function g(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<4;e++)this.space(!0)}function v(){if(this.token(","),this.newline(),this.endsWith("\n"))for(var e=0;e<6;e++)this.space(!0)}function x(e,t){this.word(e.kind),this.space();var n=!1;if(!C.isFor(t))for(var r=e.declarations,i=Array.isArray(r),a=0,r=i?r:(0,A.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;o.init&&(n=!0)}var u=void 0;n&&(u="const"===e.kind?v:g),this.printList(e.declarations,e,{separator:u}),(!C.isFor(t)||t.left!==e&&t.init!==e)&&this.semicolon()}function _(e){this.print(e.id,e),this.print(e.id.typeAnnotation,e),e.init&&(this.space(),this.token("="),this.space(),this.print(e.init,e))}n.__esModule=!0,n.ThrowStatement=n.BreakStatement=n.ReturnStatement=n.ContinueStatement=n.ForAwaitStatement=n.ForOfStatement=n.ForInStatement=void 0;var E=e("babel-runtime/core-js/get-iterator"),A=i(E);n.WithStatement=a,n.IfStatement=s,n.ForStatement=u,n.WhileStatement=l,n.DoWhileStatement=c,n.LabeledStatement=f,n.TryStatement=h,n.CatchClause=d,n.SwitchStatement=y,n.SwitchCase=m,n.DebuggerStatement=b,n.VariableDeclaration=x,n.VariableDeclarator=_;var D=e("babel-types"),C=r(D),S=function(e){return function(t){this.word("for"),this.space(),"await"===e&&(this.word("await"),this.space(),e="of"),this.token("("),this.print(t.left,t),this.space(),this.word(e),this.space(),this.print(t.right,t),this.token(")"),this.printBlock(t)}};n.ForInStatement=S("in"),n.ForOfStatement=S("of"),n.ForAwaitStatement=S("await"),n.ContinueStatement=p("continue"),n.ReturnStatement=p("return","argument"),n.BreakStatement=p("break"),n.ThrowStatement=p("throw","argument")},{"babel-runtime/core-js/get-iterator":100,"babel-types":265}],83:[function(e,t,n){"use strict";function r(e){this.print(e.tag,e),this.print(e.quasi,e)}function i(e,t){var n=t.quasis[0]===e,r=t.quasis[t.quasis.length-1]===e,i=(n?"`":"}")+e.value.raw+(r?"`":"${");n||this.space(),this.token(i),r||this.space()}function a(e){for(var t=e.quasis,n=0;n0&&this.space(),this.print(i,e),r=0||e.indexOf("@preserve")>=0},"auto"===a.compact&&(a.compact=e.length>5e5,a.compact&&console.error("[BABEL] "+g.get("codeGeneratorDeopt",t.filename,"500KB"))),a.compact&&(a.indent.adjustMultilineComment=!1),a}function s(e,t){if(!e)return"double";for(var n={single:0,double:0},r=0,i=0;i=3)break}}return n.single>n.double?"single":"double"}n.__esModule=!0,n.CodeGenerator=void 0;var o=e("babel-runtime/helpers/classCallCheck"),u=i(o),l=e("babel-runtime/helpers/possibleConstructorReturn"),c=i(l),p=e("babel-runtime/helpers/inherits"),f=i(p);n.default=function(e,t,n){return new _(e,t,n).generate()};var h=e("detect-indent"),d=i(h),y=e("./source-map"),m=i(y),b=e("babel-messages"),g=r(b),v=e("./printer"),x=i(v),_=function(e){function t(n,r,i){(0,u.default)(this,t),r=r||{};var s=n.tokens||[],o=a(i,r,s),l=r.sourceMaps?new m.default(r,i):null,p=(0,c.default)(this,e.call(this,o,l,s));return p.ast=n,p}return(0,f.default)(t,e),t.prototype.generate=function(){return e.prototype.generate.call(this,this.ast)},t}(x.default);n.CodeGenerator=function(){function e(t,n,r){(0,u.default)(this,e),this._generator=new _(t,n,r)}return e.prototype.generate=function(){return this._generator.generate()},e}()},{"./printer":89,"./source-map":90,"babel-messages":99,"babel-runtime/helpers/classCallCheck":114,"babel-runtime/helpers/inherits":115,"babel-runtime/helpers/possibleConstructorReturn":117,"detect-indent":92}],86:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){function t(e,t){var r=n[e];n[e]=r?function(e,n,i){var a=r(e,n,i);return null==a?t(e,n,i):a}:t}for(var n={},r=(0,y.default)(e),i=Array.isArray(r),a=0,r=i?r:(0,h.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s,u=_.FLIPPED_ALIAS_KEYS[o];if(u)for(var l=u,c=Array.isArray(l),p=0,l=c?l:(0,h.default)(l);;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var d=f;t(d,e[o])}else t(o,e[o])}return n}function s(e,t,n,r){var i=e[t.type];return i?i(t,n,r):null}function o(e){return!!_.isCallExpression(e)||!!_.isMemberExpression(e)&&(o(e.object)||!e.computed&&o(e.property))}function u(e,t,n){if(!e)return 0;_.isExpressionStatement(e)&&(e=e.expression);var r=s(A,e,t);if(!r){var i=s(D,e,t);if(i)for(var a=0;aa)return!0;if(r===a&&t.right===e&&!v.isLogicalExpression(t))return!0}return!1}function u(e,t){if("in"===e.operator){if(v.isVariableDeclarator(t))return!0;if(v.isFor(t))return!0}return!1}function l(e,t){return!v.isForStatement(t)&&((!v.isExpressionStatement(t)||t.expression!==e)&&(!v.isReturnStatement(t)&&(!v.isThrowStatement(t)&&((!v.isSwitchStatement(t)||t.discriminant!==e)&&((!v.isWhileStatement(t)||t.test!==e)&&((!v.isIfStatement(t)||t.test!==e)&&(!v.isForInStatement(t)||t.right!==e)))))))}function c(e,t){return v.isBinary(t)||v.isUnaryLike(t)||v.isCallExpression(t)||v.isMemberExpression(t)||v.isNewExpression(t)||v.isConditionalExpression(t)&&e===t.test}function p(e,t,n){return b(n,{considerDefaultExports:!0})}function f(e,t){return!!v.isMemberExpression(t,{object:e})||!(!v.isCallExpression(t,{callee:e})&&!v.isNewExpression(t,{callee:e}))}function h(e,t,n){return b(n,{considerDefaultExports:!0})}function d(e,t){return!!v.isExportDeclaration(t)||(!(!v.isBinaryExpression(t)&&!v.isLogicalExpression(t))||(!!v.isUnaryExpression(t)||f(e,t)))}function y(e,t){return!!v.isUnaryLike(t)||(!!v.isBinary(t)||(!!v.isConditionalExpression(t,{test:e})||f(e,t)))}function m(e){return!!v.isObjectPattern(e.left)||y.apply(void 0,arguments)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.considerArrow,r=void 0!==n&&n,i=t.considerDefaultExports,a=void 0!==i&&i,s=e.length-1,o=e[s];s--;for(var u=e[s];s>0;){if(v.isExpressionStatement(u,{expression:o}))return!0;if(a&&v.isExportDefaultDeclaration(u,{declaration:o}))return!0;if(r&&v.isArrowFunctionExpression(u,{body:o}))return!0;if(!(v.isCallExpression(u,{callee:o})||v.isSequenceExpression(u)&&u.expressions[0]===o||v.isMemberExpression(u,{object:o})||v.isConditional(u,{test:o})||v.isBinary(u,{left:o})||v.isAssignmentExpression(u,{left:o})))return!1;o=u,s--,u=e[s]}return!1}n.__esModule=!0,n.AwaitExpression=n.FunctionTypeAnnotation=void 0,n.NullableTypeAnnotation=i,n.UpdateExpression=a,n.ObjectExpression=s,n.Binary=o,n.BinaryExpression=u,n.SequenceExpression=l,n.YieldExpression=c,n.ClassExpression=p,n.UnaryLike=f,n.FunctionExpression=h,n.ArrowFunctionExpression=d,n.ConditionalExpression=y,n.AssignmentExpression=m;var g=e("babel-types"),v=r(g),x={"||":0,"&&":1,"|":2,"^":3,"&":4,"==":5,"===":5,"!=":5,"!==":5,"<":6,">":6,"<=":6,">=":6,in:6,instanceof:6,">>":7,"<<":7,">>>":7,"+":8,"-":8,"*":9,"/":9,"%":9,"**":10};n.FunctionTypeAnnotation=i,n.AwaitExpression=c},{"babel-types":265}],88:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y.isMemberExpression(e)?(a(e.object,t),e.computed&&a(e.property,t)):y.isBinary(e)||y.isAssignmentExpression(e)?(a(e.left,t),a(e.right,t)):y.isCallExpression(e)?(t.hasCall=!0,a(e.callee,t)):y.isFunction(e)?t.hasFunction=!0:y.isIdentifier(e)&&(t.hasHelper=t.hasHelper||s(e.callee)),t}function s(e){return y.isMemberExpression(e)?s(e.object)||s(e.property):y.isIdentifier(e)?"require"===e.name||"_"===e.name[0]:y.isCallExpression(e)?s(e.callee):!(!y.isBinary(e)&&!y.isAssignmentExpression(e))&&(y.isIdentifier(e.left)&&s(e.left)||s(e.right))}function o(e){return y.isLiteral(e)||y.isObjectExpression(e)||y.isArrayExpression(e)||y.isIdentifier(e)||y.isMemberExpression(e)}var u=e("lodash/isBoolean"),l=i(u),c=e("lodash/each"),p=i(c),f=e("lodash/map"),h=i(f),d=e("babel-types"),y=r(d);n.nodes={AssignmentExpression:function(e){var t=a(e.right);if(t.hasCall&&t.hasHelper||t.hasFunction)return{before:t.hasFunction,after:!0}},SwitchCase:function(e,t){return{before:e.consequent.length||t.cases[0]===e}},LogicalExpression:function(e){if(y.isFunction(e.left)||y.isFunction(e.right))return{after:!0}},Literal:function(e){if("use strict"===e.value)return{after:!0}},CallExpression:function(e){if(y.isFunction(e.callee)||s(e))return{before:!0,after:!0}},VariableDeclaration:function(e){for(var t=0;t0?new F.default(r):null}return e.prototype.generate=function(e){return this.print(e),this._maybeAddAuxComment(),this._buf.get()},e.prototype.indent=function(){this.format.compact||this.format.concise||this._indent++},e.prototype.dedent=function(){this.format.compact||this.format.concise||this._indent--},e.prototype.semicolon=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._maybeAddAuxComment(),this._append(";",!e)},e.prototype.rightBrace=function(){this.format.minified&&this._buf.removeLastSemicolon(),this.token("}")},e.prototype.space=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.format.compact||(this._buf.hasContent()&&!this.endsWith(" ")&&!this.endsWith("\n")||e)&&this._space()},e.prototype.word=function(e){this._endsWithWord&&this._space(),this._maybeAddAuxComment(),this._append(e),this._endsWithWord=!0},e.prototype.number=function(e){this.word(e),this._endsWithInteger=(0,_.default)(+e)&&!O.test(e)&&!j.test(e)&&!B.test(e)&&"."!==e[e.length-1]},e.prototype.token=function(e){("--"===e&&this.endsWith("!")||"+"===e[0]&&this.endsWith("+")||"-"===e[0]&&this.endsWith("-")||"."===e[0]&&this._endsWithInteger)&&this._space(),this._maybeAddAuxComment(),this._append(e)},e.prototype.newline=function(e){if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();if(!(this.endsWith("\n\n")||("number"!=typeof e&&(e=1),e=Math.min(2,e),(this.endsWith("{\n")||this.endsWith(":\n"))&&e--,e<=0)))for(var t=0;t1&&void 0!==arguments[1]&&arguments[1];this._maybeAddParen(e),this._maybeIndent(e),t?this._buf.queue(e):this._buf.append(e),this._endsWithWord=!1,this._endsWithInteger=!1},e.prototype._maybeIndent=function(e){this._indent&&this.endsWith("\n")&&"\n"!==e[0]&&this._buf.queue(this._getIndent())},e.prototype._maybeAddParen=function(e){var t=this._parenPushNewlineState;if(t){this._parenPushNewlineState=null;var n=void 0;for(n=0;n2&&void 0!==arguments[2]?arguments[2]:{};if(e&&e.length){n.indent&&this.indent();for(var r={addNewlines:n.addNewlines},i=0;i1&&void 0!==arguments[1])||arguments[1];e.innerComments&&(t&&this.indent(),this._printComments(e.innerComments),t&&this.dedent())},e.prototype.printSequence=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.statement=!0,this.printJoin(e,t,n)},e.prototype.printList=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return null==n.separator&&(n.separator=a),this.printJoin(e,t,n)},e.prototype._printNewline=function(e,t,n,r){var i=this;if(!this.format.retainLines&&!this.format.compact){if(this.format.concise)return void this.space();var a=0;if(null!=t.start&&!t._ignoreUserWhitespace&&this._whitespace)if(e){var s=t.leadingComments,o=s&&(0,b.default)(s,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});a=this._whitespace.getNewlinesBefore(o||t)}else{var u=t.trailingComments,l=u&&(0,v.default)(u,function(e){return!!e.loc&&i.format.shouldPrintComment(e.value)});a=this._whitespace.getNewlinesAfter(l||t)}else{e||a++,r.addNewlines&&(a+=r.addNewlines(e,t)||0);var c=w.needsWhitespaceAfter;e&&(c=w.needsWhitespaceBefore),c(t,n)&&a++,this._buf.hasContent()||(a=0)}this.newline(a)}},e.prototype._getComments=function(e,t){return t&&(e?t.leadingComments:t.trailingComments)||[]},e.prototype._printComment=function(e){var t=this;if(this.format.shouldPrintComment(e.value)&&!e.ignore&&!this._printedComments.has(e)){if(this._printedComments.add(e),null!=e.start){if(this._printedCommentStarts[e.start])return;this._printedCommentStarts[e.start]=!0}this.newline(this._whitespace?this._whitespace.getNewlinesBefore(e):0),this.endsWith("[")||this.endsWith("{")||this.space();var n="CommentLine"===e.type?"//"+e.value+"\n":"/*"+e.value+"*/";if("CommentBlock"===e.type&&this.format.indent.adjustMultilineComment){var r=e.loc&&e.loc.start.column;if(r){var i=new RegExp("\\n\\s{1,"+r+"}","g");n=n.replace(i,"\n")}var a=Math.max(this._getIndent().length,this._buf.getCurrentColumn());n=n.replace(/\n(?!$)/g,"\n"+(0,A.default)(" ",a))}this.withSource("start",e.loc,function(){t._append(n)}),this.newline((this._whitespace?this._whitespace.getNewlinesAfter(e):0)+("CommentLine"===e.type?-1:0))}},e.prototype._printComments=function(e){if(e&&e.length)for(var t=e,n=Array.isArray(t),r=0,t=n?t:(0,l.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i;this._printComment(a)}},e}();n.default=I;for(var N=[e("./generators/template-literals"),e("./generators/expressions"),e("./generators/statements"),e("./generators/classes"),e("./generators/methods"),e("./generators/modules"),e("./generators/types"),e("./generators/flow"),e("./generators/base"),e("./generators/jsx")],L=0;L=0){for(;i&&e.start===r[i-1].start;)--i;t=r[i-1],n=r[i]}return this._getNewlinesBetween(t,n)},e.prototype.getNewlinesAfter=function(e){var t=void 0,n=void 0,r=this.tokens,i=this._findToken(function(t){return t.end-e.end},0,r.length);if(i>=0){for(;i&&e.end===r[i-1].end;)--i;t=r[i],n=r[i+1],","===n.type.label&&(n=r[i+2])}return n&&"eof"===n.type.label?1:this._getNewlinesBetween(t,n)},e.prototype._getNewlinesBetween=function(e,t){if(!t||!t.loc)return 0;for(var n=e?e.loc.end.line:1,r=t.loc.start.line,i=0,a=n;a=n)return-1;var r=t+n>>>1,i=e(this.tokens[r]);return i<0?this._findToken(e,r+1,n):i>0?this._findToken(e,t,r):0===i?r:-1},e}();n.default=s,t.exports=n.default},{"babel-runtime/helpers/classCallCheck":114}],92:[function(e,t,n){"use strict";function r(e){var t=0,n=0,r=0;for(var i in e){var a=e[i],s=a[0],o=a[1];(s>n||s===n&&o>r)&&(n=s,r=o,t=Number(i))}return t}var i=e("repeating"),a=/^(?:( )+|\t+)/;t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected a string");var t,n,s=0,o=0,u=0,l={};e.split(/\n/g).forEach(function(e){if(e){var r,i=e.match(a);i?(r=i[0].length,i[1]?o++:s++):r=0;var c=r-u;u=r,c?(n=c>0,t=l[n?c:-c],t?t[0]++:t=l[c]=[1,0]):t&&(t[1]+=Number(n))}});var c,p,f=r(l);return f?o>=s?(c="space",p=i(" ",f)):(c="tab",p=i("\t",f)):(c=null,p=""),{amount:f,type:c,indent:p}}},{repeating:93}],93:[function(e,t,n){"use strict";var r=e("is-finite");t.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected `input` to be a string");if(t<0||!r(t))throw new TypeError("Expected `count` to be a positive finite number");var n="";do 1&t&&(n+=e),e+=e;while(t>>=1);return n}},{"is-finite":94}],94:[function(e,t,n){"use strict";var r=e("number-is-nan");t.exports=Number.isFinite||function(e){return!("number"!=typeof e||r(e)||e===1/0||e===-(1/0))}},{"number-is-nan":95}],95:[function(e,t,n){"use strict";t.exports=Number.isNaN||function(e){return e!==e}},{}],96:[function(e,t,n){(function(e){!function(r){var i="object"==typeof n&&n,a="object"==typeof t&&t&&t.exports==i&&t,s="object"==typeof e&&e;s.global!==s&&s.window!==s||(r=s);var o={},u=o.hasOwnProperty,l=function(e,t){var n;for(n in e)u.call(e,n)&&t(n,e[n])},c=function(e,t){return t?(l(t,function(t,n){e[t]=n}),e):e},p=function(e,t){for(var n=e.length,r=-1;++r=55296&&O<=56319&&R>M+1&&(I=L.charCodeAt(M+1),I>=56320&&I<=57343))){N=1024*(O-55296)+I-56320+65536;var V=N.toString(16);u||(V=V.toUpperCase()),i+="\\u{"+V+"}",M++}else{if(!t.escapeEverything){if(A.test(U)){i+=U;continue}if('"'==U){i+=a==U?'\\"':U;continue}if("'"==U){i+=a==U?"\\'":U;continue}}if("\0"!=U||r||E.test(L.charAt(M+1)))if(_.test(U))i+=x[U];else{var G=U.charCodeAt(0),V=G.toString(16);u||(V=V.toUpperCase());var q=V.length>2||r,K="\\"+(q?"u":"x")+("0000"+V).slice(q?-4:-2);i+=K}else i+="\\0"}}return t.wrap&&(i=a+i+a),t.escapeEtago?i.replace(/<\/(script|style)/gi,"<\\/$1"):i};D.version="1.3.0","function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return D}):i&&!i.nodeType?a?a.exports=D:i.jsesc=D:r.jsesc=D}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],97:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-template"),a=r(i),s={};n.default=s,s.typeof=(0,a.default)('\n (typeof Symbol === "function" && typeof Symbol.iterator === "symbol")\n ? function (obj) { return typeof obj; }\n : function (obj) {\n return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype\n ? "symbol"\n : typeof obj;\n };\n'),s.jsx=(0,a.default)('\n (function () {\n var REACT_ELEMENT_TYPE = (typeof Symbol === "function" && Symbol.for && Symbol.for("react.element")) || 0xeac7;\n\n return function createRawReactElement (type, props, key, children) {\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n // If we\'re going to assign props.children, we create a new object now\n // to avoid mutating defaultProps.\n props = {};\n }\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : \'\' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n };\n\n })()\n'),s.asyncIterator=(0,a.default)('\n (function (iterable) {\n if (typeof Symbol === "function") {\n if (Symbol.asyncIterator) {\n var method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n if (Symbol.iterator) {\n return iterable[Symbol.iterator]();\n }\n }\n throw new TypeError("Object is not async iterable");\n })\n'),s.asyncGenerator=(0,a.default)('\n (function () {\n function AwaitValue(value) {\n this.value = value;\n }\n\n function AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function (resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg)\n var value = result.value;\n if (value instanceof AwaitValue) {\n Promise.resolve(value.value).then(\n function (arg) { resume("next", arg); },\n function (arg) { resume("throw", arg); });\n } else {\n settle(result.done ? "return" : "normal", result.value);\n }\n } catch (err) {\n settle("throw", err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case "return":\n front.resolve({ value: value, done: true });\n break;\n case "throw":\n front.reject(value);\n break;\n default:\n front.resolve({ value: value, done: false });\n break;\n }\n\n front = front.next;\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n // Hide "return" method if generator return is not supported\n if (typeof gen.return !== "function") {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === "function" && Symbol.asyncIterator) {\n AsyncGenerator.prototype[Symbol.asyncIterator] = function () { return this; };\n }\n\n AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); };\n AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); };\n AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };\n\n return {\n wrap: function (fn) {\n return function () {\n return new AsyncGenerator(fn.apply(this, arguments));\n };\n },\n await: function (value) {\n return new AwaitValue(value);\n }\n };\n\n })()\n'),s.asyncGeneratorDelegate=(0,a.default)('\n (function (inner, awaitWrap) {\n var iter = {}, waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function (resolve) { resolve(inner[key](value)); });\n return { done: false, value: awaitWrap(value) };\n };\n\n if (typeof Symbol === "function" && Symbol.iterator) {\n iter[Symbol.iterator] = function () { return this; };\n }\n\n iter.next = function (value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n return pump("next", value);\n };\n\n if (typeof inner.throw === "function") {\n iter.throw = function (value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n return pump("throw", value);\n };\n }\n\n if (typeof inner.return === "function") {\n iter.return = function (value) {\n return pump("return", value);\n };\n }\n\n return iter;\n })\n'),s.asyncToGenerator=(0,a.default)('\n (function (fn) {\n return function () {\n var gen = fn.apply(this, arguments);\n return new Promise(function (resolve, reject) {\n function step(key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n return Promise.resolve(value).then(function (value) {\n step("next", value);\n }, function (err) {\n step("throw", err);\n });\n }\n }\n\n return step("next");\n });\n };\n })\n'),s.classCallCheck=(0,a.default)('\n (function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n });\n'),s.createClass=(0,a.default)('\n (function() {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i ++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n })()\n'),s.defineEnumerableProperties=(0,a.default)('\n (function (obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if ("value" in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n return obj;\n })\n'),s.defaults=(0,a.default)("\n (function (obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n return obj;\n })\n"),s.defineProperty=(0,a.default)("\n (function (obj, key, value) {\n // Shortcircuit the slow defineProperty path when possible.\n // We are trying to avoid issues where setters defined on the\n // prototype cause side effects under the fast path of simple\n // assignment. By checking for existence of the property with\n // the in operator, we can optimize most of this overhead away.\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n });\n"),s.extends=(0,a.default)("\n Object.assign || (function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n })\n"),s.get=(0,a.default)('\n (function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n });\n'),s.inherits=(0,a.default)('\n (function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n })\n'),s.instanceof=(0,a.default)('\n (function (left, right) {\n if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n });\n'),s.interopRequireDefault=(0,a.default)("\n (function (obj) {\n return obj && obj.__esModule ? obj : { default: obj };\n })\n"),s.interopRequireWildcard=(0,a.default)("\n (function (obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];\n }\n }\n newObj.default = obj;\n return newObj;\n }\n })\n"),s.newArrowCheck=(0,a.default)('\n (function (innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError("Cannot instantiate an arrow function");\n }\n });\n'),s.objectDestructuringEmpty=(0,a.default)('\n (function (obj) {\n if (obj == null) throw new TypeError("Cannot destructure undefined");\n });\n'),s.objectWithoutProperties=(0,a.default)("\n (function (obj, keys) {\n var target = {};\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n return target;\n })\n"),s.possibleConstructorReturn=(0,a.default)('\n (function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n return call && (typeof call === "object" || typeof call === "function") ? call : self;\n });\n'),s.selfGlobal=(0,a.default)('\n typeof global === "undefined" ? self : global\n'),s.set=(0,a.default)('\n (function set(object, property, value, receiver) {\n var desc = Object.getOwnPropertyDescriptor(object, property);\n\n if (desc === undefined) {\n var parent = Object.getPrototypeOf(object);\n\n if (parent !== null) {\n set(parent, property, value, receiver);\n }\n } else if ("value" in desc && desc.writable) {\n desc.value = value;\n } else {\n var setter = desc.set;\n\n if (setter !== undefined) {\n setter.call(receiver, value);\n }\n }\n\n return value;\n });\n'),s.slicedToArray=(0,a.default)('\n (function () {\n // Broken out into a separate function to avoid deoptimizations due to the try/catch for the\n // array iterator case.\n function sliceIterator(arr, i) {\n // this is an expanded form of `for...of` that properly supports abrupt completions of\n // iterators etc. variable names have been minimised to reduce the size of this massive\n // helper. sometimes spec compliancy is annoying :(\n //\n // _n = _iteratorNormalCompletion\n // _d = _didIteratorError\n // _e = _iteratorError\n // _i = _iterator\n // _s = _step\n\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i["return"]) _i["return"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n };\n })();\n'),s.slicedToArrayLoose=(0,a.default)('\n (function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n var _arr = [];\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {\n _arr.push(_step.value);\n if (i && _arr.length === i) break;\n }\n return _arr;\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n });\n'), +s.taggedTemplateLiteral=(0,a.default)("\n (function (strings, raw) {\n return Object.freeze(Object.defineProperties(strings, {\n raw: { value: Object.freeze(raw) }\n }));\n });\n"),s.taggedTemplateLiteralLoose=(0,a.default)("\n (function (strings, raw) {\n strings.raw = raw;\n return strings;\n });\n"),s.temporalRef=(0,a.default)('\n (function (val, name, undef) {\n if (val === undef) {\n throw new ReferenceError(name + " is not defined - temporal dead zone");\n } else {\n return val;\n }\n })\n'),s.temporalUndefined=(0,a.default)("\n ({})\n"),s.toArray=(0,a.default)("\n (function (arr) {\n return Array.isArray(arr) ? arr : Array.from(arr);\n });\n"),s.toConsumableArray=(0,a.default)("\n (function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n return arr2;\n } else {\n return Array.from(arr);\n }\n });\n"),t.exports=n.default},{"babel-template":225}],98:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=u.default[e];if(!t)throw new ReferenceError("Unknown helper "+e);return t().expression}n.__esModule=!0,n.list=void 0;var a=e("babel-runtime/core-js/object/keys"),s=r(a);n.get=i;var o=e("./helpers"),u=r(o);n.list=(0,s.default)(u.default).map(function(e){return"_"===e[0]?e.slice(1):e}).filter(function(e){return"__esModule"!==e});n.default=i},{"./helpers":97,"babel-runtime/core-js/object/keys":107}],99:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},{}],117:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("../helpers/typeof"),a=r(i);n.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,a.default)(t))&&"function"!=typeof t?e:t}},{"../helpers/typeof":118}],118:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("../core-js/symbol/iterator"),a=r(i),s=e("../core-js/symbol"),o=r(s),u="function"==typeof o.default&&"symbol"==typeof a.default?function(e){return typeof e}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":typeof e};n.default="function"==typeof o.default&&"symbol"===u(a.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof o.default&&e.constructor===o.default&&e!==o.default.prototype?"symbol":void 0===e?"undefined":u(e)}},{"../core-js/symbol":109,"../core-js/symbol/iterator":111}],119:[function(e,t,n){e("../modules/web.dom.iterable"),e("../modules/es6.string.iterator"),t.exports=e("../modules/core.get-iterator")},{"../modules/core.get-iterator":208,"../modules/es6.string.iterator":217,"../modules/web.dom.iterable":224}],120:[function(e,t,n){var r=e("../../modules/_core"),i=r.JSON||(r.JSON={stringify:JSON.stringify});t.exports=function(e){return i.stringify.apply(i,arguments)}},{"../../modules/_core":148}],121:[function(e,t,n){e("../modules/es6.object.to-string"),e("../modules/es6.string.iterator"),e("../modules/web.dom.iterable"),e("../modules/es6.map"),e("../modules/es7.map.to-json"),t.exports=e("../modules/_core").Map},{"../modules/_core":148,"../modules/es6.map":210,"../modules/es6.object.to-string":216,"../modules/es6.string.iterator":217,"../modules/es7.map.to-json":221,"../modules/web.dom.iterable":224}],122:[function(e,t,n){e("../../modules/es6.number.max-safe-integer"),t.exports=9007199254740991},{"../../modules/es6.number.max-safe-integer":211}],123:[function(e,t,n){e("../../modules/es6.object.assign"),t.exports=e("../../modules/_core").Object.assign},{"../../modules/_core":148,"../../modules/es6.object.assign":212}],124:[function(e,t,n){e("../../modules/es6.object.create");var r=e("../../modules/_core").Object;t.exports=function(e,t){return r.create(e,t)}},{"../../modules/_core":148,"../../modules/es6.object.create":213}],125:[function(e,t,n){e("../../modules/es6.symbol"),t.exports=e("../../modules/_core").Object.getOwnPropertySymbols},{"../../modules/_core":148,"../../modules/es6.symbol":218}],126:[function(e,t,n){e("../../modules/es6.object.keys"),t.exports=e("../../modules/_core").Object.keys},{"../../modules/_core":148,"../../modules/es6.object.keys":214}],127:[function(e,t,n){e("../../modules/es6.object.set-prototype-of"),t.exports=e("../../modules/_core").Object.setPrototypeOf},{"../../modules/_core":148,"../../modules/es6.object.set-prototype-of":215}],128:[function(e,t,n){e("../../modules/es6.symbol"),t.exports=e("../../modules/_core").Symbol.for},{"../../modules/_core":148,"../../modules/es6.symbol":218}],129:[function(e,t,n){e("../../modules/es6.symbol"),e("../../modules/es6.object.to-string"),e("../../modules/es7.symbol.async-iterator"),e("../../modules/es7.symbol.observable"),t.exports=e("../../modules/_core").Symbol},{"../../modules/_core":148,"../../modules/es6.object.to-string":216,"../../modules/es6.symbol":218,"../../modules/es7.symbol.async-iterator":222,"../../modules/es7.symbol.observable":223}],130:[function(e,t,n){e("../../modules/es6.string.iterator"),e("../../modules/web.dom.iterable"),t.exports=e("../../modules/_wks-ext").f("iterator")},{"../../modules/_wks-ext":205,"../../modules/es6.string.iterator":217,"../../modules/web.dom.iterable":224}],131:[function(e,t,n){e("../modules/es6.object.to-string"),e("../modules/web.dom.iterable"),e("../modules/es6.weak-map"),t.exports=e("../modules/_core").WeakMap},{"../modules/_core":148,"../modules/es6.object.to-string":216,"../modules/es6.weak-map":219,"../modules/web.dom.iterable":224}],132:[function(e,t,n){e("../modules/es6.object.to-string"),e("../modules/web.dom.iterable"),e("../modules/es6.weak-set"),t.exports=e("../modules/_core").WeakSet},{"../modules/_core":148,"../modules/es6.object.to-string":216,"../modules/es6.weak-set":220,"../modules/web.dom.iterable":224}],133:[function(e,t,n){t.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},{}],134:[function(e,t,n){t.exports=function(){}},{}],135:[function(e,t,n){t.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},{}],136:[function(e,t,n){var r=e("./_is-object");t.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},{"./_is-object":166}],137:[function(e,t,n){var r=e("./_for-of");t.exports=function(e,t){var n=[];return r(e,!1,n.push,n,t),n}},{"./_for-of":157}],138:[function(e,t,n){var r=e("./_to-iobject"),i=e("./_to-length"),a=e("./_to-index");t.exports=function(e){return function(t,n,s){var o,u=r(t),l=i(u.length),c=a(s,l);if(e&&n!=n){for(;l>c;)if(o=u[c++],o!=o)return!0}else for(;l>c;c++)if((e||c in u)&&u[c]===n)return e||c||0;return!e&&-1}}},{"./_to-index":197,"./_to-iobject":199,"./_to-length":200}],139:[function(e,t,n){var r=e("./_ctx"),i=e("./_iobject"),a=e("./_to-object"),s=e("./_to-length"),o=e("./_array-species-create");t.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,h=t||o;return function(t,o,d){for(var y,m,b=a(t),g=i(b),v=r(o,d,3),x=s(g.length),_=0,E=n?h(t,x):u?h(t,0):void 0;x>_;_++)if((f||_ in g)&&(y=g[_],m=v(y,_,b),e))if(n)E[_]=m;else if(m)switch(e){case 3:return!0;case 5:return y;case 6:return _;case 2:E.push(y)}else if(c)return!1;return p?-1:l||c?c:E}}},{"./_array-species-create":141,"./_ctx":149,"./_iobject":163,"./_to-length":200,"./_to-object":201}],140:[function(e,t,n){var r=e("./_is-object"),i=e("./_is-array"),a=e("./_wks")("species");t.exports=function(e){var t;return i(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!i(t.prototype)||(t=void 0),r(t)&&(t=t[a],null===t&&(t=void 0))),void 0===t?Array:t}},{"./_is-array":165,"./_is-object":166,"./_wks":206}],141:[function(e,t,n){var r=e("./_array-species-constructor");t.exports=function(e,t){return new(r(e))(t)}},{"./_array-species-constructor":140}],142:[function(e,t,n){var r=e("./_cof"),i=e("./_wks")("toStringTag"),a="Arguments"==r(function(){return arguments}()),s=function(e,t){try{return e[t]}catch(e){}};t.exports=function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=s(t=Object(e),i))?n:a?r(t):"Object"==(o=r(t))&&"function"==typeof t.callee?"Arguments":o}},{"./_cof":143,"./_wks":206}],143:[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],144:[function(e,t,n){"use strict";var r=e("./_object-dp").f,i=e("./_object-create"),a=e("./_redefine-all"),s=e("./_ctx"),o=e("./_an-instance"),u=e("./_defined"),l=e("./_for-of"),c=e("./_iter-define"),p=e("./_iter-step"),f=e("./_set-species"),h=e("./_descriptors"),d=e("./_meta").fastKey,y=h?"_s":"size",m=function(e,t){var n,r=d(t);if("F"!==r)return e._i[r];for(n=e._f;n;n=n.n)if(n.k==t)return n};t.exports={getConstructor:function(e,t,n,c){var p=e(function(e,r){o(e,p,t,"_i"),e._i=i(null),e._f=void 0,e._l=void 0,e[y]=0,void 0!=r&&l(r,n,e[c],e)});return a(p.prototype,{clear:function(){for(var e=this,t=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete t[n.i];e._f=e._l=void 0,e[y]=0},delete:function(e){var t=this,n=m(t,e);if(n){var r=n.n,i=n.p;delete t._i[n.i],n.r=!0,i&&(i.n=r),r&&(r.p=i),t._f==n&&(t._f=r),t._l==n&&(t._l=i),t[y]--}return!!n},forEach:function(e){o(this,p,"forEach");for(var t,n=s(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(n(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!m(this,e)}}),h&&r(p.prototype,"size",{get:function(){return u(this[y])}}),p},def:function(e,t,n){var r,i,a=m(e,t);return a?a.v=n:(e._l=a={i:i=d(t,!0),k:t,v:n,p:r=e._l,n:void 0,r:!1},e._f||(e._f=a),r&&(r.n=a),e[y]++,"F"!==i&&(e._i[i]=a)),e},getEntry:m,setStrong:function(e,t,n){c(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?"keys"==t?p(0,n.k):"values"==t?p(0,n.v):p(0,[n.k,n.v]):(e._t=void 0,p(1))},n?"entries":"values",!n,!0),f(t)}}},{"./_an-instance":135,"./_ctx":149,"./_defined":150,"./_descriptors":151,"./_for-of":157,"./_iter-define":169,"./_iter-step":170,"./_meta":174,"./_object-create":176,"./_object-dp":177,"./_redefine-all":189,"./_set-species":192}],145:[function(e,t,n){var r=e("./_classof"),i=e("./_array-from-iterable");t.exports=function(e){return function(){if(r(this)!=e)throw TypeError(e+"#toJSON isn't generic");return i(this)}}},{"./_array-from-iterable":137,"./_classof":142}],146:[function(e,t,n){"use strict";var r=e("./_redefine-all"),i=e("./_meta").getWeak,a=e("./_an-object"),s=e("./_is-object"),o=e("./_an-instance"),u=e("./_for-of"),l=e("./_array-methods"),c=e("./_has"),p=l(5),f=l(6),h=0,d=function(e){return e._l||(e._l=new y)},y=function(){this.a=[]},m=function(e,t){return p(e.a,function(e){return e[0]===t})};y.prototype={get:function(e){var t=m(this,e);if(t)return t[1]},has:function(e){return!!m(this,e)},set:function(e,t){var n=m(this,e);n?n[1]=t:this.a.push([e,t])},delete:function(e){var t=f(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},t.exports={getConstructor:function(e,t,n,a){var l=e(function(e,r){o(e,l,t,"_i"),e._i=h++,e._l=void 0,void 0!=r&&u(r,n,e[a],e)});return r(l.prototype,{delete:function(e){if(!s(e))return!1;var t=i(e);return t===!0?d(this).delete(e):t&&c(t,this._i)&&delete t[this._i]},has:function(e){if(!s(e))return!1;var t=i(e);return t===!0?d(this).has(e):t&&c(t,this._i)}}),l},def:function(e,t,n){var r=i(a(t),!0);return r===!0?d(e).set(t,n):r[e._i]=n,e},ufstore:d}},{"./_an-instance":135,"./_an-object":136,"./_array-methods":139,"./_for-of":157,"./_has":159,"./_is-object":166,"./_meta":174,"./_redefine-all":189}],147:[function(e,t,n){"use strict";var r=e("./_global"),i=e("./_export"),a=e("./_meta"),s=e("./_fails"),o=e("./_hide"),u=e("./_redefine-all"),l=e("./_for-of"),c=e("./_an-instance"),p=e("./_is-object"),f=e("./_set-to-string-tag"),h=e("./_object-dp").f,d=e("./_array-methods")(0),y=e("./_descriptors");t.exports=function(e,t,n,m,b,g){var v=r[e],x=v,_=b?"set":"add",E=x&&x.prototype,A={};return y&&"function"==typeof x&&(g||E.forEach&&!s(function(){(new x).entries().next()}))?(x=t(function(t,n){c(t,x,e,"_c"),t._c=new v,void 0!=n&&l(n,b,t[_],t)}),d("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(e){var t="add"==e||"set"==e;e in E&&(!g||"clear"!=e)&&o(x.prototype,e,function(n,r){if(c(this,x,e),!t&&g&&!p(n))return"get"==e&&void 0;var i=this._c[e](0===n?0:n,r);return t?this:i})}),"size"in E&&h(x.prototype,"size",{get:function(){return this._c.size}})):(x=m.getConstructor(t,e,b,_),u(x.prototype,n),a.NEED=!0),f(x,e),A[e]=x,i(i.G+i.W+i.F,A),g||m.setStrong(x,e,b),x}},{"./_an-instance":135,"./_array-methods":139,"./_descriptors":151,"./_export":155,"./_fails":156,"./_for-of":157,"./_global":158,"./_hide":160,"./_is-object":166,"./_meta":174,"./_object-dp":177,"./_redefine-all":189,"./_set-to-string-tag":193}],148:[function(e,t,n){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},{}],149:[function(e,t,n){var r=e("./_a-function");t.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":133}],150:[function(e,t,n){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],151:[function(e,t,n){t.exports=!e("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":156}],152:[function(e,t,n){var r=e("./_is-object"),i=e("./_global").document,a=r(i)&&r(i.createElement);t.exports=function(e){return a?i.createElement(e):{}}},{"./_global":158,"./_is-object":166}],153:[function(e,t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],154:[function(e,t,n){var r=e("./_object-keys"),i=e("./_object-gops"),a=e("./_object-pie");t.exports=function(e){var t=r(e),n=i.f;if(n)for(var s,o=n(e),u=a.f,l=0;o.length>l;)u.call(e,s=o[l++])&&t.push(s);return t}},{"./_object-gops":182,"./_object-keys":185,"./_object-pie":186}],155:[function(e,t,n){var r=e("./_global"),i=e("./_core"),a=e("./_ctx"),s=e("./_hide"),o="prototype",u=function(e,t,n){var l,c,p,f=e&u.F,h=e&u.G,d=e&u.S,y=e&u.P,m=e&u.B,b=e&u.W,g=h?i:i[t]||(i[t]={}),v=g[o],x=h?r:d?r[t]:(r[t]||{})[o];h&&(n=t);for(l in n)c=!f&&x&&void 0!==x[l],c&&l in g||(p=c?x[l]:n[l],g[l]=h&&"function"!=typeof x[l]?n[l]:m&&c?a(p,r):b&&x[l]==p?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[o]=e[o],t}(p):y&&"function"==typeof p?a(Function.call,p):p,y&&((g.virtual||(g.virtual={}))[l]=p,e&u.R&&v&&!v[l]&&s(v,l,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},{"./_core":148,"./_ctx":149,"./_global":158,"./_hide":160}],156:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],157:[function(e,t,n){var r=e("./_ctx"),i=e("./_iter-call"),a=e("./_is-array-iter"),s=e("./_an-object"),o=e("./_to-length"),u=e("./core.get-iterator-method"),l={},c={},n=t.exports=function(e,t,n,p,f){var h,d,y,m,b=f?function(){return e}:u(e),g=r(n,p,t?2:1),v=0;if("function"!=typeof b)throw TypeError(e+" is not iterable!");if(a(b)){for(h=o(e.length);h>v;v++)if(m=t?g(s(d=e[v])[0],d[1]):g(e[v]),m===l||m===c)return m}else for(y=b.call(e);!(d=y.next()).done;)if(m=i(y,g,d.value,t),m===l||m===c)return m};n.BREAK=l,n.RETURN=c},{"./_an-object":136,"./_ctx":149,"./_is-array-iter":164,"./_iter-call":167,"./_to-length":200,"./core.get-iterator-method":207}],158:[function(e,t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},{}],159:[function(e,t,n){var r={}.hasOwnProperty;t.exports=function(e,t){return r.call(e,t)}},{}],160:[function(e,t,n){var r=e("./_object-dp"),i=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},{"./_descriptors":151,"./_object-dp":177,"./_property-desc":188}],161:[function(e,t,n){t.exports=e("./_global").document&&document.documentElement},{"./_global":158}],162:[function(e,t,n){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return 7!=Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":151,"./_dom-create":152,"./_fails":156}],163:[function(e,t,n){var r=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},{"./_cof":143}],164:[function(e,t,n){var r=e("./_iterators"),i=e("./_wks")("iterator"),a=Array.prototype;t.exports=function(e){return void 0!==e&&(r.Array===e||a[i]===e)}},{"./_iterators":171,"./_wks":206}],165:[function(e,t,n){var r=e("./_cof");t.exports=Array.isArray||function(e){return"Array"==r(e)}},{"./_cof":143}],166:[function(e,t,n){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],167:[function(e,t,n){var r=e("./_an-object");t.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},{"./_an-object":136}],168:[function(e,t,n){"use strict";var r=e("./_object-create"),i=e("./_property-desc"),a=e("./_set-to-string-tag"),s={};e("./_hide")(s,e("./_wks")("iterator"),function(){return this}),t.exports=function(e,t,n){e.prototype=r(s,{next:i(1,n)}),a(e,t+" Iterator")}},{"./_hide":160,"./_object-create":176,"./_property-desc":188,"./_set-to-string-tag":193,"./_wks":206}],169:[function(e,t,n){"use strict";var r=e("./_library"),i=e("./_export"),a=e("./_redefine"),s=e("./_hide"),o=e("./_has"),u=e("./_iterators"),l=e("./_iter-create"),c=e("./_set-to-string-tag"),p=e("./_object-gpo"),f=e("./_wks")("iterator"),h=!([].keys&&"next"in[].keys()),d="keys",y="values",m=function(){return this};t.exports=function(e,t,n,b,g,v,x){l(n,t,b);var _,E,A,D=function(e){if(!h&&e in k)return k[e];switch(e){case d:return function(){return new n(this,e)};case y:return function(){return new n(this,e)}}return function(){return new n(this,e)}},C=t+" Iterator",S=g==y,w=!1,k=e.prototype,F=k[f]||k["@@iterator"]||g&&k[g],T=F||D(g),P=g?S?D("entries"):T:void 0,j="Array"==t?k.entries||F:F;if(j&&(A=p(j.call(new e)),A!==Object.prototype&&(c(A,C,!0),r||o(A,f)||s(A,f,m))),S&&F&&F.name!==y&&(w=!0,T=function(){return F.call(this)}),r&&!x||!h&&!w&&k[f]||s(k,f,T),u[t]=T,u[C]=m,g)if(_={values:S?T:D(y),keys:v?T:D(d),entries:P},x)for(E in _)E in k||a(k,E,_[E]);else i(i.P+i.F*(h||w),t,_);return _}},{"./_export":155,"./_has":159,"./_hide":160,"./_iter-create":168,"./_iterators":171,"./_library":173,"./_object-gpo":183,"./_redefine":190,"./_set-to-string-tag":193,"./_wks":206}],170:[function(e,t,n){t.exports=function(e,t){return{value:t,done:!!e}}},{}],171:[function(e,t,n){t.exports={}},{}],172:[function(e,t,n){var r=e("./_object-keys"),i=e("./_to-iobject");t.exports=function(e,t){for(var n,a=i(e),s=r(a),o=s.length,u=0;o>u;)if(a[n=s[u++]]===t)return n}},{"./_object-keys":185,"./_to-iobject":199}],173:[function(e,t,n){t.exports=!0},{}],174:[function(e,t,n){var r=e("./_uid")("meta"),i=e("./_is-object"),a=e("./_has"),s=e("./_object-dp").f,o=0,u=Object.isExtensible||function(){return!0},l=!e("./_fails")(function(){return u(Object.preventExtensions({}))}),c=function(e){s(e,r,{value:{i:"O"+ ++o,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!a(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!a(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&d.NEED&&u(e)&&!a(e,r)&&c(e),e},d=t.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},{"./_fails":156,"./_has":159,"./_is-object":166,"./_object-dp":177,"./_uid":203}],175:[function(e,t,n){"use strict";var r=e("./_object-keys"),i=e("./_object-gops"),a=e("./_object-pie"),s=e("./_to-object"),o=e("./_iobject"),u=Object.assign;t.exports=!u||e("./_fails")(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=u({},e)[n]||Object.keys(u({},t)).join("")!=r})?function(e,t){for(var n=s(e),u=arguments.length,l=1,c=i.f,p=a.f;u>l;)for(var f,h=o(arguments[l++]),d=c?r(h).concat(c(h)):r(h),y=d.length,m=0;y>m;)p.call(h,f=d[m++])&&(n[f]=h[f]);return n}:u},{"./_fails":156,"./_iobject":163,"./_object-gops":182,"./_object-keys":185,"./_object-pie":186,"./_to-object":201}],176:[function(e,t,n){var r=e("./_an-object"),i=e("./_object-dps"),a=e("./_enum-bug-keys"),s=e("./_shared-key")("IE_PROTO"),o=function(){},u="prototype",l=function(){var t,n=e("./_dom-create")("iframe"),r=a.length,i="<",s=">";for(n.style.display="none",e("./_html").appendChild(n),n.src="javascript:",t=n.contentWindow.document,t.open(),t.write(i+"script"+s+"document.F=Object"+i+"/script"+s),t.close(),l=t.F;r--;)delete l[u][a[r]];return l()};t.exports=Object.create||function(e,t){var n;return null!==e?(o[u]=r(e),n=new o,o[u]=null,n[s]=e):n=l(),void 0===t?n:i(n,t)}},{"./_an-object":136,"./_dom-create":152,"./_enum-bug-keys":153,"./_html":161,"./_object-dps":178,"./_shared-key":194}],177:[function(e,t,n){var r=e("./_an-object"),i=e("./_ie8-dom-define"),a=e("./_to-primitive"),s=Object.defineProperty;n.f=e("./_descriptors")?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},{"./_an-object":136,"./_descriptors":151,"./_ie8-dom-define":162,"./_to-primitive":202}],178:[function(e,t,n){var r=e("./_object-dp"),i=e("./_an-object"),a=e("./_object-keys");t.exports=e("./_descriptors")?Object.defineProperties:function(e,t){i(e);for(var n,s=a(t),o=s.length,u=0;o>u;)r.f(e,n=s[u++],t[n]);return e}},{"./_an-object":136,"./_descriptors":151,"./_object-dp":177,"./_object-keys":185}],179:[function(e,t,n){var r=e("./_object-pie"),i=e("./_property-desc"),a=e("./_to-iobject"),s=e("./_to-primitive"),o=e("./_has"),u=e("./_ie8-dom-define"),l=Object.getOwnPropertyDescriptor;n.f=e("./_descriptors")?l:function(e,t){if(e=a(e),t=s(t,!0),u)try{return l(e,t)}catch(e){}if(o(e,t))return i(!r.f.call(e,t),e[t])}},{"./_descriptors":151,"./_has":159,"./_ie8-dom-define":162,"./_object-pie":186,"./_property-desc":188,"./_to-iobject":199,"./_to-primitive":202}],180:[function(e,t,n){var r=e("./_to-iobject"),i=e("./_object-gopn").f,a={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],o=function(e){try{return i(e)}catch(e){return s.slice()}};t.exports.f=function(e){return s&&"[object Window]"==a.call(e)?o(e):i(r(e))}},{"./_object-gopn":181,"./_to-iobject":199}],181:[function(e,t,n){var r=e("./_object-keys-internal"),i=e("./_enum-bug-keys").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},{"./_enum-bug-keys":153,"./_object-keys-internal":184}],182:[function(e,t,n){n.f=Object.getOwnPropertySymbols},{}],183:[function(e,t,n){var r=e("./_has"),i=e("./_to-object"),a=e("./_shared-key")("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null}},{"./_has":159,"./_shared-key":194,"./_to-object":201}],184:[function(e,t,n){var r=e("./_has"),i=e("./_to-iobject"),a=e("./_array-includes")(!1),s=e("./_shared-key")("IE_PROTO");t.exports=function(e,t){var n,o=i(e),u=0,l=[];for(n in o)n!=s&&r(o,n)&&l.push(n);for(;t.length>u;)r(o,n=t[u++])&&(~a(l,n)||l.push(n));return l}},{"./_array-includes":138,"./_has":159,"./_shared-key":194,"./_to-iobject":199}],185:[function(e,t,n){var r=e("./_object-keys-internal"),i=e("./_enum-bug-keys");t.exports=Object.keys||function(e){return r(e,i)}},{"./_enum-bug-keys":153,"./_object-keys-internal":184}],186:[function(e,t,n){n.f={}.propertyIsEnumerable},{}],187:[function(e,t,n){var r=e("./_export"),i=e("./_core"),a=e("./_fails");t.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],s={};s[e]=t(n),r(r.S+r.F*a(function(){n(1)}),"Object",s)}},{"./_core":148,"./_export":155,"./_fails":156}],188:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],189:[function(e,t,n){var r=e("./_hide");t.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},{"./_hide":160}],190:[function(e,t,n){t.exports=e("./_hide")},{"./_hide":160}],191:[function(e,t,n){var r=e("./_is-object"),i=e("./_an-object"),a=function(e,t){if(i(e),!r(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,n,r){try{r=e("./_ctx")(Function.call,e("./_object-gopd").f(Object.prototype,"__proto__").set,2),r(t,[]),n=!(t instanceof Array)}catch(e){n=!0}return function(e,t){return a(e,t),n?e.__proto__=t:r(e,t),e}}({},!1):void 0),check:a}},{"./_an-object":136,"./_ctx":149,"./_is-object":166,"./_object-gopd":179}],192:[function(e,t,n){"use strict";var r=e("./_global"),i=e("./_core"),a=e("./_object-dp"),s=e("./_descriptors"),o=e("./_wks")("species");t.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];s&&t&&!t[o]&&a.f(t,o,{configurable:!0,get:function(){return this}})}},{"./_core":148,"./_descriptors":151,"./_global":158,"./_object-dp":177,"./_wks":206}],193:[function(e,t,n){var r=e("./_object-dp").f,i=e("./_has"),a=e("./_wks")("toStringTag");t.exports=function(e,t,n){ +e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},{"./_has":159,"./_object-dp":177,"./_wks":206}],194:[function(e,t,n){var r=e("./_shared")("keys"),i=e("./_uid");t.exports=function(e){return r[e]||(r[e]=i(e))}},{"./_shared":195,"./_uid":203}],195:[function(e,t,n){var r=e("./_global"),i="__core-js_shared__",a=r[i]||(r[i]={});t.exports=function(e){return a[e]||(a[e]={})}},{"./_global":158}],196:[function(e,t,n){var r=e("./_to-integer"),i=e("./_defined");t.exports=function(e){return function(t,n){var a,s,o=String(i(t)),u=r(n),l=o.length;return u<0||u>=l?e?"":void 0:(a=o.charCodeAt(u),a<55296||a>56319||u+1===l||(s=o.charCodeAt(u+1))<56320||s>57343?e?o.charAt(u):a:e?o.slice(u,u+2):(a-55296<<10)+(s-56320)+65536)}}},{"./_defined":150,"./_to-integer":198}],197:[function(e,t,n){var r=e("./_to-integer"),i=Math.max,a=Math.min;t.exports=function(e,t){return e=r(e),e<0?i(e+t,0):a(e,t)}},{"./_to-integer":198}],198:[function(e,t,n){var r=Math.ceil,i=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},{}],199:[function(e,t,n){var r=e("./_iobject"),i=e("./_defined");t.exports=function(e){return r(i(e))}},{"./_defined":150,"./_iobject":163}],200:[function(e,t,n){var r=e("./_to-integer"),i=Math.min;t.exports=function(e){return e>0?i(r(e),9007199254740991):0}},{"./_to-integer":198}],201:[function(e,t,n){var r=e("./_defined");t.exports=function(e){return Object(r(e))}},{"./_defined":150}],202:[function(e,t,n){var r=e("./_is-object");t.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":166}],203:[function(e,t,n){var r=0,i=Math.random();t.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},{}],204:[function(e,t,n){var r=e("./_global"),i=e("./_core"),a=e("./_library"),s=e("./_wks-ext"),o=e("./_object-dp").f;t.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||o(t,e,{value:s.f(e)})}},{"./_core":148,"./_global":158,"./_library":173,"./_object-dp":177,"./_wks-ext":205}],205:[function(e,t,n){n.f=e("./_wks")},{"./_wks":206}],206:[function(e,t,n){var r=e("./_shared")("wks"),i=e("./_uid"),a=e("./_global").Symbol,s="function"==typeof a;(t.exports=function(e){return r[e]||(r[e]=s&&a[e]||(s?a:i)("Symbol."+e))}).store=r},{"./_global":158,"./_shared":195,"./_uid":203}],207:[function(e,t,n){var r=e("./_classof"),i=e("./_wks")("iterator"),a=e("./_iterators");t.exports=e("./_core").getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||a[r(e)]}},{"./_classof":142,"./_core":148,"./_iterators":171,"./_wks":206}],208:[function(e,t,n){var r=e("./_an-object"),i=e("./core.get-iterator-method");t.exports=e("./_core").getIterator=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return r(t.call(e))}},{"./_an-object":136,"./_core":148,"./core.get-iterator-method":207}],209:[function(e,t,n){"use strict";var r=e("./_add-to-unscopables"),i=e("./_iter-step"),a=e("./_iterators"),s=e("./_to-iobject");t.exports=e("./_iter-define")(Array,"Array",function(e,t){this._t=s(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),a.Arguments=a.Array,r("keys"),r("values"),r("entries")},{"./_add-to-unscopables":134,"./_iter-define":169,"./_iter-step":170,"./_iterators":171,"./_to-iobject":199}],210:[function(e,t,n){"use strict";var r=e("./_collection-strong");t.exports=e("./_collection")("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=r.getEntry(this,e);return t&&t.v},set:function(e,t){return r.def(this,0===e?0:e,t)}},r,!0)},{"./_collection":147,"./_collection-strong":144}],211:[function(e,t,n){var r=e("./_export");r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{"./_export":155}],212:[function(e,t,n){var r=e("./_export");r(r.S+r.F,"Object",{assign:e("./_object-assign")})},{"./_export":155,"./_object-assign":175}],213:[function(e,t,n){var r=e("./_export");r(r.S,"Object",{create:e("./_object-create")})},{"./_export":155,"./_object-create":176}],214:[function(e,t,n){var r=e("./_to-object"),i=e("./_object-keys");e("./_object-sap")("keys",function(){return function(e){return i(r(e))}})},{"./_object-keys":185,"./_object-sap":187,"./_to-object":201}],215:[function(e,t,n){var r=e("./_export");r(r.S,"Object",{setPrototypeOf:e("./_set-proto").set})},{"./_export":155,"./_set-proto":191}],216:[function(e,t,n){arguments[4][1][0].apply(n,arguments)},{dup:1}],217:[function(e,t,n){"use strict";var r=e("./_string-at")(!0);e("./_iter-define")(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},{"./_iter-define":169,"./_string-at":196}],218:[function(e,t,n){"use strict";var r=e("./_global"),i=e("./_has"),a=e("./_descriptors"),s=e("./_export"),o=e("./_redefine"),u=e("./_meta").KEY,l=e("./_fails"),c=e("./_shared"),p=e("./_set-to-string-tag"),f=e("./_uid"),h=e("./_wks"),d=e("./_wks-ext"),y=e("./_wks-define"),m=e("./_keyof"),b=e("./_enum-keys"),g=e("./_is-array"),v=e("./_an-object"),x=e("./_to-iobject"),_=e("./_to-primitive"),E=e("./_property-desc"),A=e("./_object-create"),D=e("./_object-gopn-ext"),C=e("./_object-gopd"),S=e("./_object-dp"),w=e("./_object-keys"),k=C.f,F=S.f,T=D.f,P=r.Symbol,j=r.JSON,B=j&&j.stringify,O="prototype",I=h("_hidden"),N=h("toPrimitive"),L={}.propertyIsEnumerable,M=c("symbol-registry"),R=c("symbols"),U=c("op-symbols"),V=Object[O],G="function"==typeof P,q=r.QObject,K=!q||!q[O]||!q[O].findChild,X=a&&l(function(){return 7!=A(F({},"a",{get:function(){return F(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=k(V,t);r&&delete V[t],F(e,t,n),r&&e!==V&&F(V,t,r)}:F,J=function(e){var t=R[e]=A(P[O]);return t._k=e,t},W=G&&"symbol"==typeof P.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof P},z=function(e,t,n){return e===V&&z(U,t,n),v(e),t=_(t,!0),v(n),i(R,t)?(n.enumerable?(i(e,I)&&e[I][t]&&(e[I][t]=!1),n=A(n,{enumerable:E(0,!1)})):(i(e,I)||F(e,I,E(1,{})),e[I][t]=!0),X(e,t,n)):F(e,t,n)},Y=function(e,t){v(e);for(var n,r=b(t=x(t)),i=0,a=r.length;a>i;)z(e,n=r[i++],t[n]);return e},H=function(e,t){return void 0===t?A(e):Y(A(e),t)},$=function(e){var t=L.call(this,e=_(e,!0));return!(this===V&&i(R,e)&&!i(U,e))&&(!(t||!i(this,e)||!i(R,e)||i(this,I)&&this[I][e])||t)},Q=function(e,t){if(e=x(e),t=_(t,!0),e!==V||!i(R,t)||i(U,t)){var n=k(e,t);return!n||!i(R,t)||i(e,I)&&e[I][t]||(n.enumerable=!0),n}},Z=function(e){for(var t,n=T(x(e)),r=[],a=0;n.length>a;)i(R,t=n[a++])||t==I||t==u||r.push(t);return r},ee=function(e){for(var t,n=e===V,r=T(n?U:x(e)),a=[],s=0;r.length>s;)!i(R,t=r[s++])||n&&!i(V,t)||a.push(R[t]);return a};G||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===V&&t.call(U,n),i(this,I)&&i(this[I],e)&&(this[I][e]=!1),X(this,e,E(1,n))};return a&&K&&X(V,e,{configurable:!0,set:t}),J(e)},o(P[O],"toString",function(){return this._k}),C.f=Q,S.f=z,e("./_object-gopn").f=D.f=Z,e("./_object-pie").f=$,e("./_object-gops").f=ee,a&&!e("./_library")&&o(V,"propertyIsEnumerable",$,!0),d.f=function(e){return J(h(e))}),s(s.G+s.W+s.F*!G,{Symbol:P});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)h(te[ne++]);for(var te=w(h.store),ne=0;te.length>ne;)y(te[ne++]);s(s.S+s.F*!G,"Symbol",{for:function(e){return i(M,e+="")?M[e]:M[e]=P(e)},keyFor:function(e){if(W(e))return m(M,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){K=!0},useSimple:function(){K=!1}}),s(s.S+s.F*!G,"Object",{create:H,defineProperty:z,defineProperties:Y,getOwnPropertyDescriptor:Q,getOwnPropertyNames:Z,getOwnPropertySymbols:ee}),j&&s(s.S+s.F*(!G||l(function(){var e=P();return"[null]"!=B([e])||"{}"!=B({a:e})||"{}"!=B(Object(e))})),"JSON",{stringify:function(e){if(void 0!==e&&!W(e)){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);return t=r[1],"function"==typeof t&&(n=t),!n&&g(t)||(t=function(e,t){if(n&&(t=n.call(this,e,t)),!W(t))return t}),r[1]=t,B.apply(j,r)}}}),P[O][N]||e("./_hide")(P[O],N,P[O].valueOf),p(P,"Symbol"),p(Math,"Math",!0),p(r.JSON,"JSON",!0)},{"./_an-object":136,"./_descriptors":151,"./_enum-keys":154,"./_export":155,"./_fails":156,"./_global":158,"./_has":159,"./_hide":160,"./_is-array":165,"./_keyof":172,"./_library":173,"./_meta":174,"./_object-create":176,"./_object-dp":177,"./_object-gopd":179,"./_object-gopn":181,"./_object-gopn-ext":180,"./_object-gops":182,"./_object-keys":185,"./_object-pie":186,"./_property-desc":188,"./_redefine":190,"./_set-to-string-tag":193,"./_shared":195,"./_to-iobject":199,"./_to-primitive":202,"./_uid":203,"./_wks":206,"./_wks-define":204,"./_wks-ext":205}],219:[function(e,t,n){"use strict";var r,i=e("./_array-methods")(0),a=e("./_redefine"),s=e("./_meta"),o=e("./_object-assign"),u=e("./_collection-weak"),l=e("./_is-object"),c=s.getWeak,p=Object.isExtensible,f=u.ufstore,h={},d=function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(e){if(l(e)){var t=c(e);return t===!0?f(this).get(e):t?t[this._i]:void 0}},set:function(e,t){return u.def(this,e,t)}},m=t.exports=e("./_collection")("WeakMap",d,y,u,!0,!0);7!=(new m).set((Object.freeze||Object)(h),7).get(h)&&(r=u.getConstructor(d),o(r.prototype,y),s.NEED=!0,i(["delete","has","get","set"],function(e){var t=m.prototype,n=t[e];a(t,e,function(t,i){if(l(t)&&!p(t)){this._f||(this._f=new r);var a=this._f[e](t,i);return"set"==e?this:a}return n.call(this,t,i)})}))},{"./_array-methods":139,"./_collection":147,"./_collection-weak":146,"./_is-object":166,"./_meta":174,"./_object-assign":175,"./_redefine":190}],220:[function(e,t,n){"use strict";var r=e("./_collection-weak");e("./_collection")("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return r.def(this,e,!0)}},r,!1,!0)},{"./_collection":147,"./_collection-weak":146}],221:[function(e,t,n){var r=e("./_export");r(r.P+r.R,"Map",{toJSON:e("./_collection-to-json")("Map")})},{"./_collection-to-json":145,"./_export":155}],222:[function(e,t,n){e("./_wks-define")("asyncIterator")},{"./_wks-define":204}],223:[function(e,t,n){e("./_wks-define")("observable")},{"./_wks-define":204}],224:[function(e,t,n){e("./es6.array.iterator");for(var r=e("./_global"),i=e("./_hide"),a=e("./_iterators"),s=e("./_wks")("toStringTag"),o=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var l=o[u],c=r[l],p=c&&c.prototype;p&&!p[s]&&i(p,s,l),a[l]=a.Array}},{"./_global":158,"./_hide":160,"./_iterators":171,"./_wks":206,"./es6.array.iterator":209}],225:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){e=(0,l.default)(e);var n=e,r=n.program;return t.length&&(0,y.default)(e,E,null,t),r.body.length>1?r.body:r.body[0]}n.__esModule=!0;var s=e("babel-runtime/core-js/symbol"),o=i(s);n.default=function(e,t){var n=void 0;try{throw new Error}catch(e){e.stack&&(n=e.stack.split("\n").slice(1).join("\n"))}t=(0,p.default)({allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,preserveComments:!1},t);var r=function(){var i=void 0;try{i=b.parse(e,t),i=y.default.removeProperties(i,{preserveComments:t.preserveComments}),y.default.cheap(i,function(e){e[x]=!0})}catch(e){throw e.stack=e.stack+"from\n"+n,e}return r=function(){return i},i};return function(){for(var e=arguments.length,t=Array(e),n=0;n=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}if(e[s])return!0}return!1},e.prototype.create=function(e,t,n,r){return p.default.get({parentPath:this.parentPath,parent:e,container:t,key:n,listKey:r})},e.prototype.maybeQueue=function(e,t){if(this.trap)throw new Error("Infinite cycle detected");this.queue&&(t?this.queue.push(e):this.priorityQueue.push(e))},e.prototype.visitMultiple=function(e,t,n){if(0===e.length)return!1;for(var r=[],i=0;i=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var u=s;if(u.resync(),0!==u.contexts.length&&u.contexts[u.contexts.length-1]===this||u.pushContext(this),null!==u.key&&(d&&e.length>=1e4&&(this.trap=!0),!(t.indexOf(u.node)>=0))){if(t.push(u.node),u.visit()){n=!0;break}if(this.priorityQueue.length&&(n=this.visitQueue(this.priorityQueue),this.priorityQueue=[],this.queue=e,n))break}}for(var l=e,c=Array.isArray(l),p=0,l=c?l:(0,o.default)(l);;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}f.popContext()}return this.queue=null,n},e.prototype.visit=function(e,t){var n=e[t];return!!n&&(Array.isArray(n)?this.visitMultiple(n,e,t):this.visitSingle(e,t))},e}();n.default=y,t.exports=n.default}).call(this,e("_process"))},{"./path":236,_process:13,"babel-runtime/core-js/get-iterator":100,"babel-runtime/helpers/classCallCheck":114,"babel-types":265}],228:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),a=r(i),s=function e(t,n){(0,a.default)(this,e),this.file=t,this.options=n};n.default=s,t.exports=n.default},{"babel-runtime/helpers/classCallCheck":114}],229:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n,r,i){if(e){if(t||(t={}),!t.noScope&&!n&&"Program"!==e.type&&"File"!==e.type)throw new Error(b.get("traverseNeedsParent",e.type));y.explode(t),a.node(e,t,n,r,i)}}function s(e,t){e.node.type===t.type&&(t.has=!0,e.stop())}n.__esModule=!0,n.visitors=n.Hub=n.Scope=n.NodePath=void 0;var o=e("babel-runtime/core-js/get-iterator"),u=i(o),l=e("./path");Object.defineProperty(n,"NodePath",{enumerable:!0,get:function(){return i(l).default}});var c=e("./scope");Object.defineProperty(n,"Scope",{enumerable:!0,get:function(){return i(c).default}});var p=e("./hub");Object.defineProperty(n,"Hub",{enumerable:!0,get:function(){return i(p).default}}),n.default=a;var f=e("./context"),h=i(f),d=e("./visitors"),y=r(d),m=e("babel-messages"),b=r(m),g=e("lodash/includes"),v=i(g),x=e("babel-types"),_=r(x),E=e("./cache"),A=r(E);n.visitors=y,a.visitors=y,a.verify=y.verify,a.explode=y.explode,a.NodePath=e("./path"),a.Scope=e("./scope"),a.Hub=e("./hub"),a.cheap=function(e,t){return _.traverseFast(e,t)},a.node=function(e,t,n,r,i,a){var s=_.VISITOR_KEYS[e.type];if(s)for(var o=new h.default(n,t,r,i),l=s,c=Array.isArray(l),p=0,l=c?l:(0,u.default)(l);;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var d=f;if((!a||!a[d])&&o.visit(e,d))return}},a.clearNode=function(e,t){_.removeProperties(e,t),A.path.delete(e)},a.removeProperties=function(e,t){return _.traverseFast(e,a.clearNode,t),e},a.hasType=function(e,t,n,r){if((0,v.default)(r,e.type))return!1;if(e.type===n)return!0;var i={has:!1,type:n};return a(e,{blacklist:r,enter:s},t,i),i.has},a.clearCache=function(){A.clear()},a.clearCache.clearPath=A.clearPath,a.clearCache.clearScope=A.clearScope,a.copyCache=function(e,t){A.path.has(e)&&A.path.set(t,A.path.get(e))}},{"./cache":226,"./context":227,"./hub":228,"./path":236,"./scope":248,"./visitors":250,"babel-messages":99,"babel-runtime/core-js/get-iterator":100,"babel-types":265,"lodash/includes":473}],230:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){for(var t=this;t=t.parentPath;)if(e(t))return t;return null}function s(e){var t=this;do if(e(t))return t;while(t=t.parentPath);return null}function o(){return this.findParent(function(e){return e.isFunction()||e.isProgram()})}function u(){var e=this;do if(Array.isArray(e.container))return e;while(e=e.parentPath)}function l(e){return this.getDeepestCommonAncestorFrom(e,function(e,t,n){for(var r=void 0,i=v.VISITOR_KEYS[e.type],a=n,s=Array.isArray(a),o=0,a=s?a:(0,b.default)(a);;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u,c=l[t+1];if(r)if(c.listKey&&r.listKey===c.listKey&&c.keyf&&(r=c)}else r=c}return r})}function c(e,t){var n=this;if(!e.length)return this;if(1===e.length)return e[0];var r=1/0,i=void 0,a=void 0,s=e.map(function(e){var t=[];do t.unshift(e);while((e=e.parentPath)&&e!==n);return t.length=c.length)break;h=c[f++]}else{if(f=c.next(),f.done)break;h=f.value}var d=h;if(d[u]!==l)break e}i=u,a=l}if(a)return t?t(a,i,s):a;throw new Error("Couldn't find intersection")}function p(){var e=this,t=[];do t.push(e);while(e=e.parentPath);return t}function f(e){return e.isDescendant(this)}function h(e){return!!this.findParent(function(t){return t===e})}function d(){for(var e=this;e;){for(var t=arguments,n=Array.isArray(t),r=0,t=n?t:(0,b.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i;if(e.node.type===a)return!0}e=e.parentPath}return!1}function y(e){var t=this.isFunction()?this:this.findParent(function(e){return e.isFunction()});if(t){if(t.isFunctionExpression()||t.isFunctionDeclaration()){var n=t.node.shadow;if(n&&(!e||n[e]!==!1))return t}else if(t.isArrowFunctionExpression())return t;return null}}n.__esModule=!0;var m=e("babel-runtime/core-js/get-iterator"),b=i(m);n.findParent=a,n.find=s,n.getFunctionParent=o,n.getStatementParent=u,n.getEarliestCommonAncestorFrom=l,n.getDeepestCommonAncestorFrom=c,n.getAncestry=p,n.isAncestor=f,n.isDescendant=h,n.inType=d,n.inShadow=y;var g=e("babel-types"),v=r(g),x=e("./index");i(x)},{"./index":236,"babel-runtime/core-js/get-iterator":100,"babel-types":265}],231:[function(e,t,n){"use strict";function r(){if("string"!=typeof this.key){var e=this.node;if(e){var t=e.trailingComments,n=e.leadingComments;if(t||n){var r=this.getSibling(this.key-1),i=this.getSibling(this.key+1);r.node||(r=i),i.node||(i=r),r.addComments("trailing",n),i.addComments("leading",t)}}}}function i(e,t,n){this.addComments(e,[{type:n?"CommentLine":"CommentBlock",value:t}])}function a(e,t){if(t){var n=this.node;if(n){var r=e+"Comments";n[r]?n[r]=n[r].concat(t):n[r]=t}}}n.__esModule=!0,n.shareCommentsWithSiblings=r,n.addComment=i,n.addComments=a},{}],232:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=this.opts;return this.debug(function(){return e}),!(!this.node||!this._call(t[e]))||!!this.node&&this._call(t[this.node.type]&&t[this.node.type][e])}function a(e){if(!e)return!1;for(var t=e,n=Array.isArray(t),r=0,t=n?t:(0,C.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i;if(a){var s=this.node;if(!s)return!0;if(a.call(this.state,this,this.state))throw new Error("Unexpected return value from visitor method "+a);if(this.node!==s)return!0;if(this.shouldStop||this.shouldSkip||this.removed)return!0}}return!1}function s(){var e=this.opts.blacklist;return e&&e.indexOf(this.node.type)>-1}function o(){return!!this.node&&(!this.isBlacklisted()&&((!this.opts.shouldSkip||!this.opts.shouldSkip(this))&&(this.call("enter")||this.shouldSkip?(this.debug(function(){return"Skip..."}),this.shouldStop):(this.debug(function(){return"Recursing into..."}),w.default.node(this.node,this.opts,this.scope,this.state,this,this.skipKeys),this.call("exit"),this.shouldStop))))}function u(){this.shouldSkip=!0}function l(e){this.skipKeys[e]=!0}function c(){this.shouldStop=!0,this.shouldSkip=!0}function p(){if(!this.opts||!this.opts.noScope){var e=this.context&&this.context.scope;if(!e)for(var t=this.parentPath;t&&!e;){if(t.opts&&t.opts.noScope)return;e=t.scope,t=t.parentPath}this.scope=this.getScope(e),this.scope&&this.scope.init()}}function f(e){return this.shouldSkip=!1,this.shouldStop=!1,this.removed=!1,this.skipKeys={},e&&(this.context=e,this.state=e.state,this.opts=e.opts),this.setScope(),this}function h(){this.removed||(this._resyncParent(),this._resyncList(),this._resyncKey())}function d(){this.parentPath&&(this.parent=this.parentPath.node)}function y(){if(this.container&&this.node!==this.container[this.key]){if(Array.isArray(this.container)){for(var e=0;e0&&void 0!==arguments[0]?arguments[0]:this;if(!e.removed)for(var t=this.contexts,n=t,r=Array.isArray(n),i=0,n=r?n:(0,C.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a;s.maybeQueue(e)}}function A(){for(var e=this,t=this.contexts;!t.length;)e=e.parentPath,t=e.contexts;return t}n.__esModule=!0;var D=e("babel-runtime/core-js/get-iterator"),C=r(D);n.call=i,n._call=a,n.isBlacklisted=s,n.visit=o,n.skip=u,n.skipKey=l,n.stop=c,n.setScope=p,n.setContext=f,n.resync=h,n._resyncParent=d,n._resyncKey=y,n._resyncList=m,n._resyncRemoved=b,n.popContext=g,n.pushContext=v,n.setup=x,n.setKey=_,n.requeue=E,n._getQueueContexts=A;var S=e("../index"),w=r(S)},{"../index":229,"babel-runtime/core-js/get-iterator":100}],233:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(){var e=this.node,t=void 0;if(this.isMemberExpression())t=e.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");t=e.key}return e.computed||u.isIdentifier(t)&&(t=u.stringLiteral(t.name)),t}function a(){return u.ensureBlock(this.node)}function s(){if(this.isArrowFunctionExpression()){this.ensureBlock();var e=this.node;e.expression=!1,e.type="FunctionExpression",e.shadow=e.shadow||!0}}n.__esModule=!0,n.toComputedKey=i,n.ensureBlock=a,n.arrowFunctionToShadowed=s;var o=e("babel-types"),u=r(o)},{"babel-types":265}],234:[function(e,t,n){(function(t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){var e=this.evaluate();if(e.confident)return!!e.value}function a(){function e(e){i&&(a=e,i=!1)}function n(t){var n=t.node;if(s.has(n)){var a=s.get(n);return a.resolved?a.value:void e(t)}var o={resolved:!1};s.set(n,o);var u=r(t);return i&&(o.resolved=!0,o.value=u),u}function r(r){if(i){var a=r.node;if(r.isSequenceExpression()){var s=r.get("expressions");return n(s[s.length-1])}if(r.isStringLiteral()||r.isNumericLiteral()||r.isBooleanLiteral())return a.value;if(r.isNullLiteral())return null;if(r.isTemplateLiteral()){for(var u="",c=0,p=r.get("expressions"),d=a.quasis,y=Array.isArray(d),m=0,d=y?d:(0,l.default)(d);;){var b;if(y){if(m>=d.length)break;b=d[m++]}else{if(m=d.next(),m.done)break;b=m.value}var g=b;if(!i)break;u+=g.value.cooked;var v=p[c++];v&&(u+=String(n(v)))}if(!i)return;return u}if(r.isConditionalExpression()){var x=n(r.get("test"));if(!i)return;return n(x?r.get("consequent"):r.get("alternate"))}if(r.isExpressionWrapper())return n(r.get("expression"));if(r.isMemberExpression()&&!r.parentPath.isCallExpression({callee:a})){var _=r.get("property"),E=r.get("object");if(E.isLiteral()&&_.isIdentifier()){var A=E.node.value,D=void 0===A?"undefined":(0,o.default)(A);if("number"===D||"string"===D)return A[_.node.name]}}if(r.isReferencedIdentifier()){var C=r.scope.getBinding(a.name);if(C&&C.constantViolations.length>0)return e(C.path);if(C&&r.node.start=P.length)break;O=P[B++]}else{if(B=P.next(),B.done)break;O=B.value}var I=O;if(I=I.evaluate(),!I.confident)return e(I);F.push(I.value)}return F}if(r.isObjectExpression()){for(var N={},L=r.get("properties"),M=L,R=Array.isArray(M),U=0,M=R?M:(0,l.default)(M);;){var V;if(R){if(U>=M.length)break;V=M[U++]}else{if(U=M.next(),U.done)break;V=U.value}var G=V;if(G.isObjectMethod()||G.isSpreadProperty())return e(G);var q=G.get("key"),K=q;if(G.node.computed){if(K=K.evaluate(),!K.confident)return e(q);K=K.value}else K=K.isIdentifier()?K.node.name:K.node.value;var X=G.get("value"),J=X.evaluate();if(!J.confident)return e(X);J=J.value,N[K]=J}return N}if(r.isLogicalExpression()){var W=i,z=n(r.get("left")),Y=i;i=W;var H=n(r.get("right")),$=i;switch(i=Y&&$,a.operator){case"||":if(z&&Y)return i=!0,z;if(!i)return;return z||H;case"&&":if((!z&&Y||!H&&$)&&(i=!0),!i)return;return z&&H}}if(r.isBinaryExpression()){var Q=n(r.get("left"));if(!i)return;var Z=n(r.get("right"));if(!i)return;switch(a.operator){case"-":return Q-Z;case"+":return Q+Z;case"/":return Q/Z;case"*":return Q*Z;case"%":return Q%Z;case"**":return Math.pow(Q,Z);case"<":return Q":return Q>Z;case"<=":return Q<=Z;case">=":return Q>=Z;case"==":return Q==Z;case"!=":return Q!=Z;case"===":return Q===Z;case"!==":return Q!==Z;case"|":return Q|Z;case"&":return Q&Z;case"^":return Q^Z;case"<<":return Q<>":return Q>>Z;case">>>":return Q>>>Z}}if(r.isCallExpression()){var ee=r.get("callee"),te=void 0,ne=void 0;if(ee.isIdentifier()&&!r.scope.getBinding(ee.node.name,!0)&&f.indexOf(ee.node.name)>=0&&(ne=t[a.callee.name]),ee.isMemberExpression()){var re=ee.get("object"),ie=ee.get("property");if(re.isIdentifier()&&ie.isIdentifier()&&f.indexOf(re.node.name)>=0&&h.indexOf(ie.node.name)<0&&(te=t[re.node.name],ne=te[ie.node.name]),re.isLiteral()&&ie.isIdentifier()){var ae=(0,o.default)(re.node.value);"string"!==ae&&"number"!==ae||(te=re.node.value,ne=te[ie.node.name])}}if(ne){var se=r.get("arguments").map(n);if(!i)return;return ne.apply(te,se)}}e(r)}}var i=!0,a=void 0,s=new p.default,u=n(this);return i||(u=void 0),{confident:i,deopt:a,value:u}}n.__esModule=!0;var s=e("babel-runtime/helpers/typeof"),o=r(s),u=e("babel-runtime/core-js/get-iterator"),l=r(u),c=e("babel-runtime/core-js/map"),p=r(c);n.evaluateTruthy=i,n.evaluate=a;var f=["String","Number","Math"],h=["random"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"babel-runtime/core-js/get-iterator":100,"babel-runtime/core-js/map":102,"babel-runtime/helpers/typeof":118}],235:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(){var e=this;do{if(!e.parentPath||Array.isArray(e.container)&&e.isStatement())break;e=e.parentPath}while(e);if(e&&(e.isProgram()||e.isFile()))throw new Error("File/Program node, we can't possibly find a statement parent to this");return e}function s(){return"left"===this.key?this.getSibling("right"):"right"===this.key?this.getSibling("left"):void 0}function o(){var e=[],t=function(t){t&&(e=e.concat(t.getCompletionRecords()))};if(this.isIfStatement())t(this.get("consequent")),t(this.get("alternate"));else if(this.isDoExpression()||this.isFor()||this.isWhile())t(this.get("body"));else if(this.isProgram()||this.isBlockStatement())t(this.get("body").pop());else{if(this.isFunction())return this.get("body").getCompletionRecords();this.isTryStatement()?(t(this.get("block")),t(this.get("handler")),t(this.get("finalizer"))):e.push(this)}return e}function u(e){return _.default.get({parentPath:this.parentPath,parent:this.parent,container:this.container,listKey:this.listKey,key:e})}function l(e,t){t===!0&&(t=this.context);var n=e.split(".");return 1===n.length?this._getKey(e,t):this._getPattern(n,t)}function c(e,t){var n=this,r=this.node,i=r[e];return Array.isArray(i)?i.map(function(a,s){return _.default.get({listKey:e,parentPath:n,parent:r,container:i,key:s}).setContext(t)}):_.default.get({parentPath:this,parent:r,container:r,key:e}).setContext(t)}function p(e,t){ +for(var n=this,r=e,i=Array.isArray(r),a=0,r=i?r:(0,v.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;n="."===o?n.parentPath:Array.isArray(n)?n[o]:n.get(o,t)}return n}function f(e){return A.getBindingIdentifiers(this.node,e)}function h(e){return A.getOuterBindingIdentifiers(this.node,e)}function d(){for(var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this,r=[].concat(n),i=(0,b.default)(null);r.length;){var a=r.shift();if(a&&a.node){var s=A.getBindingIdentifiers.keys[a.node.type];if(a.isIdentifier())if(e){var o=i[a.node.name]=i[a.node.name]||[];o.push(a)}else i[a.node.name]=a;else if(a.isExportDeclaration()){var u=a.get("declaration");u.isDeclaration()&&r.push(u)}else{if(t){if(a.isFunctionDeclaration()){r.push(a.get("id"));continue}if(a.isFunctionExpression())continue}if(s)for(var l=0;l1&&void 0!==arguments[1]?arguments[1]:SyntaxError;return this.hub.file.buildCodeFrameError(this.node,e,t)},e.prototype.traverse=function(e,t){(0,m.default)(this.node,e,this.scope,t,this)},e.prototype.mark=function(e,t){this.hub.file.metadata.marked.push({type:e,message:t,loc:this.node.loc})},e.prototype.set=function(e,t){E.validate(this.node,e,t),this.node[e]=t},e.prototype.getPathLocation=function(){var e=[],t=this;do{var n=t.key;t.inList&&(n=t.listKey+"["+n+"]"),e.unshift(n)}while(t=t.parentPath);return e.join(".")},e.prototype.debug=function(e){D.enabled&&D(this.getPathLocation()+" "+this.type+": "+e())},e}();n.default=C,(0,g.default)(C.prototype,e("./ancestry")),(0,g.default)(C.prototype,e("./inference")),(0,g.default)(C.prototype,e("./replacement")),(0,g.default)(C.prototype,e("./evaluation")),(0,g.default)(C.prototype,e("./conversion")),(0,g.default)(C.prototype,e("./introspection")),(0,g.default)(C.prototype,e("./context")),(0,g.default)(C.prototype,e("./removal")),(0,g.default)(C.prototype,e("./modification")),(0,g.default)(C.prototype,e("./family")),(0,g.default)(C.prototype,e("./comments"));for(var S=function(){if(k){if(F>=w.length)return"break";T=w[F++]}else{if(F=w.next(),F.done)return"break";T=F.value}var e=T,t="is"+e;C.prototype[t]=function(e){return E[t](this.node,e)},C.prototype["assert"+e]=function(n){if(!this[t](n))throw new TypeError("Expected node path of type "+e)}},w=E.TYPES,k=Array.isArray(w),F=0,w=k?w:(0,s.default)(w);;){var T;if("break"===S())break}var P=function(e){if("_"===e[0])return"continue";E.TYPES.indexOf(e)<0&&E.TYPES.push(e);var t=c[e];C.prototype["is"+e]=function(e){return t.checkPath(this,e)}};for(var j in c){P(j)}t.exports=n.default},{"../cache":226,"../index":229,"../scope":248,"./ancestry":230,"./comments":231,"./context":232,"./conversion":233,"./evaluation":234,"./family":235,"./inference":237,"./introspection":240,"./lib/virtual-types":243,"./modification":244,"./removal":245,"./replacement":246,"babel-runtime/core-js/get-iterator":100,"babel-runtime/helpers/classCallCheck":114,"babel-types":265,debug:278,invariant:253,"lodash/assign":453}],237:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(){if(this.typeAnnotation)return this.typeAnnotation;var e=this._getTypeAnnotation()||b.anyTypeAnnotation();return b.isTypeAnnotation(e)&&(e=e.typeAnnotation),this.typeAnnotation=e}function s(){var e=this.node;{if(e){if(e.typeAnnotation)return e.typeAnnotation;var t=y[e.type];return t?t.call(this,e):(t=y[this.parentPath.type],t&&t.validParent?this.parentPath.getTypeAnnotation():void 0)}if("init"===this.key&&this.parentPath.isVariableDeclarator()){var n=this.parentPath.parentPath,r=n.parentPath;return"left"===n.key&&r.isForInStatement()?b.stringTypeAnnotation():"left"===n.key&&r.isForOfStatement()?b.anyTypeAnnotation():b.voidTypeAnnotation()}}}function o(e,t){return u(e,this.getTypeAnnotation(),t)}function u(e,t,n){if("string"===e)return b.isStringTypeAnnotation(t);if("number"===e)return b.isNumberTypeAnnotation(t);if("boolean"===e)return b.isBooleanTypeAnnotation(t);if("any"===e)return b.isAnyTypeAnnotation(t);if("mixed"===e)return b.isMixedTypeAnnotation(t);if("empty"===e)return b.isEmptyTypeAnnotation(t);if("void"===e)return b.isVoidTypeAnnotation(t);if(n)return!1;throw new Error("Unknown base type "+e)}function l(e){var t=this.getTypeAnnotation();if(b.isAnyTypeAnnotation(t))return!0;if(b.isUnionTypeAnnotation(t)){for(var n=t.types,r=Array.isArray(n),i=0,n=r?n:(0,h.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a;if(b.isAnyTypeAnnotation(s)||u(e,s,!0))return!0}return!1}return u(e,t,!0)}function c(e){var t=this.getTypeAnnotation();if(e=e.getTypeAnnotation(),!b.isAnyTypeAnnotation(t)&&b.isFlowBaseAnnotation(t))return e.type===t.type}function p(e){var t=this.getTypeAnnotation();return b.isGenericTypeAnnotation(t)&&b.isIdentifier(t.id,{name:e})}n.__esModule=!0;var f=e("babel-runtime/core-js/get-iterator"),h=i(f);n.getTypeAnnotation=a,n._getTypeAnnotation=s,n.isBaseType=o,n.couldBeBaseType=l,n.baseTypeStrictlyMatches=c,n.isGenericType=p;var d=e("./inferers"),y=r(d),m=e("babel-types"),b=r(m)},{"./inferers":239,"babel-runtime/core-js/get-iterator":100,"babel-types":265}],238:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){var n=e.scope.getBinding(t),r=[];e.typeAnnotation=h.unionTypeAnnotation(r);var i=[],a=s(n,e,i),o=l(e,t);if(o&&function(){var e=s(n,o.ifStatement);a=a.filter(function(t){return e.indexOf(t)<0}),r.push(o.typeAnnotation)}(),a.length){a=a.concat(i);for(var u=a,c=Array.isArray(u),f=0,u=c?u:(0,p.default)(u);;){var d;if(c){if(f>=u.length)break;d=u[f++]}else{if(f=u.next(),f.done)break;d=f.value}var y=d;r.push(y.getTypeAnnotation())}}if(r.length)return h.createUnionTypeAnnotation(r)}function s(e,t,n){var r=e.constantViolations.slice();return r.unshift(e.path),r.filter(function(e){e=e.resolve();var r=e._guessExecutionStatusRelativeTo(t);return n&&"function"===r&&n.push(e),"before"===r})}function o(e,t){var n=t.node.operator,r=t.get("right").resolve(),i=t.get("left").resolve(),a=void 0;if(i.isIdentifier({name:e})?a=r:r.isIdentifier({name:e})&&(a=i),a)return"==="===n?a.getTypeAnnotation():h.BOOLEAN_NUMBER_BINARY_OPERATORS.indexOf(n)>=0?h.numberTypeAnnotation():void 0;if("==="===n){var s=void 0,o=void 0;if(i.isUnaryExpression({operator:"typeof"})?(s=i,o=r):r.isUnaryExpression({operator:"typeof"})&&(s=r,o=i),(o||s)&&(o=o.resolve(),o.isLiteral())){if("string"==typeof o.node.value&&s.get("argument").isIdentifier({name:e}))return h.createTypeAnnotationBasedOnTypeof(o.node.value)}}}function u(e){for(var t=void 0;t=e.parentPath;){if(t.isIfStatement()||t.isConditionalExpression())return"test"===e.key?void 0:t;e=t}}function l(e,t){var n=u(e);if(n){var r=n.get("test"),i=[r],a=[];do{var s=i.shift().resolve();if(s.isLogicalExpression()&&(i.push(s.get("left")),i.push(s.get("right"))),s.isBinaryExpression()){var c=o(t,s);c&&a.push(c)}}while(i.length);return a.length?{typeAnnotation:h.createUnionTypeAnnotation(a),ifStatement:n}:l(n,t)}}n.__esModule=!0;var c=e("babel-runtime/core-js/get-iterator"),p=i(c);n.default=function(e){if(this.isReferenced()){var t=this.scope.getBinding(e.name);return t?t.identifier.typeAnnotation?t.identifier.typeAnnotation:a(this,e.name):"undefined"===e.name?h.voidTypeAnnotation():"NaN"===e.name||"Infinity"===e.name?h.numberTypeAnnotation():void e.name}};var f=e("babel-types"),h=r(f);t.exports=n.default},{"babel-runtime/core-js/get-iterator":100,"babel-types":265}],239:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(){return this.get("id").isIdentifier()?this.get("init").getTypeAnnotation():void 0}function s(e){return e.typeAnnotation}function o(e){if(this.get("callee").isIdentifier())return T.genericTypeAnnotation(e.callee)}function u(){return T.stringTypeAnnotation()}function l(e){var t=e.operator;return"void"===t?T.voidTypeAnnotation():T.NUMBER_UNARY_OPERATORS.indexOf(t)>=0?T.numberTypeAnnotation():T.STRING_UNARY_OPERATORS.indexOf(t)>=0?T.stringTypeAnnotation():T.BOOLEAN_UNARY_OPERATORS.indexOf(t)>=0?T.booleanTypeAnnotation():void 0}function c(e){var t=e.operator;if(T.NUMBER_BINARY_OPERATORS.indexOf(t)>=0)return T.numberTypeAnnotation();if(T.BOOLEAN_BINARY_OPERATORS.indexOf(t)>=0)return T.booleanTypeAnnotation();if("+"===t){var n=this.get("right"),r=this.get("left");return r.isBaseType("number")&&n.isBaseType("number")?T.numberTypeAnnotation():r.isBaseType("string")||n.isBaseType("string")?T.stringTypeAnnotation():T.unionTypeAnnotation([T.stringTypeAnnotation(),T.numberTypeAnnotation()])}}function p(){return T.createUnionTypeAnnotation([this.get("left").getTypeAnnotation(),this.get("right").getTypeAnnotation()])}function f(){return T.createUnionTypeAnnotation([this.get("consequent").getTypeAnnotation(),this.get("alternate").getTypeAnnotation()])}function h(){return this.get("expressions").pop().getTypeAnnotation()}function d(){return this.get("right").getTypeAnnotation()}function y(e){var t=e.operator;if("++"===t||"--"===t)return T.numberTypeAnnotation()}function m(){return T.stringTypeAnnotation()}function b(){return T.numberTypeAnnotation()}function g(){return T.booleanTypeAnnotation()}function v(){return T.nullLiteralTypeAnnotation()}function x(){return T.genericTypeAnnotation(T.identifier("RegExp"))}function _(){return T.genericTypeAnnotation(T.identifier("Object"))}function E(){return T.genericTypeAnnotation(T.identifier("Array"))}function A(){return E()}function D(){return T.genericTypeAnnotation(T.identifier("Function"))}function C(){return w(this.get("callee"))}function S(){return w(this.get("tag"))}function w(e){if(e=e.resolve(),e.isFunction()){if(e.is("async"))return e.is("generator")?T.genericTypeAnnotation(T.identifier("AsyncIterator")):T.genericTypeAnnotation(T.identifier("Promise"));if(e.node.returnType)return e.node.returnType}}n.__esModule=!0,n.ClassDeclaration=n.ClassExpression=n.FunctionDeclaration=n.ArrowFunctionExpression=n.FunctionExpression=n.Identifier=void 0;var k=e("./inferer-reference");Object.defineProperty(n,"Identifier",{enumerable:!0,get:function(){return i(k).default}}),n.VariableDeclarator=a,n.TypeCastExpression=s,n.NewExpression=o,n.TemplateLiteral=u,n.UnaryExpression=l,n.BinaryExpression=c,n.LogicalExpression=p,n.ConditionalExpression=f,n.SequenceExpression=h,n.AssignmentExpression=d,n.UpdateExpression=y,n.StringLiteral=m,n.NumericLiteral=b,n.BooleanLiteral=g,n.NullLiteral=v,n.RegExpLiteral=x,n.ObjectExpression=_,n.ArrayExpression=E,n.RestElement=A,n.CallExpression=C,n.TaggedTemplateExpression=S;var F=e("babel-types"),T=r(F);s.validParent=!0,A.validParent=!0,n.FunctionExpression=D,n.ArrowFunctionExpression=D,n.FunctionDeclaration=D,n.ClassExpression=D,n.ClassDeclaration=D},{"./inferer-reference":238,"babel-types":265}],240:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){function n(e){var t=r[a];return"*"===t||e===t}if(!this.isMemberExpression())return!1;for(var r=e.split("."),i=[this.node],a=0;i.length;){var s=i.shift();if(t&&a===r.length)return!0;if(F.isIdentifier(s)){if(!n(s.name))return!1}else if(F.isLiteral(s)){if(!n(s.value))return!1}else{if(F.isMemberExpression(s)){if(s.computed&&!F.isLiteral(s.property))return!1;i.unshift(s.property),i.unshift(s.object);continue}if(!F.isThisExpression(s))return!1;if(!n("this"))return!1}if(++a>r.length)return!1}return a===r.length}function s(e){var t=this.node&&this.node[e];return t&&Array.isArray(t)?!!t.length:!!t}function o(){return this.scope.isStatic(this.node)}function u(e){return!this.has(e)}function l(e,t){return this.node[e]===t}function c(e){return F.isType(this.type,e)}function p(){return("init"===this.key||"left"===this.key)&&this.parentPath.isFor()}function f(e){return!("body"!==this.key||!this.parentPath.isArrowFunctionExpression())&&(this.isExpression()?F.isBlockStatement(e):!!this.isBlockStatement()&&F.isExpression(e))}function h(e){var t=this,n=!0;do{var r=t.container;if(t.isFunction()&&!n)return!!e;if(n=!1,Array.isArray(r)&&t.key!==r.length-1)return!1}while((t=t.parentPath)&&!t.isProgram());return!0}function d(){return!this.parentPath.isLabeledStatement()&&!F.isBlockStatement(this.container)&&(0,w.default)(F.STATEMENT_OR_BLOCK_KEYS,this.key)}function y(e,t){if(!this.isReferencedIdentifier())return!1;var n=this.scope.getBinding(this.node.name);if(!n||"module"!==n.kind)return!1;var r=n.path,i=r.parentPath;return!!i.isImportDeclaration()&&(i.node.source.value===e&&(!t||(!(!r.isImportDefaultSpecifier()||"default"!==t)||(!(!r.isImportNamespaceSpecifier()||"*"!==t)||!(!r.isImportSpecifier()||r.node.imported.name!==t)))))}function m(){var e=this.node;return e.end?this.hub.file.code.slice(e.start,e.end):""}function b(e){return"after"!==this._guessExecutionStatusRelativeTo(e)}function g(e){var t=e.scope.getFunctionParent(),n=this.scope.getFunctionParent();if(t.node!==n.node){var r=this._guessExecutionStatusRelativeToDifferentFunctions(t);if(r)return r;e=t.path}var i=e.getAncestry();if(i.indexOf(this)>=0)return"after";var a=this.getAncestry(),s=void 0,o=void 0,u=void 0;for(u=0;u=0){s=l;break}}if(!s)return"before";var c=i[o-1],p=a[u-1];return c&&p?c.listKey&&c.container===p.container?c.key>p.key?"before":"after":F.VISITOR_KEYS[c.type].indexOf(c.key)>F.VISITOR_KEYS[p.type].indexOf(p.key)?"before":"after":"before"}function v(e){var t=e.path;if(t.isFunctionDeclaration()){var n=t.scope.getBinding(t.node.id.name);if(!n.references)return"before";for(var r=n.referencePaths,i=r,a=Array.isArray(i),s=0,i=a?i:(0,C.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;if("callee"!==u.key||!u.parentPath.isCallExpression())return}for(var l=void 0,c=r,p=Array.isArray(c),f=0,c=p?c:(0,C.default)(c);;){var h;if(p){if(f>=c.length)break;h=c[f++]}else{if(f=c.next(),f.done)break;h=f.value}var d=h;if(!!!d.find(function(e){return e.node===t.node})){var y=this._guessExecutionStatusRelativeTo(d);if(l){if(l!==y)return}else l=y}}return l}}function x(e,t){return this._resolve(e,t)||this}function _(e,t){var n=this;if(!(t&&t.indexOf(this)>=0))if(t=t||[],t.push(this),this.isVariableDeclarator()){if(this.get("id").isIdentifier())return this.get("init").resolve(e,t)}else if(this.isReferencedIdentifier()){var r=this.scope.getBinding(this.node.name);if(!r)return;if(!r.constant)return;if("module"===r.kind)return;if(r.path!==this){var i=function(){var i=r.path.resolve(e,t);return n.find(function(e){return e.node===i.node})?{v:void 0}:{v:i}}();if("object"===(void 0===i?"undefined":(0,A.default)(i)))return i.v}}else{if(this.isTypeCastExpression())return this.get("expression").resolve(e,t);if(e&&this.isMemberExpression()){var a=this.toComputedKey();if(!F.isLiteral(a))return;var s=a.value,o=this.get("object").resolve(e,t);if(o.isObjectExpression())for(var u=o.get("properties"),l=u,c=Array.isArray(l),p=0,l=c?l:(0,C.default)(l);;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var h=f;if(h.isProperty()){var d=h.get("key"),y=h.isnt("computed")&&d.isIdentifier({name:s});if(y=y||d.isLiteral({value:s}))return h.get("value").resolve(e,t)}}else if(o.isArrayExpression()&&!isNaN(+s)){var m=o.get("elements"),b=m[s];if(b)return b.resolve(e,t)}}}}n.__esModule=!0,n.is=void 0;var E=e("babel-runtime/helpers/typeof"),A=i(E),D=e("babel-runtime/core-js/get-iterator"),C=i(D);n.matchesPattern=a,n.has=s,n.isStatic=o,n.isnt=u,n.equals=l,n.isNodeType=c,n.canHaveVariableDeclarationOrExpression=p,n.canSwapBetweenExpressionAndStatement=f,n.isCompletionRecord=h,n.isStatementOrBlock=d,n.referencesImport=y,n.getSource=m,n.willIMaybeExecuteBefore=b,n._guessExecutionStatusRelativeTo=g,n._guessExecutionStatusRelativeToDifferentFunctions=v,n.resolve=x,n._resolve=_;var S=e("lodash/includes"),w=i(S),k=e("babel-types"),F=r(k);n.is=s},{"babel-runtime/core-js/get-iterator":100,"babel-runtime/helpers/typeof":118,"babel-types":265,"lodash/includes":473}],241:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var a=e("babel-runtime/helpers/classCallCheck"),s=i(a),o=e("babel-runtime/core-js/get-iterator"),u=i(o),l=e("babel-types"),c=r(l),p={ReferencedIdentifier:function(e,t){if(!e.isJSXIdentifier()||!l.react.isCompatTag(e.node.name)){var n=e.scope.getBinding(e.node.name);if(n&&n===t.scope.getBinding(e.node.name))if(n.constant)t.bindings[e.node.name]=n;else for(var r=n.constantViolations,i=Array.isArray(r),a=0,r=i?r:(0,u.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;t.breakOnScopePaths=t.breakOnScopePaths.concat(o.getAncestry())}}}},f=function(){function e(t,n){(0,s.default)(this,e),this.breakOnScopePaths=[],this.bindings={},this.scopes=[],this.scope=n,this.path=t}return e.prototype.isCompatibleScope=function(e){for(var t in this.bindings){var n=this.bindings[t];if(!e.bindingIdentifierEquals(t,n.identifier))return!1}return!0},e.prototype.getCompatibleScopes=function(){var e=this.path.scope;do{if(!this.isCompatibleScope(e))break;if(this.scopes.push(e),this.breakOnScopePaths.indexOf(e.path)>=0)break}while(e=e.parent)},e.prototype.getAttachmentPath=function(){var e=this._getAttachmentPath();if(e){var t=e.scope;if(t.path===e&&(t=e.scope.parent),t.path.isProgram()||t.path.isFunction())for(var n in this.bindings)if(t.hasOwnBinding(n)){var r=this.bindings[n];if("param"!==r.kind&&this.getAttachmentParentForPath(r.path).key>e.key)return}return e}},e.prototype._getAttachmentPath=function(){var e=this.scopes,t=e.pop();if(t){if(t.path.isFunction()){if(this.hasOwnParamBindings(t)){if(this.scope===t)return;return t.path.get("body").get("body")[0]}return this.getNextScopeAttachmentParent()}return t.path.isProgram()?this.getNextScopeAttachmentParent():void 0}},e.prototype.getNextScopeAttachmentParent=function(){var e=this.scopes.pop();if(e)return this.getAttachmentParentForPath(e.path)},e.prototype.getAttachmentParentForPath=function(e){do if(!e.parentPath||Array.isArray(e.container)&&e.isStatement()||e.isVariableDeclarator()&&e.parentPath.node.declarations.length>1)return e;while(e=e.parentPath)},e.prototype.hasOwnParamBindings=function(e){for(var t in this.bindings)if(e.hasOwnBinding(t)){var n=this.bindings[t];if("param"===n.kind)return!0}return!1},e.prototype.run=function(){var e=this.path.node;if(!e._hoisted){e._hoisted=!0,this.path.traverse(p,this),this.getCompatibleScopes();var t=this.getAttachmentPath();if(t&&t.getFunctionParent()!==this.path.getFunctionParent()){var n=t.scope.generateUidIdentifier("ref"),r=c.variableDeclarator(n,this.path.node);t.insertBefore([t.isVariableDeclarator()?r:c.variableDeclaration("var",[r])]);var i=this.path.parentPath;i.isJSXElement()&&this.path.container===i.node.children&&(n=c.JSXExpressionContainer(n)),this.path.replaceWith(n)}}},e}();n.default=f,t.exports=n.default},{"babel-runtime/core-js/get-iterator":100,"babel-runtime/helpers/classCallCheck":114,"babel-types":265}],242:[function(e,t,n){"use strict";n.__esModule=!0;n.hooks=[function(e,t){if("body"===e.key&&t.isArrowFunctionExpression())return e.replaceWith(e.scope.buildUndefinedNode()),!0},function(e,t){var n=!1;if(n=n||"test"===e.key&&(t.isWhile()||t.isSwitchCase()),n=n||"declaration"===e.key&&t.isExportDeclaration(),n=n||"body"===e.key&&t.isLabeledStatement(),n=n||"declarations"===e.listKey&&t.isVariableDeclaration()&&1===t.node.declarations.length,n=n||"expression"===e.key&&t.isExpressionStatement())return t.remove(),!0},function(e,t){if(t.isSequenceExpression()&&1===t.node.expressions.length)return t.replaceWith(t.node.expressions[0]),!0},function(e,t){if(t.isBinary())return"left"===e.key?t.replaceWith(t.node.right):t.replaceWith(t.node.left),!0},function(e,t){if(t.isIfStatement()&&("consequent"===e.key||"alternate"===e.key)||t.isLoop()&&"body"===e.key)return e.replaceWith({type:"BlockStatement",body:[]}),!0}]},{}],243:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}n.__esModule=!0,n.Flow=n.Pure=n.Generated=n.User=n.Var=n.BlockScoped=n.Referenced=n.Scope=n.Expression=n.Statement=n.BindingIdentifier=n.ReferencedMemberExpression=n.ReferencedIdentifier=void 0;var i=e("babel-types"),a=r(i);n.ReferencedIdentifier={types:["Identifier","JSXIdentifier"],checkPath:function(e,t){var n=e.node,r=e.parent;if(!a.isIdentifier(n,t)&&!a.isJSXMemberExpression(r,t)){if(!a.isJSXIdentifier(n,t))return!1;if(i.react.isCompatTag(n.name))return!1}return a.isReferenced(n,r)}},n.ReferencedMemberExpression={types:["MemberExpression"],checkPath:function(e){var t=e.node,n=e.parent;return a.isMemberExpression(t)&&a.isReferenced(t,n)}},n.BindingIdentifier={types:["Identifier"],checkPath:function(e){var t=e.node,n=e.parent;return a.isIdentifier(t)&&a.isBinding(t,n)}},n.Statement={types:["Statement"],checkPath:function(e){var t=e.node,n=e.parent;if(a.isStatement(t)){if(a.isVariableDeclaration(t)){if(a.isForXStatement(n,{left:t}))return!1;if(a.isForStatement(n,{init:t}))return!1}return!0}return!1}},n.Expression={types:["Expression"],checkPath:function(e){return e.isIdentifier()?e.isReferencedIdentifier():a.isExpression(e.node)}},n.Scope={types:["Scopable"],checkPath:function(e){return a.isScope(e.node,e.parent)}},n.Referenced={checkPath:function(e){return a.isReferenced(e.node,e.parent)}},n.BlockScoped={checkPath:function(e){return a.isBlockScoped(e.node)}},n.Var={types:["VariableDeclaration"],checkPath:function(e){return a.isVar(e.node)}},n.User={checkPath:function(e){return e.node&&!!e.node.loc}},n.Generated={checkPath:function(e){return!e.isUser()}},n.Pure={checkPath:function(e,t){return e.scope.isPure(e.node,t)}},n.Flow={types:["Flow","ImportDeclaration","ExportDeclaration"],checkPath:function(e){var t=e.node;return!!a.isFlow(t)||(a.isImportDeclaration(t)?"type"===t.importKind||"typeof"===t.importKind:!!a.isExportDeclaration(t)&&"type"===t.exportKind)}}},{"babel-types":265}],244:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertBefore(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key)this.node&&e.push(this.node),this.replaceExpressionWithStatements(e);else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertBefore(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.push(this.node),this._replaceWith(S.blockStatement(e))}return[this]}function s(e,t){this.updateSiblingKeys(e,t.length);for(var n=[],r=0;r=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var f=p;f.setScope(),f.debug(function(){return"Inserted."});for(var h=o,d=Array.isArray(h),y=0,h=d?h:(0,v.default)(h);;){var m;if(d){if(y>=h.length)break;m=h[y++]}else{if(y=h.next(),y.done)break;m=y.value}m.maybeQueue(f,!0)}}return n}function o(e){return this._containerInsert(this.key,e)}function u(e){return this._containerInsert(this.key+1,e)}function l(e){var t=e[e.length-1];(S.isIdentifier(t)||S.isExpressionStatement(t)&&S.isIdentifier(t.expression))&&!this.isCompletionRecord()&&e.pop()}function c(e){if(this._assertUnremoved(),e=this._verifyNodeList(e),this.parentPath.isExpressionStatement()||this.parentPath.isLabeledStatement())return this.parentPath.insertAfter(e);if(this.isNodeType("Expression")||this.parentPath.isForStatement()&&"init"===this.key){if(this.node){var t=this.scope.generateDeclaredUidIdentifier();e.unshift(S.expressionStatement(S.assignmentExpression("=",t,this.node))),e.push(S.expressionStatement(t))}this.replaceExpressionWithStatements(e)}else{if(this._maybePopFromStatements(e),Array.isArray(this.container))return this._containerInsertAfter(e);if(!this.isStatementOrBlock())throw new Error("We don't know what to do with this node type. We were previously a Statement but we can't fit in here?");this.node&&e.unshift(this.node),this._replaceWith(S.blockStatement(e))}return[this]}function p(e,t){if(this.parent)for(var n=x.path.get(this.parent),r=0;r=e&&(i.key+=t)}}function f(e){if(!e)return[];e.constructor!==Array&&(e=[e]);for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:this.scope;return new E.default(this,e).run()}n.__esModule=!0;var m=e("babel-runtime/helpers/typeof"),b=i(m),g=e("babel-runtime/core-js/get-iterator"),v=i(g);n.insertBefore=a,n._containerInsert=s,n._containerInsertBefore=o,n._containerInsertAfter=u,n._maybePopFromStatements=l,n.insertAfter=c,n.updateSiblingKeys=p,n._verifyNodeList=f,n.unshiftContainer=h,n.pushContainer=d,n.hoist=y;var x=e("../cache"),_=e("./lib/hoister"),E=i(_),A=e("./index"),D=i(A),C=e("babel-types"),S=r(C)},{"../cache":226,"./index":236,"./lib/hoister":241,"babel-runtime/core-js/get-iterator":100,"babel-runtime/helpers/typeof":118,"babel-types":265}],245:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){if(this._assertUnremoved(),this.resync(),this._callRemovalHooks())return void this._markRemoved();this.shareCommentsWithSiblings(),this._remove(),this._markRemoved()}function a(){for(var e=p.hooks,t=Array.isArray(e),n=0,e=t?e:(0,c.default)(e);;){var r;if(t){if(n>=e.length)break;r=e[n++]}else{if(n=e.next(),n.done)break;r=n.value}if(r(this,this.parentPath))return!0}}function s(){Array.isArray(this.container)?(this.container.splice(this.key,1),this.updateSiblingKeys(this.key,-1)):this._replaceWith(null)}function o(){this.shouldSkip=!0,this.removed=!0,this.node=null}function u(){if(this.removed)throw this.buildCodeFrameError("NodePath has been removed so is read-only.")}n.__esModule=!0;var l=e("babel-runtime/core-js/get-iterator"),c=r(l);n.remove=i,n._callRemovalHooks=a,n._remove=s,n._markRemoved=o,n._assertUnremoved=u;var p=e("./lib/removal-hooks")},{"./lib/removal-hooks":242,"babel-runtime/core-js/get-iterator":100}],246:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){this.resync(),e=this._verifyNodeList(e),_.inheritLeadingComments(e[0],this.node),_.inheritTrailingComments(e[e.length-1],this.node),this.node=this.container[this.key]=null,this.insertAfter(e),this.node?this.requeue():this.remove()}function s(e){this.resync();try{e="("+e+")",e=(0,v.parse)(e)}catch(n){var t=n.loc;throw t&&(n.message+=" - make sure this is an expression.",n.message+="\n"+(0,d.default)(e,t.line,t.column+1)),n}return e=e.program.body[0].expression,m.default.removeProperties(e),this.replaceWith(e)}function o(e){if(this.resync(),this.removed)throw new Error("You can't replace this node, we've already removed it");if(e instanceof g.default&&(e=e.node),!e)throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");if(this.node!==e){if(this.isProgram()&&!_.isProgram(e))throw new Error("You can only replace a Program root node with another Program node");if(Array.isArray(e))throw new Error("Don't use `path.replaceWith()` with an array of nodes, use `path.replaceWithMultiple()`") +;if("string"==typeof e)throw new Error("Don't use `path.replaceWith()` with a source string, use `path.replaceWithSourceString()`");if(this.isNodeType("Statement")&&_.isExpression(e)&&(this.canHaveVariableDeclarationOrExpression()||this.canSwapBetweenExpressionAndStatement(e)||(e=_.expressionStatement(e))),this.isNodeType("Expression")&&_.isStatement(e)&&!this.canHaveVariableDeclarationOrExpression()&&!this.canSwapBetweenExpressionAndStatement(e))return this.replaceExpressionWithStatements([e]);var t=this.node;t&&(_.inheritsComments(e,t),_.removeComments(t)),this._replaceWith(e),this.type=e.type,this.setScope(),this.requeue()}}function u(e){if(!this.container)throw new ReferenceError("Container is falsy");this.inList?_.validate(this.parent,this.key,[e]):_.validate(this.parent,this.key,e),this.debug(function(){return"Replace with "+(e&&e.type)}),this.node=this.container[this.key]=e}function l(e){this.resync();var t=_.toSequenceExpression(e,this.scope);if(_.isSequenceExpression(t)){var n=t.expressions;n.length>=2&&this.parentPath.isExpressionStatement()&&this._maybePopFromStatements(n),1===n.length?this.replaceWith(n[0]):this.replaceWith(t)}else{if(!t){var r=_.functionExpression(null,[],_.blockStatement(e));r.shadow=!0,this.replaceWith(_.callExpression(r,[])),this.traverse(E);for(var i=this.get("callee").getCompletionRecords(),a=i,s=Array.isArray(a),o=0,a=s?a:(0,f.default)(a);;){var u;if(s){if(o>=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;if(l.isExpressionStatement()){if(l.findParent(function(e){return e.isLoop()})){var c=this.get("callee"),p=c.scope.generateDeclaredUidIdentifier("ret");c.get("body").pushContainer("body",_.returnStatement(p)),l.get("expression").replaceWith(_.assignmentExpression("=",p,l.node.expression))}else l.replaceWith(_.returnStatement(l.node.expression))}}return this.node}this.replaceWith(t)}}function c(e){return this.resync(),Array.isArray(e)?Array.isArray(this.container)?(e=this._verifyNodeList(e),this._containerInsertAfter(e),this.remove()):this.replaceWithMultiple(e):this.replaceWith(e)}n.__esModule=!0;var p=e("babel-runtime/core-js/get-iterator"),f=i(p);n.replaceWithMultiple=a,n.replaceWithSourceString=s,n.replaceWith=o,n._replaceWith=u,n.replaceExpressionWithStatements=l,n.replaceInline=c;var h=e("babel-code-frame"),d=i(h),y=e("../index"),m=i(y),b=e("./index"),g=i(b),v=e("babylon"),x=e("babel-types"),_=r(x),E={Function:function(e){e.skip()},VariableDeclaration:function(e){if("var"===e.node.kind){var t=e.getBindingIdentifiers();for(var n in t)e.scope.push({id:t[n]});for(var r=[],i=e.node.declarations,a=Array.isArray(i),s=0,i=a?i:(0,f.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;u.init&&r.push(_.expressionStatement(_.assignmentExpression("=",u.id,u.init)))}e.replaceWithMultiple(r)}}}},{"../index":229,"./index":236,"babel-code-frame":60,"babel-runtime/core-js/get-iterator":100,"babel-types":265,babylon:274}],247:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var i=e("babel-runtime/helpers/classCallCheck"),a=r(i),s=function(){function e(t){var n=t.existing,r=t.identifier,i=t.scope,s=t.path,o=t.kind;(0,a.default)(this,e),this.identifier=r,this.scope=i,this.path=s,this.kind=o,this.constantViolations=[],this.constant=!0,this.referencePaths=[],this.referenced=!1,this.references=0,this.clearValue(),n&&(this.constantViolations=[].concat(n.path,n.constantViolations,this.constantViolations))}return e.prototype.deoptValue=function(){this.clearValue(),this.hasDeoptedValue=!0},e.prototype.setValue=function(e){this.hasDeoptedValue||(this.hasValue=!0,this.value=e)},e.prototype.clearValue=function(){this.hasDeoptedValue=!1,this.hasValue=!1,this.value=null},e.prototype.reassign=function(e){this.constant=!1,this.constantViolations.indexOf(e)===-1&&this.constantViolations.push(e)},e.prototype.reference=function(e){this.referencePaths.indexOf(e)===-1&&(this.referenced=!0,this.references++,this.referencePaths.push(e))},e.prototype.dereference=function(){this.references--,this.referenced=!!this.references},e}();n.default=s,t.exports=n.default},{"babel-runtime/helpers/classCallCheck":114}],248:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t,n){for(var r=I.scope.get(e.node)||[],i=r,a=Array.isArray(i),s=0,i=a?i:(0,m.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;if(u.parent===t&&u.path===e)return u}r.push(n),I.scope.has(e.node)||I.scope.set(e.node,r)}function s(e,t){if(O.isModuleDeclaration(e))if(e.source)s(e.source,t);else if(e.specifiers&&e.specifiers.length)for(var n=e.specifiers,r=Array.isArray(n),i=0,n=r?n:(0,m.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var o=a;s(o,t)}else e.declaration&&s(e.declaration,t);else if(O.isModuleSpecifier(e))s(e.local,t);else if(O.isMemberExpression(e))s(e.object,t),s(e.property,t);else if(O.isIdentifier(e))t.push(e.name);else if(O.isLiteral(e))t.push(e.value);else if(O.isCallExpression(e))s(e.callee,t);else if(O.isObjectExpression(e)||O.isObjectPattern(e))for(var u=e.properties,l=Array.isArray(u),c=0,u=l?u:(0,m.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var f=p;s(f.key||f.argument,t)}}n.__esModule=!0;var o=e("babel-runtime/core-js/object/keys"),u=i(o),l=e("babel-runtime/core-js/object/create"),c=i(l),p=e("babel-runtime/core-js/map"),f=i(p),h=e("babel-runtime/helpers/classCallCheck"),d=i(h),y=e("babel-runtime/core-js/get-iterator"),m=i(y),b=e("lodash/includes"),g=i(b),v=e("lodash/repeat"),x=i(v),_=e("./lib/renamer"),E=i(_),A=e("../index"),D=i(A),C=e("lodash/defaults"),S=i(C),w=e("babel-messages"),k=r(w),F=e("./binding"),T=i(F),P=e("globals"),j=i(P),B=e("babel-types"),O=r(B),I=e("../cache"),N=0,L={For:function(e){for(var t=O.FOR_INIT_KEYS,n=Array.isArray(t),r=0,t=n?t:(0,m.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i,s=e.get(a);s.isVar()&&e.scope.getFunctionParent().registerBinding("var",s)}},Declaration:function(e){e.isBlockScoped()||e.isExportDeclaration()&&e.get("declaration").isDeclaration()||e.scope.getFunctionParent().registerDeclaration(e)},ReferencedIdentifier:function(e,t){t.references.push(e)},ForXStatement:function(e,t){var n=e.get("left");(n.isPattern()||n.isIdentifier())&&t.constantViolations.push(n)},ExportDeclaration:{exit:function(e){var t=e.node,n=e.scope,r=t.declaration;if(O.isClassDeclaration(r)||O.isFunctionDeclaration(r)){var i=r.id;if(!i)return;var a=n.getBinding(i.name);a&&a.reference(e)}else if(O.isVariableDeclaration(r))for(var s=r.declarations,o=Array.isArray(s),u=0,s=o?s:(0,m.default)(s);;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l,p=O.getBindingIdentifiers(c);for(var f in p){var h=n.getBinding(f);h&&h.reference(e)}}}},LabeledStatement:function(e){e.scope.getProgramParent().addGlobal(e.node),e.scope.getBlockParent().registerDeclaration(e)},AssignmentExpression:function(e,t){t.assignments.push(e)},UpdateExpression:function(e,t){t.constantViolations.push(e.get("argument"))},UnaryExpression:function(e,t){"delete"===e.node.operator&&t.constantViolations.push(e.get("argument"))},BlockScoped:function(e){var t=e.scope;t.path===e&&(t=t.parent),t.getBlockParent().registerDeclaration(e)},ClassDeclaration:function(e){var t=e.node.id;if(t){var n=t.name;e.scope.bindings[n]=e.scope.getBinding(n)}},Block:function(e){for(var t=e.get("body"),n=t,r=Array.isArray(n),i=0,n=r?n:(0,m.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a;s.isFunctionDeclaration()&&e.scope.getBlockParent().registerDeclaration(s)}}},M=0,R=function(){function e(t,n){if((0,d.default)(this,e),n&&n.block===t.node)return n;var r=a(t,n,this);if(r)return r;this.uid=M++,this.parent=n,this.hub=t.hub,this.parentBlock=t.parent,this.block=t.node,this.path=t,this.labels=new f.default}return e.prototype.traverse=function(e,t,n){(0,D.default)(e,t,this,n,this.path)},e.prototype.generateDeclaredUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp",t=this.generateUidIdentifier(e);return this.push({id:t}),t},e.prototype.generateUidIdentifier=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";return O.identifier(this.generateUid(e))},e.prototype.generateUid=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"temp";e=O.toIdentifier(e).replace(/^_+/,"").replace(/[0-9]+$/g,"");var t=void 0,n=0;do t=this._generateUid(e,n),n++;while(this.hasLabel(t)||this.hasBinding(t)||this.hasGlobal(t)||this.hasReference(t));var r=this.getProgramParent();return r.references[t]=!0,r.uids[t]=!0,t},e.prototype._generateUid=function(e,t){var n=e;return t>1&&(n+=t),"_"+n},e.prototype.generateUidIdentifierBasedOnNode=function(e,t){var n=e;O.isAssignmentExpression(e)?n=e.left:O.isVariableDeclarator(e)?n=e.id:(O.isObjectProperty(n)||O.isObjectMethod(n))&&(n=n.key);var r=[];s(n,r);var i=r.join("$");return i=i.replace(/^_/,"")||t||"ref",this.generateUidIdentifier(i.slice(0,20))},e.prototype.isStatic=function(e){if(O.isThisExpression(e)||O.isSuper(e))return!0;if(O.isIdentifier(e)){var t=this.getBinding(e.name);return t?t.constant:this.hasBinding(e.name)}return!1},e.prototype.maybeGenerateMemoised=function(e,t){if(this.isStatic(e))return null;var n=this.generateUidIdentifierBasedOnNode(e);return t||this.push({id:n}),n},e.prototype.checkBlockScopedCollisions=function(e,t,n,r){if("param"!==t&&("hoisted"!==t||"let"!==e.kind)){var i=!1;if(i||(i="let"===t||"let"===e.kind||"const"===e.kind||"module"===e.kind),i||(i="param"===e.kind&&("let"===t||"const"===t)),i)throw this.hub.file.buildCodeFrameError(r,k.get("scopeDuplicateDeclaration",n),TypeError)}},e.prototype.rename=function(e,t,n){var r=this.getBinding(e);if(r)return t=t||this.generateUidIdentifier(e).name,new E.default(r,e,t).rename(n)},e.prototype._renameFromMap=function(e,t,n,r){e[t]&&(e[n]=r,e[t]=null)},e.prototype.dump=function(){var e=(0,x.default)("-",60);console.log(e);var t=this;do{console.log("#",t.block.type);for(var n in t.bindings){var r=t.bindings[n];console.log(" -",n,{constant:r.constant,references:r.references,violations:r.constantViolations.length,kind:r.kind})}}while(t=t.parent);console.log(e)},e.prototype.toArray=function(e,t){var n=this.hub.file;if(O.isIdentifier(e)){var r=this.getBinding(e.name);if(r&&r.constant&&r.path.isGenericType("Array"))return e}if(O.isArrayExpression(e))return e;if(O.isIdentifier(e,{name:"arguments"}))return O.callExpression(O.memberExpression(O.memberExpression(O.memberExpression(O.identifier("Array"),O.identifier("prototype")),O.identifier("slice")),O.identifier("call")),[e]);var i="toArray",a=[e];return t===!0?i="toConsumableArray":t&&(a.push(O.numericLiteral(t)),i="slicedToArray"),O.callExpression(n.addHelper(i),a)},e.prototype.hasLabel=function(e){return!!this.getLabel(e)},e.prototype.getLabel=function(e){return this.labels.get(e)},e.prototype.registerLabel=function(e){this.labels.set(e.node.label.name,e)},e.prototype.registerDeclaration=function(e){if(e.isLabeledStatement())this.registerLabel(e);else if(e.isFunctionDeclaration())this.registerBinding("hoisted",e.get("id"),e);else if(e.isVariableDeclaration())for(var t=e.get("declarations"),n=t,r=Array.isArray(n),i=0,n=r?n:(0,m.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a;this.registerBinding(e.node.kind,s)}else if(e.isClassDeclaration())this.registerBinding("let",e);else if(e.isImportDeclaration())for(var o=e.get("specifiers"),u=o,l=Array.isArray(u),c=0,u=l?u:(0,m.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var f=p;this.registerBinding("module",f)}else if(e.isExportDeclaration()){var h=e.get("declaration");(h.isClassDeclaration()||h.isFunctionDeclaration()||h.isVariableDeclaration())&&this.registerDeclaration(h)}else this.registerBinding("unknown",e)},e.prototype.buildUndefinedNode=function(){return this.hasBinding("undefined")?O.unaryExpression("void",O.numericLiteral(0),!0):O.identifier("undefined")},e.prototype.registerConstantViolation=function(e){var t=e.getBindingIdentifiers();for(var n in t){var r=this.getBinding(n);r&&r.reassign(e)}},e.prototype.registerBinding=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;if(!e)throw new ReferenceError("no `kind`");if(t.isVariableDeclaration())for(var r=t.get("declarations"),i=r,a=Array.isArray(i),s=0,i=a?i:(0,m.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o;this.registerBinding(e,u)}else{var l=this.getProgramParent(),c=t.getBindingIdentifiers(!0);for(var p in c)for(var f=c[p],h=Array.isArray(f),d=0,f=h?f:(0,m.default)(f);;){var y;if(h){if(d>=f.length)break;y=f[d++]}else{if(d=f.next(),d.done)break;y=d.value}var b=y,g=this.getOwnBinding(p);if(g){if(g.identifier===b)continue;this.checkBlockScopedCollisions(g,e,p,b)}g&&g.path.isFlow()&&(g=null),l.references[p]=!0,this.bindings[p]=new T.default({identifier:b,existing:g,scope:this,path:n,kind:e})}}},e.prototype.addGlobal=function(e){this.globals[e.name]=e},e.prototype.hasUid=function(e){var t=this;do if(t.uids[e])return!0;while(t=t.parent);return!1},e.prototype.hasGlobal=function(e){var t=this;do if(t.globals[e])return!0;while(t=t.parent);return!1},e.prototype.hasReference=function(e){var t=this;do if(t.references[e])return!0;while(t=t.parent);return!1},e.prototype.isPure=function(e,t){if(O.isIdentifier(e)){var n=this.getBinding(e.name);return!!n&&(!t||n.constant)}if(O.isClass(e))return!(e.superClass&&!this.isPure(e.superClass,t))&&this.isPure(e.body,t);if(O.isClassBody(e)){for(var r=e.body,i=Array.isArray(r),a=0,r=i?r:(0,m.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;if(!this.isPure(o,t))return!1}return!0}if(O.isBinary(e))return this.isPure(e.left,t)&&this.isPure(e.right,t);if(O.isArrayExpression(e)){for(var u=e.elements,l=Array.isArray(u),c=0,u=l?u:(0,m.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var f=p;if(!this.isPure(f,t))return!1}return!0}if(O.isObjectExpression(e)){for(var h=e.properties,d=Array.isArray(h),y=0,h=d?h:(0,m.default)(h);;){var b;if(d){if(y>=h.length)break;b=h[y++]}else{if(y=h.next(),y.done)break;b=y.value}var g=b;if(!this.isPure(g,t))return!1}return!0}return O.isClassMethod(e)?!(e.computed&&!this.isPure(e.key,t))&&("get"!==e.kind&&"set"!==e.kind):O.isClassProperty(e)||O.isObjectProperty(e)?!(e.computed&&!this.isPure(e.key,t))&&this.isPure(e.value,t):O.isUnaryExpression(e)?this.isPure(e.argument,t):O.isPureish(e)},e.prototype.setData=function(e,t){return this.data[e]=t},e.prototype.getData=function(e){var t=this;do{var n=t.data[e];if(null!=n)return n}while(t=t.parent)},e.prototype.removeData=function(e){var t=this;do{null!=t.data[e]&&(t.data[e]=null)}while(t=t.parent)},e.prototype.init=function(){this.references||this.crawl()},e.prototype.crawl=function(){N++,this._crawl(),N--},e.prototype._crawl=function(){var e=this.path;if(this.references=(0,c.default)(null),this.bindings=(0,c.default)(null),this.globals=(0,c.default)(null),this.uids=(0,c.default)(null),this.data=(0,c.default)(null),e.isLoop())for(var t=O.FOR_INIT_KEYS,n=Array.isArray(t),r=0,t=n?t:(0,m.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i,s=e.get(a);s.isBlockScoped()&&this.registerBinding(s.node.kind,s)}if(e.isFunctionExpression()&&e.has("id")&&(e.get("id").node[O.NOT_LOCAL_BINDING]||this.registerBinding("local",e.get("id"),e)),e.isClassExpression()&&e.has("id")&&(e.get("id").node[O.NOT_LOCAL_BINDING]||this.registerBinding("local",e)),e.isFunction())for(var o=e.get("params"),u=o,l=Array.isArray(u),p=0,u=l?u:(0,m.default)(u);;){var f;if(l){if(p>=u.length)break;f=u[p++]}else{if(p=u.next(),p.done)break;f=p.value}var h=f;this.registerBinding("param",h)}if(e.isCatchClause()&&this.registerBinding("let",e),!this.getProgramParent().crawling){var d={references:[],constantViolations:[],assignments:[]};this.crawling=!0,e.traverse(L,d),this.crawling=!1;for(var y=d.assignments,b=Array.isArray(y),g=0,y=b?y:(0,m.default)(y);;){var v;if(b){if(g>=y.length)break;v=y[g++]}else{if(g=y.next(),g.done)break;v=g.value}var x=v,_=x.getBindingIdentifiers(),E=void 0;for(var A in _)x.scope.getBinding(A)||(E=E||x.scope.getProgramParent(),E.addGlobal(_[A]));x.scope.registerConstantViolation(x)}for(var D=d.references,C=Array.isArray(D),S=0,D=C?D:(0,m.default)(D);;){var w;if(C){if(S>=D.length)break;w=D[S++]}else{if(S=D.next(),S.done)break;w=S.value}var k=w,F=k.scope.getBinding(k.node.name);F?F.reference(k):k.scope.getProgramParent().addGlobal(k.node)}for(var T=d.constantViolations,P=Array.isArray(T),j=0,T=P?T:(0,m.default)(T);;){var B;if(P){if(j>=T.length)break;B=T[j++]}else{if(j=T.next(),j.done)break;B=j.value}var I=B;I.scope.registerConstantViolation(I)}}},e.prototype.push=function(e){var t=this.path;t.isBlockStatement()||t.isProgram()||(t=this.getBlockParent().path),t.isSwitchStatement()&&(t=this.getFunctionParent().path),(t.isLoop()||t.isCatchClause()||t.isFunction())&&(O.ensureBlock(t.node),t=t.get("body"));var n=e.unique,r=e.kind||"var",i=null==e._blockHoist?2:e._blockHoist,a="declaration:"+r+":"+i,s=!n&&t.getData(a);if(!s){var o=O.variableDeclaration(r,[]);o._generated=!0,o._blockHoist=i;s=t.unshiftContainer("body",[o])[0],n||t.setData(a,s)}var u=O.variableDeclarator(e.id,e.init);s.node.declarations.push(u),this.registerBinding(r,s.get("declarations").pop())},e.prototype.getProgramParent=function(){var e=this;do if(e.path.isProgram())return e;while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getFunctionParent=function(){var e=this;do if(e.path.isFunctionParent())return e;while(e=e.parent);throw new Error("We couldn't find a Function or Program...")},e.prototype.getBlockParent=function(){var e=this;do if(e.path.isBlockParent())return e;while(e=e.parent);throw new Error("We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...")},e.prototype.getAllBindings=function(){var e=(0,c.default)(null),t=this;do(0,S.default)(e,t.bindings),t=t.parent;while(t);return e},e.prototype.getAllBindingsOfKind=function(){for(var e=(0,c.default)(null),t=arguments,n=Array.isArray(t),r=0,t=n?t:(0,m.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i,s=this;do{for(var o in s.bindings){var u=s.bindings[o];u.kind===a&&(e[o]=u)}s=s.parent}while(s)}return e},e.prototype.bindingIdentifierEquals=function(e,t){return this.getBindingIdentifier(e)===t},e.prototype.warnOnFlowBinding=function(e){return 0===N&&e&&e.path.isFlow()&&console.warn("\n You or one of the Babel plugins you are using are using Flow declarations as bindings.\n Support for this will be removed in version 6.8. To find out the caller, grep for this\n message and change it to a `console.trace()`.\n "),e},e.prototype.getBinding=function(e){var t=this;do{var n=t.getOwnBinding(e);if(n)return this.warnOnFlowBinding(n)}while(t=t.parent)},e.prototype.getOwnBinding=function(e){return this.warnOnFlowBinding(this.bindings[e])},e.prototype.getBindingIdentifier=function(e){var t=this.getBinding(e);return t&&t.identifier},e.prototype.getOwnBindingIdentifier=function(e){var t=this.bindings[e];return t&&t.identifier},e.prototype.hasOwnBinding=function(e){return!!this.getOwnBinding(e)},e.prototype.hasBinding=function(t,n){return!!t&&(!!this.hasOwnBinding(t)||(!!this.parentHasBinding(t,n)||(!!this.hasUid(t)||(!(n||!(0,g.default)(e.globals,t))||!(n||!(0,g.default)(e.contextVariables,t))))))},e.prototype.parentHasBinding=function(e,t){return this.parent&&this.parent.hasBinding(e,t)},e.prototype.moveBindingTo=function(e,t){var n=this.getBinding(e);n&&(n.scope.removeOwnBinding(e),n.scope=t,t.bindings[e]=n)},e.prototype.removeOwnBinding=function(e){delete this.bindings[e]},e.prototype.removeBinding=function(e){var t=this.getBinding(e);t&&t.scope.removeOwnBinding(e);var n=this;do n.uids[e]&&(n.uids[e]=!1);while(n=n.parent)},e}();R.globals=(0,u.default)(j.default.builtin),R.contextVariables=["arguments","undefined","Infinity","NaN"],n.default=R,t.exports=n.default},{"../cache":226,"../index":229,"./binding":247,"./lib/renamer":249,"babel-messages":99,"babel-runtime/core-js/get-iterator":100,"babel-runtime/core-js/map":102,"babel-runtime/core-js/object/create":105,"babel-runtime/core-js/object/keys":107,"babel-runtime/helpers/classCallCheck":114,"babel-types":265,globals:252,"lodash/defaults":460,"lodash/includes":473,"lodash/repeat":498}],249:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}n.__esModule=!0;var a=e("babel-runtime/helpers/classCallCheck"),s=i(a),o=e("../binding"),u=(i(o),e("babel-types")),l=r(u),c={ReferencedIdentifier:function(e,t){var n=e.node;n.name===t.oldName&&(n.name=t.newName)},Scope:function(e,t){e.scope.bindingIdentifierEquals(t.oldName,t.binding.identifier)||e.skip()},"AssignmentExpression|Declaration":function(e,t){var n=e.getOuterBindingIdentifiers();for(var r in n)r===t.oldName&&(n[r].name=t.newName)}},p=function(){function e(t,n,r){(0,s.default)(this,e),this.newName=r,this.oldName=n,this.binding=t}return e.prototype.maybeConvertFromExportDeclaration=function(e){var t=e.parentPath.isExportDeclaration()&&e.parentPath;if(t){var n=t.isExportDefaultDeclaration();n&&(e.isFunctionDeclaration()||e.isClassDeclaration())&&!e.node.id&&(e.node.id=e.scope.generateUidIdentifier("default"));var r=e.getOuterBindingIdentifiers(),i=[];for(var a in r){var s=a===this.oldName?this.newName:a,o=n?"default":a;i.push(l.exportSpecifier(l.identifier(s),l.identifier(o)))}if(i.length){var u=l.exportNamedDeclaration(null,i);e.isFunctionDeclaration()&&(u._blockHoist=3),t.insertAfter(u),t.replaceWith(e.node)}}},e.prototype.maybeConvertFromClassFunctionDeclaration=function(e){},e.prototype.maybeConvertFromClassFunctionExpression=function(e){},e.prototype.rename=function(e){var t=this.binding,n=this.oldName,r=this.newName,i=t.scope,a=t.path,s=a.find(function(e){return e.isDeclaration()||e.isFunctionExpression()});s&&this.maybeConvertFromExportDeclaration(s),i.traverse(e||i.block,c,this),e||(i.removeOwnBinding(n),i.bindings[r]=t,this.binding.identifier.name=r),t.type,s&&(this.maybeConvertFromClassFunctionDeclaration(s),this.maybeConvertFromClassFunctionExpression(s))},e}();n.default=p,t.exports=n.default},{"../binding":247,"babel-runtime/helpers/classCallCheck":114,"babel-types":265}],250:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e._exploded)return e;e._exploded=!0;for(var t in e)if(!h(t)){var n=t.split("|");if(1!==n.length){var r=e[t];delete e[t];for(var i=n,a=Array.isArray(i),o=0,i=a?i:(0,x.default)(i);;){var u;if(a){if(o>=i.length)break;u=i[o++]}else{if(o=i.next(),o.done)break;u=o.value}var l=u;e[l]=r}}}s(e),delete e.__esModule,c(e),p(e);for(var y=(0,g.default)(e),m=Array.isArray(y),b=0,y=m?y:(0,x.default)(y);;){var v;if(m){if(b>=y.length)break;v=y[b++]}else{if(b=y.next(),b.done)break;v=b.value}var _=v;if(!h(_)){var A=E[_];if(A){var D=e[_];for(var C in D)D[C]=f(A,D[C]);if(delete e[_],A.types)for(var w=A.types,F=Array.isArray(w),T=0,w=F?w:(0,x.default)(w);;){var P;if(F){if(T>=w.length)break;P=w[T++]}else{if(T=w.next(),T.done)break;P=T.value}var j=P;e[j]?d(e[j],D):e[j]=D}else d(e,D)}}}for(var B in e)if(!h(B)){var O=e[B],I=S.FLIPPED_ALIAS_KEYS[B],N=S.DEPRECATED_KEYS[B];if(N&&(console.trace("Visitor defined for "+B+" but it has been renamed to "+N),I=[N]),I){delete e[B];for(var L=I,M=Array.isArray(L),R=0,L=M?L:(0,x.default)(L);;){var U;if(M){if(R>=L.length)break;U=L[R++]}else{if(R=L.next(),R.done)break;U=R.value}var V=U,G=e[V];G?d(G,O):e[V]=(0,k.default)(O)}}}for(var q in e)h(q)||p(e[q]);return e}function s(e){if(!e._verified){if("function"==typeof e)throw new Error(D.get("traverseVerifyRootFunction"));for(var t in e)if("enter"!==t&&"exit"!==t||o(t,e[t]),!h(t)){if(S.TYPES.indexOf(t)<0)throw new Error(D.get("traverseVerifyNodeType",t));var n=e[t];if("object"===(void 0===n?"undefined":(0,m.default)(n)))for(var r in n){if("enter"!==r&&"exit"!==r)throw new Error(D.get("traverseVerifyVisitorProperty",t,r));o(t+"."+r,n[r])}}e._verified=!0}}function o(e,t){for(var n=[].concat(t),r=n,i=Array.isArray(r),a=0,r=i?r:(0,x.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;if("function"!=typeof o)throw new TypeError("Non-function found defined in "+e+" with type "+(void 0===o?"undefined":(0,m.default)(o)))}}function u(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments[2],r={},i=0;i","<",">=","<="]),o=n.EQUALITY_BINARY_OPERATORS=["==","===","!=","!=="],u=n.COMPARISON_BINARY_OPERATORS=[].concat(o,["in","instanceof"]),l=n.BOOLEAN_BINARY_OPERATORS=[].concat(u,s),c=n.NUMBER_BINARY_OPERATORS=["-","/","%","*","**","&","|",">>",">>>","<<","^"],p=(n.BINARY_OPERATORS=["+"].concat(c,l),n.BOOLEAN_UNARY_OPERATORS=["delete","!"]),f=n.NUMBER_UNARY_OPERATORS=["+","-","++","--","~"],h=n.STRING_UNARY_OPERATORS=["typeof"];n.UNARY_OPERATORS=["void"].concat(p,f,h),n.INHERIT_KEYS={optional:["typeAnnotation","typeParameters","returnType"],force:["start","loc","end"]},n.BLOCK_SCOPED_SYMBOL=(0,a.default)("var used to be block scoped"),n.NOT_LOCAL_BINDING=(0,a.default)("should not be considered a local binding")},{"babel-runtime/core-js/symbol/for":110}],255:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.key||e.property;return e.computed||F.isIdentifier(t)&&(t=F.stringLiteral(t.name)),t}function s(e,t){function n(e){for(var a=!1,s=[],o=e,u=Array.isArray(o),l=0,o=u?o:(0,v.default)(o);;){var c;if(u){if(l>=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var p=c;if(F.isExpression(p))s.push(p);else if(F.isExpressionStatement(p))s.push(p.expression);else{if(F.isVariableDeclaration(p)){if("var"!==p.kind)return i=!0;for(var f=p.declarations,h=Array.isArray(f),d=0,f=h?f:(0,v.default)(f);;){var y;if(h){if(d>=f.length)break;y=f[d++]}else{if(d=f.next(),d.done)break;y=d.value}var m=y,b=F.getBindingIdentifiers(m);for(var g in b)r.push({kind:p.kind,id:b[g]});m.init&&s.push(F.assignmentExpression("=",m.id,m.init))}a=!0;continue}if(F.isIfStatement(p)){var x=p.consequent?n([p.consequent]):t.buildUndefinedNode(),_=p.alternate?n([p.alternate]):t.buildUndefinedNode();if(!x||!_)return i=!0;s.push(F.conditionalExpression(p.test,x,_))}else{if(!F.isBlockStatement(p)){if(F.isEmptyStatement(p)){a=!0;continue}return i=!0}s.push(n(p.body))}}a=!1}return(a||0===s.length)&&s.push(t.buildUndefinedNode()),1===s.length?s[0]:F.sequenceExpression(s)}if(e&&e.length){var r=[],i=!1,a=n(e);if(!i){for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:e.key,n=void 0;return"method"===e.kind?o.increment()+"":(n=F.isIdentifier(t)?t.name:F.isStringLiteral(t)?(0,b.default)(t.value):(0,b.default)(F.removePropertiesDeep(F.cloneDeep(t))),e.computed&&(n="["+n+"]"),e.static&&(n="static:"+n),n)}function u(e){return e+="",e=e.replace(/[^a-zA-Z0-9$_]/g,"-"),e=e.replace(/^[-0-9]+/,""),e=e.replace(/[-\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),F.isValidIdentifier(e)||(e="_"+e),e||"_"}function l(e){return e=u(e),"eval"!==e&&"arguments"!==e||(e="_"+e),e}function c(e,t){if(F.isStatement(e))return e;var n=!1,r=void 0;if(F.isClass(e))n=!0,r="ClassDeclaration";else if(F.isFunction(e))n=!0,r="FunctionDeclaration";else if(F.isAssignmentExpression(e))return F.expressionStatement(e);if(n&&!e.id&&(r=!1),!r){if(t)return!1;throw new Error("cannot turn "+e.type+" to a statement")}return e.type=r,e}function p(e){if(F.isExpressionStatement(e)&&(e=e.expression),F.isExpression(e))return e;if(F.isClass(e)?e.type="ClassExpression":F.isFunction(e)&&(e.type="FunctionExpression"),!F.isExpression(e))throw new Error("cannot turn "+e.type+" to an expression");return e}function f(e,t){return F.isBlockStatement(e)?e:(F.isEmptyStatement(e)&&(e=[]),Array.isArray(e)||(F.isStatement(e)||(e=F.isFunction(t)?F.returnStatement(e):F.expressionStatement(e)),e=[e]),F.blockStatement(e))}function h(e){if(void 0===e)return F.identifier("undefined");if(e===!0||e===!1)return F.booleanLiteral(e);if(null===e)return F.nullLiteral();if((0,w.default)(e))return F.stringLiteral(e);if((0,A.default)(e))return F.numericLiteral(e);if((0,C.default)(e)){var t=e.source,n=e.toString().match(/\/([a-z]+|)$/)[1];return F.regExpLiteral(t,n)}if(Array.isArray(e))return F.arrayExpression(e.map(F.valueToNode));if((0,_.default)(e)){var r=[];for(var i in e){var a=void 0;a=F.isValidIdentifier(i)?F.identifier(i):F.stringLiteral(i),r.push(F.objectProperty(a,F.valueToNode(e[i])))}return F.objectExpression(r)}throw new Error("don't know how to turn this value into a node")}n.__esModule=!0;var d=e("babel-runtime/core-js/number/max-safe-integer"),y=i(d),m=e("babel-runtime/core-js/json/stringify"),b=i(m),g=e("babel-runtime/core-js/get-iterator"),v=i(g);n.toComputedKey=a,n.toSequenceExpression=s,n.toKeyAlias=o,n.toIdentifier=u,n.toBindingIdentifierName=l,n.toStatement=c,n.toExpression=p,n.toBlock=f,n.valueToNode=h;var x=e("lodash/isPlainObject"),_=i(x),E=e("lodash/isNumber"),A=i(E),D=e("lodash/isRegExp"),C=i(D),S=e("lodash/isString"),w=i(S),k=e("./index"),F=r(k);o.uid=0,o.increment=function(){return o.uid>=y.default?o.uid=0:o.uid++}},{"./index":265,"babel-runtime/core-js/get-iterator":100,"babel-runtime/core-js/json/stringify":101,"babel-runtime/core-js/number/max-safe-integer":103,"lodash/isNumber":483,"lodash/isPlainObject":486,"lodash/isRegExp":487,"lodash/isString":488}],256:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var a=e("../index"),s=i(a),o=e("../constants"),u=e("./index"),l=r(u);(0,l.default)("ArrayExpression",{fields:{elements:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeOrValueType)("null","Expression","SpreadElement"))),default:[]}},visitor:["elements"],aliases:["Expression"]}),(0,l.default)("AssignmentExpression",{fields:{operator:{validate:(0,u.assertValueType)("string")},left:{validate:(0,u.assertNodeType)("LVal")},right:{validate:(0,u.assertNodeType)("Expression")}},builder:["operator","left","right"],visitor:["left","right"],aliases:["Expression"]}),(0,l.default)("BinaryExpression",{builder:["operator","left","right"],fields:{operator:{validate:u.assertOneOf.apply(void 0,o.BINARY_OPERATORS)},left:{validate:(0,u.assertNodeType)("Expression")},right:{validate:(0,u.assertNodeType)("Expression")}},visitor:["left","right"],aliases:["Binary","Expression"]}),(0,l.default)("Directive",{visitor:["value"],fields:{value:{validate:(0,u.assertNodeType)("DirectiveLiteral")}}}),(0,l.default)("DirectiveLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}}}),(0,l.default)("BlockStatement",{builder:["body","directives"],visitor:["directives","body"],fields:{directives:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Directive"))),default:[]},body:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","Statement"]}),(0,l.default)("BreakStatement",{visitor:["label"],fields:{label:{validate:(0,u.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,l.default)("CallExpression",{visitor:["callee","arguments"],fields:{callee:{validate:(0,u.assertNodeType)("Expression")},arguments:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Expression","SpreadElement")))}},aliases:["Expression"]}),(0,l.default)("CatchClause",{visitor:["param","body"],fields:{param:{validate:(0,u.assertNodeType)("Identifier")},body:{validate:(0,u.assertNodeType)("BlockStatement")}},aliases:["Scopable"]}),(0,l.default)("ConditionalExpression",{visitor:["test","consequent","alternate"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},consequent:{validate:(0,u.assertNodeType)("Expression")},alternate:{validate:(0,u.assertNodeType)("Expression")}},aliases:["Expression","Conditional"]}),(0,l.default)("ContinueStatement",{visitor:["label"],fields:{label:{validate:(0,u.assertNodeType)("Identifier"),optional:!0}},aliases:["Statement","Terminatorless","CompletionStatement"]}),(0,l.default)("DebuggerStatement",{aliases:["Statement"]}),(0,l.default)("DoWhileStatement",{visitor:["test","body"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}},aliases:["Statement","BlockParent","Loop","While","Scopable"]}),(0,l.default)("EmptyStatement",{aliases:["Statement"]}),(0,l.default)("ExpressionStatement",{visitor:["expression"],fields:{expression:{validate:(0,u.assertNodeType)("Expression")}},aliases:["Statement","ExpressionWrapper"]}),(0,l.default)("File",{builder:["program","comments","tokens"],visitor:["program"],fields:{program:{validate:(0,u.assertNodeType)("Program")}}}),(0,l.default)("ForInStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,u.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("ForStatement",{visitor:["init","test","update","body"],aliases:["Scopable","Statement","For","BlockParent","Loop"],fields:{init:{validate:(0,u.assertNodeType)("VariableDeclaration","Expression"),optional:!0},test:{validate:(0,u.assertNodeType)("Expression"),optional:!0},update:{validate:(0,u.assertNodeType)("Expression"),optional:!0},body:{validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("FunctionDeclaration",{builder:["id","params","body","generator","async"],visitor:["id","params","body","returnType","typeParameters"],fields:{id:{validate:(0,u.assertNodeType)("Identifier")},params:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("LVal")))},body:{validate:(0,u.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,u.assertValueType)("boolean")},async:{default:!1,validate:(0,u.assertValueType)("boolean")}},aliases:["Scopable","Function","BlockParent","FunctionParent","Statement","Pureish","Declaration"]}),(0,l.default)("FunctionExpression",{inherits:"FunctionDeclaration",aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{id:{validate:(0,u.assertNodeType)("Identifier"),optional:!0},params:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("LVal")))},body:{validate:(0,u.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,u.assertValueType)("boolean")},async:{default:!1,validate:(0,u.assertValueType)("boolean")}}}),(0,l.default)("Identifier",{builder:["name"],visitor:["typeAnnotation"],aliases:["Expression","LVal"],fields:{name:{validate:function(e,t,n){s.isValidIdentifier(n)}},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator")))}}}),(0,l.default)("IfStatement",{visitor:["test","consequent","alternate"],aliases:["Statement","Conditional"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},consequent:{validate:(0,u.assertNodeType)("Statement")},alternate:{optional:!0,validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("LabeledStatement",{visitor:["label","body"],aliases:["Statement"],fields:{label:{validate:(0,u.assertNodeType)("Identifier")},body:{validate:(0,u.assertNodeType)("Statement")}}}),(0,l.default)("StringLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("string")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("NumericLiteral",{builder:["value"],deprecatedAlias:"NumberLiteral",fields:{value:{validate:(0,u.assertValueType)("number")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("NullLiteral",{aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("BooleanLiteral",{builder:["value"],fields:{value:{validate:(0,u.assertValueType)("boolean")}},aliases:["Expression","Pureish","Literal","Immutable"]}),(0,l.default)("RegExpLiteral",{builder:["pattern","flags"],deprecatedAlias:"RegexLiteral",aliases:["Expression","Literal"],fields:{pattern:{validate:(0,u.assertValueType)("string")},flags:{validate:(0,u.assertValueType)("string"),default:""}}}),(0,l.default)("LogicalExpression",{builder:["operator","left","right"],visitor:["left","right"],aliases:["Binary","Expression"],fields:{operator:{validate:u.assertOneOf.apply(void 0,o.LOGICAL_OPERATORS)},left:{validate:(0,u.assertNodeType)("Expression")},right:{validate:(0,u.assertNodeType)("Expression")}}}),(0,l.default)("MemberExpression",{builder:["object","property","computed"],visitor:["object","property"],aliases:["Expression","LVal"],fields:{object:{validate:(0,u.assertNodeType)("Expression")},property:{validate:function(e,t,n){var r=e.computed?"Expression":"Identifier";(0,u.assertNodeType)(r)(e,t,n)}},computed:{default:!1}}}),(0,l.default)("NewExpression",{visitor:["callee","arguments"],aliases:["Expression"],fields:{callee:{validate:(0,u.assertNodeType)("Expression")},arguments:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Expression","SpreadElement")))}}}),(0,l.default)("Program",{visitor:["directives","body"],builder:["body","directives"],fields:{directives:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Directive"))),default:[]},body:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Statement")))}},aliases:["Scopable","BlockParent","Block","FunctionParent"]}),(0,l.default)("ObjectExpression",{visitor:["properties"],aliases:["Expression"],fields:{properties:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("ObjectMethod","ObjectProperty","SpreadProperty")))}}}),(0,l.default)("ObjectMethod",{builder:["kind","key","params","body","computed"],fields:{kind:{validate:(0,u.chain)((0,u.assertValueType)("string"),(0,u.assertOneOf)("method","get","set")),default:"method"},computed:{validate:(0,u.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,n){var r=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];u.assertNodeType.apply(void 0,r)(e,t,n)}},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator")))},body:{validate:(0,u.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,u.assertValueType)("boolean")},async:{default:!1,validate:(0,u.assertValueType)("boolean")}},visitor:["key","params","body","decorators","returnType","typeParameters"],aliases:["UserWhitespacable","Function","Scopable","BlockParent","FunctionParent","Method","ObjectMember"]}),(0,l.default)("ObjectProperty",{builder:["key","value","computed","shorthand","decorators"],fields:{computed:{validate:(0,u.assertValueType)("boolean"),default:!1},key:{validate:function(e,t,n){var r=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];u.assertNodeType.apply(void 0,r)(e,t,n)}},value:{validate:(0,u.assertNodeType)("Expression")},shorthand:{validate:(0,u.assertValueType)("boolean"),default:!1},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator"))),optional:!0}},visitor:["key","value","decorators"],aliases:["UserWhitespacable","Property","ObjectMember"]}),(0,l.default)("RestElement",{visitor:["argument","typeAnnotation"],aliases:["LVal"],fields:{argument:{validate:(0,u.assertNodeType)("LVal")},decorators:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Decorator")))}}}),(0,l.default)("ReturnStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,u.assertNodeType)("Expression"),optional:!0}}}),(0,l.default)("SequenceExpression",{visitor:["expressions"],fields:{expressions:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Expression")))}},aliases:["Expression"]}),(0,l.default)("SwitchCase",{visitor:["test","consequent"],fields:{test:{validate:(0,u.assertNodeType)("Expression"),optional:!0},consequent:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("Statement")))}}}),(0,l.default)("SwitchStatement",{visitor:["discriminant","cases"],aliases:["Statement","BlockParent","Scopable"],fields:{discriminant:{validate:(0,u.assertNodeType)("Expression")},cases:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("SwitchCase")))}}}),(0,l.default)("ThisExpression",{ +aliases:["Expression"]}),(0,l.default)("ThrowStatement",{visitor:["argument"],aliases:["Statement","Terminatorless","CompletionStatement"],fields:{argument:{validate:(0,u.assertNodeType)("Expression")}}}),(0,l.default)("TryStatement",{visitor:["block","handler","finalizer"],aliases:["Statement"],fields:{body:{validate:(0,u.assertNodeType)("BlockStatement")},handler:{optional:!0,handler:(0,u.assertNodeType)("BlockStatement")},finalizer:{optional:!0,validate:(0,u.assertNodeType)("BlockStatement")}}}),(0,l.default)("UnaryExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!0},argument:{validate:(0,u.assertNodeType)("Expression")},operator:{validate:u.assertOneOf.apply(void 0,o.UNARY_OPERATORS)}},visitor:["argument"],aliases:["UnaryLike","Expression"]}),(0,l.default)("UpdateExpression",{builder:["operator","argument","prefix"],fields:{prefix:{default:!1},argument:{validate:(0,u.assertNodeType)("Expression")},operator:{validate:u.assertOneOf.apply(void 0,o.UPDATE_OPERATORS)}},visitor:["argument"],aliases:["Expression"]}),(0,l.default)("VariableDeclaration",{builder:["kind","declarations"],visitor:["declarations"],aliases:["Statement","Declaration"],fields:{kind:{validate:(0,u.chain)((0,u.assertValueType)("string"),(0,u.assertOneOf)("var","let","const"))},declarations:{validate:(0,u.chain)((0,u.assertValueType)("array"),(0,u.assertEach)((0,u.assertNodeType)("VariableDeclarator")))}}}),(0,l.default)("VariableDeclarator",{visitor:["id","init"],fields:{id:{validate:(0,u.assertNodeType)("LVal")},init:{optional:!0,validate:(0,u.assertNodeType)("Expression")}}}),(0,l.default)("WhileStatement",{visitor:["test","body"],aliases:["Statement","BlockParent","Loop","While","Scopable"],fields:{test:{validate:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("BlockStatement","Statement")}}}),(0,l.default)("WithStatement",{visitor:["object","body"],aliases:["Statement"],fields:{object:{object:(0,u.assertNodeType)("Expression")},body:{validate:(0,u.assertNodeType)("BlockStatement","Statement")}}})},{"../constants":254,"../index":265,"./index":260}],257:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=e("./index"),a=r(i);(0,a.default)("AssignmentPattern",{visitor:["left","right"],aliases:["Pattern","LVal"],fields:{left:{validate:(0,i.assertNodeType)("Identifier")},right:{validate:(0,i.assertNodeType)("Expression")},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ArrayPattern",{visitor:["elements","typeAnnotation"],aliases:["Pattern","LVal"],fields:{elements:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Expression")))},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ArrowFunctionExpression",{builder:["params","body","async"],visitor:["params","body","returnType","typeParameters"],aliases:["Scopable","Function","BlockParent","FunctionParent","Expression","Pureish"],fields:{params:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("LVal")))},body:{validate:(0,i.assertNodeType)("BlockStatement","Expression")},async:{validate:(0,i.assertValueType)("boolean"),default:!1}}}),(0,a.default)("ClassBody",{visitor:["body"],fields:{body:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("ClassMethod","ClassProperty")))}}}),(0,a.default)("ClassDeclaration",{builder:["id","superClass","body","decorators"],visitor:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators"],aliases:["Scopable","Class","Statement","Declaration","Pureish"],fields:{id:{validate:(0,i.assertNodeType)("Identifier")},body:{validate:(0,i.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,i.assertNodeType)("Expression")},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ClassExpression",{inherits:"ClassDeclaration",aliases:["Scopable","Class","Expression","Pureish"],fields:{id:{optional:!0,validate:(0,i.assertNodeType)("Identifier")},body:{validate:(0,i.assertNodeType)("ClassBody")},superClass:{optional:!0,validate:(0,i.assertNodeType)("Expression")},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("ExportAllDeclaration",{visitor:["source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{source:{validate:(0,i.assertNodeType)("StringLiteral")}}}),(0,a.default)("ExportDefaultDeclaration",{visitor:["declaration"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,i.assertNodeType)("FunctionDeclaration","ClassDeclaration","Expression")}}}),(0,a.default)("ExportNamedDeclaration",{visitor:["declaration","specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration","ExportDeclaration"],fields:{declaration:{validate:(0,i.assertNodeType)("Declaration"),optional:!0},specifiers:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("ExportSpecifier")))},source:{validate:(0,i.assertNodeType)("StringLiteral"),optional:!0}}}),(0,a.default)("ExportSpecifier",{visitor:["local","exported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")},exported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ForOfStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,i.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,i.assertNodeType)("Expression")},body:{validate:(0,i.assertNodeType)("Statement")}}}),(0,a.default)("ImportDeclaration",{visitor:["specifiers","source"],aliases:["Statement","Declaration","ModuleDeclaration"],fields:{specifiers:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("ImportSpecifier","ImportDefaultSpecifier","ImportNamespaceSpecifier")))},source:{validate:(0,i.assertNodeType)("StringLiteral")}}}),(0,a.default)("ImportDefaultSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ImportNamespaceSpecifier",{visitor:["local"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ImportSpecifier",{visitor:["local","imported"],aliases:["ModuleSpecifier"],fields:{local:{validate:(0,i.assertNodeType)("Identifier")},imported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("MetaProperty",{visitor:["meta","property"],aliases:["Expression"],fields:{meta:{validate:(0,i.assertValueType)("string")},property:{validate:(0,i.assertValueType)("string")}}}),(0,a.default)("ClassMethod",{aliases:["Function","Scopable","BlockParent","FunctionParent","Method"],builder:["kind","key","params","body","computed","static"],visitor:["key","params","body","decorators","returnType","typeParameters"],fields:{kind:{validate:(0,i.chain)((0,i.assertValueType)("string"),(0,i.assertOneOf)("get","set","method","constructor")),default:"method"},computed:{default:!1,validate:(0,i.assertValueType)("boolean")},static:{default:!1,validate:(0,i.assertValueType)("boolean")},key:{validate:function(e,t,n){var r=e.computed?["Expression"]:["Identifier","StringLiteral","NumericLiteral"];i.assertNodeType.apply(void 0,r)(e,t,n)}},params:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("LVal")))},body:{validate:(0,i.assertNodeType)("BlockStatement")},generator:{default:!1,validate:(0,i.assertValueType)("boolean")},async:{default:!1,validate:(0,i.assertValueType)("boolean")}}}),(0,a.default)("ObjectPattern",{visitor:["properties","typeAnnotation"],aliases:["Pattern","LVal"],fields:{properties:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("RestProperty","Property")))},decorators:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Decorator")))}}}),(0,a.default)("SpreadElement",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("Super",{aliases:["Expression"]}),(0,a.default)("TaggedTemplateExpression",{visitor:["tag","quasi"],aliases:["Expression"],fields:{tag:{validate:(0,i.assertNodeType)("Expression")},quasi:{validate:(0,i.assertNodeType)("TemplateLiteral")}}}),(0,a.default)("TemplateElement",{builder:["value","tail"],fields:{value:{},tail:{validate:(0,i.assertValueType)("boolean"),default:!1}}}),(0,a.default)("TemplateLiteral",{visitor:["quasis","expressions"],aliases:["Expression","Literal"],fields:{quasis:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("TemplateElement")))},expressions:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("Expression")))}}}),(0,a.default)("YieldExpression",{builder:["argument","delegate"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{delegate:{validate:(0,i.assertValueType)("boolean"),default:!1},argument:{optional:!0,validate:(0,i.assertNodeType)("Expression")}}})},{"./index":260}],258:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=e("./index"),a=r(i);(0,a.default)("AwaitExpression",{builder:["argument"],visitor:["argument"],aliases:["Expression","Terminatorless"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("ForAwaitStatement",{visitor:["left","right","body"],aliases:["Scopable","Statement","For","BlockParent","Loop","ForXStatement"],fields:{left:{validate:(0,i.assertNodeType)("VariableDeclaration","LVal")},right:{validate:(0,i.assertNodeType)("Expression")},body:{validate:(0,i.assertNodeType)("Statement")}}}),(0,a.default)("BindExpression",{visitor:["object","callee"],aliases:["Expression"],fields:{}}),(0,a.default)("Import",{aliases:["Expression"]}),(0,a.default)("Decorator",{visitor:["expression"],fields:{expression:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("DoExpression",{visitor:["body"],aliases:["Expression"],fields:{body:{validate:(0,i.assertNodeType)("BlockStatement")}}}),(0,a.default)("ExportDefaultSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("ExportNamespaceSpecifier",{visitor:["exported"],aliases:["ModuleSpecifier"],fields:{exported:{validate:(0,i.assertNodeType)("Identifier")}}}),(0,a.default)("RestProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,i.assertNodeType)("LVal")}}}),(0,a.default)("SpreadProperty",{visitor:["argument"],aliases:["UnaryLike"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}})},{"./index":260}],259:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=e("./index"),a=r(i);(0,a.default)("AnyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("ArrayTypeAnnotation",{visitor:["elementType"],aliases:["Flow"],fields:{}}),(0,a.default)("BooleanTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("BooleanLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,a.default)("NullLiteralTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("ClassImplements",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,a.default)("ClassProperty",{visitor:["key","value","typeAnnotation","decorators"],builder:["key","value","typeAnnotation","decorators","computed"],aliases:["Property"],fields:{computed:{validate:(0,i.assertValueType)("boolean"),default:!1}}}),(0,a.default)("DeclareClass",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareFunction",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareInterface",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareModule",{visitor:["id","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareModuleExports",{visitor:["typeAnnotation"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareTypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("DeclareVariable",{visitor:["id"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("ExistentialTypeParam",{aliases:["Flow"]}),(0,a.default)("FunctionTypeAnnotation",{visitor:["typeParameters","params","rest","returnType"],aliases:["Flow"],fields:{}}),(0,a.default)("FunctionTypeParam",{visitor:["name","typeAnnotation"],aliases:["Flow"],fields:{}}),(0,a.default)("GenericTypeAnnotation",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,a.default)("InterfaceExtends",{visitor:["id","typeParameters"],aliases:["Flow"],fields:{}}),(0,a.default)("InterfaceDeclaration",{visitor:["id","typeParameters","extends","body"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("IntersectionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,a.default)("MixedTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,a.default)("EmptyTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"]}),(0,a.default)("NullableTypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,a.default)("NumericLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,a.default)("NumberTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("StringLiteralTypeAnnotation",{aliases:["Flow"],fields:{}}),(0,a.default)("StringTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("ThisTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}}),(0,a.default)("TupleTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeofTypeAnnotation",{visitor:["argument"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeAlias",{visitor:["id","typeParameters","right"],aliases:["Flow","FlowDeclaration","Statement","Declaration"],fields:{}}),(0,a.default)("TypeAnnotation",{visitor:["typeAnnotation"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeCastExpression",{visitor:["expression","typeAnnotation"],aliases:["Flow","ExpressionWrapper","Expression"],fields:{}}),(0,a.default)("TypeParameter",{visitor:["bound"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeParameterDeclaration",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,a.default)("TypeParameterInstantiation",{visitor:["params"],aliases:["Flow"],fields:{}}),(0,a.default)("ObjectTypeAnnotation",{visitor:["properties","indexers","callProperties"],aliases:["Flow"],fields:{}}),(0,a.default)("ObjectTypeCallProperty",{visitor:["value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,a.default)("ObjectTypeIndexer",{visitor:["id","key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,a.default)("ObjectTypeProperty",{visitor:["key","value"],aliases:["Flow","UserWhitespacable"],fields:{}}),(0,a.default)("QualifiedTypeIdentifier",{visitor:["id","qualification"],aliases:["Flow"],fields:{}}),(0,a.default)("UnionTypeAnnotation",{visitor:["types"],aliases:["Flow"],fields:{}}),(0,a.default)("VoidTypeAnnotation",{aliases:["Flow","FlowBaseAnnotation"],fields:{}})},{"./index":260}],260:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return Array.isArray(e)?"array":null===e?"null":void 0===e?"undefined":void 0===e?"undefined":(0,g.default)(e)}function s(e){function t(t,n,r){if(Array.isArray(r))for(var i=0;i=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;if(x.is(l,r)){i=!0;break}}if(!i)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,m.default)(n)+" but instead got "+(0,m.default)(r&&r.type))}for(var t=arguments.length,n=Array(t),r=0;r=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l;if(a(r)===c||x.is(c,r)){i=!0;break}}if(!i)throw new TypeError("Property "+t+" of "+e.type+" expected node to be of a type "+(0,m.default)(n)+" but instead got "+(0,m.default)(r&&r.type))}for(var t=arguments.length,n=Array(t),r=0;r=e.length)break;i=e[r++]}else{if(r=e.next(),r.done)break;i=r.value}i.apply(void 0,arguments)}}for(var t=arguments.length,n=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=t.inherits&&S[t.inherits]||{};t.fields=t.fields||n.fields||{},t.visitor=t.visitor||n.visitor||[],t.aliases=t.aliases||n.aliases||[],t.builder=t.builder||n.builder||t.visitor||[],t.deprecatedAlias&&(C[t.deprecatedAlias]=e);for(var r=t.visitor.concat(t.builder),i=Array.isArray(r),s=0,r=i?r:(0,d.default)(r);;){var o;if(i){if(s>=r.length)break;o=r[s++]}else{if(s=r.next(),s.done)break;o=s.value}var u=o;t.fields[u]=t.fields[u]||{}}for(var l in t.fields){var p=t.fields[l];t.builder.indexOf(l)===-1&&(p.optional=!0),void 0===p.default?p.default=null:p.validate||(p.validate=c(a(p.default)))}_[e]=t.visitor,D[e]=t.builder,A[e]=t.fields,E[e]=t.aliases,S[e]=t}n.__esModule=!0,n.DEPRECATED_KEYS=n.BUILDER_KEYS=n.NODE_FIELDS=n.ALIAS_KEYS=n.VISITOR_KEYS=void 0;var h=e("babel-runtime/core-js/get-iterator"),d=i(h),y=e("babel-runtime/core-js/json/stringify"),m=i(y),b=e("babel-runtime/helpers/typeof"),g=i(b);n.assertEach=s,n.assertOneOf=o,n.assertNodeType=u,n.assertNodeOrValueType=l,n.assertValueType=c,n.chain=p,n.default=f;var v=e("../index"),x=r(v),_=n.VISITOR_KEYS={},E=n.ALIAS_KEYS={},A=n.NODE_FIELDS={},D=n.BUILDER_KEYS={},C=n.DEPRECATED_KEYS={},S={}},{"../index":265,"babel-runtime/core-js/get-iterator":100,"babel-runtime/core-js/json/stringify":101,"babel-runtime/helpers/typeof":118}],261:[function(e,t,n){"use strict";e("./index"),e("./core"),e("./es2015"),e("./flow"),e("./jsx"),e("./misc"),e("./experimental")},{"./core":256,"./es2015":257,"./experimental":258,"./flow":259,"./index":260,"./jsx":262,"./misc":263}],262:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=e("./index"),a=r(i);(0,a.default)("JSXAttribute",{visitor:["name","value"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,i.assertNodeType)("JSXIdentifier","JSXNamespacedName")},value:{optional:!0,validate:(0,i.assertNodeType)("JSXElement","StringLiteral","JSXExpressionContainer")}}}),(0,a.default)("JSXClosingElement",{visitor:["name"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,i.assertNodeType)("JSXIdentifier","JSXMemberExpression")}}}),(0,a.default)("JSXElement",{builder:["openingElement","closingElement","children","selfClosing"],visitor:["openingElement","children","closingElement"],aliases:["JSX","Immutable","Expression"],fields:{openingElement:{validate:(0,i.assertNodeType)("JSXOpeningElement")},closingElement:{optional:!0,validate:(0,i.assertNodeType)("JSXClosingElement")},children:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("JSXText","JSXExpressionContainer","JSXSpreadChild","JSXElement")))}}}),(0,a.default)("JSXEmptyExpression",{aliases:["JSX","Expression"]}),(0,a.default)("JSXExpressionContainer",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("JSXSpreadChild",{visitor:["expression"],aliases:["JSX","Immutable"],fields:{expression:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("JSXIdentifier",{builder:["name"],aliases:["JSX","Expression"],fields:{name:{validate:(0,i.assertValueType)("string")}}}),(0,a.default)("JSXMemberExpression",{visitor:["object","property"],aliases:["JSX","Expression"],fields:{object:{validate:(0,i.assertNodeType)("JSXMemberExpression","JSXIdentifier")},property:{validate:(0,i.assertNodeType)("JSXIdentifier")}}}),(0,a.default)("JSXNamespacedName",{visitor:["namespace","name"],aliases:["JSX"],fields:{namespace:{validate:(0,i.assertNodeType)("JSXIdentifier")},name:{validate:(0,i.assertNodeType)("JSXIdentifier")}}}),(0,a.default)("JSXOpeningElement",{builder:["name","attributes","selfClosing"],visitor:["name","attributes"],aliases:["JSX","Immutable"],fields:{name:{validate:(0,i.assertNodeType)("JSXIdentifier","JSXMemberExpression")},selfClosing:{default:!1,validate:(0,i.assertValueType)("boolean")},attributes:{validate:(0,i.chain)((0,i.assertValueType)("array"),(0,i.assertEach)((0,i.assertNodeType)("JSXAttribute","JSXSpreadAttribute")))}}}),(0,a.default)("JSXSpreadAttribute",{visitor:["argument"],aliases:["JSX"],fields:{argument:{validate:(0,i.assertNodeType)("Expression")}}}),(0,a.default)("JSXText",{aliases:["JSX","Immutable"],builder:["value"],fields:{value:{validate:(0,i.assertValueType)("string")}}})},{"./index":260}],263:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=e("./index"),a=r(i);(0,a.default)("Noop",{visitor:[]}),(0,a.default)("ParenthesizedExpression",{visitor:["expression"],aliases:["Expression","ExpressionWrapper"],fields:{expression:{validate:(0,i.assertNodeType)("Expression")}}})},{"./index":260}],264:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){var t=a(e);return 1===t.length?t[0]:u.unionTypeAnnotation(t)}function a(e){for(var t={},n={},r=[],i=[],s=0;s=0)){if(u.isAnyTypeAnnotation(o))return[o];if(u.isFlowBaseAnnotation(o))n[o.type]=o;else if(u.isUnionTypeAnnotation(o))r.indexOf(o.types)<0&&(e=e.concat(o.types),r.push(o.types));else if(u.isGenericTypeAnnotation(o)){var l=o.id.name;if(t[l]){var c=t[l];c.typeParameters?o.typeParameters&&(c.typeParameters.params=a(c.typeParameters.params.concat(o.typeParameters.params))):c=o.typeParameters}else t[l]=o}else i.push(o)}}for(var p in n)i.push(n[p]);for(var f in t)i.push(t[f]);return i}function s(e){if("string"===e)return u.stringTypeAnnotation();if("number"===e)return u.numberTypeAnnotation();if("undefined"===e)return u.voidTypeAnnotation();if("boolean"===e)return u.booleanTypeAnnotation();if("function"===e)return u.genericTypeAnnotation(u.identifier("Function"));if("object"===e)return u.genericTypeAnnotation(u.identifier("Object"));if("symbol"===e)return u.genericTypeAnnotation(u.identifier("Symbol"));throw new Error("Invalid typeof value")}n.__esModule=!0,n.createUnionTypeAnnotation=i,n.removeTypeDuplicates=a,n.createTypeAnnotationBasedOnTypeof=s;var o=e("./index"),u=r(o)},{"./index":265}],265:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=te["is"+e];t||(t=te["is"+e]=function(t,n){return te.is(e,t,n)}),te["assert"+e]=function(n,r){if(r=r||{},!t(n,r))throw new Error("Expected type "+(0,N.default)(e)+" with option "+(0,N.default)(r))}}function s(e,t,n){return!!t&&(!!o(t.type,e)&&(void 0===n||te.shallowEqual(t,n)))}function o(e,t){if(e===t)return!0;if(te.ALIAS_KEYS[t])return!1;var n=te.FLIPPED_ALIAS_KEYS[t];if(n){if(n[0]===e)return!0;for(var r=n,i=Array.isArray(r),a=0,r=i?r:(0,j.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}if(e===s)return!0}}return!1}function u(e,t,n){if(e){var r=te.NODE_FIELDS[e.type];if(r){var i=r[t];i&&i.validate&&(i.optional&&null==n||i.validate(e,t,n))}}}function l(e,t){for(var n=(0,O.default)(t),r=n,i=Array.isArray(r),a=0,r=i?r:(0,j.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;if(e[o]!==t[o])return!1}return!0}function c(e,t,n){return e.object=te.memberExpression(e.object,e.property,e.computed),e.property=t,e.computed=!!n,e}function p(e,t){return e.object=te.memberExpression(t,e.object),e}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"body";return e[t]=te.toBlock(e[t],e)}function h(e){if(!e)return e;var t={};for(var n in e)"_"!==n[0]&&(t[n]=e[n]);return t}function d(e){var t=h(e);return delete t.loc,t}function y(e){if(!e)return e;var t={};for(var n in e)if("_"!==n[0]){var r=e[n];r&&(r.type?r=te.cloneDeep(r):Array.isArray(r)&&(r=r.map(te.cloneDeep))),t[n]=r}return t}function m(e,t){var n=e.split(".");return function(e){if(!te.isMemberExpression(e))return!1;for(var r=[e],i=0;r.length;){var a=r.shift();if(t&&i===n.length)return!0;if(te.isIdentifier(a)){if(n[i]!==a.name)return!1}else{if(!te.isStringLiteral(a)){if(te.isMemberExpression(a)){if(a.computed&&!te.isStringLiteral(a.property))return!1;r.push(a.object),r.push(a.property);continue}return!1}if(n[i]!==a.value)return!1}if(++i>n.length)return!1}return!0}}function b(e){for(var t=te.COMMENT_KEYS,n=Array.isArray(t),r=0,t=n?t:(0,j.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}delete e[i]}return e}function g(e,t){return v(e,t),x(e,t),_(e,t),e}function v(e,t){E("trailingComments",e,t)}function x(e,t){E("leadingComments",e,t)}function _(e,t){E("innerComments",e,t)}function E(e,t,n){t&&n&&(t[e]=(0,$.default)((0,X.default)([].concat(t[e],n[e]))))}function A(e,t){if(!e||!t)return e;for(var n=te.INHERIT_KEYS.optional,r=Array.isArray(n),i=0,n=r?n:(0,j.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a;null==e[s]&&(e[s]=t[s])}for(var o in t)"_"===o[0]&&(e[o]=t[o]);for(var u=te.INHERIT_KEYS.force,l=Array.isArray(u),c=0,u=l?u:(0,j.default)(u);;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var f=p;e[f]=t[f]}return te.inheritsComments(e,t),e}function D(e){if(!C(e))throw new TypeError("Not a valid node "+(e&&e.type))}function C(e){return!(!e||!Q.VISITOR_KEYS[e.type])}function S(e,t,n){if(e){var r=te.VISITOR_KEYS[e.type];if(r){n=n||{},t(e,n);for(var i=r,a=Array.isArray(i),s=0,i=a?i:(0,j.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var u=o,l=e[u];if(Array.isArray(l))for(var c=l,p=Array.isArray(c),f=0,c=p?c:(0,j.default)(c);;){var h;if(p){if(f>=c.length)break;h=c[f++]}else{if(f=c.next(),f.done)break;h=f.value}var d=h;S(d,t,n)}else S(l,t,n)}}}}function w(e,t){t=t||{};for(var n=t.preserveComments?ae:se,r=n,i=Array.isArray(r),a=0,r=i?r:(0,j.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;null!=e[o]&&(e[o]=void 0)}for(var u in e)"_"===u[0]&&null!=e[u]&&(e[u]=void 0);for(var l=(0,T.default)(e),c=l,p=Array.isArray(c),f=0,c=p?c:(0,j.default)(c);;){var h;if(p){if(f>=c.length)break;h=c[f++]}else{if(f=c.next(),f.done)break;h=f.value}e[h]=null}}function k(e,t){return S(e,w,t),e}n.__esModule=!0,n.createTypeAnnotationBasedOnTypeof=n.removeTypeDuplicates=n.createUnionTypeAnnotation=n.valueToNode=n.toBlock=n.toExpression=n.toStatement=n.toBindingIdentifierName=n.toIdentifier=n.toKeyAlias=n.toSequenceExpression=n.toComputedKey=n.isNodesEquivalent=n.isImmutable=n.isScope=n.isSpecifierDefault=n.isVar=n.isBlockScoped=n.isLet=n.isValidIdentifier=n.isReferenced=n.isBinding=n.getOuterBindingIdentifiers=n.getBindingIdentifiers=n.TYPES=n.react=n.DEPRECATED_KEYS=n.BUILDER_KEYS=n.NODE_FIELDS=n.ALIAS_KEYS=n.VISITOR_KEYS=n.NOT_LOCAL_BINDING=n.BLOCK_SCOPED_SYMBOL=n.INHERIT_KEYS=n.UNARY_OPERATORS=n.STRING_UNARY_OPERATORS=n.NUMBER_UNARY_OPERATORS=n.BOOLEAN_UNARY_OPERATORS=n.BINARY_OPERATORS=n.NUMBER_BINARY_OPERATORS=n.BOOLEAN_BINARY_OPERATORS=n.COMPARISON_BINARY_OPERATORS=n.EQUALITY_BINARY_OPERATORS=n.BOOLEAN_NUMBER_BINARY_OPERATORS=n.UPDATE_OPERATORS=n.LOGICAL_OPERATORS=n.COMMENT_KEYS=n.FOR_INIT_KEYS=n.FLATTENABLE_KEYS=n.STATEMENT_OR_BLOCK_KEYS=void 0;var F=e("babel-runtime/core-js/object/get-own-property-symbols"),T=i(F),P=e("babel-runtime/core-js/get-iterator"),j=i(P),B=e("babel-runtime/core-js/object/keys"),O=i(B),I=e("babel-runtime/core-js/json/stringify"),N=i(I),L=e("./constants");Object.defineProperty(n,"STATEMENT_OR_BLOCK_KEYS",{enumerable:!0,get:function(){return L.STATEMENT_OR_BLOCK_KEYS}}),Object.defineProperty(n,"FLATTENABLE_KEYS",{enumerable:!0,get:function(){return L.FLATTENABLE_KEYS}}),Object.defineProperty(n,"FOR_INIT_KEYS",{enumerable:!0,get:function(){return L.FOR_INIT_KEYS}}),Object.defineProperty(n,"COMMENT_KEYS",{enumerable:!0,get:function(){return L.COMMENT_KEYS}}),Object.defineProperty(n,"LOGICAL_OPERATORS",{enumerable:!0,get:function(){return L.LOGICAL_OPERATORS}}),Object.defineProperty(n,"UPDATE_OPERATORS",{enumerable:!0,get:function(){return L.UPDATE_OPERATORS}}),Object.defineProperty(n,"BOOLEAN_NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return L.BOOLEAN_NUMBER_BINARY_OPERATORS}}),Object.defineProperty(n,"EQUALITY_BINARY_OPERATORS",{enumerable:!0,get:function(){return L.EQUALITY_BINARY_OPERATORS}}),Object.defineProperty(n,"COMPARISON_BINARY_OPERATORS",{enumerable:!0,get:function(){return L.COMPARISON_BINARY_OPERATORS}}),Object.defineProperty(n,"BOOLEAN_BINARY_OPERATORS",{enumerable:!0,get:function(){return L.BOOLEAN_BINARY_OPERATORS}}),Object.defineProperty(n,"NUMBER_BINARY_OPERATORS",{enumerable:!0,get:function(){return L.NUMBER_BINARY_OPERATORS}}),Object.defineProperty(n,"BINARY_OPERATORS",{enumerable:!0,get:function(){return L.BINARY_OPERATORS}}),Object.defineProperty(n,"BOOLEAN_UNARY_OPERATORS",{enumerable:!0,get:function(){return L.BOOLEAN_UNARY_OPERATORS}}),Object.defineProperty(n,"NUMBER_UNARY_OPERATORS",{enumerable:!0,get:function(){return L.NUMBER_UNARY_OPERATORS}}),Object.defineProperty(n,"STRING_UNARY_OPERATORS",{enumerable:!0,get:function(){return L.STRING_UNARY_OPERATORS}}),Object.defineProperty(n,"UNARY_OPERATORS",{enumerable:!0,get:function(){return L.UNARY_OPERATORS}}),Object.defineProperty(n,"INHERIT_KEYS",{enumerable:!0,get:function(){return L.INHERIT_KEYS}}),Object.defineProperty(n,"BLOCK_SCOPED_SYMBOL",{enumerable:!0,get:function(){return L.BLOCK_SCOPED_SYMBOL}}),Object.defineProperty(n,"NOT_LOCAL_BINDING",{enumerable:!0,get:function(){return L.NOT_LOCAL_BINDING}}),n.is=s,n.isType=o,n.validate=u,n.shallowEqual=l,n.appendToMemberExpression=c,n.prependToMemberExpression=p,n.ensureBlock=f,n.clone=h,n.cloneWithoutLoc=d,n.cloneDeep=y,n.buildMatchMemberExpression=m,n.removeComments=b,n.inheritsComments=g,n.inheritTrailingComments=v,n.inheritLeadingComments=x,n.inheritInnerComments=_,n.inherits=A,n.assertNode=D,n.isNode=C,n.traverseFast=S,n.removeProperties=w, +n.removePropertiesDeep=k;var M=e("./retrievers");Object.defineProperty(n,"getBindingIdentifiers",{enumerable:!0,get:function(){return M.getBindingIdentifiers}}),Object.defineProperty(n,"getOuterBindingIdentifiers",{enumerable:!0,get:function(){return M.getOuterBindingIdentifiers}});var R=e("./validators");Object.defineProperty(n,"isBinding",{enumerable:!0,get:function(){return R.isBinding}}),Object.defineProperty(n,"isReferenced",{enumerable:!0,get:function(){return R.isReferenced}}),Object.defineProperty(n,"isValidIdentifier",{enumerable:!0,get:function(){return R.isValidIdentifier}}),Object.defineProperty(n,"isLet",{enumerable:!0,get:function(){return R.isLet}}),Object.defineProperty(n,"isBlockScoped",{enumerable:!0,get:function(){return R.isBlockScoped}}),Object.defineProperty(n,"isVar",{enumerable:!0,get:function(){return R.isVar}}),Object.defineProperty(n,"isSpecifierDefault",{enumerable:!0,get:function(){return R.isSpecifierDefault}}),Object.defineProperty(n,"isScope",{enumerable:!0,get:function(){return R.isScope}}),Object.defineProperty(n,"isImmutable",{enumerable:!0,get:function(){return R.isImmutable}}),Object.defineProperty(n,"isNodesEquivalent",{enumerable:!0,get:function(){return R.isNodesEquivalent}});var U=e("./converters");Object.defineProperty(n,"toComputedKey",{enumerable:!0,get:function(){return U.toComputedKey}}),Object.defineProperty(n,"toSequenceExpression",{enumerable:!0,get:function(){return U.toSequenceExpression}}),Object.defineProperty(n,"toKeyAlias",{enumerable:!0,get:function(){return U.toKeyAlias}}),Object.defineProperty(n,"toIdentifier",{enumerable:!0,get:function(){return U.toIdentifier}}),Object.defineProperty(n,"toBindingIdentifierName",{enumerable:!0,get:function(){return U.toBindingIdentifierName}}),Object.defineProperty(n,"toStatement",{enumerable:!0,get:function(){return U.toStatement}}),Object.defineProperty(n,"toExpression",{enumerable:!0,get:function(){return U.toExpression}}),Object.defineProperty(n,"toBlock",{enumerable:!0,get:function(){return U.toBlock}}),Object.defineProperty(n,"valueToNode",{enumerable:!0,get:function(){return U.valueToNode}});var V=e("./flow");Object.defineProperty(n,"createUnionTypeAnnotation",{enumerable:!0,get:function(){return V.createUnionTypeAnnotation}}),Object.defineProperty(n,"removeTypeDuplicates",{enumerable:!0,get:function(){return V.removeTypeDuplicates}}),Object.defineProperty(n,"createTypeAnnotationBasedOnTypeof",{enumerable:!0,get:function(){return V.createTypeAnnotationBasedOnTypeof}});var G=e("to-fast-properties"),q=i(G),K=e("lodash/compact"),X=i(K),J=e("lodash/clone"),W=i(J),z=e("lodash/each"),Y=i(z),H=e("lodash/uniq"),$=i(H);e("./definitions/init");var Q=e("./definitions"),Z=e("./react"),ee=r(Z),te=n;n.VISITOR_KEYS=Q.VISITOR_KEYS,n.ALIAS_KEYS=Q.ALIAS_KEYS,n.NODE_FIELDS=Q.NODE_FIELDS,n.BUILDER_KEYS=Q.BUILDER_KEYS,n.DEPRECATED_KEYS=Q.DEPRECATED_KEYS,n.react=ee;for(var ne in te.VISITOR_KEYS)a(ne);te.FLIPPED_ALIAS_KEYS={},(0,Y.default)(te.ALIAS_KEYS,function(e,t){(0,Y.default)(e,function(e){(te.FLIPPED_ALIAS_KEYS[e]=te.FLIPPED_ALIAS_KEYS[e]||[]).push(t)})}),(0,Y.default)(te.FLIPPED_ALIAS_KEYS,function(e,t){te[t.toUpperCase()+"_TYPES"]=e,a(t)});n.TYPES=(0,O.default)(te.VISITOR_KEYS).concat((0,O.default)(te.FLIPPED_ALIAS_KEYS)).concat((0,O.default)(te.DEPRECATED_KEYS));(0,Y.default)(te.BUILDER_KEYS,function(e,t){function n(){if(arguments.length>e.length)throw new Error("t."+t+": Too many arguments passed. Received "+arguments.length+" but can receive no more than "+e.length);var n={};n.type=t;for(var r=0,i=e,a=Array.isArray(i),s=0,i=a?i:(0,j.default)(i);;){var o;if(a){if(s>=i.length)break;o=i[s++]}else{if(s=i.next(),s.done)break;o=s.value}var l=o,c=te.NODE_FIELDS[t][l],p=arguments[r++];void 0===p&&(p=(0,W.default)(c.default)),n[l]=p}for(var f in n)u(n,f,n[f]);return n}te[t]=n,te[t[0].toLowerCase()+t.slice(1)]=n});var re=function(e){function t(t){return function(){return console.trace("The node type "+e+" has been renamed to "+n),t.apply(this,arguments)}}var n=te.DEPRECATED_KEYS[e];te[e]=te[e[0].toLowerCase()+e.slice(1)]=t(te[n]),te["is"+e]=t(te["is"+n]),te["assert"+e]=t(te["assert"+n])};for(var ie in te.DEPRECATED_KEYS)re(ie);(0,q.default)(te),(0,q.default)(te.VISITOR_KEYS);var ae=["tokens","start","end","loc","raw","rawValue"],se=te.COMMENT_KEYS.concat(["comments"]).concat(ae)},{"./constants":254,"./converters":255,"./definitions":260,"./definitions/init":261,"./flow":264,"./react":266,"./retrievers":267,"./validators":268,"babel-runtime/core-js/get-iterator":100,"babel-runtime/core-js/json/stringify":101,"babel-runtime/core-js/object/get-own-property-symbols":106,"babel-runtime/core-js/object/keys":107,"lodash/clone":455,"lodash/compact":458,"lodash/each":461,"lodash/uniq":509,"to-fast-properties":273}],266:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return!!e&&/^[a-z]|\-/.test(e)}function a(e,t){for(var n=e.value.split(/\r\n|\n|\r/),r=0,i=0;i=0)return!0}else if(a===e)return!0}return!1}function s(e,t){switch(t.type){case"BindExpression":return t.object===e||t.callee===e;case"MemberExpression":case"JSXMemberExpression":return!(t.property!==e||!t.computed)||t.object===e;case"MetaProperty":return!1;case"ObjectProperty":if(t.key===e)return t.computed;case"VariableDeclarator":return t.id!==e;case"ArrowFunctionExpression":case"FunctionDeclaration":case"FunctionExpression":for(var n=t.params,r=Array.isArray(n),i=0,n=r?n:(0,x.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}if(a===e)return!1}return t.id!==e;case"ExportSpecifier":return!t.source&&t.local===e;case"ExportNamespaceSpecifier":case"ExportDefaultSpecifier":return!1;case"JSXAttribute":return t.name!==e;case"ClassProperty":return t.key===e?t.computed:t.value===e;case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":case"ImportSpecifier":return!1;case"ClassDeclaration":case"ClassExpression":return t.id!==e;case"ClassMethod":case"ObjectMethod":return t.key===e&&t.computed;case"LabeledStatement":return!1;case"CatchClause":return t.param!==e;case"RestElement":return!1;case"AssignmentExpression":return t.right===e;case"AssignmentPattern":return t.right===e;case"ObjectPattern":case"ArrayPattern":return!1}return!0}function o(e){return"string"==typeof e&&!A.default.keyword.isReservedWordES6(e,!0)&&A.default.keyword.isIdentifierNameES6(e)}function u(e){return C.isVariableDeclaration(e)&&("var"!==e.kind||e[S.BLOCK_SCOPED_SYMBOL])}function l(e){return C.isFunctionDeclaration(e)||C.isClassDeclaration(e)||C.isLet(e)}function c(e){return C.isVariableDeclaration(e,{kind:"var"})&&!e[S.BLOCK_SCOPED_SYMBOL]}function p(e){return C.isImportDefaultSpecifier(e)||C.isIdentifier(e.imported||e.exported,{name:"default"})}function f(e,t){return(!C.isBlockStatement(e)||!C.isFunction(t,{body:e}))&&C.isScopable(e)}function h(e){return!!C.isType(e.type,"Immutable")||!!C.isIdentifier(e)&&"undefined"===e.name}function d(e,t){if("object"!==(void 0===e?"undefined":(0,g.default)(e))||"object"!==(void 0===e?"undefined":(0,g.default)(e))||null==e||null==t)return e===t;if(e.type!==t.type)return!1;for(var n=(0,m.default)(C.NODE_FIELDS[e.type]||e.type),r=n,i=Array.isArray(r),a=0,r=i?r:(0,x.default)(r);;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;if((0,g.default)(e[o])!==(0,g.default)(t[o]))return!1;if(Array.isArray(e[o])){if(!Array.isArray(t[o]))return!1;if(e[o].length!==t[o].length)return!1;for(var u=0;u=0}}function i(e,t){for(var n=65536,r=0;re)return!1;if(n+=t[r+1],n>=e)return!0}}function a(e){return e<65?36===e:e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&T.test(String.fromCharCode(e)):i(e,j)))}function s(e){return e<48?36===e:e<58||!(e<65)&&(e<91||(e<97?95===e:e<123||(e<=65535?e>=170&&P.test(String.fromCharCode(e)):i(e,j)||i(e,B))))}function o(e){var t={};for(var n in O)t[n]=e&&n in e?e[n]:O[n];return t}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){return new I(e,{beforeExpr:!0,binop:t})}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.keyword=e,R[e]=M["_"+e]=new I(e,t)}function p(e){return 10===e||13===e||8232===e||8233===e}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=1,r=0;;){V.lastIndex=r;var i=V.exec(e);if(!(i&&i.index>10)+55296,(e-65536&1023)+56320)}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function x(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t,n,r){return e.type=t,e.end=n,e.loc.end=r,this.processComment(e),e}function A(e){return e[e.length-1]}function D(e){return"JSXIdentifier"===e.type?e.name:"JSXNamespacedName"===e.type?e.namespace.name+":"+e.name.name:"JSXMemberExpression"===e.type?D(e.object)+"."+D(e.property):void 0}function C(e,t){return new $(t,e).parse()}Object.defineProperty(n,"__esModule",{value:!0});var S={6:r("enum await"),strict:r("implements interface let package private protected public static yield"),strictBind:r("eval arguments")},w=r("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this let const class extends export import yield super"),k="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢴࢶ-ࢽऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿕ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞮꞰ-ꞷꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭥꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",F="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣔ-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷻-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_",T=new RegExp("["+k+"]"),P=new RegExp("["+k+F+"]");k=F=null;var j=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541],B=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239],O={sourceType:"script",sourceFilename:void 0,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,plugins:[],strictMode:null},I=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u(this,e),this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.rightAssociative=!!n.rightAssociative,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null},N={beforeExpr:!0},L={startsExpr:!0},M={num:new I("num",L),regexp:new I("regexp",L),string:new I("string",L),name:new I("name",L),eof:new I("eof"),bracketL:new I("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:!0,startsExpr:!0}),braceBarL:new I("{|",{beforeExpr:!0,startsExpr:!0}),braceR:new I("}"),braceBarR:new I("|}"),parenL:new I("(",{beforeExpr:!0,startsExpr:!0}),parenR:new I(")"),comma:new I(",",N),semi:new I(";",N),colon:new I(":",N),doubleColon:new I("::",N),dot:new I("."),question:new I("?",N),arrow:new I("=>",N),template:new I("template"),ellipsis:new I("...",N),backQuote:new I("`",L),dollarBraceL:new I("${",{beforeExpr:!0,startsExpr:!0}),at:new I("@"),eq:new I("=",{beforeExpr:!0,isAssign:!0}),assign:new I("_=",{beforeExpr:!0,isAssign:!0}),incDec:new I("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new I("prefix",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:l("||",1),logicalAND:l("&&",2),bitwiseOR:l("|",3),bitwiseXOR:l("^",4),bitwiseAND:l("&",5),equality:l("==/!=",6),relational:l("",7),bitShift:l("<>",8),plusMin:new I("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:l("%",10),star:l("*",10),slash:l("/",10),exponent:new I("**",{beforeExpr:!0,binop:11,rightAssociative:!0})},R={};c("break"),c("case",N),c("catch"),c("continue"),c("debugger"),c("default",N),c("do",{isLoop:!0,beforeExpr:!0}),c("else",N),c("finally"),c("for",{isLoop:!0}),c("function",L),c("if"),c("return",N),c("switch"),c("throw",N),c("try"),c("var"),c("let"),c("const"),c("while",{isLoop:!0}),c("with"),c("new",{beforeExpr:!0,startsExpr:!0}),c("this",L),c("super",L),c("class"),c("extends",N),c("export"),c("import"),c("yield",{beforeExpr:!0,startsExpr:!0}),c("null",L),c("true",L),c("false",L),c("in",{beforeExpr:!0,binop:7}),c("instanceof",{beforeExpr:!0,binop:7}),c("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),c("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),c("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0});var U=/\r\n?|\n|\u2028|\u2029/,V=new RegExp(U.source,"g"),G=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,q=function e(t,n,r,i){f(this,e),this.token=t,this.isExpr=!!n,this.preserveSpace=!!r,this.override=i},K={braceStatement:new q("{",!1),braceExpression:new q("{",!0),templateQuasi:new q("${",!0),parenStatement:new q("(",!1),parenExpression:new q("(",!0),template:new q("`",!0,!0,function(e){return e.readTmplToken()}),functionExpression:new q("function",!0)};M.parenR.updateContext=M.braceR.updateContext=function(){if(1===this.state.context.length)return void(this.state.exprAllowed=!0);var e=this.state.context.pop();e===K.braceStatement&&this.curContext()===K.functionExpression?(this.state.context.pop(),this.state.exprAllowed=!1):e===K.templateQuasi?this.state.exprAllowed=!0:this.state.exprAllowed=!e.isExpr},M.name.updateContext=function(e){this.state.exprAllowed=!1,e!==M._let&&e!==M._const&&e!==M._var||U.test(this.input.slice(this.state.end))&&(this.state.exprAllowed=!0)},M.braceL.updateContext=function(e){this.state.context.push(this.braceIsBlock(e)?K.braceStatement:K.braceExpression),this.state.exprAllowed=!0},M.dollarBraceL.updateContext=function(){this.state.context.push(K.templateQuasi),this.state.exprAllowed=!0},M.parenL.updateContext=function(e){var t=e===M._if||e===M._for||e===M._with||e===M._while;this.state.context.push(t?K.parenStatement:K.parenExpression),this.state.exprAllowed=!0},M.incDec.updateContext=function(){},M._function.updateContext=function(){this.curContext()!==K.braceStatement&&this.state.context.push(K.functionExpression),this.state.exprAllowed=!1},M.backQuote.updateContext=function(){this.curContext()===K.template?this.state.context.pop():this.state.context.push(K.template),this.state.exprAllowed=!1};var X=function e(t,n){h(this,e),this.line=t,this.column=n},J=function e(t,n){h(this,e),this.start=t,this.end=n},W=function(){function e(){y(this,e)}return e.prototype.init=function(e,t){return this.strict=e.strictMode!==!1&&"module"===e.sourceType,this.input=t,this.potentialArrowAt=-1,this.inMethod=this.inFunction=this.inGenerator=this.inAsync=this.inType=this.noAnonFunctionType=!1,this.labels=[],this.decorators=[],this.tokens=[],this.comments=[],this.trailingComments=[],this.leadingComments=[],this.commentStack=[],this.pos=this.lineStart=0,this.curLine=1,this.type=M.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=[K.braceStatement],this.exprAllowed=!0,this.containsEsc=this.containsOctal=!1,this.octalPosition=null,this.exportedIdentifiers=[],this},e.prototype.curPosition=function(){return new X(this.curLine,this.pos-this.lineStart)},e.prototype.clone=function(t){var n=new e;for(var r in this){var i=this[r];t&&"context"!==r||!Array.isArray(i)||(i=i.slice()),n[r]=i}return n},e}(),z=function e(t){m(this,e),this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,this.loc=new J(t.startLoc,t.endLoc)},Y=function(){function e(t,n){m(this,e),this.state=new W,this.state.init(t,n)}return e.prototype.next=function(){this.isLookahead||this.state.tokens.push(new z(this.state)),this.state.lastTokEnd=this.state.end,this.state.lastTokStart=this.state.start,this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()},e.prototype.eat=function(e){return!!this.match(e)&&(this.next(),!0)},e.prototype.match=function(e){return this.state.type===e},e.prototype.isKeyword=function(e){return w(e)},e.prototype.lookahead=function(){var e=this.state;this.state=e.clone(!0),this.isLookahead=!0,this.next(),this.isLookahead=!1;var t=this.state.clone(!0);return this.state=e,t},e.prototype.setStrict=function(e){if(this.state.strict=e,this.match(M.num)||this.match(M.string)){for(this.state.pos=this.state.start;this.state.pos=this.input.length?this.finishToken(M.eof):e.override?e.override(this):this.readToken(this.fullCharCodeAtPos())},e.prototype.readToken=function(e){return a(e)||92===e?this.readWord():this.getTokenFromCode(e)},e.prototype.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.state.pos);return e<=55295||e>=57344?e:(e<<10)+this.input.charCodeAt(this.state.pos+1)-56613888},e.prototype.pushComment=function(e,t,n,r,i,a){var s={type:e?"CommentBlock":"CommentLine",value:t,start:n,end:r,loc:new J(i,a)};this.isLookahead||(this.state.tokens.push(s),this.state.comments.push(s),this.addComment(s))},e.prototype.skipBlockComment=function(){var e=this.state.curPosition(),t=this.state.pos,n=this.input.indexOf("*/",this.state.pos+=2);n===-1&&this.raise(this.state.pos-2,"Unterminated comment"),this.state.pos=n+2,V.lastIndex=t;for(var r=void 0;(r=V.exec(this.input))&&r.index8&&e<14||e>=5760&&G.test(String.fromCharCode(e))))break e;++this.state.pos}}},e.prototype.finishToken=function(e,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();var n=this.state.type;this.state.type=e,this.state.value=t,this.updateContext(n)},e.prototype.readToken_dot=function(){var e=this.input.charCodeAt(this.state.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.state.pos+2);return 46===e&&46===t?(this.state.pos+=3,this.finishToken(M.ellipsis)):(++this.state.pos,this.finishToken(M.dot))},e.prototype.readToken_slash=function(){return this.state.exprAllowed?(++this.state.pos,this.readRegexp()):61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(M.assign,2):this.finishOp(M.slash,1)},e.prototype.readToken_mult_modulo=function(e){var t=42===e?M.star:M.modulo,n=1,r=this.input.charCodeAt(this.state.pos+1);return 42===r&&(n++,r=this.input.charCodeAt(this.state.pos+2),t=M.exponent),61===r&&(n++,t=M.assign),this.finishOp(t,n)},e.prototype.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?this.finishOp(124===e?M.logicalOR:M.logicalAND,2):61===t?this.finishOp(M.assign,2):124===e&&125===t&&this.hasPlugin("flow")?this.finishOp(M.braceBarR,2):this.finishOp(124===e?M.bitwiseOR:M.bitwiseAND,1)},e.prototype.readToken_caret=function(){return 61===this.input.charCodeAt(this.state.pos+1)?this.finishOp(M.assign,2):this.finishOp(M.bitwiseXOR,1)},e.prototype.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.state.pos+1);return t===e?45===t&&62===this.input.charCodeAt(this.state.pos+2)&&U.test(this.input.slice(this.state.lastTokEnd,this.state.pos))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(M.incDec,2):61===t?this.finishOp(M.assign,2):this.finishOp(M.plusMin,1)},e.prototype.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.state.pos+1),n=1;return t===e?(n=62===e&&62===this.input.charCodeAt(this.state.pos+2)?3:2,61===this.input.charCodeAt(this.state.pos+n)?this.finishOp(M.assign,n+1):this.finishOp(M.bitShift,n)):33===t&&60===e&&45===this.input.charCodeAt(this.state.pos+2)&&45===this.input.charCodeAt(this.state.pos+3)?(this.inModule&&this.unexpected(),this.skipLineComment(4),this.skipSpace(),this.nextToken()):(61===t&&(n=2),this.finishOp(M.relational,n))},e.prototype.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.state.pos+1);return 61===t?this.finishOp(M.equality,61===this.input.charCodeAt(this.state.pos+2)?3:2):61===e&&62===t?(this.state.pos+=2,this.finishToken(M.arrow)):this.finishOp(61===e?M.eq:M.prefix,1)},e.prototype.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.state.pos,this.finishToken(M.parenL);case 41:return++this.state.pos,this.finishToken(M.parenR);case 59:return++this.state.pos,this.finishToken(M.semi);case 44:return++this.state.pos,this.finishToken(M.comma);case 91:return++this.state.pos,this.finishToken(M.bracketL);case 93:return++this.state.pos,this.finishToken(M.bracketR);case 123:return this.hasPlugin("flow")&&124===this.input.charCodeAt(this.state.pos+1)?this.finishOp(M.braceBarL,2):(++this.state.pos,this.finishToken(M.braceL));case 125:return++this.state.pos,this.finishToken(M.braceR);case 58:return this.hasPlugin("functionBind")&&58===this.input.charCodeAt(this.state.pos+1)?this.finishOp(M.doubleColon,2):(++this.state.pos,this.finishToken(M.colon));case 63:return++this.state.pos,this.finishToken(M.question);case 64:return++this.state.pos,this.finishToken(M.at);case 96:return++this.state.pos,this.finishToken(M.backQuote);case 48:var t=this.input.charCodeAt(this.state.pos+1);if(120===t||88===t)return this.readRadixNumber(16);if(111===t||79===t)return this.readRadixNumber(8);if(98===t||66===t)return this.readRadixNumber(2);case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 126:return this.finishOp(M.prefix,1)}this.raise(this.state.pos,"Unexpected character '"+b(e)+"'")},e.prototype.finishOp=function(e,t){var n=this.input.slice(this.state.pos,this.state.pos+t);return this.state.pos+=t,this.finishToken(e,n)},e.prototype.readRegexp=function(){for(var e=void 0,t=void 0,n=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(n,"Unterminated regular expression");var r=this.input.charAt(this.state.pos);if(U.test(r)&&this.raise(n,"Unterminated regular expression"),e)e=!1;else{if("["===r)t=!0;else if("]"===r&&t)t=!1;else if("/"===r&&!t)break;e="\\"===r}++this.state.pos}var i=this.input.slice(n,this.state.pos);++this.state.pos;var a=this.readWord1();if(a){/^[gmsiyu]*$/.test(a)||this.raise(n,"Invalid regular expression flag")}return this.finishToken(M.regexp,{pattern:i,flags:a})},e.prototype.readInt=function(e,t){for(var n=this.state.pos,r=0,i=0,a=null==t?1/0:t;i=97?s-97+10:s>=65?s-65+10:s>=48&&s<=57?s-48:1/0,o>=e)break;++this.state.pos,r=r*e+o}return this.state.pos===n||null!=t&&this.state.pos-n!==t?null:r},e.prototype.readRadixNumber=function(e){this.state.pos+=2;var t=this.readInt(e);return null==t&&this.raise(this.state.start+2,"Expected number in radix "+e),a(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number"),this.finishToken(M.num,t)}, +e.prototype.readNumber=function(e){var t=this.state.pos,n=!1,r=48===this.input.charCodeAt(this.state.pos);e||null!==this.readInt(10)||this.raise(t,"Invalid number");var i=this.input.charCodeAt(this.state.pos);46===i&&(++this.state.pos,this.readInt(10),n=!0,i=this.input.charCodeAt(this.state.pos)),69!==i&&101!==i||(i=this.input.charCodeAt(++this.state.pos),43!==i&&45!==i||++this.state.pos,null===this.readInt(10)&&this.raise(t,"Invalid number"),n=!0),a(this.fullCharCodeAtPos())&&this.raise(this.state.pos,"Identifier directly after number");var s=this.input.slice(t,this.state.pos),o=void 0;return n?o=parseFloat(s):r&&1!==s.length?/[89]/.test(s)||this.state.strict?this.raise(t,"Invalid number"):o=parseInt(s,8):o=parseInt(s,10),this.finishToken(M.num,o)},e.prototype.readCodePoint=function(){var e=this.input.charCodeAt(this.state.pos),t=void 0;if(123===e){var n=++this.state.pos;t=this.readHexChar(this.input.indexOf("}",this.state.pos)-this.state.pos),++this.state.pos,t>1114111&&this.raise(n,"Code point out of bounds")}else t=this.readHexChar(4);return t},e.prototype.readString=function(e){for(var t="",n=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var r=this.input.charCodeAt(this.state.pos);if(r===e)break;92===r?(t+=this.input.slice(n,this.state.pos),t+=this.readEscapedChar(!1),n=this.state.pos):(p(r)&&this.raise(this.state.start,"Unterminated string constant"),++this.state.pos)}return t+=this.input.slice(n,this.state.pos++),this.finishToken(M.string,t)},e.prototype.readTmplToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated template");var n=this.input.charCodeAt(this.state.pos);if(96===n||36===n&&123===this.input.charCodeAt(this.state.pos+1))return this.state.pos===this.state.start&&this.match(M.template)?36===n?(this.state.pos+=2,this.finishToken(M.dollarBraceL)):(++this.state.pos,this.finishToken(M.backQuote)):(e+=this.input.slice(t,this.state.pos),this.finishToken(M.template,e));if(92===n)e+=this.input.slice(t,this.state.pos),e+=this.readEscapedChar(!0),t=this.state.pos;else if(p(n)){switch(e+=this.input.slice(t,this.state.pos),++this.state.pos,n){case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:e+="\n";break;default:e+=String.fromCharCode(n)}++this.state.curLine,this.state.lineStart=this.state.pos,t=this.state.pos}else++this.state.pos}},e.prototype.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.state.pos);switch(++this.state.pos,t){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return b(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.state.pos)&&++this.state.pos;case 10:return this.state.lineStart=this.state.pos,++this.state.curLine,"";default:if(t>=48&&t<=55){var n=this.input.substr(this.state.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(n,8);return r>255&&(n=n.slice(0,-1),r=parseInt(n,8)),r>0&&(this.state.containsOctal||(this.state.containsOctal=!0,this.state.octalPosition=this.state.pos-2),(this.state.strict||e)&&this.raise(this.state.pos-2,"Octal literal in strict mode")),this.state.pos+=n.length-1,String.fromCharCode(r)}return String.fromCharCode(t)}},e.prototype.readHexChar=function(e){var t=this.state.pos,n=this.readInt(16,e);return null===n&&this.raise(t,"Bad character escape sequence"),n},e.prototype.readWord1=function(){this.state.containsEsc=!1;for(var e="",t=!0,n=this.state.pos;this.state.pos=0)return this.loadAllPlugins(),{"*":!0};var t={};e.indexOf("flow")>=0&&(e=e.filter(function(e){return"flow"!==e}),e.push("flow"));for(var n=e,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}var s=a;if(!t[s]){t[s]=!0;var o=H[s];o&&o(this)}}return t},t.prototype.parse=function(){var e=this.startNode(),t=this.startNode();return this.nextToken(),this.parseTopLevel(e,t)},t}(Y),Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z=$.prototype;Z.addExtra=function(e,t,n){if(e){(e.extra=e.extra||{})[t]=n}},Z.isRelational=function(e){return this.match(M.relational)&&this.state.value===e},Z.expectRelational=function(e){this.isRelational(e)?this.next():this.unexpected(null,M.relational)},Z.isContextual=function(e){return this.match(M.name)&&this.state.value===e},Z.eatContextual=function(e){return this.state.value===e&&this.eat(M.name)},Z.expectContextual=function(e,t){this.eatContextual(e)||this.unexpected(null,t)},Z.canInsertSemicolon=function(){return this.match(M.eof)||this.match(M.braceR)||U.test(this.input.slice(this.state.lastTokEnd,this.state.start))},Z.isLineTerminator=function(){return this.eat(M.semi)||this.canInsertSemicolon()},Z.semicolon=function(){this.isLineTerminator()||this.unexpected(null,M.semi)},Z.expect=function(e,t){return this.eat(e)||this.unexpected(t,e)},Z.unexpected=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Unexpected token";t&&"object"===(void 0===t?"undefined":Q(t))&&t.label&&(t="Unexpected token, expected "+t.label),this.raise(null!=e?e:this.state.start,t)};var ee=$.prototype;ee.parseTopLevel=function(e,t){return t.sourceType=this.options.sourceType,this.parseBlockBody(t,!0,!0,M.eof),e.program=this.finishNode(t,"Program"),e.comments=this.state.comments,e.tokens=this.state.tokens,this.finishNode(e,"File")};var te={kind:"loop"},ne={kind:"switch"};ee.stmtToDirective=function(e){var t=e.expression,n=this.startNodeAt(t.start,t.loc.start),r=this.startNodeAt(e.start,e.loc.start),i=this.input.slice(t.start,t.end),a=n.value=i.slice(1,-1);return this.addExtra(n,"raw",i),this.addExtra(n,"rawValue",a),r.value=this.finishNodeAt(n,"DirectiveLiteral",t.end,t.loc.end),this.finishNodeAt(r,"Directive",e.end,e.loc.end)},ee.parseStatement=function(e,t){this.match(M.at)&&this.parseDecorators(!0);var n=this.state.type,r=this.startNode();switch(n){case M._break:case M._continue:return this.parseBreakContinueStatement(r,n.keyword);case M._debugger:return this.parseDebuggerStatement(r);case M._do:return this.parseDoStatement(r);case M._for:return this.parseForStatement(r);case M._function:return e||this.unexpected(),this.parseFunctionStatement(r);case M._class:return e||this.unexpected(),this.takeDecorators(r),this.parseClass(r,!0);case M._if:return this.parseIfStatement(r);case M._return:return this.parseReturnStatement(r);case M._switch:return this.parseSwitchStatement(r);case M._throw:return this.parseThrowStatement(r);case M._try:return this.parseTryStatement(r);case M._let:case M._const:e||this.unexpected();case M._var:return this.parseVarStatement(r,n);case M._while:return this.parseWhileStatement(r);case M._with:return this.parseWithStatement(r);case M.braceL:return this.parseBlock();case M.semi:return this.parseEmptyStatement(r);case M._export:case M._import:if(this.hasPlugin("dynamicImport")&&this.lookahead().type===M.parenL)break;return this.options.allowImportExportEverywhere||(t||this.raise(this.state.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.state.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===M._import?this.parseImport(r):this.parseExport(r);case M.name:if("async"===this.state.value){var i=this.state.clone();if(this.next(),this.match(M._function)&&!this.canInsertSemicolon())return this.expect(M._function),this.parseFunction(r,!0,!1,!0);this.state=i}}var a=this.state.value,s=this.parseExpression();return n===M.name&&"Identifier"===s.type&&this.eat(M.colon)?this.parseLabeledStatement(r,a,s):this.parseExpressionStatement(r,s)},ee.takeDecorators=function(e){this.state.decorators.length&&(e.decorators=this.state.decorators,this.state.decorators=[])},ee.parseDecorators=function(e){for(;this.match(M.at);)this.state.decorators.push(this.parseDecorator());e&&this.match(M._export)||this.match(M._class)||this.raise(this.state.start,"Leading decorators must be attached to a class declaration")},ee.parseDecorator=function(){this.hasPlugin("decorators")||this.unexpected();var e=this.startNode();return this.next(),e.expression=this.parseMaybeAssign(),this.finishNode(e,"Decorator")},ee.parseBreakContinueStatement=function(e,t){var n="break"===t;this.next(),this.isLineTerminator()?e.label=null:this.match(M.name)?(e.label=this.parseIdentifier(),this.semicolon()):this.unexpected();var r=void 0;for(r=0;r=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}s.name===t&&this.raise(n.start,"Label '"+t+"' is already declared")}for(var o=this.state.type.isLoop?"loop":this.match(M._switch)?"switch":null,u=this.state.labels.length-1;u>=0;u--){var l=this.state.labels[u];if(l.statementStart!==e.start)break;l.statementStart=this.state.start,l.kind=o}return this.state.labels.push({name:t,kind:o,statementStart:this.state.start}),e.body=this.parseStatement(!0),this.state.labels.pop(),e.label=n,this.finishNode(e,"LabeledStatement")},ee.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")},ee.parseBlock=function(e){var t=this.startNode();return this.expect(M.braceL),this.parseBlockBody(t,e,!1,M.braceR),this.finishNode(t,"BlockStatement")},ee.parseBlockBody=function(e,t,n,r){e.body=[],e.directives=[];for(var i=!1,a=void 0,s=void 0;!this.eat(r);){i||!this.state.containsOctal||s||(s=this.state.octalPosition);var o=this.parseStatement(!0,n);if(!t||i||"ExpressionStatement"!==o.type||"StringLiteral"!==o.expression.type||o.expression.extra.parenthesized)i=!0,e.body.push(o);else{var u=this.stmtToDirective(o);e.directives.push(u),void 0===a&&"use strict"===u.value.value&&(a=this.state.strict,this.setStrict(!0),s&&this.raise(s,"Octal literal in strict mode"))}}a===!1&&this.setStrict(!1)},ee.parseFor=function(e,t){return e.init=t,this.expect(M.semi),e.test=this.match(M.semi)?null:this.parseExpression(),this.expect(M.semi),e.update=this.match(M.parenR)?null:this.parseExpression(),this.expect(M.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,"ForStatement")},ee.parseForIn=function(e,t,n){var r=void 0;return n?(this.eatContextual("of"),r="ForAwaitStatement"):(r=this.match(M._in)?"ForInStatement":"ForOfStatement",this.next()),e.left=t,e.right=this.parseExpression(),this.expect(M.parenR),e.body=this.parseStatement(!1),this.state.labels.pop(),this.finishNode(e,r)},ee.parseVar=function(e,t,n){for(e.declarations=[],e.kind=n.keyword;;){var r=this.startNode();if(this.parseVarHead(r),this.eat(M.eq)?r.init=this.parseMaybeAssign(t):n!==M._const||this.match(M._in)||this.isContextual("of")?"Identifier"===r.id.type||t&&(this.match(M._in)||this.isContextual("of"))?r.init=null:this.raise(this.state.lastTokEnd,"Complex binding patterns require an initialization value"):this.unexpected(),e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(M.comma))break}return e},ee.parseVarHead=function(e){e.id=this.parseBindingAtom(),this.checkLVal(e.id,!0,void 0,"variable declaration")},ee.parseFunction=function(e,t,n,r,i){var a=this.state.inMethod;return this.state.inMethod=!1,this.initFunction(e,r),this.match(M.star)&&(e.async&&!this.hasPlugin("asyncGenerators")?this.unexpected():(e.generator=!0,this.next())),!t||i||this.match(M.name)||this.match(M._yield)||this.unexpected(),(this.match(M.name)||this.match(M._yield))&&(e.id=this.parseBindingIdentifier()),this.parseFunctionParams(e),this.parseFunctionBody(e,n),this.state.inMethod=a,this.finishNode(e,t?"FunctionDeclaration":"FunctionExpression")},ee.parseFunctionParams=function(e){this.expect(M.parenL),e.params=this.parseBindingList(M.parenR)},ee.parseClass=function(e,t,n){return this.next(),this.parseClassId(e,t,n),this.parseClassSuper(e),this.parseClassBody(e),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")},ee.isClassProperty=function(){return this.match(M.eq)||this.isLineTerminator()},ee.isClassMutatorStarter=function(){return!1},ee.parseClassBody=function(e){var t=this.state.strict;this.state.strict=!0;var n=!1,r=!1,i=[],a=this.startNode();for(a.body=[],this.expect(M.braceL);!this.eat(M.braceR);)if(!this.eat(M.semi))if(this.match(M.at))i.push(this.parseDecorator());else{var s=this.startNode();i.length&&(s.decorators=i,i=[]);var o=!1,u=this.match(M.name)&&"static"===this.state.value,l=this.eat(M.star),c=!1,p=!1;if(this.parsePropertyName(s),s.static=u&&!this.match(M.parenL),s.static&&(l=this.eat(M.star),this.parsePropertyName(s)),!l){if(this.isClassProperty()){a.body.push(this.parseClassProperty(s));continue}"Identifier"===s.key.type&&!s.computed&&this.hasPlugin("classConstructorCall")&&"call"===s.key.name&&this.match(M.name)&&"constructor"===this.state.value&&(o=!0,this.parsePropertyName(s))}var f=!this.match(M.parenL)&&!s.computed&&"Identifier"===s.key.type&&"async"===s.key.name;if(f&&(this.hasPlugin("asyncGenerators")&&this.eat(M.star)&&(l=!0),p=!0,this.parsePropertyName(s)),s.kind="method",!s.computed){var h=s.key;p||l||this.isClassMutatorStarter()||"Identifier"!==h.type||this.match(M.parenL)||"get"!==h.name&&"set"!==h.name||(c=!0,s.kind=h.name,h=this.parsePropertyName(s));var d=!o&&!s.static&&("Identifier"===h.type&&"constructor"===h.name||"StringLiteral"===h.type&&"constructor"===h.value);d&&(r&&this.raise(h.start,"Duplicate constructor in the same class"),c&&this.raise(h.start,"Constructor can't have get/set modifier"),l&&this.raise(h.start,"Constructor can't be a generator"),p&&this.raise(h.start,"Constructor can't be an async function"),s.kind="constructor",r=!0);var y=s.static&&("Identifier"===h.type&&"prototype"===h.name||"StringLiteral"===h.type&&"prototype"===h.value);y&&this.raise(h.start,"Classes may not have static property named prototype")}if(o&&(n&&this.raise(s.start,"Duplicate constructor call in the same class"),s.kind="constructorCall",n=!0),"constructor"!==s.kind&&"constructorCall"!==s.kind||!s.decorators||this.raise(s.start,"You can't attach decorators to a class constructor"),this.parseClassMethod(a,s,l,p),c){var m="get"===s.kind?0:1;if(s.params.length!==m){var b=s.start;"get"===s.kind?this.raise(b,"getter should have no params"):this.raise(b,"setter should have exactly one param")}}}i.length&&this.raise(this.state.start,"You have trailing decorators with no method"),e.body=this.finishNode(a,"ClassBody"),this.state.strict=t},ee.parseClassProperty=function(e){return this.match(M.eq)?(this.hasPlugin("classProperties")||this.unexpected(),this.next(),e.value=this.parseMaybeAssign()):e.value=null,this.semicolon(),this.finishNode(e,"ClassProperty")},ee.parseClassMethod=function(e,t,n,r){this.parseMethod(t,n,r),e.body.push(this.finishNode(t,"ClassMethod"))},ee.parseClassId=function(e,t,n){this.match(M.name)?e.id=this.parseIdentifier():n||!t?e.id=null:this.unexpected()},ee.parseClassSuper=function(e){e.superClass=this.eat(M._extends)?this.parseExprSubscripts():null},ee.parseExport=function(e){if(this.next(),this.match(M.star)){var t=this.startNode();if(this.next(),!this.hasPlugin("exportExtensions")||!this.eatContextual("as"))return this.parseExportFrom(e,!0),this.finishNode(e,"ExportAllDeclaration");t.exported=this.parseIdentifier(),e.specifiers=[this.finishNode(t,"ExportNamespaceSpecifier")],this.parseExportSpecifiersMaybe(e),this.parseExportFrom(e,!0)}else if(this.hasPlugin("exportExtensions")&&this.isExportDefaultSpecifier()){var n=this.startNode();if(n.exported=this.parseIdentifier(!0),e.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],this.match(M.comma)&&this.lookahead().type===M.star){this.expect(M.comma);var r=this.startNode();this.expect(M.star),this.expectContextual("as"),r.exported=this.parseIdentifier(),e.specifiers.push(this.finishNode(r,"ExportNamespaceSpecifier"))}else this.parseExportSpecifiersMaybe(e);this.parseExportFrom(e,!0)}else{if(this.eat(M._default)){var i=this.startNode(),a=!1;return this.eat(M._function)?i=this.parseFunction(i,!0,!1,!1,!0):this.match(M._class)?i=this.parseClass(i,!0,!0):(a=!0,i=this.parseMaybeAssign()),e.declaration=i,a&&this.semicolon(),this.checkExport(e,!0,!0),this.finishNode(e,"ExportDefaultDeclaration")}this.state.type.keyword||this.shouldParseExportDeclaration()?(e.specifiers=[],e.source=null,e.declaration=this.parseExportDeclaration(e)):(e.declaration=null,e.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(e))}return this.checkExport(e,!0),this.finishNode(e,"ExportNamedDeclaration")},ee.parseExportDeclaration=function(){return this.parseStatement(!0)},ee.isExportDefaultSpecifier=function(){if(this.match(M.name))return"type"!==this.state.value&&"async"!==this.state.value&&"interface"!==this.state.value;if(!this.match(M._default))return!1;var e=this.lookahead();return e.type===M.comma||e.type===M.name&&"from"===e.value},ee.parseExportSpecifiersMaybe=function(e){this.eat(M.comma)&&(e.specifiers=e.specifiers.concat(this.parseExportSpecifiers()))},ee.parseExportFrom=function(e,t){this.eatContextual("from")?(e.source=this.match(M.string)?this.parseExprAtom():this.unexpected(),this.checkExport(e)):t?this.unexpected():e.source=null,this.semicolon()},ee.shouldParseExportDeclaration=function(){return this.isContextual("async")},ee.checkExport=function(e,t,n){if(t)if(n)this.checkDuplicateExports(e,"default");else if(e.specifiers&&e.specifiers.length)for(var r=e.specifiers,i=Array.isArray(r),a=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;this.checkDuplicateExports(o,o.exported.name)}else if(e.declaration)if("FunctionDeclaration"===e.declaration.type||"ClassDeclaration"===e.declaration.type)this.checkDuplicateExports(e,e.declaration.id.name);else if("VariableDeclaration"===e.declaration.type)for(var u=e.declaration.declarations,l=Array.isArray(u),c=0,u=l?u:u[Symbol.iterator]();;){var p;if(l){if(c>=u.length)break;p=u[c++]}else{if(c=u.next(),c.done)break;p=c.value}var f=p;this.checkDeclaration(f.id)}if(this.state.decorators.length){var h=e.declaration&&("ClassDeclaration"===e.declaration.type||"ClassExpression"===e.declaration.type);e.declaration&&h||this.raise(e.start,"You can only use decorators on an export when exporting a class"),this.takeDecorators(e.declaration)}},ee.checkDeclaration=function(e){if("ObjectPattern"===e.type)for(var t=e.properties,n=Array.isArray(t),r=0,t=n?t:t[Symbol.iterator]();;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i;this.checkDeclaration(a)}else if("ArrayPattern"===e.type)for(var s=e.elements,o=Array.isArray(s),u=0,s=o?s:s[Symbol.iterator]();;){var l;if(o){if(u>=s.length)break;l=s[u++]}else{if(u=s.next(),u.done)break;l=u.value}var c=l;c&&this.checkDeclaration(c)}else"ObjectProperty"===e.type?this.checkDeclaration(e.value):"RestElement"===e.type||"RestProperty"===e.type?this.checkDeclaration(e.argument):"Identifier"===e.type&&this.checkDuplicateExports(e,e.name)},ee.checkDuplicateExports=function(e,t){this.state.exportedIdentifiers.indexOf(t)>-1&&this.raiseDuplicateExportError(e,t),this.state.exportedIdentifiers.push(t)},ee.raiseDuplicateExportError=function(e,t){this.raise(e.start,"default"===t?"Only one default export allowed per module.":"`"+t+"` has already been exported. Exported identifiers must be unique.")},ee.parseExportSpecifiers=function(){var e=[],t=!0,n=void 0;for(this.expect(M.braceL);!this.eat(M.braceR);){if(t)t=!1;else if(this.expect(M.comma),this.eat(M.braceR))break;var r=this.match(M._default);r&&!n&&(n=!0);var i=this.startNode();i.local=this.parseIdentifier(r),i.exported=this.eatContextual("as")?this.parseIdentifier(!0):i.local.__clone(),e.push(this.finishNode(i,"ExportSpecifier"))}return n&&!this.isContextual("from")&&this.unexpected(),e},ee.parseImport=function(e){return this.next(),this.match(M.string)?(e.specifiers=[],e.source=this.parseExprAtom()):(e.specifiers=[],this.parseImportSpecifiers(e),this.expectContextual("from"),e.source=this.match(M.string)?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(e,"ImportDeclaration")},ee.parseImportSpecifiers=function(e){var t=!0;if(this.match(M.name)){var n=this.state.start,r=this.state.startLoc;if(e.specifiers.push(this.parseImportSpecifierDefault(this.parseIdentifier(),n,r)),!this.eat(M.comma))return}if(this.match(M.star)){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdentifier(),this.checkLVal(i.local,!0,void 0,"import namespace specifier"),void e.specifiers.push(this.finishNode(i,"ImportNamespaceSpecifier"))}for(this.expect(M.braceL);!this.eat(M.braceR);){if(t)t=!1;else if(this.expect(M.comma),this.eat(M.braceR))break;var a=this.startNode();a.imported=this.parseIdentifier(!0),a.local=this.eatContextual("as")?this.parseIdentifier():a.imported.__clone(),this.checkLVal(a.local,!0,void 0,"import specifier"),e.specifiers.push(this.finishNode(a,"ImportSpecifier"))}},ee.parseImportSpecifierDefault=function(e,t,n){var r=this.startNodeAt(t,n);return r.local=e,this.checkLVal(r.local,!0,void 0,"default import specifier"),this.finishNode(r,"ImportDefaultSpecifier")};var ie=$.prototype;ie.toAssignable=function(e,t,n){if(e)switch(e.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":break;case"ObjectExpression":e.type="ObjectPattern";for(var r=e.properties,i=Array.isArray(r),a=0,r=i?r:r[Symbol.iterator]();;){var s;if(i){if(a>=r.length)break;s=r[a++]}else{if(a=r.next(),a.done)break;s=a.value}var o=s;"ObjectMethod"===o.type?"get"===o.kind||"set"===o.kind?this.raise(o.key.start,"Object pattern can't contain getter or setter"):this.raise(o.key.start,"Object pattern can't contain methods"):this.toAssignable(o,t,"object destructuring pattern")}break;case"ObjectProperty":this.toAssignable(e.value,t,n);break;case"SpreadProperty":e.type="RestProperty";break;case"ArrayExpression":e.type="ArrayPattern",this.toAssignableList(e.elements,t,n);break;case"AssignmentExpression":"="===e.operator?(e.type="AssignmentPattern",delete e.operator):this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");break;case"MemberExpression":if(!t)break;default:var u="Invalid left-hand side"+(n?" in "+n:"expression");this.raise(e.start,u)}return e},ie.toAssignableList=function(e,t,n){var r=e.length;if(r){var i=e[r-1];if(i&&"RestElement"===i.type)--r;else if(i&&"SpreadElement"===i.type){i.type="RestElement";var a=i.argument;this.toAssignable(a,t,n),"Identifier"!==a.type&&"MemberExpression"!==a.type&&"ArrayPattern"!==a.type&&this.unexpected(a.start),--r}}for(var s=0;s=a.length)break;u=a[o++]}else{if(o=a.next(),o.done)break;u=o.value}var l=u;"ObjectProperty"===l.type&&(l=l.value),this.checkLVal(l,t,n,"object destructuring pattern")}break;case"ArrayPattern":for(var c=e.elements,p=Array.isArray(c),f=0,c=p?c:c[Symbol.iterator]();;){var h;if(p){if(f>=c.length)break;h=c[f++]}else{if(f=c.next(),f.done)break;h=f.value}var d=h;d&&this.checkLVal(d,t,n,"array destructuring pattern")}break;case"AssignmentPattern":this.checkLVal(e.left,t,n,"assignment pattern");break;case"RestProperty":this.checkLVal(e.argument,t,n,"rest property");break;case"RestElement":this.checkLVal(e.argument,t,n,"rest element");break;default: +var y=(t?"Binding invalid":"Invalid")+" left-hand side"+(r?" in "+r:"expression");this.raise(e.start,y)}};var ae=$.prototype;ae.checkPropClash=function(e,t){if(!e.computed){var n=e.key,r=void 0;switch(n.type){case"Identifier":r=n.name;break;case"StringLiteral":case"NumericLiteral":r=String(n.value);break;default:return}"__proto__"!==r||e.kind||(t.proto&&this.raise(n.start,"Redefinition of __proto__ property"),t.proto=!0)}},ae.parseExpression=function(e,t){var n=this.state.start,r=this.state.startLoc,i=this.parseMaybeAssign(e,t);if(this.match(M.comma)){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(M.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.toReferencedList(a.expressions),this.finishNode(a,"SequenceExpression")}return i},ae.parseMaybeAssign=function(e,t,n,r){var i=this.state.start,a=this.state.startLoc;if(this.match(M._yield)&&this.state.inGenerator){var s=this.parseYield();return n&&(s=n.call(this,s,i,a)),s}var o=void 0;t?o=!1:(t={start:0},o=!0),(this.match(M.parenL)||this.match(M.name))&&(this.state.potentialArrowAt=this.state.start);var u=this.parseMaybeConditional(e,t,r);if(n&&(u=n.call(this,u,i,a)),this.state.type.isAssign){var l=this.startNodeAt(i,a);if(l.operator=this.state.value,l.left=this.match(M.eq)?this.toAssignable(u,void 0,"assignment expression"):u,t.start=0,this.checkLVal(u,void 0,void 0,"assignment expression"),u.extra&&u.extra.parenthesized){var c=void 0;"ObjectPattern"===u.type?c="`({a}) = 0` use `({a} = 0)`":"ArrayPattern"===u.type&&(c="`([a]) = 0` use `([a] = 0)`"),c&&this.raise(u.start,"You're trying to assign to a parenthesized expression, eg. instead of "+c)}return this.next(),l.right=this.parseMaybeAssign(e),this.finishNode(l,"AssignmentExpression")}return o&&t.start&&this.unexpected(t.start),u},ae.parseMaybeConditional=function(e,t,n){var r=this.state.start,i=this.state.startLoc,a=this.parseExprOps(e,t);return t&&t.start?a:this.parseConditional(a,e,r,i,n)},ae.parseConditional=function(e,t,n,r){if(this.eat(M.question)){var i=this.startNodeAt(n,r);return i.test=e,i.consequent=this.parseMaybeAssign(),this.expect(M.colon),i.alternate=this.parseMaybeAssign(t),this.finishNode(i,"ConditionalExpression")}return e},ae.parseExprOps=function(e,t){var n=this.state.start,r=this.state.startLoc,i=this.parseMaybeUnary(t);return t&&t.start?i:this.parseExprOp(i,n,r,-1,e)},ae.parseExprOp=function(e,t,n,r,i){var a=this.state.type.binop;if(!(null==a||i&&this.match(M._in))&&a>r){var s=this.startNodeAt(t,n);s.left=e,s.operator=this.state.value,"**"!==s.operator||"UnaryExpression"!==e.type||!e.extra||e.extra.parenthesizedArgument||e.extra.parenthesized||this.raise(e.argument.start,"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");var o=this.state.type;this.next();var u=this.state.start,l=this.state.startLoc;return s.right=this.parseExprOp(this.parseMaybeUnary(),u,l,o.rightAssociative?a-1:a,i),this.finishNode(s,o===M.logicalOR||o===M.logicalAND?"LogicalExpression":"BinaryExpression"),this.parseExprOp(s,t,n,r,i)}return e},ae.parseMaybeUnary=function(e){if(this.state.type.prefix){var t=this.startNode(),n=this.match(M.incDec);t.operator=this.state.value,t.prefix=!0,this.next();var r=this.state.type;return t.argument=this.parseMaybeUnary(),this.addExtra(t,"parenthesizedArgument",!(r!==M.parenL||t.argument.extra&&t.argument.extra.parenthesized)),e&&e.start&&this.unexpected(e.start),n?this.checkLVal(t.argument,void 0,void 0,"prefix operation"):this.state.strict&&"delete"===t.operator&&"Identifier"===t.argument.type&&this.raise(t.start,"Deleting local variable in strict mode"),this.finishNode(t,n?"UpdateExpression":"UnaryExpression")}var i=this.state.start,a=this.state.startLoc,s=this.parseExprSubscripts(e);if(e&&e.start)return s;for(;this.state.type.postfix&&!this.canInsertSemicolon();){var o=this.startNodeAt(i,a);o.operator=this.state.value,o.prefix=!1,o.argument=s,this.checkLVal(s,void 0,void 0,"postfix operation"),this.next(),s=this.finishNode(o,"UpdateExpression")}return s},ae.parseExprSubscripts=function(e){var t=this.state.start,n=this.state.startLoc,r=this.state.potentialArrowAt,i=this.parseExprAtom(e);return"ArrowFunctionExpression"===i.type&&i.start===r?i:e&&e.start?i:this.parseSubscripts(i,t,n)},ae.parseSubscripts=function(e,t,n,r){for(;;){if(!r&&this.eat(M.doubleColon)){var i=this.startNodeAt(t,n);return i.object=e,i.callee=this.parseNoCallExpr(),this.parseSubscripts(this.finishNode(i,"BindExpression"),t,n,r)}if(this.eat(M.dot)){var a=this.startNodeAt(t,n);a.object=e,a.property=this.parseIdentifier(!0),a.computed=!1,e=this.finishNode(a,"MemberExpression")}else if(this.eat(M.bracketL)){var s=this.startNodeAt(t,n);s.object=e,s.property=this.parseExpression(),s.computed=!0,this.expect(M.bracketR),e=this.finishNode(s,"MemberExpression")}else if(!r&&this.match(M.parenL)){var o=this.state.potentialArrowAt===e.start&&"Identifier"===e.type&&"async"===e.name&&!this.canInsertSemicolon();this.next();var u=this.startNodeAt(t,n);if(u.callee=e,u.arguments=this.parseCallExpressionArguments(M.parenR,o),"Import"===u.callee.type&&1!==u.arguments.length&&this.raise(u.start,"import() requires exactly one argument"),e=this.finishNode(u,"CallExpression"),o&&this.shouldParseAsyncArrow())return this.parseAsyncArrowFromCallExpression(this.startNodeAt(t,n),u);this.toReferencedList(u.arguments)}else{if(!this.match(M.backQuote))return e;var l=this.startNodeAt(t,n);l.tag=e,l.quasi=this.parseTemplate(),e=this.finishNode(l,"TaggedTemplateExpression")}}},ae.parseCallExpressionArguments=function(e,t){for(var n=void 0,r=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(M.comma),this.eat(e))break;this.match(M.parenL)&&!n&&(n=this.state.start),r.push(this.parseExprListItem(void 0,t?{start:0}:void 0))}return t&&n&&this.shouldParseAsyncArrow()&&this.unexpected(),r},ae.shouldParseAsyncArrow=function(){return this.match(M.arrow)},ae.parseAsyncArrowFromCallExpression=function(e,t){return this.expect(M.arrow),this.parseArrowExpression(e,t.arguments,!0)},ae.parseNoCallExpr=function(){var e=this.state.start,t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),e,t,!0)},ae.parseExprAtom=function(e){var t=void 0,n=this.state.potentialArrowAt===this.state.start;switch(this.state.type){case M._super:return this.state.inMethod||this.options.allowSuperOutsideMethod||this.raise(this.state.start,"'super' outside of function or class"),t=this.startNode(),this.next(),this.match(M.parenL)||this.match(M.bracketL)||this.match(M.dot)||this.unexpected(),this.match(M.parenL)&&"constructor"!==this.state.inMethod&&!this.options.allowSuperOutsideMethod&&this.raise(t.start,"super() outside of class constructor"),this.finishNode(t,"Super");case M._import:return this.hasPlugin("dynamicImport")||this.unexpected(),t=this.startNode(),this.next(),this.match(M.parenL)||this.unexpected(null,M.parenL),this.finishNode(t,"Import");case M._this:return t=this.startNode(),this.next(),this.finishNode(t,"ThisExpression");case M._yield:this.state.inGenerator&&this.unexpected();case M.name:t=this.startNode();var r="await"===this.state.value&&this.state.inAsync,i=this.shouldAllowYieldIdentifier(),a=this.parseIdentifier(r||i);if("await"===a.name){if(this.state.inAsync||this.inModule)return this.parseAwait(t)}else{if("async"===a.name&&this.match(M._function)&&!this.canInsertSemicolon())return this.next(),this.parseFunction(t,!1,!1,!0);if(n&&"async"===a.name&&this.match(M.name)){var s=[this.parseIdentifier()];return this.expect(M.arrow),this.parseArrowExpression(t,s,!0)}}return n&&!this.canInsertSemicolon()&&this.eat(M.arrow)?this.parseArrowExpression(t,[a]):a;case M._do:if(this.hasPlugin("doExpressions")){var o=this.startNode();this.next();var u=this.state.inFunction,l=this.state.labels;return this.state.labels=[],this.state.inFunction=!1,o.body=this.parseBlock(!1,!0),this.state.inFunction=u,this.state.labels=l,this.finishNode(o,"DoExpression")}case M.regexp:var c=this.state.value;return t=this.parseLiteral(c.value,"RegExpLiteral"),t.pattern=c.pattern,t.flags=c.flags,t;case M.num:return this.parseLiteral(this.state.value,"NumericLiteral");case M.string:return this.parseLiteral(this.state.value,"StringLiteral");case M._null:return t=this.startNode(),this.next(),this.finishNode(t,"NullLiteral");case M._true:case M._false:return t=this.startNode(),t.value=this.match(M._true),this.next(),this.finishNode(t,"BooleanLiteral");case M.parenL:return this.parseParenAndDistinguishExpression(null,null,n);case M.bracketL:return t=this.startNode(),this.next(),t.elements=this.parseExprList(M.bracketR,!0,e),this.toReferencedList(t.elements),this.finishNode(t,"ArrayExpression");case M.braceL:return this.parseObj(!1,e);case M._function:return this.parseFunctionExpression();case M.at:this.parseDecorators();case M._class:return t=this.startNode(),this.takeDecorators(t),this.parseClass(t,!1);case M._new:return this.parseNew();case M.backQuote:return this.parseTemplate();case M.doubleColon:t=this.startNode(),this.next(),t.object=null;var p=t.callee=this.parseNoCallExpr();if("MemberExpression"===p.type)return this.finishNode(t,"BindExpression");this.raise(p.start,"Binding should be performed on object property.");default:this.unexpected()}},ae.parseFunctionExpression=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.state.inGenerator&&this.eat(M.dot)&&this.hasPlugin("functionSent")?this.parseMetaProperty(e,t,"sent"):this.parseFunction(e,!1)},ae.parseMetaProperty=function(e,t,n){return e.meta=t,e.property=this.parseIdentifier(!0),e.property.name!==n&&this.raise(e.property.start,"The only valid meta property for new is "+t.name+"."+n),this.finishNode(e,"MetaProperty")},ae.parseLiteral=function(e,t){var n=this.startNode();return this.addExtra(n,"rawValue",e),this.addExtra(n,"raw",this.input.slice(this.state.start,this.state.end)),n.value=e,this.next(),this.finishNode(n,t)},ae.parseParenExpression=function(){this.expect(M.parenL);var e=this.parseExpression();return this.expect(M.parenR),e},ae.parseParenAndDistinguishExpression=function(e,t,n){e=e||this.state.start,t=t||this.state.startLoc;var r=void 0;this.expect(M.parenL);for(var i=this.state.start,a=this.state.startLoc,s=[],o=!0,u={start:0},l=void 0,c=void 0,p={start:0};!this.match(M.parenR);){if(o)o=!1;else if(this.expect(M.comma,p.start||null),this.match(M.parenR)){c=this.state.start;break}if(this.match(M.ellipsis)){var f=this.state.start,h=this.state.startLoc;l=this.state.start,s.push(this.parseParenItem(this.parseRest(),h,f));break}s.push(this.parseMaybeAssign(!1,u,this.parseParenItem,p))}var d=this.state.start,y=this.state.startLoc;this.expect(M.parenR);var m=this.startNodeAt(e,t);if(n&&this.shouldParseArrow()&&(m=this.parseArrow(m))){for(var b=s,g=Array.isArray(b),v=0,b=g?b:b[Symbol.iterator]();;){var x;if(g){if(v>=b.length)break;x=b[v++]}else{if(v=b.next(),v.done)break;x=v.value}var _=x;_.extra&&_.extra.parenthesized&&this.unexpected(_.extra.parenStart)}return this.parseArrowExpression(m,s)}return s.length||this.unexpected(this.state.lastTokStart),c&&this.unexpected(c),l&&this.unexpected(l),u.start&&this.unexpected(u.start),p.start&&this.unexpected(p.start),s.length>1?(r=this.startNodeAt(i,a),r.expressions=s,this.toReferencedList(r.expressions),this.finishNodeAt(r,"SequenceExpression",d,y)):r=s[0],this.addExtra(r,"parenthesized",!0),this.addExtra(r,"parenStart",e),r},ae.shouldParseArrow=function(){return!this.canInsertSemicolon()},ae.parseArrow=function(e){if(this.eat(M.arrow))return e},ae.parseParenItem=function(e){return e},ae.parseNew=function(){var e=this.startNode(),t=this.parseIdentifier(!0);return this.eat(M.dot)?this.parseMetaProperty(e,t,"target"):(e.callee=this.parseNoCallExpr(),this.eat(M.parenL)?(e.arguments=this.parseExprList(M.parenR),this.toReferencedList(e.arguments)):e.arguments=[],this.finishNode(e,"NewExpression"))},ae.parseTemplateElement=function(){var e=this.startNode();return e.value={raw:this.input.slice(this.state.start,this.state.end).replace(/\r\n?/g,"\n"),cooked:this.state.value},this.next(),e.tail=this.match(M.backQuote),this.finishNode(e,"TemplateElement")},ae.parseTemplate=function(){var e=this.startNode();this.next(),e.expressions=[];var t=this.parseTemplateElement();for(e.quasis=[t];!t.tail;)this.expect(M.dollarBraceL),e.expressions.push(this.parseExpression()),this.expect(M.braceR),e.quasis.push(t=this.parseTemplateElement());return this.next(),this.finishNode(e,"TemplateLiteral")},ae.parseObj=function(e,t){var n=[],r=Object.create(null),i=!0,a=this.startNode();a.properties=[],this.next();for(var s=null;!this.eat(M.braceR);){if(i)i=!1;else if(this.expect(M.comma),this.eat(M.braceR))break;for(;this.match(M.at);)n.push(this.parseDecorator());var o=this.startNode(),u=!1,l=!1,c=void 0,p=void 0;if(n.length&&(o.decorators=n,n=[]),this.hasPlugin("objectRestSpread")&&this.match(M.ellipsis)){if(o=this.parseSpread(),o.type=e?"RestProperty":"SpreadProperty",a.properties.push(o),!e)continue;var f=this.state.start;if(null===s){if(this.eat(M.braceR))break;if(this.match(M.comma)&&this.lookahead().type===M.braceR)continue;s=f;continue}this.unexpected(s,"Cannot have multiple rest elements when destructuring")}if(o.method=!1,o.shorthand=!1,(e||t)&&(c=this.state.start,p=this.state.startLoc),e||(u=this.eat(M.star)),!e&&this.isContextual("async")){u&&this.unexpected();var h=this.parseIdentifier();this.match(M.colon)||this.match(M.parenL)||this.match(M.braceR)||this.match(M.eq)||this.match(M.comma)?o.key=h:(l=!0,this.hasPlugin("asyncGenerators")&&(u=this.eat(M.star)),this.parsePropertyName(o))}else this.parsePropertyName(o);this.parseObjPropValue(o,c,p,u,l,e,t),this.checkPropClash(o,r),o.shorthand&&this.addExtra(o,"shorthand",!0),a.properties.push(o)}return null!==s&&this.unexpected(s,"The rest element has to be the last element when destructuring"),n.length&&this.raise(this.state.start,"You have trailing decorators with no property"),this.finishNode(a,e?"ObjectPattern":"ObjectExpression")},ae.parseObjPropValue=function(e,t,n,r,i,a,s){if(i||r||this.match(M.parenL))return a&&this.unexpected(),e.kind="method",e.method=!0,this.parseMethod(e,r,i),this.finishNode(e,"ObjectMethod");if(this.eat(M.colon))return e.value=a?this.parseMaybeDefault(this.state.start,this.state.startLoc):this.parseMaybeAssign(!1,s),this.finishNode(e,"ObjectProperty");if(!(a||e.computed||"Identifier"!==e.key.type||"get"!==e.key.name&&"set"!==e.key.name||this.match(M.comma)||this.match(M.braceR))){(r||i)&&this.unexpected(),e.kind=e.key.name,this.parsePropertyName(e),this.parseMethod(e,!1);var o="get"===e.kind?0:1;if(e.params.length!==o){var u=e.start;"get"===e.kind?this.raise(u,"getter should have no params"):this.raise(u,"setter should have exactly one param")}return this.finishNode(e,"ObjectMethod")}if(!e.computed&&"Identifier"===e.key.type)return a?(this.checkReservedWord(e.key.name,e.key.start,!0,!0),e.value=this.parseMaybeDefault(t,n,e.key.__clone())):this.match(M.eq)&&s?(s.start||(s.start=this.state.start),e.value=this.parseMaybeDefault(t,n,e.key.__clone())):e.value=e.key.__clone(),e.shorthand=!0,this.finishNode(e,"ObjectProperty");this.unexpected()},ae.parsePropertyName=function(e){return this.eat(M.bracketL)?(e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(M.bracketR),e.key):(e.computed=!1,e.key=this.match(M.num)||this.match(M.string)?this.parseExprAtom():this.parseIdentifier(!0))},ae.initFunction=function(e,t){e.id=null,e.generator=!1,e.expression=!1,e.async=!!t},ae.parseMethod=function(e,t,n){var r=this.state.inMethod;return this.state.inMethod=e.kind||!0,this.initFunction(e,n),this.expect(M.parenL),e.params=this.parseBindingList(M.parenR),e.generator=t,this.parseFunctionBody(e),this.state.inMethod=r,e},ae.parseArrowExpression=function(e,t,n){return this.initFunction(e,n),e.params=this.toAssignableList(t,!0,"arrow function parameters"),this.parseFunctionBody(e,!0),this.finishNode(e,"ArrowFunctionExpression")},ae.parseFunctionBody=function(e,t){var n=t&&!this.match(M.braceL),r=this.state.inAsync;if(this.state.inAsync=e.async,n)e.body=this.parseMaybeAssign(),e.expression=!0;else{var i=this.state.inFunction,a=this.state.inGenerator,s=this.state.labels;this.state.inFunction=!0,this.state.inGenerator=e.generator,this.state.labels=[],e.body=this.parseBlock(!0),e.expression=!1,this.state.inFunction=i,this.state.inGenerator=a,this.state.labels=s}this.state.inAsync=r;var o=this.state.strict,u=!1;if(t&&(o=!0),!n&&e.body.directives.length)for(var l=e.body.directives,c=Array.isArray(l),p=0,l=c?l:l[Symbol.iterator]();;){var f;if(c){if(p>=l.length)break;f=l[p++]}else{if(p=l.next(),p.done)break;f=p.value}var h=f;if("use strict"===h.value.value){u=!0,o=!0;break}}if(u&&e.id&&"Identifier"===e.id.type&&"yield"===e.id.name&&this.raise(e.id.start,"Binding yield in strict mode"),o){var d=Object.create(null),y=this.state.strict;u&&(this.state.strict=!0),e.id&&this.checkLVal(e.id,!0,void 0,"function name");for(var m=e.params,b=Array.isArray(m),g=0,m=b?m:m[Symbol.iterator]();;){var v;if(b){if(g>=m.length)break;v=m[g++]}else{if(g=m.next(),g.done)break;v=g.value}var x=v;u&&"Identifier"!==x.type&&this.raise(x.start,"Non-simple parameter in strict mode"),this.checkLVal(x,!0,d,"function parameter list")}this.state.strict=y}},ae.parseExprList=function(e,t,n){for(var r=[],i=!0;!this.eat(e);){if(i)i=!1;else if(this.expect(M.comma),this.eat(e))break;r.push(this.parseExprListItem(t,n))}return r},ae.parseExprListItem=function(e,t){return e&&this.match(M.comma)?null:this.match(M.ellipsis)?this.parseSpread(t):this.parseMaybeAssign(!1,t,this.parseParenItem)},ae.parseIdentifier=function(e){var t=this.startNode();return this.match(M.name)?(e||this.checkReservedWord(this.state.value,this.state.start,!1,!1),t.name=this.state.value):e&&this.state.type.keyword?t.name=this.state.type.keyword:this.unexpected(),!e&&"await"===t.name&&this.state.inAsync&&this.raise(t.start,"invalid use of await inside of an async function"),t.loc.identifierName=t.name,this.next(),this.finishNode(t,"Identifier")},ae.checkReservedWord=function(e,t,n,r){(this.isReservedWord(e)||n&&this.isKeyword(e))&&this.raise(t,e+" is a reserved word"),this.state.strict&&(S.strict(e)||r&&S.strictBind(e))&&this.raise(t,e+" is a reserved word in strict mode")},ae.parseAwait=function(e){return this.state.inAsync||this.unexpected(),this.match(M.star)&&this.raise(e.start,"await* has been removed from the async functions proposal. Use Promise.all() instead."),e.argument=this.parseMaybeUnary(),this.finishNode(e,"AwaitExpression")},ae.parseYield=function(){var e=this.startNode();return this.next(),this.match(M.semi)||this.canInsertSemicolon()||!this.match(M.star)&&!this.state.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(M.star),e.argument=this.parseMaybeAssign()),this.finishNode(e,"YieldExpression")};var se=$.prototype,oe=["leadingComments","trailingComments","innerComments"],ue=function(){function e(t,n,r){_(this,e),this.type="",this.start=t,this.end=0,this.loc=new J(n),r&&(this.loc.filename=r)}return e.prototype.__clone=function(){var t=new e;for(var n in this)oe.indexOf(n)<0&&(t[n]=this[n]);return t},e}();se.startNode=function(){return new ue(this.state.start,this.state.startLoc,this.filename)},se.startNodeAt=function(e,t){return new ue(e,t,this.filename)},se.finishNode=function(e,t){return E.call(this,e,t,this.state.lastTokEnd,this.state.lastTokEndLoc)},se.finishNodeAt=function(e,t,n,r){return E.call(this,e,t,n,r)},$.prototype.raise=function(e,t){var n=d(this.input,e);t+=" ("+n.line+":"+n.column+")";var r=new SyntaxError(t);throw r.pos=e,r.loc=n,r};var le=$.prototype;le.addComment=function(e){this.filename&&(e.loc.filename=this.filename),this.state.trailingComments.push(e),this.state.leadingComments.push(e)},le.processComment=function(e){if(!("Program"===e.type&&e.body.length>0)){var t=this.state.commentStack,n=void 0,r=void 0,i=void 0,a=void 0;if(this.state.trailingComments.length>0)this.state.trailingComments[0].start>=e.end?(r=this.state.trailingComments,this.state.trailingComments=[]):this.state.trailingComments.length=0;else{var s=A(t);t.length>0&&s.trailingComments&&s.trailingComments[0].start>=e.end&&(r=s.trailingComments,s.trailingComments=null)}for(;t.length>0&&A(t).start>=e.start;)n=t.pop();if(n){if(n.leadingComments)if(n!==e&&A(n.leadingComments).end<=e.start)e.leadingComments=n.leadingComments,n.leadingComments=null;else for(i=n.leadingComments.length-2;i>=0;--i)if(n.leadingComments[i].end<=e.start){e.leadingComments=n.leadingComments.splice(0,i+1);break}}else if(this.state.leadingComments.length>0)if(A(this.state.leadingComments).end<=e.start){if(this.state.commentPreviousNode)for(a=0;a0&&(e.leadingComments=this.state.leadingComments,this.state.leadingComments=[])}else{for(i=0;ie.start);i++);e.leadingComments=this.state.leadingComments.slice(0,i),0===e.leadingComments.length&&(e.leadingComments=null),r=this.state.leadingComments.slice(i),0===r.length&&(r=null)}this.state.commentPreviousNode=e,r&&(r.length&&r[0].start>=e.start&&A(r).end<=e.end?e.innerComments=r:e.trailingComments=r),t.push(e)}};var ce=$.prototype;ce.flowParseTypeInitialiser=function(e,t){var n=this.state.inType;this.state.inType=!0,this.expect(e||M.colon),t&&(this.match(M.bitwiseAND)||this.match(M.bitwiseOR))&&this.next();var r=this.flowParseType();return this.state.inType=n,r},ce.flowParseDeclareClass=function(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")},ce.flowParseDeclareFunction=function(e){this.next();var t=e.id=this.parseIdentifier(),n=this.startNode(),r=this.startNode();this.isRelational("<")?n.typeParameters=this.flowParseTypeParameterDeclaration():n.typeParameters=null,this.expect(M.parenL);var i=this.flowParseFunctionTypeParams();return n.params=i.params,n.rest=i.rest,this.expect(M.parenR),n.returnType=this.flowParseTypeInitialiser(),r.typeAnnotation=this.finishNode(n,"FunctionTypeAnnotation"),t.typeAnnotation=this.finishNode(r,"TypeAnnotation"),this.finishNode(t,t.type),this.semicolon(),this.finishNode(e,"DeclareFunction")},ce.flowParseDeclare=function(e){return this.match(M._class)?this.flowParseDeclareClass(e):this.match(M._function)?this.flowParseDeclareFunction(e):this.match(M._var)?this.flowParseDeclareVariable(e):this.isContextual("module")?this.lookahead().type===M.dot?this.flowParseDeclareModuleExports(e):this.flowParseDeclareModule(e):this.isContextual("type")?this.flowParseDeclareTypeAlias(e):this.isContextual("interface")?this.flowParseDeclareInterface(e):void this.unexpected()},ce.flowParseDeclareVariable=function(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.semicolon(),this.finishNode(e,"DeclareVariable")},ce.flowParseDeclareModule=function(e){this.next(),this.match(M.string)?e.id=this.parseExprAtom():e.id=this.parseIdentifier();var t=e.body=this.startNode(),n=t.body=[];for(this.expect(M.braceL);!this.match(M.braceR);){var r=this.startNode();this.expectContextual("declare","Unexpected token. Only declares are allowed inside declare module"),n.push(this.flowParseDeclare(r))}return this.expect(M.braceR),this.finishNode(t,"BlockStatement"),this.finishNode(e,"DeclareModule")},ce.flowParseDeclareModuleExports=function(e){return this.expectContextual("module"),this.expect(M.dot),this.expectContextual("exports"),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")},ce.flowParseDeclareTypeAlias=function(e){return this.next(),this.flowParseTypeAlias(e),this.finishNode(e,"DeclareTypeAlias")},ce.flowParseDeclareInterface=function(e){return this.next(),this.flowParseInterfaceish(e),this.finishNode(e,"DeclareInterface")},ce.flowParseInterfaceish=function(e,t){if(e.id=this.parseIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],e.mixins=[],this.eat(M._extends))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(M.comma));if(this.isContextual("mixins")){this.next();do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(M.comma))}e.body=this.flowParseObjectType(t)},ce.flowParseInterfaceExtends=function(){var e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")},ce.flowParseInterface=function(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")},ce.flowParseTypeAlias=function(e){return e.id=this.parseIdentifier(),this.isRelational("<")?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(M.eq,!0),this.semicolon(),this.finishNode(e,"TypeAlias")},ce.flowParseTypeParameter=function(){var e=this.startNode(),t=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return e.name=n.name,e.variance=t,e.bound=n.typeAnnotation,this.match(M.eq)&&(this.eat(M.eq),e.default=this.flowParseType()),this.finishNode(e,"TypeParameter")},ce.flowParseTypeParameterDeclaration=function(){var e=this.state.inType,t=this.startNode();t.params=[],this.state.inType=!0,this.isRelational("<")||this.match(M.jsxTagStart)?this.next():this.unexpected();do t.params.push(this.flowParseTypeParameter()),this.isRelational(">")||this.expect(M.comma);while(!this.isRelational(">"));return this.expectRelational(">"),this.state.inType=e,this.finishNode(t,"TypeParameterDeclaration")},ce.flowParseTypeParameterInstantiation=function(){var e=this.startNode(),t=this.state.inType;for(e.params=[],this.state.inType=!0,this.expectRelational("<");!this.isRelational(">");)e.params.push(this.flowParseType()),this.isRelational(">")||this.expect(M.comma);return this.expectRelational(">"),this.state.inType=t,this.finishNode(e,"TypeParameterInstantiation")},ce.flowParseObjectPropertyKey=function(){return this.match(M.num)||this.match(M.string)?this.parseExprAtom():this.parseIdentifier(!0)},ce.flowParseObjectTypeIndexer=function(e,t,n){return e.static=t,this.expect(M.bracketL),this.lookahead().type===M.colon?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(M.bracketR),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeIndexer")},ce.flowParseObjectTypeMethodish=function(e){for(e.params=[],e.rest=null,e.typeParameters=null,this.isRelational("<")&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(M.parenL);this.match(M.name);)e.params.push(this.flowParseFunctionTypeParam()),this.match(M.parenR)||this.expect(M.comma);return this.eat(M.ellipsis)&&(e.rest=this.flowParseFunctionTypeParam()),this.expect(M.parenR),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")},ce.flowParseObjectTypeMethod=function(e,t,n,r){var i=this.startNodeAt(e,t);return i.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e,t)),i.static=n,i.key=r,i.optional=!1,this.flowObjectTypeSemicolon(),this.finishNode(i,"ObjectTypeProperty")},ce.flowParseObjectTypeCallProperty=function(e,t){var n=this.startNode();return e.static=t,e.value=this.flowParseObjectTypeMethodish(n),this.flowObjectTypeSemicolon(),this.finishNode(e,"ObjectTypeCallProperty")},ce.flowParseObjectType=function(e,t){var n=this.state.inType;this.state.inType=!0;var r=this.startNode(),i=void 0,a=void 0,s=!1;r.callProperties=[],r.properties=[],r.indexers=[];var o=void 0,u=void 0;for(t&&this.match(M.braceBarL)?(this.expect(M.braceBarL),o=M.braceBarR,u=!0):(this.expect(M.braceL),o=M.braceR,u=!1),r.exact=u;!this.match(o);){var l=!1,c=this.state.start,p=this.state.startLoc;i=this.startNode(),e&&this.isContextual("static")&&this.lookahead().type!==M.colon&&(this.next(),s=!0);var f=this.state.start,h=this.flowParseVariance();this.match(M.bracketL)?r.indexers.push(this.flowParseObjectTypeIndexer(i,s,h)):this.match(M.parenL)||this.isRelational("<")?(h&&this.unexpected(f),r.callProperties.push(this.flowParseObjectTypeCallProperty(i,e))):(a=this.flowParseObjectPropertyKey(),this.isRelational("<")||this.match(M.parenL)?(h&&this.unexpected(f),r.properties.push(this.flowParseObjectTypeMethod(c,p,s,a))):(this.eat(M.question)&&(l=!0),i.key=a,i.value=this.flowParseTypeInitialiser(),i.optional=l,i.static=s,i.variance=h,this.flowObjectTypeSemicolon(),r.properties.push(this.finishNode(i,"ObjectTypeProperty")))),s=!1}this.expect(o);var d=this.finishNode(r,"ObjectTypeAnnotation");return this.state.inType=n,d},ce.flowObjectTypeSemicolon=function(){this.eat(M.semi)||this.eat(M.comma)||this.match(M.braceR)||this.match(M.braceBarR)||this.unexpected()},ce.flowParseQualifiedTypeIdentifier=function(e,t,n){e=e||this.state.start,t=t||this.state.startLoc;for(var r=n||this.parseIdentifier();this.eat(M.dot);){var i=this.startNodeAt(e,t);i.qualification=r,i.id=this.parseIdentifier(),r=this.finishNode(i,"QualifiedTypeIdentifier")}return r},ce.flowParseGenericType=function(e,t,n){var r=this.startNodeAt(e,t);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,t,n),this.isRelational("<")&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")},ce.flowParseTypeofType=function(){var e=this.startNode();return this.expect(M._typeof),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")},ce.flowParseTupleType=function(){var e=this.startNode();for(e.types=[],this.expect(M.bracketL);this.state.pos0&&void 0!==arguments[0]?arguments[0]:[],t={params:e,rest:null};this.match(M.name);)t.params.push(this.flowParseFunctionTypeParam()),this.match(M.parenR)||this.expect(M.comma);return this.eat(M.ellipsis)&&(t.rest=this.flowParseFunctionTypeParam()),t},ce.flowIdentToTypeAnnotation=function(e,t,n,r){switch(r.name){case"any":return this.finishNode(n,"AnyTypeAnnotation");case"void":return this.finishNode(n,"VoidTypeAnnotation");case"bool":case"boolean":return this.finishNode(n,"BooleanTypeAnnotation");case"mixed":return this.finishNode(n,"MixedTypeAnnotation");case"empty":return this.finishNode(n,"EmptyTypeAnnotation");case"number":return this.finishNode(n,"NumberTypeAnnotation");case"string":return this.finishNode(n,"StringTypeAnnotation");default:return this.flowParseGenericType(e,t,r)}},ce.flowParsePrimaryType=function(){var e=this.state.start,t=this.state.startLoc,n=this.startNode(),r=void 0,i=void 0,a=!1,s=this.state.noAnonFunctionType;switch(this.state.type){case M.name:return this.flowIdentToTypeAnnotation(e,t,n,this.parseIdentifier());case M.braceL:return this.flowParseObjectType(!1,!1);case M.braceBarL:return this.flowParseObjectType(!1,!0);case M.bracketL:return this.flowParseTupleType();case M.relational:if("<"===this.state.value)return n.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(M.parenL),r=this.flowParseFunctionTypeParams(),n.params=r.params,n.rest=r.rest,this.expect(M.parenR),this.expect(M.arrow), +n.returnType=this.flowParseType(),this.finishNode(n,"FunctionTypeAnnotation");break;case M.parenL:if(this.next(),!this.match(M.parenR)&&!this.match(M.ellipsis))if(this.match(M.name)){var o=this.lookahead().type;a=o!==M.question&&o!==M.colon}else a=!0;if(a){if(this.state.noAnonFunctionType=!1,i=this.flowParseType(),this.state.noAnonFunctionType=s,this.state.noAnonFunctionType||!(this.match(M.comma)||this.match(M.parenR)&&this.lookahead().type===M.arrow))return this.expect(M.parenR),i;this.eat(M.comma)}return r=i?this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(i)]):this.flowParseFunctionTypeParams(),n.params=r.params,n.rest=r.rest,this.expect(M.parenR),this.expect(M.arrow),n.returnType=this.flowParseType(),n.typeParameters=null,this.finishNode(n,"FunctionTypeAnnotation");case M.string:return n.value=this.state.value,this.addExtra(n,"rawValue",n.value),this.addExtra(n,"raw",this.input.slice(this.state.start,this.state.end)),this.next(),this.finishNode(n,"StringLiteralTypeAnnotation");case M._true:case M._false:return n.value=this.match(M._true),this.next(),this.finishNode(n,"BooleanLiteralTypeAnnotation");case M.plusMin:if("-"===this.state.value)return this.next(),this.match(M.num)||this.unexpected(),n.value=-this.state.value,this.addExtra(n,"rawValue",n.value),this.addExtra(n,"raw",this.input.slice(this.state.start,this.state.end)),this.next(),this.finishNode(n,"NumericLiteralTypeAnnotation");case M.num:return n.value=this.state.value,this.addExtra(n,"rawValue",n.value),this.addExtra(n,"raw",this.input.slice(this.state.start,this.state.end)),this.next(),this.finishNode(n,"NumericLiteralTypeAnnotation");case M._null:return n.value=this.match(M._null),this.next(),this.finishNode(n,"NullLiteralTypeAnnotation");case M._this:return n.value=this.match(M._this),this.next(),this.finishNode(n,"ThisTypeAnnotation");case M.star:return this.next(),this.finishNode(n,"ExistentialTypeParam");default:if("typeof"===this.state.type.keyword)return this.flowParseTypeofType()}this.unexpected()},ce.flowParsePostfixType=function(){for(var e=this.state.start,t=this.state.startLoc,n=this.flowParsePrimaryType();!this.canInsertSemicolon()&&this.match(M.bracketL);){var r=this.startNodeAt(e,t);r.elementType=n,this.expect(M.bracketL),this.expect(M.bracketR),n=this.finishNode(r,"ArrayTypeAnnotation")}return n},ce.flowParsePrefixType=function(){var e=this.startNode();return this.eat(M.question)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()},ce.flowParseAnonFunctionWithoutParens=function(){var e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(M.arrow)){var t=this.startNodeAt(e.start,e.loc);return t.params=[this.reinterpretTypeAsFunctionTypeParam(e)],t.rest=null,t.returnType=this.flowParseType(),t.typeParameters=null,this.finishNode(t,"FunctionTypeAnnotation")}return e},ce.flowParseIntersectionType=function(){var e=this.startNode(),t=this.flowParseAnonFunctionWithoutParens();for(e.types=[t];this.eat(M.bitwiseAND);)e.types.push(this.flowParseAnonFunctionWithoutParens());return 1===e.types.length?t:this.finishNode(e,"IntersectionTypeAnnotation")},ce.flowParseUnionType=function(){var e=this.startNode(),t=this.flowParseIntersectionType();for(e.types=[t];this.eat(M.bitwiseOR);)e.types.push(this.flowParseIntersectionType());return 1===e.types.length?t:this.finishNode(e,"UnionTypeAnnotation")},ce.flowParseType=function(){var e=this.state.inType;this.state.inType=!0;var t=this.flowParseUnionType();return this.state.inType=e,t},ce.flowParseTypeAnnotation=function(){var e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")},ce.flowParseTypeAnnotatableIdentifier=function(){var e=this.parseIdentifier();return this.match(M.colon)&&(e.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(e,e.type)),e},ce.typeCastToParameter=function(e){return e.expression.typeAnnotation=e.typeAnnotation,this.finishNodeAt(e.expression,e.expression.type,e.typeAnnotation.end,e.typeAnnotation.loc.end)},ce.flowParseVariance=function(){var e=null;return this.match(M.plusMin)&&("+"===this.state.value?e="plus":"-"===this.state.value&&(e="minus"),this.next()),e};var pe=function(e){e.extend("parseFunctionBody",function(e){return function(t,n){return this.match(M.colon)&&!n&&(t.returnType=this.flowParseTypeAnnotation()),e.call(this,t,n)}}),e.extend("parseStatement",function(e){return function(t,n){if(this.state.strict&&this.match(M.name)&&"interface"===this.state.value){var r=this.startNode();return this.next(),this.flowParseInterface(r)}return e.call(this,t,n)}}),e.extend("parseExpressionStatement",function(e){return function(t,n){if("Identifier"===n.type)if("declare"===n.name){if(this.match(M._class)||this.match(M.name)||this.match(M._function)||this.match(M._var))return this.flowParseDeclare(t)}else if(this.match(M.name)){if("interface"===n.name)return this.flowParseInterface(t);if("type"===n.name)return this.flowParseTypeAlias(t)}return e.call(this,t,n)}}),e.extend("shouldParseExportDeclaration",function(e){return function(){return this.isContextual("type")||this.isContextual("interface")||e.call(this)}}),e.extend("parseConditional",function(e){return function(t,n,r,i,a){if(a&&this.match(M.question)){var s=this.state.clone();try{return e.call(this,t,n,r,i)}catch(e){if(e instanceof SyntaxError)return this.state=s,a.start=e.pos||this.state.start,t;throw e}}return e.call(this,t,n,r,i)}}),e.extend("parseParenItem",function(e){return function(t,n,r){if(t=e.call(this,t,n,r),this.eat(M.question)&&(t.optional=!0),this.match(M.colon)){var i=this.startNodeAt(n,r);return i.expression=t,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return t}}),e.extend("parseExport",function(e){return function(t){return t=e.call(this,t),"ExportNamedDeclaration"===t.type&&(t.exportKind=t.exportKind||"value"),t}}),e.extend("parseExportDeclaration",function(e){return function(t){if(this.isContextual("type")){t.exportKind="type";var n=this.startNode();return this.next(),this.match(M.braceL)?(t.specifiers=this.parseExportSpecifiers(),this.parseExportFrom(t),null):this.flowParseTypeAlias(n)}if(this.isContextual("interface")){t.exportKind="type";var r=this.startNode();return this.next(),this.flowParseInterface(r)}return e.call(this,t)}}),e.extend("parseClassId",function(e){return function(t){e.apply(this,arguments),this.isRelational("<")&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}}),e.extend("isKeyword",function(e){return function(t){return(!this.state.inType||"void"!==t)&&e.call(this,t)}}),e.extend("parsePropertyName",function(e){return function(t){var n=this.state.inType;this.state.inType=!0;var r=e.call(this,t);return this.state.inType=n,r}}),e.extend("readToken",function(e){return function(t){return!this.state.inType||62!==t&&60!==t?e.call(this,t):this.finishOp(M.relational,1)}}),e.extend("jsx_readToken",function(e){return function(){if(!this.state.inType)return e.call(this)}}),e.extend("toAssignable",function(e){return function(t,n,r){return"TypeCastExpression"===t.type?e.call(this,this.typeCastToParameter(t),n,r):e.call(this,t,n,r)}}),e.extend("toAssignableList",function(e){return function(t,n,r){for(var i=0;i",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"},he=/^[\da-fA-F]+$/,de=/^\d+$/;K.j_oTag=new q("...",!0,!0),M.jsxName=new I("jsxName"),M.jsxText=new I("jsxText",{beforeExpr:!0}),M.jsxTagStart=new I("jsxTagStart",{startsExpr:!0}),M.jsxTagEnd=new I("jsxTagEnd"),M.jsxTagStart.updateContext=function(){this.state.context.push(K.j_expr),this.state.context.push(K.j_oTag),this.state.exprAllowed=!1},M.jsxTagEnd.updateContext=function(e){var t=this.state.context.pop();t===K.j_oTag&&e===M.slash||t===K.j_cTag?(this.state.context.pop(),this.state.exprAllowed=this.curContext()===K.j_expr):this.state.exprAllowed=!0};var ye=$.prototype;ye.jsxReadToken=function(){for(var e="",t=this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated JSX contents");var n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:return this.state.pos===this.state.start?60===n&&this.state.exprAllowed?(++this.state.pos,this.finishToken(M.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.state.pos),this.finishToken(M.jsxText,e));case 38:e+=this.input.slice(t,this.state.pos),e+=this.jsxReadEntity(),t=this.state.pos;break;default:p(n)?(e+=this.input.slice(t,this.state.pos),e+=this.jsxReadNewLine(!0),t=this.state.pos):++this.state.pos}}},ye.jsxReadNewLine=function(e){var t=this.input.charCodeAt(this.state.pos),n=void 0;return++this.state.pos,13===t&&10===this.input.charCodeAt(this.state.pos)?(++this.state.pos,n=e?"\n":"\r\n"):n=String.fromCharCode(t),++this.state.curLine,this.state.lineStart=this.state.pos,n},ye.jsxReadString=function(e){for(var t="",n=++this.state.pos;;){this.state.pos>=this.input.length&&this.raise(this.state.start,"Unterminated string constant");var r=this.input.charCodeAt(this.state.pos);if(r===e)break;38===r?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos):p(r)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}return t+=this.input.slice(n,this.state.pos++),this.finishToken(M.string,t)},ye.jsxReadEntity=function(){for(var e="",t=0,n=void 0,r=this.input[this.state.pos],i=++this.state.pos;this.state.pos")}return n.openingElement=i,n.closingElement=a,n.children=r,this.match(M.relational)&&"<"===this.state.value&&this.raise(this.state.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(n,"JSXElement")},ye.jsxParseElement=function(){var e=this.state.start,t=this.state.startLoc;return this.next(),this.jsxParseElementAt(e,t)};var me=function(e){e.extend("parseExprAtom",function(e){return function(t){if(this.match(M.jsxText)){var n=this.parseLiteral(this.state.value,"JSXText");return n.extra=null,n}return this.match(M.jsxTagStart)?this.jsxParseElement():e.call(this,t)}}),e.extend("readToken",function(e){return function(t){var n=this.curContext();if(n===K.j_expr)return this.jsxReadToken();if(n===K.j_oTag||n===K.j_cTag){if(a(t))return this.jsxReadWord();if(62===t)return++this.state.pos,this.finishToken(M.jsxTagEnd);if((34===t||39===t)&&n===K.j_oTag)return this.jsxReadString(t)}return 60===t&&this.state.exprAllowed?(++this.state.pos,this.finishToken(M.jsxTagStart)):e.call(this,t)}}),e.extend("updateContext",function(e){return function(t){if(this.match(M.braceL)){var n=this.curContext();n===K.j_oTag?this.state.context.push(K.braceExpression):n===K.j_expr?this.state.context.push(K.templateQuasi):e.call(this,t),this.state.exprAllowed=!0}else{if(!this.match(M.slash)||t!==M.jsxTagStart)return e.call(this,t);this.state.context.length-=2,this.state.context.push(K.j_cTag),this.state.exprAllowed=!1}}})};H.flow=pe,H.jsx=me,n.parse=C,n.tokTypes=M},{}],275:[function(e,t,n){(function(t){"use strict";function r(e){return new t(e,"base64").toString()}function i(e){return e.split(",").pop()}function a(e,t){var n=p.exec(e);p.lastIndex=0;var r=n[1]||n[2],i=l.resolve(t,r);try{return u.readFileSync(i,"utf8")}catch(e){throw new Error("An error occurred while trying to read the map file at "+i+"\n"+e)}}function s(e,t){t=t||{},t.isFileComment&&(e=a(e,t.commentFileDir)),t.hasComment&&(e=i(e)),t.isEncoded&&(e=r(e)),(t.isJSON||t.isEncoded)&&(e=JSON.parse(e)),this.sourcemap=e}function o(e){for(var t,r=e.split("\n"),i=r.length-1;i>0;i--)if(t=r[i],~t.indexOf("sourceMappingURL=data:"))return n.fromComment(t)}var u=e("fs"),l=e("path"),c=/^\s*\/(?:\/|\*)[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+;)?base64,(.*)$/gm,p=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/){1}[ \t]*$)/gm;s.prototype.toJSON=function(e){return JSON.stringify(this.sourcemap,null,e)},s.prototype.toBase64=function(){return new t(this.toJSON()).toString("base64")},s.prototype.toComment=function(e){var t=this.toBase64(),n="sourceMappingURL=data:application/json;base64,"+t;return e&&e.multiline?"/*# "+n+" */":"//# "+n},s.prototype.toObject=function(){return JSON.parse(this.toJSON())},s.prototype.addProperty=function(e,t){if(this.sourcemap.hasOwnProperty(e))throw new Error("property %s already exists on the sourcemap, use set property instead");return this.setProperty(e,t)},s.prototype.setProperty=function(e,t){return this.sourcemap[e]=t,this},s.prototype.getProperty=function(e){return this.sourcemap[e]},n.fromObject=function(e){return new s(e)},n.fromJSON=function(e){return new s(e,{isJSON:!0})},n.fromBase64=function(e){return new s(e,{isEncoded:!0})},n.fromComment=function(e){return e=e.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),new s(e,{isEncoded:!0,hasComment:!0})},n.fromMapFileComment=function(e,t){return new s(e,{commentFileDir:t,isFileComment:!0,isJSON:!0})},n.fromSource=function(e,t){if(t){var r=o(e);return r?r:null}var i=e.match(c);return c.lastIndex=0,i?n.fromComment(i.pop()):null},n.fromMapFileSource=function(e,t){var r=e.match(p);return p.lastIndex=0,r?n.fromMapFileComment(r.pop(),t):null},n.removeComments=function(e){return c.lastIndex=0,e.replace(c,"")},n.removeMapFileComments=function(e){return p.lastIndex=0,e.replace(p,"")},n.generateMapFileComment=function(e,t){var n="sourceMappingURL="+e;return t&&t.multiline?"/*# "+n+" */":"//# "+n},Object.defineProperty(n,"commentRegex",{get:function(){return c.lastIndex=0,c}}),Object.defineProperty(n,"mapFileCommentRegex",{get:function(){return p.lastIndex=0,p}})}).call(this,e("buffer").Buffer)},{buffer:4,fs:1,path:12}],276:[function(e,t,n){t.exports=e("./src/node")},{"./src/node":280}],277:[function(e,t,n){function r(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*p;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*l;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function i(e){return e>=c?Math.round(e/c)+"d":e>=l?Math.round(e/l)+"h":e>=u?Math.round(e/u)+"m":e>=o?Math.round(e/o)+"s":e+"ms"}function a(e){return s(e,c,"day")||s(e,l,"hour")||s(e,u,"minute")||s(e,o,"second")||e+" ms"}function s(e,t,n){if(!(e0)return r(e);if("number"===n&&isNaN(e)===!1)return t.long?a(e):i(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],278:[function(e,t,n){(function(r){function i(){return"undefined"!=typeof window&&void 0!==window.process&&"renderer"===window.process.type||("undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||"undefined"!=typeof window&&window.console&&(console.firebug||console.exception&&console.table)||navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function a(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var i=0,a=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))}),e.splice(a,0,r)}}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(e){}}function u(){try{return n.storage.debug}catch(e){}if(void 0!==r&&"env"in r)return r.env.DEBUG}function l(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=s,n.formatArgs=a,n.save=o,n.load=u,n.useColors=i,n.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:l(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},n.enable(u()),"undefined"!=typeof window&&(window.debug=n)}).call(this,e("_process"))},{"./debug":279,_process:13}],279:[function(e,t,n){function r(e){var t,r=0;for(t in e)r=(r<<5)-r+e.charCodeAt(t),r|=0;return n.colors[Math.abs(r)%n.colors.length]}function i(e){function t(){if(t.enabled){var e=t,r=+new Date,i=r-(l||r);e.diff=i,e.prev=l,e.curr=r,l=r;for(var a=new Array(arguments.length),s=0;s"z")&&(r<"A"||r>"Z")&&l("Bad identifier as unquoted key");c()&&("_"===r||"$"===r||r>="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9");)e+=r;return e},h=function(){var e,t="",n="",i=10;if("-"!==r&&"+"!==r||(t=r,c(r)),"I"===r)return e=v(),("number"!=typeof e||isNaN(e))&&l("Unexpected word for number"),"-"===t?-e:e;if("N"===r)return e=v(),isNaN(e)||l("expected word to be NaN"),e;switch("0"===r&&(n+=r,c(),"x"===r||"X"===r?(n+=r,c(),i=16):r>="0"&&r<="9"&&l("Octal literal")),i){case 10:for(;r>="0"&&r<="9";)n+=r,c();if("."===r)for(n+=".";c()&&r>="0"&&r<="9";)n+=r;if("e"===r||"E"===r)for(n+=r,c(),"-"!==r&&"+"!==r||(n+=r,c());r>="0"&&r<="9";)n+=r,c();break;case 16:for(;r>="0"&&r<="9"||r>="A"&&r<="F"||r>="a"&&r<="f";)n+=r,c()}if(e="-"===t?-n:+n,isFinite(e))return e;l("Bad number")},d=function(){var e,t,n,i,a="";if('"'===r||"'"===r)for(n=r;c();){if(r===n)return c(),a;if("\\"===r)if(c(),"u"===r){for(i=0,t=0;t<4&&(e=parseInt(c(),16),isFinite(e));t+=1)i=16*i+e;a+=String.fromCharCode(i)}else if("\r"===r)"\n"===p()&&c();else{if("string"!=typeof s[r])break;a+=s[r]}else{if("\n"===r)break;a+=r}}l("Bad string")},y=function(){"/"!==r&&l("Not an inline comment");do if(c(),"\n"===r||"\r"===r)return void c();while(r)},m=function(){"*"!==r&&l("Not a block comment");do for(c();"*"===r;)if(c("*"),"/"===r)return void c("/");while(r);l("Unterminated block comment")},b=function(){"/"!==r&&l("Not a comment"),c("/"),"/"===r?y():"*"===r?m():l("Unrecognized comment")},g=function(){for(;r;)if("/"===r)b();else{if(!(o.indexOf(r)>=0))return;c()}},v=function(){switch(r){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null;case"I":return c("I"),c("n"),c("f"),c("i"),c("n"),c("i"),c("t"),c("y"),1/0;case"N":return c("N"),c("a"),c("N"),NaN}l("Unexpected "+u(r))},x=function(){var e=[];if("["===r)for(c("["),g();r;){if("]"===r)return c("]"),e;if(","===r?l("Missing array element"):e.push(a()),g(),","!==r)return c("]"),e;c(","),g()}l("Bad array")},_=function(){var e,t={};if("{"===r)for(c("{"),g();r;){if("}"===r)return c("}"),t;if(e='"'===r||"'"===r?d():f(),g(),c(":"),t[e]=a(),g(),","!==r)return c("}"),t;c(","),g()}l("Bad object")};return a=function(){switch(g(),r){case"{":return _();case"[":return x();case'"':case"'":return d();case"-":case"+":case".":return h();default:return r>="0"&&r<="9"?h():v()}},function(s,o){var u;return i=String(s),e=0,t=1,n=1,r=" ",u=a(),g(),r&&l("Syntax error"),"function"==typeof o?function e(t,n){var r,i,a=t[n];if(a&&"object"==typeof a)for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(i=e(a,r),void 0!==i?a[r]=i:delete a[r]);return o.call(t,n,a)}({"":u},""):u}}(),r.stringify=function(e,t,n){function i(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"_"===e||"$"===e}function a(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e||"$"===e}function s(e){if("string"!=typeof e)return!1;if(!a(e[0]))return!1;for(var t=1,n=e.length;t10&&(e=e.substring(0,10));for(var r=n?"":"\n",i=0;i=0?i:void 0:i};r.isWord=s;var d,y=[];n&&("string"==typeof n?d=n:"number"==typeof n&&n>=0&&(d=c(" ",n,!0)));var m=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,b={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},g={"":e};return void 0===e?h(g,"",!0):f(g,"",!0)}},{}],282:[function(e,t,n){var r=e("./_getNative"),i=e("./_root"),a=r(i,"DataView");t.exports=a},{"./_getNative":391,"./_root":436}],283:[function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1}var i=e("./_baseIndexOf");t.exports=r},{"./_baseIndexOf":326}],300:[function(e,t,n){function r(e,t,n){for(var r=-1,i=null==e?0:e.length;++r=t?e:t)),e}t.exports=r},{}],314:[function(e,t,n){function r(e,t,n,P,j,B){var O,I=t&A,N=t&D,L=t&C;if(n&&(O=j?n(e,P,j,B):n(e)),void 0!==O)return O;if(!_(e))return e;var M=v(e);if(M){if(O=m(e),!I)return c(e,O)}else{var R=y(e),U=R==w||R==k;if(x(e))return l(e,I);if(R==F||R==S||U&&!j){if(O=N||U?{}:g(e),!I)return N?f(e,u(O,e)):p(e,o(O,e))}else{if(!T[R])return j?e:{};O=b(e,R,r,I)}}B||(B=new i);var V=B.get(e);if(V)return V;B.set(e,O);var G=L?N?d:h:N?keysIn:E,q=M?void 0:G(e);return a(q||e,function(i,a){q&&(a=i,i=e[a]),s(O,a,r(i,t,n,a,e,B))}),O}var i=e("./_Stack"),a=e("./_arrayEach"),s=e("./_assignValue"),o=e("./_baseAssign"),u=e("./_baseAssignIn"),l=e("./_cloneBuffer"),c=e("./_copyArray"),p=e("./_copySymbols"),f=e("./_copySymbolsIn"),h=e("./_getAllKeys"),d=e("./_getAllKeysIn"),y=e("./_getTag"),m=e("./_initCloneArray"),b=e("./_initCloneByTag"),g=e("./_initCloneObject"),v=e("./isArray"),x=e("./isBuffer"),_=e("./isObject"),E=e("./keys"),A=1,D=2,C=4,S="[object Arguments]",w="[object Function]",k="[object GeneratorFunction]",F="[object Object]",T={};T[S]=T["[object Array]"]=T["[object ArrayBuffer]"]=T["[object DataView]"]=T["[object Boolean]"]=T["[object Date]"]=T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Map]"]=T["[object Number]"]=T[F]=T["[object RegExp]"]=T["[object Set]"]=T["[object String]"]=T["[object Symbol]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T["[object Error]"]=T[w]=T["[object WeakMap]"]=!1,t.exports=r},{"./_Stack":290,"./_arrayEach":297,"./_assignValue":308,"./_baseAssign":310,"./_baseAssignIn":311,"./_cloneBuffer":362,"./_copyArray":371,"./_copySymbols":373,"./_copySymbolsIn":374,"./_getAllKeys":387,"./_getAllKeysIn":388,"./_getTag":396,"./_initCloneArray":405,"./_initCloneByTag":406,"./_initCloneObject":407,"./isArray":475,"./isBuffer":479,"./isObject":484,"./keys":491}],315:[function(e,t,n){var r=e("./isObject"),i=Object.create,a=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();t.exports=a},{"./isObject":484}],316:[function(e,t,n){var r=e("./_baseForOwn"),i=e("./_createBaseEach"),a=i(r);t.exports=a},{"./_baseForOwn":320,"./_createBaseEach":377}],317:[function(e,t,n){function r(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a0&&n(c)?t>1?r(c,t-1,n,s,o):i(o,c):s||(o[o.length]=c)}return o}var i=e("./_arrayPush"),a=e("./_isFlattenable");t.exports=r},{"./_arrayPush":303,"./_isFlattenable":408}],319:[function(e,t,n){var r=e("./_createBaseFor"),i=r();t.exports=i},{"./_createBaseFor":378}],320:[function(e,t,n){function r(e,t){return e&&i(e,t,a)}var i=e("./_baseFor"),a=e("./keys");t.exports=r},{"./_baseFor":319,"./keys":491}],321:[function(e,t,n){function r(e,t){t=i(t,e);for(var n=0,r=t.length;null!=e&&ni)return n;do t%2&&(n+=e),t=a(t/2),t&&(e+=e);while(t);return n}var i=9007199254740991,a=Math.floor;t.exports=r},{}],347:[function(e,t,n){function r(e,t){return s(a(e,t,i),e+"")}var i=e("./identity"),a=e("./_overRest"),s=e("./_setToString");t.exports=r},{"./_overRest":435,"./_setToString":440,"./identity":472}],348:[function(e,t,n){var r=e("./constant"),i=e("./_defineProperty"),a=e("./identity"),s=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;t.exports=s},{"./_defineProperty":382,"./constant":459,"./identity":472}],349:[function(e,t,n){function r(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=c){var m=t?null:u(e);if(m)return l(m);h=!1,p=o,y=new i}else y=t?[]:d;e:for(;++r=r?e:i(e,t,n)}var i=e("./_baseSlice");t.exports=r},{"./_baseSlice":349}],360:[function(e,t,n){function r(e,t){for(var n=e.length;n--&&i(t,e[n],0)>-1;);return n}var i=e("./_baseIndexOf");t.exports=r},{"./_baseIndexOf":326}],361:[function(e,t,n){function r(e){var t=new e.constructor(e.byteLength);return new i(t).set(new i(e)),t}var i=e("./_Uint8Array");t.exports=r},{"./_Uint8Array":292}],362:[function(e,t,n){function r(e,t){if(t)return e.slice();var n=e.length,r=l?l(n):new e.constructor(n);return e.copy(r),r}var i=e("./_root"),a="object"==typeof n&&n&&!n.nodeType&&n,s=a&&"object"==typeof t&&t&&!t.nodeType&&t,o=s&&s.exports===a,u=o?i.Buffer:void 0,l=u?u.allocUnsafe:void 0;t.exports=r},{"./_root":436}],363:[function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var i=e("./_cloneArrayBuffer");t.exports=r},{"./_cloneArrayBuffer":361}],364:[function(e,t,n){function r(e,t,n){return a(t?n(s(e),o):s(e),i,new e.constructor)}var i=e("./_addMapEntry"),a=e("./_arrayReduce"),s=e("./_mapToArray"),o=1;t.exports=r},{"./_addMapEntry":294,"./_arrayReduce":304,"./_mapToArray":426}],365:[function(e,t,n){function r(e){var t=new e.constructor(e.source,i.exec(e));return t.lastIndex=e.lastIndex,t}var i=/\w*$/;t.exports=r},{}],366:[function(e,t,n){function r(e,t,n){return a(t?n(s(e),o):s(e),i,new e.constructor)}var i=e("./_addSetEntry"),a=e("./_arrayReduce"),s=e("./_setToArray"),o=1;t.exports=r},{"./_addSetEntry":295,"./_arrayReduce":304,"./_setToArray":439}],367:[function(e,t,n){function r(e){return s?Object(s.call(e)):{}}var i=e("./_Symbol"),a=i?i.prototype:void 0,s=a?a.valueOf:void 0;t.exports=r},{"./_Symbol":291}],368:[function(e,t,n){function r(e,t){var n=t?i(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var i=e("./_cloneArrayBuffer");t.exports=r},{"./_cloneArrayBuffer":361}],369:[function(e,t,n){function r(e,t){if(e!==t){var n=void 0!==e,r=null===e,a=e===e,s=i(e),o=void 0!==t,u=null===t,l=t===t,c=i(t);if(!u&&!c&&!s&&e>t||s&&o&&l&&!u&&!c||r&&o&&l||!n&&l||!a)return 1;if(!r&&!s&&!c&&e=u)return l;return l*("desc"==n[r]?-1:1)}}return e.index-t.index}var i=e("./_compareAscending");t.exports=r},{"./_compareAscending":369}],371:[function(e,t,n){function r(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=e.length>3&&"function"==typeof s?(i--,s):void 0,o&&a(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),t=Object(t);++r-1?o[u?t[l]:l]:void 0}}var i=e("./_baseIteratee"),a=e("./isArrayLike"),s=e("./keys");t.exports=r},{"./_baseIteratee":335,"./isArrayLike":476,"./keys":491}],380:[function(e,t,n){var r=e("./_Set"),i=e("./noop"),a=e("./_setToArray"),s=1/0,o=r&&1/a(new r([,-0]))[1]==s?function(e){return new r(e)}:i;t.exports=o},{"./_Set":288,"./_setToArray":439,"./noop":496}],381:[function(e,t,n){function r(e,t,n,r){return void 0===e||i(e,a[n])&&!s.call(r,n)?t:e}var i=e("./eq"),a=Object.prototype,s=a.hasOwnProperty;t.exports=r},{"./eq":462}],382:[function(e,t,n){var r=e("./_getNative"),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();t.exports=i},{"./_getNative":391}],383:[function(e,t,n){function r(e,t,n,r,l,c){var p=n&o,f=e.length,h=t.length;if(f!=h&&!(p&&h>f))return!1;var d=c.get(e);if(d&&c.get(t))return d==t;var y=-1,m=!0,b=n&u?new i:void 0;for(c.set(e,t),c.set(t,e);++y-1&&e%1==0&&e-1}var i=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":309}],420:[function(e,t,n){function r(e,t){var n=this.__data__,r=i(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var i=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":309}],421:[function(e,t,n){function r(){this.size=0,this.__data__={hash:new i,map:new(s||a),string:new i}}var i=e("./_Hash"),a=e("./_ListCache"),s=e("./_Map");t.exports=r},{"./_Hash":283,"./_ListCache":284,"./_Map":285}],422:[function(e,t,n){function r(e){var t=i(this,e).delete(e);return this.size-=t?1:0,t}var i=e("./_getMapData");t.exports=r},{"./_getMapData":389}],423:[function(e,t,n){function r(e){return i(this,e).get(e)}var i=e("./_getMapData");t.exports=r},{"./_getMapData":389}],424:[function(e,t,n){function r(e){return i(this,e).has(e)}var i=e("./_getMapData");t.exports=r},{"./_getMapData":389}],425:[function(e,t,n){function r(e,t){var n=i(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var i=e("./_getMapData");t.exports=r},{"./_getMapData":389}],426:[function(e,t,n){function r(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=r},{}],427:[function(e,t,n){function r(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}t.exports=r},{}],428:[function(e,t,n){function r(e){var t=i(e,function(e){return n.size===a&&n.clear(),e}),n=t.cache;return t}var i=e("./memoize"),a=500;t.exports=r},{"./memoize":494}],429:[function(e,t,n){var r=e("./_getNative"),i=r(Object,"create");t.exports=i},{"./_getNative":391}],430:[function(e,t,n){var r=e("./_overArg"),i=r(Object.keys,Object);t.exports=i},{"./_overArg":434}],431:[function(e,t,n){function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.exports=r},{}],432:[function(e,t,n){var r=e("./_freeGlobal"),i="object"==typeof n&&n&&!n.nodeType&&n,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,s=a&&a.exports===i,o=s&&r.process,u=function(){try{return o&&o.binding&&o.binding("util")}catch(e){}}();t.exports=u},{"./_freeGlobal":386}],433:[function(e,t,n){function r(e){return a.call(e)}var i=Object.prototype,a=i.toString;t.exports=r},{}],434:[function(e,t,n){function r(e,t){return function(n){return e(t(n))}}t.exports=r},{}],435:[function(e,t,n){function r(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var r=arguments,s=-1,o=a(r.length-t,0),u=Array(o);++s0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var i=800,a=16,s=Date.now;t.exports=r},{}],442:[function(e,t,n){function r(){this.__data__=new i,this.size=0}var i=e("./_ListCache");t.exports=r},{"./_ListCache":284}],443:[function(e,t,n){function r(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=r},{}],444:[function(e,t,n){function r(e){return this.__data__.get(e)}t.exports=r},{}],445:[function(e,t,n){function r(e){return this.__data__.has(e)}t.exports=r},{}],446:[function(e,t,n){function r(e,t){var n=this.__data__;if(n instanceof i){var r=n.__data__;if(!a||r.length-1:!!c&&i(e,t,n)>-1}var i=e("./_baseIndexOf"),a=e("./isArrayLike"),s=e("./isString"),o=e("./toInteger"),u=e("./values"),l=Math.max;t.exports=r},{"./_baseIndexOf":326,"./isArrayLike":476,"./isString":488,"./toInteger":504,"./values":510}],474:[function(e,t,n){var r=e("./_baseIsArguments"),i=e("./isObjectLike"),a=Object.prototype,s=a.hasOwnProperty,o=a.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!o.call(e,"callee")};t.exports=u},{"./_baseIsArguments":327,"./isObjectLike":485}],475:[function(e,t,n){var r=Array.isArray;t.exports=r},{}],476:[function(e,t,n){function r(e){return null!=e&&a(e.length)&&!i(e)}var i=e("./isFunction"),a=e("./isLength");t.exports=r},{"./isFunction":480,"./isLength":482}],477:[function(e,t,n){function r(e){return a(e)&&i(e)}var i=e("./isArrayLike"),a=e("./isObjectLike");t.exports=r},{"./isArrayLike":476,"./isObjectLike":485}],478:[function(e,t,n){function r(e){return e===!0||e===!1||a(e)&&i(e)==s}var i=e("./_baseGetTag"),a=e("./isObjectLike"),s="[object Boolean]";t.exports=r},{"./_baseGetTag":323,"./isObjectLike":485}],479:[function(e,t,n){var r=e("./_root"),i=e("./stubFalse"),a="object"==typeof n&&n&&!n.nodeType&&n,s=a&&"object"==typeof t&&t&&!t.nodeType&&t,o=s&&s.exports===a,u=o?r.Buffer:void 0,l=u?u.isBuffer:void 0,c=l||i;t.exports=c},{"./_root":436,"./stubFalse":502}],480:[function(e,t,n){function r(e){if(!a(e))return!1;var t=i(e);return t==o||t==u||t==s||t==l}var i=e("./_baseGetTag"),a=e("./isObject"),s="[object AsyncFunction]",o="[object Function]",u="[object GeneratorFunction]",l="[object Proxy]";t.exports=r},{"./_baseGetTag":323,"./isObject":484}],481:[function(e,t,n){function r(e){return"number"==typeof e&&e==i(e)}var i=e("./toInteger");t.exports=r},{"./toInteger":504}],482:[function(e,t,n){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}var i=9007199254740991;t.exports=r},{}],483:[function(e,t,n){function r(e){return"number"==typeof e||a(e)&&i(e)==s}var i=e("./_baseGetTag"),a=e("./isObjectLike"),s="[object Number]";t.exports=r},{"./_baseGetTag":323,"./isObjectLike":485}],484:[function(e,t,n){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=r},{}],485:[function(e,t,n){function r(e){return null!=e&&"object"==typeof e}t.exports=r},{}],486:[function(e,t,n){function r(e){if(!s(e)||i(e)!=o)return!1;var t=a(e);if(null===t)return!0;var n=p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}var i=e("./_baseGetTag"),a=e("./_getPrototype"),s=e("./isObjectLike"),o="[object Object]",u=Function.prototype,l=Object.prototype,c=u.toString,p=l.hasOwnProperty,f=c.call(Object);t.exports=r},{"./_baseGetTag":323,"./_getPrototype":392,"./isObjectLike":485}],487:[function(e,t,n){var r=e("./_baseIsRegExp"),i=e("./_baseUnary"),a=e("./_nodeUtil"),s=a&&a.isRegExp,o=s?i(s):r;t.exports=o},{"./_baseIsRegExp":333,"./_baseUnary":353,"./_nodeUtil":432}],488:[function(e,t,n){function r(e){return"string"==typeof e||!a(e)&&s(e)&&i(e)==o}var i=e("./_baseGetTag"),a=e("./isArray"),s=e("./isObjectLike"),o="[object String]";t.exports=r},{"./_baseGetTag":323,"./isArray":475,"./isObjectLike":485}],489:[function(e,t,n){function r(e){return"symbol"==typeof e||a(e)&&i(e)==s}var i=e("./_baseGetTag"),a=e("./isObjectLike"),s="[object Symbol]";t.exports=r},{"./_baseGetTag":323,"./isObjectLike":485}],490:[function(e,t,n){var r=e("./_baseIsTypedArray"),i=e("./_baseUnary"),a=e("./_nodeUtil"),s=a&&a.isTypedArray,o=s?i(s):r;t.exports=o},{"./_baseIsTypedArray":334,"./_baseUnary":353,"./_nodeUtil":432}],491:[function(e,t,n){function r(e){return s(e)?i(e):a(e)}var i=e("./_arrayLikeKeys"),a=e("./_baseKeys"),s=e("./isArrayLike");t.exports=r},{"./_arrayLikeKeys":301,"./_baseKeys":336,"./isArrayLike":476}],492:[function(e,t,n){function r(e){return s(e)?i(e,!0):a(e)}var i=e("./_arrayLikeKeys"),a=e("./_baseKeysIn"),s=e("./isArrayLike");t.exports=r},{"./_arrayLikeKeys":301,"./_baseKeysIn":337,"./isArrayLike":476}],493:[function(e,t,n){function r(e,t){return(o(e)?i:s)(e,a(t,3))}var i=e("./_arrayMap"),a=e("./_baseIteratee"),s=e("./_baseMap"),o=e("./isArray");t.exports=r},{"./_arrayMap":302,"./_baseIteratee":335,"./_baseMap":338,"./isArray":475}],494:[function(e,t,n){function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(a);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var s=e.apply(this,r);return n.cache=a.set(i,s)||a,s};return n.cache=new(r.Cache||i),n}var i=e("./_MapCache"),a="Expected a function";r.Cache=i,t.exports=r},{"./_MapCache":286}],495:[function(e,t,n){var r=e("./_baseMerge"),i=e("./_createAssigner"),a=i(function(e,t,n,i){r(e,t,n,i)});t.exports=a},{"./_baseMerge":341,"./_createAssigner":376}],496:[function(e,t,n){function r(){}t.exports=r},{}],497:[function(e,t,n){function r(e){return s(e)?i(o(e)):a(e)}var i=e("./_baseProperty"),a=e("./_basePropertyDeep"),s=e("./_isKey"),o=e("./_toKey");t.exports=r},{"./_baseProperty":344,"./_basePropertyDeep":345,"./_isKey":411,"./_toKey":450}],498:[function(e,t,n){function r(e,t,n){return t=(n?a(e,t,n):void 0===t)?1:s(t),i(o(e),t)}var i=e("./_baseRepeat"),a=e("./_isIterateeCall"),s=e("./toInteger"),o=e("./toString");t.exports=r},{"./_baseRepeat":346,"./_isIterateeCall":410,"./toInteger":504,"./toString":507}],499:[function(e,t,n){var r=e("./_baseFlatten"),i=e("./_baseOrderBy"),a=e("./_baseRest"),s=e("./_isIterateeCall"),o=a(function(e,t){if(null==e)return[];var n=t.length;return n>1&&s(e,t[0],t[1])?t=[]:n>2&&s(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])});t.exports=o},{"./_baseFlatten":318,"./_baseOrderBy":343,"./_baseRest":347,"./_isIterateeCall":410}],500:[function(e,t,n){function r(e,t,n){return e=o(e),n=null==n?0:i(s(n),0,e.length),t=a(t),e.slice(n,n+t.length)==t}var i=e("./_baseClamp"),a=e("./_baseToString"),s=e("./toInteger"),o=e("./toString");t.exports=r},{"./_baseClamp":313,"./_baseToString":352,"./toInteger":504,"./toString":507}],501:[function(e,t,n){function r(){return[]}t.exports=r},{}],502:[function(e,t,n){function r(){return!1}t.exports=r},{}],503:[function(e,t,n){function r(e){if(!e)return 0===e?e:0;if(e=i(e),e===a||e===-a){return(e<0?-1:1)*s}return e===e?e:0}var i=e("./toNumber"),a=1/0,s=1.7976931348623157e308;t.exports=r},{"./toNumber":505}],504:[function(e,t,n){function r(e){var t=i(e),n=t%1;return t===t?n?t-n:t:0}var i=e("./toFinite");t.exports=r},{"./toFinite":503}],505:[function(e,t,n){function r(e){if("number"==typeof e)return e;if(a(e))return s;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=l.test(e);return n||c.test(e)?p(e.slice(2),n?2:8):u.test(e)?s:+e}var i=e("./isObject"),a=e("./isSymbol"),s=NaN,o=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,p=parseInt;t.exports=r},{"./isObject":484,"./isSymbol":489}],506:[function(e,t,n){function r(e){return i(e,a(e))}var i=e("./_copyObject"),a=e("./keysIn");t.exports=r},{"./_copyObject":372,"./keysIn":492}],507:[function(e,t,n){function r(e){return null==e?"":i(e)}var i=e("./_baseToString");t.exports=r},{"./_baseToString":352}],508:[function(e,t,n){function r(e,t,n){if(e=u(e),e&&(n||void 0===t))return e.replace(l,"");if(!e||!(t=i(t)))return e;var r=o(e);return a(r,0,s(r,o(t))+1).join("")}var i=e("./_baseToString"),a=e("./_castSlice"),s=e("./_charsEndIndex"),o=e("./_stringToArray"),u=e("./toString"),l=/\s+$/;t.exports=r},{"./_baseToString":352,"./_castSlice":359,"./_charsEndIndex":360,"./_stringToArray":448,"./toString":507}],509:[function(e,t,n){function r(e){return e&&e.length?i(e):[]}var i=e("./_baseUniq");t.exports=r},{"./_baseUniq":354}],510:[function(e,t,n){function r(e){return null==e?[]:i(e,a(e))}var i=e("./_baseValues"),a=e("./keys");t.exports=r},{"./_baseValues":355,"./keys":491}],511:[function(e,t,n){function r(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}function i(e,t){return t=t||{},function(n,r,i){return s(n,e,t)}}function a(e,t){e=e||{},t=t||{};var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}function s(e,t,n){if("string"!=typeof t)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new o(t,n).match(e))}function o(e,t){if(!(this instanceof o))return new o(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==m.sep&&(e=e.split(m.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function u(){if(!this._made){var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error),this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(C)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return e.indexOf(!1)===-1}),this.debug(this.pattern,n),this.set=n}}function l(){var e=this.pattern,t=!1,n=this.options,r=0;if(!n.nonegate){for(var i=0,a=e.length;i65536)throw new TypeError("pattern is too long");var r=this.options;if(!r.noglobstar&&"**"===e)return b;if(""===e)return"";for(var i,a,s="",o=!!r.nocase,u=!1,l=[],c=[],p=!1,f=-1,h=-1,y="."===e.charAt(0)?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",m=this,g=0,E=e.length;g-1;P--){var j=c[P],B=s.slice(0,j.reStart),O=s.slice(j.reStart,j.reEnd-8),I=s.slice(j.reEnd-8,j.reEnd),N=s.slice(j.reEnd);I+=N;var L=B.split("(").length-1,M=N;for(g=0;g=0&&!(i=e[a]);a--);for(a=0;a>> no match, partial?",e,c,t,p),c!==s))}var h;if("string"==typeof u?(h=r.nocase?l.toLowerCase()===u.toLowerCase():l===u,this.debug("string match",u,l,h)):(h=l.match(u),this.debug("pattern match",u,l,h)),!h)return!1}if(i===s&&a===o)return!0;if(i===s)return n;if(a===o){return i===s-1&&""===e[i]}throw new Error("wtf?")}},{"brace-expansion":512,path:12}],512:[function(e,t,n){function r(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function i(e){return e.split("\\\\").join(y).split("\\{").join(m).split("\\}").join(b).split("\\,").join(g).split("\\.").join(v)}function a(e){return e.split(y).join("\\").split(m).join("{").split(b).join("}").split(g).join(",").split(v).join(".")}function s(e){if(!e)return[""];var t=[],n=d("{","}",e);if(!n)return e.split(",");var r=n.pre,i=n.body,a=n.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var u=s(a);return a.length&&(o[o.length-1]+=u.shift(),o.push.apply(o,u)),t.push.apply(t,o),t}function o(e){return e?("{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2)),f(i(e),!0).map(a)):[]}function u(e){return"{"+e+"}"}function l(e){return/^-?0\d/.test(e)}function c(e,t){return e<=t}function p(e,t){return e>=t}function f(e,t){var n=[],i=d("{","}",e);if(!i||/\$$/.test(i.pre))return[e];var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),y=a||o,m=/^(.*,)+(.+)?$/.test(i.body);if(!y&&!m)return i.post.match(/,.*\}/)?(e=i.pre+"{"+i.body+b+i.post,f(e)):[e];var g;if(y)g=i.body.split(/\.\./);else if(g=s(i.body),1===g.length&&(g=f(g[0],!1).map(u),1===g.length)){var v=i.post.length?f(i.post,!1):[""];return v.map(function(e){return i.pre+g[0]+e})}var x,_=i.pre,v=i.post.length?f(i.post,!1):[""];if(y){var E=r(g[0]),A=r(g[1]),D=Math.max(g[0].length,g[1].length),C=3==g.length?Math.abs(r(g[2])):1,S=c;A0){var P=new Array(T+1).join("0");F=k<0?"-"+P+F.slice(1):P+F}}x.push(F)}}else x=h(g,function(e){return f(e,!1)});for(var j=0;j=0&&l>0){for(r=[],a=n.length;c>=0&&!o;)c==u?(r.push(c),u=n.indexOf(e,c+1)):1==r.length?o=[r.pop(),l]:(i=r.pop(),i=0?u:l;r.length&&(o=[a,s])}return o}t.exports=r,r.range=a},{}],514:[function(e,t,n){t.exports=function(e,t){for(var n=[],i=0;i=0&&e>1;return t?-n:n}var a=e("./base64"),s=5,o=1<>>=s,i>0&&(t|=l),n+=a.encode(t);while(i>0);return n},n.decode=function(e,t,n){var r,o,c=e.length,p=0,f=0;do{if(t>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(o=a.decode(e.charCodeAt(t++)),o===-1)throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(o&l),o&=u,p+=o<0?t-u>1?r(u,t,i,a,s,o):o==n.LEAST_UPPER_BOUND?t1?r(e,u,i,a,s,o):o==n.LEAST_UPPER_BOUND?u:e<0?-1:e}n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,t,i,a){if(0===t.length)return-1;var s=r(-1,t.length,e,t,i,a||n.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&0===i(t[s],t[s-1],!0);)--s;return s}},{}],521:[function(e,t,n){function r(e,t){var n=e.generatedLine,r=t.generatedLine,i=e.generatedColumn,s=t.generatedColumn;return r>n||r==n&&s>=i||a.compareByGeneratedPositionsInflated(e,t)<=0}function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}var a=e("./util");i.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},i.prototype.add=function(e){r(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(a.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},n.MappingList=i},{"./util":526}],522:[function(e,t,n){function r(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function i(e,t){return Math.round(e+Math.random()*(t-e))}function a(e,t,n,s){if(n=0){var a=this._originalMappings[i];if(void 0===e.column)for(var s=a.originalLine;a&&a.originalLine===s;)r.push({line:o.getArg(a,"generatedLine",null),column:o.getArg(a,"generatedColumn",null),lastColumn:o.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i];else for(var l=a.originalColumn;a&&a.originalLine===t&&a.originalColumn==l;)r.push({line:o.getArg(a,"generatedLine",null),column:o.getArg(a,"generatedColumn",null),lastColumn:o.getArg(a,"lastGeneratedColumn",null)}),a=this._originalMappings[++i]}return r},n.SourceMapConsumer=r,i.prototype=Object.create(r.prototype),i.prototype.consumer=r,i.fromSourceMap=function(e){var t=Object.create(i.prototype),n=t._names=l.fromArray(e._names.toArray(),!0),r=t._sources=l.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var s=e._mappings.toArray().slice(),u=t.__generatedMappings=[],c=t.__originalMappings=[],f=0,h=s.length;f1&&(n.source=y+i[1],y+=i[1],n.originalLine=h+i[2],h=n.originalLine,n.originalLine+=1,n.originalColumn=d+i[3],d=n.originalColumn,i.length>4&&(n.name=m+i[4],m+=i[4])),E.push(n),"number"==typeof n.originalLine&&_.push(n)}p(E,o.compareByGeneratedPositionsDeflated),this.__generatedMappings=E,p(_,o.compareByOriginalPositions),this.__originalMappings=_},i.prototype._findMapping=function(e,t,n,r,i,a){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return u.search(e,t,i,a)},i.prototype.computeColumnSpans=function(){for(var e=0;e=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var a=o.getArg(i,"source",null);null!==a&&(a=this._sources.at(a),null!=this.sourceRoot&&(a=o.join(this.sourceRoot,a)));var s=o.getArg(i,"name",null);return null!==s&&(s=this._names.at(s)),{source:a,line:o.getArg(i,"originalLine",null),column:o.getArg(i,"originalColumn",null),name:s}}}return{source:null,line:null,column:null,name:null}},i.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},i.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=o.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=o.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},i.prototype.generatedPositionFor=function(e){var t=o.getArg(e,"source");if(null!=this.sourceRoot&&(t=o.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var n={source:t,originalLine:o.getArg(e,"line"),originalColumn:o.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",o.compareByOriginalPositions,o.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var a=this._originalMappings[i];if(a.source===n.source)return{line:o.getArg(a,"generatedLine",null),column:o.getArg(a,"generatedColumn",null),lastColumn:o.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=i,s.prototype=Object.create(r.prototype),s.prototype.constructor=r,s.prototype._version=3,Object.defineProperty(s.prototype,"sources",{get:function(){for(var e=[],t=0;t0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},r.prototype._serializeMappings=function(){for(var e,t,n,r,s=0,o=1,u=0,l=0,c=0,p=0,f="",h=this._mappings.toArray(),d=0,y=h.length;d0){if(!a.compareByGeneratedPositionsInflated(t,h[d-1]))continue;e+=","}e+=i.encode(t.generatedColumn-s),s=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=i.encode(r-p),p=r,e+=i.encode(t.originalLine-1-l),l=t.originalLine-1,e+=i.encode(t.originalColumn-u),u=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=i.encode(n-c),c=n)),f+=e}return f},r.prototype._generateSourcesContent=function(e,t){return e.map(function(e){if(!this._sourcesContents)return null;null!=t&&(e=a.relative(t,e));var n=a.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)},r.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},r.prototype.toString=function(){return JSON.stringify(this.toJSON())},n.SourceMapGenerator=r},{"./array-set":517,"./base64-vlq":518,"./mapping-list":521,"./util":526}],525:[function(e,t,n){function r(e,t,n,r,i){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==i?null:i,this[o]=!0,null!=r&&this.add(r)}var i=e("./source-map-generator").SourceMapGenerator,a=e("./util"),s=/(\r?\n)/,o="$$$isSourceNode$$$";r.fromStringWithSourceMap=function(e,t,n){function i(e,t){if(null===e||void 0===e.source)o.add(t);else{var i=n?a.join(n,e.source):e.source;o.add(new r(e.originalLine,e.originalColumn,i,t,e.name))}}var o=new r,u=e.split(s),l=function(){return u.shift()+(u.shift()||"")},c=1,p=0,f=null;return t.eachMapping(function(e){if(null!==f){if(!(c0&&(f&&i(f,l()),o.add(u.join(""))),t.sources.forEach(function(e){var r=t.sourceContentFor(e);null!=r&&(null!=n&&(e=a.join(n,e)),o.setSourceContent(e,r))}),o},r.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},r.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[o]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},r.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n0){for(t=[],n=0;n=0;c--)s=u[c],"."===s?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return t=u.join("/"),""===t&&(t=o?"/":"."),r?(r.path=t,a(r)):t}function o(e,t){""===e&&(e="."),""===t&&(t=".");var n=i(t),r=i(e);if(r&&(e=r.path||"/"),n&&!n.scheme)return r&&(n.scheme=r.scheme),a(n);if(n||t.match(g))return t;if(r&&!r.host&&!r.path)return r.host=t,a(r);var o="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return r?(r.path=o,a(r)):o}function u(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function l(e){return e}function c(e){return f(e)?"$"+e:e}function p(e){return f(e)?e.slice(1):e}function f(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function h(e,t,n){var r=e.source-t.source;return 0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r||n?r:(r=e.generatedColumn-t.generatedColumn,0!==r?r:(r=e.generatedLine-t.generatedLine,0!==r?r:e.name-t.name))))}function d(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:(r=e.generatedColumn-t.generatedColumn,0!==r||n?r:(r=e.source-t.source,0!==r?r:(r=e.originalLine-t.originalLine,0!==r?r:(r=e.originalColumn-t.originalColumn,0!==r?r:e.name-t.name))))}function y(e,t){return e===t?0:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:(n=e.generatedColumn-t.generatedColumn,0!==n?n:(n=y(e.source,t.source),0!==n?n:(n=e.originalLine-t.originalLine,0!==n?n:(n=e.originalColumn-t.originalColumn,0!==n?n:y(e.name,t.name)))))}n.getArg=r;var b=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/,g=/^data:.+\,.+$/;n.urlParse=i,n.urlGenerate=a,n.normalize=s,n.join=o,n.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(b)},n.relative=u;var v=function(){return!("__proto__"in Object.create(null))}();n.toSetString=v?l:c,n.fromSetString=v?l:p,n.compareByOriginalPositions=h,n.compareByGeneratedPositionsDeflated=d,n.compareByGeneratedPositionsInflated=m},{}],527:[function(e,t,n){n.SourceMapGenerator=e("./lib/source-map-generator").SourceMapGenerator,n.SourceMapConsumer=e("./lib/source-map-consumer").SourceMapConsumer,n.SourceNode=e("./lib/source-node").SourceNode},{"./lib/source-map-consumer":523,"./lib/source-map-generator":524,"./lib/source-node":525}],528:[function(e,t,n){t.exports={name:"babel-core",version:"6.21.0",description:"Babel compiler core.",author:{name:"Sebastian McKenzie",email:"sebmck@gmail.com"},homepage:"https://babeljs.io/",license:"MIT",repository:{type:"git",url:"https://github.com/babel/babel/tree/master/packages/babel-core"},keywords:["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core"],scripts:{bench:"make bench",test:"make test"},dependencies:{"babel-code-frame":"^6.20.0","babel-generator":"^6.21.0","babel-helpers":"^6.16.0","babel-messages":"^6.8.0","babel-template":"^6.16.0","babel-runtime":"^6.20.0","babel-register":"^6.18.0","babel-traverse":"^6.21.0","babel-types":"^6.21.0",babylon:"^6.11.0","convert-source-map":"^1.1.0",debug:"^2.1.1",json5:"^0.5.0",lodash:"^4.2.0",minimatch:"^3.0.2","path-is-absolute":"^1.0.0",private:"^0.1.6",slash:"^1.0.0","source-map":"^0.5.0"},devDependencies:{"babel-helper-fixtures":"^6.20.0","babel-helper-transform-fixture-test-runner":"^6.21.0","babel-polyfill":"^6.20.0"},_id:"babel-core@6.21.0", +_shasum:"75525480c21c803f826ef3867d22c19f080a3724",_from:"babel-core@>=6.18.2 <7.0.0",_npmVersion:"3.10.8",_nodeVersion:"6.9.0",_npmUser:{name:"hzoo",email:"hi@henryzoo.com"},dist:{shasum:"75525480c21c803f826ef3867d22c19f080a3724",tarball:"https://registry.npmjs.org/babel-core/-/babel-core-6.21.0.tgz"},maintainers:[{name:"amasad",email:"amjad.masad@gmail.com"},{name:"hzoo",email:"hi@henryzoo.com"},{name:"jmm",email:"npm-public@jessemccarthy.net"},{name:"loganfsmyth",email:"loganfsmyth@gmail.com"},{name:"sebmck",email:"sebmck@gmail.com"},{name:"thejameskyle",email:"me@thejameskyle.com"}],_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/babel-core-6.21.0.tgz_1481925355362_0.2487682355567813"},directories:{},_resolved:"https://registry.npmjs.org/babel-core/-/babel-core-6.21.0.tgz",readme:"ERROR: No README data found!"}},{}],529:[function(e,t,n){function r(e,t,n){if(e){if(x.fixFaultyLocations(e,t),n){if(d.Node.check(e)&&d.SourceLocation.check(e.loc)){for(var i=n.length-1;i>=0&&!(_(n[i].loc.end,e.loc.start)<=0);--i);return void n.splice(i+1,0,e)}}else if(e[E])return e[E];var a;if(y.check(e))a=Object.keys(e);else{if(!m.check(e))return;a=h.getFieldNames(e)}n||Object.defineProperty(e,E,{value:n=[],enumerable:!1});for(var i=0,s=a.length;i>1,l=a[u];if(_(l.loc.start,t.loc.start)<=0&&_(t.loc.end,l.loc.end)<=0)return void i(t.enclosingNode=l,t,n);if(_(l.loc.end,t.loc.start)<=0){var c=l;s=u+1}else{if(!(_(t.loc.end,l.loc.start)<=0))throw new Error("Comment location overlaps with node location");var p=l;o=u}}c&&(t.precedingNode=c),p&&(t.followingNode=p)}function a(e,t){var n=e.length;if(0!==n){for(var r=e[0].precedingNode,i=e[0].followingNode,a=i.loc.start,s=n;s>0;--s){var u=e[s-1];f.strictEqual(u.precedingNode,r),f.strictEqual(u.followingNode,i);var c=t.sliceString(u.loc.end,a);if(/\S/.test(c))break;a=u.loc.start}for(;s<=n&&(u=e[s])&&("Line"===u.type||"CommentLine"===u.type)&&u.loc.start.column>i.loc.start.column;)++s;e.forEach(function(e,t){t0){var d=r[h-1];f.strictEqual(d.precedingNode===e.precedingNode,d.followingNode===e.followingNode),d.followingNode!==e.followingNode&&a(r,n)}r.push(e)}else if(s)a(r,n),l(s,e);else if(p)a(r,n),o(p,e);else{if(!c)throw new Error("AST contains no nodes at all?");a(r,n),u(c,e)}}),a(r,n),e.forEach(function(e){delete e.precedingNode,delete e.enclosingNode,delete e.followingNode})}},n.printComments=function(e,t){var n=e.getValue(),r=t(e),i=d.Node.check(n)&&h.getFieldValue(n,"comments");if(!i||0===i.length)return r;var a=[],s=[r];return e.each(function(e){var r=e.getValue(),i=h.getFieldValue(r,"leading"),o=h.getFieldValue(r,"trailing");i||o&&!d.Statement.check(n)&&"Block"!==r.type&&"CommentBlock"!==r.type?a.push(c(e,t)):o&&s.push(p(e,t))},"comments"),a.push.apply(a,s),v(a)}},{"./lines":531,"./types":537,"./util":538,assert:2,private:560}],530:[function(e,t,n){function r(e){o.ok(this instanceof r),this.stack=[e]}function i(e,t){for(var n=e.stack,r=n.length-1;r>=0;r-=2){var i=n[r];if(l.Node.check(i)&&--t<0)return i}return null}function a(e){return l.BinaryExpression.check(e)||l.LogicalExpression.check(e)}function s(e){return!!l.CallExpression.check(e)||(c.check(e)?e.some(s):!!l.Node.check(e)&&u.someField(e,function(e,t){return s(t)}))}var o=e("assert"),u=e("./types"),l=u.namedTypes,c=(l.Node,u.builtInTypes.array),p=u.builtInTypes.number,f=r.prototype;t.exports=r,r.from=function(e){if(e instanceof r)return e.copy();if(e instanceof u.NodePath){for(var t,n=Object.create(r.prototype),i=[e.value];t=e.parentPath;e=t)i.push(e.name,t.value);return n.stack=i.reverse(),n}return new r(e)},f.copy=function e(){var e=Object.create(r.prototype);return e.stack=this.stack.slice(0),e},f.getName=function(){var e=this.stack,t=e.length;return t>1?e[t-2]:null},f.getValue=function(){var e=this.stack;return e[e.length-1]},f.getNode=function(e){return i(this,~~e)},f.getParentNode=function(e){return i(this,~~e+1)},f.getRootValue=function(){var e=this.stack;return e.length%2===0?e[1]:e[0]},f.call=function(e){for(var t=this.stack,n=t.length,r=t[n-1],i=arguments.length,a=1;af)return!0;if(u===f&&"right"===n)return o.strictEqual(t.right,r),!0;default:return!1}case"SequenceExpression":switch(t.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==n;default:return!0}case"YieldExpression":switch(t.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return"NullableTypeAnnotation"===t.type;case"Literal":return"MemberExpression"===t.type&&p.check(r.value)&&"object"===n&&t.object===r;case"AssignmentExpression":case"ConditionalExpression":switch(t.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===n&&t.callee===r;case"ConditionalExpression":return"test"===n&&t.test===r;case"MemberExpression":return"object"===n&&t.object===r;default:return!1}case"ArrowFunctionExpression":return"CallExpression"===t.type&&"callee"===n||a(t);case"ObjectExpression":if("ArrowFunctionExpression"===t.type&&"body"===n)return!0;default:if("NewExpression"===t.type&&"callee"===n&&t.callee===r)return s(r)}return!(e===!0||this.canBeFirstInStatement()||!this.firstInStatement())};var h={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%","**"]].forEach(function(e,t){e.forEach(function(e){h[e]=t})}),f.canBeFirstInStatement=function(){var e=this.getNode();return!l.FunctionExpression.check(e)&&!l.ObjectExpression.check(e)},f.firstInStatement=function(){for(var e,t,n,r,i=this.stack,s=i.length-1;s>=0;s-=2)if(l.Node.check(i[s])&&(n=e,r=t,e=i[s-1],t=i[s]),t&&r){if(l.BlockStatement.check(t)&&"body"===e&&0===n)return o.strictEqual(t.body[0],r),!0;if(l.ExpressionStatement.check(t)&&"expression"===n)return o.strictEqual(t.expression,r),!0;if(l.SequenceExpression.check(t)&&"expressions"===e&&0===n)o.strictEqual(t.expressions[0],r);else if(l.CallExpression.check(t)&&"callee"===n)o.strictEqual(t.callee,r);else if(l.MemberExpression.check(t)&&"object"===n)o.strictEqual(t.object,r);else if(l.ConditionalExpression.check(t)&&"test"===n)o.strictEqual(t.test,r);else if(a(t)&&"left"===n)o.strictEqual(t.left,r);else{if(!l.UnaryExpression.check(t)||t.prefix||"argument"!==n)return!1;o.strictEqual(t.argument,r)}}return!0}},{"./types":537,assert:2}],531:[function(e,t,n){function r(e){return e[h]}function i(e,t){c.ok(this instanceof i),c.ok(e.length>0),t?y.assert(t):t=null,Object.defineProperty(this,h,{value:{infos:e,mappings:[],name:t,cachedSourceMap:null}}),t&&r(this).mappings.push(new b(this,{start:this.firstPos(),end:this.lastPos()}))}function a(e){return{line:e.line,indent:e.indent,locked:e.locked,sliceStart:e.sliceStart,sliceEnd:e.sliceEnd}}function s(e,t){for(var n=0,r=e.length,i=0;i0);var a=Math.ceil(n/t)*t;a===n?n+=t:n=a;break;case 11:case 12:case 13:case 65279:break;case 32:default:n+=1}return n}function o(e,t){if(e instanceof i)return e;e+="";var n=t&&t.tabWidth,r=e.indexOf("\t")<0,a=!(!t||!t.locked),o=!t&&r&&e.length<=_;if(c.ok(n||r,"No tab width specified but encountered tabs in string\n"+e),o&&x.call(v,e))return v[e];var u=new i(e.split(A).map(function(e){var t=E.exec(e)[0];return{line:e,indent:s(t,n),locked:a,sliceStart:t.length,sliceEnd:e.length}}),f(t).sourceFileName);return o&&(v[e]=u),u}function u(e){return!/\S/.test(e)}function l(e,t,n){var r=e.sliceStart,i=e.sliceEnd,a=Math.max(e.indent,0),s=a+i-r;return void 0===n&&(n=s),t=Math.max(t,0),n=Math.min(n,s),n=Math.max(n,t),n=0),c.ok(r<=i),c.strictEqual(s,a+i-r),e.indent===a&&e.sliceStart===r&&e.sliceEnd===i?e:{line:e.line,indent:a,locked:!1,sliceStart:r,sliceEnd:i}}var c=e("assert"),p=e("source-map"),f=e("./options").normalize,h=e("private").makeUniqueKey(),d=e("./types"),y=d.builtInTypes.string,m=e("./util").comparePos,b=e("./mapping");n.Lines=i;var g=i.prototype;Object.defineProperties(g,{length:{get:function(){return r(this).infos.length}},name:{get:function(){return r(this).name}}});var v={},x=v.hasOwnProperty,_=10;n.countSpaces=s;var E=/^\s*/,A=/\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/;n.fromString=o,g.toString=function(e){return this.sliceString(this.firstPos(),this.lastPos(),e)},g.getSourceMap=function(e,t){function n(n){return n=n||{},y.assert(e),n.file=e,t&&(y.assert(t),n.sourceRoot=t),n}if(!e)return null;var i=this,a=r(i);if(a.cachedSourceMap)return n(a.cachedSourceMap.toJSON());var s=new p.SourceMapGenerator(n()),o={};return a.mappings.forEach(function(e){for(var t=e.sourceLines.skipSpaces(e.sourceLoc.start)||e.sourceLines.lastPos(),n=i.skipSpaces(e.targetLoc.start)||i.lastPos();m(t,e.sourceLoc.end)<0&&m(n,e.targetLoc.end)<0;){var r=e.sourceLines.charAt(t),a=i.charAt(n);c.strictEqual(r,a);var u=e.sourceLines.name;if(s.addMapping({source:u,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column}}),!x.call(o,u)){var l=e.sourceLines.toString();s.setSourceContent(u,l),o[u]=l}i.nextPos(n,!0),e.sourceLines.nextPos(t,!0)}}),a.cachedSourceMap=s,s.toJSON()},g.bootstrapCharAt=function(e){c.strictEqual(typeof e,"object"),c.strictEqual(typeof e.line,"number"),c.strictEqual(typeof e.column,"number");var t=e.line,n=e.column,r=this.toString().split(A),i=r[t-1];return void 0===i?"":n===i.length&&t=i.length?"":i.charAt(n)},g.charAt=function(e){c.strictEqual(typeof e,"object"),c.strictEqual(typeof e.line,"number"),c.strictEqual(typeof e.column,"number");var t=e.line,n=e.column,i=r(this),a=i.infos,s=a[t-1],o=n;if(void 0===s||o<0)return"";var u=this.getIndentAt(t);return o=s.sliceEnd?"":s.line.charAt(o))},g.stripMargin=function(e,t){if(0===e)return this;if(c.ok(e>0,"negative margin: "+e),t&&1===this.length)return this;var n=r(this),s=new i(n.infos.map(function(n,r){return n.line&&(r>0||!t)&&(n=a(n),n.indent=Math.max(0,n.indent-e)),n}));if(n.mappings.length>0){var o=r(s).mappings;c.strictEqual(o.length,0),n.mappings.forEach(function(n){o.push(n.indent(e,t,!0))})}return s},g.indent=function(e){if(0===e)return this;var t=r(this),n=new i(t.infos.map(function(t){return t.line&&!t.locked&&(t=a(t),t.indent+=e),t}));if(t.mappings.length>0){var s=r(n).mappings;c.strictEqual(s.length,0),t.mappings.forEach(function(t){s.push(t.indent(e))})}return n},g.indentTail=function(e){if(0===e)return this;if(this.length<2)return this;var t=r(this),n=new i(t.infos.map(function(t,n){return n>0&&t.line&&!t.locked&&(t=a(t),t.indent+=e),t}));if(t.mappings.length>0){var s=r(n).mappings;c.strictEqual(s.length,0),t.mappings.forEach(function(t){s.push(t.indent(e,!0))})}return n},g.lockIndentTail=function(){return this.length<2?this:new i(r(this).infos.map(function(e,t){return e=a(e),e.locked=t>0,e}))},g.getIndentAt=function(e){c.ok(e>=1,"no line "+e+" (line numbers start from 1)");var t=r(this),n=t.infos[e-1];return Math.max(n.indent,0)},g.guessTabWidth=function(){var e=r(this);if(x.call(e,"cachedTabWidth"))return e.cachedTabWidth;for(var t=[],n=0,i=1,a=this.length;i<=a;++i){var s=e.infos[i-1];if(!u(s.line.slice(s.sliceStart,s.sliceEnd))){var o=Math.abs(s.indent-n);t[o]=~~t[o]+1,n=s.indent}}for(var l=-1,c=2,p=1;pl&&(l=t[p],c=p);return e.cachedTabWidth=c},g.isOnlyWhitespace=function(){return u(this.toString())},g.isPrecededOnlyByWhitespace=function(e){var t=r(this),n=t.infos[e.line-1],i=Math.max(n.indent,0),a=e.column-i;if(a<=0)return!0;var s=n.sliceStart,o=Math.min(s+a,n.sliceEnd);return u(n.line.slice(s,o))},g.getLineLength=function(e){var t=r(this),n=t.infos[e-1];return this.getIndentAt(e)+n.sliceEnd-n.sliceStart},g.nextPos=function(e,t){var n=Math.max(e.line,0);return Math.max(e.column,0)0){var o=r(s).mappings;c.strictEqual(o.length,0),n.mappings.forEach(function(n){var r=n.slice(this,e,t);r&&o.push(r)},this)}return s},g.bootstrapSliceString=function(e,t,n){return this.slice(e,t).toString(n)},g.sliceString=function(e,t,n){if(!t){if(!e)return this;t=this.lastPos()}n=f(n);for(var i=r(this).infos,a=[],o=n.tabWidth,c=e.line;c<=t.line;++c){var p=i[c-1];c===e.line?p=c===t.line?l(p,e.column,t.column):l(p,e.column):c===t.line&&(p=l(p,0,t.column));var h=Math.max(p.indent,0),d=p.line.slice(0,p.sliceStart);if(n.reuseWhitespace&&u(d)&&s(d,n.tabWidth)===h)a.push(p.line.slice(0,p.sliceEnd));else{var y=0,m=h;n.useTabs&&(y=Math.floor(h/o),m-=y*o);var b="";y>0&&(b+=new Array(y+1).join("\t")),m>0&&(b+=new Array(m+1).join(" ")),b+=p.line.slice(p.sliceStart,p.sliceEnd),a.push(b)}}return a.join(n.lineTerminator)},g.isEmpty=function(){return this.length<2&&this.getLineLength(1)<1},g.join=function(e){function t(e){if(null!==e){if(s){var t=e.infos[0],n=new Array(t.indent+1).join(" "),r=c.length,i=Math.max(s.indent,0)+s.sliceEnd-s.sliceStart;s.line=s.line.slice(0,s.sliceEnd)+n+t.line.slice(t.sliceStart,t.sliceEnd),s.locked=s.locked||t.locked,s.sliceEnd=s.line.length,e.mappings.length>0&&e.mappings.forEach(function(e){p.push(e.add(r,i))})}else e.mappings.length>0&&p.push.apply(p,e.mappings);e.infos.forEach(function(e,t){(!s||t>0)&&(s=a(e),c.push(s))})}}function n(e,n){n>0&&t(l),t(e)}var s,u=this,l=r(u),c=[],p=[];if(e.map(function(e){var t=o(e);return t.isEmpty()?null:r(t)}).forEach(u.isEmpty()?t:n),c.length<1)return D;var f=new i(c);return r(f).mappings=p,f},n.concat=function(e){return D.join(e)},g.concat=function(e){var t=arguments,n=[this];return n.push.apply(n,t),c.strictEqual(n.length,t.length+1),D.join(n)};var D=o("")},{"./mapping":532,"./options":533,"./types":537,"./util":538,assert:2,private:560,"source-map":571}],532:[function(e,t,n){function r(e,t,n){o.ok(this instanceof r),o.ok(e instanceof f.Lines),c.assert(t),n?o.ok(l.check(n.start.line)&&l.check(n.start.column)&&l.check(n.end.line)&&l.check(n.end.column)):n=t,Object.defineProperties(this,{sourceLines:{value:e},sourceLoc:{value:t},targetLoc:{value:n}})}function i(e,t,n){return{line:e.line+t-1,column:1===e.line?e.column+n:e.column}}function a(e,t,n){return{line:e.line-t+1,column:e.line===t?e.column-n:e.column}}function s(e,t,n,r,i){o.ok(e instanceof f.Lines),o.ok(n instanceof f.Lines),p.assert(t),p.assert(r),p.assert(i);var a=h(r,i);if(0===a)return t;if(a<0){var s=e.skipSpaces(t),u=n.skipSpaces(r),l=i.line-u.line;for(s.line+=l,u.line+=l,l>0?(s.column=0,u.column=0):o.strictEqual(l,0);h(u,i)<0&&n.nextPos(u,!0);)o.ok(e.nextPos(s,!0)),o.strictEqual(e.charAt(s),n.charAt(u))}else{var s=e.skipSpaces(t,!0),u=n.skipSpaces(r,!0),l=i.line-u.line;for(s.line+=l,u.line+=l,l<0?(s.column=e.getLineLength(s.line),u.column=n.getLineLength(u.line)):o.strictEqual(l,0);h(i,u)<0&&n.prevPos(u,!0);)o.ok(e.prevPos(s,!0)),o.strictEqual(e.charAt(s),n.charAt(u))}return s}var o=e("assert"),u=e("./types"),l=(u.builtInTypes.string,u.builtInTypes.number),c=u.namedTypes.SourceLocation,p=u.namedTypes.Position,f=e("./lines"),h=e("./util").comparePos,d=r.prototype;t.exports=r,d.slice=function(e,t,n){function i(r){var i=l[r],a=c[r],p=t;return"end"===r?p=n:o.strictEqual(r,"start"),s(u,i,e,a,p)}o.ok(e instanceof f.Lines),p.assert(t),n?p.assert(n):n=e.lastPos();var u=this.sourceLines,l=this.sourceLoc,c=this.targetLoc;if(h(t,c.start)<=0)if(h(c.end,n)<=0)c={start:a(c.start,t.line,t.column),end:a(c.end,t.line,t.column)};else{if(h(n,c.start)<=0)return null;l={start:l.start,end:i("end")},c={start:a(c.start,t.line,t.column),end:a(n,t.line,t.column)}}else{if(h(c.end,t)<=0)return null;h(c.end,n)<=0?(l={start:i("start"),end:l.end},c={start:{line:1,column:0},end:a(c.end,t.line,t.column)}):(l={start:i("start"),end:i("end")},c={start:{line:1,column:0},end:a(n,t.line,t.column)})}return new r(this.sourceLines,l,c)},d.add=function(e,t){return new r(this.sourceLines,this.sourceLoc,{start:i(this.targetLoc.start,e,t),end:i(this.targetLoc.end,e,t)})},d.subtract=function(e,t){return new r(this.sourceLines,this.sourceLoc,{start:a(this.targetLoc.start,e,t),end:a(this.targetLoc.end,e,t)})},d.indent=function(e,t,n){if(0===e)return this;var i=this.targetLoc,a=i.start.line,s=i.end.line;if(t&&1===a&&1===s)return this;if(i={start:i.start,end:i.end},!t||a>1){var o=i.start.column+e;i.start={line:a,column:n?Math.max(0,o):o}}if(!t||s>1){var u=i.end.column+e;i.end={line:s,column:n?Math.max(0,u):u}}return new r(this.sourceLines,this.sourceLoc,i)}},{"./lines":531,"./types":537,"./util":538,assert:2}],533:[function(e,t,n){var r={parser:e("esprima"),tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:e("os").EOL,wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0},i=r.hasOwnProperty;n.normalize=function(e){function t(t){return i.call(e,t)?e[t]:r[t]}return e=e||r,{tabWidth:+t("tabWidth"),useTabs:!!t("useTabs"),reuseWhitespace:!!t("reuseWhitespace"),lineTerminator:t("lineTerminator"),wrapColumn:Math.max(t("wrapColumn"),0),sourceFileName:t("sourceFileName"),sourceMapName:t("sourceMapName"),sourceRoot:t("sourceRoot"),inputSourceMap:t("inputSourceMap"),parser:t("esprima")||t("parser"),range:t("range"),tolerant:t("tolerant"),quote:t("quote"),trailingComma:t("trailingComma"),arrayBracketSpacing:t("arrayBracketSpacing"),objectCurlySpacing:t("objectCurlySpacing"),arrowParensAlways:t("arrowParensAlways"),flowObjectCommas:t("flowObjectCommas")}}},{esprima:559,os:11}],534:[function(e,t,n){function r(e){i.ok(this instanceof r),this.lines=e,this.indent=0}var i=e("assert"),a=e("./types"),s=(a.namedTypes,a.builders),o=a.builtInTypes.object,u=a.builtInTypes.array,l=(a.builtInTypes.function,e("./patcher").Patcher,e("./options").normalize),c=e("./lines").fromString,p=e("./comments").attach,f=e("./util");n.parse=function(e,t){t=l(t);var n=c(e,t),i=n.toString({tabWidth:t.tabWidth,reuseWhitespace:!1,useTabs:!1}),a=[],o=t.parser.parse(i,{jsx:!0,loc:!0,locations:!0,range:t.range,comment:!0,onComment:a,tolerant:t.tolerant,ecmaVersion:6,sourceType:"module"});f.fixFaultyLocations(o,n),o.loc=o.loc||{start:n.firstPos(),end:n.lastPos()},o.loc.lines=n,o.loc.indent=0;var u=f.getTrueLoc(o,n);o.loc.start=u.start,o.loc.end=u.end,o.comments&&(a=o.comments,delete o.comments);var h=o;if("Program"===h.type){var h=s.file(o);h.loc={lines:n,indent:0,start:n.firstPos(),end:n.lastPos()}}else"File"===h.type&&(o=h.program);return p(a,o.body.length?h.program:h,n),new r(n).copy(h)},r.prototype.copy=function(e){if(u.check(e))return e.map(this.copy,this);if(!o.check(e))return e;f.fixFaultyLocations(e,this.lines);var t=Object.create(Object.getPrototypeOf(e),{original:{value:e,configurable:!1,enumerable:!1,writable:!0}}),n=e.loc,r=this.indent,i=r;n&&(("Block"===e.type||"Line"===e.type||"CommentBlock"===e.type||"CommentLine"===e.type||this.lines.isPrecededOnlyByWhitespace(n.start))&&(i=this.indent=n.start.column),n.lines=this.lines,n.indent=i);for(var a=Object.keys(e),s=a.length,l=0;l0||(r(i,e.start),a.push(e.lines),i=e.end)}),r(i,t.end),m.concat(a)}}function i(e){var t=[];return e.comments&&e.comments.length>0&&e.comments.forEach(function(e){(e.leading||e.trailing)&&t.push(e)}),t}function a(e,t,n){var r=_.copyPos(t.start),i=e.prevPos(r)&&e.charAt(r),a=n.charAt(n.firstPos());return i&&w.test(i)&&a&&w.test(a)}function s(e,t,n){var r=e.charAt(t.end),i=n.lastPos(),a=n.prevPos(i)&&n.charAt(i);return a&&w.test(a)&&r&&w.test(r)}function o(e,t){var n=e.getValue();g.assert(n);var r=n.original;if(g.assert(r),y.deepEqual(t,[]),n.type!==r.type)return!1;var i=new A(r),a=d(e,i,t);return a||(t.length=0),a}function u(e,t,n){var r=e.getValue();return r===t.getValue()||(C.check(r)?l(e,t,n):!!D.check(r)&&c(e,t,n))}function l(e,t,n){var r=e.getValue(),i=t.getValue();C.assert(r);var a=r.length;if(!C.check(i)||i.length!==a)return!1;for(var s=0;s0&&o.forEach(function(e){var t=e.oldPath.getValue();y.ok(t.leading||t.trailing),r.replace(t.loc,n(e.newPath).indentTail(t.loc.indent))}),u},k.deleteComments=function(e){if(e.comments){var t=this;e.comments.forEach(function(n){n.leading?t.replace({start:n.loc.start,end:e.loc.lines.skipSpaces(n.loc.end,!1,!1)},""):n.trailing&&t.replace({start:e.loc.lines.skipSpaces(n.loc.start,!0,!1),end:n.loc.end},"")})}},n.getReprinter=function(e){y.ok(e instanceof A);var t=e.getValue();if(g.check(t)){var n=t.original,i=n&&n.loc,u=i&&i.lines,l=[];if(u&&o(e,l))return function(e){var t=new r(u);return l.forEach(function(n){var r=n.newPath.getValue(),i=n.oldPath.getValue();x.assert(i.loc,!0);var o=!t.tryToReprintComments(r,i,e);o&&t.deleteComments(i);var l=e(n.newPath,o).indentTail(i.loc.indent),c=a(u,i.loc,l),p=s(u,i.loc,l);if(c||p){var f=[];c&&f.push(" "),f.push(l),p&&f.push(" "),l=m.concat(f)}t.replace(i.loc,l)}),t.get(i).indentTail(-n.loc.indent)}}};var F={line:1,column:0},T=/\S/},{"./fast-path":530,"./lines":531,"./types":537,"./util":538,assert:2}],536:[function(e,t,n){function r(e,t){A.ok(this instanceof r),j.assert(e),this.code=e,t&&(B.assert(t),this.map=t)}function i(e){function t(e){return A.ok(e instanceof O),D(e,n)}function n(e,n){if(n)return t(e);if(A.ok(e instanceof O),!c){var r=p.tabWidth,i=e.getNode().loc;if(i&&i.lines&&i.lines.guessTabWidth){p.tabWidth=i.lines.guessTabWidth();var a=o(e);return p.tabWidth=r,a}}return o(e)}function o(e){var t=F(e);return t?a(e,t(n)):u(e)}function u(e,n){return n?D(e,u):s(e,p,t)}function l(e){return s(e,p,l)}A.ok(this instanceof i);var c=e&&e.tabWidth,p=k(e);A.notStrictEqual(p,e),p.sourceFileName=null,this.print=function(e){if(!e)return M;var t=n(O.from(e),!0);return new r(t.toString(p),I.composeSourceMaps(p.inputSourceMap,t.getSourceMap(p.sourceMapName,p.sourceRoot)))},this.printGenerically=function(e){if(!e)return M;var t=O.from(e),n=p.reuseWhitespace;p.reuseWhitespace=!1;var i=new r(l(t).toString(p));return p.reuseWhitespace=n,i}}function a(e,t){return e.needsParens()?w(["(",t,")"]):t}function s(e,t,n){A.ok(e instanceof O);var r=e.getValue(),i=[],a=!1,s=o(e,t,n);return!r||s.isEmpty()?s:(r.decorators&&r.decorators.length>0&&!I.getParentExportDeclaration(e)?e.each(function(e){i.push(n(e),"\n")},"decorators"):I.isExportDeclaration(r)&&r.declaration&&r.declaration.decorators?e.each(function(e){i.push(n(e),"\n")},"declaration","decorators"):a=e.needsParens(),a&&i.unshift("("),i.push(s),a&&i.push(")"),w(i))}function o(e,t,n){var r=e.getValue();if(!r)return S("");if("string"==typeof r)return S(r,t);P.Printable.assert(r);var i=[];switch(r.type){case"File":return e.call(n,"program");case"Program":return r.directives&&e.each(function(e){i.push(n(e),";\n")},"directives"),i.push(e.call(function(e){return u(e,t,n)},"body")),w(i);case"Noop":case"EmptyStatement":return S("");case"ExpressionStatement":return w([e.call(n,"expression"),";"]);case"ParenthesizedExpression":return w(["(",e.call(n,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return S(" ").join([e.call(n,"left"),r.operator,e.call(n,"right")]);case"AssignmentPattern":return w([e.call(n,"left")," = ",e.call(n,"right")]);case"MemberExpression":i.push(e.call(n,"object"));var a=e.call(n,"property");return r.computed?i.push("[",a,"]"):i.push(".",a),w(i);case"MetaProperty":return w([e.call(n,"meta"),".",e.call(n,"property")]);case"BindExpression":return r.object&&i.push(e.call(n,"object")),i.push("::",e.call(n,"callee")),w(i);case"Path":return S(".").join(r.body);case"Identifier":return w([S(r.name,t),e.call(n,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"RestElement":return w(["...",e.call(n,"argument")]);case"FunctionDeclaration":case"FunctionExpression":return r.async&&i.push("async "),i.push("function"),r.generator&&i.push("*"),r.id&&i.push(" ",e.call(n,"id"),e.call(n,"typeParameters")),i.push("(",h(e,t,n),")",e.call(n,"returnType")," ",e.call(n,"body")),w(i);case"ArrowFunctionExpression":return r.async&&i.push("async "),r.typeParameters&&i.push(e.call(n,"typeParameters")),t.arrowParensAlways||1!==r.params.length||r.rest||"Identifier"!==r.params[0].type||r.params[0].typeAnnotation||r.returnType?i.push("(",h(e,t,n),")",e.call(n,"returnType")):i.push(e.call(n,"params",0)),i.push(" => ",e.call(n,"body")),w(i);case"MethodDefinition":return r.static&&i.push("static "),i.push(c(e,t,n)),w(i);case"YieldExpression":return i.push("yield"),r.delegate&&i.push("*"),r.argument&&i.push(" ",e.call(n,"argument")),w(i);case"AwaitExpression":return i.push("await"),r.all&&i.push("*"),r.argument&&i.push(" ",e.call(n,"argument")),w(i);case"ModuleDeclaration":return i.push("module",e.call(n,"id")),r.source?(A.ok(!r.body),i.push("from",e.call(n,"source"))):i.push(e.call(n,"body")),S(" ").join(i);case"ImportSpecifier":return r.imported?(i.push(e.call(n,"imported")),r.local&&r.local.name!==r.imported.name&&i.push(" as ",e.call(n,"local"))):r.id&&(i.push(e.call(n,"id")),r.name&&i.push(" as ",e.call(n,"name"))),w(i) +;case"ExportSpecifier":return r.local?(i.push(e.call(n,"local")),r.exported&&r.exported.name!==r.local.name&&i.push(" as ",e.call(n,"exported"))):r.id&&(i.push(e.call(n,"id")),r.name&&i.push(" as ",e.call(n,"name"))),w(i);case"ExportBatchSpecifier":return S("*");case"ImportNamespaceSpecifier":return i.push("* as "),r.local?i.push(e.call(n,"local")):r.id&&i.push(e.call(n,"id")),w(i);case"ImportDefaultSpecifier":return r.local?e.call(n,"local"):e.call(n,"id");case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return y(e,t,n);case"ExportAllDeclaration":return i.push("export *"),r.exported&&i.push(" as ",e.call(n,"exported")),i.push(" from ",e.call(n,"source")),w(i);case"ExportNamespaceSpecifier":return w(["* as ",e.call(n,"exported")]);case"ExportDefaultSpecifier":return e.call(n,"exported");case"ImportDeclaration":if(i.push("import "),r.importKind&&"value"!==r.importKind&&i.push(r.importKind+" "),r.specifiers&&r.specifiers.length>0){var s=!1;e.each(function(e){e.getName()>0&&i.push(", ");var r=e.getValue();P.ImportDefaultSpecifier.check(r)||P.ImportNamespaceSpecifier.check(r)?A.strictEqual(s,!1):(P.ImportSpecifier.assert(r),s||(s=!0,i.push(t.objectCurlySpacing?"{ ":"{"))),i.push(n(e))},"specifiers"),s&&i.push(t.objectCurlySpacing?" }":"}"),i.push(" from ")}return i.push(e.call(n,"source"),";"),w(i);case"BlockStatement":var o=e.call(function(e){return u(e,t,n)},"body");return!o.isEmpty()||r.directives&&0!==r.directives.length?(i.push("{\n"),r.directives&&e.each(function(e){i.push(n(e).indent(t.tabWidth),";",r.directives.length>1||!o.isEmpty()?"\n":"")},"directives"),i.push(o.indent(t.tabWidth)),i.push("\n}"),w(i)):S("{}");case"ReturnStatement":if(i.push("return"),r.argument){var l=e.call(n,"argument");l.length>1&&P.JSXElement&&P.JSXElement.check(r.argument)?i.push(" (\n",l.indent(t.tabWidth),"\n)"):i.push(" ",l)}return i.push(";"),w(i);case"CallExpression":return w([e.call(n,"callee"),f(e,t,n)]);case"ObjectExpression":case"ObjectPattern":case"ObjectTypeAnnotation":var g=!1,x="ObjectTypeAnnotation"===r.type,E=t.flowObjectCommas?",":x?";":",",D=[];x&&D.push("indexers","callProperties"),D.push("properties");var C=0;D.forEach(function(e){C+=r[e].length});var k=x&&1===C||0===C,F=r.exact?"{|":"{",T=r.exact?"|}":"}";i.push(k?F:F+"\n");var j=i.length-1,B=0;return D.forEach(function(r){e.each(function(e){var r=n(e);k||(r=r.indent(t.tabWidth));var a=!x&&r.length>1;a&&g&&i.push("\n"),i.push(r),B0&&i.push(" "):r=r.indent(t.tabWidth),i.push(r),(n1?i.push(S(",\n").join(L).indentTail(r.kind.length+1)):i.push(L[0]);var U=e.getParentNode();return P.ForStatement.check(U)||P.ForInStatement.check(U)||P.ForOfStatement&&P.ForOfStatement.check(U)||P.ForAwaitStatement&&P.ForAwaitStatement.check(U)||i.push(";"),w(i);case"VariableDeclarator":return r.init?S(" = ").join([e.call(n,"id"),e.call(n,"init")]):e.call(n,"id");case"WithStatement":return w(["with (",e.call(n,"object"),") ",e.call(n,"body")]);case"IfStatement":var V=b(e.call(n,"consequent"),t),i=["if (",e.call(n,"test"),")",V];return r.alternate&&i.push(v(V)?" else":"\nelse",b(e.call(n,"alternate"),t)),w(i);case"ForStatement":var G=e.call(n,"init"),q=G.length>1?";\n":"; ",K="for (",X=S(q).join([G,e.call(n,"test"),e.call(n,"update")]).indentTail(K.length),J=w([K,X,")"]),W=b(e.call(n,"body"),t),i=[J];return J.length>1&&(i.push("\n"),W=W.trimLeft()),i.push(W),w(i);case"WhileStatement":return w(["while (",e.call(n,"test"),")",b(e.call(n,"body"),t)]);case"ForInStatement":return w([r.each?"for each (":"for (",e.call(n,"left")," in ",e.call(n,"right"),")",b(e.call(n,"body"),t)]);case"ForOfStatement":return w(["for (",e.call(n,"left")," of ",e.call(n,"right"),")",b(e.call(n,"body"),t)]);case"ForAwaitStatement":return w(["for await (",e.call(n,"left")," of ",e.call(n,"right"),")",b(e.call(n,"body"),t)]);case"DoWhileStatement":var z=w(["do",b(e.call(n,"body"),t)]),i=[z];return v(z)?i.push(" while"):i.push("\nwhile"),i.push(" (",e.call(n,"test"),");"),w(i);case"DoExpression":return w(["do {\n",e.call(function(e){return u(e,t,n)},"body").indent(t.tabWidth),"\n}"]);case"BreakStatement":return i.push("break"),r.label&&i.push(" ",e.call(n,"label")),i.push(";"),w(i);case"ContinueStatement":return i.push("continue"),r.label&&i.push(" ",e.call(n,"label")),i.push(";"),w(i);case"LabeledStatement":return w([e.call(n,"label"),":\n",e.call(n,"body")]);case"TryStatement":return i.push("try ",e.call(n,"block")),r.handler?i.push(" ",e.call(n,"handler")):r.handlers&&e.each(function(e){i.push(" ",n(e))},"handlers"),r.finalizer&&i.push(" finally ",e.call(n,"finalizer")),w(i);case"CatchClause":return i.push("catch (",e.call(n,"param")),r.guard&&i.push(" if ",e.call(n,"guard")),i.push(") ",e.call(n,"body")),w(i);case"ThrowStatement":return w(["throw ",e.call(n,"argument"),";"]);case"SwitchStatement":return w(["switch (",e.call(n,"discriminant"),") {\n",S("\n").join(e.map(n,"cases")),"\n}"]);case"SwitchCase":return r.test?i.push("case ",e.call(n,"test"),":"):i.push("default:"),r.consequent.length>0&&i.push("\n",e.call(function(e){return u(e,t,n)},"consequent").indent(t.tabWidth)),w(i);case"DebuggerStatement":return S("debugger;");case"JSXAttribute":return i.push(e.call(n,"name")),r.value&&i.push("=",e.call(n,"value")),w(i);case"JSXIdentifier":return S(r.name,t);case"JSXNamespacedName":return S(":").join([e.call(n,"namespace"),e.call(n,"name")]);case"JSXMemberExpression":return S(".").join([e.call(n,"object"),e.call(n,"property")]);case"JSXSpreadAttribute":return w(["{...",e.call(n,"argument"),"}"]);case"JSXExpressionContainer":return w(["{",e.call(n,"expression"),"}"]);case"JSXElement":var Y=e.call(n,"openingElement");if(r.openingElement.selfClosing)return A.ok(!r.closingElement),Y;return w([Y,w(e.map(function(e){var t=e.getValue();if(P.Literal.check(t)&&"string"==typeof t.value){if(/\S/.test(t.value))return t.value.replace(/^\s+|\s+$/g,"");if(/\n/.test(t.value))return"\n"}return n(e)},"children")).indentTail(t.tabWidth),e.call(n,"closingElement")]);case"JSXOpeningElement":i.push("<",e.call(n,"name"));var H=[];e.each(function(e){H.push(" ",n(e))},"attributes");var $=w(H);return($.length>1||$.getLineLength(1)>t.wrapColumn)&&(H.forEach(function(e,t){" "===e&&(A.strictEqual(t%2,0),H[t]="\n")}),$=w(H).indentTail(t.tabWidth)),i.push($,r.selfClosing?" />":">"),w(i);case"JSXClosingElement":return w([""]);case"JSXText":return S(r.value,t);case"JSXEmptyExpression":return S("");case"TypeAnnotatedIdentifier":return w([e.call(n,"annotation")," ",e.call(n,"identifier")]);case"ClassBody":return 0===r.body.length?S("{}"):w(["{\n",e.call(function(e){return u(e,t,n)},"body").indent(t.tabWidth),"\n}"]);case"ClassPropertyDefinition":return i.push("static ",e.call(n,"definition")),P.MethodDefinition.check(r.definition)||i.push(";"),w(i);case"ClassProperty":r.static&&i.push("static ");var O=e.call(n,"key");return r.computed?O=w(["[",O,"]"]):"plus"===r.variance?O=w(["+",O]):"minus"===r.variance&&(O=w(["-",O])),i.push(O),r.typeAnnotation&&i.push(e.call(n,"typeAnnotation")),r.value&&i.push(" = ",e.call(n,"value")),i.push(";"),w(i);case"ClassDeclaration":case"ClassExpression":return i.push("class"),r.id&&i.push(" ",e.call(n,"id"),e.call(n,"typeParameters")),r.superClass&&i.push(" extends ",e.call(n,"superClass"),e.call(n,"superTypeParameters")),r.implements&&r.implements.length>0&&i.push(" implements ",S(", ").join(e.map(n,"implements"))),i.push(" ",e.call(n,"body")),w(i);case"TemplateElement":return S(r.value.raw,t).lockIndentTail();case"TemplateLiteral":var Q=e.map(n,"expressions");return i.push("`"),e.each(function(e){var t=e.getName();i.push(n(e)),t ":": ",e.call(n,"returnType")),w(i);case"FunctionTypeParam":return w([e.call(n,"name"),r.optional?"?":"",": ",e.call(n,"typeAnnotation")]);case"GenericTypeAnnotation":return w([e.call(n,"id"),e.call(n,"typeParameters")]);case"DeclareInterface":i.push("declare ");case"InterfaceDeclaration":return i.push(S("interface ",t),e.call(n,"id"),e.call(n,"typeParameters")," "),r.extends&&i.push("extends ",S(", ").join(e.map(n,"extends"))),i.push(" ",e.call(n,"body")),w(i);case"ClassImplements":case"InterfaceExtends":return w([e.call(n,"id"),e.call(n,"typeParameters")]);case"IntersectionTypeAnnotation":return S(" & ").join(e.map(n,"types"));case"NullableTypeAnnotation":return w(["?",e.call(n,"typeAnnotation")]);case"NullLiteralTypeAnnotation":return S("null",t);case"ThisTypeAnnotation":return S("this",t);case"NumberTypeAnnotation":return S("number",t);case"ObjectTypeCallProperty":return e.call(n,"value");case"ObjectTypeIndexer":var te="plus"===r.variance?"+":"minus"===r.variance?"-":"";return w([te,"[",e.call(n,"id"),": ",e.call(n,"key"),"]: ",e.call(n,"value")]);case"ObjectTypeProperty":var te="plus"===r.variance?"+":"minus"===r.variance?"-":"";return w([te,e.call(n,"key"),r.optional?"?":"",": ",e.call(n,"value")]);case"QualifiedTypeIdentifier":return w([e.call(n,"qualification"),".",e.call(n,"id")]);case"StringLiteralTypeAnnotation":return S(_(r.value,t),t);case"NumberLiteralTypeAnnotation":return A.strictEqual(typeof r.value,"number"),S(""+r.value,t);case"StringTypeAnnotation":return S("string",t);case"DeclareTypeAlias":i.push("declare ");case"TypeAlias":return w(["type ",e.call(n,"id"),e.call(n,"typeParameters")," = ",e.call(n,"right"),";"]);case"TypeCastExpression":return w(["(",e.call(n,"expression"),e.call(n,"typeAnnotation"),")"]);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return w(["<",S(", ").join(e.map(n,"params")),">"]);case"TypeParameter":switch(r.variance){case"plus":i.push("+");break;case"minus":i.push("-")}return i.push(e.call(n,"name")),r.bound&&i.push(e.call(n,"bound")),r.default&&i.push("=",e.call(n,"default")),w(i);case"TypeofTypeAnnotation":return w([S("typeof ",t),e.call(n,"argument")]);case"UnionTypeAnnotation":return S(" | ").join(e.map(n,"types"));case"VoidTypeAnnotation":return S("void",t);case"NullTypeAnnotation":return S("null",t);case"ClassHeritage":case"ComprehensionBlock":case"ComprehensionExpression":case"Glob":case"GeneratorExpression":case"LetStatement":case"LetExpression":case"GraphExpression":case"GraphIndexExpression":case"XMLDefaultDeclaration":case"XMLAnyName":case"XMLQualifiedIdentifier":case"XMLFunctionQualifiedIdentifier":case"XMLAttributeSelector":case"XMLFilterExpression":case"XML":case"XMLElement":case"XMLList":case"XMLEscape":case"XMLText":case"XMLStartTag":case"XMLEndTag":case"XMLPointTag":case"XMLName":case"XMLAttribute":case"XMLCdata":case"XMLComment":case"XMLProcessingInstruction":default:throw new Error("unknown type: "+JSON.stringify(r.type))}return p}function u(e,t,n){var r=(P.ClassBody&&P.ClassBody.check(e.getParentNode()),[]),i=!1,a=!1;e.each(function(e){var t=(e.getName(),e.getValue());t&&"EmptyStatement"!==t.type&&(P.Comment.check(t)?i=!0:P.Statement.check(t)?a=!0:j.assert(t),r.push({node:t,printed:n(e)}))}),i&&A.strictEqual(a,!1,"Comments may appear as statements in otherwise empty statement lists, but may not coexist with non-Comment nodes.");var s=null,o=r.length,u=[];return r.forEach(function(e,n){var r,i,a=e.printed,c=e.node,p=a.length>1,f=n>0,h=nn.length?r:n}function c(e,t,n){var r=e.getNode(),i=r.kind,a=[];"ObjectMethod"===r.type||"ClassMethod"===r.type?r.value=r:P.FunctionExpression.assert(r.value),r.value.async&&a.push("async "),i&&"init"!==i&&"method"!==i&&"constructor"!==i?(A.ok("get"===i||"set"===i),a.push(i," ")):r.value.generator&&a.push("*");var s=e.call(n,"key");return r.computed&&(s=w(["[",s,"]"])),a.push(s,e.call(n,"value","typeParameters"),"(",e.call(function(e){return h(e,t,n)},"value"),")",e.call(n,"value","returnType")," ",e.call(n,"value","body")),w(a)}function f(e,t,n){var r=e.map(n,"arguments"),i=I.isTrailingCommaEnabled(t,"parameters"),a=S(", ").join(r);return a.getLineLength(1)>t.wrapColumn?(a=S(",\n").join(r),w(["(\n",a.indent(t.tabWidth),i?",\n)":"\n)"])):w(["(",a,")"])}function h(e,t,n){var r=e.getValue();P.Function.assert(r);var i=e.map(n,"params");r.defaults&&e.each(function(e){var t=e.getName(),r=i[t];r&&e.getValue()&&(i[t]=w([r," = ",n(e)]))},"defaults"),r.rest&&i.push(w(["...",e.call(n,"rest")]));var a=S(", ").join(i);return a.length>1||a.getLineLength(1)>t.wrapColumn?(a=S(",\n").join(i),a=w(I.isTrailingCommaEnabled(t,"parameters")&&!r.rest&&"RestElement"!==r.params[r.params.length-1].type?[a,",\n"]:[a,"\n"]),w(["\n",a.indent(t.tabWidth)])):a}function d(e,t,n){var r=e.getValue(),i=[];if(r.async&&i.push("async "),r.generator&&i.push("*"),r.method||"get"===r.kind||"set"===r.kind)return c(e,t,n);var a=e.call(n,"key");return r.computed?i.push("[",a,"]"):i.push(a),i.push("(",h(e,t,n),")",e.call(n,"returnType")," ",e.call(n,"body")),w(i)}function y(e,t,n){var r=e.getValue(),i=["export "],a=t.objectCurlySpacing;P.Declaration.assert(r),(r.default||"ExportDefaultDeclaration"===r.type)&&i.push("default "),r.declaration?i.push(e.call(n,"declaration")):r.specifiers&&r.specifiers.length>0&&(1===r.specifiers.length&&"ExportBatchSpecifier"===r.specifiers[0].type?i.push("*"):i.push(a?"{ ":"{",S(", ").join(e.map(n,"specifiers")),a?" }":"}"),r.source&&i.push(" from ",e.call(n,"source")));var s=w(i);return";"===g(s)||r.declaration&&("FunctionDeclaration"===r.declaration.type||"ClassDeclaration"===r.declaration.type)||(s=w([s,";"])),s}function m(e,t){var n=I.getParentExportDeclaration(e);return n?A.strictEqual(n.type,"DeclareExportDeclaration"):t.unshift("declare "),w(t)}function b(e,t){return w(e.length>1?[" ",e]:["\n",E(e).indent(t.tabWidth)])}function g(e){var t=e.lastPos();do{var n=e.charAt(t);if(/\S/.test(n))return n}while(e.prevPos(t))}function v(e){return"}"===g(e)}function x(e){return e.replace(/['"]/g,function(e){return'"'===e?"'":'"'})}function _(e,t){switch(j.assert(e),t.quote){case"auto":var n=JSON.stringify(e),r=x(JSON.stringify(x(e)));return n.length>r.length?r:n;case"single":return x(JSON.stringify(x(e)));case"double":default:return JSON.stringify(e)}}function E(e){var t=g(e);return!t||"\n};".indexOf(t)<0?w([e,";"]):e}var A=e("assert"),D=(e("source-map"),e("./comments").printComments),C=e("./lines"),S=C.fromString,w=C.concat,k=e("./options").normalize,F=e("./patcher").getReprinter,T=e("./types"),P=T.namedTypes,j=T.builtInTypes.string,B=T.builtInTypes.object,O=e("./fast-path"),I=e("./util"),N=r.prototype,L=!1;N.toString=function(){return L||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),L=!0),this.code};var M=new r("");n.Printer=i},{"./comments":529,"./fast-path":530,"./lines":531,"./options":533,"./patcher":535,"./types":537,"./util":538,assert:2,"source-map":571}],537:[function(e,t,n){t.exports=e("ast-types")},{"ast-types":558}],538:[function(e,t,n){function r(){for(var e={},t=arguments.length,n=0;n",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof","..");i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",c).field("left",i("Expression")).field("right",i("Expression"));var p=a("=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&=");i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",p).field("left",i("Pattern")).field("right",i("Expression"));var f=a("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",i("Expression")).field("prefix",Boolean);var h=a("||","&&");i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",a(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var e=this.property.type;return"Literal"===e||"MemberExpression"===e||"BinaryExpression"===e}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",a(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Node","Expression","Pattern").build("name").field("name",String),i("Literal").bases("Node","Expression").build("value").field("value",a(String,Boolean,null,Number,RegExp)).field("regex",a({pattern:String,flags:String},null),function(){if(this.value instanceof RegExp){var e="";return this.value.ignoreCase&&(e+="i"),this.value.multiline&&(e+="m"),this.value.global&&(e+="g"),{pattern:this.value.source,flags:e}}return null}),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}},{"../lib/shared":556,"../lib/types":557}],543:[function(e,t,n){t.exports=function(t){t.use(e("./core"));var n=t.use(e("../lib/types")),r=n.Type.def,i=n.Type.or;r("XMLDefaultDeclaration").bases("Declaration").field("namespace",r("Expression")),r("XMLAnyName").bases("Expression"),r("XMLQualifiedIdentifier").bases("Expression").field("left",i(r("Identifier"),r("XMLAnyName"))).field("right",i(r("Identifier"),r("Expression"))).field("computed",Boolean),r("XMLFunctionQualifiedIdentifier").bases("Expression").field("right",i(r("Identifier"),r("Expression"))).field("computed",Boolean),r("XMLAttributeSelector").bases("Expression").field("attribute",r("Expression")),r("XMLFilterExpression").bases("Expression").field("left",r("Expression")).field("right",r("Expression")),r("XMLElement").bases("XML","Expression").field("contents",[r("XML")]),r("XMLList").bases("XML","Expression").field("contents",[r("XML")]),r("XML").bases("Node"),r("XMLEscape").bases("XML").field("expression",r("Expression")),r("XMLText").bases("XML").field("text",String),r("XMLStartTag").bases("XML").field("contents",[r("XML")]),r("XMLEndTag").bases("XML").field("contents",[r("XML")]),r("XMLPointTag").bases("XML").field("contents",[r("XML")]),r("XMLName").bases("XML").field("contents",i(String,[r("XML")])),r("XMLAttribute").bases("XML").field("value",String),r("XMLCdata").bases("XML").field("contents",String),r("XMLComment").bases("XML").field("contents",String),r("XMLProcessingInstruction").bases("XML").field("target",String).field("contents",i(String,null))}},{"../lib/types":557,"./core":542}],544:[function(e,t,n){t.exports=function(t){t.use(e("./core"));var n=t.use(e("../lib/types")),r=n.Type.def,i=n.Type.or,a=t.use(e("../lib/shared")).defaults;r("Function").field("generator",Boolean,a.false).field("expression",Boolean,a.false).field("defaults",[i(r("Expression"),null)],a.emptyArray).field("rest",i(r("Identifier"),null),a.null),r("RestElement").bases("Pattern").build("argument").field("argument",r("Pattern")),r("SpreadElementPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("FunctionDeclaration").build("id","params","body","generator","expression"),r("FunctionExpression").build("id","params","body","generator","expression"),r("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,a.null).field("body",i(r("BlockStatement"),r("Expression"))).field("generator",!1,a.false),r("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(r("Expression"),null)).field("delegate",Boolean,a.false),r("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionBlock").bases("Node").build("left","right","each").field("left",r("Pattern")).field("right",r("Expression")).field("each",Boolean),r("Property").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("value",i(r("Expression"),r("Pattern"))).field("method",Boolean,a.false).field("shorthand",Boolean,a.false).field("computed",Boolean,a.false),r("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("pattern",r("Pattern")).field("computed",Boolean,a.false),r("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(r("PropertyPattern"),r("Property"))]),r("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(r("Pattern"),null)]),r("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("value",r("Function")).field("computed",Boolean,a.false).field("static",Boolean,a.false),r("SpreadElement").bases("Node").build("argument").field("argument",r("Expression")),r("ArrayExpression").field("elements",[i(r("Expression"),r("SpreadElement"),r("RestElement"),null)]),r("NewExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("CallExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("AssignmentPattern").bases("Pattern").build("left","right").field("left",r("Pattern")).field("right",r("Expression"));var s=i(r("MethodDefinition"),r("VariableDeclarator"),r("ClassPropertyDefinition"),r("ClassProperty"));r("ClassProperty").bases("Declaration").build("key").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("computed",Boolean,a.false),r("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",s),r("ClassBody").bases("Declaration").build("body").field("body",[s]),r("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(r("Identifier"),null)).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),a.null),r("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(r("Identifier"),null),a.null).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),a.null).field("implements",[r("ClassImplements")],a.emptyArray),r("ClassImplements").bases("Node").build("id").field("id",r("Identifier")).field("superClass",i(r("Expression"),null),a.null),r("Specifier").bases("Node"),r("ModuleSpecifier").bases("Specifier").field("local",i(r("Identifier"),null),a.null).field("id",i(r("Identifier"),null),a.null).field("name",i(r("Identifier"),null),a.null),r("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",r("Expression")).field("quasi",r("TemplateLiteral")),r("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[r("TemplateElement")]).field("expressions",[r("Expression")]),r("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean)}},{"../lib/shared":556,"../lib/types":557,"./core":542}],545:[function(e,t,n){t.exports=function(t){t.use(e("./es6"));var n=t.use(e("../lib/types")),r=n.Type.def,i=n.Type.or,a=(n.builtInTypes,t.use(e("../lib/shared")).defaults);r("Function").field("async",Boolean,a.false),r("SpreadProperty").bases("Node").build("argument").field("argument",r("Expression")),r("ObjectExpression").field("properties",[i(r("Property"),r("SpreadProperty"))]),r("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("ObjectPattern").field("properties",[i(r("Property"),r("PropertyPattern"),r("SpreadPropertyPattern"))]),r("AwaitExpression").bases("Expression").build("argument","all").field("argument",i(r("Expression"),null)).field("all",Boolean,a.false)}},{"../lib/shared":556,"../lib/types":557,"./es6":544}],546:[function(e,t,n){t.exports=function(t){t.use(e("./es7"));var n=t.use(e("../lib/types")),r=t.use(e("../lib/shared")).defaults,i=n.Type.def,a=n.Type.or;i("VariableDeclaration").field("declarations",[a(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",a(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[a(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[a(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ImportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("id"),i("ImportDefaultSpecifier").bases("ModuleSpecifier").build("id"),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",a(i("Declaration"),i("Expression"),null)).field("specifiers",[a(i("ExportSpecifier"),i("ExportBatchSpecifier"))],r.emptyArray).field("source",a(i("Literal"),null),r.null),i("ImportDeclaration").bases("Declaration").build("specifiers","source").field("specifiers",[a(i("ImportSpecifier"),i("ImportNamespaceSpecifier"),i("ImportDefaultSpecifier"))],r.emptyArray).field("source",i("Literal")),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}},{"../lib/shared":556,"../lib/types":557,"./es7":545}],547:[function(e,t,n){t.exports=function(t){t.use(e("./es7"));var n=t.use(e("../lib/types")),r=n.Type.def,i=n.Type.or,a=t.use(e("../lib/shared")).defaults;r("Type").bases("Node"),r("AnyTypeAnnotation").bases("Type").build(),r("EmptyTypeAnnotation").bases("Type").build(),r("MixedTypeAnnotation").bases("Type").build(),r("VoidTypeAnnotation").bases("Type").build(),r("NumberTypeAnnotation").bases("Type").build(),r("NumberLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Number).field("raw",String),r("StringTypeAnnotation").bases("Type").build(),r("StringLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",String).field("raw",String),r("BooleanTypeAnnotation").bases("Type").build(),r("BooleanLiteralTypeAnnotation").bases("Type").build("value","raw").field("value",Boolean).field("raw",String),r("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r("Type")),r("NullableTypeAnnotation").bases("Type").build("typeAnnotation").field("typeAnnotation",r("Type")),r("NullLiteralTypeAnnotation").bases("Type").build(),r("NullTypeAnnotation").bases("Type").build(),r("ThisTypeAnnotation").bases("Type").build(),r("ExistsTypeAnnotation").bases("Type").build(),r("ExistentialTypeParam").bases("Type").build(),r("FunctionTypeAnnotation").bases("Type").build("params","returnType","rest","typeParameters").field("params",[r("FunctionTypeParam")]).field("returnType",r("Type")).field("rest",i(r("FunctionTypeParam"),null)).field("typeParameters",i(r("TypeParameterDeclaration"),null)),r("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",r("Identifier")).field("typeAnnotation",r("Type")).field("optional",Boolean),r("ArrayTypeAnnotation").bases("Type").build("elementType").field("elementType",r("Type")),r("ObjectTypeAnnotation").bases("Type").build("properties","indexers","callProperties").field("properties",[r("ObjectTypeProperty")]).field("indexers",[r("ObjectTypeIndexer")],a.emptyArray).field("callProperties",[r("ObjectTypeCallProperty")],a.emptyArray).field("exact",Boolean,a.false),r("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(r("Literal"),r("Identifier"))).field("value",r("Type")).field("optional",Boolean).field("variance",i("plus","minus",null),a.null),r("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",r("Identifier")).field("key",r("Type")).field("value",r("Type")).field("variance",i("plus","minus",null),a.null),r("ObjectTypeCallProperty").bases("Node").build("value").field("value",r("FunctionTypeAnnotation")).field("static",Boolean,a.false),r("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("id",r("Identifier")),r("GenericTypeAnnotation").bases("Type").build("id","typeParameters").field("id",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("typeParameters",i(r("TypeParameterInstantiation"),null)),r("MemberTypeAnnotation").bases("Type").build("object","property").field("object",r("Identifier")).field("property",i(r("MemberTypeAnnotation"),r("GenericTypeAnnotation"))),r("UnionTypeAnnotation").bases("Type").build("types").field("types",[r("Type")]),r("IntersectionTypeAnnotation").bases("Type").build("types").field("types",[r("Type")]),r("TypeofTypeAnnotation").bases("Type").build("argument").field("argument",r("Type")),r("Identifier").field("typeAnnotation",i(r("TypeAnnotation"),null),a.null),r("TypeParameterDeclaration").bases("Node").build("params").field("params",[r("TypeParameter")]),r("TypeParameterInstantiation").bases("Node").build("params").field("params",[r("Type")]),r("TypeParameter").bases("Type").build("name","variance","bound").field("name",String).field("variance",i("plus","minus",null),a.null).field("bound",i(r("TypeAnnotation"),null),a.null),r("Function").field("returnType",i(r("TypeAnnotation"),null),a.null).field("typeParameters",i(r("TypeParameterDeclaration"),null),a.null),r("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(r("Expression"),null)).field("typeAnnotation",i(r("TypeAnnotation"),null)).field("static",Boolean,a.false).field("variance",i("plus","minus",null),a.null),r("ClassImplements").field("typeParameters",i(r("TypeParameterInstantiation"),null),a.null),r("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null),a.null).field("body",r("ObjectTypeAnnotation")).field("extends",[r("InterfaceExtends")]),r("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),r("InterfaceExtends").bases("Node").build("id").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterInstantiation"),null)),r("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("right",r("Type")),r("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),r("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",r("Expression")).field("typeAnnotation",r("TypeAnnotation")),r("TupleTypeAnnotation").bases("Type").build("types").field("types",[r("Type")]),r("DeclareVariable").bases("Statement").build("id").field("id",r("Identifier")),r("DeclareFunction").bases("Statement").build("id").field("id",r("Identifier")),r("DeclareClass").bases("InterfaceDeclaration").build("id"),r("DeclareModule").bases("Statement").build("id","body").field("id",i(r("Identifier"),r("Literal"))).field("body",r("BlockStatement")),r("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",r("Type")),r("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(r("DeclareVariable"),r("DeclareFunction"),r("DeclareClass"),r("Type"),null)).field("specifiers",[i(r("ExportSpecifier"),r("ExportBatchSpecifier"))],a.emptyArray).field("source",i(r("Literal"),null),a.null)}},{"../lib/shared":556,"../lib/types":557,"./es7":545}],548:[function(e,t,n){t.exports=function(t){t.use(e("./es7"));var n=t.use(e("../lib/types")),r=n.Type.def,i=n.Type.or,a=t.use(e("../lib/shared")).defaults;r("JSXAttribute").bases("Node").build("name","value").field("name",i(r("JSXIdentifier"),r("JSXNamespacedName"))).field("value",i(r("Literal"),r("JSXExpressionContainer"),null),a.null),r("JSXIdentifier").bases("Identifier").build("name").field("name",String),r("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",r("JSXIdentifier")).field("name",r("JSXIdentifier")),r("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(r("JSXIdentifier"),r("JSXMemberExpression"))).field("property",r("JSXIdentifier")).field("computed",Boolean,a.false);var s=i(r("JSXIdentifier"),r("JSXNamespacedName"),r("JSXMemberExpression"));r("JSXSpreadAttribute").bases("Node").build("argument").field("argument",r("Expression"));var o=[i(r("JSXAttribute"),r("JSXSpreadAttribute"))];r("JSXExpressionContainer").bases("Expression").build("expression").field("expression",r("Expression")),r("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",r("JSXOpeningElement")).field("closingElement",i(r("JSXClosingElement"),null),a.null).field("children",[i(r("JSXElement"),r("JSXExpressionContainer"),r("JSXText"),r("Literal"))],a.emptyArray).field("name",s,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),r("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",s).field("attributes",o,a.emptyArray).field("selfClosing",Boolean,a.false),r("JSXClosingElement").bases("Node").build("name").field("name",s),r("JSXText").bases("Literal").build("value").field("value",String),r("JSXEmptyExpression").bases("Expression").build()}},{"../lib/shared":556,"../lib/types":557,"./es7":545}],549:[function(e,t,n){t.exports=function(t){t.use(e("./core"));var n=t.use(e("../lib/types")),r=n.Type.def,i=n.Type.or,a=t.use(e("../lib/shared")),s=a.geq,o=a.defaults;r("Function").field("body",i(r("BlockStatement"),r("Expression"))),r("ForInStatement").build("left","right","body","each").field("each",Boolean,o.false),r("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(r("VariableDeclaration"),r("Expression"))).field("right",r("Expression")).field("body",r("Statement")),r("LetStatement").bases("Statement").build("head","body").field("head",[r("VariableDeclarator")]).field("body",r("Statement")),r("LetExpression").bases("Expression").build("head","body").field("head",[r("VariableDeclarator")]).field("body",r("Expression")),r("GraphExpression").bases("Expression").build("index","expression").field("index",s(0)).field("expression",r("Literal")),r("GraphIndexExpression").bases("Expression").build("index").field("index",s(0))}},{"../lib/shared":556,"../lib/types":557,"./core":542}],550:[function(e,t,n){t.exports=function(t){function n(e){var t=r.indexOf(e);return t===-1&&(t=r.length,r.push(e),i[t]=e(a)),i[t]}var r=[],i=[],a={};a.use=n;var s=n(e("./lib/types"));t.forEach(n),s.finalize();var o={Type:s.Type,builtInTypes:s.builtInTypes,namedTypes:s.namedTypes,builders:s.builders,defineMethod:s.defineMethod,getFieldNames:s.getFieldNames,getFieldValue:s.getFieldValue,eachField:s.eachField,someField:s.someField,getSupertypeNames:s.getSupertypeNames,astNodesAreEquivalent:n(e("./lib/equiv")),finalize:s.finalize,Path:n(e("./lib/path")),NodePath:n(e("./lib/node-path")),PathVisitor:n(e("./lib/path-visitor")),use:n};return o.visit=o.PathVisitor.visit,o}},{"./lib/equiv":551,"./lib/node-path":552,"./lib/path":554,"./lib/path-visitor":553,"./lib/types":557}],551:[function(e,t,n){t.exports=function(t){function n(e,t,n){return c.check(n)?n.length=0:n=null,i(e,t,n)}function r(e){return/[_$a-z][_$a-z0-9]*/i.test(e)?"."+e:"["+JSON.stringify(e)+"]"}function i(e,t,n){return e===t||(c.check(e)?a(e,t,n):p.check(e)?s(e,t,n):f.check(e)?f.check(t)&&+e===+t:h.check(e)?h.check(t)&&e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.ignoreCase===t.ignoreCase:e==t)}function a(e,t,n){c.assert(e);var r=e.length;if(!c.check(t)||t.length!==r)return n&&n.push("length"),!1;for(var a=0;ao)return!0;if(t===o&&"right"===this.name){if(r.right!==n)throw new Error("Nodes must be equal");return!0}default:return!1}case"SequenceExpression":switch(r.type){case"ForStatement":return!1;case"ExpressionStatement":return"expression"!==this.name;default:return!0}case"YieldExpression":switch(r.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return"MemberExpression"===r.type&&p.check(n.value)&&"object"===this.name&&r.object===n;case"AssignmentExpression":case"ConditionalExpression":switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return"callee"===this.name&&r.callee===n;case"ConditionalExpression":return"test"===this.name&&r.test===n;case"MemberExpression":return"object"===this.name&&r.object===n;default:return!1}default:if("NewExpression"===r.type&&"callee"===this.name&&r.callee===n)return i(n)}return!(e===!0||this.canBeFirstInStatement()||!this.firstInStatement())};var m={};return[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(e,t){e.forEach(function(e){m[e]=t})}),y.canBeFirstInStatement=function(){var e=this.node;return!l.FunctionExpression.check(e)&&!l.ObjectExpression.check(e)},y.firstInStatement=function(){return a(this)},n}},{"./path":554,"./scope":555,"./types":557}],553:[function(e,t,n){var r=Object.prototype.hasOwnProperty;t.exports=function(t){function n(){if(!(this instanceof n))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=i(this),this._shouldVisitComments=r.call(this._methodNameTable,"Block")||r.call(this._methodNameTable,"Line"),this.Context=o(this),this._visiting=!1,this._changeReported=!1}function i(e){var t=Object.create(null);for(var n in e)/^visit[A-Z]/.test(n)&&(t[n.slice("visit".length)]=!0);for(var r=l.computeSupertypeLookupTable(t),i=Object.create(null),t=Object.keys(r),a=t.length,s=0;s=0&&(a[e.name=s]=e)}else i[e.name]=e.value,a[e.name]=e;if(i[e.name]!==e.value)throw new Error("");if(e.parentPath.get(e.name)!==e)throw new Error("");return e}var l=t.use(e("./types")),c=l.builtInTypes.array,p=l.builtInTypes.number,f=n.prototype;return f.getValueProperty=function(e){return this.value[e]},f.get=function(e){for(var t=this,n=arguments,r=n.length,a=0;a=e},s+" >= "+e)},n.defaults={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){}};var o=i.or(a.string,a.number,a.boolean,a.null,a.undefined);return n.isPrimitive=new i(function(e){if(null===e)return!0;var t=typeof e;return!("object"===t||"function"===t)},o.toString()),n}},{"../lib/types":557}],557:[function(e,t,n){var r=Array.prototype,i=r.slice,a=(r.map,r.forEach,Object.prototype),s=a.toString,o=s.call(function(){}),u=s.call(""),l=a.hasOwnProperty;t.exports=function(){function e(t,n){var r=this;if(!(r instanceof e))throw new Error("Type constructor cannot be invoked without 'new'");if(s.call(t)!==o)throw new Error(t+" is not a function");var i=s.call(n);if(i!==o&&i!==u)throw new Error(n+" is neither a function nor a string");Object.defineProperties(r,{name:{value:n},check:{value:function(e,n){var i=t.call(r,e,n);return!i&&n&&s.call(n)===o&&n(r,e),i}}})}function t(e){return S.check(e)?"{"+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+"}":C.check(e)?"["+e.map(t).join(", ")+"]":JSON.stringify(e)}function n(t,n){var r=s.call(t),i=new e(function(e){return s.call(e)===r},n);return E[n]=i,t&&"function"==typeof t.constructor&&(x.push(t.constructor),_.push(i)),i}function r(t,n){if(t instanceof e)return t;if(t instanceof c)return t.type;if(C.check(t))return e.fromArray(t);if(S.check(t))return e.fromObject(t);if(D.check(t)){var r=x.indexOf(t);return r>=0?_[r]:new e(t,n)}return new e(function(e){return e===t},k.check(n)?function(){return t+""}:n)}function a(e,t,n,i){var s=this;if(!(s instanceof a))throw new Error("Field constructor cannot be invoked without 'new'");A.assert(e),t=r(t);var o={name:{value:e},type:{value:t},hidden:{value:!!i}};D.check(n)&&(o.defaultFn={value:n}),Object.defineProperties(s,o)}function c(t){var n=this;if(!(n instanceof c))throw new Error("Def constructor cannot be invoked without 'new'");Object.defineProperties(n,{typeName:{value:t},baseNames:{value:[]},ownFields:{value:Object.create(null)},allSupertypes:{value:Object.create(null)},supertypeList:{value:[]},allFields:{value:Object.create(null)},fieldNames:{value:[]},type:{value:new e(function(e,t){return n.check(e,t)},t)}})}function p(e){return e.replace(/^[A-Z]+/,function(e){var t=e.length;switch(t){case 0:return"";case 1:return e.toLowerCase();default:return e.slice(0,t-1).toLowerCase()+e.charAt(t-1)}})}function f(e){return e=p(e),e.replace(/(Expression)?$/,"Statement")}function h(e){var t=c.fromValue(e);if(t)return t.fieldNames.slice(0);if("type"in e)throw new Error("did not recognize object of type "+JSON.stringify(e.type));return Object.keys(e)}function d(e,t){var n=c.fromValue(e);if(n){var r=n.allFields[t];if(r)return r.getValue(e)}return e&&e[t]}function y(e){var t=f(e);if(!j[t]){var n=j[p(e)];n&&(j[t]=function(){return j.expressionStatement(n.apply(j,arguments))})}}function m(e,t){t.length=0,t.push(e);for(var n=Object.create(null),r=0;r=0&&y(e.typeName)}},g.finalize=function(){Object.keys(T).forEach(function(e){T[e].finalize()})},g}},{}],558:[function(e,t,n){t.exports=e("./fork")([e("./def/core"),e("./def/es6"),e("./def/es7"),e("./def/mozilla"),e("./def/e4x"),e("./def/jsx"),e("./def/flow"),e("./def/esprima"),e("./def/babel"),e("./def/babel6")])},{"./def/babel":540,"./def/babel6":541,"./def/core":542,"./def/e4x":543,"./def/es6":544,"./def/es7":545,"./def/esprima":546,"./def/flow":547,"./def/jsx":548,"./def/mozilla":549,"./fork":550}],559:[function(e,t,n){!function(e,r){"object"==typeof n&&"object"==typeof t?t.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof n?n.esprima=r():e.esprima=r()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e,t,n){var r=null,i=function(e,t){n&&n(e,t),r&&r.visit(e,t)},u="function"==typeof n?i:null,l=!1;if(t){l="boolean"==typeof t.comment&&t.comment;var c="boolean"==typeof t.attachComment&&t.attachComment;(l||c)&&(r=new a.CommentHandler,r.attach=c,t.comment=!0,u=i)}var p;p=t&&"boolean"==typeof t.jsx&&t.jsx?new o.JSXParser(e,t,u):new s.Parser(e,t,u);var f=p.parseProgram();return l&&(f.comments=r.comments),p.config.tokens&&(f.tokens=p.tokens),p.config.tolerant&&(f.errors=p.errorHandler.errors),f}function i(e,t,n){var r,i=new u.Tokenizer(e,t);r=[];try{for(;;){var a=i.getNextToken();if(!a)break;n&&(a=n(a)),r.push(a)}}catch(e){i.errorHandler.tolerate(e)}return i.errorHandler.tolerant&&(r.errors=i.errors()),r}var a=n(1),s=n(3),o=n(11),u=n(15);t.parse=r,t.tokenize=i;var l=n(2);t.Syntax=l.Syntax,t.version="3.1.3"},function(e,t,n){"use strict";var r=n(2),i=function(){function e(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return e.prototype.insertInnerComments=function(e,t){if(e.type===r.Syntax.BlockStatement&&0===e.body.length){for(var n=[],i=this.leading.length-1;i>=0;--i){var a=this.leading[i];t.end.offset>=a.start&&(n.unshift(a.comment),this.leading.splice(i,1),this.trailing.splice(i,1))}n.length&&(e.innerComments=n)}},e.prototype.findTrailingComments=function(e,t){var n=[];if(this.trailing.length>0){for(var r=this.trailing.length-1;r>=0;--r){var i=this.trailing[r];i.start>=t.end.offset&&n.unshift(i.comment)}return this.trailing.length=0,n}var a=this.stack[this.stack.length-1];if(a&&a.node.trailingComments){var s=a.node.trailingComments[0];s&&s.range[0]>=t.end.offset&&(n=a.node.trailingComments,delete a.node.trailingComments)}return n},e.prototype.findLeadingComments=function(e,t){for(var n,r=[];this.stack.length>0;){var i=this.stack[this.stack.length-1];if(!(i&&i.start>=t.start.offset))break;n=this.stack.pop().node}if(n){for(var a=n.leadingComments?n.leadingComments.length:0,s=a-1;s>=0;--s){var o=n.leadingComments[s];o.range[1]<=t.start.offset&&(r.unshift(o),n.leadingComments.splice(s,1))}return n.leadingComments&&0===n.leadingComments.length&&delete n.leadingComments,r}for(var s=this.leading.length-1;s>=0;--s){var i=this.leading[s];i.start<=t.start.offset&&(r.unshift(i.comment),this.leading.splice(s,1))}return r},e.prototype.visitNode=function(e,t){if(!(e.type===r.Syntax.Program&&e.body.length>0)){this.insertInnerComments(e,t);var n=this.findTrailingComments(e,t),i=this.findLeadingComments(e,t);i.length>0&&(e.leadingComments=i),n.length>0&&(e.trailingComments=n),this.stack.push({node:e,start:t.start.offset})}},e.prototype.visitComment=function(e,t){var n="L"===e.type[0]?"Line":"Block",r={type:n,value:e.value};if(e.range&&(r.range=e.range),e.loc&&(r.loc=e.loc),this.comments.push(r),this.attach){var i={comment:{type:n,value:e.value,range:[t.start.offset,t.end.offset]},start:t.start.offset};e.loc&&(i.comment.loc=e.loc),e.type=n,this.leading.push(i),this.trailing.push(i)}},e.prototype.visit=function(e,t){"LineComment"===e.type?this.visitComment(e,t):"BlockComment"===e.type?this.visitComment(e,t):this.attach&&this.visitNode(e,t)},e}();t.CommentHandler=i},function(e,t){"use strict";t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,n){"use strict";var r=n(4),i=n(5),a=n(6),s=n(7),o=n(8),u=n(2),l=n(10),c="ArrowParameterPlaceHolder",p=function(){function e(e,t,n){void 0===t&&(t={}),this.config={range:"boolean"==typeof t.range&&t.range,loc:"boolean"==typeof t.loc&&t.loc,source:null,tokens:"boolean"==typeof t.tokens&&t.tokens,comment:"boolean"==typeof t.comment&&t.comment,tolerant:"boolean"==typeof t.tolerant&&t.tolerant},this.config.loc&&t.source&&null!==t.source&&(this.config.source=String(t.source)),this.delegate=n,this.errorHandler=new a.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new o.Scanner(e,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.sourceType=t&&"module"===t.sourceType?"module":"script",this.lookahead=null,this.hasLineTerminator=!1,this.context={allowIn:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:"module"===this.sourceType},this.tokens=[],this.startMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.lastMarker={index:0,lineNumber:this.scanner.lineNumber,lineStart:0},this.nextToken(),this.lastMarker={index:this.scanner.index,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart}}return e.prototype.throwError=function(e){for(var t=[],n=1;n0&&this.delegate)for(var t=0;t>="===e||">>>="===e||"&="===e||"^="===e||"|="===e},e.prototype.isolateCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return null!==this.context.firstCoverInitializedNameError&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=t,this.context.isAssignmentTarget=n,this.context.firstCoverInitializedNameError=r,i},e.prototype.inheritCoverGrammar=function(e){var t=this.context.isBindingElement,n=this.context.isAssignmentTarget,r=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var i=e.call(this);return this.context.isBindingElement=this.context.isBindingElement&&t,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,this.context.firstCoverInitializedNameError=r||this.context.firstCoverInitializedNameError,i},e.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type===s.Token.EOF||this.match("}")||this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.lineNumber=this.startMarker.lineNumber,this.lastMarker.lineStart=this.startMarker.lineStart)},e.prototype.parsePrimaryExpression=function(){var e,t,n,r=this.createNode();switch(this.lookahead.type){case s.Token.Identifier:"module"===this.sourceType&&"await"===this.lookahead.value&&this.tolerateUnexpectedToken(this.lookahead),e=this.finalize(r,new l.Identifier(this.nextToken().value));break;case s.Token.NumericLiteral:case s.Token.StringLiteral:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,i.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),n=this.getTokenRaw(t),e=this.finalize(r,new l.Literal(t.value,n));break;case s.Token.BooleanLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),t.value="true"===t.value,n=this.getTokenRaw(t),e=this.finalize(r,new l.Literal(t.value,n));break;case s.Token.NullLiteral:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,t=this.nextToken(),t.value=null,n=this.getTokenRaw(t),e=this.finalize(r,new l.Literal(t.value,n));break;case s.Token.Template:e=this.parseTemplateLiteral();break;case s.Token.Punctuator:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,e=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":e=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":e=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,t=this.nextRegexToken(),n=this.getTokenRaw(t),e=this.finalize(r,new l.RegexLiteral(t.value,n,t.regex));break;default:this.throwUnexpectedToken(this.nextToken())}break;case s.Token.Keyword:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?e=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?e=this.finalize(r,new l.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?e=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),e=this.finalize(r,new l.ThisExpression)):this.matchKeyword("class")?e=this.parseClassExpression():this.throwUnexpectedToken(this.nextToken()));break;default:this.throwUnexpectedToken(this.nextToken())}return e},e.prototype.parseSpreadElement=function(){var e=this.createNode();this.expect("...");var t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(e,new l.SpreadElement(t))},e.prototype.parseArrayInitializer=function(){var e=this.createNode(),t=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),t.push(null);else if(this.match("...")){var n=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),t.push(n)}else t.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(e,new l.ArrayExpression(t))},e.prototype.parsePropertyMethod=function(e){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var t=this.context.strict,n=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&e.firstRestricted&&this.tolerateUnexpectedToken(e.firstRestricted,e.message),this.context.strict&&e.stricted&&this.tolerateUnexpectedToken(e.stricted,e.message),this.context.strict=t,n},e.prototype.parsePropertyMethodFunction=function(){var e=!1,t=this.createNode(),n=this.context.allowYield;this.context.allowYield=!1;var r=this.parseFormalParameters(),i=this.parsePropertyMethod(r);return this.context.allowYield=n,this.finalize(t,new l.FunctionExpression(null,r.params,i,e))},e.prototype.parseObjectPropertyKey=function(){var e=this.createNode(),t=this.nextToken(),n=null;switch(t.type){case s.Token.StringLiteral:case s.Token.NumericLiteral:this.context.strict&&t.octal&&this.tolerateUnexpectedToken(t,i.Messages.StrictOctalLiteral);var r=this.getTokenRaw(t);n=this.finalize(e,new l.Literal(t.value,r));break;case s.Token.Identifier:case s.Token.BooleanLiteral:case s.Token.NullLiteral:case s.Token.Keyword:n=this.finalize(e,new l.Identifier(t.value));break;case s.Token.Punctuator:"["===t.value?(n=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):this.throwUnexpectedToken(t);break;default:this.throwUnexpectedToken(t)}return n},e.prototype.isPropertyKey=function(e,t){return e.type===u.Syntax.Identifier&&e.name===t||e.type===u.Syntax.Literal&&e.value===t},e.prototype.parseObjectProperty=function(e){var t,n,r,a=this.createNode(),o=this.lookahead,u=!1,c=!1,p=!1;o.type===s.Token.Identifier?(this.nextToken(),n=this.finalize(a,new l.Identifier(o.value))):this.match("*")?this.nextToken():(u=this.match("["),n=this.parseObjectPropertyKey());var f=this.qualifiedPropertyName(this.lookahead);if(o.type===s.Token.Identifier&&"get"===o.value&&f)t="get",u=this.match("["),n=this.parseObjectPropertyKey(),this.context.allowYield=!1,r=this.parseGetterMethod();else if(o.type===s.Token.Identifier&&"set"===o.value&&f)t="set",u=this.match("["),n=this.parseObjectPropertyKey(),r=this.parseSetterMethod();else if(o.type===s.Token.Punctuator&&"*"===o.value&&f)t="init",u=this.match("["),n=this.parseObjectPropertyKey(),r=this.parseGeneratorMethod(),c=!0;else if(n||this.throwUnexpectedToken(this.lookahead),t="init",this.match(":"))!u&&this.isPropertyKey(n,"__proto__")&&(e.value&&this.tolerateError(i.Messages.DuplicateProtoProperty),e.value=!0),this.nextToken(),r=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))r=this.parsePropertyMethodFunction(),c=!0;else if(o.type===s.Token.Identifier){var h=this.finalize(a,new l.Identifier(o.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),p=!0;var d=this.isolateCoverGrammar(this.parseAssignmentExpression);r=this.finalize(a,new l.AssignmentPattern(h,d))}else p=!0,r=h}else this.throwUnexpectedToken(this.nextToken());return this.finalize(a,new l.Property(t,n,u,r,c,p))},e.prototype.parseObjectInitializer=function(){var e=this.createNode();this.expect("{");for(var t=[],n={value:!1};!this.match("}");)t.push(this.parseObjectProperty(n)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(e,new l.ObjectExpression(t))},e.prototype.parseTemplateHead=function(){r.assert(this.lookahead.head,"Template literal must start with a template head");var e=this.createNode(),t=this.nextToken(),n={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,t.tail))},e.prototype.parseTemplateElement=function(){this.lookahead.type!==s.Token.Template&&this.throwUnexpectedToken();var e=this.createNode(),t=this.nextToken(),n={raw:t.value.raw,cooked:t.value.cooked};return this.finalize(e,new l.TemplateElement(n,t.tail))},e.prototype.parseTemplateLiteral=function(){var e=this.createNode(),t=[],n=[],r=this.parseTemplateHead();for(n.push(r);!r.tail;)t.push(this.parseExpression()),r=this.parseTemplateElement(),n.push(r);return this.finalize(e,new l.TemplateLiteral(n,t))},e.prototype.reinterpretExpressionAsPattern=function(e){switch(e.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:e.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(e.argument);break;case u.Syntax.ArrayExpression:e.type=u.Syntax.ArrayPattern;for(var t=0;t")||this.expect("=>"),e={type:c,params:[]};else{var t=this.lookahead,n=[];if(this.match("..."))e=this.parseRestElement(n),this.expect(")"),this.match("=>")||this.expect("=>"),e={type:c,params:[e]};else{var r=!1;if(this.context.isBindingElement=!0,e=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var i=[];for(this.context.isAssignmentTarget=!1,i.push(e);this.startMarker.index")||this.expect("=>"),this.context.isBindingElement=!1;for(var a=0;a")&&(e.type===u.Syntax.Identifier&&"yield"===e.name&&(r=!0,e={type:c,params:[e]}),!r)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),e.type===u.Syntax.SequenceExpression)for(var a=0;a0){this.nextToken(),n.prec=r,this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var i=[e,this.lookahead],a=t,s=this.isolateCoverGrammar(this.parseExponentiationExpression),o=[a,n,s];;){if(r=this.binaryPrecedence(this.lookahead),r<=0)break;for(;o.length>2&&r<=o[o.length-2].prec;){s=o.pop();var u=o.pop().value;a=o.pop(),i.pop();var c=this.startNode(i[i.length-1]);o.push(this.finalize(c,new l.BinaryExpression(u,a,s)))}n=this.nextToken(),n.prec=r,o.push(n),i.push(this.lookahead),o.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var p=o.length-1;for(t=o[p],i.pop();p>1;){var c=this.startNode(i.pop());t=this.finalize(c,new l.BinaryExpression(o[p-1].value,o[p-2],t)),p-=2}}return t},e.prototype.parseConditionalExpression=function(){var e=this.lookahead,t=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var n=this.context.allowIn;this.context.allowIn=!0;var r=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=n,this.expect(":");var i=this.isolateCoverGrammar(this.parseAssignmentExpression);t=this.finalize(this.startNode(e),new l.ConditionalExpression(t,r,i)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return t},e.prototype.checkPatternParam=function(e,t){switch(t.type){case u.Syntax.Identifier:this.validateParam(e,t,t.name);break;case u.Syntax.RestElement:this.checkPatternParam(e,t.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(e,t.left);break;case u.Syntax.ArrayPattern:for(var n=0;n")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var r=this.reinterpretAsCoverFormalsList(e);if(r){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var a=this.context.strict,s=this.context.allowYield;this.context.allowYield=!0;var o=this.startNode(t);this.expect("=>");var p=this.match("{")?this.parseFunctionSourceElements():this.isolateCoverGrammar(this.parseAssignmentExpression),f=p.type!==u.Syntax.BlockStatement;this.context.strict&&r.firstRestricted&&this.throwUnexpectedToken(r.firstRestricted,r.message),this.context.strict&&r.stricted&&this.tolerateUnexpectedToken(r.stricted,r.message),e=this.finalize(o,new l.ArrowFunctionExpression(r.params,p,f)),this.context.strict=a,this.context.allowYield=s}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(i.Messages.InvalidLHSInAssignment),this.context.strict&&e.type===u.Syntax.Identifier){var h=e;this.scanner.isRestrictedWord(h.name)&&this.tolerateUnexpectedToken(n,i.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(h.name)&&this.tolerateUnexpectedToken(n,i.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(e):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),n=this.nextToken();var d=this.isolateCoverGrammar(this.parseAssignmentExpression);e=this.finalize(this.startNode(t),new l.AssignmentExpression(n.value,e,d)),this.context.firstCoverInitializedNameError=null}}return e},e.prototype.parseExpression=function(){var e=this.lookahead,t=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var n=[];for(n.push(t);this.startMarker.index",t.TokenName[n.Identifier]="Identifier",t.TokenName[n.Keyword]="Keyword",t.TokenName[n.NullLiteral]="Null",t.TokenName[n.NumericLiteral]="Numeric",t.TokenName[n.Punctuator]="Punctuator",t.TokenName[n.StringLiteral]="String",t.TokenName[n.RegularExpression]="RegularExpression",t.TokenName[n.Template]="Template"},function(e,t,n){"use strict";function r(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function i(e){return"01234567".indexOf(e)}var a=n(4),s=n(5),o=n(9),u=n(7),l=function(){function e(e,t){this.source=e,this.errorHandler=t,this.trackComment=!1,this.length=e.length,this.index=0,this.lineNumber=e.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return e.prototype.eof=function(){return this.index>=this.length},e.prototype.throwUnexpectedToken=function(e){void 0===e&&(e=s.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,e)},e.prototype.tolerateUnexpectedToken=function(){this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,s.Messages.UnexpectedTokenIllegal)},e.prototype.skipSingleLineComment=function(e){var t,n,r;for(this.trackComment&&(t=[],n=this.index-e,r={start:{line:this.lineNumber,column:this.index-this.lineStart-e},end:{}});!this.eof();){var i=this.source.charCodeAt(this.index);if(++this.index,o.Character.isLineTerminator(i)){if(this.trackComment){r.end={line:this.lineNumber,column:this.index-this.lineStart-1};var a={multiLine:!1,slice:[n+e,this.index-1],range:[n,this.index-1],loc:r};t.push(a)}return 13===i&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t}}if(this.trackComment){r.end={line:this.lineNumber,column:this.index-this.lineStart};var a={multiLine:!1,slice:[n+e,this.index],range:[n,this.index],loc:r};t.push(a)}return t},e.prototype.skipMultiLineComment=function(){var e,t,n;for(this.trackComment&&(e=[],t=this.index-2,n={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var r=this.source.charCodeAt(this.index);if(o.Character.isLineTerminator(r))13===r&&10===this.source.charCodeAt(this.index+1)&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(42===r){if(47===this.source.charCodeAt(this.index+1)){if(this.index+=2,this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index-2],range:[t,this.index],loc:n};e.push(i)}return e}++this.index}else++this.index}if(this.trackComment){n.end={line:this.lineNumber,column:this.index-this.lineStart};var i={multiLine:!0,slice:[t+2,this.index],range:[t,this.index],loc:n};e.push(i)}return this.tolerateUnexpectedToken(),e},e.prototype.scanComments=function(){var e;this.trackComment&&(e=[]);for(var t=0===this.index;!this.eof();){var n=this.source.charCodeAt(this.index);if(o.Character.isWhiteSpace(n))++this.index;else if(o.Character.isLineTerminator(n))++this.index,13===n&&10===this.source.charCodeAt(this.index)&&++this.index,++this.lineNumber,this.lineStart=this.index,t=!0;else if(47===n)if(n=this.source.charCodeAt(this.index+1),47===n){this.index+=2;var r=this.skipSingleLineComment(2);this.trackComment&&(e=e.concat(r)),t=!0}else{if(42!==n)break;this.index+=2;var r=this.skipMultiLineComment();this.trackComment&&(e=e.concat(r))}else if(t&&45===n){if(45!==this.source.charCodeAt(this.index+1)||62!==this.source.charCodeAt(this.index+2))break;this.index+=3;var r=this.skipSingleLineComment(3);this.trackComment&&(e=e.concat(r))}else{if(60!==n)break;if("!--"!==this.source.slice(this.index+1,this.index+4))break;this.index+=4;var r=this.skipSingleLineComment(4);this.trackComment&&(e=e.concat(r))}}return e},e.prototype.isFutureReservedWord=function(e){switch(e){case"enum":case"export":case"import":case"super":return!0;default:return!1}},e.prototype.isStrictModeReservedWord=function(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},e.prototype.isRestrictedWord=function(e){return"eval"===e||"arguments"===e},e.prototype.isKeyword=function(e){switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}},e.prototype.codePointAt=function(e){var t=this.source.charCodeAt(e);if(t>=55296&&t<=56319){ +var n=this.source.charCodeAt(e+1);if(n>=56320&&n<=57343){t=1024*(t-55296)+n-56320+65536}}return t},e.prototype.scanHexEscape=function(e){for(var t="u"===e?4:2,n=0,i=0;i1114111||"}"!==e)&&this.throwUnexpectedToken(),o.Character.fromCodePoint(t)},e.prototype.getIdentifier=function(){for(var e=this.index++;!this.eof();){var t=this.source.charCodeAt(this.index);if(92===t)return this.index=e,this.getComplexIdentifier();if(t>=55296&&t<57343)return this.index=e,this.getComplexIdentifier();if(!o.Character.isIdentifierPart(t))break;++this.index}return this.source.slice(e,this.index)},e.prototype.getComplexIdentifier=function(){var e=this.codePointAt(this.index),t=o.Character.fromCodePoint(e);this.index+=t.length;var n;for(92===e&&(117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),e=n.charCodeAt(0),n&&"\\"!==n&&o.Character.isIdentifierStart(e)||this.throwUnexpectedToken()),t=n);!this.eof()&&(e=this.codePointAt(this.index),o.Character.isIdentifierPart(e));)n=o.Character.fromCodePoint(e),t+=n,this.index+=n.length,92===e&&(t=t.substr(0,t.length-1),117!==this.source.charCodeAt(this.index)&&this.throwUnexpectedToken(),++this.index,"{"===this.source[this.index]?(++this.index,n=this.scanUnicodeCodePointEscape()):(n=this.scanHexEscape("u"),e=n.charCodeAt(0),n&&"\\"!==n&&o.Character.isIdentifierPart(e)||this.throwUnexpectedToken()),t+=n);return t},e.prototype.octalToDecimal=function(e){var t="0"!==e,n=i(e);return!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(t=!0,n=8*n+i(this.source[this.index++]),"0123".indexOf(e)>=0&&!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(n=8*n+i(this.source[this.index++]))),{code:n,octal:t}},e.prototype.scanIdentifier=function(){var e,t=this.index,n=92===this.source.charCodeAt(t)?this.getComplexIdentifier():this.getIdentifier();return e=1===n.length?u.Token.Identifier:this.isKeyword(n)?u.Token.Keyword:"null"===n?u.Token.NullLiteral:"true"===n||"false"===n?u.Token.BooleanLiteral:u.Token.Identifier,{type:e,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.scanPunctuator=function(){var e={type:u.Token.Punctuator,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index},t=this.source[this.index];switch(t){case"(":case"{":"{"===t&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,"."===this.source[this.index]&&"."===this.source[this.index+1]&&(this.index+=2,t="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:t=this.source.substr(this.index,4),">>>="===t?this.index+=4:(t=t.substr(0,3),"==="===t||"!=="===t||">>>"===t||"<<="===t||">>="===t||"**="===t?this.index+=3:(t=t.substr(0,2),"&&"===t||"||"===t||"=="===t||"!="===t||"+="===t||"-="===t||"*="===t||"/="===t||"++"===t||"--"===t||"<<"===t||">>"===t||"&="===t||"|="===t||"^="===t||"%="===t||"<="===t||">="===t||"=>"===t||"**"===t?this.index+=2:(t=this.source[this.index],"<>=!+-*%&|^/".indexOf(t)>=0&&++this.index)))}return this.index===e.start&&this.throwUnexpectedToken(),e.end=this.index,e.value=t,e},e.prototype.scanHexLiteral=function(e){for(var t="";!this.eof()&&o.Character.isHexDigit(this.source.charCodeAt(this.index));)t+=this.source[this.index++];return 0===t.length&&this.throwUnexpectedToken(),o.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:u.Token.NumericLiteral,value:parseInt("0x"+t,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanBinaryLiteral=function(e){for(var t,n="";!this.eof()&&(t=this.source[this.index],"0"===t||"1"===t);)n+=this.source[this.index++];return 0===n.length&&this.throwUnexpectedToken(),this.eof()||(t=this.source.charCodeAt(this.index),(o.Character.isIdentifierStart(t)||o.Character.isDecimalDigit(t))&&this.throwUnexpectedToken()),{type:u.Token.NumericLiteral,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:e,end:this.index}},e.prototype.scanOctalLiteral=function(e,t){var n="",r=!1;for(o.Character.isOctalDigit(e.charCodeAt(0))?(r=!0,n="0"+this.source[this.index++]):++this.index;!this.eof()&&o.Character.isOctalDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return r||0!==n.length||this.throwUnexpectedToken(),(o.Character.isIdentifierStart(this.source.charCodeAt(this.index))||o.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:u.Token.NumericLiteral,value:parseInt(n,8),octal:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}},e.prototype.isImplicitOctalLiteral=function(){for(var e=this.index+1;e=0&&(r=r.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(e,t,r){var a=parseInt(t||r,16);return a>1114111&&i.throwUnexpectedToken(s.Messages.InvalidRegExp),a<=65535?String.fromCharCode(a):n}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,n));try{RegExp(r)}catch(e){this.throwUnexpectedToken(s.Messages.InvalidRegExp)}try{return new RegExp(e,t)}catch(e){return null}},e.prototype.scanRegExpBody=function(){var e=this.source[this.index];a.assert("/"===e,"Regular expression literal must start with a slash");for(var t=this.source[this.index++],n=!1,r=!1;!this.eof();)if(e=this.source[this.index++],t+=e,"\\"===e)e=this.source[this.index++],o.Character.isLineTerminator(e.charCodeAt(0))&&this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),t+=e;else if(o.Character.isLineTerminator(e.charCodeAt(0)))this.throwUnexpectedToken(s.Messages.UnterminatedRegExp);else if(n)"]"===e&&(n=!1);else{if("/"===e){r=!0;break}"["===e&&(n=!0)}return r||this.throwUnexpectedToken(s.Messages.UnterminatedRegExp),{value:t.substr(1,t.length-2),literal:t}},e.prototype.scanRegExpFlags=function(){for(var e="",t="";!this.eof();){var n=this.source[this.index];if(!o.Character.isIdentifierPart(n.charCodeAt(0)))break;if(++this.index,"\\"!==n||this.eof())t+=n,e+=n;else if(n=this.source[this.index],"u"===n){++this.index;var r=this.index;if(n=this.scanHexEscape("u"))for(t+=n,e+="\\u";r=55296&&e<57343&&o.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},e}();t.Scanner=l},function(e,t){"use strict";var n={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(e){return e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023))},isWhiteSpace:function(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0},isLineTerminator:function(e){return 10===e||13===e||8232===e||8233===e},isIdentifierStart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&n.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(e))},isIdentifierPart:function(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&n.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(e))},isDecimalDigit:function(e){return e>=48&&e<=57},isHexDigit:function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},isOctalDigit:function(e){return e>=48&&e<=55}}},function(e,t,n){"use strict";var r=n(2),i=function(){function e(e){this.type=r.Syntax.ArrayExpression,this.elements=e}return e}();t.ArrayExpression=i;var a=function(){function e(e){this.type=r.Syntax.ArrayPattern,this.elements=e}return e}();t.ArrayPattern=a;var s=function(){function e(e,t,n){this.type=r.Syntax.ArrowFunctionExpression,this.id=null,this.params=e,this.body=t,this.generator=!1,this.expression=n}return e}();t.ArrowFunctionExpression=s;var o=function(){function e(e,t,n){this.type=r.Syntax.AssignmentExpression,this.operator=e,this.left=t,this.right=n}return e}();t.AssignmentExpression=o;var u=function(){function e(e,t){this.type=r.Syntax.AssignmentPattern,this.left=e,this.right=t}return e}();t.AssignmentPattern=u;var l=function(){function e(e,t,n){var i="||"===e||"&&"===e;this.type=i?r.Syntax.LogicalExpression:r.Syntax.BinaryExpression,this.operator=e,this.left=t,this.right=n}return e}();t.BinaryExpression=l;var c=function(){function e(e){this.type=r.Syntax.BlockStatement,this.body=e}return e}();t.BlockStatement=c;var p=function(){function e(e){this.type=r.Syntax.BreakStatement,this.label=e}return e}();t.BreakStatement=p;var f=function(){function e(e,t){this.type=r.Syntax.CallExpression,this.callee=e,this.arguments=t}return e}();t.CallExpression=f;var h=function(){function e(e,t){this.type=r.Syntax.CatchClause,this.param=e,this.body=t}return e}();t.CatchClause=h;var d=function(){function e(e){this.type=r.Syntax.ClassBody,this.body=e}return e}();t.ClassBody=d;var y=function(){function e(e,t,n){this.type=r.Syntax.ClassDeclaration,this.id=e,this.superClass=t,this.body=n}return e}();t.ClassDeclaration=y;var m=function(){function e(e,t,n){this.type=r.Syntax.ClassExpression,this.id=e,this.superClass=t,this.body=n}return e}();t.ClassExpression=m;var b=function(){function e(e,t){this.type=r.Syntax.MemberExpression,this.computed=!0,this.object=e,this.property=t}return e}();t.ComputedMemberExpression=b;var g=function(){function e(e,t,n){this.type=r.Syntax.ConditionalExpression,this.test=e,this.consequent=t,this.alternate=n}return e}();t.ConditionalExpression=g;var v=function(){function e(e){this.type=r.Syntax.ContinueStatement,this.label=e}return e}();t.ContinueStatement=v;var x=function(){function e(){this.type=r.Syntax.DebuggerStatement}return e}();t.DebuggerStatement=x;var _=function(){function e(e,t){this.type=r.Syntax.ExpressionStatement,this.expression=e,this.directive=t}return e}();t.Directive=_;var E=function(){function e(e,t){this.type=r.Syntax.DoWhileStatement,this.body=e,this.test=t}return e}();t.DoWhileStatement=E;var A=function(){function e(){this.type=r.Syntax.EmptyStatement}return e}();t.EmptyStatement=A;var D=function(){function e(e){this.type=r.Syntax.ExportAllDeclaration,this.source=e}return e}();t.ExportAllDeclaration=D;var C=function(){function e(e){this.type=r.Syntax.ExportDefaultDeclaration,this.declaration=e}return e}();t.ExportDefaultDeclaration=C;var S=function(){function e(e,t,n){this.type=r.Syntax.ExportNamedDeclaration,this.declaration=e,this.specifiers=t,this.source=n}return e}();t.ExportNamedDeclaration=S;var w=function(){function e(e,t){this.type=r.Syntax.ExportSpecifier,this.exported=t,this.local=e}return e}();t.ExportSpecifier=w;var k=function(){function e(e){this.type=r.Syntax.ExpressionStatement,this.expression=e}return e}();t.ExpressionStatement=k;var F=function(){function e(e,t,n){this.type=r.Syntax.ForInStatement,this.left=e,this.right=t,this.body=n,this.each=!1}return e}();t.ForInStatement=F;var T=function(){function e(e,t,n){this.type=r.Syntax.ForOfStatement,this.left=e,this.right=t,this.body=n}return e}();t.ForOfStatement=T;var P=function(){function e(e,t,n,i){this.type=r.Syntax.ForStatement,this.init=e,this.test=t,this.update=n,this.body=i}return e}();t.ForStatement=P;var j=function(){function e(e,t,n,i){this.type=r.Syntax.FunctionDeclaration,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1}return e}();t.FunctionDeclaration=j;var B=function(){function e(e,t,n,i){this.type=r.Syntax.FunctionExpression,this.id=e,this.params=t,this.body=n,this.generator=i,this.expression=!1}return e}();t.FunctionExpression=B;var O=function(){function e(e){this.type=r.Syntax.Identifier,this.name=e +}return e}();t.Identifier=O;var I=function(){function e(e,t,n){this.type=r.Syntax.IfStatement,this.test=e,this.consequent=t,this.alternate=n}return e}();t.IfStatement=I;var N=function(){function e(e,t){this.type=r.Syntax.ImportDeclaration,this.specifiers=e,this.source=t}return e}();t.ImportDeclaration=N;var L=function(){function e(e){this.type=r.Syntax.ImportDefaultSpecifier,this.local=e}return e}();t.ImportDefaultSpecifier=L;var M=function(){function e(e){this.type=r.Syntax.ImportNamespaceSpecifier,this.local=e}return e}();t.ImportNamespaceSpecifier=M;var R=function(){function e(e,t){this.type=r.Syntax.ImportSpecifier,this.local=e,this.imported=t}return e}();t.ImportSpecifier=R;var U=function(){function e(e,t){this.type=r.Syntax.LabeledStatement,this.label=e,this.body=t}return e}();t.LabeledStatement=U;var V=function(){function e(e,t){this.type=r.Syntax.Literal,this.value=e,this.raw=t}return e}();t.Literal=V;var G=function(){function e(e,t){this.type=r.Syntax.MetaProperty,this.meta=e,this.property=t}return e}();t.MetaProperty=G;var q=function(){function e(e,t,n,i,a){this.type=r.Syntax.MethodDefinition,this.key=e,this.computed=t,this.value=n,this.kind=i,this.static=a}return e}();t.MethodDefinition=q;var K=function(){function e(e,t){this.type=r.Syntax.NewExpression,this.callee=e,this.arguments=t}return e}();t.NewExpression=K;var X=function(){function e(e){this.type=r.Syntax.ObjectExpression,this.properties=e}return e}();t.ObjectExpression=X;var J=function(){function e(e){this.type=r.Syntax.ObjectPattern,this.properties=e}return e}();t.ObjectPattern=J;var W=function(){function e(e,t){this.type=r.Syntax.Program,this.body=e,this.sourceType=t}return e}();t.Program=W;var z=function(){function e(e,t,n,i,a,s){this.type=r.Syntax.Property,this.key=t,this.computed=n,this.value=i,this.kind=e,this.method=a,this.shorthand=s}return e}();t.Property=z;var Y=function(){function e(e,t,n){this.type=r.Syntax.Literal,this.value=e,this.raw=t,this.regex=n}return e}();t.RegexLiteral=Y;var H=function(){function e(e){this.type=r.Syntax.RestElement,this.argument=e}return e}();t.RestElement=H;var $=function(){function e(e){this.type=r.Syntax.ReturnStatement,this.argument=e}return e}();t.ReturnStatement=$;var Q=function(){function e(e){this.type=r.Syntax.SequenceExpression,this.expressions=e}return e}();t.SequenceExpression=Q;var Z=function(){function e(e){this.type=r.Syntax.SpreadElement,this.argument=e}return e}();t.SpreadElement=Z;var ee=function(){function e(e,t){this.type=r.Syntax.MemberExpression,this.computed=!1,this.object=e,this.property=t}return e}();t.StaticMemberExpression=ee;var te=function(){function e(){this.type=r.Syntax.Super}return e}();t.Super=te;var ne=function(){function e(e,t){this.type=r.Syntax.SwitchCase,this.test=e,this.consequent=t}return e}();t.SwitchCase=ne;var re=function(){function e(e,t){this.type=r.Syntax.SwitchStatement,this.discriminant=e,this.cases=t}return e}();t.SwitchStatement=re;var ie=function(){function e(e,t){this.type=r.Syntax.TaggedTemplateExpression,this.tag=e,this.quasi=t}return e}();t.TaggedTemplateExpression=ie;var ae=function(){function e(e,t){this.type=r.Syntax.TemplateElement,this.value=e,this.tail=t}return e}();t.TemplateElement=ae;var se=function(){function e(e,t){this.type=r.Syntax.TemplateLiteral,this.quasis=e,this.expressions=t}return e}();t.TemplateLiteral=se;var oe=function(){function e(){this.type=r.Syntax.ThisExpression}return e}();t.ThisExpression=oe;var ue=function(){function e(e){this.type=r.Syntax.ThrowStatement,this.argument=e}return e}();t.ThrowStatement=ue;var le=function(){function e(e,t,n){this.type=r.Syntax.TryStatement,this.block=e,this.handler=t,this.finalizer=n}return e}();t.TryStatement=le;var ce=function(){function e(e,t){this.type=r.Syntax.UnaryExpression,this.operator=e,this.argument=t,this.prefix=!0}return e}();t.UnaryExpression=ce;var pe=function(){function e(e,t,n){this.type=r.Syntax.UpdateExpression,this.operator=e,this.argument=t,this.prefix=n}return e}();t.UpdateExpression=pe;var fe=function(){function e(e,t){this.type=r.Syntax.VariableDeclaration,this.declarations=e,this.kind=t}return e}();t.VariableDeclaration=fe;var he=function(){function e(e,t){this.type=r.Syntax.VariableDeclarator,this.id=e,this.init=t}return e}();t.VariableDeclarator=he;var de=function(){function e(e,t){this.type=r.Syntax.WhileStatement,this.test=e,this.body=t}return e}();t.WhileStatement=de;var ye=function(){function e(e,t){this.type=r.Syntax.WithStatement,this.object=e,this.body=t}return e}();t.WithStatement=ye;var me=function(){function e(e,t){this.type=r.Syntax.YieldExpression,this.argument=e,this.delegate=t}return e}();t.YieldExpression=me},function(e,t,n){"use strict";function r(e){var t;switch(e.type){case c.JSXSyntax.JSXIdentifier:t=e.name;break;case c.JSXSyntax.JSXNamespacedName:var n=e;t=r(n.namespace)+":"+r(n.name);break;case c.JSXSyntax.JSXMemberExpression:var i=e;t=r(i.object)+"."+r(i.property)}return t}var i,a=this&&this.__extends||function(e,t){function n(){this.constructor=e}for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},s=n(9),o=n(7),u=n(3),l=n(12),c=n(13),p=n(10),f=n(14);!function(e){e[e.Identifier=100]="Identifier",e[e.Text=101]="Text"}(i||(i={})),o.TokenName[i.Identifier]="JSXIdentifier",o.TokenName[i.Text]="JSXText";var h=function(e){function t(t,n,r){e.call(this,t,n,r)}return a(t,e),t.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():e.prototype.parsePrimaryExpression.call(this)},t.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.lineNumber,this.scanner.lineStart=this.startMarker.lineStart},t.prototype.finishJSX=function(){this.nextToken()},t.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},t.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},t.prototype.scanXHTMLEntity=function(e){for(var t="&",n=!0,r=!1,i=!1,a=!1;!this.scanner.eof()&&n&&!r;){var o=this.scanner.source[this.scanner.index];if(o===e)break;if(r=";"===o,t+=o,++this.scanner.index,!r)switch(t.length){case 2:i="#"===o;break;case 3:i&&(a="x"===o,n=a||s.Character.isDecimalDigit(o.charCodeAt(0)),i=i&&!a);break;default:n=n&&!(i&&!s.Character.isDecimalDigit(o.charCodeAt(0))),n=n&&!(a&&!s.Character.isHexDigit(o.charCodeAt(0)))}}if(n&&r&&t.length>2){var u=t.substr(1,t.length-2);i&&u.length>1?t=String.fromCharCode(parseInt(u.substr(1),10)):a&&u.length>2?t=String.fromCharCode(parseInt("0"+u.substr(1),16)):i||a||!l.XHTMLEntities[u]||(t=l.XHTMLEntities[u])}return t},t.prototype.lexJSX=function(){var e=this.scanner.source.charCodeAt(this.scanner.index);if(60===e||62===e||47===e||58===e||61===e||123===e||125===e){var t=this.scanner.source[this.scanner.index++];return{type:o.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(34===e||39===e){for(var n=this.scanner.index,r=this.scanner.source[this.scanner.index++],a="";!this.scanner.eof();){var u=this.scanner.source[this.scanner.index++];if(u===r)break;a+="&"===u?this.scanXHTMLEntity(r):u}return{type:o.Token.StringLiteral,value:a,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(46===e){var l=this.scanner.source.charCodeAt(this.scanner.index+1),c=this.scanner.source.charCodeAt(this.scanner.index+2),t=46===l&&46===c?"...":".",n=this.scanner.index;return this.scanner.index+=t.length,{type:o.Token.Punctuator,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}if(96===e)return{type:o.Token.Template,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(s.Character.isIdentifierStart(e)&&92!==e){var n=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var u=this.scanner.source.charCodeAt(this.scanner.index);if(s.Character.isIdentifierPart(u)&&92!==u)++this.scanner.index;else{if(45!==u)break;++this.scanner.index}}var p=this.scanner.source.slice(n,this.scanner.index);return{type:i.Identifier,value:p,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:n,end:this.scanner.index}}this.scanner.throwUnexpectedToken()},t.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;var e=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(e)),e},t.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.lineNumber=this.scanner.lineNumber,this.startMarker.lineStart=this.scanner.lineStart;for(var e=this.scanner.index,t="";!this.scanner.eof();){var n=this.scanner.source[this.scanner.index];if("{"===n||"<"===n)break;++this.scanner.index,t+=n,s.Character.isLineTerminator(n.charCodeAt(0))&&(++this.scanner.lineNumber,"\r"===n&&"\n"===this.scanner.source[this.scanner.index]&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart;var r={type:i.Text,value:t,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:e,end:this.scanner.index};return t.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(r)),r},t.prototype.peekJSXToken=function(){var e=this.scanner.index,t=this.scanner.lineNumber,n=this.scanner.lineStart;this.scanner.scanComments();var r=this.lexJSX();return this.scanner.index=e,this.scanner.lineNumber=t,this.scanner.lineStart=n,r},t.prototype.expectJSX=function(e){var t=this.nextJSXToken();t.type===o.Token.Punctuator&&t.value===e||this.throwUnexpectedToken(t)},t.prototype.matchJSX=function(e){var t=this.peekJSXToken();return t.type===o.Token.Punctuator&&t.value===e},t.prototype.parseJSXIdentifier=function(){var e=this.createJSXNode(),t=this.nextJSXToken();return t.type!==i.Identifier&&this.throwUnexpectedToken(t),this.finalize(e,new f.JSXIdentifier(t.value))},t.prototype.parseJSXElementName=function(){var e=this.createJSXNode(),t=this.parseJSXIdentifier();if(this.matchJSX(":")){var n=t;this.expectJSX(":");var r=this.parseJSXIdentifier();t=this.finalize(e,new f.JSXNamespacedName(n,r))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var i=t;this.expectJSX(".");var a=this.parseJSXIdentifier();t=this.finalize(e,new f.JSXMemberExpression(i,a))}return t},t.prototype.parseJSXAttributeName=function(){var e,t=this.createJSXNode(),n=this.parseJSXIdentifier();if(this.matchJSX(":")){var r=n;this.expectJSX(":");var i=this.parseJSXIdentifier();e=this.finalize(t,new f.JSXNamespacedName(r,i))}else e=n;return e},t.prototype.parseJSXStringLiteralAttribute=function(){var e=this.createJSXNode(),t=this.nextJSXToken();t.type!==o.Token.StringLiteral&&this.throwUnexpectedToken(t);var n=this.getTokenRaw(t);return this.finalize(e,new p.Literal(t.value,n))},t.prototype.parseJSXExpressionAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new f.JSXExpressionContainer(t))},t.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},t.prototype.parseJSXNameValueAttribute=function(){var e=this.createJSXNode(),t=this.parseJSXAttributeName(),n=null;return this.matchJSX("=")&&(this.expectJSX("="),n=this.parseJSXAttributeValue()),this.finalize(e,new f.JSXAttribute(t,n))},t.prototype.parseJSXSpreadAttribute=function(){var e=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var t=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(e,new f.JSXSpreadAttribute(t))},t.prototype.parseJSXAttributes=function(){for(var e=[];!this.matchJSX("/")&&!this.matchJSX(">");){var t=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();e.push(t)}return e},t.prototype.parseJSXOpeningElement=function(){var e=this.createJSXNode();this.expectJSX("<");var t=this.parseJSXElementName(),n=this.parseJSXAttributes(),r=this.matchJSX("/");return r&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new f.JSXOpeningElement(t,r,n))},t.prototype.parseJSXBoundaryElement=function(){var e=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var t=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(e,new f.JSXClosingElement(t))}var n=this.parseJSXElementName(),r=this.parseJSXAttributes(),i=this.matchJSX("/");return i&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(e,new f.JSXOpeningElement(n,i,r))},t.prototype.parseJSXEmptyExpression=function(){var e=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.lineNumber=this.scanner.lineNumber,this.lastMarker.lineStart=this.scanner.lineStart,this.finalize(e,new f.JSXEmptyExpression)},t.prototype.parseJSXExpressionContainer=function(){var e=this.createJSXNode();this.expectJSX("{");var t;return this.matchJSX("}")?(t=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),t=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(e,new f.JSXExpressionContainer(t))},t.prototype.parseJSXChildren=function(){for(var e=[];!this.scanner.eof();){var t=this.createJSXChildNode(),n=this.nextJSXText();if(n.start0))break;var s=this.finalize(e.node,new f.JSXElement(e.opening,e.children,e.closing));e=t.pop(),e.children.push(s)}}return e},t.prototype.parseJSXElement=function(){var e=this.createJSXNode(),t=this.parseJSXOpeningElement(),n=[],r=null;if(!t.selfClosing){var i=this.parseComplexJSXElement({node:e,opening:t,closing:r,children:n});n=i.children,r=i.closing}return this.finalize(e,new f.JSXElement(t,n,r))},t.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var e=this.parseJSXElement();return this.finishJSX(),e},t}(u.Parser);t.JSXParser=h},function(e,t){"use strict";t.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",lang:"⟨",rang:"⟩"}},function(e,t){"use strict";t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,n){"use strict";var r=n(13),i=function(){function e(e){this.type=r.JSXSyntax.JSXClosingElement,this.name=e}return e}();t.JSXClosingElement=i;var a=function(){function e(e,t,n){this.type=r.JSXSyntax.JSXElement,this.openingElement=e,this.children=t,this.closingElement=n}return e}();t.JSXElement=a;var s=function(){function e(){this.type=r.JSXSyntax.JSXEmptyExpression}return e}();t.JSXEmptyExpression=s;var o=function(){function e(e){this.type=r.JSXSyntax.JSXExpressionContainer,this.expression=e}return e}();t.JSXExpressionContainer=o;var u=function(){function e(e){this.type=r.JSXSyntax.JSXIdentifier,this.name=e}return e}();t.JSXIdentifier=u;var l=function(){function e(e,t){this.type=r.JSXSyntax.JSXMemberExpression,this.object=e,this.property=t}return e}();t.JSXMemberExpression=l;var c=function(){function e(e,t){this.type=r.JSXSyntax.JSXAttribute,this.name=e,this.value=t}return e}();t.JSXAttribute=c;var p=function(){function e(e,t){this.type=r.JSXSyntax.JSXNamespacedName,this.namespace=e,this.name=t}return e}();t.JSXNamespacedName=p;var f=function(){function e(e,t,n){this.type=r.JSXSyntax.JSXOpeningElement,this.name=e,this.selfClosing=t,this.attributes=n}return e}();t.JSXOpeningElement=f;var h=function(){function e(e){this.type=r.JSXSyntax.JSXSpreadAttribute,this.argument=e}return e}();t.JSXSpreadAttribute=h;var d=function(){function e(e,t){this.type=r.JSXSyntax.JSXText,this.value=e,this.raw=t}return e}();t.JSXText=d},function(e,t,n){"use strict";var r=n(8),i=n(6),a=n(7),s=function(){function e(){this.values=[],this.curly=this.paren=-1}return e.prototype.beforeFunctionExpression=function(e){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(e)>=0},e.prototype.isRegexStart=function(){var e=this.values[this.values.length-1],t=null!==e;switch(e){case"this":case"]":t=!1;break;case")":var n=this.values[this.paren-1];t="if"===n||"while"===n||"for"===n||"with"===n;break;case"}":if(t=!1,"function"===this.values[this.curly-3]){var r=this.values[this.curly-4];t=!!r&&!this.beforeFunctionExpression(r)}else if("function"===this.values[this.curly-4]){var i=this.values[this.curly-5];t=!i||!this.beforeFunctionExpression(i)}}return t},e.prototype.push=function(e){e.type===a.Token.Punctuator||e.type===a.Token.Keyword?("{"===e.value?this.curly=this.values.length:"("===e.value&&(this.paren=this.values.length),this.values.push(e.value)):this.values.push(null)},e}(),o=function(){function e(e,t){this.errorHandler=new i.ErrorHandler,this.errorHandler.tolerant=!!t&&("boolean"==typeof t.tolerant&&t.tolerant),this.scanner=new r.Scanner(e,this.errorHandler),this.scanner.trackComment=!!t&&("boolean"==typeof t.comment&&t.comment),this.trackRange=!!t&&("boolean"==typeof t.range&&t.range),this.trackLoc=!!t&&("boolean"==typeof t.loc&&t.loc),this.buffer=[],this.reader=new s}return e.prototype.errors=function(){return this.errorHandler.errors},e.prototype.getNextToken=function(){if(0===this.buffer.length){var e=this.scanner.scanComments();if(this.scanner.trackComment)for(var t=0;tr&&(t[r]=t[n]),++r);return t.length=r,t},r(n,"makeAccessor",l)},{}],561:[function(e,t,n){arguments[4][517][0].apply(n,arguments)},{"./util":570,dup:517}],562:[function(e,t,n){arguments[4][518][0].apply(n,arguments)},{"./base64":563,dup:518}],563:[function(e,t,n){arguments[4][519][0].apply(n,arguments)},{dup:519}],564:[function(e,t,n){arguments[4][520][0].apply(n,arguments)},{dup:520}],565:[function(e,t,n){arguments[4][521][0].apply(n,arguments)},{"./util":570,dup:521}],566:[function(e,t,n){arguments[4][522][0].apply(n,arguments)},{dup:522}],567:[function(e,t,n){arguments[4][523][0].apply(n,arguments)},{"./array-set":561,"./base64-vlq":562,"./binary-search":564,"./quick-sort":566,"./util":570,dup:523}],568:[function(e,t,n){arguments[4][524][0].apply(n,arguments)},{"./array-set":561,"./base64-vlq":562,"./mapping-list":565,"./util":570,dup:524}],569:[function(e,t,n){arguments[4][525][0].apply(n,arguments)},{"./source-map-generator":568,"./util":570,dup:525}],570:[function(e,t,n){arguments[4][526][0].apply(n,arguments)},{dup:526}],571:[function(e,t,n){arguments[4][527][0].apply(n,arguments)},{"./lib/source-map-consumer":567,"./lib/source-map-generator":568,"./lib/source-node":569,dup:527}],572:[function(e,t,n){t.exports={plugins:[e("babel-plugin-syntax-async-functions"),e("babel-plugin-syntax-async-generators"),e("babel-plugin-transform-es2015-classes"),e("babel-plugin-transform-es2015-arrow-functions"),e("babel-plugin-transform-es2015-block-scoping"),e("babel-plugin-transform-es2015-for-of"),e("regenerator-transform").default]}},{"babel-plugin-syntax-async-functions":573,"babel-plugin-syntax-async-generators":574,"babel-plugin-transform-es2015-arrow-functions":575,"babel-plugin-transform-es2015-block-scoping":576,"babel-plugin-transform-es2015-classes":936,"babel-plugin-transform-es2015-for-of":1629,"regenerator-transform":1632}],573:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("asyncFunctions")}}},t.exports=n.default},{}],574:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(){return{manipulateOptions:function(e,t){t.plugins.push("asyncGenerators")}}},t.exports=n.default},{}],575:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(e){var t=e.types;return{visitor:{ArrowFunctionExpression:function(e,n){if(n.opts.spec){var r=e.node;if(r.shadow)return;r.shadow={this:!1},r.type="FunctionExpression";var i=t.thisExpression();i._forceShadow=e,e.ensureBlock(),e.get("body").unshiftContainer("body",t.expressionStatement(t.callExpression(n.addHelper("newArrowCheck"),[t.thisExpression(),i]))),e.replaceWith(t.callExpression(t.memberExpression(r,t.identifier("bind")),[t.thisExpression()]))}else e.arrowFunctionToShadowed()}}}},t.exports=n.default},{}],576:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return x.isLoop(e.parent)||x.isCatchClause(e.parent)}function s(e){return!!x.isVariableDeclaration(e)&&(!!e[x.BLOCK_SCOPED_SYMBOL]||("let"===e.kind||"const"===e.kind))}function o(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(t||(t=e.node),!x.isFor(n))for(var a=0;a=0)return;s=s+"|"+n.label.name}else{if(t.ignoreLabeless)return;if(t.inSwitchCase)return;if(x.isBreakStatement(n)&&x.isSwitchCase(r))return}t.hasBreakContinue=!0,t.map[s]=n,a=x.stringLiteral(s)}e.isReturnStatement()&&(t.hasReturn=!0,a=x.objectExpression([x.objectProperty(x.identifier("v"),n.argument||i.buildUndefinedNode())])),a&&(a=x.returnStatement(a),a[this.LOOP_IGNORE]=!0,e.skip(),e.replaceWith(x.inherits(a,n)))}}},O=function(){function e(t,n,r,i,a){(0,y.default)(this,e),this.parent=r,this.scope=i,this.file=a,this.blockPath=n,this.block=n.node,this.outsideLetReferences=(0,h.default)(null),this.hasLetReferences=!1,this.letReferences=(0,h.default)(null),this.body=[],t&&(this.loopParent=t.parent,this.loopLabel=x.isLabeledStatement(this.loopParent)&&this.loopParent.label,this.loopPath=t,this.loop=t.node)}return e.prototype.run=function(){var e=this.block;if(!e._letDone){e._letDone=!0;var t=this.getLetReferences();if(x.isFunction(this.parent)||x.isProgram(this.block))return void this.updateScopeInfo();if(this.hasLetReferences)return t?this.wrapClosure():this.remap(),this.updateScopeInfo(t),this.loopLabel&&!x.isLabeledStatement(this.loopParent)?x.labeledStatement(this.loopLabel,this.loop):void 0}},e.prototype.updateScopeInfo=function(e){var t=this.scope,n=t.getFunctionParent(),r=this.letReferences;for(var i in r){var a=r[i],s=t.getBinding(a.name);s&&("let"!==s.kind&&"const"!==s.kind||(s.kind="var",e?t.removeBinding(a.name):t.moveBindingTo(a.name,n)))}},e.prototype.remap=function(){var e=this.letReferences,t=this.scope;for(var n in e){var r=e[n];(t.parentHasBinding(n)||t.hasGlobal(n))&&(t.hasOwnBinding(n)&&t.rename(r.name),this.blockPath.scope.hasOwnBinding(n)&&this.blockPath.scope.rename(r.name))}},e.prototype.wrapClosure=function(){var e=this.block,t=this.outsideLetReferences;if(this.loop)for(var n in t){var r=t[n];(this.scope.hasGlobal(r.name)||this.scope.parentHasBinding(r.name))&&(delete t[r.name],delete this.letReferences[r.name],this.scope.rename(r.name), +this.letReferences[r.name]=r,t[r.name]=r)}this.has=this.checkLoop(),this.hoistVarDeclarations();var i=(0,E.default)(t),a=(0,E.default)(t),s=this.blockPath.isSwitchStatement(),o=x.functionExpression(null,i,x.blockStatement(s?[e]:e.body));o.shadow=!0,this.addContinuations(o);var u=o;this.loop&&(u=this.scope.generateUidIdentifier("loop"),this.loopPath.insertBefore(x.variableDeclaration("var",[x.variableDeclarator(u,o)])));var l=x.callExpression(u,a),c=this.scope.generateUidIdentifier("ret");b.default.hasType(o.body,this.scope,"YieldExpression",x.FUNCTION_TYPES)&&(o.generator=!0,l=x.yieldExpression(l,!0)),b.default.hasType(o.body,this.scope,"AwaitExpression",x.FUNCTION_TYPES)&&(o.async=!0,l=x.awaitExpression(l)),this.buildClosure(c,l),s?this.blockPath.replaceWithMultiple(this.body):e.body=this.body},e.prototype.buildClosure=function(e,t){var n=this.has;n.hasReturn||n.hasBreakContinue?this.buildHas(e,t):this.body.push(x.expressionStatement(t))},e.prototype.addContinuations=function(e){var t={reassignments:{},outsideReferences:this.outsideLetReferences};this.scope.traverse(e,j,t);for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"value",r=arguments[3],i=void 0;e.static?(this.hasStaticDescriptors=!0,i=this.staticMutatorMap):(this.hasInstanceDescriptors=!0,i=this.instanceMutatorMap);var a=y.push(i,e,n,this.file,r);return t&&(a.enumerable=v.booleanLiteral(!0)),a},e.prototype.constructorMeMaybe=function(){for(var e=!1,t=this.path.get("body.body"),n=t,r=Array.isArray(n),i=0,n=r?n:(0,s.default)(n);;){var a;if(r){if(i>=n.length)break;a=n[i++]}else{if(i=n.next(),i.done)break;a=i.value}if(e=a.equals("kind","constructor"))break}if(!e){var o=void 0,u=void 0;if(this.isDerived){var l=x().expression;o=l.params,u=l.body}else o=[],u=v.blockStatement([]);this.path.get("body").unshiftContainer("body",v.classMethod("constructor",v.identifier("constructor"),o,u))}},e.prototype.buildBody=function(){if(this.constructorMeMaybe(),this.pushBody(),this.verifyConstructor(),this.userConstructor){var e=this.constructorBody;e.body=e.body.concat(this.userConstructor.body.body),v.inherits(this.constructor,this.userConstructor),v.inherits(e,this.userConstructor.body)}this.pushDescriptors()},e.prototype.pushBody=function(){for(var e=this.path.get("body.body"),t=e,n=Array.isArray(t),r=0,t=n?t:(0,s.default)(t);;){var i;if(n){if(r>=t.length)break;i=t[r++]}else{if(r=t.next(),r.done)break;i=r.value}var a=i,o=a.node;if(a.isClassProperty())throw a.buildCodeFrameError("Missing class properties transform.");if(o.decorators)throw a.buildCodeFrameError("Method has decorators, put the decorator plugin before the classes one.");if(v.isClassMethod(o)){var u="constructor"===o.kind;if(u&&(a.traverse(E,this),!this.hasBareSuper&&this.isDerived))throw a.buildCodeFrameError("missing super() call in constructor");var l=new p.default({forceSuperMemoisation:u,methodPath:a,methodNode:o,objectRef:this.classRef,superRef:this.superName,isStatic:o.static,isLoose:this.isLoose,scope:this.scope,file:this.file},!0);l.replace(),u?this.pushConstructor(l,o,a):this.pushMethod(o,a)}}},e.prototype.clearDescriptors=function(){this.hasInstanceDescriptors=!1,this.hasStaticDescriptors=!1,this.instanceMutatorMap={},this.staticMutatorMap={}},e.prototype.pushDescriptors=function(){this.pushInherits();var e=this.body,t=void 0,n=void 0;if(this.hasInstanceDescriptors&&(t=y.toClassObject(this.instanceMutatorMap)),this.hasStaticDescriptors&&(n=y.toClassObject(this.staticMutatorMap)),t||n){t&&(t=y.toComputedObjectFromClass(t)),n&&(n=y.toComputedObjectFromClass(n));var r=v.nullLiteral(),i=[this.classRef,r,r,r,r];t&&(i[1]=t),n&&(i[2]=n),this.instanceInitializersId&&(i[3]=this.instanceInitializersId,e.unshift(this.buildObjectAssignment(this.instanceInitializersId))),this.staticInitializersId&&(i[4]=this.staticInitializersId,e.unshift(this.buildObjectAssignment(this.staticInitializersId)));for(var a=0,s=0;s=o.length)break;c=o[l++]}else{if(l=o.next(),l.done)break;c=l.value}var p=c;this.wrapSuperCall(p,i,a,n),r&&p.find(function(e){return e===t||(e.isLoop()||e.isConditional()?(r=!1,!0):void 0)})}for(var f=this.superThises,h=Array.isArray(f),d=0,f=h?f:(0,s.default)(f);;){var y;if(h){if(d>=f.length)break;y=f[d++]}else{if(d=f.next(),d.done)break;y=d.value}y.replaceWith(a)}var m=function(t){return v.callExpression(e.file.addHelper("possibleConstructorReturn"),[a].concat(t||[]))},b=n.get("body");b.length&&!b.pop().isReturnStatement()&&n.pushContainer("body",v.returnStatement(r?a:m()));for(var g=this.superReturns,x=Array.isArray(g),_=0,g=x?g:(0,s.default)(g);;){var E;if(x){if(_>=g.length)break;E=g[_++]}else{if(_=g.next(),_.done)break;E=_.value}var D=E;if(D.node.argument){var C=D.scope.generateDeclaredUidIdentifier("ret");D.get("argument").replaceWithMultiple([v.assignmentExpression("=",C,D.node.argument),m(C)])}else D.get("argument").replaceWith(m())}}},e.prototype.pushMethod=function(e,t){var n=t?t.scope:this.scope;"method"===e.kind&&this._processMethod(e,n)||this.pushToMap(e,!1,null,n)},e.prototype._processMethod=function(){return!1},e.prototype.pushConstructor=function(e,t,n){this.bareSupers=e.bareSupers,this.superReturns=e.returns,n.scope.hasOwnBinding(this.classRef.name)&&n.scope.rename(this.classRef.name);var r=this.constructor;this.userConstructorPath=n,this.userConstructor=t,this.hasConstructor=!0,v.inheritsComments(r,t),r._ignoreUserWhitespace=!0,r.params=t.params,v.inherits(r.body,t.body),r.body.directives=t.body.directives,this._pushConstructor()},e.prototype._pushConstructor=function(){this.pushedConstructor||(this.pushedConstructor=!0,(this.hasInstanceDescriptors||this.hasStaticDescriptors)&&this.pushDescriptors(),this.body.push(this.constructor),this.pushInherits())},e.prototype.pushInherits=function(){this.isDerived&&!this.pushedInherits&&(this.pushedInherits=!0,this.body.unshift(v.expressionStatement(v.callExpression(this.file.addHelper("inherits"),[this.classRef,this.superName]))))},e}();n.default=D,t.exports=n.default},{"babel-helper-define-map":939,"babel-helper-optimise-call-expression":1023,"babel-helper-replace-supers":1024,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/helpers/classCallCheck":1038,"babel-template":1144,"babel-traverse":1284,"babel-types":1480}],939:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){return!g.isClassMethod(e)&&!g.isObjectMethod(e)||"get"!==e.kind&&"set"!==e.kind?"value":e.kind}function s(e,t,n,r,i){var s=g.toKeyAlias(t),o={};if((0,m.default)(e,s)&&(o=e[s]),e[s]=o,o._inherits=o._inherits||[],o._inherits.push(t),o._key=t.key,t.computed&&(o._computed=!0),t.decorators){var u=o.decorators=o.decorators||g.arrayExpression([]);u.elements=u.elements.concat(t.decorators.map(function(e){return e.expression}).reverse())}if(o.value||o.initializer)throw r.buildCodeFrameError(t,"Key conflict with sibling node");var l=void 0,c=void 0;(g.isObjectProperty(t)||g.isObjectMethod(t)||g.isClassMethod(t))&&(l=g.toComputedKey(t,t.key)),g.isObjectProperty(t)||g.isClassProperty(t)?c=t.value:(g.isObjectMethod(t)||g.isClassMethod(t))&&(c=g.functionExpression(null,t.params,t.body,t.generator,t.async),c.returnType=t.returnType);var p=a(t);return n&&"value"===p||(n=p),i&&g.isStringLiteral(l)&&("value"===n||"initializer"===n)&&g.isFunctionExpression(c)&&(c=(0,f.default)({id:l,node:c,scope:i})),c&&(g.inheritsComments(c,t),o[n]=c),o}function o(e){for(var t in e)if(e[t]._computed)return!0;return!1}function u(e){for(var t=g.arrayExpression([]),n=0;n1&&void 0!==arguments[1]&&arguments[1];(0,l.default)(this,e),this.forceSuperMemoisation=t.forceSuperMemoisation,this.methodPath=t.methodPath,this.methodNode=t.methodNode,this.superRef=t.superRef,this.isStatic=t.isStatic,this.hasSuper=!1,this.inClass=n,this.isLoose=t.isLoose,this.scope=this.methodPath.scope,this.file=t.file,this.opts=t,this.bareSupers=[],this.returns=[],this.thises=[]}return e.prototype.getObjectRef=function(){return this.opts.objectRef||this.opts.getObjectRef()},e.prototype.setSuperProperty=function(e,t,n){return b.callExpression(this.file.addHelper("set"),[o(this.getObjectRef(),this.isStatic),n?e:b.stringLiteral(e.name),t,b.thisExpression()])},e.prototype.getSuperProperty=function(e,t){return b.callExpression(this.file.addHelper("get"),[o(this.getObjectRef(),this.isStatic),t?e:b.stringLiteral(e.name),b.thisExpression()])},e.prototype.replace=function(){this.methodPath.traverse(v,this)},e.prototype.getLooseSuperProperty=function(e,t){var n=this.methodNode,r=this.superRef||b.identifier("Function");return t.property===e?void 0:b.isCallExpression(t,{callee:e})?void 0:b.isMemberExpression(t)&&!n.static?b.memberExpression(r,b.identifier("prototype")):r},e.prototype.looseHandle=function(e){var t=e.node;if(e.isSuper())return this.getLooseSuperProperty(t,e.parent);if(e.isCallExpression()){var n=t.callee;if(!b.isMemberExpression(n))return;if(!b.isSuper(n.object))return;return b.appendToMemberExpression(n,b.identifier("call")),t.arguments.unshift(b.thisExpression()),!0}},e.prototype.specHandleAssignmentExpression=function(e,t,n){return"="===n.operator?this.setSuperProperty(n.left.property,n.right,n.left.computed):(e=e||t.scope.generateUidIdentifier("ref"),[b.variableDeclaration("var",[b.variableDeclarator(e,n.left)]),b.expressionStatement(b.assignmentExpression("=",n.left,b.binaryExpression(n.operator[0],e,n.right)))])},e.prototype.specHandle=function(e){var t=void 0,n=void 0,r=void 0,i=e.parent,o=e.node;if(a(o,i))throw e.buildCodeFrameError(y.get("classesIllegalBareSuper"));if(b.isCallExpression(o)){var u=o.callee;if(b.isSuper(u))return;s(u)&&(t=u.property,n=u.computed,r=o.arguments)}else if(b.isMemberExpression(o)&&b.isSuper(o.object))t=o.property,n=o.computed;else{if(b.isUpdateExpression(o)&&s(o.argument)){var l=b.binaryExpression(o.operator[0],o.argument,b.numericLiteral(1));if(o.prefix)return this.specHandleAssignmentExpression(null,e,l);var c=e.scope.generateUidIdentifier("ref");return this.specHandleAssignmentExpression(c,e,l).concat(b.expressionStatement(c))}if(b.isAssignmentExpression(o)&&s(o.left))return this.specHandleAssignmentExpression(null,e,o)}if(t){var p=this.getSuperProperty(t,n);return r?this.optimiseCall(p,r):p}},e.prototype.optimiseCall=function(e,t){var n=b.thisExpression();return n[g]=!0,(0,h.default)(e,n,t)},e}();n.default=x,t.exports=n.default},{"babel-helper-optimise-call-expression":1023,"babel-messages":1025,"babel-runtime/core-js/symbol":1034,"babel-runtime/helpers/classCallCheck":1038,"babel-types":1480}],1025:[function(e,t,n){arguments[4][99][0].apply(n,arguments)},{"babel-runtime/core-js/json/stringify":1027,dup:99,util:35}],1026:[function(e,t,n){arguments[4][100][0].apply(n,arguments)},{"core-js/library/fn/get-iterator":1042,dup:100}],1027:[function(e,t,n){arguments[4][101][0].apply(n,arguments)},{"core-js/library/fn/json/stringify":1043,dup:101}],1028:[function(e,t,n){arguments[4][102][0].apply(n,arguments)},{"core-js/library/fn/map":1044,dup:102}],1029:[function(e,t,n){arguments[4][103][0].apply(n,arguments)},{"core-js/library/fn/number/max-safe-integer":1045,dup:103}],1030:[function(e,t,n){arguments[4][105][0].apply(n,arguments)},{"core-js/library/fn/object/create":1046,dup:105}],1031:[function(e,t,n){arguments[4][106][0].apply(n,arguments)},{"core-js/library/fn/object/get-own-property-symbols":1047,dup:106}],1032:[function(e,t,n){arguments[4][107][0].apply(n,arguments)},{"core-js/library/fn/object/keys":1048,dup:107}],1033:[function(e,t,n){arguments[4][108][0].apply(n,arguments)},{"core-js/library/fn/object/set-prototype-of":1049,dup:108}],1034:[function(e,t,n){arguments[4][109][0].apply(n,arguments)},{"core-js/library/fn/symbol":1051,dup:109}],1035:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{"core-js/library/fn/symbol/for":1050,dup:110}],1036:[function(e,t,n){arguments[4][111][0].apply(n,arguments)},{"core-js/library/fn/symbol/iterator":1052,dup:111}],1037:[function(e,t,n){arguments[4][112][0].apply(n,arguments)},{"core-js/library/fn/weak-map":1053,dup:112}],1038:[function(e,t,n){arguments[4][114][0].apply(n,arguments)},{dup:114}],1039:[function(e,t,n){arguments[4][115][0].apply(n,arguments)},{"../core-js/object/create":1030,"../core-js/object/set-prototype-of":1033,"../helpers/typeof":1041,dup:115}],1040:[function(e,t,n){arguments[4][117][0].apply(n,arguments)},{"../helpers/typeof":1041,dup:117}],1041:[function(e,t,n){arguments[4][118][0].apply(n,arguments)},{"../core-js/symbol":1034,"../core-js/symbol/iterator":1036,dup:118}],1042:[function(e,t,n){arguments[4][119][0].apply(n,arguments)},{"../modules/core.get-iterator":1129,"../modules/es6.string.iterator":1137,"../modules/web.dom.iterable":1143,dup:119}],1043:[function(e,t,n){arguments[4][120][0].apply(n,arguments)},{"../../modules/_core":1069,dup:120}],1044:[function(e,t,n){arguments[4][121][0].apply(n,arguments)},{"../modules/_core":1069,"../modules/es6.map":1131,"../modules/es6.object.to-string":1136,"../modules/es6.string.iterator":1137,"../modules/es7.map.to-json":1140,"../modules/web.dom.iterable":1143,dup:121}],1045:[function(e,t,n){arguments[4][122][0].apply(n,arguments)},{"../../modules/es6.number.max-safe-integer":1132,dup:122}],1046:[function(e,t,n){arguments[4][124][0].apply(n,arguments)},{"../../modules/_core":1069,"../../modules/es6.object.create":1133,dup:124}],1047:[function(e,t,n){arguments[4][125][0].apply(n,arguments)},{"../../modules/_core":1069,"../../modules/es6.symbol":1138,dup:125}],1048:[function(e,t,n){arguments[4][126][0].apply(n,arguments)},{"../../modules/_core":1069,"../../modules/es6.object.keys":1134,dup:126}],1049:[function(e,t,n){arguments[4][127][0].apply(n,arguments)},{"../../modules/_core":1069,"../../modules/es6.object.set-prototype-of":1135,dup:127}],1050:[function(e,t,n){arguments[4][128][0].apply(n,arguments)},{"../../modules/_core":1069,"../../modules/es6.symbol":1138,dup:128}],1051:[function(e,t,n){arguments[4][129][0].apply(n,arguments)},{"../../modules/_core":1069,"../../modules/es6.object.to-string":1136,"../../modules/es6.symbol":1138,"../../modules/es7.symbol.async-iterator":1141,"../../modules/es7.symbol.observable":1142,dup:129}],1052:[function(e,t,n){arguments[4][130][0].apply(n,arguments)},{"../../modules/_wks-ext":1126,"../../modules/es6.string.iterator":1137,"../../modules/web.dom.iterable":1143,dup:130}],1053:[function(e,t,n){arguments[4][131][0].apply(n,arguments)},{"../modules/_core":1069,"../modules/es6.object.to-string":1136,"../modules/es6.weak-map":1139,"../modules/web.dom.iterable":1143,dup:131}],1054:[function(e,t,n){arguments[4][133][0].apply(n,arguments)},{dup:133}],1055:[function(e,t,n){arguments[4][134][0].apply(n,arguments)},{dup:134}],1056:[function(e,t,n){arguments[4][135][0].apply(n,arguments)},{dup:135}],1057:[function(e,t,n){arguments[4][136][0].apply(n,arguments)},{"./_is-object":1087,dup:136}],1058:[function(e,t,n){arguments[4][137][0].apply(n,arguments)},{"./_for-of":1078,dup:137}],1059:[function(e,t,n){arguments[4][138][0].apply(n,arguments)},{"./_to-index":1118,"./_to-iobject":1120,"./_to-length":1121,dup:138}],1060:[function(e,t,n){arguments[4][139][0].apply(n,arguments)},{"./_array-species-create":1062,"./_ctx":1070,"./_iobject":1084,"./_to-length":1121,"./_to-object":1122,dup:139}],1061:[function(e,t,n){arguments[4][140][0].apply(n,arguments)},{"./_is-array":1086,"./_is-object":1087,"./_wks":1127,dup:140}],1062:[function(e,t,n){arguments[4][141][0].apply(n,arguments)},{"./_array-species-constructor":1061,dup:141}],1063:[function(e,t,n){arguments[4][142][0].apply(n,arguments)},{"./_cof":1064,"./_wks":1127,dup:142}],1064:[function(e,t,n){arguments[4][143][0].apply(n,arguments)},{dup:143}],1065:[function(e,t,n){arguments[4][144][0].apply(n,arguments)},{"./_an-instance":1056,"./_ctx":1070,"./_defined":1071,"./_descriptors":1072,"./_for-of":1078,"./_iter-define":1090,"./_iter-step":1091,"./_meta":1095,"./_object-create":1097,"./_object-dp":1098,"./_redefine-all":1110,"./_set-species":1113,dup:144}],1066:[function(e,t,n){arguments[4][145][0].apply(n,arguments)},{"./_array-from-iterable":1058,"./_classof":1063,dup:145}],1067:[function(e,t,n){arguments[4][146][0].apply(n,arguments)},{"./_an-instance":1056,"./_an-object":1057,"./_array-methods":1060,"./_for-of":1078,"./_has":1080,"./_is-object":1087,"./_meta":1095,"./_redefine-all":1110,dup:146}],1068:[function(e,t,n){arguments[4][147][0].apply(n,arguments)},{"./_an-instance":1056,"./_array-methods":1060,"./_descriptors":1072,"./_export":1076,"./_fails":1077,"./_for-of":1078,"./_global":1079,"./_hide":1081,"./_is-object":1087,"./_meta":1095,"./_object-dp":1098,"./_redefine-all":1110,"./_set-to-string-tag":1114,dup:147}],1069:[function(e,t,n){arguments[4][148][0].apply(n,arguments)},{dup:148}],1070:[function(e,t,n){arguments[4][149][0].apply(n,arguments)},{"./_a-function":1054,dup:149}],1071:[function(e,t,n){arguments[4][150][0].apply(n,arguments)},{dup:150}],1072:[function(e,t,n){arguments[4][151][0].apply(n,arguments)},{"./_fails":1077,dup:151}],1073:[function(e,t,n){arguments[4][152][0].apply(n,arguments)},{"./_global":1079,"./_is-object":1087,dup:152}],1074:[function(e,t,n){arguments[4][153][0].apply(n,arguments)},{dup:153}],1075:[function(e,t,n){arguments[4][154][0].apply(n,arguments)},{"./_object-gops":1103,"./_object-keys":1106,"./_object-pie":1107,dup:154}],1076:[function(e,t,n){arguments[4][155][0].apply(n,arguments)},{"./_core":1069,"./_ctx":1070,"./_global":1079,"./_hide":1081,dup:155}],1077:[function(e,t,n){arguments[4][156][0].apply(n,arguments)},{dup:156}],1078:[function(e,t,n){arguments[4][157][0].apply(n,arguments)},{"./_an-object":1057,"./_ctx":1070,"./_is-array-iter":1085,"./_iter-call":1088,"./_to-length":1121,"./core.get-iterator-method":1128,dup:157}],1079:[function(e,t,n){arguments[4][158][0].apply(n,arguments)},{dup:158}],1080:[function(e,t,n){arguments[4][159][0].apply(n,arguments)},{dup:159}],1081:[function(e,t,n){arguments[4][160][0].apply(n,arguments)},{"./_descriptors":1072,"./_object-dp":1098,"./_property-desc":1109,dup:160}],1082:[function(e,t,n){arguments[4][161][0].apply(n,arguments)},{"./_global":1079,dup:161}],1083:[function(e,t,n){arguments[4][162][0].apply(n,arguments)},{"./_descriptors":1072,"./_dom-create":1073,"./_fails":1077,dup:162}],1084:[function(e,t,n){arguments[4][163][0].apply(n,arguments)},{"./_cof":1064,dup:163}],1085:[function(e,t,n){arguments[4][164][0].apply(n,arguments)},{"./_iterators":1092,"./_wks":1127,dup:164}],1086:[function(e,t,n){arguments[4][165][0].apply(n,arguments)},{"./_cof":1064,dup:165}],1087:[function(e,t,n){arguments[4][166][0].apply(n,arguments)},{dup:166}],1088:[function(e,t,n){arguments[4][167][0].apply(n,arguments)},{"./_an-object":1057,dup:167}],1089:[function(e,t,n){arguments[4][168][0].apply(n,arguments)},{"./_hide":1081,"./_object-create":1097,"./_property-desc":1109,"./_set-to-string-tag":1114,"./_wks":1127,dup:168}],1090:[function(e,t,n){arguments[4][169][0].apply(n,arguments)},{"./_export":1076,"./_has":1080,"./_hide":1081,"./_iter-create":1089,"./_iterators":1092,"./_library":1094,"./_object-gpo":1104,"./_redefine":1111,"./_set-to-string-tag":1114,"./_wks":1127,dup:169}],1091:[function(e,t,n){arguments[4][170][0].apply(n,arguments)},{dup:170}],1092:[function(e,t,n){arguments[4][171][0].apply(n,arguments)},{dup:171}],1093:[function(e,t,n){arguments[4][172][0].apply(n,arguments)},{"./_object-keys":1106,"./_to-iobject":1120,dup:172}],1094:[function(e,t,n){arguments[4][173][0].apply(n,arguments)},{dup:173}],1095:[function(e,t,n){arguments[4][174][0].apply(n,arguments)},{"./_fails":1077,"./_has":1080,"./_is-object":1087,"./_object-dp":1098,"./_uid":1124,dup:174}],1096:[function(e,t,n){arguments[4][175][0].apply(n,arguments)},{"./_fails":1077,"./_iobject":1084,"./_object-gops":1103,"./_object-keys":1106,"./_object-pie":1107,"./_to-object":1122,dup:175}],1097:[function(e,t,n){arguments[4][176][0].apply(n,arguments)},{"./_an-object":1057,"./_dom-create":1073,"./_enum-bug-keys":1074,"./_html":1082,"./_object-dps":1099,"./_shared-key":1115,dup:176}],1098:[function(e,t,n){arguments[4][177][0].apply(n,arguments)},{"./_an-object":1057,"./_descriptors":1072,"./_ie8-dom-define":1083,"./_to-primitive":1123,dup:177}],1099:[function(e,t,n){arguments[4][178][0].apply(n,arguments)},{"./_an-object":1057,"./_descriptors":1072,"./_object-dp":1098,"./_object-keys":1106,dup:178}],1100:[function(e,t,n){arguments[4][179][0].apply(n,arguments)},{"./_descriptors":1072,"./_has":1080,"./_ie8-dom-define":1083,"./_object-pie":1107,"./_property-desc":1109,"./_to-iobject":1120,"./_to-primitive":1123,dup:179}],1101:[function(e,t,n){arguments[4][180][0].apply(n,arguments)},{"./_object-gopn":1102,"./_to-iobject":1120,dup:180}],1102:[function(e,t,n){arguments[4][181][0].apply(n,arguments)},{"./_enum-bug-keys":1074,"./_object-keys-internal":1105,dup:181}],1103:[function(e,t,n){arguments[4][182][0].apply(n,arguments)},{dup:182}],1104:[function(e,t,n){arguments[4][183][0].apply(n,arguments)},{"./_has":1080,"./_shared-key":1115,"./_to-object":1122,dup:183}],1105:[function(e,t,n){arguments[4][184][0].apply(n,arguments)},{"./_array-includes":1059,"./_has":1080,"./_shared-key":1115,"./_to-iobject":1120,dup:184}],1106:[function(e,t,n){arguments[4][185][0].apply(n,arguments)},{"./_enum-bug-keys":1074,"./_object-keys-internal":1105,dup:185}],1107:[function(e,t,n){arguments[4][186][0].apply(n,arguments)},{dup:186}],1108:[function(e,t,n){arguments[4][187][0].apply(n,arguments)},{"./_core":1069,"./_export":1076,"./_fails":1077,dup:187}],1109:[function(e,t,n){arguments[4][188][0].apply(n,arguments)},{dup:188}],1110:[function(e,t,n){arguments[4][189][0].apply(n,arguments)},{"./_hide":1081,dup:189}],1111:[function(e,t,n){arguments[4][190][0].apply(n,arguments)},{"./_hide":1081,dup:190}],1112:[function(e,t,n){arguments[4][191][0].apply(n,arguments)},{"./_an-object":1057,"./_ctx":1070,"./_is-object":1087,"./_object-gopd":1100,dup:191}],1113:[function(e,t,n){arguments[4][192][0].apply(n,arguments)},{"./_core":1069,"./_descriptors":1072,"./_global":1079,"./_object-dp":1098,"./_wks":1127,dup:192}],1114:[function(e,t,n){arguments[4][193][0].apply(n,arguments)},{"./_has":1080,"./_object-dp":1098,"./_wks":1127,dup:193}],1115:[function(e,t,n){arguments[4][194][0].apply(n,arguments)},{"./_shared":1116,"./_uid":1124,dup:194}],1116:[function(e,t,n){arguments[4][195][0].apply(n,arguments)},{"./_global":1079,dup:195}],1117:[function(e,t,n){arguments[4][196][0].apply(n,arguments)},{"./_defined":1071,"./_to-integer":1119,dup:196}],1118:[function(e,t,n){arguments[4][197][0].apply(n,arguments)},{"./_to-integer":1119,dup:197}],1119:[function(e,t,n){arguments[4][198][0].apply(n,arguments)},{dup:198}],1120:[function(e,t,n){arguments[4][199][0].apply(n,arguments)},{"./_defined":1071,"./_iobject":1084,dup:199}],1121:[function(e,t,n){arguments[4][200][0].apply(n,arguments)},{"./_to-integer":1119,dup:200}],1122:[function(e,t,n){arguments[4][201][0].apply(n,arguments)},{"./_defined":1071,dup:201}],1123:[function(e,t,n){arguments[4][202][0].apply(n,arguments)},{"./_is-object":1087,dup:202}],1124:[function(e,t,n){arguments[4][203][0].apply(n,arguments)},{dup:203}],1125:[function(e,t,n){arguments[4][204][0].apply(n,arguments)},{"./_core":1069,"./_global":1079,"./_library":1094,"./_object-dp":1098,"./_wks-ext":1126,dup:204}],1126:[function(e,t,n){arguments[4][205][0].apply(n,arguments)},{"./_wks":1127,dup:205}],1127:[function(e,t,n){arguments[4][206][0].apply(n,arguments)},{"./_global":1079,"./_shared":1116,"./_uid":1124,dup:206}],1128:[function(e,t,n){arguments[4][207][0].apply(n,arguments)},{"./_classof":1063,"./_core":1069,"./_iterators":1092,"./_wks":1127,dup:207}],1129:[function(e,t,n){arguments[4][208][0].apply(n,arguments)},{"./_an-object":1057,"./_core":1069,"./core.get-iterator-method":1128,dup:208}],1130:[function(e,t,n){arguments[4][209][0].apply(n,arguments)},{"./_add-to-unscopables":1055,"./_iter-define":1090,"./_iter-step":1091,"./_iterators":1092,"./_to-iobject":1120,dup:209}],1131:[function(e,t,n){arguments[4][210][0].apply(n,arguments)},{"./_collection":1068,"./_collection-strong":1065,dup:210}],1132:[function(e,t,n){arguments[4][211][0].apply(n,arguments)},{"./_export":1076,dup:211}],1133:[function(e,t,n){arguments[4][213][0].apply(n,arguments)},{"./_export":1076,"./_object-create":1097,dup:213}],1134:[function(e,t,n){arguments[4][214][0].apply(n,arguments)},{"./_object-keys":1106,"./_object-sap":1108,"./_to-object":1122,dup:214}],1135:[function(e,t,n){arguments[4][215][0].apply(n,arguments)},{"./_export":1076,"./_set-proto":1112,dup:215}],1136:[function(e,t,n){arguments[4][1][0].apply(n,arguments)},{dup:1}],1137:[function(e,t,n){arguments[4][217][0].apply(n,arguments)},{"./_iter-define":1090,"./_string-at":1117,dup:217}],1138:[function(e,t,n){arguments[4][218][0].apply(n,arguments)},{"./_an-object":1057,"./_descriptors":1072,"./_enum-keys":1075,"./_export":1076,"./_fails":1077,"./_global":1079,"./_has":1080,"./_hide":1081,"./_is-array":1086,"./_keyof":1093,"./_library":1094,"./_meta":1095,"./_object-create":1097,"./_object-dp":1098,"./_object-gopd":1100,"./_object-gopn":1102,"./_object-gopn-ext":1101,"./_object-gops":1103,"./_object-keys":1106,"./_object-pie":1107,"./_property-desc":1109,"./_redefine":1111,"./_set-to-string-tag":1114,"./_shared":1116,"./_to-iobject":1120,"./_to-primitive":1123,"./_uid":1124,"./_wks":1127,"./_wks-define":1125,"./_wks-ext":1126,dup:218}],1139:[function(e,t,n){arguments[4][219][0].apply(n,arguments)},{"./_array-methods":1060,"./_collection":1068,"./_collection-weak":1067,"./_is-object":1087,"./_meta":1095,"./_object-assign":1096,"./_redefine":1111,dup:219}],1140:[function(e,t,n){arguments[4][221][0].apply(n,arguments)},{"./_collection-to-json":1066,"./_export":1076,dup:221}],1141:[function(e,t,n){arguments[4][222][0].apply(n,arguments)},{"./_wks-define":1125,dup:222}],1142:[function(e,t,n){arguments[4][223][0].apply(n,arguments)},{"./_wks-define":1125,dup:223}],1143:[function(e,t,n){arguments[4][224][0].apply(n,arguments)},{"./_global":1079,"./_hide":1081,"./_iterators":1092,"./_wks":1127,"./es6.array.iterator":1130,dup:224}],1144:[function(e,t,n){arguments[4][225][0].apply(n,arguments)},{"babel-runtime/core-js/symbol":1034,"babel-traverse":1284,"babel-types":1480,babylon:1145,dup:225,"lodash/assign":1259,"lodash/cloneDeep":1260,"lodash/has":1263}],1145:[function(e,t,n){arguments[4][274][0].apply(n,arguments)},{dup:274}],1146:[function(e,t,n){arguments[4][282][0].apply(n,arguments)},{"./_getNative":1206,"./_root":1247,dup:282}],1147:[function(e,t,n){arguments[4][283][0].apply(n,arguments)},{"./_hashClear":1214,"./_hashDelete":1215,"./_hashGet":1216,"./_hashHas":1217,"./_hashSet":1218,dup:283}],1148:[function(e,t,n){arguments[4][284][0].apply(n,arguments)},{"./_listCacheClear":1228,"./_listCacheDelete":1229,"./_listCacheGet":1230,"./_listCacheHas":1231,"./_listCacheSet":1232,dup:284}],1149:[function(e,t,n){arguments[4][285][0].apply(n,arguments)},{"./_getNative":1206,"./_root":1247,dup:285}],1150:[function(e,t,n){arguments[4][286][0].apply(n,arguments)},{"./_mapCacheClear":1233,"./_mapCacheDelete":1234,"./_mapCacheGet":1235,"./_mapCacheHas":1236,"./_mapCacheSet":1237,dup:286}],1151:[function(e,t,n){arguments[4][287][0].apply(n,arguments)},{"./_getNative":1206,"./_root":1247,dup:287}],1152:[function(e,t,n){arguments[4][288][0].apply(n,arguments)},{"./_getNative":1206,"./_root":1247,dup:288}],1153:[function(e,t,n){arguments[4][290][0].apply(n,arguments)},{"./_ListCache":1148,"./_stackClear":1251,"./_stackDelete":1252,"./_stackGet":1253,"./_stackHas":1254,"./_stackSet":1255,dup:290}],1154:[function(e,t,n){arguments[4][291][0].apply(n,arguments)},{"./_root":1247,dup:291}],1155:[function(e,t,n){arguments[4][292][0].apply(n,arguments)},{"./_root":1247,dup:292}],1156:[function(e,t,n){arguments[4][293][0].apply(n,arguments)},{"./_getNative":1206,"./_root":1247,dup:293}],1157:[function(e,t,n){arguments[4][294][0].apply(n,arguments)},{dup:294}], +1158:[function(e,t,n){arguments[4][295][0].apply(n,arguments)},{dup:295}],1159:[function(e,t,n){arguments[4][296][0].apply(n,arguments)},{dup:296}],1160:[function(e,t,n){arguments[4][297][0].apply(n,arguments)},{dup:297}],1161:[function(e,t,n){arguments[4][298][0].apply(n,arguments)},{dup:298}],1162:[function(e,t,n){arguments[4][301][0].apply(n,arguments)},{"./_baseTimes":1183,"./_isIndex":1222,"./isArguments":1265,"./isArray":1266,"./isBuffer":1268,"./isTypedArray":1274,dup:301}],1163:[function(e,t,n){arguments[4][302][0].apply(n,arguments)},{dup:302}],1164:[function(e,t,n){arguments[4][303][0].apply(n,arguments)},{dup:303}],1165:[function(e,t,n){arguments[4][304][0].apply(n,arguments)},{dup:304}],1166:[function(e,t,n){arguments[4][308][0].apply(n,arguments)},{"./_baseAssignValue":1170,"./eq":1262,dup:308}],1167:[function(e,t,n){arguments[4][309][0].apply(n,arguments)},{"./eq":1262,dup:309}],1168:[function(e,t,n){arguments[4][310][0].apply(n,arguments)},{"./_copyObject":1196,"./keys":1275,dup:310}],1169:[function(e,t,n){arguments[4][311][0].apply(n,arguments)},{"./_copyObject":1196,"./keysIn":1276,dup:311}],1170:[function(e,t,n){arguments[4][312][0].apply(n,arguments)},{"./_defineProperty":1201,dup:312}],1171:[function(e,t,n){arguments[4][314][0].apply(n,arguments)},{"./_Stack":1153,"./_arrayEach":1160,"./_assignValue":1166,"./_baseAssign":1168,"./_baseAssignIn":1169,"./_cloneBuffer":1188,"./_copyArray":1195,"./_copySymbols":1197,"./_copySymbolsIn":1198,"./_getAllKeys":1203,"./_getAllKeysIn":1204,"./_getTag":1211,"./_initCloneArray":1219,"./_initCloneByTag":1220,"./_initCloneObject":1221,"./isArray":1266,"./isBuffer":1268,"./isObject":1271,"./keys":1275,dup:314}],1172:[function(e,t,n){arguments[4][315][0].apply(n,arguments)},{"./isObject":1271,dup:315}],1173:[function(e,t,n){arguments[4][322][0].apply(n,arguments)},{"./_arrayPush":1164,"./isArray":1266,dup:322}],1174:[function(e,t,n){arguments[4][323][0].apply(n,arguments)},{"./_Symbol":1154,"./_getRawTag":1208,"./_objectToString":1244,dup:323}],1175:[function(e,t,n){arguments[4][324][0].apply(n,arguments)},{dup:324}],1176:[function(e,t,n){arguments[4][327][0].apply(n,arguments)},{"./_baseGetTag":1174,"./isObjectLike":1272,dup:327}],1177:[function(e,t,n){arguments[4][332][0].apply(n,arguments)},{"./_isMasked":1226,"./_toSource":1258,"./isFunction":1269,"./isObject":1271,dup:332}],1178:[function(e,t,n){arguments[4][334][0].apply(n,arguments)},{"./_baseGetTag":1174,"./isLength":1270,"./isObjectLike":1272,dup:334}],1179:[function(e,t,n){arguments[4][336][0].apply(n,arguments)},{"./_isPrototype":1227,"./_nativeKeys":1241,dup:336}],1180:[function(e,t,n){arguments[4][337][0].apply(n,arguments)},{"./_isPrototype":1227,"./_nativeKeysIn":1242,"./isObject":1271,dup:337}],1181:[function(e,t,n){arguments[4][347][0].apply(n,arguments)},{"./_overRest":1246,"./_setToString":1249,"./identity":1264,dup:347}],1182:[function(e,t,n){arguments[4][348][0].apply(n,arguments)},{"./_defineProperty":1201,"./constant":1261,"./identity":1264,dup:348}],1183:[function(e,t,n){arguments[4][351][0].apply(n,arguments)},{dup:351}],1184:[function(e,t,n){arguments[4][352][0].apply(n,arguments)},{"./_Symbol":1154,"./_arrayMap":1163,"./isArray":1266,"./isSymbol":1273,dup:352}],1185:[function(e,t,n){arguments[4][353][0].apply(n,arguments)},{dup:353}],1186:[function(e,t,n){arguments[4][358][0].apply(n,arguments)},{"./_isKey":1224,"./_stringToPath":1256,"./isArray":1266,"./toString":1280,dup:358}],1187:[function(e,t,n){arguments[4][361][0].apply(n,arguments)},{"./_Uint8Array":1155,dup:361}],1188:[function(e,t,n){arguments[4][362][0].apply(n,arguments)},{"./_root":1247,dup:362}],1189:[function(e,t,n){arguments[4][363][0].apply(n,arguments)},{"./_cloneArrayBuffer":1187,dup:363}],1190:[function(e,t,n){arguments[4][364][0].apply(n,arguments)},{"./_addMapEntry":1157,"./_arrayReduce":1165,"./_mapToArray":1238,dup:364}],1191:[function(e,t,n){arguments[4][365][0].apply(n,arguments)},{dup:365}],1192:[function(e,t,n){arguments[4][366][0].apply(n,arguments)},{"./_addSetEntry":1158,"./_arrayReduce":1165,"./_setToArray":1248,dup:366}],1193:[function(e,t,n){arguments[4][367][0].apply(n,arguments)},{"./_Symbol":1154,dup:367}],1194:[function(e,t,n){arguments[4][368][0].apply(n,arguments)},{"./_cloneArrayBuffer":1187,dup:368}],1195:[function(e,t,n){arguments[4][371][0].apply(n,arguments)},{dup:371}],1196:[function(e,t,n){arguments[4][372][0].apply(n,arguments)},{"./_assignValue":1166,"./_baseAssignValue":1170,dup:372}],1197:[function(e,t,n){arguments[4][373][0].apply(n,arguments)},{"./_copyObject":1196,"./_getSymbols":1209,dup:373}],1198:[function(e,t,n){arguments[4][374][0].apply(n,arguments)},{"./_copyObject":1196,"./_getSymbolsIn":1210,dup:374}],1199:[function(e,t,n){arguments[4][375][0].apply(n,arguments)},{"./_root":1247,dup:375}],1200:[function(e,t,n){arguments[4][376][0].apply(n,arguments)},{"./_baseRest":1181,"./_isIterateeCall":1223,dup:376}],1201:[function(e,t,n){arguments[4][382][0].apply(n,arguments)},{"./_getNative":1206,dup:382}],1202:[function(e,t,n){arguments[4][386][0].apply(n,arguments)},{dup:386}],1203:[function(e,t,n){arguments[4][387][0].apply(n,arguments)},{"./_baseGetAllKeys":1173,"./_getSymbols":1209,"./keys":1275,dup:387}],1204:[function(e,t,n){arguments[4][388][0].apply(n,arguments)},{"./_baseGetAllKeys":1173,"./_getSymbolsIn":1210,"./keysIn":1276,dup:388}],1205:[function(e,t,n){arguments[4][389][0].apply(n,arguments)},{"./_isKeyable":1225,dup:389}],1206:[function(e,t,n){arguments[4][391][0].apply(n,arguments)},{"./_baseIsNative":1177,"./_getValue":1212,dup:391}],1207:[function(e,t,n){arguments[4][392][0].apply(n,arguments)},{"./_overArg":1245,dup:392}],1208:[function(e,t,n){arguments[4][393][0].apply(n,arguments)},{"./_Symbol":1154,dup:393}],1209:[function(e,t,n){arguments[4][394][0].apply(n,arguments)},{"./_arrayFilter":1161,"./stubArray":1278,dup:394}],1210:[function(e,t,n){arguments[4][395][0].apply(n,arguments)},{"./_arrayPush":1164,"./_getPrototype":1207,"./_getSymbols":1209,"./stubArray":1278,dup:395}],1211:[function(e,t,n){arguments[4][396][0].apply(n,arguments)},{"./_DataView":1146,"./_Map":1149,"./_Promise":1151,"./_Set":1152,"./_WeakMap":1156,"./_baseGetTag":1174,"./_toSource":1258,dup:396}],1212:[function(e,t,n){arguments[4][397][0].apply(n,arguments)},{dup:397}],1213:[function(e,t,n){arguments[4][398][0].apply(n,arguments)},{"./_castPath":1186,"./_isIndex":1222,"./_toKey":1257,"./isArguments":1265,"./isArray":1266,"./isLength":1270,dup:398}],1214:[function(e,t,n){arguments[4][400][0].apply(n,arguments)},{"./_nativeCreate":1240,dup:400}],1215:[function(e,t,n){arguments[4][401][0].apply(n,arguments)},{dup:401}],1216:[function(e,t,n){arguments[4][402][0].apply(n,arguments)},{"./_nativeCreate":1240,dup:402}],1217:[function(e,t,n){arguments[4][403][0].apply(n,arguments)},{"./_nativeCreate":1240,dup:403}],1218:[function(e,t,n){arguments[4][404][0].apply(n,arguments)},{"./_nativeCreate":1240,dup:404}],1219:[function(e,t,n){arguments[4][405][0].apply(n,arguments)},{dup:405}],1220:[function(e,t,n){arguments[4][406][0].apply(n,arguments)},{"./_cloneArrayBuffer":1187,"./_cloneDataView":1189,"./_cloneMap":1190,"./_cloneRegExp":1191,"./_cloneSet":1192,"./_cloneSymbol":1193,"./_cloneTypedArray":1194,dup:406}],1221:[function(e,t,n){arguments[4][407][0].apply(n,arguments)},{"./_baseCreate":1172,"./_getPrototype":1207,"./_isPrototype":1227,dup:407}],1222:[function(e,t,n){arguments[4][409][0].apply(n,arguments)},{dup:409}],1223:[function(e,t,n){arguments[4][410][0].apply(n,arguments)},{"./_isIndex":1222,"./eq":1262,"./isArrayLike":1267,"./isObject":1271,dup:410}],1224:[function(e,t,n){arguments[4][411][0].apply(n,arguments)},{"./isArray":1266,"./isSymbol":1273,dup:411}],1225:[function(e,t,n){arguments[4][412][0].apply(n,arguments)},{dup:412}],1226:[function(e,t,n){arguments[4][413][0].apply(n,arguments)},{"./_coreJsData":1199,dup:413}],1227:[function(e,t,n){arguments[4][414][0].apply(n,arguments)},{dup:414}],1228:[function(e,t,n){arguments[4][416][0].apply(n,arguments)},{dup:416}],1229:[function(e,t,n){arguments[4][417][0].apply(n,arguments)},{"./_assocIndexOf":1167,dup:417}],1230:[function(e,t,n){arguments[4][418][0].apply(n,arguments)},{"./_assocIndexOf":1167,dup:418}],1231:[function(e,t,n){arguments[4][419][0].apply(n,arguments)},{"./_assocIndexOf":1167,dup:419}],1232:[function(e,t,n){arguments[4][420][0].apply(n,arguments)},{"./_assocIndexOf":1167,dup:420}],1233:[function(e,t,n){arguments[4][421][0].apply(n,arguments)},{"./_Hash":1147,"./_ListCache":1148,"./_Map":1149,dup:421}],1234:[function(e,t,n){arguments[4][422][0].apply(n,arguments)},{"./_getMapData":1205,dup:422}],1235:[function(e,t,n){arguments[4][423][0].apply(n,arguments)},{"./_getMapData":1205,dup:423}],1236:[function(e,t,n){arguments[4][424][0].apply(n,arguments)},{"./_getMapData":1205,dup:424}],1237:[function(e,t,n){arguments[4][425][0].apply(n,arguments)},{"./_getMapData":1205,dup:425}],1238:[function(e,t,n){arguments[4][426][0].apply(n,arguments)},{dup:426}],1239:[function(e,t,n){arguments[4][428][0].apply(n,arguments)},{"./memoize":1277,dup:428}],1240:[function(e,t,n){arguments[4][429][0].apply(n,arguments)},{"./_getNative":1206,dup:429}],1241:[function(e,t,n){arguments[4][430][0].apply(n,arguments)},{"./_overArg":1245,dup:430}],1242:[function(e,t,n){arguments[4][431][0].apply(n,arguments)},{dup:431}],1243:[function(e,t,n){arguments[4][432][0].apply(n,arguments)},{"./_freeGlobal":1202,dup:432}],1244:[function(e,t,n){arguments[4][433][0].apply(n,arguments)},{dup:433}],1245:[function(e,t,n){arguments[4][434][0].apply(n,arguments)},{dup:434}],1246:[function(e,t,n){arguments[4][435][0].apply(n,arguments)},{"./_apply":1159,dup:435}],1247:[function(e,t,n){arguments[4][436][0].apply(n,arguments)},{"./_freeGlobal":1202,dup:436}],1248:[function(e,t,n){arguments[4][439][0].apply(n,arguments)},{dup:439}],1249:[function(e,t,n){arguments[4][440][0].apply(n,arguments)},{"./_baseSetToString":1182,"./_shortOut":1250,dup:440}],1250:[function(e,t,n){arguments[4][441][0].apply(n,arguments)},{dup:441}],1251:[function(e,t,n){arguments[4][442][0].apply(n,arguments)},{"./_ListCache":1148,dup:442}],1252:[function(e,t,n){arguments[4][443][0].apply(n,arguments)},{dup:443}],1253:[function(e,t,n){arguments[4][444][0].apply(n,arguments)},{dup:444}],1254:[function(e,t,n){arguments[4][445][0].apply(n,arguments)},{dup:445}],1255:[function(e,t,n){arguments[4][446][0].apply(n,arguments)},{"./_ListCache":1148,"./_Map":1149,"./_MapCache":1150,dup:446}],1256:[function(e,t,n){arguments[4][449][0].apply(n,arguments)},{"./_memoizeCapped":1239,dup:449}],1257:[function(e,t,n){arguments[4][450][0].apply(n,arguments)},{"./isSymbol":1273,dup:450}],1258:[function(e,t,n){arguments[4][451][0].apply(n,arguments)},{dup:451}],1259:[function(e,t,n){arguments[4][453][0].apply(n,arguments)},{"./_assignValue":1166,"./_copyObject":1196,"./_createAssigner":1200,"./_isPrototype":1227,"./isArrayLike":1267,"./keys":1275,dup:453}],1260:[function(e,t,n){arguments[4][456][0].apply(n,arguments)},{"./_baseClone":1171,dup:456}],1261:[function(e,t,n){arguments[4][459][0].apply(n,arguments)},{dup:459}],1262:[function(e,t,n){arguments[4][462][0].apply(n,arguments)},{dup:462}],1263:[function(e,t,n){arguments[4][470][0].apply(n,arguments)},{"./_baseHas":1175,"./_hasPath":1213,dup:470}],1264:[function(e,t,n){arguments[4][472][0].apply(n,arguments)},{dup:472}],1265:[function(e,t,n){arguments[4][474][0].apply(n,arguments)},{"./_baseIsArguments":1176,"./isObjectLike":1272,dup:474}],1266:[function(e,t,n){arguments[4][475][0].apply(n,arguments)},{dup:475}],1267:[function(e,t,n){arguments[4][476][0].apply(n,arguments)},{"./isFunction":1269,"./isLength":1270,dup:476}],1268:[function(e,t,n){arguments[4][479][0].apply(n,arguments)},{"./_root":1247,"./stubFalse":1279,dup:479}],1269:[function(e,t,n){arguments[4][480][0].apply(n,arguments)},{"./_baseGetTag":1174,"./isObject":1271,dup:480}],1270:[function(e,t,n){arguments[4][482][0].apply(n,arguments)},{dup:482}],1271:[function(e,t,n){arguments[4][484][0].apply(n,arguments)},{dup:484}],1272:[function(e,t,n){arguments[4][485][0].apply(n,arguments)},{dup:485}],1273:[function(e,t,n){arguments[4][489][0].apply(n,arguments)},{"./_baseGetTag":1174,"./isObjectLike":1272,dup:489}],1274:[function(e,t,n){arguments[4][490][0].apply(n,arguments)},{"./_baseIsTypedArray":1178,"./_baseUnary":1185,"./_nodeUtil":1243,dup:490}],1275:[function(e,t,n){arguments[4][491][0].apply(n,arguments)},{"./_arrayLikeKeys":1162,"./_baseKeys":1179,"./isArrayLike":1267,dup:491}],1276:[function(e,t,n){arguments[4][492][0].apply(n,arguments)},{"./_arrayLikeKeys":1162,"./_baseKeysIn":1180,"./isArrayLike":1267,dup:492}],1277:[function(e,t,n){arguments[4][494][0].apply(n,arguments)},{"./_MapCache":1150,dup:494}],1278:[function(e,t,n){arguments[4][501][0].apply(n,arguments)},{dup:501}],1279:[function(e,t,n){arguments[4][502][0].apply(n,arguments)},{dup:502}],1280:[function(e,t,n){arguments[4][507][0].apply(n,arguments)},{"./_baseToString":1184,dup:507}],1281:[function(e,t,n){arguments[4][226][0].apply(n,arguments)},{"babel-runtime/core-js/weak-map":1037,dup:226}],1282:[function(e,t,n){arguments[4][227][0].apply(n,arguments)},{"./path":1291,_process:13,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/helpers/classCallCheck":1038,"babel-types":1480,dup:227}],1283:[function(e,t,n){arguments[4][228][0].apply(n,arguments)},{"babel-runtime/helpers/classCallCheck":1038,dup:228}],1284:[function(e,t,n){arguments[4][229][0].apply(n,arguments)},{"./cache":1281,"./context":1282,"./hub":1283,"./path":1291,"./scope":1303,"./visitors":1305,"babel-messages":1025,"babel-runtime/core-js/get-iterator":1026,"babel-types":1480,dup:229,"lodash/includes":1447}],1285:[function(e,t,n){arguments[4][230][0].apply(n,arguments)},{"./index":1291,"babel-runtime/core-js/get-iterator":1026,"babel-types":1480,dup:230}],1286:[function(e,t,n){arguments[4][231][0].apply(n,arguments)},{dup:231}],1287:[function(e,t,n){arguments[4][232][0].apply(n,arguments)},{"../index":1284,"babel-runtime/core-js/get-iterator":1026,dup:232}],1288:[function(e,t,n){arguments[4][233][0].apply(n,arguments)},{"babel-types":1480,dup:233}],1289:[function(e,t,n){arguments[4][234][0].apply(n,arguments)},{"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/map":1028,"babel-runtime/helpers/typeof":1041,dup:234}],1290:[function(e,t,n){arguments[4][235][0].apply(n,arguments)},{"./index":1291,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/object/create":1030,"babel-types":1480,dup:235}],1291:[function(e,t,n){arguments[4][236][0].apply(n,arguments)},{"../cache":1281,"../index":1284,"../scope":1303,"./ancestry":1285,"./comments":1286,"./context":1287,"./conversion":1288,"./evaluation":1289,"./family":1290,"./inference":1292,"./introspection":1295,"./lib/virtual-types":1298,"./modification":1299,"./removal":1300,"./replacement":1301,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/helpers/classCallCheck":1038,"babel-types":1480,debug:1322,dup:236,invariant:1326,"lodash/assign":1440}],1292:[function(e,t,n){arguments[4][237][0].apply(n,arguments)},{"./inferers":1294,"babel-runtime/core-js/get-iterator":1026,"babel-types":1480,dup:237}],1293:[function(e,t,n){arguments[4][238][0].apply(n,arguments)},{"babel-runtime/core-js/get-iterator":1026,"babel-types":1480,dup:238}],1294:[function(e,t,n){arguments[4][239][0].apply(n,arguments)},{"./inferer-reference":1293,"babel-types":1480,dup:239}],1295:[function(e,t,n){arguments[4][240][0].apply(n,arguments)},{"babel-runtime/core-js/get-iterator":1026,"babel-runtime/helpers/typeof":1041,"babel-types":1480,dup:240,"lodash/includes":1447}],1296:[function(e,t,n){arguments[4][241][0].apply(n,arguments)},{"babel-runtime/core-js/get-iterator":1026,"babel-runtime/helpers/classCallCheck":1038,"babel-types":1480,dup:241}],1297:[function(e,t,n){arguments[4][242][0].apply(n,arguments)},{dup:242}],1298:[function(e,t,n){arguments[4][243][0].apply(n,arguments)},{"babel-types":1480,dup:243}],1299:[function(e,t,n){arguments[4][244][0].apply(n,arguments)},{"../cache":1281,"./index":1291,"./lib/hoister":1296,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/helpers/typeof":1041,"babel-types":1480,dup:244}],1300:[function(e,t,n){arguments[4][245][0].apply(n,arguments)},{"./lib/removal-hooks":1297,"babel-runtime/core-js/get-iterator":1026,dup:245}],1301:[function(e,t,n){arguments[4][246][0].apply(n,arguments)},{"../index":1284,"./index":1291,"babel-code-frame":1306,"babel-runtime/core-js/get-iterator":1026,"babel-types":1480,babylon:1320,dup:246}],1302:[function(e,t,n){arguments[4][247][0].apply(n,arguments)},{"babel-runtime/helpers/classCallCheck":1038,dup:247}],1303:[function(e,t,n){arguments[4][248][0].apply(n,arguments)},{"../cache":1281,"../index":1284,"./binding":1302,"./lib/renamer":1304,"babel-messages":1025,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/map":1028,"babel-runtime/core-js/object/create":1030,"babel-runtime/core-js/object/keys":1032,"babel-runtime/helpers/classCallCheck":1038,"babel-types":1480,dup:248,globals:1325,"lodash/defaults":1444,"lodash/includes":1447,"lodash/repeat":1461}],1304:[function(e,t,n){arguments[4][249][0].apply(n,arguments)},{"../binding":1302,"babel-runtime/helpers/classCallCheck":1038,"babel-types":1480,dup:249}],1305:[function(e,t,n){arguments[4][250][0].apply(n,arguments)},{"./path/lib/virtual-types":1298,"babel-messages":1025,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/object/keys":1032,"babel-runtime/helpers/typeof":1041,"babel-types":1480,dup:250,"lodash/clone":1442}],1306:[function(e,t,n){arguments[4][60][0].apply(n,arguments)},{chalk:1307,dup:60,esutils:1318,"js-tokens":1319}],1307:[function(e,t,n){arguments[4][61][0].apply(n,arguments)},{_process:13,"ansi-styles":1308,dup:61,"escape-string-regexp":1309,"has-ansi":1310,"strip-ansi":1312,"supports-color":1314}],1308:[function(e,t,n){arguments[4][62][0].apply(n,arguments)},{dup:62}],1309:[function(e,t,n){arguments[4][63][0].apply(n,arguments)},{dup:63}],1310:[function(e,t,n){arguments[4][64][0].apply(n,arguments)},{"ansi-regex":1311,dup:64}],1311:[function(e,t,n){arguments[4][65][0].apply(n,arguments)},{dup:65}],1312:[function(e,t,n){arguments[4][66][0].apply(n,arguments)},{"ansi-regex":1313,dup:66}],1313:[function(e,t,n){arguments[4][65][0].apply(n,arguments)},{dup:65}],1314:[function(e,t,n){arguments[4][68][0].apply(n,arguments)},{_process:13,dup:68}],1315:[function(e,t,n){arguments[4][69][0].apply(n,arguments)},{dup:69}],1316:[function(e,t,n){arguments[4][70][0].apply(n,arguments)},{dup:70}],1317:[function(e,t,n){arguments[4][71][0].apply(n,arguments)},{"./code":1316,dup:71}],1318:[function(e,t,n){arguments[4][72][0].apply(n,arguments)},{"./ast":1315,"./code":1316,"./keyword":1317,dup:72}],1319:[function(e,t,n){arguments[4][73][0].apply(n,arguments)},{dup:73}],1320:[function(e,t,n){arguments[4][274][0].apply(n,arguments)},{dup:274}],1321:[function(e,t,n){arguments[4][277][0].apply(n,arguments)},{dup:277}],1322:[function(e,t,n){arguments[4][278][0].apply(n,arguments)},{"./debug":1323,_process:13,dup:278}],1323:[function(e,t,n){arguments[4][279][0].apply(n,arguments)},{dup:279,ms:1321}],1324:[function(e,t,n){arguments[4][251][0].apply(n,arguments)},{dup:251}],1325:[function(e,t,n){arguments[4][252][0].apply(n,arguments)},{"./globals.json":1324,dup:252}],1326:[function(e,t,n){arguments[4][253][0].apply(n,arguments)},{dup:253}],1327:[function(e,t,n){arguments[4][282][0].apply(n,arguments)},{"./_getNative":1391,"./_root":1429,dup:282}],1328:[function(e,t,n){arguments[4][283][0].apply(n,arguments)},{"./_hashClear":1398,"./_hashDelete":1399,"./_hashGet":1400,"./_hashHas":1401,"./_hashSet":1402,dup:283}],1329:[function(e,t,n){arguments[4][284][0].apply(n,arguments)},{"./_listCacheClear":1411,"./_listCacheDelete":1412,"./_listCacheGet":1413,"./_listCacheHas":1414,"./_listCacheSet":1415,dup:284}],1330:[function(e,t,n){arguments[4][285][0].apply(n,arguments)},{"./_getNative":1391,"./_root":1429,dup:285}],1331:[function(e,t,n){arguments[4][286][0].apply(n,arguments)},{"./_mapCacheClear":1416,"./_mapCacheDelete":1417,"./_mapCacheGet":1418,"./_mapCacheHas":1419,"./_mapCacheSet":1420,dup:286}],1332:[function(e,t,n){arguments[4][287][0].apply(n,arguments)},{"./_getNative":1391,"./_root":1429,dup:287}],1333:[function(e,t,n){arguments[4][288][0].apply(n,arguments)},{"./_getNative":1391,"./_root":1429,dup:288}],1334:[function(e,t,n){arguments[4][290][0].apply(n,arguments)},{"./_ListCache":1329,"./_stackClear":1433,"./_stackDelete":1434,"./_stackGet":1435,"./_stackHas":1436,"./_stackSet":1437,dup:290}],1335:[function(e,t,n){arguments[4][291][0].apply(n,arguments)},{"./_root":1429,dup:291}],1336:[function(e,t,n){arguments[4][292][0].apply(n,arguments)},{"./_root":1429,dup:292}],1337:[function(e,t,n){arguments[4][293][0].apply(n,arguments)},{"./_getNative":1391,"./_root":1429,dup:293}],1338:[function(e,t,n){arguments[4][294][0].apply(n,arguments)},{dup:294}],1339:[function(e,t,n){arguments[4][295][0].apply(n,arguments)},{dup:295}],1340:[function(e,t,n){arguments[4][296][0].apply(n,arguments)},{dup:296}],1341:[function(e,t,n){arguments[4][297][0].apply(n,arguments)},{dup:297}],1342:[function(e,t,n){arguments[4][298][0].apply(n,arguments)},{dup:298}],1343:[function(e,t,n){arguments[4][301][0].apply(n,arguments)},{"./_baseTimes":1367,"./_isIndex":1406,"./isArguments":1448,"./isArray":1449,"./isBuffer":1451,"./isTypedArray":1458,dup:301}],1344:[function(e,t,n){arguments[4][302][0].apply(n,arguments)},{dup:302}],1345:[function(e,t,n){arguments[4][303][0].apply(n,arguments)},{dup:303}],1346:[function(e,t,n){arguments[4][304][0].apply(n,arguments)},{dup:304}],1347:[function(e,t,n){arguments[4][308][0].apply(n,arguments)},{"./_baseAssignValue":1351,"./eq":1445,dup:308}],1348:[function(e,t,n){arguments[4][309][0].apply(n,arguments)},{"./eq":1445,dup:309}],1349:[function(e,t,n){arguments[4][310][0].apply(n,arguments)},{"./_copyObject":1380,"./keys":1459,dup:310}],1350:[function(e,t,n){arguments[4][311][0].apply(n,arguments)},{"./_copyObject":1380,"./keysIn":1460,dup:311}],1351:[function(e,t,n){arguments[4][312][0].apply(n,arguments)},{"./_defineProperty":1386,dup:312}],1352:[function(e,t,n){arguments[4][314][0].apply(n,arguments)},{"./_Stack":1334,"./_arrayEach":1341,"./_assignValue":1347,"./_baseAssign":1349,"./_baseAssignIn":1350,"./_cloneBuffer":1372,"./_copyArray":1379,"./_copySymbols":1381,"./_copySymbolsIn":1382,"./_getAllKeys":1388,"./_getAllKeysIn":1389,"./_getTag":1396,"./_initCloneArray":1403,"./_initCloneByTag":1404,"./_initCloneObject":1405,"./isArray":1449,"./isBuffer":1451,"./isObject":1454,"./keys":1459,dup:314}],1353:[function(e,t,n){arguments[4][315][0].apply(n,arguments)},{"./isObject":1454,dup:315}],1354:[function(e,t,n){arguments[4][317][0].apply(n,arguments)},{dup:317}],1355:[function(e,t,n){arguments[4][322][0].apply(n,arguments)},{"./_arrayPush":1345,"./isArray":1449,dup:322}],1356:[function(e,t,n){arguments[4][323][0].apply(n,arguments)},{"./_Symbol":1335,"./_getRawTag":1393,"./_objectToString":1426,dup:323}],1357:[function(e,t,n){arguments[4][326][0].apply(n,arguments)},{"./_baseFindIndex":1354,"./_baseIsNaN":1359,"./_strictIndexOf":1438,dup:326}],1358:[function(e,t,n){arguments[4][327][0].apply(n,arguments)},{"./_baseGetTag":1356,"./isObjectLike":1455,dup:327}],1359:[function(e,t,n){arguments[4][331][0].apply(n,arguments)},{dup:331}],1360:[function(e,t,n){arguments[4][332][0].apply(n,arguments)},{"./_isMasked":1409,"./_toSource":1439,"./isFunction":1452,"./isObject":1454,dup:332}],1361:[function(e,t,n){arguments[4][334][0].apply(n,arguments)},{"./_baseGetTag":1356,"./isLength":1453,"./isObjectLike":1455,dup:334}],1362:[function(e,t,n){arguments[4][336][0].apply(n,arguments)},{"./_isPrototype":1410,"./_nativeKeys":1423,dup:336}],1363:[function(e,t,n){arguments[4][337][0].apply(n,arguments)},{"./_isPrototype":1410,"./_nativeKeysIn":1424,"./isObject":1454,dup:337}],1364:[function(e,t,n){arguments[4][346][0].apply(n,arguments)},{dup:346}],1365:[function(e,t,n){arguments[4][347][0].apply(n,arguments)},{"./_overRest":1428,"./_setToString":1431,"./identity":1446,dup:347}],1366:[function(e,t,n){arguments[4][348][0].apply(n,arguments)},{"./_defineProperty":1386,"./constant":1443,"./identity":1446,dup:348}],1367:[function(e,t,n){arguments[4][351][0].apply(n,arguments)},{dup:351}],1368:[function(e,t,n){arguments[4][352][0].apply(n,arguments)},{"./_Symbol":1335,"./_arrayMap":1344,"./isArray":1449,"./isSymbol":1457,dup:352}],1369:[function(e,t,n){arguments[4][353][0].apply(n,arguments)},{dup:353}],1370:[function(e,t,n){arguments[4][355][0].apply(n,arguments)},{"./_arrayMap":1344,dup:355}],1371:[function(e,t,n){arguments[4][361][0].apply(n,arguments)},{"./_Uint8Array":1336,dup:361}],1372:[function(e,t,n){arguments[4][362][0].apply(n,arguments)},{"./_root":1429,dup:362}],1373:[function(e,t,n){arguments[4][363][0].apply(n,arguments)},{"./_cloneArrayBuffer":1371,dup:363}],1374:[function(e,t,n){arguments[4][364][0].apply(n,arguments)},{"./_addMapEntry":1338,"./_arrayReduce":1346,"./_mapToArray":1421,dup:364}],1375:[function(e,t,n){arguments[4][365][0].apply(n,arguments)},{dup:365}],1376:[function(e,t,n){arguments[4][366][0].apply(n,arguments)},{"./_addSetEntry":1339,"./_arrayReduce":1346,"./_setToArray":1430,dup:366}],1377:[function(e,t,n){arguments[4][367][0].apply(n,arguments)},{"./_Symbol":1335,dup:367}],1378:[function(e,t,n){arguments[4][368][0].apply(n,arguments)},{"./_cloneArrayBuffer":1371,dup:368}],1379:[function(e,t,n){arguments[4][371][0].apply(n,arguments)},{dup:371}],1380:[function(e,t,n){arguments[4][372][0].apply(n,arguments)},{"./_assignValue":1347,"./_baseAssignValue":1351,dup:372}],1381:[function(e,t,n){arguments[4][373][0].apply(n,arguments)},{"./_copyObject":1380,"./_getSymbols":1394,dup:373}],1382:[function(e,t,n){arguments[4][374][0].apply(n,arguments)},{"./_copyObject":1380,"./_getSymbolsIn":1395,dup:374}],1383:[function(e,t,n){arguments[4][375][0].apply(n,arguments)},{"./_root":1429,dup:375}],1384:[function(e,t,n){arguments[4][376][0].apply(n,arguments)},{"./_baseRest":1365,"./_isIterateeCall":1407,dup:376}],1385:[function(e,t,n){arguments[4][381][0].apply(n,arguments)},{"./eq":1445,dup:381}],1386:[function(e,t,n){arguments[4][382][0].apply(n,arguments)},{"./_getNative":1391,dup:382}],1387:[function(e,t,n){arguments[4][386][0].apply(n,arguments)},{dup:386}],1388:[function(e,t,n){arguments[4][387][0].apply(n,arguments)},{"./_baseGetAllKeys":1355,"./_getSymbols":1394,"./keys":1459,dup:387}],1389:[function(e,t,n){arguments[4][388][0].apply(n,arguments)},{"./_baseGetAllKeys":1355,"./_getSymbolsIn":1395,"./keysIn":1460,dup:388}],1390:[function(e,t,n){arguments[4][389][0].apply(n,arguments)},{"./_isKeyable":1408,dup:389}],1391:[function(e,t,n){arguments[4][391][0].apply(n,arguments)},{"./_baseIsNative":1360,"./_getValue":1397,dup:391}],1392:[function(e,t,n){arguments[4][392][0].apply(n,arguments)},{"./_overArg":1427,dup:392}],1393:[function(e,t,n){arguments[4][393][0].apply(n,arguments)},{"./_Symbol":1335,dup:393}],1394:[function(e,t,n){arguments[4][394][0].apply(n,arguments)},{"./_arrayFilter":1342,"./stubArray":1462,dup:394}],1395:[function(e,t,n){arguments[4][395][0].apply(n,arguments)},{"./_arrayPush":1345,"./_getPrototype":1392,"./_getSymbols":1394,"./stubArray":1462,dup:395}],1396:[function(e,t,n){arguments[4][396][0].apply(n,arguments)},{"./_DataView":1327,"./_Map":1330,"./_Promise":1332,"./_Set":1333,"./_WeakMap":1337,"./_baseGetTag":1356,"./_toSource":1439,dup:396}],1397:[function(e,t,n){arguments[4][397][0].apply(n,arguments)},{dup:397}],1398:[function(e,t,n){arguments[4][400][0].apply(n,arguments)},{"./_nativeCreate":1422,dup:400}],1399:[function(e,t,n){arguments[4][401][0].apply(n,arguments)},{dup:401}],1400:[function(e,t,n){arguments[4][402][0].apply(n,arguments)},{"./_nativeCreate":1422,dup:402}],1401:[function(e,t,n){arguments[4][403][0].apply(n,arguments)},{"./_nativeCreate":1422,dup:403}],1402:[function(e,t,n){arguments[4][404][0].apply(n,arguments)},{"./_nativeCreate":1422,dup:404}],1403:[function(e,t,n){arguments[4][405][0].apply(n,arguments)},{dup:405}],1404:[function(e,t,n){arguments[4][406][0].apply(n,arguments)},{"./_cloneArrayBuffer":1371,"./_cloneDataView":1373,"./_cloneMap":1374,"./_cloneRegExp":1375,"./_cloneSet":1376,"./_cloneSymbol":1377,"./_cloneTypedArray":1378,dup:406}],1405:[function(e,t,n){arguments[4][407][0].apply(n,arguments)},{"./_baseCreate":1353,"./_getPrototype":1392,"./_isPrototype":1410,dup:407}],1406:[function(e,t,n){arguments[4][409][0].apply(n,arguments)},{dup:409}],1407:[function(e,t,n){arguments[4][410][0].apply(n,arguments)},{"./_isIndex":1406,"./eq":1445,"./isArrayLike":1450,"./isObject":1454,dup:410}],1408:[function(e,t,n){arguments[4][412][0].apply(n,arguments)},{dup:412}],1409:[function(e,t,n){arguments[4][413][0].apply(n,arguments)},{"./_coreJsData":1383,dup:413}],1410:[function(e,t,n){arguments[4][414][0].apply(n,arguments)},{dup:414}],1411:[function(e,t,n){arguments[4][416][0].apply(n,arguments)},{dup:416}],1412:[function(e,t,n){arguments[4][417][0].apply(n,arguments)},{"./_assocIndexOf":1348,dup:417}],1413:[function(e,t,n){arguments[4][418][0].apply(n,arguments)},{"./_assocIndexOf":1348,dup:418}],1414:[function(e,t,n){arguments[4][419][0].apply(n,arguments)},{"./_assocIndexOf":1348,dup:419}],1415:[function(e,t,n){arguments[4][420][0].apply(n,arguments)},{"./_assocIndexOf":1348,dup:420}],1416:[function(e,t,n){arguments[4][421][0].apply(n,arguments)},{"./_Hash":1328,"./_ListCache":1329,"./_Map":1330,dup:421}],1417:[function(e,t,n){arguments[4][422][0].apply(n,arguments)},{"./_getMapData":1390,dup:422}],1418:[function(e,t,n){arguments[4][423][0].apply(n,arguments)},{"./_getMapData":1390,dup:423}],1419:[function(e,t,n){arguments[4][424][0].apply(n,arguments)},{"./_getMapData":1390,dup:424}],1420:[function(e,t,n){arguments[4][425][0].apply(n,arguments)},{"./_getMapData":1390,dup:425}],1421:[function(e,t,n){arguments[4][426][0].apply(n,arguments)},{dup:426}],1422:[function(e,t,n){arguments[4][429][0].apply(n,arguments)},{"./_getNative":1391,dup:429}],1423:[function(e,t,n){arguments[4][430][0].apply(n,arguments)},{"./_overArg":1427,dup:430}],1424:[function(e,t,n){arguments[4][431][0].apply(n,arguments)},{dup:431}],1425:[function(e,t,n){arguments[4][432][0].apply(n,arguments)},{"./_freeGlobal":1387,dup:432}],1426:[function(e,t,n){arguments[4][433][0].apply(n,arguments)},{dup:433}],1427:[function(e,t,n){arguments[4][434][0].apply(n,arguments)},{dup:434}],1428:[function(e,t,n){arguments[4][435][0].apply(n,arguments)},{"./_apply":1340,dup:435}],1429:[function(e,t,n){arguments[4][436][0].apply(n,arguments)},{"./_freeGlobal":1387,dup:436}],1430:[function(e,t,n){arguments[4][439][0].apply(n,arguments)},{dup:439}],1431:[function(e,t,n){arguments[4][440][0].apply(n,arguments)},{"./_baseSetToString":1366,"./_shortOut":1432,dup:440}],1432:[function(e,t,n){arguments[4][441][0].apply(n,arguments)},{dup:441}],1433:[function(e,t,n){arguments[4][442][0].apply(n,arguments)},{"./_ListCache":1329,dup:442}],1434:[function(e,t,n){arguments[4][443][0].apply(n,arguments)},{dup:443}],1435:[function(e,t,n){arguments[4][444][0].apply(n,arguments)},{dup:444}],1436:[function(e,t,n){arguments[4][445][0].apply(n,arguments)},{dup:445}],1437:[function(e,t,n){arguments[4][446][0].apply(n,arguments)},{"./_ListCache":1329,"./_Map":1330,"./_MapCache":1331,dup:446}],1438:[function(e,t,n){arguments[4][447][0].apply(n,arguments)},{dup:447}],1439:[function(e,t,n){arguments[4][451][0].apply(n,arguments)},{dup:451}],1440:[function(e,t,n){arguments[4][453][0].apply(n,arguments)},{"./_assignValue":1347,"./_copyObject":1380,"./_createAssigner":1384,"./_isPrototype":1410,"./isArrayLike":1450,"./keys":1459,dup:453}],1441:[function(e,t,n){arguments[4][454][0].apply(n,arguments)},{"./_copyObject":1380,"./_createAssigner":1384,"./keysIn":1460,dup:454}],1442:[function(e,t,n){arguments[4][455][0].apply(n,arguments)},{"./_baseClone":1352, +dup:455}],1443:[function(e,t,n){arguments[4][459][0].apply(n,arguments)},{dup:459}],1444:[function(e,t,n){arguments[4][460][0].apply(n,arguments)},{"./_apply":1340,"./_baseRest":1365,"./_customDefaultsAssignIn":1385,"./assignInWith":1441,dup:460}],1445:[function(e,t,n){arguments[4][462][0].apply(n,arguments)},{dup:462}],1446:[function(e,t,n){arguments[4][472][0].apply(n,arguments)},{dup:472}],1447:[function(e,t,n){arguments[4][473][0].apply(n,arguments)},{"./_baseIndexOf":1357,"./isArrayLike":1450,"./isString":1456,"./toInteger":1465,"./values":1468,dup:473}],1448:[function(e,t,n){arguments[4][474][0].apply(n,arguments)},{"./_baseIsArguments":1358,"./isObjectLike":1455,dup:474}],1449:[function(e,t,n){arguments[4][475][0].apply(n,arguments)},{dup:475}],1450:[function(e,t,n){arguments[4][476][0].apply(n,arguments)},{"./isFunction":1452,"./isLength":1453,dup:476}],1451:[function(e,t,n){arguments[4][479][0].apply(n,arguments)},{"./_root":1429,"./stubFalse":1463,dup:479}],1452:[function(e,t,n){arguments[4][480][0].apply(n,arguments)},{"./_baseGetTag":1356,"./isObject":1454,dup:480}],1453:[function(e,t,n){arguments[4][482][0].apply(n,arguments)},{dup:482}],1454:[function(e,t,n){arguments[4][484][0].apply(n,arguments)},{dup:484}],1455:[function(e,t,n){arguments[4][485][0].apply(n,arguments)},{dup:485}],1456:[function(e,t,n){arguments[4][488][0].apply(n,arguments)},{"./_baseGetTag":1356,"./isArray":1449,"./isObjectLike":1455,dup:488}],1457:[function(e,t,n){arguments[4][489][0].apply(n,arguments)},{"./_baseGetTag":1356,"./isObjectLike":1455,dup:489}],1458:[function(e,t,n){arguments[4][490][0].apply(n,arguments)},{"./_baseIsTypedArray":1361,"./_baseUnary":1369,"./_nodeUtil":1425,dup:490}],1459:[function(e,t,n){arguments[4][491][0].apply(n,arguments)},{"./_arrayLikeKeys":1343,"./_baseKeys":1362,"./isArrayLike":1450,dup:491}],1460:[function(e,t,n){arguments[4][492][0].apply(n,arguments)},{"./_arrayLikeKeys":1343,"./_baseKeysIn":1363,"./isArrayLike":1450,dup:492}],1461:[function(e,t,n){arguments[4][498][0].apply(n,arguments)},{"./_baseRepeat":1364,"./_isIterateeCall":1407,"./toInteger":1465,"./toString":1467,dup:498}],1462:[function(e,t,n){arguments[4][501][0].apply(n,arguments)},{dup:501}],1463:[function(e,t,n){arguments[4][502][0].apply(n,arguments)},{dup:502}],1464:[function(e,t,n){arguments[4][503][0].apply(n,arguments)},{"./toNumber":1466,dup:503}],1465:[function(e,t,n){arguments[4][504][0].apply(n,arguments)},{"./toFinite":1464,dup:504}],1466:[function(e,t,n){arguments[4][505][0].apply(n,arguments)},{"./isObject":1454,"./isSymbol":1457,dup:505}],1467:[function(e,t,n){arguments[4][507][0].apply(n,arguments)},{"./_baseToString":1368,dup:507}],1468:[function(e,t,n){arguments[4][510][0].apply(n,arguments)},{"./_baseValues":1370,"./keys":1459,dup:510}],1469:[function(e,t,n){arguments[4][254][0].apply(n,arguments)},{"babel-runtime/core-js/symbol/for":1035,dup:254}],1470:[function(e,t,n){arguments[4][255][0].apply(n,arguments)},{"./index":1480,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/json/stringify":1027,"babel-runtime/core-js/number/max-safe-integer":1029,dup:255,"lodash/isNumber":1615,"lodash/isPlainObject":1618,"lodash/isRegExp":1619,"lodash/isString":1620}],1471:[function(e,t,n){arguments[4][256][0].apply(n,arguments)},{"../constants":1469,"../index":1480,"./index":1475,dup:256}],1472:[function(e,t,n){arguments[4][257][0].apply(n,arguments)},{"./index":1475,dup:257}],1473:[function(e,t,n){arguments[4][258][0].apply(n,arguments)},{"./index":1475,dup:258}],1474:[function(e,t,n){arguments[4][259][0].apply(n,arguments)},{"./index":1475,dup:259}],1475:[function(e,t,n){arguments[4][260][0].apply(n,arguments)},{"../index":1480,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/json/stringify":1027,"babel-runtime/helpers/typeof":1041,dup:260}],1476:[function(e,t,n){arguments[4][261][0].apply(n,arguments)},{"./core":1471,"./es2015":1472,"./experimental":1473,"./flow":1474,"./index":1475,"./jsx":1477,"./misc":1478,dup:261}],1477:[function(e,t,n){arguments[4][262][0].apply(n,arguments)},{"./index":1475,dup:262}],1478:[function(e,t,n){arguments[4][263][0].apply(n,arguments)},{"./index":1475,dup:263}],1479:[function(e,t,n){arguments[4][264][0].apply(n,arguments)},{"./index":1480,dup:264}],1480:[function(e,t,n){arguments[4][265][0].apply(n,arguments)},{"./constants":1469,"./converters":1470,"./definitions":1475,"./definitions/init":1476,"./flow":1479,"./react":1481,"./retrievers":1482,"./validators":1483,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/json/stringify":1027,"babel-runtime/core-js/object/get-own-property-symbols":1031,"babel-runtime/core-js/object/keys":1032,dup:265,"lodash/clone":1603,"lodash/compact":1604,"lodash/each":1605,"lodash/uniq":1627,"to-fast-properties":1628}],1481:[function(e,t,n){arguments[4][266][0].apply(n,arguments)},{"./index":1480,dup:266}],1482:[function(e,t,n){arguments[4][267][0].apply(n,arguments)},{"./index":1480,"babel-runtime/core-js/object/create":1030,dup:267}],1483:[function(e,t,n){arguments[4][268][0].apply(n,arguments)},{"./constants":1469,"./index":1480,"./retrievers":1482,"babel-runtime/core-js/get-iterator":1026,"babel-runtime/core-js/object/keys":1032,"babel-runtime/helpers/typeof":1041,dup:268,esutils:1487}],1484:[function(e,t,n){arguments[4][69][0].apply(n,arguments)},{dup:69}],1485:[function(e,t,n){arguments[4][70][0].apply(n,arguments)},{dup:70}],1486:[function(e,t,n){arguments[4][71][0].apply(n,arguments)},{"./code":1485,dup:71}],1487:[function(e,t,n){arguments[4][72][0].apply(n,arguments)},{"./ast":1484,"./code":1485,"./keyword":1486,dup:72}],1488:[function(e,t,n){arguments[4][282][0].apply(n,arguments)},{"./_getNative":1556,"./_root":1592,dup:282}],1489:[function(e,t,n){arguments[4][283][0].apply(n,arguments)},{"./_hashClear":1563,"./_hashDelete":1564,"./_hashGet":1565,"./_hashHas":1566,"./_hashSet":1567,dup:283}],1490:[function(e,t,n){arguments[4][284][0].apply(n,arguments)},{"./_listCacheClear":1575,"./_listCacheDelete":1576,"./_listCacheGet":1577,"./_listCacheHas":1578,"./_listCacheSet":1579,dup:284}],1491:[function(e,t,n){arguments[4][285][0].apply(n,arguments)},{"./_getNative":1556,"./_root":1592,dup:285}],1492:[function(e,t,n){arguments[4][286][0].apply(n,arguments)},{"./_mapCacheClear":1580,"./_mapCacheDelete":1581,"./_mapCacheGet":1582,"./_mapCacheHas":1583,"./_mapCacheSet":1584,dup:286}],1493:[function(e,t,n){arguments[4][287][0].apply(n,arguments)},{"./_getNative":1556,"./_root":1592,dup:287}],1494:[function(e,t,n){arguments[4][288][0].apply(n,arguments)},{"./_getNative":1556,"./_root":1592,dup:288}],1495:[function(e,t,n){arguments[4][289][0].apply(n,arguments)},{"./_MapCache":1492,"./_setCacheAdd":1593,"./_setCacheHas":1594,dup:289}],1496:[function(e,t,n){arguments[4][290][0].apply(n,arguments)},{"./_ListCache":1490,"./_stackClear":1596,"./_stackDelete":1597,"./_stackGet":1598,"./_stackHas":1599,"./_stackSet":1600,dup:290}],1497:[function(e,t,n){arguments[4][291][0].apply(n,arguments)},{"./_root":1592,dup:291}],1498:[function(e,t,n){arguments[4][292][0].apply(n,arguments)},{"./_root":1592,dup:292}],1499:[function(e,t,n){arguments[4][293][0].apply(n,arguments)},{"./_getNative":1556,"./_root":1592,dup:293}],1500:[function(e,t,n){arguments[4][294][0].apply(n,arguments)},{dup:294}],1501:[function(e,t,n){arguments[4][295][0].apply(n,arguments)},{dup:295}],1502:[function(e,t,n){arguments[4][297][0].apply(n,arguments)},{dup:297}],1503:[function(e,t,n){arguments[4][298][0].apply(n,arguments)},{dup:298}],1504:[function(e,t,n){arguments[4][299][0].apply(n,arguments)},{"./_baseIndexOf":1522,dup:299}],1505:[function(e,t,n){arguments[4][300][0].apply(n,arguments)},{dup:300}],1506:[function(e,t,n){arguments[4][301][0].apply(n,arguments)},{"./_baseTimes":1530,"./_isIndex":1571,"./isArguments":1609,"./isArray":1610,"./isBuffer":1612,"./isTypedArray":1621,dup:301}],1507:[function(e,t,n){arguments[4][303][0].apply(n,arguments)},{dup:303}],1508:[function(e,t,n){arguments[4][304][0].apply(n,arguments)},{dup:304}],1509:[function(e,t,n){arguments[4][308][0].apply(n,arguments)},{"./_baseAssignValue":1513,"./eq":1606,dup:308}],1510:[function(e,t,n){arguments[4][309][0].apply(n,arguments)},{"./eq":1606,dup:309}],1511:[function(e,t,n){arguments[4][310][0].apply(n,arguments)},{"./_copyObject":1544,"./keys":1622,dup:310}],1512:[function(e,t,n){arguments[4][311][0].apply(n,arguments)},{"./_copyObject":1544,"./keysIn":1623,dup:311}],1513:[function(e,t,n){arguments[4][312][0].apply(n,arguments)},{"./_defineProperty":1551,dup:312}],1514:[function(e,t,n){arguments[4][314][0].apply(n,arguments)},{"./_Stack":1496,"./_arrayEach":1502,"./_assignValue":1509,"./_baseAssign":1511,"./_baseAssignIn":1512,"./_cloneBuffer":1536,"./_copyArray":1543,"./_copySymbols":1545,"./_copySymbolsIn":1546,"./_getAllKeys":1553,"./_getAllKeysIn":1554,"./_getTag":1561,"./_initCloneArray":1568,"./_initCloneByTag":1569,"./_initCloneObject":1570,"./isArray":1610,"./isBuffer":1612,"./isObject":1616,"./keys":1622,dup:314}],1515:[function(e,t,n){arguments[4][315][0].apply(n,arguments)},{"./isObject":1616,dup:315}],1516:[function(e,t,n){arguments[4][316][0].apply(n,arguments)},{"./_baseForOwn":1519,"./_createBaseEach":1548,dup:316}],1517:[function(e,t,n){arguments[4][317][0].apply(n,arguments)},{dup:317}],1518:[function(e,t,n){arguments[4][319][0].apply(n,arguments)},{"./_createBaseFor":1549,dup:319}],1519:[function(e,t,n){arguments[4][320][0].apply(n,arguments)},{"./_baseFor":1518,"./keys":1622,dup:320}],1520:[function(e,t,n){arguments[4][322][0].apply(n,arguments)},{"./_arrayPush":1507,"./isArray":1610,dup:322}],1521:[function(e,t,n){arguments[4][323][0].apply(n,arguments)},{"./_Symbol":1497,"./_getRawTag":1558,"./_objectToString":1590,dup:323}],1522:[function(e,t,n){arguments[4][326][0].apply(n,arguments)},{"./_baseFindIndex":1517,"./_baseIsNaN":1524,"./_strictIndexOf":1601,dup:326}],1523:[function(e,t,n){arguments[4][327][0].apply(n,arguments)},{"./_baseGetTag":1521,"./isObjectLike":1617,dup:327}],1524:[function(e,t,n){arguments[4][331][0].apply(n,arguments)},{dup:331}],1525:[function(e,t,n){arguments[4][332][0].apply(n,arguments)},{"./_isMasked":1573,"./_toSource":1602,"./isFunction":1613,"./isObject":1616,dup:332}],1526:[function(e,t,n){arguments[4][333][0].apply(n,arguments)},{"./_baseGetTag":1521,"./isObjectLike":1617,dup:333}],1527:[function(e,t,n){arguments[4][334][0].apply(n,arguments)},{"./_baseGetTag":1521,"./isLength":1614,"./isObjectLike":1617,dup:334}],1528:[function(e,t,n){arguments[4][336][0].apply(n,arguments)},{"./_isPrototype":1574,"./_nativeKeys":1587,dup:336}],1529:[function(e,t,n){arguments[4][337][0].apply(n,arguments)},{"./_isPrototype":1574,"./_nativeKeysIn":1588,"./isObject":1616,dup:337}],1530:[function(e,t,n){arguments[4][351][0].apply(n,arguments)},{dup:351}],1531:[function(e,t,n){arguments[4][353][0].apply(n,arguments)},{dup:353}],1532:[function(e,t,n){arguments[4][354][0].apply(n,arguments)},{"./_SetCache":1495,"./_arrayIncludes":1504,"./_arrayIncludesWith":1505,"./_cacheHas":1533,"./_createSet":1550,"./_setToArray":1595,dup:354}],1533:[function(e,t,n){arguments[4][356][0].apply(n,arguments)},{dup:356}],1534:[function(e,t,n){arguments[4][357][0].apply(n,arguments)},{"./identity":1608,dup:357}],1535:[function(e,t,n){arguments[4][361][0].apply(n,arguments)},{"./_Uint8Array":1498,dup:361}],1536:[function(e,t,n){arguments[4][362][0].apply(n,arguments)},{"./_root":1592,dup:362}],1537:[function(e,t,n){arguments[4][363][0].apply(n,arguments)},{"./_cloneArrayBuffer":1535,dup:363}],1538:[function(e,t,n){arguments[4][364][0].apply(n,arguments)},{"./_addMapEntry":1500,"./_arrayReduce":1508,"./_mapToArray":1585,dup:364}],1539:[function(e,t,n){arguments[4][365][0].apply(n,arguments)},{dup:365}],1540:[function(e,t,n){arguments[4][366][0].apply(n,arguments)},{"./_addSetEntry":1501,"./_arrayReduce":1508,"./_setToArray":1595,dup:366}],1541:[function(e,t,n){arguments[4][367][0].apply(n,arguments)},{"./_Symbol":1497,dup:367}],1542:[function(e,t,n){arguments[4][368][0].apply(n,arguments)},{"./_cloneArrayBuffer":1535,dup:368}],1543:[function(e,t,n){arguments[4][371][0].apply(n,arguments)},{dup:371}],1544:[function(e,t,n){arguments[4][372][0].apply(n,arguments)},{"./_assignValue":1509,"./_baseAssignValue":1513,dup:372}],1545:[function(e,t,n){arguments[4][373][0].apply(n,arguments)},{"./_copyObject":1544,"./_getSymbols":1559,dup:373}],1546:[function(e,t,n){arguments[4][374][0].apply(n,arguments)},{"./_copyObject":1544,"./_getSymbolsIn":1560,dup:374}],1547:[function(e,t,n){arguments[4][375][0].apply(n,arguments)},{"./_root":1592,dup:375}],1548:[function(e,t,n){arguments[4][377][0].apply(n,arguments)},{"./isArrayLike":1611,dup:377}],1549:[function(e,t,n){arguments[4][378][0].apply(n,arguments)},{dup:378}],1550:[function(e,t,n){arguments[4][380][0].apply(n,arguments)},{"./_Set":1494,"./_setToArray":1595,"./noop":1624,dup:380}],1551:[function(e,t,n){arguments[4][382][0].apply(n,arguments)},{"./_getNative":1556,dup:382}],1552:[function(e,t,n){arguments[4][386][0].apply(n,arguments)},{dup:386}],1553:[function(e,t,n){arguments[4][387][0].apply(n,arguments)},{"./_baseGetAllKeys":1520,"./_getSymbols":1559,"./keys":1622,dup:387}],1554:[function(e,t,n){arguments[4][388][0].apply(n,arguments)},{"./_baseGetAllKeys":1520,"./_getSymbolsIn":1560,"./keysIn":1623,dup:388}],1555:[function(e,t,n){arguments[4][389][0].apply(n,arguments)},{"./_isKeyable":1572,dup:389}],1556:[function(e,t,n){arguments[4][391][0].apply(n,arguments)},{"./_baseIsNative":1525,"./_getValue":1562,dup:391}],1557:[function(e,t,n){arguments[4][392][0].apply(n,arguments)},{"./_overArg":1591,dup:392}],1558:[function(e,t,n){arguments[4][393][0].apply(n,arguments)},{"./_Symbol":1497,dup:393}],1559:[function(e,t,n){arguments[4][394][0].apply(n,arguments)},{"./_arrayFilter":1503,"./stubArray":1625,dup:394}],1560:[function(e,t,n){arguments[4][395][0].apply(n,arguments)},{"./_arrayPush":1507,"./_getPrototype":1557,"./_getSymbols":1559,"./stubArray":1625,dup:395}],1561:[function(e,t,n){arguments[4][396][0].apply(n,arguments)},{"./_DataView":1488,"./_Map":1491,"./_Promise":1493,"./_Set":1494,"./_WeakMap":1499,"./_baseGetTag":1521,"./_toSource":1602,dup:396}],1562:[function(e,t,n){arguments[4][397][0].apply(n,arguments)},{dup:397}],1563:[function(e,t,n){arguments[4][400][0].apply(n,arguments)},{"./_nativeCreate":1586,dup:400}],1564:[function(e,t,n){arguments[4][401][0].apply(n,arguments)},{dup:401}],1565:[function(e,t,n){arguments[4][402][0].apply(n,arguments)},{"./_nativeCreate":1586,dup:402}],1566:[function(e,t,n){arguments[4][403][0].apply(n,arguments)},{"./_nativeCreate":1586,dup:403}],1567:[function(e,t,n){arguments[4][404][0].apply(n,arguments)},{"./_nativeCreate":1586,dup:404}],1568:[function(e,t,n){arguments[4][405][0].apply(n,arguments)},{dup:405}],1569:[function(e,t,n){arguments[4][406][0].apply(n,arguments)},{"./_cloneArrayBuffer":1535,"./_cloneDataView":1537,"./_cloneMap":1538,"./_cloneRegExp":1539,"./_cloneSet":1540,"./_cloneSymbol":1541,"./_cloneTypedArray":1542,dup:406}],1570:[function(e,t,n){arguments[4][407][0].apply(n,arguments)},{"./_baseCreate":1515,"./_getPrototype":1557,"./_isPrototype":1574,dup:407}],1571:[function(e,t,n){arguments[4][409][0].apply(n,arguments)},{dup:409}],1572:[function(e,t,n){arguments[4][412][0].apply(n,arguments)},{dup:412}],1573:[function(e,t,n){arguments[4][413][0].apply(n,arguments)},{"./_coreJsData":1547,dup:413}],1574:[function(e,t,n){arguments[4][414][0].apply(n,arguments)},{dup:414}],1575:[function(e,t,n){arguments[4][416][0].apply(n,arguments)},{dup:416}],1576:[function(e,t,n){arguments[4][417][0].apply(n,arguments)},{"./_assocIndexOf":1510,dup:417}],1577:[function(e,t,n){arguments[4][418][0].apply(n,arguments)},{"./_assocIndexOf":1510,dup:418}],1578:[function(e,t,n){arguments[4][419][0].apply(n,arguments)},{"./_assocIndexOf":1510,dup:419}],1579:[function(e,t,n){arguments[4][420][0].apply(n,arguments)},{"./_assocIndexOf":1510,dup:420}],1580:[function(e,t,n){arguments[4][421][0].apply(n,arguments)},{"./_Hash":1489,"./_ListCache":1490,"./_Map":1491,dup:421}],1581:[function(e,t,n){arguments[4][422][0].apply(n,arguments)},{"./_getMapData":1555,dup:422}],1582:[function(e,t,n){arguments[4][423][0].apply(n,arguments)},{"./_getMapData":1555,dup:423}],1583:[function(e,t,n){arguments[4][424][0].apply(n,arguments)},{"./_getMapData":1555,dup:424}],1584:[function(e,t,n){arguments[4][425][0].apply(n,arguments)},{"./_getMapData":1555,dup:425}],1585:[function(e,t,n){arguments[4][426][0].apply(n,arguments)},{dup:426}],1586:[function(e,t,n){arguments[4][429][0].apply(n,arguments)},{"./_getNative":1556,dup:429}],1587:[function(e,t,n){arguments[4][430][0].apply(n,arguments)},{"./_overArg":1591,dup:430}],1588:[function(e,t,n){arguments[4][431][0].apply(n,arguments)},{dup:431}],1589:[function(e,t,n){arguments[4][432][0].apply(n,arguments)},{"./_freeGlobal":1552,dup:432}],1590:[function(e,t,n){arguments[4][433][0].apply(n,arguments)},{dup:433}],1591:[function(e,t,n){arguments[4][434][0].apply(n,arguments)},{dup:434}],1592:[function(e,t,n){arguments[4][436][0].apply(n,arguments)},{"./_freeGlobal":1552,dup:436}],1593:[function(e,t,n){arguments[4][437][0].apply(n,arguments)},{dup:437}],1594:[function(e,t,n){arguments[4][438][0].apply(n,arguments)},{dup:438}],1595:[function(e,t,n){arguments[4][439][0].apply(n,arguments)},{dup:439}],1596:[function(e,t,n){arguments[4][442][0].apply(n,arguments)},{"./_ListCache":1490,dup:442}],1597:[function(e,t,n){arguments[4][443][0].apply(n,arguments)},{dup:443}],1598:[function(e,t,n){arguments[4][444][0].apply(n,arguments)},{dup:444}],1599:[function(e,t,n){arguments[4][445][0].apply(n,arguments)},{dup:445}],1600:[function(e,t,n){arguments[4][446][0].apply(n,arguments)},{"./_ListCache":1490,"./_Map":1491,"./_MapCache":1492,dup:446}],1601:[function(e,t,n){arguments[4][447][0].apply(n,arguments)},{dup:447}],1602:[function(e,t,n){arguments[4][451][0].apply(n,arguments)},{dup:451}],1603:[function(e,t,n){arguments[4][455][0].apply(n,arguments)},{"./_baseClone":1514,dup:455}],1604:[function(e,t,n){arguments[4][458][0].apply(n,arguments)},{dup:458}],1605:[function(e,t,n){arguments[4][461][0].apply(n,arguments)},{"./forEach":1607,dup:461}],1606:[function(e,t,n){arguments[4][462][0].apply(n,arguments)},{dup:462}],1607:[function(e,t,n){arguments[4][468][0].apply(n,arguments)},{"./_arrayEach":1502,"./_baseEach":1516,"./_castFunction":1534,"./isArray":1610,dup:468}],1608:[function(e,t,n){arguments[4][472][0].apply(n,arguments)},{dup:472}],1609:[function(e,t,n){arguments[4][474][0].apply(n,arguments)},{"./_baseIsArguments":1523,"./isObjectLike":1617,dup:474}],1610:[function(e,t,n){arguments[4][475][0].apply(n,arguments)},{dup:475}],1611:[function(e,t,n){arguments[4][476][0].apply(n,arguments)},{"./isFunction":1613,"./isLength":1614,dup:476}],1612:[function(e,t,n){arguments[4][479][0].apply(n,arguments)},{"./_root":1592,"./stubFalse":1626,dup:479}],1613:[function(e,t,n){arguments[4][480][0].apply(n,arguments)},{"./_baseGetTag":1521,"./isObject":1616,dup:480}],1614:[function(e,t,n){arguments[4][482][0].apply(n,arguments)},{dup:482}],1615:[function(e,t,n){arguments[4][483][0].apply(n,arguments)},{"./_baseGetTag":1521,"./isObjectLike":1617,dup:483}],1616:[function(e,t,n){arguments[4][484][0].apply(n,arguments)},{dup:484}],1617:[function(e,t,n){arguments[4][485][0].apply(n,arguments)},{dup:485}],1618:[function(e,t,n){arguments[4][486][0].apply(n,arguments)},{"./_baseGetTag":1521,"./_getPrototype":1557,"./isObjectLike":1617,dup:486}],1619:[function(e,t,n){arguments[4][487][0].apply(n,arguments)},{"./_baseIsRegExp":1526,"./_baseUnary":1531,"./_nodeUtil":1589,dup:487}],1620:[function(e,t,n){arguments[4][488][0].apply(n,arguments)},{"./_baseGetTag":1521,"./isArray":1610,"./isObjectLike":1617,dup:488}],1621:[function(e,t,n){arguments[4][490][0].apply(n,arguments)},{"./_baseIsTypedArray":1527,"./_baseUnary":1531,"./_nodeUtil":1589,dup:490}],1622:[function(e,t,n){arguments[4][491][0].apply(n,arguments)},{"./_arrayLikeKeys":1506,"./_baseKeys":1528,"./isArrayLike":1611,dup:491}],1623:[function(e,t,n){arguments[4][492][0].apply(n,arguments)},{"./_arrayLikeKeys":1506,"./_baseKeysIn":1529,"./isArrayLike":1611,dup:492}],1624:[function(e,t,n){arguments[4][496][0].apply(n,arguments)},{dup:496}],1625:[function(e,t,n){arguments[4][501][0].apply(n,arguments)},{dup:501}],1626:[function(e,t,n){arguments[4][502][0].apply(n,arguments)},{dup:502}],1627:[function(e,t,n){arguments[4][509][0].apply(n,arguments)},{"./_baseUniq":1532,dup:509}],1628:[function(e,t,n){arguments[4][273][0].apply(n,arguments)},{dup:273}],1629:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(e){function t(e){var t=e.node,n=e.scope,r=[],i=t.right;if(!s.isIdentifier(i)||!n.hasBinding(i.name)){var a=n.generateUidIdentifier("arr");r.push(s.variableDeclaration("var",[s.variableDeclarator(a,i)])),i=a}var u=n.generateUidIdentifier("i"),l=o({BODY:t.body,KEY:u,ARR:i});s.inherits(l,t),s.ensureBlock(l);var c=s.memberExpression(i,u,!0),p=t.left;return s.isVariableDeclaration(p)?(p.declarations[0].init=c,l.body.body.unshift(p)):l.body.body.unshift(s.expressionStatement(s.assignmentExpression("=",p,c))),e.parentPath.isLabeledStatement()&&(l=s.labeledStatement(e.parentPath.node.label,l)),r.push(l),r}function n(e,t){var n=e.node,r=e.scope,a=n.left,o=void 0,l=void 0;if(s.isIdentifier(a)||s.isPattern(a)||s.isMemberExpression(a))l=a;else{if(!s.isVariableDeclaration(a))throw t.buildCodeFrameError(a,i.get("unknownForHead",a.type));l=r.generateUidIdentifier("ref"),o=s.variableDeclaration(a.kind,[s.variableDeclarator(a.declarations[0].id,l)])}var c=r.generateUidIdentifier("iterator"),p=r.generateUidIdentifier("isArray"),f=u({LOOP_OBJECT:c,IS_ARRAY:p,OBJECT:n.right,INDEX:r.generateUidIdentifier("i"),ID:l});return o||f.body.body.shift(),{declar:o,node:f,loop:f}}function r(e,t){var n=e.node,r=e.scope,a=e.parent,o=n.left,u=void 0,c=r.generateUidIdentifier("step"),p=s.memberExpression(c,s.identifier("value"));if(s.isIdentifier(o)||s.isPattern(o)||s.isMemberExpression(o))u=s.expressionStatement(s.assignmentExpression("=",o,p));else{if(!s.isVariableDeclaration(o))throw t.buildCodeFrameError(o,i.get("unknownForHead",o.type));u=s.variableDeclaration(o.kind,[s.variableDeclarator(o.declarations[0].id,p)])}var f=r.generateUidIdentifier("iterator"),h=l({ITERATOR_HAD_ERROR_KEY:r.generateUidIdentifier("didIteratorError"),ITERATOR_COMPLETION:r.generateUidIdentifier("iteratorNormalCompletion"),ITERATOR_ERROR_KEY:r.generateUidIdentifier("iteratorError"),ITERATOR_KEY:f,STEP_KEY:c,OBJECT:n.right,BODY:null}),d=s.isLabeledStatement(a),y=h[3].block.body,m=y[0];return d&&(y[0]=s.labeledStatement(a.label,m)),{replaceParent:d,declar:u,loop:m,node:h}}var i=e.messages,a=e.template,s=e.types,o=a("\n for (var KEY = 0; KEY < ARR.length; KEY++) BODY;\n "),u=a("\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n var ID;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n "),l=a("\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY; !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done); ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n ");return{visitor:{ForOfStatement:function(e,i){if(e.get("right").isArrayExpression())return e.parentPath.isLabeledStatement()?e.parentPath.replaceWithMultiple(t(e)):e.replaceWithMultiple(t(e));var a=r;i.opts.loose&&(a=n);var o=e.node,u=a(e,i),l=u.declar,c=u.loop,p=c.body;e.ensureBlock(),l&&p.body.push(l),p.body=p.body.concat(o.body.body),s.inherits(c,o),s.inherits(c.body,o.body),u.replaceParent?(e.parentPath.replaceWithMultiple(u.node),e.remove()):e.replaceWithMultiple(u.node)}}}},t.exports=n.default},{}],1630:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e){d.default.ok(this instanceof a),m.assertIdentifier(e),this.nextTempId=0,this.contextId=e,this.listing=[],this.marked=[!0],this.finalLoc=s(),this.tryEntries=[],this.leapManager=new g.LeapManager(this)}function s(){return m.numericLiteral(-1)}function o(e){return new Error("all declarations should have been transformed into assignments before the Exploder began its work: "+(0,f.default)(e))}function u(e){var t=e.type;return"normal"===t?!A.call(e,"target"):"break"===t||"continue"===t?!A.call(e,"value")&&m.isLiteral(e.target):("return"===t||"throw"===t)&&(A.call(e,"value")&&!A.call(e,"target"))}var l=e("babel-runtime/helpers/typeof"),c=i(l),p=e("babel-runtime/core-js/json/stringify"),f=i(p),h=e("assert"),d=i(h),y=e("babel-types"),m=r(y),b=e("./leap"),g=r(b),v=e("./meta"),x=r(v),_=e("./util"),E=r(_),A=Object.prototype.hasOwnProperty,D=a.prototype;n.Emitter=a,D.mark=function(e){m.assertLiteral(e);var t=this.listing.length;return e.value===-1?e.value=t:d.default.strictEqual(e.value,t),this.marked[t]=!0,e},D.emit=function(e){m.isExpression(e)&&(e=m.expressionStatement(e)),m.assertStatement(e),this.listing.push(e)},D.emitAssign=function(e,t){return this.emit(this.assign(e,t)),e},D.assign=function(e,t){return m.expressionStatement(m.assignmentExpression("=",e,t))},D.contextProperty=function(e,t){return m.memberExpression(this.contextId,t?m.stringLiteral(e):m.identifier(e),!!t)},D.stop=function(e){e&&this.setReturnValue(e),this.jump(this.finalLoc)},D.setReturnValue=function(e){m.assertExpression(e.value),this.emitAssign(this.contextProperty("rval"),this.explodeExpression(e))},D.clearPendingException=function(e,t){m.assertLiteral(e);var n=m.callExpression(this.contextProperty("catch",!0),[e]);t?this.emitAssign(t,n):this.emit(n)},D.jump=function(e){this.emitAssign(this.contextProperty("next"),e),this.emit(m.breakStatement())},D.jumpIf=function(e,t){m.assertExpression(e),m.assertLiteral(t),this.emit(m.ifStatement(e,m.blockStatement([this.assign(this.contextProperty("next"),t),m.breakStatement()])))},D.jumpIfNot=function(e,t){m.assertExpression(e),m.assertLiteral(t);var n=void 0;n=m.isUnaryExpression(e)&&"!"===e.operator?e.argument:m.unaryExpression("!",e),this.emit(m.ifStatement(n,m.blockStatement([this.assign(this.contextProperty("next"),t),m.breakStatement()])))},D.makeTempVar=function(){return this.contextProperty("t"+this.nextTempId++)},D.getContextFunction=function(e){return m.functionExpression(e||null,[this.contextId],m.blockStatement([this.getDispatchLoop()]),!1,!1)},D.getDispatchLoop=function(){var e=this,t=[],n=void 0,r=!1;return e.listing.forEach(function(i,a){e.marked.hasOwnProperty(a)&&(t.push(m.switchCase(m.numericLiteral(a),n=[])),r=!1),r||(n.push(i),m.isCompletionStatement(i)&&(r=!0))}),this.finalLoc.value=this.listing.length,t.push(m.switchCase(this.finalLoc,[]),m.switchCase(m.stringLiteral("end"),[m.returnStatement(m.callExpression(this.contextProperty("stop"),[]))])),m.whileStatement(m.numericLiteral(1),m.switchStatement(m.assignmentExpression("=",this.contextProperty("prev"),this.contextProperty("next")),t))},D.getTryLocsList=function(){if(0===this.tryEntries.length)return null;var e=0;return m.arrayExpression(this.tryEntries.map(function(t){var n=t.firstLoc.value;d.default.ok(n>=e,"try entries out of order"),e=n;var r=t.catchEntry,i=t.finallyEntry,a=[t.firstLoc,r?r.firstLoc:null];return i&&(a[2]=i.firstLoc,a[3]=i.afterLoc),m.arrayExpression(a)}))},D.explode=function(e,t){var n=e.node,r=this;if(m.assertNode(n),m.isDeclaration(n))throw o(n);if(m.isStatement(n))return r.explodeStatement(e);if(m.isExpression(n))return r.explodeExpression(e,t);switch(n.type){case"Program":return e.get("body").map(r.explodeStatement,r);case"VariableDeclarator":throw o(n);case"Property":case"SwitchCase":case"CatchClause":throw new Error(n.type+" nodes should be handled by their parents");default:throw new Error("unknown Node of type "+(0,f.default)(n.type))}},D.explodeStatement=function(e,t){var n=e.node,r=this,i=void 0,a=void 0,o=void 0;if(m.assertStatement(n),t?m.assertIdentifier(t):t=null,m.isBlockStatement(n))return void e.get("body").forEach(function(e){r.explodeStatement(e)});if(!x.containsLeap(n))return void r.emit(n);var u=function(){switch(n.type){case"ExpressionStatement":r.explodeExpression(e.get("expression"),!0);break;case"LabeledStatement":a=s(),r.leapManager.withEntry(new g.LabeledEntry(a,n.label),function(){r.explodeStatement(e.get("body"),n.label)}),r.mark(a);break;case"WhileStatement":i=s(),a=s(),r.mark(i),r.jumpIfNot(r.explodeExpression(e.get("test")),a),r.leapManager.withEntry(new g.LoopEntry(a,i,t),function(){r.explodeStatement(e.get("body"))}),r.jump(i),r.mark(a);break;case"DoWhileStatement":var u=s(),l=s();a=s(),r.mark(u),r.leapManager.withEntry(new g.LoopEntry(a,l,t),function(){r.explode(e.get("body"))}),r.mark(l),r.jumpIf(r.explodeExpression(e.get("test")),u),r.mark(a);break;case"ForStatement":o=s();var c=s();a=s(),n.init&&r.explode(e.get("init"),!0),r.mark(o),n.test&&r.jumpIfNot(r.explodeExpression(e.get("test")),a),r.leapManager.withEntry(new g.LoopEntry(a,c,t),function(){r.explodeStatement(e.get("body"))}),r.mark(c),n.update&&r.explode(e.get("update"),!0),r.jump(o),r.mark(a);break;case"TypeCastExpression":return{v:r.explodeExpression(e.get("expression"))};case"ForInStatement":o=s(),a=s();var p=r.makeTempVar();r.emitAssign(p,m.callExpression(E.runtimeProperty("keys"),[r.explodeExpression(e.get("right"))])),r.mark(o);var h=r.makeTempVar();r.jumpIf(m.memberExpression(m.assignmentExpression("=",h,m.callExpression(p,[])),m.identifier("done"),!1),a),r.emitAssign(n.left,m.memberExpression(h,m.identifier("value"),!1)),r.leapManager.withEntry(new g.LoopEntry(a,o,t),function(){r.explodeStatement(e.get("body"))}),r.jump(o),r.mark(a);break;case"BreakStatement":r.emitAbruptCompletion({type:"break",target:r.leapManager.getBreakLoc(n.label)});break;case"ContinueStatement":r.emitAbruptCompletion({type:"continue",target:r.leapManager.getContinueLoc(n.label)});break;case"SwitchStatement":var y=r.emitAssign(r.makeTempVar(),r.explodeExpression(e.get("discriminant")));a=s();for(var b=s(),v=b,x=[],_=n.cases||[],A=_.length-1;A>=0;--A){var D=_[A];m.assertSwitchCase(D),D.test?v=m.conditionalExpression(m.binaryExpression("===",y,D.test),x[A]=s(),v):x[A]=b}var S=e.get("discriminant");S.replaceWith(v),r.jump(r.explodeExpression(S)),r.leapManager.withEntry(new g.SwitchEntry(a),function(){e.get("cases").forEach(function(e){var t=e.key;r.mark(x[t]),e.get("consequent").forEach(function(e){r.explodeStatement(e)})})}),r.mark(a),b.value===-1&&(r.mark(b),d.default.strictEqual(a.value,b.value));break;case"IfStatement":var w=n.alternate&&s();a=s(),r.jumpIfNot(r.explodeExpression(e.get("test")),w||a),r.explodeStatement(e.get("consequent")),w&&(r.jump(a),r.mark(w),r.explodeStatement(e.get("alternate"))),r.mark(a);break;case"ReturnStatement":r.emitAbruptCompletion({type:"return",value:r.explodeExpression(e.get("argument"))});break;case"WithStatement":throw new Error("WithStatement not supported in generator functions.");case"TryStatement":a=s();var k=n.handler,F=k&&s(),T=F&&new g.CatchEntry(F,k.param),P=n.finalizer&&s(),j=P&&new g.FinallyEntry(P,a),B=new g.TryEntry(r.getUnmarkedCurrentLoc(),T,j);r.tryEntries.push(B),r.updateContextPrevLoc(B.firstLoc), +r.leapManager.withEntry(B,function(){r.explodeStatement(e.get("block")),F&&function(){P?r.jump(P):r.jump(a),r.updateContextPrevLoc(r.mark(F));var t=e.get("handler.body"),n=r.makeTempVar();r.clearPendingException(B.firstLoc,n),t.traverse(C,{safeParam:n,catchParamName:k.param.name}),r.leapManager.withEntry(T,function(){r.explodeStatement(t)})}(),P&&(r.updateContextPrevLoc(r.mark(P)),r.leapManager.withEntry(j,function(){r.explodeStatement(e.get("finalizer"))}),r.emit(m.returnStatement(m.callExpression(r.contextProperty("finish"),[j.firstLoc]))))}),r.mark(a);break;case"ThrowStatement":r.emit(m.throwStatement(r.explodeExpression(e.get("argument"))));break;default:throw new Error("unknown Statement of type "+(0,f.default)(n.type))}}();return"object"===(void 0===u?"undefined":(0,c.default)(u))?u.v:void 0};var C={Identifier:function(e,t){e.node.name===t.catchParamName&&E.isReference(e)&&e.replaceWith(t.safeParam)},Scope:function(e,t){e.scope.hasOwnBinding(t.catchParamName)&&e.skip()}};D.emitAbruptCompletion=function(e){u(e)||d.default.ok(!1,"invalid completion record: "+(0,f.default)(e)),d.default.notStrictEqual(e.type,"normal","normal completions are not abrupt");var t=[m.stringLiteral(e.type)];"break"===e.type||"continue"===e.type?(m.assertLiteral(e.target),t[1]=e.target):"return"!==e.type&&"throw"!==e.type||e.value&&(m.assertExpression(e.value),t[1]=e.value),this.emit(m.returnStatement(m.callExpression(this.contextProperty("abrupt"),t)))},D.getUnmarkedCurrentLoc=function(){return m.numericLiteral(this.listing.length)},D.updateContextPrevLoc=function(e){e?(m.assertLiteral(e),e.value===-1?e.value=this.listing.length:d.default.strictEqual(e.value,this.listing.length)):e=this.getUnmarkedCurrentLoc(),this.emitAssign(this.contextProperty("prev"),e)},D.explodeExpression=function(e,t){function n(e){if(m.assertExpression(e),!t)return e;a.emit(e)}function r(e,t,n){d.default.ok(!n||!e,"Ignoring the result of a child expression but forcing it to be assigned to a temporary variable?");var r=a.explodeExpression(t,n);return n||(e||l&&!m.isLiteral(r))&&(r=a.emitAssign(e||a.makeTempVar(),r)),r}var i=e.node;if(!i)return i;m.assertExpression(i);var a=this,o=void 0,u=void 0;if(!x.containsLeap(i))return n(i);var l=x.containsLeap.onlyChildren(i),p=function(){switch(i.type){case"MemberExpression":return{v:n(m.memberExpression(a.explodeExpression(e.get("object")),i.computed?r(null,e.get("property")):i.property,i.computed))};case"CallExpression":var l=e.get("callee"),c=e.get("arguments"),p=void 0,h=[],y=!1;if(c.forEach(function(e){y=y||x.containsLeap(e.node)}),m.isMemberExpression(l.node))if(y){var b=r(a.makeTempVar(),l.get("object")),g=l.node.computed?r(null,l.get("property")):l.node.property;h.unshift(b),p=m.memberExpression(m.memberExpression(b,g,l.node.computed),m.identifier("call"),!1)}else p=a.explodeExpression(l);else p=r(null,l),m.isMemberExpression(p)&&(p=m.sequenceExpression([m.numericLiteral(0),p]));return c.forEach(function(e){h.push(r(null,e))}),{v:n(m.callExpression(p,h))};case"NewExpression":return{v:n(m.newExpression(r(null,e.get("callee")),e.get("arguments").map(function(e){return r(null,e)})))};case"ObjectExpression":return{v:n(m.objectExpression(e.get("properties").map(function(e){return e.isObjectProperty()?m.objectProperty(e.node.key,r(null,e.get("value")),e.node.computed):e.node})))};case"ArrayExpression":return{v:n(m.arrayExpression(e.get("elements").map(function(e){return r(null,e)})))};case"SequenceExpression":var v=i.expressions.length-1;return e.get("expressions").forEach(function(e){e.key===v?o=a.explodeExpression(e,t):a.explodeExpression(e,!0)}),{v:o};case"LogicalExpression":u=s(),t||(o=a.makeTempVar());var _=r(o,e.get("left"));return"&&"===i.operator?a.jumpIfNot(_,u):(d.default.strictEqual(i.operator,"||"),a.jumpIf(_,u)),r(o,e.get("right"),t),a.mark(u),{v:o};case"ConditionalExpression":var E=s();u=s();var A=a.explodeExpression(e.get("test"));return a.jumpIfNot(A,E),t||(o=a.makeTempVar()),r(o,e.get("consequent"),t),a.jump(u),a.mark(E),r(o,e.get("alternate"),t),a.mark(u),{v:o};case"UnaryExpression":return{v:n(m.unaryExpression(i.operator,a.explodeExpression(e.get("argument")),!!i.prefix))};case"BinaryExpression":return{v:n(m.binaryExpression(i.operator,r(null,e.get("left")),r(null,e.get("right"))))};case"AssignmentExpression":return{v:n(m.assignmentExpression(i.operator,a.explodeExpression(e.get("left")),a.explodeExpression(e.get("right"))))};case"UpdateExpression":return{v:n(m.updateExpression(i.operator,a.explodeExpression(e.get("argument")),i.prefix))};case"YieldExpression":u=s();var D=i.argument&&a.explodeExpression(e.get("argument"));if(D&&i.delegate){var C=a.makeTempVar();return a.emit(m.returnStatement(m.callExpression(a.contextProperty("delegateYield"),[D,m.stringLiteral(C.property.name),u]))),a.mark(u),{v:C}}return a.emitAssign(a.contextProperty("next"),u),a.emit(m.returnStatement(D||null)),a.mark(u),{v:a.contextProperty("sent")};default:throw new Error("unknown Expression of type "+(0,f.default)(i.type))}}();return"object"===(void 0===p?"undefined":(0,c.default)(p))?p.v:void 0}},{"./leap":1633,"./meta":1634,"./util":1635,assert:2,"babel-runtime/core-js/json/stringify":1638,"babel-runtime/helpers/typeof":1646,"babel-types":1737}],1631:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}var a=e("babel-runtime/core-js/object/keys"),s=i(a),o=e("babel-types"),u=r(o),l=Object.prototype.hasOwnProperty;n.hoist=function(e){function t(e,t){u.assertVariableDeclaration(e);var r=[];return e.declarations.forEach(function(e){n[e.id.name]=u.identifier(e.id.name),e.init?r.push(u.assignmentExpression("=",e.id,e.init)):t&&r.push(e.id)}),0===r.length?null:1===r.length?r[0]:u.sequenceExpression(r)}u.assertFunction(e.node);var n={};e.get("body").traverse({VariableDeclaration:{exit:function(e){var n=t(e.node,!1);null===n?e.remove():e.replaceWith(u.expressionStatement(n)),e.skip()}},ForStatement:function(e){var n=e.node.init;u.isVariableDeclaration(n)&&e.get("init").replaceWith(t(n,!1))},ForXStatement:function(e){var n=e.get("left");n.isVariableDeclaration()&&n.replaceWith(t(n.node,!0))},FunctionDeclaration:function(e){var t=e.node;n[t.id.name]=t.id;var r=u.expressionStatement(u.assignmentExpression("=",t.id,u.functionExpression(t.id,t.params,t.body,t.generator,t.expression)));e.parentPath.isBlockStatement()?(e.parentPath.unshiftContainer("body",r),e.remove()):e.replaceWith(r),e.skip()},FunctionExpression:function(e){e.skip()}});var r={};e.get("params").forEach(function(e){var t=e.node;u.isIdentifier(t)&&(r[t.name]=t)});var i=[];return(0,s.default)(n).forEach(function(e){l.call(r,e)||i.push(u.variableDeclarator(n[e],null))}),0===i.length?null:u.variableDeclaration("var",i)}},{"babel-runtime/core-js/object/keys":1642,"babel-types":1737}],1632:[function(e,t,n){"use strict";n.__esModule=!0,n.default=function(){return e("./visit")}},{"./visit":1636}],1633:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(){y.default.ok(this instanceof a)}function s(e){a.call(this),b.assertLiteral(e),this.returnLoc=e}function o(e,t,n){a.call(this),b.assertLiteral(e),b.assertLiteral(t),n?b.assertIdentifier(n):n=null,this.breakLoc=e,this.continueLoc=t,this.label=n}function u(e){a.call(this),b.assertLiteral(e),this.breakLoc=e}function l(e,t,n){a.call(this),b.assertLiteral(e),t?y.default.ok(t instanceof c):t=null,n?y.default.ok(n instanceof p):n=null,y.default.ok(t||n),this.firstLoc=e,this.catchEntry=t,this.finallyEntry=n}function c(e,t){a.call(this),b.assertLiteral(e),b.assertIdentifier(t),this.firstLoc=e,this.paramId=t}function p(e,t){a.call(this),b.assertLiteral(e),b.assertLiteral(t),this.firstLoc=e,this.afterLoc=t}function f(e,t){a.call(this),b.assertLiteral(e),b.assertIdentifier(t),this.breakLoc=e,this.label=t}function h(t){y.default.ok(this instanceof h);var n=e("./emit").Emitter;y.default.ok(t instanceof n),this.emitter=t,this.entryStack=[new s(t.finalLoc)]}var d=e("assert"),y=i(d),m=e("babel-types"),b=r(m),g=e("util");(0,g.inherits)(s,a),n.FunctionEntry=s,(0,g.inherits)(o,a),n.LoopEntry=o,(0,g.inherits)(u,a),n.SwitchEntry=u,(0,g.inherits)(l,a),n.TryEntry=l,(0,g.inherits)(c,a),n.CatchEntry=c,(0,g.inherits)(p,a),n.FinallyEntry=p,(0,g.inherits)(f,a),n.LabeledEntry=f;var v=h.prototype;n.LeapManager=h,v.withEntry=function(e,t){y.default.ok(e instanceof a),this.entryStack.push(e);try{t.call(this.emitter)}finally{var n=this.entryStack.pop();y.default.strictEqual(n,e)}},v._findLeapLocation=function(e,t){for(var n=this.entryStack.length-1;n>=0;--n){var r=this.entryStack[n],i=r[e];if(i)if(t){if(r.label&&r.label.name===t.name)return i}else if(!(r instanceof f))return i}return null},v.getBreakLoc=function(e){return this._findLeapLocation("breakLoc",e)},v.getContinueLoc=function(e){return this._findLeapLocation("continueLoc",e)}},{"./emit":1630,assert:2,"babel-types":1737,util:35}],1634:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){function n(e){function t(e){return n||(Array.isArray(e)?e.some(t):l.isNode(e)&&(o.default.strictEqual(n,!1),n=r(e))),n}l.assertNode(e);var n=!1,i=l.VISITOR_KEYS[e.type];if(i)for(var a=0;a0&&(s.node.body=l);var c=a(e);p.assertIdentifier(n.id);var d=p.identifier(n.id.name+"$"),m=(0,f.hoist)(e);o(e,i)&&(m=m||p.variableDeclaration("var",[]),m.declarations.push(p.variableDeclarator(i,p.identifier("arguments"))));var b=new h.Emitter(r);b.explode(e.get("body")),m&&m.declarations.length>0&&u.push(m);var x=[b.getContextFunction(d),n.generator?c:p.nullLiteral(),p.thisExpression()],_=b.getTryLocsList();_&&x.push(_);var E=p.callExpression(y.runtimeProperty(n.async?"async":"wrap"),x);u.push(p.returnStatement(E)),n.body=p.blockStatement(u);var A=s.node.directives;A&&(n.body.directives=A);var D=n.generator;D&&(n.generator=!1),n.async&&(n.async=!1),D&&p.isExpression(n)&&e.replaceWith(p.callExpression(y.runtimeProperty("mark"),[n])),e.requeue()}}};var b={"FunctionExpression|FunctionDeclaration":function(e){e.skip()},Identifier:function(e,t){"arguments"===e.node.name&&y.isReference(e)&&(e.replaceWith(t.argsId),t.didRenameArguments=!0)}},g={MetaProperty:function(e){var t=e.node;"function"===t.meta.name&&"sent"===t.property.name&&e.replaceWith(p.memberExpression(this.context,p.identifier("_sent")))}},v={Function:function(e){e.skip()},AwaitExpression:function(e){var t=e.node.argument;e.replaceWith(p.yieldExpression(p.callExpression(y.runtimeProperty("awrap"),[t]),!1))}}},{"./emit":1630,"./hoist":1631,"./util":1635,assert:2,"babel-types":1737,private:1886}],1637:[function(e,t,n){arguments[4][100][0].apply(n,arguments)},{"core-js/library/fn/get-iterator":1647,dup:100}],1638:[function(e,t,n){arguments[4][101][0].apply(n,arguments)},{"core-js/library/fn/json/stringify":1648,dup:101}],1639:[function(e,t,n){arguments[4][103][0].apply(n,arguments)},{"core-js/library/fn/number/max-safe-integer":1649,dup:103}],1640:[function(e,t,n){arguments[4][105][0].apply(n,arguments)},{"core-js/library/fn/object/create":1650,dup:105}],1641:[function(e,t,n){arguments[4][106][0].apply(n,arguments)},{"core-js/library/fn/object/get-own-property-symbols":1651,dup:106}],1642:[function(e,t,n){arguments[4][107][0].apply(n,arguments)},{"core-js/library/fn/object/keys":1652,dup:107}],1643:[function(e,t,n){arguments[4][109][0].apply(n,arguments)},{"core-js/library/fn/symbol":1654,dup:109}],1644:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{"core-js/library/fn/symbol/for":1653,dup:110}],1645:[function(e,t,n){arguments[4][111][0].apply(n,arguments)},{"core-js/library/fn/symbol/iterator":1655,dup:111}],1646:[function(e,t,n){arguments[4][118][0].apply(n,arguments)},{"../core-js/symbol":1643,"../core-js/symbol/iterator":1645,dup:118}],1647:[function(e,t,n){arguments[4][119][0].apply(n,arguments)},{"../modules/core.get-iterator":1715,"../modules/es6.string.iterator":1721,"../modules/web.dom.iterable":1725,dup:119}],1648:[function(e,t,n){arguments[4][120][0].apply(n,arguments)},{"../../modules/_core":1662,dup:120}],1649:[function(e,t,n){arguments[4][122][0].apply(n,arguments)},{"../../modules/es6.number.max-safe-integer":1717,dup:122}],1650:[function(e,t,n){arguments[4][124][0].apply(n,arguments)},{"../../modules/_core":1662,"../../modules/es6.object.create":1718,dup:124}],1651:[function(e,t,n){arguments[4][125][0].apply(n,arguments)},{"../../modules/_core":1662,"../../modules/es6.symbol":1722,dup:125}],1652:[function(e,t,n){arguments[4][126][0].apply(n,arguments)},{"../../modules/_core":1662,"../../modules/es6.object.keys":1719,dup:126}],1653:[function(e,t,n){arguments[4][128][0].apply(n,arguments)},{"../../modules/_core":1662,"../../modules/es6.symbol":1722,dup:128}],1654:[function(e,t,n){arguments[4][129][0].apply(n,arguments)},{"../../modules/_core":1662,"../../modules/es6.object.to-string":1720,"../../modules/es6.symbol":1722,"../../modules/es7.symbol.async-iterator":1723,"../../modules/es7.symbol.observable":1724,dup:129}],1655:[function(e,t,n){arguments[4][130][0].apply(n,arguments)},{"../../modules/_wks-ext":1712,"../../modules/es6.string.iterator":1721,"../../modules/web.dom.iterable":1725,dup:130}],1656:[function(e,t,n){arguments[4][133][0].apply(n,arguments)},{dup:133}],1657:[function(e,t,n){arguments[4][134][0].apply(n,arguments)},{dup:134}],1658:[function(e,t,n){arguments[4][136][0].apply(n,arguments)},{"./_is-object":1678,dup:136}],1659:[function(e,t,n){arguments[4][138][0].apply(n,arguments)},{"./_to-index":1704,"./_to-iobject":1706,"./_to-length":1707,dup:138}],1660:[function(e,t,n){arguments[4][142][0].apply(n,arguments)},{"./_cof":1661,"./_wks":1713,dup:142}],1661:[function(e,t,n){arguments[4][143][0].apply(n,arguments)},{dup:143}],1662:[function(e,t,n){arguments[4][148][0].apply(n,arguments)},{dup:148}],1663:[function(e,t,n){arguments[4][149][0].apply(n,arguments)},{"./_a-function":1656,dup:149}],1664:[function(e,t,n){arguments[4][150][0].apply(n,arguments)},{dup:150}],1665:[function(e,t,n){arguments[4][151][0].apply(n,arguments)},{"./_fails":1670,dup:151}],1666:[function(e,t,n){arguments[4][152][0].apply(n,arguments)},{"./_global":1671,"./_is-object":1678,dup:152}],1667:[function(e,t,n){arguments[4][153][0].apply(n,arguments)},{dup:153}],1668:[function(e,t,n){arguments[4][154][0].apply(n,arguments)},{"./_object-gops":1692,"./_object-keys":1695,"./_object-pie":1696,dup:154}],1669:[function(e,t,n){arguments[4][155][0].apply(n,arguments)},{"./_core":1662,"./_ctx":1663,"./_global":1671,"./_hide":1673,dup:155}],1670:[function(e,t,n){arguments[4][156][0].apply(n,arguments)},{dup:156}],1671:[function(e,t,n){arguments[4][158][0].apply(n,arguments)},{dup:158}],1672:[function(e,t,n){arguments[4][159][0].apply(n,arguments)},{dup:159}],1673:[function(e,t,n){arguments[4][160][0].apply(n,arguments)},{"./_descriptors":1665,"./_object-dp":1687,"./_property-desc":1698,dup:160}],1674:[function(e,t,n){arguments[4][161][0].apply(n,arguments)},{"./_global":1671,dup:161}],1675:[function(e,t,n){arguments[4][162][0].apply(n,arguments)},{"./_descriptors":1665,"./_dom-create":1666,"./_fails":1670,dup:162}],1676:[function(e,t,n){arguments[4][163][0].apply(n,arguments)},{"./_cof":1661,dup:163}],1677:[function(e,t,n){arguments[4][165][0].apply(n,arguments)},{"./_cof":1661,dup:165}],1678:[function(e,t,n){arguments[4][166][0].apply(n,arguments)},{dup:166}],1679:[function(e,t,n){arguments[4][168][0].apply(n,arguments)},{"./_hide":1673,"./_object-create":1686,"./_property-desc":1698,"./_set-to-string-tag":1700,"./_wks":1713,dup:168}],1680:[function(e,t,n){arguments[4][169][0].apply(n,arguments)},{"./_export":1669,"./_has":1672,"./_hide":1673,"./_iter-create":1679,"./_iterators":1682,"./_library":1684,"./_object-gpo":1693,"./_redefine":1699,"./_set-to-string-tag":1700,"./_wks":1713,dup:169}],1681:[function(e,t,n){arguments[4][170][0].apply(n,arguments)},{dup:170}],1682:[function(e,t,n){arguments[4][171][0].apply(n,arguments)},{dup:171}],1683:[function(e,t,n){arguments[4][172][0].apply(n,arguments)},{"./_object-keys":1695,"./_to-iobject":1706,dup:172}],1684:[function(e,t,n){arguments[4][173][0].apply(n,arguments)},{dup:173}],1685:[function(e,t,n){arguments[4][174][0].apply(n,arguments)},{"./_fails":1670,"./_has":1672,"./_is-object":1678,"./_object-dp":1687,"./_uid":1710,dup:174}],1686:[function(e,t,n){arguments[4][176][0].apply(n,arguments)},{"./_an-object":1658,"./_dom-create":1666,"./_enum-bug-keys":1667,"./_html":1674,"./_object-dps":1688,"./_shared-key":1701,dup:176}],1687:[function(e,t,n){arguments[4][177][0].apply(n,arguments)},{"./_an-object":1658,"./_descriptors":1665,"./_ie8-dom-define":1675,"./_to-primitive":1709,dup:177}],1688:[function(e,t,n){arguments[4][178][0].apply(n,arguments)},{"./_an-object":1658,"./_descriptors":1665,"./_object-dp":1687,"./_object-keys":1695,dup:178}],1689:[function(e,t,n){arguments[4][179][0].apply(n,arguments)},{"./_descriptors":1665,"./_has":1672,"./_ie8-dom-define":1675,"./_object-pie":1696,"./_property-desc":1698,"./_to-iobject":1706,"./_to-primitive":1709,dup:179}],1690:[function(e,t,n){arguments[4][180][0].apply(n,arguments)},{"./_object-gopn":1691,"./_to-iobject":1706,dup:180}],1691:[function(e,t,n){arguments[4][181][0].apply(n,arguments)},{"./_enum-bug-keys":1667,"./_object-keys-internal":1694,dup:181}],1692:[function(e,t,n){arguments[4][182][0].apply(n,arguments)},{dup:182}],1693:[function(e,t,n){arguments[4][183][0].apply(n,arguments)},{"./_has":1672,"./_shared-key":1701,"./_to-object":1708,dup:183}],1694:[function(e,t,n){arguments[4][184][0].apply(n,arguments)},{"./_array-includes":1659,"./_has":1672,"./_shared-key":1701,"./_to-iobject":1706,dup:184}],1695:[function(e,t,n){arguments[4][185][0].apply(n,arguments)},{"./_enum-bug-keys":1667,"./_object-keys-internal":1694,dup:185}],1696:[function(e,t,n){arguments[4][186][0].apply(n,arguments)},{dup:186}],1697:[function(e,t,n){arguments[4][187][0].apply(n,arguments)},{"./_core":1662,"./_export":1669,"./_fails":1670,dup:187}],1698:[function(e,t,n){arguments[4][188][0].apply(n,arguments)},{dup:188}],1699:[function(e,t,n){arguments[4][190][0].apply(n,arguments)},{"./_hide":1673,dup:190}],1700:[function(e,t,n){arguments[4][193][0].apply(n,arguments)},{"./_has":1672,"./_object-dp":1687,"./_wks":1713,dup:193}],1701:[function(e,t,n){arguments[4][194][0].apply(n,arguments)},{"./_shared":1702,"./_uid":1710,dup:194}],1702:[function(e,t,n){arguments[4][195][0].apply(n,arguments)},{"./_global":1671,dup:195}],1703:[function(e,t,n){arguments[4][196][0].apply(n,arguments)},{"./_defined":1664,"./_to-integer":1705,dup:196}],1704:[function(e,t,n){arguments[4][197][0].apply(n,arguments)},{"./_to-integer":1705,dup:197}],1705:[function(e,t,n){arguments[4][198][0].apply(n,arguments)},{dup:198}],1706:[function(e,t,n){arguments[4][199][0].apply(n,arguments)},{"./_defined":1664,"./_iobject":1676,dup:199}],1707:[function(e,t,n){arguments[4][200][0].apply(n,arguments)},{"./_to-integer":1705,dup:200}],1708:[function(e,t,n){arguments[4][201][0].apply(n,arguments)},{"./_defined":1664,dup:201}],1709:[function(e,t,n){arguments[4][202][0].apply(n,arguments)},{"./_is-object":1678,dup:202}],1710:[function(e,t,n){arguments[4][203][0].apply(n,arguments)},{dup:203}],1711:[function(e,t,n){arguments[4][204][0].apply(n,arguments)},{"./_core":1662,"./_global":1671,"./_library":1684,"./_object-dp":1687,"./_wks-ext":1712,dup:204}],1712:[function(e,t,n){arguments[4][205][0].apply(n,arguments)},{"./_wks":1713,dup:205}],1713:[function(e,t,n){arguments[4][206][0].apply(n,arguments)},{"./_global":1671,"./_shared":1702,"./_uid":1710,dup:206}],1714:[function(e,t,n){arguments[4][207][0].apply(n,arguments)},{"./_classof":1660,"./_core":1662,"./_iterators":1682,"./_wks":1713,dup:207}],1715:[function(e,t,n){arguments[4][208][0].apply(n,arguments)},{"./_an-object":1658,"./_core":1662,"./core.get-iterator-method":1714,dup:208}],1716:[function(e,t,n){arguments[4][209][0].apply(n,arguments)},{"./_add-to-unscopables":1657,"./_iter-define":1680,"./_iter-step":1681,"./_iterators":1682,"./_to-iobject":1706,dup:209}],1717:[function(e,t,n){arguments[4][211][0].apply(n,arguments)},{"./_export":1669,dup:211}],1718:[function(e,t,n){arguments[4][213][0].apply(n,arguments)},{"./_export":1669,"./_object-create":1686,dup:213}],1719:[function(e,t,n){arguments[4][214][0].apply(n,arguments)},{"./_object-keys":1695,"./_object-sap":1697,"./_to-object":1708,dup:214}],1720:[function(e,t,n){arguments[4][1][0].apply(n,arguments)},{dup:1}],1721:[function(e,t,n){arguments[4][217][0].apply(n,arguments)},{"./_iter-define":1680,"./_string-at":1703,dup:217}],1722:[function(e,t,n){arguments[4][218][0].apply(n,arguments)},{"./_an-object":1658,"./_descriptors":1665,"./_enum-keys":1668,"./_export":1669,"./_fails":1670,"./_global":1671,"./_has":1672,"./_hide":1673,"./_is-array":1677,"./_keyof":1683,"./_library":1684,"./_meta":1685,"./_object-create":1686,"./_object-dp":1687,"./_object-gopd":1689,"./_object-gopn":1691,"./_object-gopn-ext":1690,"./_object-gops":1692,"./_object-keys":1695,"./_object-pie":1696,"./_property-desc":1698,"./_redefine":1699,"./_set-to-string-tag":1700,"./_shared":1702,"./_to-iobject":1706,"./_to-primitive":1709,"./_uid":1710,"./_wks":1713,"./_wks-define":1711,"./_wks-ext":1712,dup:218}],1723:[function(e,t,n){arguments[4][222][0].apply(n,arguments)},{"./_wks-define":1711,dup:222}],1724:[function(e,t,n){arguments[4][223][0].apply(n,arguments)},{"./_wks-define":1711,dup:223}],1725:[function(e,t,n){arguments[4][224][0].apply(n,arguments)},{"./_global":1671,"./_hide":1673,"./_iterators":1682,"./_wks":1713,"./es6.array.iterator":1716,dup:224}],1726:[function(e,t,n){arguments[4][254][0].apply(n,arguments)},{"babel-runtime/core-js/symbol/for":1644,dup:254}],1727:[function(e,t,n){arguments[4][255][0].apply(n,arguments)},{"./index":1737,"babel-runtime/core-js/get-iterator":1637,"babel-runtime/core-js/json/stringify":1638,"babel-runtime/core-js/number/max-safe-integer":1639,dup:255,"lodash/isNumber":1872,"lodash/isPlainObject":1875,"lodash/isRegExp":1876,"lodash/isString":1877}],1728:[function(e,t,n){arguments[4][256][0].apply(n,arguments)},{"../constants":1726,"../index":1737,"./index":1732,dup:256}],1729:[function(e,t,n){arguments[4][257][0].apply(n,arguments)},{"./index":1732,dup:257}],1730:[function(e,t,n){arguments[4][258][0].apply(n,arguments)},{"./index":1732,dup:258}],1731:[function(e,t,n){arguments[4][259][0].apply(n,arguments)},{"./index":1732,dup:259}],1732:[function(e,t,n){arguments[4][260][0].apply(n,arguments)},{"../index":1737,"babel-runtime/core-js/get-iterator":1637,"babel-runtime/core-js/json/stringify":1638,"babel-runtime/helpers/typeof":1646,dup:260}],1733:[function(e,t,n){arguments[4][261][0].apply(n,arguments)},{"./core":1728,"./es2015":1729,"./experimental":1730,"./flow":1731,"./index":1732,"./jsx":1734,"./misc":1735,dup:261}],1734:[function(e,t,n){arguments[4][262][0].apply(n,arguments)},{"./index":1732,dup:262}],1735:[function(e,t,n){arguments[4][263][0].apply(n,arguments)},{"./index":1732,dup:263}],1736:[function(e,t,n){arguments[4][264][0].apply(n,arguments)},{"./index":1737,dup:264}],1737:[function(e,t,n){arguments[4][265][0].apply(n,arguments)},{"./constants":1726,"./converters":1727,"./definitions":1732,"./definitions/init":1733,"./flow":1736,"./react":1738,"./retrievers":1739,"./validators":1740,"babel-runtime/core-js/get-iterator":1637,"babel-runtime/core-js/json/stringify":1638,"babel-runtime/core-js/object/get-own-property-symbols":1641,"babel-runtime/core-js/object/keys":1642,dup:265,"lodash/clone":1860,"lodash/compact":1861,"lodash/each":1862,"lodash/uniq":1884,"to-fast-properties":1885}],1738:[function(e,t,n){arguments[4][266][0].apply(n,arguments)},{"./index":1737,dup:266}],1739:[function(e,t,n){arguments[4][267][0].apply(n,arguments)},{"./index":1737,"babel-runtime/core-js/object/create":1640,dup:267}],1740:[function(e,t,n){arguments[4][268][0].apply(n,arguments)},{"./constants":1726,"./index":1737,"./retrievers":1739,"babel-runtime/core-js/get-iterator":1637,"babel-runtime/core-js/object/keys":1642,"babel-runtime/helpers/typeof":1646,dup:268,esutils:1744}],1741:[function(e,t,n){arguments[4][69][0].apply(n,arguments)},{dup:69}],1742:[function(e,t,n){arguments[4][70][0].apply(n,arguments)},{dup:70}],1743:[function(e,t,n){arguments[4][71][0].apply(n,arguments)},{"./code":1742,dup:71}],1744:[function(e,t,n){arguments[4][72][0].apply(n,arguments)},{"./ast":1741,"./code":1742,"./keyword":1743,dup:72}],1745:[function(e,t,n){arguments[4][282][0].apply(n,arguments)},{"./_getNative":1813,"./_root":1849,dup:282}],1746:[function(e,t,n){arguments[4][283][0].apply(n,arguments)},{"./_hashClear":1820,"./_hashDelete":1821,"./_hashGet":1822,"./_hashHas":1823,"./_hashSet":1824,dup:283}],1747:[function(e,t,n){arguments[4][284][0].apply(n,arguments)},{"./_listCacheClear":1832,"./_listCacheDelete":1833,"./_listCacheGet":1834,"./_listCacheHas":1835,"./_listCacheSet":1836,dup:284}],1748:[function(e,t,n){arguments[4][285][0].apply(n,arguments)},{"./_getNative":1813,"./_root":1849,dup:285}],1749:[function(e,t,n){arguments[4][286][0].apply(n,arguments)},{"./_mapCacheClear":1837,"./_mapCacheDelete":1838,"./_mapCacheGet":1839,"./_mapCacheHas":1840,"./_mapCacheSet":1841,dup:286}],1750:[function(e,t,n){arguments[4][287][0].apply(n,arguments)},{"./_getNative":1813,"./_root":1849,dup:287}],1751:[function(e,t,n){arguments[4][288][0].apply(n,arguments)},{"./_getNative":1813,"./_root":1849,dup:288}],1752:[function(e,t,n){arguments[4][289][0].apply(n,arguments)},{"./_MapCache":1749,"./_setCacheAdd":1850,"./_setCacheHas":1851,dup:289}],1753:[function(e,t,n){arguments[4][290][0].apply(n,arguments)},{"./_ListCache":1747,"./_stackClear":1853,"./_stackDelete":1854,"./_stackGet":1855,"./_stackHas":1856,"./_stackSet":1857,dup:290}],1754:[function(e,t,n){arguments[4][291][0].apply(n,arguments)},{"./_root":1849,dup:291}],1755:[function(e,t,n){arguments[4][292][0].apply(n,arguments)},{"./_root":1849,dup:292}],1756:[function(e,t,n){arguments[4][293][0].apply(n,arguments)},{"./_getNative":1813,"./_root":1849,dup:293}],1757:[function(e,t,n){arguments[4][294][0].apply(n,arguments)},{dup:294}],1758:[function(e,t,n){arguments[4][295][0].apply(n,arguments)},{dup:295}],1759:[function(e,t,n){arguments[4][297][0].apply(n,arguments)},{dup:297}],1760:[function(e,t,n){arguments[4][298][0].apply(n,arguments)},{dup:298}],1761:[function(e,t,n){arguments[4][299][0].apply(n,arguments)},{"./_baseIndexOf":1779,dup:299}],1762:[function(e,t,n){arguments[4][300][0].apply(n,arguments)},{dup:300}],1763:[function(e,t,n){arguments[4][301][0].apply(n,arguments)},{"./_baseTimes":1787,"./_isIndex":1828,"./isArguments":1866,"./isArray":1867,"./isBuffer":1869,"./isTypedArray":1878,dup:301}],1764:[function(e,t,n){arguments[4][303][0].apply(n,arguments)},{dup:303}],1765:[function(e,t,n){arguments[4][304][0].apply(n,arguments)},{dup:304}],1766:[function(e,t,n){arguments[4][308][0].apply(n,arguments)},{"./_baseAssignValue":1770,"./eq":1863,dup:308}],1767:[function(e,t,n){arguments[4][309][0].apply(n,arguments)},{"./eq":1863,dup:309}],1768:[function(e,t,n){arguments[4][310][0].apply(n,arguments)},{"./_copyObject":1801,"./keys":1879,dup:310}],1769:[function(e,t,n){arguments[4][311][0].apply(n,arguments)},{"./_copyObject":1801,"./keysIn":1880,dup:311}],1770:[function(e,t,n){arguments[4][312][0].apply(n,arguments)},{"./_defineProperty":1808,dup:312}],1771:[function(e,t,n){arguments[4][314][0].apply(n,arguments)},{"./_Stack":1753,"./_arrayEach":1759,"./_assignValue":1766,"./_baseAssign":1768,"./_baseAssignIn":1769,"./_cloneBuffer":1793,"./_copyArray":1800,"./_copySymbols":1802,"./_copySymbolsIn":1803,"./_getAllKeys":1810,"./_getAllKeysIn":1811,"./_getTag":1818,"./_initCloneArray":1825,"./_initCloneByTag":1826,"./_initCloneObject":1827,"./isArray":1867,"./isBuffer":1869,"./isObject":1873,"./keys":1879,dup:314}],1772:[function(e,t,n){arguments[4][315][0].apply(n,arguments)},{"./isObject":1873,dup:315}],1773:[function(e,t,n){arguments[4][316][0].apply(n,arguments)},{"./_baseForOwn":1776,"./_createBaseEach":1805,dup:316}],1774:[function(e,t,n){arguments[4][317][0].apply(n,arguments)},{dup:317}],1775:[function(e,t,n){arguments[4][319][0].apply(n,arguments)},{"./_createBaseFor":1806,dup:319}],1776:[function(e,t,n){arguments[4][320][0].apply(n,arguments)},{"./_baseFor":1775,"./keys":1879,dup:320}],1777:[function(e,t,n){arguments[4][322][0].apply(n,arguments)},{"./_arrayPush":1764,"./isArray":1867,dup:322}],1778:[function(e,t,n){arguments[4][323][0].apply(n,arguments)},{"./_Symbol":1754,"./_getRawTag":1815,"./_objectToString":1847, +dup:323}],1779:[function(e,t,n){arguments[4][326][0].apply(n,arguments)},{"./_baseFindIndex":1774,"./_baseIsNaN":1781,"./_strictIndexOf":1858,dup:326}],1780:[function(e,t,n){arguments[4][327][0].apply(n,arguments)},{"./_baseGetTag":1778,"./isObjectLike":1874,dup:327}],1781:[function(e,t,n){arguments[4][331][0].apply(n,arguments)},{dup:331}],1782:[function(e,t,n){arguments[4][332][0].apply(n,arguments)},{"./_isMasked":1830,"./_toSource":1859,"./isFunction":1870,"./isObject":1873,dup:332}],1783:[function(e,t,n){arguments[4][333][0].apply(n,arguments)},{"./_baseGetTag":1778,"./isObjectLike":1874,dup:333}],1784:[function(e,t,n){arguments[4][334][0].apply(n,arguments)},{"./_baseGetTag":1778,"./isLength":1871,"./isObjectLike":1874,dup:334}],1785:[function(e,t,n){arguments[4][336][0].apply(n,arguments)},{"./_isPrototype":1831,"./_nativeKeys":1844,dup:336}],1786:[function(e,t,n){arguments[4][337][0].apply(n,arguments)},{"./_isPrototype":1831,"./_nativeKeysIn":1845,"./isObject":1873,dup:337}],1787:[function(e,t,n){arguments[4][351][0].apply(n,arguments)},{dup:351}],1788:[function(e,t,n){arguments[4][353][0].apply(n,arguments)},{dup:353}],1789:[function(e,t,n){arguments[4][354][0].apply(n,arguments)},{"./_SetCache":1752,"./_arrayIncludes":1761,"./_arrayIncludesWith":1762,"./_cacheHas":1790,"./_createSet":1807,"./_setToArray":1852,dup:354}],1790:[function(e,t,n){arguments[4][356][0].apply(n,arguments)},{dup:356}],1791:[function(e,t,n){arguments[4][357][0].apply(n,arguments)},{"./identity":1865,dup:357}],1792:[function(e,t,n){arguments[4][361][0].apply(n,arguments)},{"./_Uint8Array":1755,dup:361}],1793:[function(e,t,n){arguments[4][362][0].apply(n,arguments)},{"./_root":1849,dup:362}],1794:[function(e,t,n){arguments[4][363][0].apply(n,arguments)},{"./_cloneArrayBuffer":1792,dup:363}],1795:[function(e,t,n){arguments[4][364][0].apply(n,arguments)},{"./_addMapEntry":1757,"./_arrayReduce":1765,"./_mapToArray":1842,dup:364}],1796:[function(e,t,n){arguments[4][365][0].apply(n,arguments)},{dup:365}],1797:[function(e,t,n){arguments[4][366][0].apply(n,arguments)},{"./_addSetEntry":1758,"./_arrayReduce":1765,"./_setToArray":1852,dup:366}],1798:[function(e,t,n){arguments[4][367][0].apply(n,arguments)},{"./_Symbol":1754,dup:367}],1799:[function(e,t,n){arguments[4][368][0].apply(n,arguments)},{"./_cloneArrayBuffer":1792,dup:368}],1800:[function(e,t,n){arguments[4][371][0].apply(n,arguments)},{dup:371}],1801:[function(e,t,n){arguments[4][372][0].apply(n,arguments)},{"./_assignValue":1766,"./_baseAssignValue":1770,dup:372}],1802:[function(e,t,n){arguments[4][373][0].apply(n,arguments)},{"./_copyObject":1801,"./_getSymbols":1816,dup:373}],1803:[function(e,t,n){arguments[4][374][0].apply(n,arguments)},{"./_copyObject":1801,"./_getSymbolsIn":1817,dup:374}],1804:[function(e,t,n){arguments[4][375][0].apply(n,arguments)},{"./_root":1849,dup:375}],1805:[function(e,t,n){arguments[4][377][0].apply(n,arguments)},{"./isArrayLike":1868,dup:377}],1806:[function(e,t,n){arguments[4][378][0].apply(n,arguments)},{dup:378}],1807:[function(e,t,n){arguments[4][380][0].apply(n,arguments)},{"./_Set":1751,"./_setToArray":1852,"./noop":1881,dup:380}],1808:[function(e,t,n){arguments[4][382][0].apply(n,arguments)},{"./_getNative":1813,dup:382}],1809:[function(e,t,n){arguments[4][386][0].apply(n,arguments)},{dup:386}],1810:[function(e,t,n){arguments[4][387][0].apply(n,arguments)},{"./_baseGetAllKeys":1777,"./_getSymbols":1816,"./keys":1879,dup:387}],1811:[function(e,t,n){arguments[4][388][0].apply(n,arguments)},{"./_baseGetAllKeys":1777,"./_getSymbolsIn":1817,"./keysIn":1880,dup:388}],1812:[function(e,t,n){arguments[4][389][0].apply(n,arguments)},{"./_isKeyable":1829,dup:389}],1813:[function(e,t,n){arguments[4][391][0].apply(n,arguments)},{"./_baseIsNative":1782,"./_getValue":1819,dup:391}],1814:[function(e,t,n){arguments[4][392][0].apply(n,arguments)},{"./_overArg":1848,dup:392}],1815:[function(e,t,n){arguments[4][393][0].apply(n,arguments)},{"./_Symbol":1754,dup:393}],1816:[function(e,t,n){arguments[4][394][0].apply(n,arguments)},{"./_arrayFilter":1760,"./stubArray":1882,dup:394}],1817:[function(e,t,n){arguments[4][395][0].apply(n,arguments)},{"./_arrayPush":1764,"./_getPrototype":1814,"./_getSymbols":1816,"./stubArray":1882,dup:395}],1818:[function(e,t,n){arguments[4][396][0].apply(n,arguments)},{"./_DataView":1745,"./_Map":1748,"./_Promise":1750,"./_Set":1751,"./_WeakMap":1756,"./_baseGetTag":1778,"./_toSource":1859,dup:396}],1819:[function(e,t,n){arguments[4][397][0].apply(n,arguments)},{dup:397}],1820:[function(e,t,n){arguments[4][400][0].apply(n,arguments)},{"./_nativeCreate":1843,dup:400}],1821:[function(e,t,n){arguments[4][401][0].apply(n,arguments)},{dup:401}],1822:[function(e,t,n){arguments[4][402][0].apply(n,arguments)},{"./_nativeCreate":1843,dup:402}],1823:[function(e,t,n){arguments[4][403][0].apply(n,arguments)},{"./_nativeCreate":1843,dup:403}],1824:[function(e,t,n){arguments[4][404][0].apply(n,arguments)},{"./_nativeCreate":1843,dup:404}],1825:[function(e,t,n){arguments[4][405][0].apply(n,arguments)},{dup:405}],1826:[function(e,t,n){arguments[4][406][0].apply(n,arguments)},{"./_cloneArrayBuffer":1792,"./_cloneDataView":1794,"./_cloneMap":1795,"./_cloneRegExp":1796,"./_cloneSet":1797,"./_cloneSymbol":1798,"./_cloneTypedArray":1799,dup:406}],1827:[function(e,t,n){arguments[4][407][0].apply(n,arguments)},{"./_baseCreate":1772,"./_getPrototype":1814,"./_isPrototype":1831,dup:407}],1828:[function(e,t,n){arguments[4][409][0].apply(n,arguments)},{dup:409}],1829:[function(e,t,n){arguments[4][412][0].apply(n,arguments)},{dup:412}],1830:[function(e,t,n){arguments[4][413][0].apply(n,arguments)},{"./_coreJsData":1804,dup:413}],1831:[function(e,t,n){arguments[4][414][0].apply(n,arguments)},{dup:414}],1832:[function(e,t,n){arguments[4][416][0].apply(n,arguments)},{dup:416}],1833:[function(e,t,n){arguments[4][417][0].apply(n,arguments)},{"./_assocIndexOf":1767,dup:417}],1834:[function(e,t,n){arguments[4][418][0].apply(n,arguments)},{"./_assocIndexOf":1767,dup:418}],1835:[function(e,t,n){arguments[4][419][0].apply(n,arguments)},{"./_assocIndexOf":1767,dup:419}],1836:[function(e,t,n){arguments[4][420][0].apply(n,arguments)},{"./_assocIndexOf":1767,dup:420}],1837:[function(e,t,n){arguments[4][421][0].apply(n,arguments)},{"./_Hash":1746,"./_ListCache":1747,"./_Map":1748,dup:421}],1838:[function(e,t,n){arguments[4][422][0].apply(n,arguments)},{"./_getMapData":1812,dup:422}],1839:[function(e,t,n){arguments[4][423][0].apply(n,arguments)},{"./_getMapData":1812,dup:423}],1840:[function(e,t,n){arguments[4][424][0].apply(n,arguments)},{"./_getMapData":1812,dup:424}],1841:[function(e,t,n){arguments[4][425][0].apply(n,arguments)},{"./_getMapData":1812,dup:425}],1842:[function(e,t,n){arguments[4][426][0].apply(n,arguments)},{dup:426}],1843:[function(e,t,n){arguments[4][429][0].apply(n,arguments)},{"./_getNative":1813,dup:429}],1844:[function(e,t,n){arguments[4][430][0].apply(n,arguments)},{"./_overArg":1848,dup:430}],1845:[function(e,t,n){arguments[4][431][0].apply(n,arguments)},{dup:431}],1846:[function(e,t,n){arguments[4][432][0].apply(n,arguments)},{"./_freeGlobal":1809,dup:432}],1847:[function(e,t,n){arguments[4][433][0].apply(n,arguments)},{dup:433}],1848:[function(e,t,n){arguments[4][434][0].apply(n,arguments)},{dup:434}],1849:[function(e,t,n){arguments[4][436][0].apply(n,arguments)},{"./_freeGlobal":1809,dup:436}],1850:[function(e,t,n){arguments[4][437][0].apply(n,arguments)},{dup:437}],1851:[function(e,t,n){arguments[4][438][0].apply(n,arguments)},{dup:438}],1852:[function(e,t,n){arguments[4][439][0].apply(n,arguments)},{dup:439}],1853:[function(e,t,n){arguments[4][442][0].apply(n,arguments)},{"./_ListCache":1747,dup:442}],1854:[function(e,t,n){arguments[4][443][0].apply(n,arguments)},{dup:443}],1855:[function(e,t,n){arguments[4][444][0].apply(n,arguments)},{dup:444}],1856:[function(e,t,n){arguments[4][445][0].apply(n,arguments)},{dup:445}],1857:[function(e,t,n){arguments[4][446][0].apply(n,arguments)},{"./_ListCache":1747,"./_Map":1748,"./_MapCache":1749,dup:446}],1858:[function(e,t,n){arguments[4][447][0].apply(n,arguments)},{dup:447}],1859:[function(e,t,n){arguments[4][451][0].apply(n,arguments)},{dup:451}],1860:[function(e,t,n){arguments[4][455][0].apply(n,arguments)},{"./_baseClone":1771,dup:455}],1861:[function(e,t,n){arguments[4][458][0].apply(n,arguments)},{dup:458}],1862:[function(e,t,n){arguments[4][461][0].apply(n,arguments)},{"./forEach":1864,dup:461}],1863:[function(e,t,n){arguments[4][462][0].apply(n,arguments)},{dup:462}],1864:[function(e,t,n){arguments[4][468][0].apply(n,arguments)},{"./_arrayEach":1759,"./_baseEach":1773,"./_castFunction":1791,"./isArray":1867,dup:468}],1865:[function(e,t,n){arguments[4][472][0].apply(n,arguments)},{dup:472}],1866:[function(e,t,n){arguments[4][474][0].apply(n,arguments)},{"./_baseIsArguments":1780,"./isObjectLike":1874,dup:474}],1867:[function(e,t,n){arguments[4][475][0].apply(n,arguments)},{dup:475}],1868:[function(e,t,n){arguments[4][476][0].apply(n,arguments)},{"./isFunction":1870,"./isLength":1871,dup:476}],1869:[function(e,t,n){arguments[4][479][0].apply(n,arguments)},{"./_root":1849,"./stubFalse":1883,dup:479}],1870:[function(e,t,n){arguments[4][480][0].apply(n,arguments)},{"./_baseGetTag":1778,"./isObject":1873,dup:480}],1871:[function(e,t,n){arguments[4][482][0].apply(n,arguments)},{dup:482}],1872:[function(e,t,n){arguments[4][483][0].apply(n,arguments)},{"./_baseGetTag":1778,"./isObjectLike":1874,dup:483}],1873:[function(e,t,n){arguments[4][484][0].apply(n,arguments)},{dup:484}],1874:[function(e,t,n){arguments[4][485][0].apply(n,arguments)},{dup:485}],1875:[function(e,t,n){arguments[4][486][0].apply(n,arguments)},{"./_baseGetTag":1778,"./_getPrototype":1814,"./isObjectLike":1874,dup:486}],1876:[function(e,t,n){arguments[4][487][0].apply(n,arguments)},{"./_baseIsRegExp":1783,"./_baseUnary":1788,"./_nodeUtil":1846,dup:487}],1877:[function(e,t,n){arguments[4][488][0].apply(n,arguments)},{"./_baseGetTag":1778,"./isArray":1867,"./isObjectLike":1874,dup:488}],1878:[function(e,t,n){arguments[4][490][0].apply(n,arguments)},{"./_baseIsTypedArray":1784,"./_baseUnary":1788,"./_nodeUtil":1846,dup:490}],1879:[function(e,t,n){arguments[4][491][0].apply(n,arguments)},{"./_arrayLikeKeys":1763,"./_baseKeys":1785,"./isArrayLike":1868,dup:491}],1880:[function(e,t,n){arguments[4][492][0].apply(n,arguments)},{"./_arrayLikeKeys":1763,"./_baseKeysIn":1786,"./isArrayLike":1868,dup:492}],1881:[function(e,t,n){arguments[4][496][0].apply(n,arguments)},{dup:496}],1882:[function(e,t,n){arguments[4][501][0].apply(n,arguments)},{dup:501}],1883:[function(e,t,n){arguments[4][502][0].apply(n,arguments)},{dup:502}],1884:[function(e,t,n){arguments[4][509][0].apply(n,arguments)},{"./_baseUniq":1789,dup:509}],1885:[function(e,t,n){arguments[4][273][0].apply(n,arguments)},{dup:273}],1886:[function(e,t,n){arguments[4][560][0].apply(n,arguments)},{dup:560}],1887:[function(e,t,n){(function(t){n.path=e("path").join(t,"runtime.js")}).call(this,"/node_modules/regenerator/node_modules/regenerator-runtime")},{path:12}],1888:[function(e,t,n){(function(n){var r="object"==typeof n?n:"object"==typeof window?window:"object"==typeof self?self:this,i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,a=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=e("./runtime"),i)r.regeneratorRuntime=a;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./runtime":1889}],1889:[function(e,t,n){(function(e,n){!function(n){"use strict";function r(e,t,n,r){var i=t&&t.prototype instanceof a?t:a,s=Object.create(i.prototype),o=new h(r||[]);return s._invoke=c(e,n,o),s}function i(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function a(){}function s(){}function o(){}function u(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(t){function n(e,r,a,s){var o=i(t[e],t,r);if("throw"!==o.type){var u=o.arg,l=u.value;return l&&"object"==typeof l&&g.call(l,"__await")?Promise.resolve(l.__await).then(function(e){n("next",e,a,s)},function(e){n("throw",e,a,s)}):Promise.resolve(l).then(function(e){u.value=e,a(u)},s)}s(o.arg)}function r(e,t){function r(){return new Promise(function(r,i){n(e,t,r,i)})}return a=a?a.then(r,r):r()}"object"==typeof e&&e.domain&&(n=e.domain.bind(n));var a;this._invoke=r}function c(e,t,n){var r=D;return function(a,s){if(r===S)throw new Error("Generator is already running");if(r===w){if("throw"===a)throw s;return y()}for(;;){var o=n.delegate;if(o){if("return"===a||"throw"===a&&o.iterator[a]===m){n.delegate=null;var u=o.iterator.return;if(u){var l=i(u,o.iterator,s);if("throw"===l.type){a="throw",s=l.arg;continue}}if("return"===a)continue}var l=i(o.iterator[a],o.iterator,s);if("throw"===l.type){n.delegate=null,a="throw",s=l.arg;continue}a="next",s=m;var c=l.arg;if(!c.done)return r=C,c;n[o.resultName]=c.value,n.next=o.nextLoc,n.delegate=null}if("next"===a)n.sent=n._sent=s;else if("throw"===a){if(r===D)throw r=w,s;n.dispatchException(s)&&(a="next",s=m)}else"return"===a&&n.abrupt("return",s);r=S;var l=i(e,t,n);if("normal"===l.type){r=n.done?w:C;var c={value:l.arg,done:n.done};if(l.arg!==k)return c;n.delegate&&"next"===a&&(s=m)}else"throw"===l.type&&(r=w,a="throw",s=l.arg)}}}function p(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function h(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(p,this),this.reset(!0)}function d(e){if(e){var t=e[x];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var s=g.call(i,"catchLoc"),o=g.call(i,"finallyLoc");if(s&&o){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),k}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;f(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},k}}}("object"==typeof n?n:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:13}],1890:[function(e,t,n){(function(r){function i(e,t,n){function i(){for(;l.length&&!p.paused;){var e=l.shift();if(null===e)return p.emit("end");p.emit("data",e)}}function s(){p.writable=!1,t.call(p),!p.readable&&p.autoDestroy&&p.destroy()}e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var o=!1,u=!1,l=[],c=!1,p=new a;return p.readable=p.writable=!0,p.paused=!1,p.autoDestroy=!(n&&n.autoDestroy===!1),p.write=function(t){return e.call(this,t),!p.paused},p.queue=p.push=function(e){return c?p:(null===e&&(c=!0),l.push(e),i(),p)},p.on("end",function(){p.readable=!1,!p.writable&&p.autoDestroy&&r.nextTick(function(){p.destroy()})}),p.end=function(e){if(!o)return o=!0,arguments.length&&p.write(e),s(),p},p.destroy=function(){if(!u)return u=!0,o=!0,l.length=0,p.writable=p.readable=!1,p.emit("close"),p},p.pause=function(){if(!p.paused)return p.paused=!0,p},p.resume=function(){return p.paused&&(p.paused=!1,p.emit("resume")),i(),p.paused||p.emit("drain"),p},p}var a=e("stream");n=t.exports=i,i.through=i}).call(this,e("_process"))},{_process:13,stream:30}],regenerator:[function(e,t,n){function n(e,t){function n(e){i.push(e)}function r(){try{this.queue(a(i.join(""),t).code),this.queue(null)}catch(e){this.emit("error",e)}}var i=[];return o(n,r)}function r(){regeneratorRuntime=e("regenerator-runtime")}function i(){return p||(p=s.readFileSync(r.path,"utf8"))}function a(t,n){var r;return n=l.defaults(n||{},{includeRuntime:!1}),r=c.test(t)?e("babel-core").transform(t,f):{code:t},n.includeRuntime===!0&&(r.code=i()+"\n"+r.code),r}var s=e("fs"),o=e("through"),u=e("./lib/visit").transform,l=e("./lib/util"),c=/\bfunction\s*\*|\basync\b/;t.exports=n,n.runtime=r,r.path=e("regenerator-runtime/path.js").path;var p,f={presets:[e("regenerator-preset")],parserOpts:{sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,strictMode:!1,plugins:["*","jsx","flow"]}};n.types=e("recast").types,n.compile=a,n.transform=u},{"./lib/util":36,"./lib/visit":37,"babel-core":38,fs:1,recast:539,"regenerator-preset":572,"regenerator-runtime":1888,"regenerator-runtime/path.js":1887,through:1890}]},{},[]); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.d.ts b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.d.ts new file mode 100644 index 0000000000..5471b37b14 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.d.ts @@ -0,0 +1,282 @@ +declare var ajv: { + (options?: ajv.Options): ajv.Ajv; + new (options?: ajv.Options): ajv.Ajv; +} + +declare namespace ajv { + interface Ajv { + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize. + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + validate(schemaKeyRef: Object | string, data: any): boolean; + /** + * Create validating function for passed schema. + * @param {Object} schema schema object + * @return {Function} validating function + */ + compile(schema: Object): ValidateFunction; + /** + * Creates validating function for passed schema with asynchronous loading of missing schemas. + * `loadSchema` option should be a function that accepts schema uri and node-style callback. + * @this Ajv + * @param {Object} schema schema object + * @param {Function} callback node-style callback, it is always called with 2 parameters: error (or null) and validating function. + */ + compileAsync(schema: Object, callback: (err: Error, validate: ValidateFunction) => any): void; + /** + * Adds schema to the instance. + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + */ + addSchema(schema: Array | Object, key?: string): void; + /** + * Add schema that will be used to validate other schemas + * options in META_IGNORE_OPTIONS are alway set to false + * @param {Object} schema schema object + * @param {String} key optional schema key + */ + addMetaSchema(schema: Object, key?: string): void; + /** + * Validate schema + * @param {Object} schema schema to validate + * @return {Boolean} true if schema is valid + */ + validateSchema(schema: Object): boolean; + /** + * Get compiled schema from the instance by `key` or `ref`. + * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). + * @return {Function} schema validating function (with property `schema`). + */ + getSchema(keyRef: string): ValidateFunction; + /** + * Remove cached schema(s). + * If no parameter is passed all schemas but meta-schemas are removed. + * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. + * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. + * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object + */ + removeSchema(schemaKeyRef?: Object | string | RegExp): void; + /** + * Add custom format + * @param {String} name format name + * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid) + */ + addFormat(name: string, format: FormatValidator | FormatDefinition): void; + /** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords. + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + */ + addKeyword(keyword: string, definition: KeywordDefinition): void; + /** + * Get keyword definition + * @this Ajv + * @param {String} keyword pre-defined or custom keyword. + * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. + */ + getKeyword(keyword: string): Object | boolean; + /** + * Remove keyword + * @this Ajv + * @param {String} keyword pre-defined or custom keyword. + */ + removeKeyword(keyword: string): void; + /** + * Convert array of error message objects to string + * @param {Array} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ + errorsText(errors?: Array, options?: ErrorsTextOptions): string; + errors?: Array; + } + + interface Thenable { + then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; + } + + interface ValidateFunction { + ( + data: any, + dataPath?: string, + parentData?: Object | Array, + parentDataProperty?: string | number, + rootData?: Object | Array + ): boolean | Thenable; + errors?: Array; + schema?: Object; + } + + interface Options { + v5?: boolean; + allErrors?: boolean; + verbose?: boolean; + jsonPointers?: boolean; + uniqueItems?: boolean; + unicode?: boolean; + format?: string; + formats?: Object; + unknownFormats?: boolean | string | Array; + schemas?: Array | Object; + ownProperties?: boolean; + missingRefs?: boolean | string; + loadSchema?: (uri: string, cb: (err: Error, schema: Object) => any) => any; + removeAdditional?: boolean | string; + useDefaults?: boolean | string; + coerceTypes?: boolean | string; + async?: boolean | string; + transpile?: string | ((code: string) => string); + meta?: boolean | Object; + validateSchema?: boolean | string; + addUsedSchema?: boolean; + inlineRefs?: boolean | number; + passContext?: boolean; + loopRequired?: number; + multipleOfPrecision?: number; + errorDataPath?: string; + messages?: boolean; + beautify?: boolean | Object; + cache?: Object; + } + + type FormatValidator = string | RegExp | ((data: string) => boolean); + + interface FormatDefinition { + validate: FormatValidator; + compare: (data1: string, data2: string) => number; + async?: boolean; + } + + interface KeywordDefinition { + type?: string | Array; + async?: boolean; + errors?: boolean | string; + // schema: false makes validate not to expect schema (ValidateFunction) + schema?: boolean; + modifying?: boolean; + valid?: boolean; + // one and only one of the following properties should be present + validate?: ValidateFunction | SchemaValidateFunction; + compile?: (schema: Object, parentSchema: Object) => ValidateFunction; + macro?: (schema: Object, parentSchema: Object) => Object; + inline?: (it: Object, keyword: string, schema: Object, parentSchema: Object) => string; + } + + interface SchemaValidateFunction { + ( + schema: Object, + data: any, + parentSchema?: Object, + dataPath?: string, + parentData?: Object | Array, + parentDataProperty?: string | number + ): boolean | Thenable; + errors?: Array; + } + + interface ErrorsTextOptions { + separator?: string; + dataVar?: string; + } + + interface ErrorObject { + keyword: string; + dataPath: string; + schemaPath: string; + params: ErrorParameters; + // Excluded if messages set to false. + message?: string; + // These are added with the `verbose` option. + schema?: Object; + parentSchema?: Object; + data?: any; + } + + type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams | + DependenciesParams | FormatParams | ComparisonParams | + MultipleOfParams | PatternParams | RequiredParams | + TypeParams | UniqueItemsParams | CustomParams | + PatternGroupsParams | PatternRequiredParams | + SwitchParams | NoParams | EnumParams; + + interface RefParams { + ref: string; + } + + interface LimitParams { + limit: number; + } + + interface AdditionalPropertiesParams { + additionalProperty: string; + } + + interface DependenciesParams { + property: string; + missingProperty: string; + depsCount: number; + deps: string; + } + + interface FormatParams { + format: string + } + + interface ComparisonParams { + comparison: string; + limit: number | string; + exclusive: boolean; + } + + interface MultipleOfParams { + multipleOf: number; + } + + interface PatternParams { + pattern: string; + } + + interface RequiredParams { + missingProperty: string; + } + + interface TypeParams { + type: string; + } + + interface UniqueItemsParams { + i: number; + j: number; + } + + interface CustomParams { + keyword: string; + } + + interface PatternGroupsParams { + reason: string; + limit: number; + pattern: string; + } + + interface PatternRequiredParams { + missingPattern: string; + } + + interface SwitchParams { + caseIndex: number; + } + + interface NoParams {} + + interface EnumParams { + allowedValues: Array; + } +} + +export = ajv; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.js new file mode 100644 index 0000000000..0502c1fd36 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/ajv.js @@ -0,0 +1,420 @@ +'use strict'; + +var compileSchema = require('./compile') + , resolve = require('./compile/resolve') + , Cache = require('./cache') + , SchemaObject = require('./compile/schema_obj') + , stableStringify = require('json-stable-stringify') + , formats = require('./compile/formats') + , rules = require('./compile/rules') + , v5 = require('./v5') + , util = require('./compile/util') + , async = require('./async') + , co = require('co'); + +module.exports = Ajv; + +Ajv.prototype.compileAsync = async.compile; + +var customKeyword = require('./keyword'); +Ajv.prototype.addKeyword = customKeyword.add; +Ajv.prototype.getKeyword = customKeyword.get; +Ajv.prototype.removeKeyword = customKeyword.remove; +Ajv.ValidationError = require('./compile/validation_error'); + +var META_SCHEMA_ID = 'http://json-schema.org/draft-04/schema'; +var SCHEMA_URI_FORMAT = /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i; +function SCHEMA_URI_FORMAT_FUNC(str) { + return SCHEMA_URI_FORMAT.test(str); +} + +var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; + +/** + * Creates validator instance. + * Usage: `Ajv(opts)` + * @param {Object} opts optional options + * @return {Object} ajv instance + */ +function Ajv(opts) { + if (!(this instanceof Ajv)) return new Ajv(opts); + var self = this; + + opts = this._opts = util.copy(opts) || {}; + this._schemas = {}; + this._refs = {}; + this._fragments = {}; + this._formats = formats(opts.format); + this._cache = opts.cache || new Cache; + this._loadingSchemas = {}; + this._compilations = []; + this.RULES = rules(); + + // this is done on purpose, so that methods are bound to the instance + // (without using bind) so that they can be used without the instance + this.validate = validate; + this.compile = compile; + this.addSchema = addSchema; + this.addMetaSchema = addMetaSchema; + this.validateSchema = validateSchema; + this.getSchema = getSchema; + this.removeSchema = removeSchema; + this.addFormat = addFormat; + this.errorsText = errorsText; + + this._addSchema = _addSchema; + this._compile = _compile; + + opts.loopRequired = opts.loopRequired || Infinity; + if (opts.async || opts.transpile) async.setup(opts); + if (opts.beautify === true) opts.beautify = { indent_size: 2 }; + if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; + this._metaOpts = getMetaSchemaOptions(); + + if (opts.formats) addInitialFormats(); + addDraft4MetaSchema(); + if (opts.v5) v5.enable(this); + if (typeof opts.meta == 'object') addMetaSchema(opts.meta); + addInitialSchemas(); + + + /** + * Validate data using schema + * Schema will be compiled and cached (using serialized JSON as key. [json-stable-stringify](https://github.com/substack/json-stable-stringify) is used to serialize. + * @param {String|Object} schemaKeyRef key, ref or schema object + * @param {Any} data to be validated + * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). + */ + function validate(schemaKeyRef, data) { + var v; + if (typeof schemaKeyRef == 'string') { + v = getSchema(schemaKeyRef); + if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); + } else { + var schemaObj = _addSchema(schemaKeyRef); + v = schemaObj.validate || _compile(schemaObj); + } + + var valid = v(data); + if (v.$async === true) + return self._opts.async == '*' ? co(valid) : valid; + self.errors = v.errors; + return valid; + } + + + /** + * Create validating function for passed schema. + * @param {Object} schema schema object + * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. + * @return {Function} validating function + */ + function compile(schema, _meta) { + var schemaObj = _addSchema(schema, undefined, _meta); + return schemaObj.validate || _compile(schemaObj); + } + + + /** + * Adds schema to the instance. + * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. + * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. + * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. + * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. + */ + function addSchema(schema, key, _skipValidation, _meta) { + if (Array.isArray(schema)){ + for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used. + * @param {Object} options optional options with properties `separator` and `dataVar`. + * @return {String} human readable string with all errors descriptions + */ + function errorsText(errors, options) { + errors = errors || self.errors; + if (!errors) return 'No errors'; + options = options || {}; + var separator = options.separator === undefined ? ', ' : options.separator; + var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; + + var text = ''; + for (var i=0; i= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; +} + + +function time(str, full) { + var matches = str.match(TIME); + if (!matches) return false; + + var hour = matches[1]; + var minute = matches[2]; + var second = matches[3]; + var timeZone = matches[5]; + return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); +} + + +var DATE_TIME_SEPARATOR = /t|\s/i; +function date_time(str) { + // http://tools.ietf.org/html/rfc3339#section-5.6 + var dateTime = str.split(DATE_TIME_SEPARATOR); + return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); +} + + +function hostname(str) { + // https://tools.ietf.org/html/rfc1034#section-3.5 + // https://tools.ietf.org/html/rfc1123#section-2 + return str.length <= 255 && HOSTNAME.test(str); +} + + +var NOT_URI_FRAGMENT = /\/|\:/; +function uri(str) { + // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." + return NOT_URI_FRAGMENT.test(str) && URI.test(str); +} + + +function regex(str) { + try { + new RegExp(str); + return true; + } catch(e) { + return false; + } +} + + +function compareDate(d1, d2) { + if (!(d1 && d2)) return; + if (d1 > d2) return 1; + if (d1 < d2) return -1; + if (d1 === d2) return 0; +} + + +function compareTime(t1, t2) { + if (!(t1 && t2)) return; + t1 = t1.match(TIME); + t2 = t2.match(TIME); + if (!(t1 && t2)) return; + t1 = t1[1] + t1[2] + t1[3] + (t1[4]||''); + t2 = t2[1] + t2[2] + t2[3] + (t2[4]||''); + if (t1 > t2) return 1; + if (t1 < t2) return -1; + if (t1 === t2) return 0; +} + + +function compareDateTime(dt1, dt2) { + if (!(dt1 && dt2)) return; + dt1 = dt1.split(DATE_TIME_SEPARATOR); + dt2 = dt2.split(DATE_TIME_SEPARATOR); + var res = compareDate(dt1[0], dt2[0]); + if (res === undefined) return; + return res || compareTime(dt1[1], dt2[1]); +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/index.js new file mode 100644 index 0000000000..c9c6730f8a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/index.js @@ -0,0 +1,390 @@ +'use strict'; + +var resolve = require('./resolve') + , util = require('./util') + , stableStringify = require('json-stable-stringify') + , async = require('../async'); + +var beautify; + +function loadBeautify(){ + if (beautify === undefined) { + var name = 'js-beautify'; + try { beautify = require(name).js_beautify; } + catch(e) { beautify = false; } + } +} + +var validateGenerator = require('../dotjs/validate'); + +/** + * Functions below are used inside compiled validations function + */ + +var co = require('co'); +var ucs2length = util.ucs2length; +var equal = require('./equal'); + +// this error is thrown by async schemas to return validation errors via exception +var ValidationError = require('./validation_error'); + +module.exports = compile; + + +/** + * Compiles schema to validation function + * @this Ajv + * @param {Object} schema schema object + * @param {Object} root object with information about the root schema for this schema + * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution + * @param {String} baseId base ID for IDs in the schema + * @return {Function} validation function + */ +function compile(schema, root, localRefs, baseId) { + /* jshint validthis: true, evil: true */ + /* eslint no-shadow: 0 */ + var self = this + , opts = this._opts + , refVal = [ undefined ] + , refs = {} + , patterns = [] + , patternsHash = {} + , defaults = [] + , defaultsHash = {} + , customRules = [] + , keepSourceCode = opts.sourceCode !== false; + + root = root || { schema: schema, refVal: refVal, refs: refs }; + + var c = checkCompiling.call(this, schema, root, baseId); + var compilation = this._compilations[c.index]; + if (c.compiling) return (compilation.callValidate = callValidate); + + var formats = this._formats; + var RULES = this.RULES; + + try { + var v = localCompile(schema, root, localRefs, baseId); + compilation.validate = v; + var cv = compilation.callValidate; + if (cv) { + cv.schema = v.schema; + cv.errors = null; + cv.refs = v.refs; + cv.refVal = v.refVal; + cv.root = v.root; + cv.$async = v.$async; + if (keepSourceCode) cv.sourceCode = v.sourceCode; + } + return v; + } finally { + endCompiling.call(this, schema, root, baseId); + } + + function callValidate() { + var validate = compilation.validate; + var result = validate.apply(null, arguments); + callValidate.errors = validate.errors; + return result; + } + + function localCompile(_schema, _root, localRefs, baseId) { + var isRoot = !_root || (_root && _root.schema == _schema); + if (_root.schema != root.schema) + return compile.call(self, _schema, _root, localRefs, baseId); + + var $async = _schema.$async === true; + if ($async && !opts.transpile) async.setup(opts); + + var sourceCode = validateGenerator({ + isTop: true, + schema: _schema, + isRoot: isRoot, + baseId: baseId, + root: _root, + schemaPath: '', + errSchemaPath: '#', + errorPath: '""', + RULES: RULES, + validate: validateGenerator, + util: util, + resolve: resolve, + resolveRef: resolveRef, + usePattern: usePattern, + useDefault: useDefault, + useCustomRule: useCustomRule, + opts: opts, + formats: formats, + self: self + }); + + sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) + + vars(defaults, defaultCode) + vars(customRules, customRuleCode) + + sourceCode; + + if (opts.beautify) { + loadBeautify(); + /* istanbul ignore else */ + if (beautify) sourceCode = beautify(sourceCode, opts.beautify); + else console.error('"npm install js-beautify" to use beautify option'); + } + // console.log('\n\n\n *** \n', sourceCode); + var validate, validateCode + , transpile = opts._transpileFunc; + try { + validateCode = $async && transpile + ? transpile(sourceCode) + : sourceCode; + + var makeValidate = new Function( + 'self', + 'RULES', + 'formats', + 'root', + 'refVal', + 'defaults', + 'customRules', + 'co', + 'equal', + 'ucs2length', + 'ValidationError', + validateCode + ); + + validate = makeValidate( + self, + RULES, + formats, + root, + refVal, + defaults, + customRules, + co, + equal, + ucs2length, + ValidationError + ); + + refVal[0] = validate; + } catch(e) { + console.error('Error compiling schema, function code:', validateCode); + throw e; + } + + validate.schema = _schema; + validate.errors = null; + validate.refs = refs; + validate.refVal = refVal; + validate.root = isRoot ? validate : _root; + if ($async) validate.$async = true; + if (keepSourceCode) validate.sourceCode = sourceCode; + if (opts.sourceCode === true) { + validate.source = { + patterns: patterns, + defaults: defaults + }; + } + + return validate; + } + + function resolveRef(baseId, ref, isRoot) { + ref = resolve.url(baseId, ref); + var refIndex = refs[ref]; + var _refVal, refCode; + if (refIndex !== undefined) { + _refVal = refVal[refIndex]; + refCode = 'refVal[' + refIndex + ']'; + return resolvedRef(_refVal, refCode); + } + if (!isRoot && root.refs) { + var rootRefId = root.refs[ref]; + if (rootRefId !== undefined) { + _refVal = root.refVal[rootRefId]; + refCode = addLocalRef(ref, _refVal); + return resolvedRef(_refVal, refCode); + } + } + + refCode = addLocalRef(ref); + var v = resolve.call(self, localCompile, root, ref); + if (!v) { + var localSchema = localRefs && localRefs[ref]; + if (localSchema) { + v = resolve.inlineRef(localSchema, opts.inlineRefs) + ? localSchema + : compile.call(self, localSchema, root, localRefs, baseId); + } + } + + if (v) { + replaceLocalRef(ref, v); + return resolvedRef(v, refCode); + } + } + + function addLocalRef(ref, v) { + var refId = refVal.length; + refVal[refId] = v; + refs[ref] = refId; + return 'refVal' + refId; + } + + function replaceLocalRef(ref, v) { + var refId = refs[ref]; + refVal[refId] = v; + } + + function resolvedRef(refVal, code) { + return typeof refVal == 'object' + ? { code: code, schema: refVal, inline: true } + : { code: code, $async: refVal && refVal.$async }; + } + + function usePattern(regexStr) { + var index = patternsHash[regexStr]; + if (index === undefined) { + index = patternsHash[regexStr] = patterns.length; + patterns[index] = regexStr; + } + return 'pattern' + index; + } + + function useDefault(value) { + switch (typeof value) { + case 'boolean': + case 'number': + return '' + value; + case 'string': + return util.toQuotedString(value); + case 'object': + if (value === null) return 'null'; + var valueStr = stableStringify(value); + var index = defaultsHash[valueStr]; + if (index === undefined) { + index = defaultsHash[valueStr] = defaults.length; + defaults[index] = value; + } + return 'default' + index; + } + } + + function useCustomRule(rule, schema, parentSchema, it) { + var validateSchema = rule.definition.validateSchema; + if (validateSchema && self._opts.validateSchema !== false) { + var valid = validateSchema(schema); + if (!valid) { + var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); + if (self._opts.validateSchema == 'log') console.error(message); + else throw new Error(message); + } + } + + var compile = rule.definition.compile + , inline = rule.definition.inline + , macro = rule.definition.macro; + + var validate; + if (compile) { + validate = compile.call(self, schema, parentSchema, it); + } else if (macro) { + validate = macro.call(self, schema, parentSchema, it); + if (opts.validateSchema !== false) self.validateSchema(validate, true); + } else if (inline) { + validate = inline.call(self, it, rule.keyword, schema, parentSchema); + } else { + validate = rule.definition.validate; + } + + var index = customRules.length; + customRules[index] = validate; + + return { + code: 'customRule' + index, + validate: validate + }; + } +} + + +/** + * Checks if the schema is currently compiled + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) + */ +function checkCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var index = compIndex.call(this, schema, root, baseId); + if (index >= 0) return { index: index, compiling: true }; + index = this._compilations.length; + this._compilations[index] = { + schema: schema, + root: root, + baseId: baseId + }; + return { index: index, compiling: false }; +} + + +/** + * Removes the schema from the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + */ +function endCompiling(schema, root, baseId) { + /* jshint validthis: true */ + var i = compIndex.call(this, schema, root, baseId); + if (i >= 0) this._compilations.splice(i, 1); +} + + +/** + * Index of schema compilation in the currently compiled list + * @this Ajv + * @param {Object} schema schema to compile + * @param {Object} root root object + * @param {String} baseId base schema ID + * @return {Integer} compilation index + */ +function compIndex(schema, root, baseId) { + /* jshint validthis: true */ + for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { + // high surrogate, and there is a next character + value = str.charCodeAt(pos); + if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate + } + } + return length; +}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/util.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/util.js new file mode 100644 index 0000000000..8451f83ae2 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/compile/util.js @@ -0,0 +1,257 @@ +'use strict'; + + +module.exports = { + copy: copy, + checkDataType: checkDataType, + checkDataTypes: checkDataTypes, + coerceToTypes: coerceToTypes, + toHash: toHash, + getProperty: getProperty, + escapeQuotes: escapeQuotes, + ucs2length: require('./ucs2length'), + varOccurences: varOccurences, + varReplace: varReplace, + cleanUpCode: cleanUpCode, + cleanUpVarErrors: cleanUpVarErrors, + schemaHasRules: schemaHasRules, + schemaHasRulesExcept: schemaHasRulesExcept, + stableStringify: require('json-stable-stringify'), + toQuotedString: toQuotedString, + getPathExpr: getPathExpr, + getPath: getPath, + getData: getData, + unescapeFragment: unescapeFragment, + escapeFragment: escapeFragment, + escapeJsonPointer: escapeJsonPointer +}; + + +function copy(o, to) { + to = to || {}; + for (var key in o) to[key] = o[key]; + return to; +} + + +function checkDataType(dataType, data, negate) { + var EQUAL = negate ? ' !== ' : ' === ' + , AND = negate ? ' || ' : ' && ' + , OK = negate ? '!' : '' + , NOT = negate ? '' : '!'; + switch (dataType) { + case 'null': return data + EQUAL + 'null'; + case 'array': return OK + 'Array.isArray(' + data + ')'; + case 'object': return '(' + OK + data + AND + + 'typeof ' + data + EQUAL + '"object"' + AND + + NOT + 'Array.isArray(' + data + '))'; + case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + + NOT + '(' + data + ' % 1)' + + AND + data + EQUAL + data + ')'; + default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; + } +} + + +function checkDataTypes(dataTypes, data) { + switch (dataTypes.length) { + case 1: return checkDataType(dataTypes[0], data, true); + default: + var code = ''; + var types = toHash(dataTypes); + if (types.array && types.object) { + code = types.null ? '(': '(!' + data + ' || '; + code += 'typeof ' + data + ' !== "object")'; + delete types.null; + delete types.array; + delete types.object; + } + if (types.number) delete types.integer; + for (var t in types) + code += (code ? ' && ' : '' ) + checkDataType(t, data, true); + + return code; + } +} + + +var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); +function coerceToTypes(optionCoerceTypes, dataTypes) { + if (Array.isArray(dataTypes)) { + var types = []; + for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i' + , $notOp = $isMax ? '>' : '<'; +}} + +{{? $isDataExcl }} + {{ + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) + , $exclusive = 'exclusive' + $lvl + , $opExpr = 'op' + $lvl + , $opStr = '\' + ' + $opExpr + ' + \''; + }} + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} + + var exclusive{{=$lvl}}; + if (typeof {{=$schemaValueExcl}} != 'boolean' && typeof {{=$schemaValueExcl}} != 'undefined') { + {{ var $errorKeyword = $exclusiveKeyword; }} + {{# def.error:'_exclusiveLimit' }} + } else if({{# def.$dataNotType:'number' }} + ((exclusive{{=$lvl}} = {{=$schemaValueExcl}} === true) + ? {{=$data}} {{=$notOp}}= {{=$schemaValue}} + : {{=$data}} {{=$notOp}} {{=$schemaValue}}) + || {{=$data}} !== {{=$data}}) { + var op{{=$lvl}} = exclusive{{=$lvl}} ? '{{=$op}}' : '{{=$op}}='; +{{??}} + {{ + var $exclusive = $schemaExcl === true + , $opStr = $op; /*used in error*/ + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ + }} + + if ({{# def.$dataNotType:'number' }} + {{=$data}} {{=$notOp}}{{?$exclusive}}={{?}} {{=$schemaValue}} + || {{=$data}} !== {{=$data}}) { +{{?}} + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limit' }} + } {{? $breakOnError }} else { {{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitItems.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitItems.jst new file mode 100644 index 0000000000..a3e078e513 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitItems.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitItems' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitLength.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitLength.jst new file mode 100644 index 0000000000..cfc8dbb016 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitLength.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitLength' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitProperties.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitProperties.jst new file mode 100644 index 0000000000..da7ea776f1 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/_limitProperties.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }} +if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_limitProperties' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/allOf.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/allOf.jst new file mode 100644 index 0000000000..4c2836311b --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/allOf.jst @@ -0,0 +1,34 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $currentBaseId = $it.baseId + , $allSchemasEmpty = true; +}} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{# def.ifResultValid }} + {{?}} +{{~}} + +{{? $breakOnError }} + {{? $allSchemasEmpty }} + if (true) { + {{??}} + {{= $closingBraces.slice(0,-1) }} + {{?}} +{{?}} + +{{# def.cleanUp }} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/anyOf.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/anyOf.jst new file mode 100644 index 0000000000..93c3cd828a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/anyOf.jst @@ -0,0 +1,48 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{ + var $noEmptySchema = $schema.every(function($sch) { + return {{# def.nonEmptySchema:$sch }}; + }); +}} +{{? $noEmptySchema }} + {{ var $currentBaseId = $it.baseId; }} + var {{=$errs}} = errors; + var {{=$valid}} = false; + + {{# def.setCompositeRule }} + + {{~ $schema:$sch:$i }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + + {{=$valid}} = {{=$valid}} || {{=$nextValid}}; + + if (!{{=$valid}}) { + {{ $closingBraces += '}'; }} + {{~}} + + {{# def.resetCompositeRule }} + + {{= $closingBraces }} + + if (!{{=$valid}}) { + {{# def.addError:'anyOf' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} + + {{# def.cleanUp }} +{{??}} + {{? $breakOnError }} + if (true) { + {{?}} +{{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/coerce.def b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/coerce.def new file mode 100644 index 0000000000..86e0e18af9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/coerce.def @@ -0,0 +1,61 @@ +{{## def.coerceType: + {{ + var $dataType = 'dataType' + $lvl + , $coerced = 'coerced' + $lvl; + }} + var {{=$dataType}} = typeof {{=$data}}; + {{? it.opts.coerceTypes == 'array'}} + if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array'; + {{?}} + + var {{=$coerced}} = undefined; + + {{ var $bracesCoercion = ''; }} + {{~ $coerceToTypes:$type:$i }} + {{? $i }} + if ({{=$coerced}} === undefined) { + {{ $bracesCoercion += '}'; }} + {{?}} + + {{? it.opts.coerceTypes == 'array' && $type != 'array' }} + if ({{=$dataType}} == 'array' && {{=$data}}.length == 1) { + {{=$coerced}} = {{=$data}} = {{=$data}}[0]; + {{=$dataType}} = typeof {{=$data}}; + /*if ({{=$dataType}} == 'object' && Array.isArray({{=$data}})) {{=$dataType}} = 'array';*/ + } + {{?}} + + {{? $type == 'string' }} + if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean') + {{=$coerced}} = '' + {{=$data}}; + else if ({{=$data}} === null) {{=$coerced}} = ''; + {{?? $type == 'number' || $type == 'integer' }} + if ({{=$dataType}} == 'boolean' || {{=$data}} === null + || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}} + {{? $type == 'integer' }} && !({{=$data}} % 1){{?}})) + {{=$coerced}} = +{{=$data}}; + {{?? $type == 'boolean' }} + if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null) + {{=$coerced}} = false; + else if ({{=$data}} === 'true' || {{=$data}} === 1) + {{=$coerced}} = true; + {{?? $type == 'null' }} + if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false) + {{=$coerced}} = null; + {{?? it.opts.coerceTypes == 'array' && $type == 'array' }} + if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null) + {{=$coerced}} = [{{=$data}}]; + {{?}} + {{~}} + + {{= $bracesCoercion }} + + if ({{=$coerced}} === undefined) { + {{# def.error:'type' }} + } else { + {{# def.setParentData }} + {{=$data}} = {{=$coerced}}; + {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}} + {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}}; + } +#}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/custom.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/custom.jst new file mode 100644 index 0000000000..ed5d80a5ef --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/custom.jst @@ -0,0 +1,188 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $rule = this + , $definition = 'definition' + $lvl + , $rDef = $rule.definition + , $validate = $rDef.validate + , $compile + , $inline + , $macro + , $ruleValidate + , $validateCode; +}} + +{{? $isData && $rDef.$data }} + {{ + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + }} + var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition; + var {{=$validateCode}} = {{=$definition}}.validate; +{{??}} + {{ + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + }} +{{?}} + +{{ + var $ruleErrs = $validateCode + '.errors' + , $i = 'i' + $lvl + , $ruleErr = 'ruleErr' + $lvl + , $asyncKeyword = $rDef.async; + + if ($asyncKeyword && !it.async) + throw new Error('async keyword in sync schema'); +}} + + +{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}} +var {{=$errs}} = errors; +var {{=$valid}}; + +{{## def.callRuleValidate: + {{=$validateCode}}.call( + {{? it.opts.passContext }}this{{??}}self{{?}} + {{? $compile || $rDef.schema === false }} + , {{=$data}} + {{??}} + , {{=$schemaValue}} + , {{=$data}} + , validate.schema{{=it.schemaPath}} + {{?}} + , {{# def.dataPath }} + {{# def.passParentData }} + , rootData + ) +#}} + +{{## def.extendErrors:_inline: + for (var {{=$i}}={{=$errs}}; {{=$i}} {{=$i}}) { + {{ + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + } + + {{# def.ifResultValid }} + {{?}} + {{~}} + + {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }} + {{ + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + }} + {{=$nextValid}} = true; + + if ({{=$data}}.length > {{= $schema.length }}) { + {{# def.validateItems: $schema.length }} + } + + {{# def.ifResultValid }} + {{?}} + +{{?? {{# def.nonEmptySchema:$schema }} }} + {{ /* 'items' is a single schema */}} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + {{# def.validateItems: 0 }} + {{# def.ifResultValid }} +{{?}} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} + +{{# def.cleanUp }} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/missing.def b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/missing.def new file mode 100644 index 0000000000..23ad04cf43 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/missing.def @@ -0,0 +1,34 @@ +{{## def.checkMissingProperty:_properties: + {{~ _properties:_$property:$i }} + {{?$i}} || {{?}} + {{ var $prop = it.util.getProperty(_$property); }} + ( {{=$data}}{{=$prop}} === undefined && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop) }}) ) + {{~}} +#}} + + +{{## def.errorMissingProperty:_error: + {{ + var $propertyPath = 'missing' + $lvl + , $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers + ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) + : $currentErrorPath + ' + ' + $propertyPath; + } + }} + {{# def.error:_error }} +#}} + +{{## def.allErrorsMissingProperty:_error: + {{ + var $prop = it.util.getProperty($reqProperty) + , $missingProperty = it.util.escapeQuotes($reqProperty); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + } + }} + if ({{=$data}}{{=$prop}} === undefined) { + {{# def.addError:_error }} + } +#}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/multipleOf.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/multipleOf.jst new file mode 100644 index 0000000000..5f8dd33b5d --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/multipleOf.jst @@ -0,0 +1,20 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +var division{{=$lvl}}; +if ({{?$isData}} + {{=$schemaValue}} !== undefined && ( + typeof {{=$schemaValue}} != 'number' || + {{?}} + (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}}, + {{? it.opts.multipleOfPrecision }} + Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}} + {{??}} + division{{=$lvl}} !== parseInt(division{{=$lvl}}) + {{?}} + ) + {{?$isData}} ) {{?}} ) { + {{# def.error:'multipleOf' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/not.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/not.jst new file mode 100644 index 0000000000..e03185ae87 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/not.jst @@ -0,0 +1,43 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +{{? {{# def.nonEmptySchema:$schema }} }} + {{ + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + }} + + var {{=$errs}} = errors; + + {{# def.setCompositeRule }} + + {{ + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + }} + {{= it.validate($it) }} + {{ + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + }} + + {{# def.resetCompositeRule }} + + if ({{=$nextValid}}) { + {{# def.error:'not' }} + } else { + {{# def.resetErrors }} + {{? it.opts.allErrors }} } {{?}} +{{??}} + {{# def.addError:'not' }} + {{? $breakOnError}} + if (false) { + {{?}} +{{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/oneOf.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/oneOf.jst new file mode 100644 index 0000000000..b7f7bff079 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/oneOf.jst @@ -0,0 +1,44 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + +var {{=$errs}} = errors; +var prevValid{{=$lvl}} = false; +var {{=$valid}} = false; + +{{ var $currentBaseId = $it.baseId; }} +{{# def.setCompositeRule }} + +{{~ $schema:$sch:$i }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + }} + + {{# def.insertSubschemaCode }} + {{??}} + var {{=$nextValid}} = true; + {{?}} + + {{? $i }} + if ({{=$nextValid}} && prevValid{{=$lvl}}) + {{=$valid}} = false; + else { + {{ $closingBraces += '}'; }} + {{?}} + + if ({{=$nextValid}}) {{=$valid}} = prevValid{{=$lvl}} = true; +{{~}} + +{{# def.resetCompositeRule }} + +{{= $closingBraces }} + +if (!{{=$valid}}) { + {{# def.error:'oneOf' }} +} else { + {{# def.resetErrors }} +{{? it.opts.allErrors }} } {{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/pattern.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/pattern.jst new file mode 100644 index 0000000000..3a37ef6cb8 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/pattern.jst @@ -0,0 +1,14 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ + var $regexp = $isData + ? '(new RegExp(' + $schemaValue + '))' + : it.usePattern($schema); +}} + +if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) { + {{# def.error:'pattern' }} +} {{? $breakOnError }} else { {{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/properties.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/properties.jst new file mode 100644 index 0000000000..3a4b966ffe --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/properties.jst @@ -0,0 +1,319 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateAdditional: + {{ /* additionalProperties is schema */ + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty + ? it.errorPath + : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} +#}} + + +{{ + var $key = 'key' + $lvl + , $dataNxt = $it.dataLevel = it.dataLevel + 1 + , $nextData = 'data' + $dataNxt; + + var $schemaKeys = Object.keys($schema || {}) + , $pProperties = it.schema.patternProperties || {} + , $pPropertyKeys = Object.keys($pProperties) + , $aProperties = it.schema.additionalProperties + , $someProperties = $schemaKeys.length || $pPropertyKeys.length + , $noAdditional = $aProperties === false + , $additionalIsSchema = typeof $aProperties == 'object' + && Object.keys($aProperties).length + , $removeAdditional = it.opts.removeAdditional + , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional + , $ownProperties = it.opts.ownProperties + , $currentBaseId = it.baseId; + + var $required = it.schema.required; + if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) + var $requiredHash = it.util.toHash($required); + + if (it.opts.v5) { + var $pgProperties = it.schema.patternGroups || {} + , $pgPropertyKeys = Object.keys($pgProperties); + } +}} + + +var {{=$errs}} = errors; +var {{=$nextValid}} = true; + +{{? $checkAdditional }} + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + {{? $someProperties }} + var isAdditional{{=$lvl}} = !(false + {{? $schemaKeys.length }} + {{? $schemaKeys.length > 5 }} + || validate.schema{{=$schemaPath}}[{{=$key}}] + {{??}} + {{~ $schemaKeys:$propertyKey }} + || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }} + {{~}} + {{?}} + {{?}} + {{? $pPropertyKeys.length }} + {{~ $pPropertyKeys:$pProperty:$i }} + || {{= it.usePattern($pProperty) }}.test({{=$key}}) + {{~}} + {{?}} + {{? it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length }} + {{~ $pgPropertyKeys:$pgProperty:$i }} + || {{= it.usePattern($pgProperty) }}.test({{=$key}}) + {{~}} + {{?}} + ); + + if (isAdditional{{=$lvl}}) { + {{?}} + {{? $removeAdditional == 'all' }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{ + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + }} + {{? $noAdditional }} + {{? $removeAdditional }} + delete {{=$data}}[{{=$key}}]; + {{??}} + {{=$nextValid}} = false; + {{ + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + }} + {{# def.error:'additionalProperties' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{? $breakOnError }} break; {{?}} + {{?}} + {{?? $additionalIsSchema }} + {{? $removeAdditional == 'failing' }} + var {{=$errs}} = errors; + {{# def.setCompositeRule }} + + {{# def.validateAdditional }} + + if (!{{=$nextValid}}) { + errors = {{=$errs}}; + if (validate.errors !== null) { + if (errors) validate.errors.length = errors; + else validate.errors = null; + } + delete {{=$data}}[{{=$key}}]; + } + + {{# def.resetCompositeRule }} + {{??}} + {{# def.validateAdditional }} + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + {{?}} + {{?}} + {{ it.errorPath = $currentErrorPath; }} + {{?}} + {{? $someProperties }} + } + {{?}} + } + + {{# def.ifResultValid }} +{{?}} + +{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }} + +{{? $schemaKeys.length }} + {{~ $schemaKeys:$propertyKey }} + {{ var $sch = $schema[$propertyKey]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + var $prop = it.util.getProperty($propertyKey) + , $passData = $data + $prop + , $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + }} + + {{# def.generateSubschemaCode }} + + {{? {{# def.willOptimize }} }} + {{ + $code = {{# def._optimizeValidate }}; + var $useData = $passData; + }} + {{??}} + {{ var $useData = $nextData; }} + var {{=$nextData}} = {{=$passData}}; + {{?}} + + {{? $hasDefault }} + {{= $code }} + {{??}} + {{? $requiredHash && $requiredHash[$propertyKey] }} + if ({{=$useData}} === undefined) { + {{=$nextValid}} = false; + {{ + var $currentErrorPath = it.errorPath + , $currErrSchemaPath = $errSchemaPath + , $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + }} + {{# def.error:'required' }} + {{ $errSchemaPath = $currErrSchemaPath; }} + {{ it.errorPath = $currentErrorPath; }} + } else { + {{??}} + {{? $breakOnError }} + if ({{=$useData}} === undefined) { + {{=$nextValid}} = true; + } else { + {{??}} + if ({{=$useData}} !== undefined) { + {{?}} + {{?}} + + {{= $code }} + } + {{?}} {{ /* $hasDefault */ }} + {{?}} {{ /* def.nonEmptySchema */ }} + + {{# def.ifResultValid }} + {{~}} +{{?}} + +{{~ $pPropertyKeys:$pProperty }} + {{ var $sch = $pProperties[$pProperty]; }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + + it.util.escapeFragment($pProperty); + }} + + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + if ({{= it.usePattern($pProperty) }}.test({{=$key}})) { + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + } + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} + } + + {{# def.ifResultValid }} + {{?}} {{ /* def.nonEmptySchema */ }} +{{~}} + + +{{? it.opts.v5 }} + {{~ $pgPropertyKeys:$pgProperty }} + {{ + var $pgSchema = $pgProperties[$pgProperty] + , $sch = $pgSchema.schema; + }} + + {{? {{# def.nonEmptySchema:$sch}} }} + {{ + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; + $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + + it.util.escapeFragment($pgProperty) + + '/schema'; + }} + + var pgPropCount{{=$lvl}} = 0; + + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + if ({{= it.usePattern($pgProperty) }}.test({{=$key}})) { + pgPropCount{{=$lvl}}++; + + {{ + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + }} + + {{# def.generateSubschemaCode }} + {{# def.optimizeValidate }} + + {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}} + } + {{? $breakOnError }} else {{=$nextValid}} = true; {{?}} + } + + {{# def.ifResultValid }} + + {{ + var $pgMin = $pgSchema.minimum + , $pgMax = $pgSchema.maximum; + }} + {{? $pgMin !== undefined || $pgMax !== undefined }} + var {{=$valid}} = true; + + {{ var $currErrSchemaPath = $errSchemaPath; }} + + {{? $pgMin !== undefined }} + {{ var $limit = $pgMin, $reason = 'minimum', $moreOrLess = 'less'; }} + {{=$valid}} = pgPropCount{{=$lvl}} >= {{=$pgMin}}; + {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; }} + {{# def.checkError:'patternGroups' }} + {{? $pgMax !== undefined }} + else + {{?}} + {{?}} + + {{? $pgMax !== undefined }} + {{ var $limit = $pgMax, $reason = 'maximum', $moreOrLess = 'more'; }} + {{=$valid}} = pgPropCount{{=$lvl}} <= {{=$pgMax}}; + {{ $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; }} + {{# def.checkError:'patternGroups' }} + {{?}} + + {{ $errSchemaPath = $currErrSchemaPath; }} + + {{# def.ifValid }} + {{?}} + {{?}} {{ /* def.nonEmptySchema */ }} + {{~}} +{{?}} + + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} + +{{# def.cleanUp }} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst new file mode 100644 index 0000000000..e8cdc4435a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/ref.jst @@ -0,0 +1,86 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +{{## def._validateRef:_v: + {{? it.opts.passContext }} + {{=_v}}.call(this, + {{??}} + {{=_v}}( + {{?}} + {{=$data}}, {{# def.dataPath }}{{# def.passParentData }}, rootData) +#}} + +{{ var $async, $refCode; }} +{{? $schema == '#' || $schema == '#/' }} + {{ + if (it.isRoot) { + $async = it.async; + $refCode = 'validate'; + } else { + $async = it.root.schema.$async === true; + $refCode = 'root.refVal[0]'; + } + }} +{{??}} + {{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }} + {{? $refVal === undefined }} + {{ var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; }} + {{? it.opts.missingRefs == 'fail' }} + {{ console.log($message); }} + {{# def.error:'$ref' }} + {{? $breakOnError }} if (false) { {{?}} + {{?? it.opts.missingRefs == 'ignore' }} + {{ console.log($message); }} + {{? $breakOnError }} if (true) { {{?}} + {{??}} + {{ + var $error = new Error($message); + $error.missingRef = it.resolve.url(it.baseId, $schema); + $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); + throw $error; + }} + {{?}} + {{?? $refVal.inline }} + {{# def.setupNextLevel }} + {{ + $it.schema = $refVal.schema; + $it.schemaPath = ''; + $it.errSchemaPath = $schema; + }} + {{ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); }} + {{= $code }} + {{? $breakOnError}} + if ({{=$nextValid}}) { + {{?}} + {{??}} + {{ + $async = $refVal.$async === true; + $refCode = $refVal.code; + }} + {{?}} +{{?}} + +{{? $refCode }} + {{# def.beginDefOut}} + {{# def._validateRef:$refCode }} + {{# def.storeDefOut:__callValidate }} + + {{? $async }} + {{ if (!it.async) throw new Error('async schema referenced by sync schema'); }} + try { {{? $breakOnError }}var {{=$valid}} ={{?}} {{=it.yieldAwait}} {{=__callValidate}}; } + catch (e) { + if (!(e instanceof ValidationError)) throw e; + if (vErrors === null) vErrors = e.errors; + else vErrors = vErrors.concat(e.errors); + errors = vErrors.length; + } + {{? $breakOnError }} if ({{=$valid}}) { {{?}} + {{??}} + if (!{{=__callValidate}}) { + if (vErrors === null) vErrors = {{=$refCode}}.errors; + else vErrors = vErrors.concat({{=$refCode}}.errors); + errors = vErrors.length; + } {{? $breakOnError }} else { {{?}} + {{?}} +{{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/required.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/required.jst new file mode 100644 index 0000000000..e109568f3e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/required.jst @@ -0,0 +1,96 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.missing }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{ var $vSchema = 'schema' + $lvl; }} + +{{## def.setupLoop: + {{? !$isData }} + var {{=$vSchema}} = validate.schema{{=$schemaPath}}; + {{?}} + + {{ + var $i = 'i' + $lvl + , $propertyPath = 'schema' + $lvl + '[' + $i + ']' + , $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + }} +#}} + + +{{? !$isData }} + {{? $schema.length < it.opts.loopRequired && + it.schema.properties && Object.keys(it.schema.properties).length }} + {{ var $required = []; }} + {{~ $schema:$property }} + {{ var $propertySch = it.schema.properties[$property]; }} + {{? !($propertySch && {{# def.nonEmptySchema:$propertySch}}) }} + {{ $required[$required.length] = $property; }} + {{?}} + {{~}} + {{??}} + {{ var $required = $schema; }} + {{?}} +{{?}} + + +{{? $isData || $required.length }} + {{ + var $currentErrorPath = it.errorPath + , $loopRequired = $isData || $required.length >= it.opts.loopRequired; + }} + + {{? $breakOnError }} + var missing{{=$lvl}}; + {{? $loopRequired }} + {{# def.setupLoop }} + var {{=$valid}} = true; + + {{?$isData}}{{# def.check$dataIsArray }}{{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + {{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined; + if (!{{=$valid}}) break; + } + + {{? $isData }} } {{?}} + + {{# def.checkError:'required' }} + else { + {{??}} + if ({{# def.checkMissingProperty:$required }}) { + {{# def.errorMissingProperty:'required' }} + } else { + {{?}} + {{??}} + {{? $loopRequired }} + {{# def.setupLoop }} + {{? $isData }} + if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) { + {{# def.addError:'required' }} + } else if ({{=$vSchema}} !== undefined) { + {{?}} + + for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) { + if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined) { + {{# def.addError:'required' }} + } + } + + {{? $isData }} } {{?}} + {{??}} + {{~ $required:$reqProperty }} + {{# def.allErrorsMissingProperty:'required' }} + {{~}} + {{?}} + {{?}} + + {{ it.errorPath = $currentErrorPath; }} + +{{?? $breakOnError }} + if (true) { +{{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/uniqueItems.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/uniqueItems.jst new file mode 100644 index 0000000000..dfc42b03b2 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/uniqueItems.jst @@ -0,0 +1,38 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + + +{{? ($schema || $isData) && it.opts.uniqueItems !== false }} + {{? $isData }} + var {{=$valid}}; + if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined) + {{=$valid}} = true; + else if (typeof {{=$schemaValue}} != 'boolean') + {{=$valid}} = false; + else { + {{?}} + + var {{=$valid}} = true; + if ({{=$data}}.length > 1) { + var i = {{=$data}}.length, j; + outer: + for (;i--;) { + for (j = i; j--;) { + if (equal({{=$data}}[i], {{=$data}}[j])) { + {{=$valid}} = false; + break outer; + } + } + } + } + + {{? $isData }} } {{?}} + + if (!{{=$valid}}) { + {{# def.error:'uniqueItems' }} + } {{? $breakOnError }} else { {{?}} +{{??}} + {{? $breakOnError }} if (true) { {{?}} +{{?}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/_formatLimit.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/_formatLimit.jst new file mode 100644 index 0000000000..af16b88d84 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/_formatLimit.jst @@ -0,0 +1,116 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +var {{=$valid}} = undefined; + +{{## def.skipFormatLimit: + {{=$valid}} = true; + {{ return out; }} +#}} + +{{## def.compareFormat: + {{? $isData }} + if ({{=$schemaValue}} === undefined) {{=$valid}} = true; + else if (typeof {{=$schemaValue}} != 'string') {{=$valid}} = false; + else { + {{ $closingBraces += '}'; }} + {{?}} + + {{? $isDataFormat }} + if (!{{=$compare}}) {{=$valid}} = true; + else { + {{ $closingBraces += '}'; }} + {{?}} + + var {{=$result}} = {{=$compare}}({{=$data}}, {{# def.schemaValueQS }}); + + if ({{=$result}} === undefined) {{=$valid}} = false; +#}} + + +{{? it.opts.format === false }}{{# def.skipFormatLimit }}{{?}} + +{{ + var $schemaFormat = it.schema.format + , $isDataFormat = it.opts.v5 && $schemaFormat.$data + , $closingBraces = ''; +}} + +{{? $isDataFormat }} + {{ + var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr) + , $format = 'format' + $lvl + , $compare = 'compare' + $lvl; + }} + + var {{=$format}} = formats[{{=$schemaValueFormat}}] + , {{=$compare}} = {{=$format}} && {{=$format}}.compare; +{{??}} + {{ var $format = it.formats[$schemaFormat]; }} + {{? !($format && $format.compare) }} + {{# def.skipFormatLimit }} + {{?}} + {{ var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; }} +{{?}} + +{{ + var $isMax = $keyword == 'formatMaximum' + , $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum') + , $schemaExcl = it.schema[$exclusiveKeyword] + , $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data + , $op = $isMax ? '<' : '>' + , $result = 'result' + $lvl; +}} + +{{# def.$data }} + + +{{? $isDataExcl }} + {{ + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr) + , $exclusive = 'exclusive' + $lvl + , $opExpr = 'op' + $lvl + , $opStr = '\' + ' + $opExpr + ' + \''; + }} + var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}}; + {{ $schemaValueExcl = 'schemaExcl' + $lvl; }} + + if (typeof {{=$schemaValueExcl}} != 'boolean' && {{=$schemaValueExcl}} !== undefined) { + {{=$valid}} = false; + {{ var $errorKeyword = $exclusiveKeyword; }} + {{# def.error:'_formatExclusiveLimit' }} + } + + {{# def.elseIfValid }} + + {{# def.compareFormat }} + var {{=$exclusive}} = {{=$schemaValueExcl}} === true; + + if ({{=$valid}} === undefined) { + {{=$valid}} = {{=$exclusive}} + ? {{=$result}} {{=$op}} 0 + : {{=$result}} {{=$op}}= 0; + } + + if (!{{=$valid}}) var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}='; +{{??}} + {{ + var $exclusive = $schemaExcl === true + , $opStr = $op; /*used in error*/ + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; /*used in error*/ + }} + + {{# def.compareFormat }} + + if ({{=$valid}} === undefined) + {{=$valid}} = {{=$result}} {{=$op}}{{?!$exclusive}}={{?}} 0; +{{?}} + +{{= $closingBraces }} + +if (!{{=$valid}}) { + {{ var $errorKeyword = $keyword; }} + {{# def.error:'_formatLimit' }} +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/constant.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/constant.jst new file mode 100644 index 0000000000..67969c1b9f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/constant.jst @@ -0,0 +1,10 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.$data }} + +{{? !$isData }} + var schema{{=$lvl}} = validate.schema{{=$schemaPath}}; +{{?}} +var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}}); +{{# def.checkError:'constant' }} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/patternRequired.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/patternRequired.jst new file mode 100644 index 0000000000..9af2cdc9d0 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/patternRequired.jst @@ -0,0 +1,28 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} + +{{ + var $key = 'key' + $lvl + , $matched = 'patternMatched' + $lvl + , $closingBraces = '' + , $ownProperties = it.opts.ownProperties; +}} + +var {{=$valid}} = true; +{{~ $schema:$pProperty }} + var {{=$matched}} = false; + for (var {{=$key}} in {{=$data}}) { + {{# def.checkOwnProperty }} + {{=$matched}} = {{= it.usePattern($pProperty) }}.test({{=$key}}); + if ({{=$matched}}) break; + } + + {{ var $missingPattern = it.util.escapeQuotes($pProperty); }} + if (!{{=$matched}}) { + {{=$valid}} = false; + {{# def.addError:'patternRequired' }} + } {{# def.elseIfValid }} +{{~}} + +{{= $closingBraces }} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst new file mode 100644 index 0000000000..ff64b0e740 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/v5/switch.jst @@ -0,0 +1,73 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.validateIf: + {{# def.setCompositeRule }} + {{ $it.createErrors = false; }} + {{# def._validateSwitchRule:if }} + {{ $it.createErrors = true; }} + {{# def.resetCompositeRule }} + {{=$ifPassed}} = {{=$nextValid}}; +#}} + +{{## def.validateThen: + {{? typeof $sch.then == 'boolean' }} + {{? $sch.then === false }} + {{# def.error:'switch' }} + {{?}} + var {{=$nextValid}} = {{= $sch.then }}; + {{??}} + {{# def._validateSwitchRule:then }} + {{?}} +#}} + +{{## def._validateSwitchRule:_clause: + {{ + $it.schema = $sch._clause; + $it.schemaPath = $schemaPath + '[' + $caseIndex + ']._clause'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/_clause'; + }} + {{# def.insertSubschemaCode }} +#}} + +{{## def.switchCase: + {{? $sch.if && {{# def.nonEmptySchema:$sch.if }} }} + var {{=$errs}} = errors; + {{# def.validateIf }} + if ({{=$ifPassed}}) { + {{# def.validateThen }} + } else { + {{# def.resetErrors }} + } + {{??}} + {{=$ifPassed}} = true; + {{# def.validateThen }} + {{?}} +#}} + + +{{ + var $ifPassed = 'ifPassed' + it.level + , $currentBaseId = $it.baseId + , $shouldContinue; +}} +var {{=$ifPassed}}; + +{{~ $schema:$sch:$caseIndex }} + {{? $caseIndex && !$shouldContinue }} + if (!{{=$ifPassed}}) { + {{ $closingBraces+= '}'; }} + {{?}} + + {{# def.switchCase }} + {{ $shouldContinue = $sch.continue }} +{{~}} + +{{= $closingBraces }} + +var {{=$valid}} = {{=$nextValid}}; + +{{# def.cleanUp }} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/validate.jst b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/validate.jst new file mode 100644 index 0000000000..1b08758701 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dot/validate.jst @@ -0,0 +1,210 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.defaults }} +{{# def.coerce }} + +{{ /** + * schema compilation (render) time: + * it = { schema, RULES, _validate, opts } + * it.validate - this template function, + * it is used recursively to generate code for subschemas + * + * runtime: + * "validate" is a variable name to which this function will be assigned + * validateRef etc. are defined in the parent scope in index.js + */ }} + +{{ var $async = it.schema.$async === true; }} + +{{? it.isTop}} + {{ + var $top = it.isTop + , $lvl = it.level = 0 + , $dataLvl = it.dataLevel = 0 + , $data = 'data'; + it.rootId = it.resolve.fullPath(it.root.schema.id); + it.baseId = it.baseId || it.rootId; + if ($async) { + it.async = true; + var $es7 = it.opts.async == 'es7'; + it.yieldAwait = $es7 ? 'await' : 'yield'; + } + delete it.isTop; + + it.dataPathArr = [undefined]; + }} + + var validate = + {{? $async }} + {{? $es7 }} + (async function + {{??}} + {{? it.opts.async == 'co*'}}co.wrap{{?}}(function* + {{?}} + {{??}} + (function + {{?}} + (data, dataPath, parentData, parentDataProperty, rootData) { + 'use strict'; + var vErrors = null; {{ /* don't edit, used in replace */ }} + var errors = 0; {{ /* don't edit, used in replace */ }} + if (rootData === undefined) rootData = data; +{{??}} + {{ + var $lvl = it.level + , $dataLvl = it.dataLevel + , $data = 'data' + ($dataLvl || ''); + + if (it.schema.id) it.baseId = it.resolve.url(it.baseId, it.schema.id); + + if ($async && !it.async) throw new Error('async schema in sync schema'); + }} + + var errs_{{=$lvl}} = errors; +{{?}} + +{{ + var $valid = 'valid' + $lvl + , $breakOnError = !it.opts.allErrors + , $closingBraces1 = '' + , $closingBraces2 = '' + , $errorKeyword; + + var $typeSchema = it.schema.type + , $typeIsArray = Array.isArray($typeSchema); +}} + +{{## def.checkType: + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type' + , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + }} + + if ({{= it.util[$method]($typeSchema, $data, true) }}) { +#}} + +{{? $typeSchema && it.opts.coerceTypes }} + {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }} + {{? $coerceToTypes }} + {{# def.checkType }} + {{# def.coerceType }} + } + {{?}} +{{?}} + +{{ var $refKeywords; }} +{{? it.schema.$ref && ($refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref')) }} + {{? it.opts.extendRefs == 'fail' }} + {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '"'); }} + {{?? it.opts.extendRefs == 'ignore' }} + {{ + $refKeywords = false; + console.log('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + }} + {{?? it.opts.extendRefs !== true }} + {{ console.log('$ref: all keywords used in schema at path "' + it.errSchemaPath + '". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour'); }} + {{?}} +{{?}} + +{{? it.schema.$ref && !$refKeywords }} + {{= it.RULES.all.$ref.code(it, '$ref') }} + {{? $breakOnError }} + } + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} +{{??}} + {{~ it.RULES:$rulesGroup }} + {{? $shouldUseGroup($rulesGroup) }} + {{? $rulesGroup.type }} + if ({{= it.util.checkDataType($rulesGroup.type, $data) }}) { + {{?}} + {{? it.opts.useDefaults && !it.compositeRule }} + {{? $rulesGroup.type == 'object' && it.schema.properties }} + {{# def.defaultProperties }} + {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }} + {{# def.defaultItems }} + {{?}} + {{?}} + {{~ $rulesGroup.rules:$rule }} + {{? $shouldUseRule($rule) }} + {{= $rule.code(it, $rule.keyword) }} + {{? $breakOnError }} + {{ $closingBraces1 += '}'; }} + {{?}} + {{?}} + {{~}} + {{? $breakOnError }} + {{= $closingBraces1 }} + {{ $closingBraces1 = ''; }} + {{?}} + {{? $rulesGroup.type }} + } + {{? $typeSchema && $typeSchema === $rulesGroup.type }} + {{ var $typeChecked = true; }} + else { + {{ + var $schemaPath = it.schemaPath + '.type' + , $errSchemaPath = it.errSchemaPath + '/type'; + }} + {{# def.error:'type' }} + } + {{?}} + {{?}} + + {{? $breakOnError }} + if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) { + {{ $closingBraces2 += '}'; }} + {{?}} + {{?}} + {{~}} +{{?}} + +{{? $typeSchema && !$typeChecked && !(it.opts.coerceTypes && $coerceToTypes) }} + {{# def.checkType }} + {{# def.error:'type' }} + } +{{?}} + +{{? $breakOnError }} {{= $closingBraces2 }} {{?}} + +{{? $top }} + {{? $async }} + if (errors === 0) return true; {{ /* don't edit, used in replace */ }} + else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }} + {{??}} + validate.errors = vErrors; {{ /* don't edit, used in replace */ }} + return errors === 0; {{ /* don't edit, used in replace */ }} + {{?}} + }); + + return validate; +{{??}} + var {{=$valid}} = errors === errs_{{=$lvl}}; +{{?}} + +{{# def.cleanUp }} + +{{? $top && $breakOnError }} + {{# def.cleanUpVarErrors }} +{{?}} + +{{ + function $shouldUseGroup($rulesGroup) { + for (var i=0; i < $rulesGroup.rules.length; i++) + if ($shouldUseRule($rulesGroup.rules[i])) + return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || + ( $rule.keyword == 'properties' && + ( it.schema.additionalProperties === false || + typeof it.schema.additionalProperties == 'object' + || ( it.schema.patternProperties && + Object.keys(it.schema.patternProperties).length ) + || ( it.opts.v5 && it.schema.patternGroups && + Object.keys(it.schema.patternGroups).length ))); + } +}} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/README.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/README.md new file mode 100644 index 0000000000..4d994846c8 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/README.md @@ -0,0 +1,3 @@ +These files are compiled dot templates from dot folder. + +Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_formatLimit.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_formatLimit.js new file mode 100644 index 0000000000..996e1f2c20 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_formatLimit.js @@ -0,0 +1,176 @@ +'use strict'; +module.exports = function generate__formatLimit(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + out += 'var ' + ($valid) + ' = undefined;'; + if (it.opts.format === false) { + out += ' ' + ($valid) + ' = true; '; + return out; + } + var $schemaFormat = it.schema.format, + $isDataFormat = it.opts.v5 && $schemaFormat.$data, + $closingBraces = ''; + if ($isDataFormat) { + var $schemaValueFormat = it.util.getData($schemaFormat.$data, $dataLvl, it.dataPathArr), + $format = 'format' + $lvl, + $compare = 'compare' + $lvl; + out += ' var ' + ($format) + ' = formats[' + ($schemaValueFormat) + '] , ' + ($compare) + ' = ' + ($format) + ' && ' + ($format) + '.compare;'; + } else { + var $format = it.formats[$schemaFormat]; + if (!($format && $format.compare)) { + out += ' ' + ($valid) + ' = true; '; + return out; + } + var $compare = 'formats' + it.util.getProperty($schemaFormat) + '.compare'; + } + var $isMax = $keyword == 'formatMaximum', + $exclusiveKeyword = 'formatExclusive' + ($isMax ? 'Maximum' : 'Minimum'), + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $result = 'result' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && ' + ($schemaValueExcl) + ' !== undefined) { ' + ($valid) + ' = false; '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatExclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; var ' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true; if (' + ($valid) + ' === undefined) { ' + ($valid) + ' = ' + ($exclusive) + ' ? ' + ($result) + ' ' + ($op) + ' 0 : ' + ($result) + ' ' + ($op) + '= 0; } if (!' + ($valid) + ') var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + if ($isData) { + out += ' if (' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'string\') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + if ($isDataFormat) { + out += ' if (!' + ($compare) + ') ' + ($valid) + ' = true; else { '; + $closingBraces += '}'; + } + out += ' var ' + ($result) + ' = ' + ($compare) + '(' + ($data) + ', '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' ); if (' + ($result) + ' === undefined) ' + ($valid) + ' = false; if (' + ($valid) + ' === undefined) ' + ($valid) + ' = ' + ($result) + ' ' + ($op); + if (!$exclusive) { + out += '='; + } + out += ' 0;'; + } + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_formatLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '}'; + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limit.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limit.js new file mode 100644 index 0000000000..4d92024afc --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limit.js @@ -0,0 +1,124 @@ +'use strict'; +module.exports = function generate__limit(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.v5 && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<'; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var exclusive' + ($lvl) + '; if (typeof ' + ($schemaValueExcl) + ' != \'boolean\' && typeof ' + ($schemaValueExcl) + ' != \'undefined\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ((exclusive' + ($lvl) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ') || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = exclusive' + ($lvl) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclusive = $schemaExcl === true, + $opStr = $op; + if (!$exclusive) $opStr += '='; + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp); + if ($exclusive) { + out += '='; + } + out += ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') {'; + } + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitItems.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitItems.js new file mode 100644 index 0000000000..6a843627bc --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitItems.js @@ -0,0 +1,76 @@ +'use strict'; +module.exports = function generate__limitItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitLength.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitLength.js new file mode 100644 index 0000000000..e378104df9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitLength.js @@ -0,0 +1,81 @@ +'use strict'; +module.exports = function generate__limitLength(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitProperties.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitProperties.js new file mode 100644 index 0000000000..74c0851842 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/_limitProperties.js @@ -0,0 +1,76 @@ +'use strict'; +module.exports = function generate__limitProperties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/allOf.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/allOf.js new file mode 100644 index 0000000000..0063ecf1a7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/allOf.js @@ -0,0 +1,43 @@ +'use strict'; +module.exports = function generate_allOf(it, $keyword) { + var out = ' '; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $currentBaseId = $it.baseId, + $allSchemasEmpty = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $allSchemasEmpty = false; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if ($breakOnError) { + if ($allSchemasEmpty) { + out += ' if (true) { '; + } else { + out += ' ' + ($closingBraces.slice(0, -1)) + ' '; + } + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/anyOf.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/anyOf.js new file mode 100644 index 0000000000..3d24b89f07 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/anyOf.js @@ -0,0 +1,66 @@ +'use strict'; +module.exports = function generate_anyOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $noEmptySchema = $schema.every(function($sch) { + return it.util.schemaHasRules($sch, it.RULES.all); + }); + if ($noEmptySchema) { + var $currentBaseId = $it.baseId; + out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match some schema in anyOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + out = it.util.cleanUpCode(out); + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/constant.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/constant.js new file mode 100644 index 0000000000..9e8f371f28 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/constant.js @@ -0,0 +1,53 @@ +'use strict'; +module.exports = function generate_constant(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (!$isData) { + out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; + } + out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'constant') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should be equal to constant\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/custom.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/custom.js new file mode 100644 index 0000000000..def37df5ed --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/custom.js @@ -0,0 +1,221 @@ +'use strict'; +module.exports = function generate_custom(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $rule = this, + $definition = 'definition' + $lvl, + $rDef = $rule.definition, + $validate = $rDef.validate, + $compile, $inline, $macro, $ruleValidate, $validateCode; + if ($isData && $rDef.$data) { + $validateCode = 'keywordValidate' + $lvl; + var $validateSchema = $rDef.validateSchema; + out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; + } else { + $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); + $schemaValue = 'validate.schema' + $schemaPath; + $validateCode = $ruleValidate.code; + $compile = $rDef.compile; + $inline = $rDef.inline; + $macro = $rDef.macro; + } + var $ruleErrs = $validateCode + '.errors', + $i = 'i' + $lvl, + $ruleErr = 'ruleErr' + $lvl, + $asyncKeyword = $rDef.async; + if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); + if (!($inline || $macro)) { + out += '' + ($ruleErrs) + ' = null;'; + } + out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; + if ($validateSchema) { + out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') {'; + } + if ($inline) { + if ($rDef.statements) { + out += ' ' + ($ruleValidate.validate) + ' '; + } else { + out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; + } + } else if ($macro) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $ruleValidate.validate; + $it.schemaPath = ''; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($code); + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + out += ' ' + ($validateCode) + '.call( '; + if (it.opts.passContext) { + out += 'this'; + } else { + out += 'self'; + } + if ($compile || $rDef.schema === false) { + out += ' , ' + ($data) + ' '; + } else { + out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; + } + out += ' , (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; + var def_callRuleValidate = out; + out = $$outStack.pop(); + if ($rDef.errors === false) { + out += ' ' + ($valid) + ' = '; + if ($asyncKeyword) { + out += '' + (it.yieldAwait); + } + out += '' + (def_callRuleValidate) + '; '; + } else { + if ($asyncKeyword) { + $ruleErrs = 'customErrors' + $lvl; + out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; + } else { + out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; + } + } + } + if ($rDef.modifying) { + out += ' ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; + } + if ($validateSchema) { + out += ' }'; + } + if ($rDef.valid) { + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + out += ' if ( '; + if ($rDef.valid === undefined) { + out += ' !'; + if ($macro) { + out += '' + ($nextValid); + } else { + out += '' + ($valid); + } + } else { + out += ' ' + (!$rDef.valid) + ' '; + } + out += ') { '; + $errorKeyword = $rule.keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + var def_customError = out; + out = $$outStack.pop(); + if ($inline) { + if ($rDef.errors) { + if ($rDef.errors != 'full') { + out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' ' + ($i) + ') { '; + var $passData = $data + '[' + $i + ']'; + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); + $it.dataPathArr[$dataNxt] = $i; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { + $it.schema = $additionalItems; + $it.schemaPath = it.schemaPath + '.additionalItems'; + $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; + out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } else if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); + var $passData = $data + '[' + $idx + ']'; + $it.dataPathArr[$dataNxt] = $idx; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/multipleOf.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/multipleOf.js new file mode 100644 index 0000000000..1f89031ddb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/multipleOf.js @@ -0,0 +1,77 @@ +'use strict'; +module.exports = function generate_multipleOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + out += 'var division' + ($lvl) + ';if ('; + if ($isData) { + out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; + } + out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; + if (it.opts.multipleOfPrecision) { + out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + } else { + out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; + } + out += ' ) '; + if ($isData) { + out += ' ) '; + } + out += ' ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be multiple of '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schema) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/not.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/not.js new file mode 100644 index 0000000000..f1af86d2bb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/not.js @@ -0,0 +1,84 @@ +'use strict'; +module.exports = function generate_not(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + if (it.util.schemaHasRules($schema, it.RULES.all)) { + $it.schema = $schema; + $it.schemaPath = $schemaPath; + $it.errSchemaPath = $errSchemaPath; + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + var $allErrorsOption; + if ($it.opts.allErrors) { + $allErrorsOption = $it.opts.allErrors; + $it.opts.allErrors = false; + } + out += ' ' + (it.validate($it)) + ' '; + $it.createErrors = true; + if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' if (' + ($nextValid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + if (it.opts.allErrors) { + out += ' } '; + } + } else { + out += ' var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be valid\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + if ($breakOnError) { + out += ' if (false) { '; + } + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/oneOf.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/oneOf.js new file mode 100644 index 0000000000..077f00a7c8 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/oneOf.js @@ -0,0 +1,77 @@ +'use strict'; +module.exports = function generate_oneOf(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; + var $currentBaseId = $it.baseId; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + var arr1 = $schema; + if (arr1) { + var $sch, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $sch = arr1[$i += 1]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = $schemaPath + '[' + $i + ']'; + $it.errSchemaPath = $errSchemaPath + '/' + $i; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } else { + out += ' var ' + ($nextValid) + ' = true; '; + } + if ($i) { + out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; + $closingBraces += '}'; + } + out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; + } + } + it.compositeRule = $it.compositeRule = $wasComposite; + out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'should match exactly one schema in oneOf\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; + if (it.opts.allErrors) { + out += ' } '; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/pattern.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/pattern.js new file mode 100644 index 0000000000..dc221495de --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/pattern.js @@ -0,0 +1,75 @@ +'use strict'; +module.exports = function generate_pattern(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + } + out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; + if ($isData) { + out += '' + ($schemaValue); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should match pattern "'; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + (it.util.escapeQuotes($schema)); + } + out += '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + (it.util.toQuotedString($schema)); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js new file mode 100644 index 0000000000..e20df98ca7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/patternRequired.js @@ -0,0 +1,52 @@ +'use strict'; +module.exports = function generate_patternRequired(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $key = 'key' + $lvl, + $matched = 'patternMatched' + $lvl, + $closingBraces = '', + $ownProperties = it.opts.ownProperties; + out += 'var ' + ($valid) + ' = true;'; + var arr1 = $schema; + if (arr1) { + var $pProperty, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $pProperty = arr1[i1 += 1]; + out += ' var ' + ($matched) + ' = false; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' ' + ($matched) + ' = ' + (it.usePattern($pProperty)) + '.test(' + ($key) + '); if (' + ($matched) + ') break; } '; + var $missingPattern = it.util.escapeQuotes($pProperty); + out += ' if (!' + ($matched) + ') { ' + ($valid) + ' = false; var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'patternRequired') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingPattern: \'' + ($missingPattern) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should have property matching pattern \\\'' + ($missingPattern) + '\\\'\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + } + out += '' + ($closingBraces); + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/properties.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/properties.js new file mode 100644 index 0000000000..ea42c82885 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/properties.js @@ -0,0 +1,446 @@ +'use strict'; +module.exports = function generate_properties(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $key = 'key' + $lvl, + $dataNxt = $it.dataLevel = it.dataLevel + 1, + $nextData = 'data' + $dataNxt; + var $schemaKeys = Object.keys($schema || {}), + $pProperties = it.schema.patternProperties || {}, + $pPropertyKeys = Object.keys($pProperties), + $aProperties = it.schema.additionalProperties, + $someProperties = $schemaKeys.length || $pPropertyKeys.length, + $noAdditional = $aProperties === false, + $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, + $removeAdditional = it.opts.removeAdditional, + $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, + $ownProperties = it.opts.ownProperties, + $currentBaseId = it.baseId; + var $required = it.schema.required; + if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); + if (it.opts.v5) { + var $pgProperties = it.schema.patternGroups || {}, + $pgPropertyKeys = Object.keys($pgProperties); + } + out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; + if ($checkAdditional) { + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + if ($someProperties) { + out += ' var isAdditional' + ($lvl) + ' = !(false '; + if ($schemaKeys.length) { + if ($schemaKeys.length > 5) { + out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; + } else { + var arr1 = $schemaKeys; + if (arr1) { + var $propertyKey, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $propertyKey = arr1[i1 += 1]; + out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; + } + } + } + } + if ($pPropertyKeys.length) { + var arr2 = $pPropertyKeys; + if (arr2) { + var $pProperty, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + $pProperty = arr2[$i += 1]; + out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; + } + } + } + if (it.opts.v5 && $pgPropertyKeys && $pgPropertyKeys.length) { + var arr3 = $pgPropertyKeys; + if (arr3) { + var $pgProperty, $i = -1, + l3 = arr3.length - 1; + while ($i < l3) { + $pgProperty = arr3[$i += 1]; + out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; + } + } + } + out += ' ); if (isAdditional' + ($lvl) + ') { '; + } + if ($removeAdditional == 'all') { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + var $currentErrorPath = it.errorPath; + var $additionalProperty = '\' + ' + $key + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + } + if ($noAdditional) { + if ($removeAdditional) { + out += ' delete ' + ($data) + '[' + ($key) + ']; '; + } else { + out += ' ' + ($nextValid) + ' = false; '; + var $currErrSchemaPath = $errSchemaPath; + $errSchemaPath = it.errSchemaPath + '/additionalProperties'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have additional properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' break; '; + } + } + } else if ($additionalIsSchema) { + if ($removeAdditional == 'failing') { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; + it.compositeRule = $it.compositeRule = $wasComposite; + } else { + $it.schema = $aProperties; + $it.schemaPath = it.schemaPath + '.additionalProperties'; + $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; + $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + } + } + it.errorPath = $currentErrorPath; + } + if ($someProperties) { + out += ' } '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + var $useDefaults = it.opts.useDefaults && !it.compositeRule; + if ($schemaKeys.length) { + var arr4 = $schemaKeys; + if (arr4) { + var $propertyKey, i4 = -1, + l4 = arr4.length - 1; + while (i4 < l4) { + $propertyKey = arr4[i4 += 1]; + var $sch = $schema[$propertyKey]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + var $prop = it.util.getProperty($propertyKey), + $passData = $data + $prop, + $hasDefault = $useDefaults && $sch.default !== undefined; + $it.schema = $sch; + $it.schemaPath = $schemaPath + $prop; + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); + $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); + $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + $code = it.util.varReplace($code, $nextData, $passData); + var $useData = $passData; + } else { + var $useData = $nextData; + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; + } + if ($hasDefault) { + out += ' ' + ($code) + ' '; + } else { + if ($requiredHash && $requiredHash[$propertyKey]) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = false; '; + var $currentErrorPath = it.errorPath, + $currErrSchemaPath = $errSchemaPath, + $missingProperty = it.util.escapeQuotes($propertyKey); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + $errSchemaPath = it.errSchemaPath + '/required'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + $errSchemaPath = $currErrSchemaPath; + it.errorPath = $currentErrorPath; + out += ' } else { '; + } else { + if ($breakOnError) { + out += ' if (' + ($useData) + ' === undefined) { ' + ($nextValid) + ' = true; } else { '; + } else { + out += ' if (' + ($useData) + ' !== undefined) { '; + } + } + out += ' ' + ($code) + ' } '; + } + } + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + var arr5 = $pPropertyKeys; + if (arr5) { + var $pProperty, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $pProperty = arr5[i5 += 1]; + var $sch = $pProperties[$pProperty]; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); + $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); + out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + } + if (it.opts.v5) { + var arr6 = $pgPropertyKeys; + if (arr6) { + var $pgProperty, i6 = -1, + l6 = arr6.length - 1; + while (i6 < l6) { + $pgProperty = arr6[i6 += 1]; + var $pgSchema = $pgProperties[$pgProperty], + $sch = $pgSchema.schema; + if (it.util.schemaHasRules($sch, it.RULES.all)) { + $it.schema = $sch; + $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; + $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; + out += ' var pgPropCount' + ($lvl) + ' = 0; for (var ' + ($key) + ' in ' + ($data) + ') { '; + if ($ownProperties) { + out += ' if (!Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($key) + ')) continue; '; + } + out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; + $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); + var $passData = $data + '[' + $key + ']'; + $it.dataPathArr[$dataNxt] = $key; + var $code = it.validate($it); + $it.baseId = $currentBaseId; + if (it.util.varOccurences($code, $nextData) < 2) { + out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + } else { + out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + } + if ($breakOnError) { + out += ' if (!' + ($nextValid) + ') break; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else ' + ($nextValid) + ' = true; '; + } + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + var $pgMin = $pgSchema.minimum, + $pgMax = $pgSchema.maximum; + if ($pgMin !== undefined || $pgMax !== undefined) { + out += ' var ' + ($valid) + ' = true; '; + var $currErrSchemaPath = $errSchemaPath; + if ($pgMin !== undefined) { + var $limit = $pgMin, + $reason = 'minimum', + $moreOrLess = 'less'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($pgMax !== undefined) { + out += ' else '; + } + } + if ($pgMax !== undefined) { + var $limit = $pgMax, + $reason = 'maximum', + $moreOrLess = 'more'; + out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; + $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + $errSchemaPath = $currErrSchemaPath; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + $closingBraces += '}'; + } + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/ref.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/ref.js new file mode 100644 index 0000000000..4b38b06ca0 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/ref.js @@ -0,0 +1,120 @@ +'use strict'; +module.exports = function generate_ref(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $async, $refCode; + if ($schema == '#' || $schema == '#/') { + if (it.isRoot) { + $async = it.async; + $refCode = 'validate'; + } else { + $async = it.root.schema.$async === true; + $refCode = 'root.refVal[0]'; + } + } else { + var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); + if ($refVal === undefined) { + var $message = 'can\'t resolve reference ' + $schema + ' from id ' + it.baseId; + if (it.opts.missingRefs == 'fail') { + console.log($message); + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; + } + if (it.opts.verbose) { + out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + if ($breakOnError) { + out += ' if (false) { '; + } + } else if (it.opts.missingRefs == 'ignore') { + console.log($message); + if ($breakOnError) { + out += ' if (true) { '; + } + } else { + var $error = new Error($message); + $error.missingRef = it.resolve.url(it.baseId, $schema); + $error.missingSchema = it.resolve.normalizeId(it.resolve.fullPath($error.missingRef)); + throw $error; + } + } else if ($refVal.inline) { + var $it = it.util.copy(it); + $it.level++; + var $nextValid = 'valid' + $it.level; + $it.schema = $refVal.schema; + $it.schemaPath = ''; + $it.errSchemaPath = $schema; + var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); + out += ' ' + ($code) + ' '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + } + } else { + $async = $refVal.$async === true; + $refCode = $refVal.code; + } + } + if ($refCode) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; + if (it.opts.passContext) { + out += ' ' + ($refCode) + '.call(this, '; + } else { + out += ' ' + ($refCode) + '( '; + } + out += ' ' + ($data) + ', (dataPath || \'\')'; + if (it.errorPath != '""') { + out += ' + ' + (it.errorPath); + } + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; + var __callValidate = out; + out = $$outStack.pop(); + if ($async) { + if (!it.async) throw new Error('async schema referenced by sync schema'); + out += ' try { '; + if ($breakOnError) { + out += 'var ' + ($valid) + ' ='; + } + out += ' ' + (it.yieldAwait) + ' ' + (__callValidate) + '; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' if (' + ($valid) + ') { '; + } + } else { + out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; + if ($breakOnError) { + out += ' else { '; + } + } + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/required.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/required.js new file mode 100644 index 0000000000..43dbf35562 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/required.js @@ -0,0 +1,250 @@ +'use strict'; +module.exports = function generate_required(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $vSchema = 'schema' + $lvl; + if (!$isData) { + if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { + var $required = []; + var arr1 = $schema; + if (arr1) { + var $property, i1 = -1, + l1 = arr1.length - 1; + while (i1 < l1) { + $property = arr1[i1 += 1]; + var $propertySch = it.schema.properties[$property]; + if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { + $required[$required.length] = $property; + } + } + } + } else { + var $required = $schema; + } + } + if ($isData || $required.length) { + var $currentErrorPath = it.errorPath, + $loopRequired = $isData || $required.length >= it.opts.loopRequired; + if ($breakOnError) { + out += ' var missing' + ($lvl) + '; '; + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + out += ' var ' + ($valid) + ' = true; '; + if ($isData) { + out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined; if (!' + ($valid) + ') break; } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } else { + out += ' if ( '; + var arr2 = $required; + if (arr2) { + var _$property, $i = -1, + l2 = arr2.length - 1; + while ($i < l2) { + _$property = arr2[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty(_$property); + out += ' ( ' + ($data) + ($prop) + ' === undefined && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? _$property : $prop)) + ') ) '; + } + } + out += ') { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + } + } else { + if ($loopRequired) { + if (!$isData) { + out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; + } + var $i = 'i' + $lvl, + $propertyPath = 'schema' + $lvl + '[' + $i + ']', + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); + } + if ($isData) { + out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; + } + out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; + if ($isData) { + out += ' } '; + } + } else { + var arr3 = $required; + if (arr3) { + var $reqProperty, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $reqProperty = arr3[i3 += 1]; + var $prop = it.util.getProperty($reqProperty), + $missingProperty = it.util.escapeQuotes($reqProperty); + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $reqProperty, it.opts.jsonPointers); + } + out += ' if (' + ($data) + ($prop) + ' === undefined) { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \''; + if (it.opts._errorDataPathProperty) { + out += 'is a required property'; + } else { + out += 'should have required property \\\'' + ($missingProperty) + '\\\''; + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + } + it.errorPath = $currentErrorPath; + } else if ($breakOnError) { + out += ' if (true) {'; + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/switch.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/switch.js new file mode 100644 index 0000000000..4ccf0bca36 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/switch.js @@ -0,0 +1,129 @@ +'use strict'; +module.exports = function generate_switch(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $ifPassed = 'ifPassed' + it.level, + $currentBaseId = $it.baseId, + $shouldContinue; + out += 'var ' + ($ifPassed) + ';'; + var arr1 = $schema; + if (arr1) { + var $sch, $caseIndex = -1, + l1 = arr1.length - 1; + while ($caseIndex < l1) { + $sch = arr1[$caseIndex += 1]; + if ($caseIndex && !$shouldContinue) { + out += ' if (!' + ($ifPassed) + ') { '; + $closingBraces += '}'; + } + if ($sch.if && it.util.schemaHasRules($sch.if, it.RULES.all)) { + out += ' var ' + ($errs) + ' = errors; '; + var $wasComposite = it.compositeRule; + it.compositeRule = $it.compositeRule = true; + $it.createErrors = false; + $it.schema = $sch.if; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].if'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/if'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + $it.createErrors = true; + it.compositeRule = $it.compositeRule = $wasComposite; + out += ' ' + ($ifPassed) + ' = ' + ($nextValid) + '; if (' + ($ifPassed) + ') { '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } } '; + } else { + out += ' ' + ($ifPassed) + ' = true; '; + if (typeof $sch.then == 'boolean') { + if ($sch.then === false) { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'switch') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { caseIndex: ' + ($caseIndex) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should pass "switch" keyword validation\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' var ' + ($nextValid) + ' = ' + ($sch.then) + '; '; + } else { + $it.schema = $sch.then; + $it.schemaPath = $schemaPath + '[' + $caseIndex + '].then'; + $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/then'; + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + } + } + $shouldContinue = $sch.continue + } + } + out += '' + ($closingBraces) + 'var ' + ($valid) + ' = ' + ($nextValid) + '; '; + out = it.util.cleanUpCode(out); + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/uniqueItems.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/uniqueItems.js new file mode 100644 index 0000000000..7faff85aa7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/uniqueItems.js @@ -0,0 +1,72 @@ +'use strict'; +module.exports = function generate_uniqueItems(it, $keyword) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + var $isData = it.opts.v5 && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + if (($schema || $isData) && it.opts.uniqueItems !== false) { + if ($isData) { + out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; + } + out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; + if ($isData) { + out += ' } '; + } + out += ' if (!' + ($valid) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + } else { + if ($breakOnError) { + out += ' if (true) { '; + } + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/validate.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/validate.js new file mode 100644 index 0000000000..c984af3cb6 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/dotjs/validate.js @@ -0,0 +1,376 @@ +'use strict'; +module.exports = function generate_validate(it, $keyword) { + var out = ''; + var $async = it.schema.$async === true; + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.root.schema.id); + it.baseId = it.baseId || it.rootId; + if ($async) { + it.async = true; + var $es7 = it.opts.async == 'es7'; + it.yieldAwait = $es7 ? 'await' : 'yield'; + } + delete it.isTop; + it.dataPathArr = [undefined]; + out += ' var validate = '; + if ($async) { + if ($es7) { + out += ' (async function '; + } else { + if (it.opts.async == 'co*') { + out += 'co.wrap'; + } + out += '(function* '; + } + } else { + out += ' (function '; + } + out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data;'; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if (it.schema.id) it.baseId = it.resolve.url(it.baseId, it.schema.id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = '', + $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeSchema && it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + if ($coerceToTypes) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + } + out += ' var ' + ($coerced) + ' = undefined; '; + var $bracesCoercion = ''; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += ' if (' + ($coerced) + ' === undefined) { '; + $bracesCoercion += '}'; + } + if (it.opts.coerceTypes == 'array' && $type != 'array') { + out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; + } + if ($type == 'string') { + out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } } '; + } + } + var $refKeywords; + if (it.schema.$ref && ($refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'))) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs == 'ignore') { + $refKeywords = false; + console.log('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } else if (it.opts.extendRefs !== true) { + console.log('$ref: all keywords used in schema at path "' + it.errSchemaPath + '". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour'); + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + } + if (it.opts.useDefaults && !it.compositeRule) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + out += ' ' + ($rule.code(it, $rule.keyword)) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type) { + var $typeChecked = true; + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($typeSchema && !$typeChecked && !(it.opts.coerceTypes && $coerceToTypes)) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' }'; + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return true; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }); return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + out = it.util.cleanUpCode(out); + if ($top && $breakOnError) { + out = it.util.cleanUpVarErrors(out, $async); + } + + function $shouldUseGroup($rulesGroup) { + for (var i = 0; i < $rulesGroup.rules.length; i++) + if ($shouldUseRule($rulesGroup.rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.keyword == 'properties' && (it.schema.additionalProperties === false || typeof it.schema.additionalProperties == 'object' || (it.schema.patternProperties && Object.keys(it.schema.patternProperties).length) || (it.opts.v5 && it.schema.patternGroups && Object.keys(it.schema.patternGroups).length))); + } + return out; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/keyword.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/keyword.js new file mode 100644 index 0000000000..1c9cccfe63 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/lib/keyword.js @@ -0,0 +1,129 @@ +'use strict'; + +var IDENTIFIER = /^[a-z_$][a-z0-9_$\-]*$/i; +var customRuleCode = require('./dotjs/custom'); + +module.exports = { + add: addKeyword, + get: getKeyword, + remove: removeKeyword +}; + +/** + * Define custom keyword + * @this Ajv + * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). + * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. + */ +function addKeyword(keyword, definition) { + /* jshint validthis: true */ + /* eslint no-shadow: 0 */ + var RULES = this.RULES; + + if (RULES.keywords[keyword]) + throw new Error('Keyword ' + keyword + ' is already defined'); + + if (!IDENTIFIER.test(keyword)) + throw new Error('Keyword ' + keyword + ' is not a valid identifier'); + + if (definition) { + if (definition.macro && definition.valid !== undefined) + throw new Error('"valid" option cannot be used with macro keywords'); + + var dataType = definition.type; + if (Array.isArray(dataType)) { + var i, len = dataType.length; + for (i=0; i [1, 2, 3] +}).catch(onerror); + +// errors can be try/catched +co(function *(){ + try { + yield Promise.reject(new Error('boom')); + } catch (err) { + console.error(err.message); // "boom" + } +}).catch(onerror); + +function onerror(err) { + // log any uncaught errors + // co will not throw any errors you do not handle!!! + // HANDLE ALL YOUR ERRORS!!! + console.error(err.stack); +} +``` + +## Yieldables + + The `yieldable` objects currently supported are: + + - promises + - thunks (functions) + - array (parallel execution) + - objects (parallel execution) + - generators (delegation) + - generator functions (delegation) + +Nested `yieldable` objects are supported, meaning you can nest +promises within objects within arrays, and so on! + +### Promises + +[Read more on promises!](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) + +### Thunks + +Thunks are functions that only have a single argument, a callback. +Thunk support only remains for backwards compatibility and may +be removed in future versions of `co`. + +### Arrays + +`yield`ing an array will resolve all the `yieldables` in parallel. + +```js +co(function* () { + var res = yield [ + Promise.resolve(1), + Promise.resolve(2), + Promise.resolve(3), + ]; + console.log(res); // => [1, 2, 3] +}).catch(onerror); +``` + +### Objects + +Just like arrays, objects resolve all `yieldable`s in parallel. + +```js +co(function* () { + var res = yield { + 1: Promise.resolve(1), + 2: Promise.resolve(2), + }; + console.log(res); // => { 1: 1, 2: 2 } +}).catch(onerror); +``` + +### Generators and Generator Functions + +Any generator or generator function you can pass into `co` +can be yielded as well. This should generally be avoided +as we should be moving towards spec-compliant `Promise`s instead. + +## API + +### co(fn*).then( val => ) + +Returns a promise that resolves a generator, generator function, +or any function that returns a generator. + +```js +co(function* () { + return yield Promise.resolve(true); +}).then(function (val) { + console.log(val); +}, function (err) { + console.error(err.stack); +}); +``` + +### var fn = co.wrap(fn*) + +Convert a generator into a regular function that returns a `Promise`. + +```js +var fn = co.wrap(function* (val) { + return yield Promise.resolve(val); +}); + +fn(true).then(function (val) { + +}); +``` + +## License + + MIT + +[npm-image]: https://img.shields.io/npm/v/co.svg?style=flat-square +[npm-url]: https://npmjs.org/package/co +[travis-image]: https://img.shields.io/travis/tj/co.svg?style=flat-square +[travis-url]: https://travis-ci.org/tj/co +[coveralls-image]: https://img.shields.io/coveralls/tj/co.svg?style=flat-square +[coveralls-url]: https://coveralls.io/r/tj/co +[downloads-image]: http://img.shields.io/npm/dm/co.svg?style=flat-square +[downloads-url]: https://npmjs.org/package/co +[gitter-image]: https://badges.gitter.im/Join%20Chat.svg +[gitter-url]: https://gitter.im/tj/co?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/index.js new file mode 100644 index 0000000000..87ba8ba8b4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/index.js @@ -0,0 +1,237 @@ + +/** + * slice() reference. + */ + +var slice = Array.prototype.slice; + +/** + * Expose `co`. + */ + +module.exports = co['default'] = co.co = co; + +/** + * Wrap the given generator `fn` into a + * function that returns a promise. + * This is a separate function so that + * every `co()` call doesn't create a new, + * unnecessary closure. + * + * @param {GeneratorFunction} fn + * @return {Function} + * @api public + */ + +co.wrap = function (fn) { + createPromise.__generatorFunction__ = fn; + return createPromise; + function createPromise() { + return co.call(this, fn.apply(this, arguments)); + } +}; + +/** + * Execute the generator function or a generator + * and return a promise. + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +function co(gen) { + var ctx = this; + var args = slice.call(arguments, 1) + + // we wrap everything in a promise to avoid promise chaining, + // which leads to memory leak errors. + // see https://github.com/tj/co/issues/180 + return new Promise(function(resolve, reject) { + if (typeof gen === 'function') gen = gen.apply(ctx, args); + if (!gen || typeof gen.next !== 'function') return resolve(gen); + + onFulfilled(); + + /** + * @param {Mixed} res + * @return {Promise} + * @api private + */ + + function onFulfilled(res) { + var ret; + try { + ret = gen.next(res); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * @param {Error} err + * @return {Promise} + * @api private + */ + + function onRejected(err) { + var ret; + try { + ret = gen.throw(err); + } catch (e) { + return reject(e); + } + next(ret); + } + + /** + * Get the next value in the generator, + * return a promise. + * + * @param {Object} ret + * @return {Promise} + * @api private + */ + + function next(ret) { + if (ret.done) return resolve(ret.value); + var value = toPromise.call(ctx, ret.value); + if (value && isPromise(value)) return value.then(onFulfilled, onRejected); + return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, ' + + 'but the following object was passed: "' + String(ret.value) + '"')); + } + }); +} + +/** + * Convert a `yield`ed value into a promise. + * + * @param {Mixed} obj + * @return {Promise} + * @api private + */ + +function toPromise(obj) { + if (!obj) return obj; + if (isPromise(obj)) return obj; + if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj); + if ('function' == typeof obj) return thunkToPromise.call(this, obj); + if (Array.isArray(obj)) return arrayToPromise.call(this, obj); + if (isObject(obj)) return objectToPromise.call(this, obj); + return obj; +} + +/** + * Convert a thunk to a promise. + * + * @param {Function} + * @return {Promise} + * @api private + */ + +function thunkToPromise(fn) { + var ctx = this; + return new Promise(function (resolve, reject) { + fn.call(ctx, function (err, res) { + if (err) return reject(err); + if (arguments.length > 2) res = slice.call(arguments, 1); + resolve(res); + }); + }); +} + +/** + * Convert an array of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Array} obj + * @return {Promise} + * @api private + */ + +function arrayToPromise(obj) { + return Promise.all(obj.map(toPromise, this)); +} + +/** + * Convert an object of "yieldables" to a promise. + * Uses `Promise.all()` internally. + * + * @param {Object} obj + * @return {Promise} + * @api private + */ + +function objectToPromise(obj){ + var results = new obj.constructor(); + var keys = Object.keys(obj); + var promises = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var promise = toPromise.call(this, obj[key]); + if (promise && isPromise(promise)) defer(promise, key); + else results[key] = obj[key]; + } + return Promise.all(promises).then(function () { + return results; + }); + + function defer(promise, key) { + // predefine the key in the result + results[key] = undefined; + promises.push(promise.then(function (res) { + results[key] = res; + })); + } +} + +/** + * Check if `obj` is a promise. + * + * @param {Object} obj + * @return {Boolean} + * @api private + */ + +function isPromise(obj) { + return 'function' == typeof obj.then; +} + +/** + * Check if `obj` is a generator. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ + +function isGenerator(obj) { + return 'function' == typeof obj.next && 'function' == typeof obj.throw; +} + +/** + * Check if `obj` is a generator function. + * + * @param {Mixed} obj + * @return {Boolean} + * @api private + */ +function isGeneratorFunction(obj) { + var constructor = obj.constructor; + if (!constructor) return false; + if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; + return isGenerator(constructor.prototype); +} + +/** + * Check for plain object. + * + * @param {Mixed} val + * @return {Boolean} + * @api private + */ + +function isObject(val) { + return Object == val.constructor; +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/package.json new file mode 100644 index 0000000000..7453b8bb36 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/co/package.json @@ -0,0 +1,106 @@ +{ + "_args": [ + [ + { + "raw": "co@^4.6.0", + "scope": null, + "escapedName": "co", + "name": "co", + "rawSpec": "^4.6.0", + "spec": ">=4.6.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator/node_modules/ajv" + ] + ], + "_from": "co@>=4.6.0 <5.0.0", + "_id": "co@4.6.0", + "_inCache": true, + "_location": "/request/har-validator/ajv/co", + "_nodeVersion": "2.3.3", + "_npmUser": { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "co@^4.6.0", + "scope": null, + "escapedName": "co", + "name": "co", + "rawSpec": "^4.6.0", + "spec": ">=4.6.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/ajv" + ], + "_resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "_shasum": "6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184", + "_shrinkwrap": null, + "_spec": "co@^4.6.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator/node_modules/ajv", + "bugs": { + "url": "https://github.com/tj/co/issues" + }, + "dependencies": {}, + "description": "generator async control flow goodness", + "devDependencies": { + "browserify": "^10.0.0", + "istanbul-harmony": "0", + "mocha": "^2.0.0", + "mz": "^1.0.2" + }, + "directories": {}, + "dist": { + "shasum": "6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184", + "tarball": "https://registry.npmjs.org/co/-/co-4.6.0.tgz" + }, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + }, + "files": [ + "index.js" + ], + "gitHead": "b54d18f8f472ad1314800e786993c4169a5ff9f8", + "homepage": "https://github.com/tj/co#readme", + "keywords": [ + "async", + "flow", + "generator", + "coro", + "coroutine" + ], + "license": "MIT", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "jonathanong", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + } + ], + "name": "co", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tj/co.git" + }, + "scripts": { + "browserify": "browserify index.js -o ./co-browser.js -s co", + "prepublish": "npm run browserify", + "test": "mocha --harmony", + "test-cov": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter dot", + "test-travis": "node --harmony node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- --reporter dot" + }, + "version": "4.6.0" +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.npmignore b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.npmignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.travis.yml b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.travis.yml new file mode 100644 index 0000000000..cc4dba29d9 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - "0.8" + - "0.10" diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/LICENSE b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/LICENSE new file mode 100644 index 0000000000..ee27ba4b44 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/key_cmp.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/key_cmp.js new file mode 100644 index 0000000000..d5f66752d8 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/key_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/nested.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/nested.js new file mode 100644 index 0000000000..9a672fc65f --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/nested.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/str.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/str.js new file mode 100644 index 0000000000..9b4b3cd289 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/str.js @@ -0,0 +1,3 @@ +var stringify = require('../'); +var obj = { c: 6, b: [4,5], a: 3 }; +console.log(stringify(obj)); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/value_cmp.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/value_cmp.js new file mode 100644 index 0000000000..09f1c5f79b --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/example/value_cmp.js @@ -0,0 +1,7 @@ +var stringify = require('../'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/index.js new file mode 100644 index 0000000000..6a4131d44e --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/index.js @@ -0,0 +1,84 @@ +var json = typeof JSON !== 'undefined' ? JSON : require('jsonify'); + +module.exports = function (obj, opts) { + if (!opts) opts = {}; + if (typeof opts === 'function') opts = { cmp: opts }; + var space = opts.space || ''; + if (typeof space === 'number') space = Array(space+1).join(' '); + var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false; + var replacer = opts.replacer || function(key, value) { return value; }; + + var cmp = opts.cmp && (function (f) { + return function (node) { + return function (a, b) { + var aobj = { key: a, value: node[a] }; + var bobj = { key: b, value: node[b] }; + return f(aobj, bobj); + }; + }; + })(opts.cmp); + + var seen = []; + return (function stringify (parent, key, node, level) { + var indent = space ? ('\n' + new Array(level + 1).join(space)) : ''; + var colonSeparator = space ? ': ' : ':'; + + if (node && node.toJSON && typeof node.toJSON === 'function') { + node = node.toJSON(); + } + + node = replacer.call(parent, key, node); + + if (node === undefined) { + return; + } + if (typeof node !== 'object' || node === null) { + return json.stringify(node); + } + if (isArray(node)) { + var out = []; + for (var i = 0; i < node.length; i++) { + var item = stringify(node, i, node[i], level+1) || json.stringify(null); + out.push(indent + space + item); + } + return '[' + out.join(',') + indent + ']'; + } + else { + if (seen.indexOf(node) !== -1) { + if (cycles) return json.stringify('__cycle__'); + throw new TypeError('Converting circular structure to JSON'); + } + else seen.push(node); + + var keys = objectKeys(node).sort(cmp && cmp(node)); + var out = []; + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = stringify(node, key, node[key], level+1); + + if(!value) continue; + + var keyValue = json.stringify(key) + + colonSeparator + + value; + ; + out.push(indent + space + keyValue); + } + seen.splice(seen.indexOf(node), 1); + return '{' + out.join(',') + indent + '}'; + } + })({ '': obj }, '', obj, 0); +}; + +var isArray = Array.isArray || function (x) { + return {}.toString.call(x) === '[object Array]'; +}; + +var objectKeys = Object.keys || function (obj) { + var has = Object.prototype.hasOwnProperty || function () { return true }; + var keys = []; + for (var key in obj) { + if (has.call(obj, key)) keys.push(key); + } + return keys; +}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/README.markdown b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/README.markdown new file mode 100644 index 0000000000..71d9a93b59 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/README.markdown @@ -0,0 +1,34 @@ +jsonify +======= + +This module provides Douglas Crockford's JSON implementation without modifying +any globals. + +`stringify` and `parse` are merely exported without respect to whether or not a +global `JSON` object exists. + +methods +======= + +var json = require('jsonify'); + +json.parse(source, reviver) +--------------------------- + +Return a new javascript object from a parse of the `source` string. + +If a `reviver` function is specified, walk the structure passing each name/value +pair to `reviver.call(parent, key, value)` to transform the `value` before +parsing it. + +json.stringify(value, replacer, space) +-------------------------------------- + +Return a string representation for `value`. + +If `replacer` is specified, walk the structure passing each name/value pair to +`replacer.call(parent, key, value)` to transform the `value` before stringifying +it. + +If `space` is a number, indent the result by that many spaces. +If `space` is a string, use `space` as the indentation. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/index.js new file mode 100644 index 0000000000..f728a1605a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/index.js @@ -0,0 +1,2 @@ +exports.parse = require('./lib/parse'); +exports.stringify = require('./lib/stringify'); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/parse.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/parse.js new file mode 100644 index 0000000000..2b88cfff0b --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/parse.js @@ -0,0 +1,273 @@ +var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + // Call error when something is wrong. + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + // If a c parameter is provided, verify that it matches the current character. + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + + // Get the next character. When there are no more characters, + // return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { + // Parse a number value. + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + return number; + } + }, + + string = function () { + // Parse a string value. + var hex, + i, + string = '', + uffff; + + // When parsing for string values, we must look for " and \ characters. + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } else if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + +value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } +}; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + +module.exports = function (source, reviver) { + var result; + + text = source; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + + // If there is a reviver function, we recursively walk the new structure, + // passing each name/value pair to the reviver function for possible + // transformation, starting with a temporary root object that holds the result + // in an empty key. If there is not a reviver function, we simply return the + // result. + + return typeof reviver === 'function' ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + }({'': result}, '')) : result; +}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/stringify.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/stringify.js new file mode 100644 index 0000000000..e88fb83406 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/lib/stringify.js @@ -0,0 +1,154 @@ +var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + +function quote(string) { + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; +} + +function str(key, holder) { + // Produce a string from holder[key]. + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + // JSON numbers must be finite. Encode non-finite numbers as null. + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + return String(value); + + case 'object': + if (!value) return 'null'; + gap += indent; + partial = []; + + // Array.isArray + if (Object.prototype.toString.apply(value) === '[object Array]') { + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and + // wrap them in brackets. + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be + // stringified. + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + k = rep[i]; + if (typeof k === 'string') { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + else { + // Otherwise, iterate through all of the keys in the object. + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } +} + +module.exports = function (value, replacer, space) { + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + } + // If the space parameter is a string, it will be used as the indent string. + else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + rep = replacer; + if (replacer && typeof replacer !== 'function' + && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + return str('', {'': value}); +}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/package.json new file mode 100644 index 0000000000..3811adb867 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + { + "raw": "jsonify@~0.0.0", + "scope": null, + "escapedName": "jsonify", + "name": "jsonify", + "rawSpec": "~0.0.0", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify" + ] + ], + "_defaultsLoaded": true, + "_engineSupported": true, + "_from": "jsonify@>=0.0.0 <0.1.0", + "_id": "jsonify@0.0.0", + "_inCache": true, + "_location": "/request/har-validator/ajv/json-stable-stringify/jsonify", + "_nodeVersion": "v0.5.0-pre", + "_npmVersion": "1.0.10", + "_phantomChildren": {}, + "_requested": { + "raw": "jsonify@~0.0.0", + "scope": null, + "escapedName": "jsonify", + "name": "jsonify", + "rawSpec": "~0.0.0", + "spec": ">=0.0.0 <0.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/ajv/json-stable-stringify" + ], + "_resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "_shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", + "_shrinkwrap": null, + "_spec": "jsonify@~0.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify", + "author": { + "name": "Douglas Crockford", + "url": "http://crockford.com/" + }, + "bugs": { + "url": "https://github.com/substack/jsonify/issues" + }, + "dependencies": {}, + "description": "JSON without touching any globals", + "devDependencies": { + "garbage": "0.0.x", + "tap": "0.0.x" + }, + "directories": { + "lib": ".", + "test": "test" + }, + "dist": { + "shasum": "2c74b6ee41d93ca51b7b5aaee8f503631d252a73", + "tarball": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz" + }, + "engines": { + "node": "*" + }, + "homepage": "https://github.com/substack/jsonify#readme", + "keywords": [ + "json", + "browser" + ], + "license": "Public Domain", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "jsonify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/jsonify.git" + }, + "scripts": { + "test": "tap test" + }, + "version": "0.0.0" +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/parse.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/parse.js new file mode 100644 index 0000000000..d23de157e1 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/parse.js @@ -0,0 +1,16 @@ +var test = require('tap').test; +var json = require('../'); +var garbage = require('garbage'); + +test('parse', function (t) { + for (var i = 0; i < 50; i++) { + var s = JSON.stringify(garbage(50)); + + t.deepEqual( + json.parse(s), + JSON.parse(s) + ); + } + + t.end(); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/stringify.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/stringify.js new file mode 100644 index 0000000000..72de91f2b6 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/node_modules/jsonify/test/stringify.js @@ -0,0 +1,15 @@ +var test = require('tap').test; +var json = require('../'); +var garbage = require('garbage'); + +test('stringify', function (t) { + for (var i = 0; i < 50; i++) { + var obj = garbage(50); + t.equal( + json.stringify(obj), + JSON.stringify(obj) + ); + } + + t.end(); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/package.json new file mode 100644 index 0000000000..6f5ce72496 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/package.json @@ -0,0 +1,109 @@ +{ + "_args": [ + [ + { + "raw": "json-stable-stringify@^1.0.1", + "scope": null, + "escapedName": "json-stable-stringify", + "name": "json-stable-stringify", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator/node_modules/ajv" + ] + ], + "_from": "json-stable-stringify@>=1.0.1 <2.0.0", + "_id": "json-stable-stringify@1.0.1", + "_inCache": true, + "_location": "/request/har-validator/ajv/json-stable-stringify", + "_nodeVersion": "4.2.1", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/json-stable-stringify-1.0.1.tgz_1454436356521_0.9410459187347442" + }, + "_npmUser": { + "name": "substack", + "email": "substack@gmail.com" + }, + "_npmVersion": "3.4.1", + "_phantomChildren": {}, + "_requested": { + "raw": "json-stable-stringify@^1.0.1", + "scope": null, + "escapedName": "json-stable-stringify", + "name": "json-stable-stringify", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/ajv" + ], + "_resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "_shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", + "_shrinkwrap": null, + "_spec": "json-stable-stringify@^1.0.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator/node_modules/ajv", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/json-stable-stringify/issues" + }, + "dependencies": { + "jsonify": "~0.0.0" + }, + "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results", + "devDependencies": { + "tape": "~1.0.4" + }, + "directories": {}, + "dist": { + "shasum": "9a759d39c5f2ff503fd5300646ed445f88c4f9af", + "tarball": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz" + }, + "gitHead": "4a3ac9cc006a91e64901f8ebe78d23bf9fc9fbd0", + "homepage": "https://github.com/substack/json-stable-stringify", + "keywords": [ + "json", + "stringify", + "deterministic", + "hash", + "sort", + "stable" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "json-stable-stringify", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/json-stable-stringify.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "ff/5", + "ff/latest", + "chrome/15", + "chrome/latest", + "safari/latest", + "opera/latest" + ] + }, + "version": "1.0.1" +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/readme.markdown b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/readme.markdown new file mode 100644 index 0000000000..406c3c7261 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/readme.markdown @@ -0,0 +1,130 @@ +# json-stable-stringify + +deterministic version of `JSON.stringify()` so you can get a consistent hash +from stringified results + +You can also pass in a custom comparison function. + +[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify) + +[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify) + +# example + +``` js +var stringify = require('json-stable-stringify'); +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +console.log(stringify(obj)); +``` + +output: + +``` +{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8} +``` + +# methods + +``` js +var stringify = require('json-stable-stringify') +``` + +## var str = stringify(obj, opts) + +Return a deterministic stringified string `str` from the object `obj`. + +## options + +### cmp + +If `opts` is given, you can supply an `opts.cmp` to have a custom comparison +function for object keys. Your function `opts.cmp` is called with these +parameters: + +``` js +opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue }) +``` + +For example, to sort on the object key names in reverse order you could write: + +``` js +var stringify = require('json-stable-stringify'); + +var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; +var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; +}); +console.log(s); +``` + +which results in the output string: + +``` +{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3} +``` + +Or if you wanted to sort on the object values in reverse order, you could write: + +``` +var stringify = require('json-stable-stringify'); + +var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 }; +var s = stringify(obj, function (a, b) { + return a.value < b.value ? 1 : -1; +}); +console.log(s); +``` + +which outputs: + +``` +{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10} +``` + +### space + +If you specify `opts.space`, it will indent the output for pretty-printing. +Valid values are strings (e.g. `{space: \t}`) or a number of spaces +(`{space: 3}`). + +For example: + +```js +var obj = { b: 1, a: { foo: 'bar', and: [1, 2, 3] } }; +var s = stringify(obj, { space: ' ' }); +console.log(s); +``` + +which outputs: + +``` +{ + "a": { + "and": [ + 1, + 2, + 3 + ], + "foo": "bar" + }, + "b": 1 +} +``` + +### replacer + +The replacer parameter is a function `opts.replacer(key, value)` that behaves +the same as the replacer +[from the core JSON object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter). + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install json-stable-stringify +``` + +# license + +MIT diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js new file mode 100644 index 0000000000..2dbb39355c --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js @@ -0,0 +1,11 @@ +var test = require('tape'); +var stringify = require('../'); + +test('custom comparison function', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + var s = stringify(obj, function (a, b) { + return a.key < b.key ? 1 : -1; + }); + t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}'); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/nested.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/nested.js new file mode 100644 index 0000000000..e7f5a0e65b --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/nested.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var stringify = require('../'); + +test('nested', function (t) { + t.plan(1); + var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 }; + t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}'); +}); + +test('cyclic (default)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + try { + stringify(one); + } catch (ex) { + t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON'); + } +}); + +test('cyclic (specifically allowed)', function (t) { + t.plan(1); + var one = { a: 1 }; + var two = { a: 2, one: one }; + one.two = two; + t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}'); +}); + +test('repeated non-cyclic value', function(t) { + t.plan(1); + var one = { x: 1 }; + var two = { a: one, b: one }; + t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}'); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/replacer.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/replacer.js new file mode 100644 index 0000000000..98802a72d6 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/replacer.js @@ -0,0 +1,74 @@ +var test = require('tape'); +var stringify = require('../'); + +test('replace root', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { return 'one'; }; + + t.equal(stringify(obj, { replacer: replacer }), '"one"'); +}); + +test('replace numbers', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(value === 1) return 'one'; + if(value === 2) return 'two'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":false}'); +}); + +test('replace with object', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(key === 'b') return { d: 1 }; + if(value === 1) return 'one'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":{"d":"one"},"c":false}'); +}); + +test('replace with undefined', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(value === false) return; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":2}'); +}); + +test('replace with array', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: false }; + var replacer = function(key, value) { + if(key === 'b') return ['one', 'two']; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":["one","two"],"c":false}'); +}); + +test('replace array item', function (t) { + t.plan(1); + + var obj = { a: 1, b: 2, c: [1,2] }; + var replacer = function(key, value) { + if(value === 1) return 'one'; + if(value === 2) return 'two'; + return value; + }; + + t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":["one","two"]}'); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/space.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/space.js new file mode 100644 index 0000000000..2621122ae3 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/space.js @@ -0,0 +1,59 @@ +var test = require('tape'); +var stringify = require('../'); + +test('space parameter', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: ' '}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": 2\n' + + '}' + ); +}); + +test('space parameter (with tabs)', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: '\t'}), '' + + '{\n' + + '\t"one": 1,\n' + + '\t"two": 2\n' + + '}' + ); +}); + +test('space parameter (with a number)', function (t) { + t.plan(1); + var obj = { one: 1, two: 2 }; + t.equal(stringify(obj, {space: 3}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": 2\n' + + '}' + ); +}); + +test('space parameter (nested objects)', function (t) { + t.plan(1); + var obj = { one: 1, two: { b: 4, a: [2,3] } }; + t.equal(stringify(obj, {space: ' '}), '' + + '{\n' + + ' "one": 1,\n' + + ' "two": {\n' + + ' "a": [\n' + + ' 2,\n' + + ' 3\n' + + ' ],\n' + + ' "b": 4\n' + + ' }\n' + + '}' + ); +}); + +test('space parameter (same as native)', function (t) { + t.plan(1); + // for this test, properties need to be in alphabetical order + var obj = { one: 1, two: { a: [2,3], b: 4 } }; + t.equal(stringify(obj, {space: ' '}), JSON.stringify(obj, null, ' ')); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/str.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/str.js new file mode 100644 index 0000000000..67426b99e3 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/str.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var stringify = require('../'); + +test('simple object', function (t) { + t.plan(1); + var obj = { c: 6, b: [4,5], a: 3, z: null }; + t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}'); +}); + +test('object with undefined', function (t) { + t.plan(1); + var obj = { a: 3, z: undefined }; + t.equal(stringify(obj), '{"a":3}'); +}); + +test('array with undefined', function (t) { + t.plan(1); + var obj = [4, undefined, 6]; + t.equal(stringify(obj), '[4,null,6]'); +}); + +test('object with empty string', function (t) { + t.plan(1); + var obj = { a: 3, z: '' }; + t.equal(stringify(obj), '{"a":3,"z":""}'); +}); + +test('array with empty string', function (t) { + t.plan(1); + var obj = [4, '', 6]; + t.equal(stringify(obj), '[4,"",6]'); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/to-json.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/to-json.js new file mode 100644 index 0000000000..ef9a980929 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/to-json.js @@ -0,0 +1,20 @@ +var test = require('tape'); +var stringify = require('../'); + +test('toJSON function', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } }; + t.equal(stringify(obj), '{"one":1}' ); +}); + +test('toJSON returns string', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } }; + t.equal(stringify(obj), '"one"'); +}); + +test('toJSON returns array', function (t) { + t.plan(1); + var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } }; + t.equal(stringify(obj), '["one"]'); +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/package.json new file mode 100644 index 0000000000..a860a09779 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/package.json @@ -0,0 +1,166 @@ +{ + "_args": [ + [ + { + "raw": "ajv@^4.9.1", + "scope": null, + "escapedName": "ajv", + "name": "ajv", + "rawSpec": "^4.9.1", + "spec": ">=4.9.1 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator" + ] + ], + "_from": "ajv@>=4.9.1 <5.0.0", + "_id": "ajv@4.11.4", + "_inCache": true, + "_location": "/request/har-validator/ajv", + "_nodeVersion": "4.6.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ajv-4.11.4.tgz_1488652451968_0.44489557039923966" + }, + "_npmUser": { + "name": "esp", + "email": "e.poberezkin@me.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "ajv@^4.9.1", + "scope": null, + "escapedName": "ajv", + "name": "ajv", + "rawSpec": "^4.9.1", + "spec": ">=4.9.1 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator" + ], + "_resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.4.tgz", + "_shasum": "ebf3a55d4b132ea60ff5847ae85d2ef069960b45", + "_shrinkwrap": null, + "_spec": "ajv@^4.9.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/request/node_modules/har-validator", + "author": { + "name": "Evgeny Poberezkin" + }, + "bugs": { + "url": "https://github.com/epoberezkin/ajv/issues" + }, + "dependencies": { + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" + }, + "description": "Another JSON Schema Validator", + "devDependencies": { + "bluebird": "^3.1.5", + "brfs": "^1.4.3", + "browserify": "^14.1.0", + "chai": "^3.5.0", + "coveralls": "^2.11.4", + "dot": "^1.0.3", + "eslint": "^3.2.2", + "gh-pages-generator": "^0.2.0", + "glob": "^7.0.0", + "if-node-version": "^1.0.0", + "js-beautify": "^1.5.6", + "jshint": "^2.8.0", + "json-schema-test": "^1.1.1", + "karma": "^1.0.0", + "karma-chrome-launcher": "^2.0.0", + "karma-mocha": "^1.1.1", + "karma-phantomjs-launcher": "^1.0.0", + "karma-sauce-launcher": "^1.1.0", + "mocha": "^3.0.0", + "nodent": "^3.0.2", + "nyc": "^10.0.0", + "phantomjs-prebuilt": "^2.1.4", + "pre-commit": "^1.1.1", + "regenerator": "0.9.5", + "require-globify": "^1.3.0", + "typescript": "^2.0.3", + "uglify-js": "^2.6.1", + "watch": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "ebf3a55d4b132ea60ff5847ae85d2ef069960b45", + "tarball": "https://registry.npmjs.org/ajv/-/ajv-4.11.4.tgz" + }, + "files": [ + "lib/", + "dist/", + "scripts/", + "LICENSE", + ".tonic_example.js" + ], + "gitHead": "3760c359455ba33b66b4427d17cb655d039bc550", + "homepage": "https://github.com/epoberezkin/ajv", + "keywords": [ + "JSON", + "schema", + "validator", + "validation", + "jsonschema", + "json-schema", + "json-schema-validator", + "json-schema-validation" + ], + "license": "MIT", + "main": "lib/ajv.js", + "maintainers": [ + { + "name": "blakeembrey", + "email": "hello@blakeembrey.com" + }, + { + "name": "esp", + "email": "e.poberezkin@me.com" + } + ], + "name": "ajv", + "nyc": { + "exclude": [ + "**/spec/**", + "node_modules" + ], + "reporter": [ + "lcov", + "text-summary" + ] + }, + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/epoberezkin/ajv.git" + }, + "scripts": { + "build": "rm -f lib/dotjs/*.js && node scripts/compile-dots.js", + "bundle": "./scripts/bundle . Ajv pure_getters", + "bundle-all": "rm -rf dist && npm run bundle && npm run bundle-regenerator && npm run bundle-nodent", + "bundle-beautify": "./scripts/bundle js-beautify", + "bundle-nodent": "./scripts/bundle nodent", + "bundle-regenerator": "./scripts/bundle regenerator", + "eslint": "if-node-version '>=4' eslint lib/*.js lib/compile/*.js spec", + "jshint": "jshint lib/*.js lib/**/*.js --exclude lib/dotjs/**/*", + "prepublish": "npm run build && npm run bundle-all", + "test": "npm run jshint && npm run eslint && npm run test-ts && npm run build && npm run test-cov && npm run test-browser", + "test-browser": "rm -rf .browser && npm run bundle-all && scripts/prepare-tests && npm run test-karma", + "test-cov": "nyc npm run test-spec", + "test-debug": "mocha spec/*.spec.js --debug-brk -R spec", + "test-fast": "AJV_FAST_TEST=true npm run test-spec", + "test-karma": "karma start --single-run --browsers PhantomJS", + "test-spec": "mocha spec/*.spec.js -R spec", + "test-ts": "tsc --target ES5 --noImplicitAny lib/ajv.d.ts", + "watch": "watch 'npm run build' ./lib/dot" + }, + "tonicExampleFilename": ".tonic_example.js", + "typings": "lib/ajv.d.ts", + "version": "4.11.4", + "webpack": "dist/ajv.bundle.js" +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/bundle b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/bundle new file mode 100755 index 0000000000..ffb57a06be --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/bundle @@ -0,0 +1,33 @@ +#!/usr/bin/env sh + +set -e + +package=$1 +standalone=$2 +compress=$3 + +name=$(./scripts/info $package name) +main=$(./scripts/info $package main) +version=$(./scripts/info $package version) +description=$(./scripts/info $package description) + +if [ "$package" != "." ]; then + package="./node_modules/$package" +fi + +mkdir -p dist + +browserify -r "$package/$main:$name" \ + -o "dist/$name.bundle.js" \ + $([ -n "$standalone" ] && echo "-s $standalone") + +uglifyjs dist/$name.bundle.js \ + -o dist/$name.min.js \ + -c $compress \ + -m \ + $([ -n "$standalone" ] && echo "--source-map dist/$name.min.js.map -r $standalone") \ + --preamble "/* $name $version: $description */" + +if [ -z "$standalone" ]; then + rm dist/$name.bundle.js +fi diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/compile-dots.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/compile-dots.js new file mode 100644 index 0000000000..7150bebfa7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/compile-dots.js @@ -0,0 +1,56 @@ +//compile doT templates to js functions + +var glob = require('glob') + , fs = require('fs') + , path = require('path') + , doT = require('dot') + , beautify = require('js-beautify').js_beautify; + +var defsRootPath = process.argv[2] || path.join(__dirname, '../lib'); + +var defs = {}; +var defFiles = glob.sync('./dot/**/*.def', { cwd: defsRootPath }); +defFiles.forEach(function (f) { + var name = path.basename(f, '.def'); + defs[name] = fs.readFileSync(path.join(defsRootPath, f)); +}); + +var filesRootPath = process.argv[3] || path.join(__dirname, '../lib'); +var files = glob.sync('./dot/**/*.jst', { cwd: filesRootPath }); + +var dotjsPath = path.join(filesRootPath, './dotjs'); +try { fs.mkdirSync(dotjsPath); } catch(e) {} + +console.log('\n\nCompiling:'); + +var FUNCTION_NAME = /function\s+anonymous\s*\(it[^)]*\)\s*{/; +var OUT_EMPTY_STRING = /out\s*\+=\s*'\s*';/g; +var ISTANBUL = /\'(istanbul[^']+)\';/g; +var VARS = ['$errs', '$valid', '$lvl', '$data', '$dataLvl', + '$errorKeyword', '$closingBraces', '$schemaPath']; + +files.forEach(function (f) { + var keyword = path.basename(f, '.jst'); + var targetPath = path.join(dotjsPath, keyword + '.js'); + var template = fs.readFileSync(path.join(filesRootPath, f)); + var code = doT.compile(template, defs); + code = code.toString() + .replace(OUT_EMPTY_STRING, '') + .replace(FUNCTION_NAME, 'function generate_' + keyword + '(it, $keyword) {') + .replace(ISTANBUL, '/* $1 */'); + VARS.forEach(removeUnusedVar); + code = "'use strict';\nmodule.exports = " + code; + code = beautify(code, { indent_size: 2 }) + '\n'; + fs.writeFileSync(targetPath, code); + console.log('compiled', keyword); + + function removeUnusedVar(v) { + v = v.replace(/\$/g, '\\$$'); + var regexp = new RegExp(v + '[^A-Za-z0-9_$]', 'g'); + var count = (code.match(regexp) || []).length; + if (count == 1) { + regexp = new RegExp('var\\s+' + v + '\\s*=[^;]+;|var\\s+' + v + ';'); + code = code.replace(regexp, ''); + } + } +}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/info b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/info new file mode 100755 index 0000000000..77269ab5fa --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/info @@ -0,0 +1,10 @@ +#!/usr/bin/env node + +'use strict'; + +var fs = require('fs'); +var name = process.argv[2] || '.'; +var property = process.argv[3] || 'version'; +if (name != '.') name = 'node_modules/' + name; +var json = JSON.parse(fs.readFileSync(name + '/package.json', 'utf8')); +console.log(json[property]); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/prepare-tests b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/prepare-tests new file mode 100755 index 0000000000..6f62634e23 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/prepare-tests @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +set -e + +mkdir -p .browser + +find spec -type f -name '*.spec.js' | \ +xargs -I {} sh -c \ +'export f="{}"; browserify $f -t require-globify -t brfs -x ajv -u buffer -o $(echo $f | sed -e "s/spec/.browser/");' diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/travis-gh-pages b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/travis-gh-pages new file mode 100755 index 0000000000..ac8b8f5442 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/scripts/travis-gh-pages @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then + git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$' && { + rm -rf ../gh-pages + git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/epoberezkin/ajv.git ../gh-pages + mkdir -p ../gh-pages/_source + cp *.md ../gh-pages/_source + cp LICENSE ../gh-pages/_source + currentDir=$(pwd) + cd ../gh-pages + $currentDir/node_modules/.bin/gh-pages-generator + git config user.email "$GIT_USER_EMAIL" + git config user.name "$GIT_USER_NAME" + git add . + git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER" + git push --quiet origin gh-pages > /dev/null 2>&1 + } +fi diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js deleted file mode 100644 index 2d85a91747..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; -var escapeStringRegexp = require('escape-string-regexp'); -var ansiStyles = require('ansi-styles'); -var stripAnsi = require('strip-ansi'); -var hasAnsi = require('has-ansi'); -var supportsColor = require('supports-color'); -var defineProps = Object.defineProperties; -var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); - -function Chalk(options) { - // detect mode if not set manually - this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; -} - -// use bright blue on Windows as the normal blue color is illegible -if (isSimpleWindowsTerm) { - ansiStyles.blue.open = '\u001b[94m'; -} - -var styles = (function () { - var ret = {}; - - Object.keys(ansiStyles).forEach(function (key) { - ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); - - ret[key] = { - get: function () { - return build.call(this, this._styles.concat(key)); - } - }; - }); - - return ret; -})(); - -var proto = defineProps(function chalk() {}, styles); - -function build(_styles) { - var builder = function () { - return applyStyle.apply(builder, arguments); - }; - - builder._styles = _styles; - builder.enabled = this.enabled; - // __proto__ is used because we must return a function, but there is - // no way to create a function with a different prototype. - /* eslint-disable no-proto */ - builder.__proto__ = proto; - - return builder; -} - -function applyStyle() { - // support varags, but simply cast to string in case there's only one arg - var args = arguments; - var argsLen = args.length; - var str = argsLen !== 0 && String(arguments[0]); - - if (argsLen > 1) { - // don't slice `arguments`, it prevents v8 optimizations - for (var a = 1; a < argsLen; a++) { - str += ' ' + args[a]; - } - } - - if (!this.enabled || !str) { - return str; - } - - var nestedStyles = this._styles; - var i = nestedStyles.length; - - // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, - // see https://github.com/chalk/chalk/issues/58 - // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. - var originalDim = ansiStyles.dim.open; - if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { - ansiStyles.dim.open = ''; - } - - while (i--) { - var code = ansiStyles[nestedStyles[i]]; - - // Replace any instances already present with a re-opening code - // otherwise only the part of the string until said closing code - // will be colored, and the rest will simply be 'plain'. - str = code.open + str.replace(code.closeRe, code.open) + code.close; - } - - // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. - ansiStyles.dim.open = originalDim; - - return str; -} - -function init() { - var ret = {}; - - Object.keys(styles).forEach(function (name) { - ret[name] = { - get: function () { - return build.call(this, [name]); - } - }; - }); - - return ret; -} - -defineProps(Chalk.prototype, init()); - -module.exports = new Chalk(); -module.exports.styles = ansiStyles; -module.exports.hasColor = hasAnsi; -module.exports.stripColor = stripAnsi; -module.exports.supportsColor = supportsColor; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/license b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js deleted file mode 100644 index 78945278f7..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/index.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -function assembleStyles () { - var styles = { - modifiers: { - reset: [0, 0], - bold: [1, 22], // 21 isn't widely supported and 22 does the same thing - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - colors: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39] - }, - bgColors: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49] - } - }; - - // fix humans - styles.colors.grey = styles.colors.gray; - - Object.keys(styles).forEach(function (groupName) { - var group = styles[groupName]; - - Object.keys(group).forEach(function (styleName) { - var style = group[styleName]; - - styles[styleName] = group[styleName] = { - open: '\u001b[' + style[0] + 'm', - close: '\u001b[' + style[1] + 'm' - }; - }); - - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); - }); - - return styles; -} - -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json deleted file mode 100644 index cfca2b9295..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "ansi-styles@^2.2.1", - "scope": null, - "escapedName": "ansi-styles", - "name": "ansi-styles", - "rawSpec": "^2.2.1", - "spec": ">=2.2.1 <3.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" - ] - ], - "_from": "ansi-styles@>=2.2.1 <3.0.0", - "_id": "ansi-styles@2.2.1", - "_inCache": true, - "_installable": true, - "_location": "/request/har-validator/chalk/ansi-styles", - "_nodeVersion": "4.3.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" - }, - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "_npmVersion": "3.8.3", - "_phantomChildren": {}, - "_requested": { - "raw": "ansi-styles@^2.2.1", - "scope": null, - "escapedName": "ansi-styles", - "name": "ansi-styles", - "rawSpec": "^2.2.1", - "spec": ">=2.2.1 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/har-validator/chalk" - ], - "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", - "_shrinkwrap": null, - "_spec": "ansi-styles@^2.2.1", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-styles/issues" - }, - "dependencies": {}, - "description": "ANSI escape codes for styling strings in the terminal", - "devDependencies": { - "mocha": "*" - }, - "directories": {}, - "dist": { - "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", - "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "95c59b23be760108b6530ca1c89477c21b258032", - "homepage": "https://github.com/chalk/ansi-styles#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "name": "ansi-styles", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-styles.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.2.1" -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md deleted file mode 100644 index 3f933f6162..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) - -> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal - -You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. - -![](screenshot.png) - - -## Install - -``` -$ npm install --save ansi-styles -``` - - -## Usage - -```js -var ansi = require('ansi-styles'); - -console.log(ansi.green.open + 'Hello world!' + ansi.green.close); -``` - - -## API - -Each style has an `open` and `close` property. - - -## Styles - -### Modifiers - -- `reset` -- `bold` -- `dim` -- `italic` *(not widely supported)* -- `underline` -- `inverse` -- `hidden` -- `strikethrough` *(not widely supported)* - -### Colors - -- `black` -- `red` -- `green` -- `yellow` -- `blue` -- `magenta` -- `cyan` -- `white` -- `gray` - -### Background colors - -- `bgBlack` -- `bgRed` -- `bgGreen` -- `bgYellow` -- `bgBlue` -- `bgMagenta` -- `bgCyan` -- `bgWhite` - - -## Advanced usage - -By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. - -- `ansi.modifiers` -- `ansi.colors` -- `ansi.bgColors` - - -###### Example - -```js -console.log(ansi.colors.green.open); -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js deleted file mode 100644 index 7834bf9b24..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; - -module.exports = function (str) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string'); - } - - return str.replace(matchOperatorsRe, '\\$&'); -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json deleted file mode 100644 index 187d312661..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "escape-string-regexp@^1.0.2", - "scope": null, - "escapedName": "escape-string-regexp", - "name": "escape-string-regexp", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" - ] - ], - "_from": "escape-string-regexp@>=1.0.2 <2.0.0", - "_id": "escape-string-regexp@1.0.5", - "_inCache": true, - "_installable": true, - "_location": "/request/har-validator/chalk/escape-string-regexp", - "_nodeVersion": "4.2.6", - "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" - }, - "_npmUser": { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - }, - "_npmVersion": "2.14.12", - "_phantomChildren": {}, - "_requested": { - "raw": "escape-string-regexp@^1.0.2", - "scope": null, - "escapedName": "escape-string-regexp", - "name": "escape-string-regexp", - "rawSpec": "^1.0.2", - "spec": ">=1.0.2 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/har-validator/chalk" - ], - "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "_shrinkwrap": null, - "_spec": "escape-string-regexp@^1.0.2", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/escape-string-regexp/issues" - }, - "dependencies": {}, - "description": "Escape RegExp special characters", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "directories": {}, - "dist": { - "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" - }, - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "index.js" - ], - "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20", - "homepage": "https://github.com/sindresorhus/escape-string-regexp", - "keywords": [ - "escape", - "regex", - "regexp", - "re", - "regular", - "expression", - "string", - "str", - "special", - "characters" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "name": "escape-string-regexp", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/escape-string-regexp.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.5" -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md deleted file mode 100644 index 87ac82d5ef..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md +++ /dev/null @@ -1,27 +0,0 @@ -# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) - -> Escape RegExp special characters - - -## Install - -``` -$ npm install --save escape-string-regexp -``` - - -## Usage - -```js -const escapeStringRegexp = require('escape-string-regexp'); - -const escapedString = escapeStringRegexp('how much $ for a unicorn?'); -//=> 'how much \$ for a unicorn\?' - -new RegExp(escapedString); -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js deleted file mode 100644 index 98fae06767..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -var ansiRegex = require('ansi-regex'); -var re = new RegExp(ansiRegex().source); // remove the `g` flag -module.exports = re.test.bind(re); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json deleted file mode 100644 index 8ecf94571f..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "has-ansi@^2.0.0", - "scope": null, - "escapedName": "has-ansi", - "name": "has-ansi", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" - ] - ], - "_from": "has-ansi@>=2.0.0 <3.0.0", - "_id": "has-ansi@2.0.0", - "_inCache": true, - "_installable": true, - "_location": "/request/har-validator/chalk/has-ansi", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "_npmVersion": "2.11.2", - "_phantomChildren": {}, - "_requested": { - "raw": "has-ansi@^2.0.0", - "scope": null, - "escapedName": "has-ansi", - "name": "has-ansi", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/har-validator/chalk" - ], - "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "_shrinkwrap": null, - "_spec": "has-ansi@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/has-ansi/issues" - }, - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "description": "Check if a string has ANSI escape codes", - "devDependencies": { - "ava": "0.0.4" - }, - "directories": {}, - "dist": { - "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", - "homepage": "https://github.com/sindresorhus/has-ansi", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern", - "has" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "name": "has-ansi", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-ansi.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md deleted file mode 100644 index 02bc7c2300..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi) - -> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save has-ansi -``` - - -## Usage - -```js -var hasAnsi = require('has-ansi'); - -hasAnsi('\u001b[4mcake\u001b[0m'); -//=> true - -hasAnsi('cake'); -//=> false -``` - - -## Related - -- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module -- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes -- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js deleted file mode 100644 index 4346e272e1..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/index.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; -var argv = process.argv; - -var terminator = argv.indexOf('--'); -var hasFlag = function (flag) { - flag = '--' + flag; - var pos = argv.indexOf(flag); - return pos !== -1 && (terminator !== -1 ? pos < terminator : true); -}; - -module.exports = (function () { - if ('FORCE_COLOR' in process.env) { - return true; - } - - if (hasFlag('no-color') || - hasFlag('no-colors') || - hasFlag('color=false')) { - return false; - } - - if (hasFlag('color') || - hasFlag('colors') || - hasFlag('color=true') || - hasFlag('color=always')) { - return true; - } - - if (process.stdout && !process.stdout.isTTY) { - return false; - } - - if (process.platform === 'win32') { - return true; - } - - if ('COLORTERM' in process.env) { - return true; - } - - if (process.env.TERM === 'dumb') { - return false; - } - - if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { - return true; - } - - return false; -})(); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license deleted file mode 100644 index 654d0bfe94..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json deleted file mode 100644 index cd92886ca2..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "supports-color@^2.0.0", - "scope": null, - "escapedName": "supports-color", - "name": "supports-color", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" - ] - ], - "_from": "supports-color@>=2.0.0 <3.0.0", - "_id": "supports-color@2.0.0", - "_inCache": true, - "_installable": true, - "_location": "/request/har-validator/chalk/supports-color", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "_npmVersion": "2.11.2", - "_phantomChildren": {}, - "_requested": { - "raw": "supports-color@^2.0.0", - "scope": null, - "escapedName": "supports-color", - "name": "supports-color", - "rawSpec": "^2.0.0", - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/har-validator/chalk" - ], - "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "_shrinkwrap": null, - "_spec": "supports-color@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" - }, - "dependencies": {}, - "description": "Detect whether a terminal supports color", - "devDependencies": { - "mocha": "*", - "require-uncached": "^1.0.2" - }, - "directories": {}, - "dist": { - "shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" - }, - "engines": { - "node": ">=0.8.0" - }, - "files": [ - "index.js" - ], - "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", - "homepage": "https://github.com/chalk/supports-color", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "ansi", - "styles", - "tty", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "support", - "supports", - "capability", - "detect" - ], - "license": "MIT", - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "name": "supports-color", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md deleted file mode 100644 index b4761f1ecd..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/readme.md +++ /dev/null @@ -1,36 +0,0 @@ -# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) - -> Detect whether a terminal supports color - - -## Install - -``` -$ npm install --save supports-color -``` - - -## Usage - -```js -var supportsColor = require('supports-color'); - -if (supportsColor) { - console.log('Terminal supports color'); -} -``` - -It obeys the `--color` and `--no-color` CLI flags. - -For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`. - - -## Related - -- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module -- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json deleted file mode 100644 index a29160d3a2..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "chalk@^1.1.1", - "scope": null, - "escapedName": "chalk", - "name": "chalk", - "rawSpec": "^1.1.1", - "spec": ">=1.1.1 <2.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" - ] - ], - "_from": "chalk@>=1.1.1 <2.0.0", - "_id": "chalk@1.1.3", - "_inCache": true, - "_installable": true, - "_location": "/request/har-validator/chalk", - "_nodeVersion": "0.10.32", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" - }, - "_npmUser": { - "name": "qix", - "email": "i.am.qix@gmail.com" - }, - "_npmVersion": "2.14.2", - "_phantomChildren": { - "ansi-regex": "2.0.0" - }, - "_requested": { - "raw": "chalk@^1.1.1", - "scope": null, - "escapedName": "chalk", - "name": "chalk", - "rawSpec": "^1.1.1", - "spec": ">=1.1.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/har-validator" - ], - "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", - "_shrinkwrap": null, - "_spec": "chalk@^1.1.1", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator", - "bugs": { - "url": "https://github.com/chalk/chalk/issues" - }, - "dependencies": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - }, - "description": "Terminal string styling done right. Much color.", - "devDependencies": { - "coveralls": "^2.11.2", - "matcha": "^0.6.0", - "mocha": "*", - "nyc": "^3.0.0", - "require-uncached": "^1.0.2", - "resolve-from": "^1.0.0", - "semver": "^4.3.3", - "xo": "*" - }, - "directories": {}, - "dist": { - "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", - "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js" - ], - "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24", - "homepage": "https://github.com/chalk/chalk#readme", - "keywords": [ - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "str", - "ansi", - "style", - "styles", - "tty", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "license": "MIT", - "maintainers": [ - { - "name": "qix", - "email": "i.am.qix@gmail.com" - }, - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "unicorn", - "email": "sindresorhus+unicorn@gmail.com" - } - ], - "name": "chalk", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/chalk.git" - }, - "scripts": { - "bench": "matcha benchmark.js", - "coverage": "nyc npm test && nyc report", - "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", - "test": "xo && mocha" - }, - "version": "1.1.3", - "xo": { - "envs": [ - "node", - "mocha" - ] - } -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md deleted file mode 100644 index 5cf111e353..0000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md +++ /dev/null @@ -1,213 +0,0 @@ -

          -
          -
          - chalk -
          -
          -
          -

          - -> Terminal string styling done right - -[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) -[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) -[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) - - -[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. - -**Chalk is a clean and focused alternative.** - -![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) - - -## Why - -- Highly performant -- Doesn't extend `String.prototype` -- Expressive API -- Ability to nest styles -- Clean and focused -- Auto-detects color support -- Actively maintained -- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 - - -## Install - -``` -$ npm install --save chalk -``` - - -## Usage - -Chalk comes with an easy to use composable API where you just chain and nest the styles you want. - -```js -var chalk = require('chalk'); - -// style a string -chalk.blue('Hello world!'); - -// combine styled and normal strings -chalk.blue('Hello') + 'World' + chalk.red('!'); - -// compose multiple styles using the chainable API -chalk.blue.bgRed.bold('Hello world!'); - -// pass in multiple arguments -chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); - -// nest styles -chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); - -// nest styles of the same type even (color, underline, background) -chalk.green( - 'I am a green line ' + - chalk.blue.underline.bold('with a blue substring') + - ' that becomes green again!' -); -``` - -Easily define your own themes. - -```js -var chalk = require('chalk'); -var error = chalk.bold.red; -console.log(error('Error!')); -``` - -Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). - -```js -var name = 'Sindre'; -console.log(chalk.green('Hello %s'), name); -//=> Hello Sindre -``` - - -## API - -### chalk.`