diff --git a/.eslintrc.yaml b/.eslintrc.yaml index da49eb8b4f7c82..4735778b7bbff8 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -43,6 +43,7 @@ rules: # Best Practices # http://eslint.org/docs/rules/#best-practices accessor-pairs: error + array-callback-return: error dot-location: [error, property] eqeqeq: [error, smart] no-fallthrough: error diff --git a/.gitignore b/.gitignore index efbdc824d29289..40838bcc7fa8d7 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ _UpgradeReport_Files/ ipch/ *.sdf *.opensdf +*.VC.db *.VC.opendb .vs/ .vscode/ @@ -118,3 +119,6 @@ icu_config.gypi deps/uv/.github/ deps/uv/docs/code/ deps/uv/docs/src/guide/ + +# do not override V8's .gitignore +!deps/v8/** diff --git a/.mailmap b/.mailmap index fd6816a5dce7d3..f04496bf3b51ca 100644 --- a/.mailmap +++ b/.mailmap @@ -188,6 +188,8 @@ Kathy Truong k3kathy Kazuyuki Yamada Keith M Wesolowski Kelsey Breseman +Khaidi Chu XadillaX +Khaidi Chu Kiyoshi Nomo kysnm Koichi Kobayashi Kris Kowal @@ -264,6 +266,7 @@ Roman Klauke Roman Reiss Ron Korving Ron Korving ronkorving +Ruben Bridgewater Russell Dempsey Ryan Dahl Ryan Emery diff --git a/AUTHORS b/AUTHORS index 8d8e74493aff0a..57d5a25ea0a7e3 100644 --- a/AUTHORS +++ b/AUTHORS @@ -911,7 +911,7 @@ HUANG Wei DC Daniel Turing Julie Pagano -Ruben Bridgewater +Ruben Bridgewater Felix Becker Igor Klopov Tsarevich Dmitry @@ -1493,7 +1493,7 @@ Sreepurna Jasti Rafael Fragoso Andrei Cioromila Frank Lanitz -XadillaX +Khaidi Chu Akshay Iyer Rick Bullotta Rajaram Gaunker @@ -1532,7 +1532,6 @@ Dan Homola cornholio <0@mcornholio.ru> Tamás Hódi DuanPengfei <2459714173@qq.com> -Ruben Bridgewater Lakshmi Swetha Gopireddy Rob Wu Steven Winston @@ -2036,5 +2035,34 @@ Hannes Magnusson ChungNgoops Jose M. Palacios Diaz hmammedzadeh +IHsuan +Francisco Gerardo Neri Andriano +Shilo Mangam +idandagan1 +Cameron Moorehead +TomerOmri +Collins Abitekaniza +Federico Kauffman +Benno Fünfstück +Ram Goli +babygoat +Will Clark +Jem Bezooyen +Haejin Jo +Hakan Kimeiga +Tyler +Shinya Kanamaru +you12724 +routerman +April Webster +Jure Triglav +alnyan +rt33 +Ulmanb +xortiz +Waleed Ashraf +Mir Mufaqam Ali +Nicholas Drane +Shobhit Chittora # Generated by tools/update-authors.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b17c36f3e215d..6ba104e7f77801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,7 +29,8 @@ release. -9.3.0
+9.4.0
+9.3.0
9.2.1
9.2.0
9.1.0
diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 358fd59476d2cc..2569570b8d03bd 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -4,7 +4,7 @@ * [Issues and Pull Requests](#issues-and-pull-requests) - [Managing Issues and Pull Requests](#managing-issues-and-pull-requests) - - [Welcoming First-Time Contributiors](#welcoming-first-time-contributiors) + - [Welcoming First-Time Contributors](#welcoming-first-time-contributors) - [Closing Issues and Pull Requests](#closing-issues-and-pull-requests) * [Accepting Modifications](#accepting-modifications) - [Code Reviews and Consensus Seeking](#code-reviews-and-consensus-seeking) @@ -33,7 +33,7 @@ - [How is an LTS release cut?](#how-is-an-lts-release-cut) This document contains information for Collaborators of the Node.js -project regarding maintaining the code, documentation, and issues. +project regarding managing the project's code, documentation, and issue tracker. Collaborators should be familiar with the guidelines for new contributors in [CONTRIBUTING.md](./CONTRIBUTING.md) and also @@ -52,11 +52,11 @@ may also notify other qualified parties for more input on an issue or a pull request. [See "Who to CC in issues"](./doc/onboarding-extras.md#who-to-cc-in-issues) -### Welcoming First-Time Contributiors +### Welcoming First-Time Contributors Courtesy should always be shown to individuals submitting issues and pull requests to the Node.js project. Be welcoming to first-time contributors, -identified by the GitHub ![badge](./doc/first_timer_badge.png) badge. +identified by the GitHub ![First-time contributor](./doc/first_timer_badge.png) badge. For first-time contributors, check if the commit author is the same as the pull request author, and ask if they have configured their git @@ -116,6 +116,11 @@ oppose the PR, it can be landed. Where there is disagreement among TSC members or objections from one or more Collaborators, `semver-major` pull requests should be put on the TSC meeting agenda. +#### Helpful resources + +* How to respectfully and usefully review code, part [one](https://mtlynch.io/human-code-reviews-1/) and [two](https://mtlynch.io/human-code-reviews-2/) +* [How to write a positive code review](https://css-tricks.com/code-review-etiquette/) + ### Waiting for Approvals Before landing pull requests, sufficient time should be left for input @@ -142,6 +147,7 @@ test should *fail* before the change, and *pass* after the change. All pull requests that modify executable code should be subjected to continuous integration tests on the [project CI server](https://ci.nodejs.org/). +The pull request should have a CI status indicator if possible. #### Useful CI Jobs @@ -200,11 +206,10 @@ Node.js API are internal: - Any native C/C++ APIs/ABIs exported by the Node.js `*.h` header files that are hidden behind the `NODE_WANT_INTERNALS` flag are internal. -Exception to each of these points can be made if use or behavior of a given -internal API can be demonstrated to be sufficiently relied upon by the Node.js -ecosystem such that any changes would cause too much breakage. The threshold -for what qualifies as too much breakage is to be decided on a case-by-case -basis by the TSC. +Exceptions can be made if use or behavior of a given internal API can be +demonstrated to be sufficiently relied upon by the Node.js ecosystem such that +any changes would cause too much breakage. The threshold for what qualifies as +too much breakage is to be decided on a case-by-case basis by the TSC. If it is determined that a currently undocumented object, property, method, argument, or event *should* be documented, then a pull request adding the @@ -243,14 +248,14 @@ properties to an options argument) are semver-minor changes. #### Breaking Changes and Deprecations -With a few notable exceptions outlined below, when backwards incompatible -changes to a *Public* API are necessary, the existing API *must* be deprecated -*first* and the new API either introduced in parallel or added after the next -major Node.js version following the deprecation as a replacement for the -deprecated API. In other words, as a general rule, existing *Public* APIs -*must not* change (in a backwards incompatible way) without a deprecation. +With a few exceptions outlined below, when backward-incompatible changes to a +*Public* API are necessary, the existing API *must* be deprecated *first* and +the new API either introduced in parallel or added after the next major Node.js +version following the deprecation as a replacement for the deprecated API. In +other words, as a general rule, existing *Public* APIs *must not* change (in a +backward-incompatible way) without a deprecation. -Exception to this rule is given in the following cases: +Exceptions to this rule may be made in the following cases: * Adding or removing errors thrown or reported by a Public API; * Changing error messages; @@ -351,7 +356,7 @@ recommended but not required. ### Deprecations _Deprecation_ refers to the identification of Public APIs that should no longer -be used and that may be removed or modified in non-backwards compatible ways in +be used and that may be removed or modified in backward-incompatible ways in a future major release of Node.js. Deprecation may be used with internal APIs if there is expected impact on the user community. @@ -491,7 +496,7 @@ Check and re-review the changes: $ git diff upstream/master ``` -Check number of commits and commit messages: +Check the number of commits and commit messages: ```text $ git log upstream/master...master @@ -652,7 +657,7 @@ commit final. #### What is LTS? Long Term Support (often referred to as *LTS*) guarantees application developers -a 30 month support cycle with specific versions of Node.js. +a 30-month support cycle with specific versions of Node.js. You can find more information [in the full release plan](https://github.com/nodejs/Release#release-plan). @@ -665,7 +670,7 @@ certain performance improvements that can be demonstrated to not break existing applications. Semver-minor changes are only permitted if required for bug fixes and then only on a case-by-case basis with LTS WG and possibly Technical Steering Committee (TSC) review. Semver-major changes are permitted only if -required for security related fixes. +required for security-related fixes. Once a Current branch moves into Maintenance mode, only **critical** bugs, **critical** security fixes, and documentation updates will be permitted. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f8f89cdaa999e..b1cc67ada553ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,15 @@ # Contributing to Node.js -Contributions to Node.js may come in many forms. Some contribute code changes, -others contribute docs, others help answer questions from users, help keep the -infrastructure running, or seek out ways of advocating for Node.js users of all -types. +Contributions to Node.js include code, documentation, answering user questions, +running the project's infrastructure, and advocating for all types of Node.js +users. The Node.js project welcomes all contributions from anyone willing to work in -good faith both with other contributors and with the community. No contribution -is too small and all contributions are valued. +good faith with other contributors and the community. No contribution is too +small and all contributions are valued. -This guide details the basic steps for getting started contributing to the -Node.js project's core `nodejs/node` GitHub Repository and describes what to -expect throughout each step of the process. +This guide explains the process for contributing to the Node.js project's core +`nodejs/node` GitHub Repository and describes what to expect at each step. * [Code of Conduct](#code-of-conduct) * [Bad Actors](#bad-actors) @@ -201,9 +199,8 @@ functional guidelines of the Node.js project. ## Pull Requests -Pull Requests are the way in which concrete changes are made to the code, -documentation, dependencies, and tools contained with the `nodejs/node` -repository. +Pull Requests are the way concrete changes are made to the code, documentation, +dependencies, and tools contained in the `nodejs/node` repository. There are two fundamental components of the Pull Request process: one concrete and technical, and one more process oriented. The concrete and technical @@ -605,12 +602,11 @@ your name on it. Congratulations and thanks for your contribution! All Node.js contributors who choose to review and provide feedback on Pull Requests have a responsibility to both the project and the individual making the contribution. Reviews and feedback must be helpful, insightful, and geared -towards improving the contribution as opposed to simply blocking it or -stopping it. If there are reasons why you feel the PR should not land, explain -what those are. Do not expect to be able to block a Pull Request from advancing -simply because you say "No" without giving an explanation. It is also important -to be open to having your mind changed, and to being open to working with the -contributor to make the Pull Request better. +towards improving the contribution as opposed to simply blocking it. If there +are reasons why you feel the PR should not land, explain what those are. Do not +expect to be able to block a Pull Request from advancing simply because you say +"No" without giving an explanation. Be open to having your mind changed. Be open +to working with the contributor to make the Pull Request better. Reviews that are dismissive or disrespectful of the contributor or any other reviewers are strictly counter to the [Code of Conduct][]. diff --git a/CPP_STYLE_GUIDE.md b/CPP_STYLE_GUIDE.md index 62c96a8fd12e35..6266ee03b7c538 100644 --- a/CPP_STYLE_GUIDE.md +++ b/CPP_STYLE_GUIDE.md @@ -4,6 +4,7 @@ * [Formatting](#formatting) * [Left-leaning (C++ style) asterisks for pointer declarations](#left-leaning-c-style-asterisks-for-pointer-declarations) + * [C++ style comments](#c-style-comments) * [2 spaces of indentation for blocks or bodies of conditionals](#2-spaces-of-indentation-for-blocks-or-bodies-of-conditionals) * [4 spaces of indentation for statement continuations](#4-spaces-of-indentation-for-statement-continuations) * [Align function arguments vertically](#align-function-arguments-vertically) @@ -33,6 +34,26 @@ these rules: `char* buffer;` instead of `char *buffer;` +## C++ style comments + +Use C++ style comments (`//`) for both single-line and multi-line comments. +Comments should also start with uppercase and finish with a dot. + +Examples: + +```c++ +// A single-line comment. + +// Multi-line comments +// should also use C++ +// style comments. +``` + +The codebase may contain old C style comments (`/* */`) from before this was the +preferred style. Feel free to update old comments to the preferred style when +working on code in the immediate vicinity or when changing/improving those +comments. + ## 2 spaces of indentation for blocks or bodies of conditionals ```c++ diff --git a/Makefile b/Makefile index 992af027687657..213284aa70cd15 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,7 @@ BUILD_RELEASE_FLAGS ?= $(BUILD_DOWNLOAD_FLAGS) $(BUILD_INTL_FLAGS) # or set the V environment variable to an empty string. V ?= 1 +.PHONY: all # BUILDTYPE=Debug builds both release and debug builds. If you want to compile # just the debug build, run `make -C out BUILDTYPE=Debug` instead. ifeq ($(BUILDTYPE),Release) @@ -68,6 +69,7 @@ else all: out/Makefile $(NODE_EXE) $(NODE_G_EXE) endif +.PHONY: help # To add a target to the help, add a double comment (##) on the target line. help: ## Print help for targets with comments. @printf "For more targets and info see the comments in the Makefile.\n\n" @@ -100,12 +102,15 @@ out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ config.gypi: configure $(error Missing or stale $@, please run ./$<) +.PHONY: install install: all ## Installs node into $PREFIX (default=/usr/local). $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' +.PHONY: uninstall uninstall: ## Uninstalls node from $PREFIX (default=/usr/local). $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' +.PHONY: clean clean: ## Remove build artifacts. $(RM) -r out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) \ out/$(BUILDTYPE)/node.exp @@ -118,6 +123,7 @@ clean: ## Remove build artifacts. $(RM) -r test/.tmp* $(MAKE) test-addons-clean +.PHONY: distclean distclean: $(RM) -r out $(RM) config.gypi icu_config.gypi config_fips.gypi @@ -129,8 +135,10 @@ distclean: $(RM) $(BINARYTAR).* $(TARBALL).* $(RM) -r deps/v8/testing/gmock +.PHONY: check check: test +.PHONY: coverage-clean # Remove files generated by running coverage, put the non-instrumented lib back # in place coverage-clean: @@ -146,13 +154,15 @@ coverage-clean: $(RM) out/$(BUILDTYPE)/obj.target/cctest/src/*.gcno $(RM) out/$(BUILDTYPE)/obj.target/cctest/test/cctest/*.gcno +.PHONY: coverage # Build and test with code coverage reporting. Leave the lib directory # instrumented for any additional runs the user may want to make. # For C++ coverage reporting, this needs to be run in conjunction with configure # --coverage. html coverage reports will be created under coverage/ - +# Related CI job: node-test-commit-linux-coverage coverage: coverage-test ## Run the tests and generate a coverage report. +.PHONY: coverage-build coverage-build: all mkdir -p node_modules if [ ! -d node_modules/istanbul-merge ]; then \ @@ -162,15 +172,16 @@ coverage-build: all if [ ! -d gcovr ]; then git clone --depth=1 \ --single-branch git://github.com/gcovr/gcovr.git; fi if [ ! -d testing ]; then git clone --depth=1 \ - --single-branch https://github.com/nodejs/testing.git; fi + --single-branch https://github.com/nodejs/build.git; fi if [ ! -f gcovr/scripts/gcovr.orig ]; then \ (cd gcovr && patch -N -p1 < \ - "$(CURDIR)/testing/coverage/gcovr-patches.diff"); fi + "$(CURDIR)/build/jenkins/scripts/coverage/gcovr-patches.diff"); fi if [ -d lib_ ]; then $(RM) -r lib; mv lib_ lib; fi mv lib lib_ $(NODE) ./node_modules/.bin/nyc instrument --extension .js --extension .mjs lib_/ lib/ $(MAKE) +.PHONY: coverage-test coverage-test: coverage-build $(RM) -r out/$(BUILDTYPE)/.coverage $(RM) -r .cov_tmp @@ -198,43 +209,49 @@ coverage-test: coverage-build @grep -A3 Lines coverage/cxxcoverage.html | grep style \ | sed 's/<[^>]*>//g'| sed 's/ //g' +.PHONY: cctest +# Runs the C++ tests using the built `cctest` executable. cctest: all @out/$(BUILDTYPE)/$@ --gtest_filter=$(GTEST_FILTER) +.PHONY: list-gtests list-gtests: ifeq (,$(wildcard out/$(BUILDTYPE)/cctest)) $(error Please run 'make cctest' first) endif @out/$(BUILDTYPE)/cctest --gtest_list_tests +.PHONY: v8 +# Related CI job: node-test-commit-v8-linux +# Rebuilds deps/v8 as a git tree, pulls its third-party dependencies, and +# builds it. v8: tools/make-v8.sh $(MAKE) -C deps/v8 $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) -test: all ## Default test target. Runs default tests, linters, and builds docs. +.PHONY: test +# This does not run tests of third-party libraries inside deps. +test: all ## Runs default tests, linters, and builds docs. $(MAKE) -s build-addons $(MAKE) -s build-addons-napi $(MAKE) -s doc-only $(MAKE) -s lint $(MAKE) -s cctest $(PYTHON) tools/test.py --mode=release -J \ - $(CI_ASYNC_HOOKS) \ $(CI_JS_SUITES) \ $(CI_NATIVE_SUITES) \ - $(CI_DOC) \ - known_issues + $(CI_DOC) -# For a quick test, does not run linter or build doc -test-only: all +.PHONY: test-only +test-only: all ## For a quick test, does not run linter or build docs. $(MAKE) build-addons $(MAKE) build-addons-napi $(MAKE) cctest $(PYTHON) tools/test.py --mode=release -J \ - $(CI_ASYNC_HOOKS) \ $(CI_JS_SUITES) \ - $(CI_NATIVE_SUITES) \ - known_issues + $(CI_NATIVE_SUITES) +# Used by `make coverage-test` test-cov: all $(MAKE) build-addons $(MAKE) build-addons-napi @@ -314,6 +331,7 @@ test/addons/.buildstamp: config.gypi \ done touch $@ +.PHONY: build-addons # .buildstamp needs $(NODE_EXE) but cannot depend on it # directly because it calls make recursively. The parent make cannot know # if the subprocess touched anything so it pessimistically assumes that @@ -353,6 +371,7 @@ test/addons-napi/.buildstamp: config.gypi \ done touch $@ +.PHONY: build-addons-napi # .buildstamp needs $(NODE_EXE) but cannot depend on it # directly because it calls make recursively. The parent make cannot know # if the subprocess touched anything so it pessimistically assumes that @@ -361,6 +380,7 @@ test/addons-napi/.buildstamp: config.gypi \ # TODO(bnoordhuis) Force rebuild after gyp or node-gyp update. build-addons-napi: | $(NODE_EXE) test/addons-napi/.buildstamp +.PHONY: clear-stalled clear-stalled: # Clean up any leftover processes but don't error if found. ps awwx | grep Release/node | grep -v grep | cat @@ -369,9 +389,11 @@ clear-stalled: echo $${PS_OUT} | xargs kill; \ fi +.PHONY: test-gc test-gc: all test/gc/build/Release/binding.node $(PYTHON) tools/test.py --mode=release gc +.PHONY: test-gc-clean test-gc-clean: $(RM) -r test/gc/build @@ -379,6 +401,7 @@ test-build: | all build-addons build-addons-napi test-build-addons-napi: all build-addons-napi +.PHONY: test-all test-all: test-build test/gc/build/Release/binding.node ## Run everything in test/. $(PYTHON) tools/test.py --mode=debug,release @@ -386,22 +409,25 @@ test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind CI_NATIVE_SUITES ?= addons addons-napi -CI_ASYNC_HOOKS := async-hooks CI_JS_SUITES ?= default CI_DOC := doctool +.PHONY: test-ci-native # Build and test addons without building anything else +# Related CI job: node-test-commit-arm-fanned test-ci-native: LOGLEVEL := info test-ci-native: | test/addons/.buildstamp test/addons-napi/.buildstamp $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=release --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) $(CI_NATIVE_SUITES) +.PHONY: test-ci-js # This target should not use a native compiler at all +# Related CI job: node-test-commit-arm-fanned test-ci-js: | clear-stalled $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=release --flaky-tests=$(FLAKY_TESTS) \ - $(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES) known_issues + $(TEST_CI_ARGS) $(CI_JS_SUITES) # Clean up any leftover processes, error if found. ps awwx | grep Release/node | grep -v grep | cat @PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \ @@ -409,13 +435,14 @@ test-ci-js: | clear-stalled echo $${PS_OUT} | xargs kill; exit 1; \ fi +.PHONY: test-ci +# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned test-ci: LOGLEVEL := info test-ci: | clear-stalled build-addons build-addons-napi doc-only out/Release/cctest --gtest_output=tap:cctest.tap $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=release --flaky-tests=$(FLAKY_TESTS) \ - $(TEST_CI_ARGS) $(CI_ASYNC_HOOKS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) \ - $(CI_DOC) known_issues + $(TEST_CI_ARGS) $(CI_JS_SUITES) $(CI_NATIVE_SUITES) $(CI_DOC) # Clean up any leftover processes, error if found. ps awwx | grep Release/node | grep -v grep | cat @PS_OUT=`ps awwx | grep Release/node | grep -v grep | awk '{print $$1}'`; \ @@ -423,6 +450,23 @@ test-ci: | clear-stalled build-addons build-addons-napi doc-only echo $${PS_OUT} | xargs kill; exit 1; \ fi +.PHONY: build-ci +# Prepare the build for running the tests. +# Related CI jobs: most CI tests, excluding node-test-commit-arm-fanned +build-ci: + $(PYTHON) ./configure $(CONFIG_FLAGS) + $(MAKE) + +.PHONY: run-ci +# Run by CI tests, exceptions: +# - node-test-commit-arm-fanned (Raspberry Pis), where the binaries are +# cross-compiled, then transferred elsewhere to run different subsets +# of tests. See `test-ci-native` and `test-ci-js`. +# - node-test-commit-linux-coverage: where the build and the tests need +# to be instrumented, see `coverage`. +run-ci: build-ci + $(MAKE) test-ci + test-release: test-build $(PYTHON) tools/test.py --mode=release @@ -448,32 +492,40 @@ test-node-inspect: $(NODE_EXE) test-tick-processor: all $(PYTHON) tools/test.py tick-processor +.PHONY: test-hash-seed +# Verifies the hash seed used by V8 for hashing is random. test-hash-seed: all $(NODE) test/pummel/test-hash-seed.js -test-doc: doc-only +.PHONY: test-doc +test-doc: doc-only ## Builds, lints, and verifies the docs. $(MAKE) lint $(PYTHON) tools/test.py $(CI_DOC) test-known-issues: all $(PYTHON) tools/test.py known_issues +# Related CI job: node-test-npm test-npm: $(NODE_EXE) ## Run the npm test suite on deps/npm. $(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test-node test-npm-publish: $(NODE_EXE) npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js +.PHONY: test-addons-napi test-addons-napi: test-build-addons-napi $(PYTHON) tools/test.py --mode=release addons-napi +.PHONY: test-addons-napi-clean test-addons-napi-clean: $(RM) -r test/addons-napi/*/build $(RM) test/addons-napi/.buildstamp +.PHONY: test-addons test-addons: test-build test-addons-napi $(PYTHON) tools/test.py --mode=release addons +.PHONY: test-addons-clean test-addons-clean: $(RM) -r test/addons/??_*/ $(RM) -r test/addons/*/build @@ -499,9 +551,17 @@ test-with-async-hooks: $(CI_NATIVE_SUITES) +.PHONY: test-v8 +.PHONY: test-v8-all +.PHONY: test-v8-benchmarks +.PHONY: test-v8-intl ifneq ("","$(wildcard deps/v8/tools/run-tests.py)") +# Related CI job: node-test-commit-v8-linux test-v8: v8 ## Runs the V8 test suite on deps/v8. -# note: performs full test unless QUICKCHECK is specified +# Performs a full test unless QUICKCHECK is specified. +# Note that we cannot run the tests in deps/v8 directly without rebuilding a +# git tree and using gclient to pull the third-party dependencies, which is +# done by the `v8` target. deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \ --mode=$(BUILDTYPE_LOWER) $(V8_TEST_OPTIONS) $(QUICKCHECK_ARG) \ --no-presubmit \ @@ -512,7 +572,7 @@ test-v8: v8 ## Runs the V8 test suite on deps/v8. $(MAKE) test-hash-seed test-v8-intl: v8 -# note: performs full test unless QUICKCHECK is specified +# Performs a full test unless QUICKCHECK is specified. deps/v8/tools/run-tests.py --arch=$(V8_ARCH) \ --mode=$(BUILDTYPE_LOWER) --no-presubmit $(QUICKCHECK_ARG) \ --shell-dir=deps/v8/out/$(V8_ARCH).$(BUILDTYPE_LOWER) intl \ @@ -545,8 +605,8 @@ apidocs_json = $(addprefix out/,$(apidoc_sources:.md=.json)) apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*))) -# This uses the locally built node if available, otherwise uses the global node -doc-only: $(apidoc_dirs) $(apiassets) +.PHONY: doc-only +doc-only: $(apidoc_dirs) $(apiassets) ## Builds the docs with the local or the global Node.js binary. # If it's a source tarball, assets are already in doc/api/assets, # no need to install anything, we have already copied the docs over if [ ! -d doc/api/assets ]; then \ @@ -554,6 +614,7 @@ doc-only: $(apidoc_dirs) $(apiassets) fi; @$(MAKE) -s $(apidocs_html) $(apidocs_json) +.PHONY: doc doc: $(NODE_EXE) doc-only out/doc: @@ -601,19 +662,14 @@ out/doc/api/%.json: doc/api/%.md out/doc/api/%.html: doc/api/%.md $(call available-node, $(gen-html)) +.PHONY: docopen docopen: $(apidocs_html) @$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html +.PHONY: docclean docclean: $(RM) -r out/doc -build-ci: - $(PYTHON) ./configure $(CONFIG_FLAGS) - $(MAKE) - -run-ci: build-ci - $(MAKE) test-ci - RAWVER=$(shell $(PYTHON) tools/getnodeversion.py) VERSION=v$(RAWVER) @@ -751,6 +807,7 @@ XZ_COMPRESSION ?= 9e PKG=$(TARNAME).pkg MACOSOUTDIR=out/macos +.PHONY: release-only release-only: @if [ "$(DISTTYPE)" != "nightly" ] && [ "$(DISTTYPE)" != "next-nightly" ] && \ `grep -q REPLACEME doc/api/*.md`; then \ @@ -834,8 +891,11 @@ $(PKG): release-only --package-path $(MACOSOUTDIR)/pkgs ./$(PKG) SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh +.PHONY: pkg +# Builds the macOS installer for releases. pkg: $(PKG) +# Note: this is strictly for release builds on release machines only. pkg-upload: pkg ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" chmod 664 $(TARNAME).pkg @@ -866,8 +926,10 @@ ifeq ($(XZ), 0) endif $(RM) $(TARNAME).tar +.PHONY: tar tar: $(TARBALL) ## Create a source tarball. +# Note: this is strictly for release builds on release machines only. tar-upload: tar ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" chmod 664 $(TARNAME).tar.gz @@ -879,12 +941,14 @@ ifeq ($(XZ), 0) ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).tar.xz.done" endif +# Note: this is strictly for release builds on release machines only. doc-upload: doc ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/" chmod -R ug=rw-x+X,o=r+X out/doc/ scp -pr out/doc/* $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/ ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs.done" +.PHONY: $(TARBALL)-headers $(TARBALL)-headers: release-only $(PYTHON) ./configure \ --prefix=/ \ @@ -939,8 +1003,11 @@ ifeq ($(XZ), 0) endif $(RM) $(BINARYNAME).tar +.PHONY: binary +# This requires NODE_VERSION_IS_RELEASE defined as 1 in src/node_version.h. binary: $(BINARYTAR) ## Build release binary tarballs. +# Note: this is strictly for release builds on release machines only. binary-upload: binary ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" chmod 664 $(TARNAME)-$(OSTYPE)-$(ARCH).tar.gz @@ -952,27 +1019,34 @@ ifeq ($(XZ), 0) ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-$(OSTYPE)-$(ARCH).tar.xz.done" endif +.PHONY: bench-net bench-net: all @$(NODE) benchmark/run.js net bench-crypto: all @$(NODE) benchmark/run.js crypto +.PHONY: bench-tls bench-tls: all @$(NODE) benchmark/run.js tls +.PHONY: bench-http bench-http: all @$(NODE) benchmark/run.js http +.PHONY: bench-fs bench-fs: all @$(NODE) benchmark/run.js fs +.PHONY: bench-misc bench-misc: benchmark/misc/function_call/build/Release/binding.node @$(NODE) benchmark/run.js misc +.PHONY: bench-array bench-array: all @$(NODE) benchmark/run.js arrays +.PHONY: bench-buffer bench-buffer: all @$(NODE) benchmark/run.js buffers @@ -988,17 +1062,22 @@ bench-util: all bench-dgram: all @$(NODE) benchmark/run.js dgram +.PHONY: bench-all bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events bench-dgram bench-util -bench: bench-net bench-http bench-fs bench-tls ## Run node benchmarks. +.PHONY: bench +bench: bench-net bench-http bench-fs bench-tls +.PHONY: bench-ci bench-ci: bench +.PHONY: lint-md-clean lint-md-clean: $(RM) -r tools/remark-cli/node_modules $(RM) -r tools/remark-preset-lint-node/node_modules $(RM) tools/.*mdlintstamp +.PHONY: lint-md-build lint-md-build: @if [ ! -d tools/remark-cli/node_modules ]; then \ echo "Markdown linter: installing remark-cli into tools/"; \ @@ -1007,6 +1086,7 @@ lint-md-build: echo "Markdown linter: installing remark-preset-lint-node into tools/"; \ cd tools/remark-preset-lint-node && ../../$(NODE) ../../$(NPM) install; fi +.PHONY: lint-md ifneq ("","$(wildcard tools/remark-cli/node_modules/)") LINT_MD_TARGETS = src lib benchmark tools/doc tools/icu LINT_MD_ROOT_DOCS := $(wildcard *.md) @@ -1026,6 +1106,7 @@ tools/.miscmdlintstamp: $(LINT_MD_FILES) tools/.mdlintstamp: tools/.miscmdlintstamp tools/.docmdlintstamp +# Lints the markdown documents maintained by us in the codebase. lint-md: | tools/.mdlintstamp else lint-md: @@ -1038,6 +1119,7 @@ LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \ --rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \ $(LINT_JS_TARGETS) +.PHONY: lint-js-fix lint-js-fix: @if [ -x $(NODE) ]; then \ $(NODE) $(LINT_JS_CMD) --fix; \ @@ -1045,6 +1127,9 @@ lint-js-fix: node $(LINT_JS_CMD) --fix; \ fi +.PHONY: lint-js +# Note that on the CI `lint-js-ci` is run instead. +# Lints the JavaScript code with eslint. lint-js: @echo "Running JS linter..." @if [ -x $(NODE) ]; then \ @@ -1056,6 +1141,8 @@ lint-js: jslint: lint-js @echo "Please use lint-js instead of jslint" +.PHONY: lint-js-ci +# On the CI the output is emitted in the TAP format. lint-js-ci: @echo "Running JS linter..." @if [ -x $(NODE) ]; then \ @@ -1100,6 +1187,8 @@ LINT_CPP_FILES = $(filter-out $(LINT_CPP_EXCLUDE), $(wildcard \ # and the actual filename is generated so it won't match header guards ADDON_DOC_LINT_FLAGS=-whitespace/ending_newline,-build/header_guard +.PHONY: lint-cpp +# Lints the C++ code with cpplint.py and check-imports.py. lint-cpp: tools/.cpplintstamp tools/.cpplintstamp: $(LINT_CPP_FILES) @@ -1115,6 +1204,8 @@ lint-addon-docs: test/addons/.docbuildstamp cpplint: lint-cpp @echo "Please use lint-cpp instead of cpplint" +.PHONY: lint +.PHONY: lint-ci ifneq ("","$(wildcard tools/eslint/)") lint: ## Run JS, C++, MD and doc linters. @EXIT_STATUS=0 ; \ @@ -1123,6 +1214,8 @@ lint: ## Run JS, C++, MD and doc linters. $(MAKE) lint-addon-docs || EXIT_STATUS=$$? ; \ exit $$EXIT_STATUS CONFLICT_RE=^>>>>>>> [0-9A-Fa-f]+|^<<<<<<< [A-Za-z]+ + +# Related CI job: node-test-linter lint-ci: lint-js-ci lint-cpp lint-md lint-addon-docs @if ! ( grep -IEqrs "$(CONFLICT_RE)" benchmark deps doc lib src test tools ) \ && ! ( find . -maxdepth 1 -type f | xargs grep -IEqs "$(CONFLICT_RE)" ); then \ @@ -1141,84 +1234,7 @@ lint: lint-ci: lint endif +.PHONY: lint-clean lint-clean: $(RM) tools/.*lintstamp $(RM) .eslintcache - -.PHONY: $(TARBALL)-headers \ - all \ - bench \ - bench \ - bench-all \ - bench-array \ - bench-buffer \ - bench-ci \ - bench-fs \ - bench-http \ - bench-http-simple \ - bench-idle \ - bench-misc \ - bench-net \ - bench-tls \ - binary \ - blog \ - blogclean \ - build-addons \ - build-addons-napi \ - build-ci \ - cctest \ - check \ - clean \ - clear-stalled \ - coverage \ - coverage-build \ - coverage-clean \ - coverage-test \ - dist \ - distclean \ - doc \ - doc-only \ - docclean \ - docopen \ - dynamiclib \ - help \ - install \ - install-bin \ - install-includes \ - lint \ - lint-clean \ - lint-ci \ - lint-cpp \ - lint-js \ - lint-js-ci \ - lint-js-fix \ - list-gtests \ - lint-md \ - lint-md-build \ - lint-md-clean \ - pkg \ - release-only \ - run-ci \ - staticlib \ - tar \ - test \ - test-addons \ - test-addons-clean \ - test-addons-napi \ - test-addons-napi-clean \ - test-all \ - test-ci \ - test-ci-js \ - test-ci-native \ - test-doc \ - test-gc \ - test-gc-clean \ - test-hash-seed \ - test-only \ - test-v8 \ - test-v8-all \ - test-v8-benchmarks \ - test-v8-intl \ - uninstall \ - v8 \ - website-upload diff --git a/README.md b/README.md index e37a2b70d82b02..85a27f549a5150 100644 --- a/README.md +++ b/README.md @@ -169,23 +169,22 @@ officially supported platforms. ## Security -All security bugs in Node.js are taken seriously and should be reported by -emailing security@nodejs.org. This will be delivered to a subset of the project -team who handle security issues. Please don't disclose security bugs -publicly until they have been handled by the security team. +Security flaws in Node.js should be reported by emailing security@nodejs.org. +Please do not disclose security bugs publicly until they have been handled by +the security team. -Your email will be acknowledged within 24 hours, and you’ll receive a more +Your email will be acknowledged within 24 hours, and you will receive a more detailed response to your email within 48 hours indicating the next steps in handling your report. There are no hard and fast rules to determine if a bug is worth reporting as -a security issue. The general rule is any issue worth reporting -must allow an attacker to compromise the confidentiality, integrity -or availability of the Node.js application or its system for which the attacker -does not already have the capability. +a security issue. The general rule is an issue worth reporting should allow an +attacker to compromise the confidentiality, integrity, or availability of the +Node.js application or its system for which the attacker does not already have +the capability. To illustrate the point, here are some examples of past issues and what the -Security Reponse Team thinks of them. When in doubt, however, please do send +Security Response Team thinks of them. When in doubt, however, please do send us a report nonetheless. @@ -238,6 +237,8 @@ For more information about the governance of the Node.js project, see **Сковорода Никита Андреевич** <chalkerx@gmail.com> (he/him) * [cjihrig](https://github.com/cjihrig) - **Colin Ihrig** <cjihrig@gmail.com> +* [danbev](https://github.com/danbev) - +**Daniel Bevenius** <daniel.bevenius@gmail.com> * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <evanlucas@me.com> (he/him) * [fhinkel](https://github.com/fhinkel) - @@ -248,8 +249,6 @@ For more information about the governance of the Node.js project, see **Fedor Indutny** <fedor.indutny@gmail.com> * [jasnell](https://github.com/jasnell) - **James M Snell** <jasnell@gmail.com> (he/him) -* [joshgav](https://github.com/joshgav) - -**Josh Gavant** <josh.gavant@outlook.com> * [joyeecheung](https://github.com/joyeecheung) - **Joyee Cheung** <joyeec9h3@gmail.com> (she/her) * [mcollina](https://github.com/mcollina) - @@ -281,6 +280,8 @@ For more information about the governance of the Node.js project, see **Chris Dickinson** <christopher.s.dickinson@gmail.com> * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <i@izs.me> +* [joshgav](https://github.com/joshgav) - +**Josh Gavant** <josh.gavant@outlook.com> * [nebrius](https://github.com/nebrius) - **Bryan Hughes** <bryan@nebri.us> * [orangemocha](https://github.com/orangemocha) - @@ -410,8 +411,6 @@ For more information about the governance of the Node.js project, see **Luca Maraschi** <luca.maraschi@gmail.com> (he/him) * [maclover7](https://github.com/maclover7) - **Jon Moss** <me@jonathanmoss.me> (he/him) -* [matthewloring](https://github.com/matthewloring) - -**Matthew Loring** <mattloring@google.com> * [mcollina](https://github.com/mcollina) - **Matteo Collina** <matteo.collina@gmail.com> (he/him) * [mhdawson](https://github.com/mhdawson) - @@ -474,6 +473,8 @@ For more information about the governance of the Node.js project, see **Roman Reiss** <me@silverwind.io> * [srl295](https://github.com/srl295) - **Steven R Loomis** <srloomis@us.ibm.com> +* [starkwang](https://github.com/starkwang) - +**Weijia Wang** <starkwang@126.com> * [stefanmb](https://github.com/stefanmb) - **Stefan Budeanu** <stefan@budeanu.com> * [targos](https://github.com/targos) - @@ -485,7 +486,7 @@ For more information about the governance of the Node.js project, see * [thlorenz](https://github.com/thlorenz) - **Thorsten Lorenz** <thlorenz@gmx.de> * [TimothyGu](https://github.com/TimothyGu) - -**Timothy Gu** <timothygu99@gmail.com> (he/him) +**Tiancheng "Timothy" Gu** <timothygu99@gmail.com> (he/him) * [tniessen](https://github.com/tniessen) - **Tobias Nießen** <tniessen@tnie.de> * [trevnorris](https://github.com/trevnorris) - @@ -515,6 +516,8 @@ For more information about the governance of the Node.js project, see **Isaac Z. Schlueter** <i@izs.me> * [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** <lxe@lxe.co> +* [matthewloring](https://github.com/matthewloring) - +**Matthew Loring** <mattloring@google.com> * [monsanto](https://github.com/monsanto) - **Christopher Monsanto** <chris@monsan.to> * [Olegas](https://github.com/Olegas) - diff --git a/benchmark/buffers/buffer-read-float.js b/benchmark/buffers/buffer-read-float.js new file mode 100644 index 00000000000000..5dda2486c6711a --- /dev/null +++ b/benchmark/buffers/buffer-read-float.js @@ -0,0 +1,46 @@ +'use strict'; +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + noAssert: ['false', 'true'], + type: ['Double', 'Float'], + endian: ['BE', 'LE'], + value: ['zero', 'big', 'small', 'inf', 'nan'], + millions: [1] +}); + +function main(conf) { + const noAssert = conf.noAssert === 'true'; + const len = +conf.millions * 1e6; + const buff = Buffer.alloc(8); + const type = conf.type || 'Double'; + const endian = conf.endian; + const fn = `read${type}${endian}`; + const values = { + Double: { + zero: 0, + big: 2 ** 1023, + small: 2 ** -1074, + inf: Infinity, + nan: NaN, + }, + Float: { + zero: 0, + big: 2 ** 127, + small: 2 ** -149, + inf: Infinity, + nan: NaN, + }, + }; + const value = values[type][conf.value]; + + buff[`write${type}${endian}`](value, 0, noAssert); + const testFunction = new Function('buff', ` + for (var i = 0; i !== ${len}; i++) { + buff.${fn}(0, ${JSON.stringify(noAssert)}); + } + `); + bench.start(); + testFunction(buff); + bench.end(len / 1e6); +} diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index 162cef6864a686..e0dc7edc05ea3e 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -3,7 +3,7 @@ const path = require('path'); const common = require('../common.js'); -const filename = path.resolve(__dirname, +const filename = path.resolve(process.env.NODE_TMPDIR || __dirname, `.removeme-benchmark-garbage-${process.pid}`); const fs = require('fs'); const assert = require('assert'); diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index 82479ff14e5f68..7c55073fe0f017 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -5,7 +5,7 @@ const path = require('path'); const common = require('../common.js'); -const filename = path.resolve(__dirname, +const filename = path.resolve(process.env.NODE_TMPDIR || __dirname, `.removeme-benchmark-garbage-${process.pid}`); const fs = require('fs'); diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index 5c6464fdbb2cbb..08f059156f2cd9 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -3,7 +3,7 @@ const path = require('path'); const common = require('../common.js'); -const filename = path.resolve(__dirname, +const filename = path.resolve(process.env.NODE_TMPDIR || __dirname, `.removeme-benchmark-garbage-${process.pid}`); const fs = require('fs'); @@ -41,10 +41,6 @@ function main(conf) { var started = false; var ending = false; var ended = false; - setTimeout(function() { - ending = true; - f.end(); - }, dur * 1000); var f = fs.createWriteStream(filename); f.on('drain', write); @@ -66,6 +62,10 @@ function main(conf) { if (!started) { started = true; + setTimeout(function() { + ending = true; + f.end(); + }, dur * 1000); bench.start(); } diff --git a/benchmark/http/upgrade.js b/benchmark/http/upgrade.js new file mode 100644 index 00000000000000..0feaecc8ff19e6 --- /dev/null +++ b/benchmark/http/upgrade.js @@ -0,0 +1,53 @@ +'use strict'; + +const common = require('../common.js'); +const PORT = common.PORT; +const net = require('net'); + +const bench = common.createBenchmark(main, { + n: [5, 1000] +}); + +const reqData = 'GET / HTTP/1.1\r\n' + + 'Upgrade: WebSocket\r\n' + + 'Connection: Upgrade\r\n' + + '\r\n' + + 'WjN}|M(6'; + +const resData = 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' + + 'Upgrade: WebSocket\r\n' + + 'Connection: Upgrade\r\n' + + '\r\n\r\n'; + +function main({ n }) { + process.env.PORT = PORT; + var server = require('../fixtures/simple-http-server.js') + .listen(common.PORT) + .on('listening', function() { + bench.start(); + doBench(server.address(), n, function() { + bench.end(n); + server.close(); + }); + }) + .on('upgrade', function(req, socket, upgradeHead) { + socket.resume(); + socket.write(resData); + socket.end(); + }); +} + +function doBench(address, count, done) { + if (count === 0) { + done(); + return; + } + + const conn = net.createConnection(address.port); + conn.write(reqData); + conn.resume(); + + conn.on('end', function() { + doBench(address, count - 1, done); + }); +} diff --git a/benchmark/misc/arguments.js b/benchmark/misc/arguments.js new file mode 100644 index 00000000000000..2e5df6188b07f5 --- /dev/null +++ b/benchmark/misc/arguments.js @@ -0,0 +1,59 @@ +'use strict'; + +const { createBenchmark } = require('../common.js'); +const { format } = require('util'); + +const methods = [ + 'restAndSpread', + 'argumentsAndApply', + 'restAndApply', + 'predefined' +]; + +const bench = createBenchmark(main, { + method: methods, + n: [1e6] +}); + +function usingRestAndSpread(...args) { + format(...args); +} + +function usingRestAndApply(...args) { + format.apply(null, args); +} + +function usingArgumentsAndApply() { + format.apply(null, arguments); +} + +function usingPredefined() { + format('part 1', 'part', 2, 'part 3', 'part', 4); +} + +function main({ n, method, args }) { + var fn; + switch (method) { + // '' is a default case for tests + case '': + case 'restAndSpread': + fn = usingRestAndSpread; + break; + case 'restAndApply': + fn = usingRestAndApply; + break; + case 'argumentsAndApply': + fn = usingArgumentsAndApply; + break; + case 'predefined': + fn = usingPredefined; + break; + default: + throw new Error(`Unexpected method "${method}"`); + } + + bench.start(); + for (var i = 0; i < n; i++) + fn('part 1', 'part', 2, 'part 3', 'part', 4); + bench.end(n); +} diff --git a/benchmark/misc/console.js b/benchmark/misc/console.js deleted file mode 100644 index ab938168ac30c4..00000000000000 --- a/benchmark/misc/console.js +++ /dev/null @@ -1,126 +0,0 @@ -'use strict'; - -const common = require('../common.js'); -const assert = require('assert'); -const Writable = require('stream').Writable; -const util = require('util'); - -const methods = [ - 'restAndSpread', - 'argumentsAndApply', - 'restAndApply', - 'restAndConcat' -]; - -const bench = common.createBenchmark(main, { - method: methods, - concat: [1, 0], - n: [1000000] -}); - -const nullStream = createNullStream(); - -function usingRestAndConcat(...args) { - nullStream.write(`this is ${args[0]} of ${args[1]}\n`); -} - -function usingRestAndSpreadTS(...args) { - nullStream.write(`${util.format(...args)}\n`); -} - -function usingRestAndApplyTS(...args) { - nullStream.write(`${util.format.apply(null, args)}\n`); -} - -function usingArgumentsAndApplyTS() { - nullStream.write(`${util.format.apply(null, arguments)}\n`); -} - -function usingRestAndSpreadC(...args) { - nullStream.write(`${util.format(...args)}\n`); -} - -function usingRestAndApplyC(...args) { - nullStream.write(`${util.format.apply(null, args)}\n`); -} - -function usingArgumentsAndApplyC() { - nullStream.write(`${util.format.apply(null, arguments)}\n`); -} - -function runUsingRestAndConcat(n) { - - var i = 0; - bench.start(); - for (; i < n; i++) - usingRestAndConcat('a', 1); - bench.end(n); -} - -function runUsingRestAndSpread(n, concat) { - - const method = concat ? usingRestAndSpreadC : usingRestAndSpreadTS; - - var i = 0; - bench.start(); - for (; i < n; i++) - method('this is %s of %d', 'a', 1); - bench.end(n); -} - -function runUsingRestAndApply(n, concat) { - - const method = concat ? usingRestAndApplyC : usingRestAndApplyTS; - - var i = 0; - bench.start(); - for (; i < n; i++) - method('this is %s of %d', 'a', 1); - bench.end(n); -} - -function runUsingArgumentsAndApply(n, concat) { - - const method = concat ? usingArgumentsAndApplyC : usingArgumentsAndApplyTS; - - var i = 0; - bench.start(); - for (; i < n; i++) - method('this is %s of %d', 'a', 1); - bench.end(n); -} - -function main(conf) { - const n = +conf.n; - switch (conf.method) { - // '' is a default case for tests - case '': - case 'restAndSpread': - runUsingRestAndSpread(n, conf.concat); - break; - case 'restAndApply': - runUsingRestAndApply(n, conf.concat); - break; - case 'argumentsAndApply': - runUsingArgumentsAndApply(n, conf.concat); - break; - case 'restAndConcat': - if (conf.concat) - runUsingRestAndConcat(n); - break; - default: - throw new Error('Unexpected method'); - } -} - -function createNullStream() { - // Used to approximate /dev/null - function NullStream() { - Writable.call(this, {}); - } - util.inherits(NullStream, Writable); - NullStream.prototype._write = function(cb) { - assert.strictEqual(cb.toString(), 'this is a of 1\n'); - }; - return new NullStream(); -} diff --git a/common.gypi b/common.gypi index 0d9529f3ad2cc5..b5e1bc0628d22c 100644 --- a/common.gypi +++ b/common.gypi @@ -27,7 +27,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.15', + 'v8_embedder_string': '-node.17', # Enable disassembler for `--print-code` v8 options 'v8_enable_disassembler': 1, diff --git a/deps/nghttp2/lib/CMakeLists.txt b/deps/nghttp2/lib/CMakeLists.txt index 7ef37ed85cc628..0846d06789a0f1 100644 --- a/deps/nghttp2/lib/CMakeLists.txt +++ b/deps/nghttp2/lib/CMakeLists.txt @@ -44,6 +44,10 @@ set_target_properties(nghttp2 PROPERTIES VERSION ${LT_VERSION} SOVERSION ${LT_SOVERSION} C_VISIBILITY_PRESET hidden ) +target_include_directories(nghttp2 INTERFACE + "${CMAKE_CURRENT_BINARY_DIR}/includes" + "${CMAKE_CURRENT_SOURCE_DIR}/includes" + ) if(HAVE_CUNIT) # Static library (for unittests because of symbol visibility) diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2.h index 5696a2ef633653..13cda9f29e28f5 100644 --- a/deps/nghttp2/lib/includes/nghttp2/nghttp2.h +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2.h @@ -387,6 +387,11 @@ typedef enum { * Indicates that a processing was canceled. */ NGHTTP2_ERR_CANCEL = -535, + /** + * When a local endpoint expects to receive SETTINGS frame, it + * receives an other type of frame. + */ + NGHTTP2_ERR_SETTINGS_EXPECTED = -536, /** * The errors < :enum:`NGHTTP2_ERR_FATAL` mean that the library is * under unexpected condition and processing was terminated (e.g., @@ -1987,6 +1992,9 @@ typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session, * of length |len|. |len| does not include the sentinel NULL * character. * + * This function is deprecated. The new application should use + * :type:`nghttp2_error_callback2`. + * * The format of error message may change between nghttp2 library * versions. The application should not depend on the particular * format. @@ -2003,6 +2011,33 @@ typedef ssize_t (*nghttp2_pack_extension_callback)(nghttp2_session *session, typedef int (*nghttp2_error_callback)(nghttp2_session *session, const char *msg, size_t len, void *user_data); +/** + * @functypedef + * + * Callback function invoked when library provides the error code, and + * message. This callback is solely for debugging purpose. + * |lib_error_code| is one of error code defined in + * :enum:`nghttp2_error`. The |msg| is typically NULL-terminated + * string of length |len|, and intended for human consumption. |len| + * does not include the sentinel NULL character. + * + * The format of error message may change between nghttp2 library + * versions. The application should not depend on the particular + * format. + * + * Normally, application should return 0 from this callback. If fatal + * error occurred while doing something in this callback, application + * should return :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. In this case, + * library will return immediately with return value + * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`. Currently, if nonzero value + * is returned from this callback, they are treated as + * :enum:`NGHTTP2_ERR_CALLBACK_FAILURE`, but application should not + * rely on this details. + */ +typedef int (*nghttp2_error_callback2)(nghttp2_session *session, + int lib_error_code, const char *msg, + size_t len, void *user_data); + struct nghttp2_session_callbacks; /** @@ -2267,10 +2302,30 @@ nghttp2_session_callbacks_set_on_extension_chunk_recv_callback( * * Sets callback function invoked when library tells error message to * the application. + * + * This function is deprecated. The new application should use + * `nghttp2_session_callbacks_set_error_callback2()`. + * + * If both :type:`nghttp2_error_callback` and + * :type:`nghttp2_error_callback2` are set, the latter takes + * precedence. */ NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback( nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback); +/** + * @function + * + * Sets callback function invoked when library tells error code, and + * message to the application. + * + * If both :type:`nghttp2_error_callback` and + * :type:`nghttp2_error_callback2` are set, the latter takes + * precedence. + */ +NGHTTP2_EXTERN void nghttp2_session_callbacks_set_error_callback2( + nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2); + /** * @functypedef * @@ -4702,8 +4757,8 @@ nghttp2_hd_deflate_change_table_size(nghttp2_hd_deflater *deflater, * * After this function returns, it is safe to delete the |nva|. * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: + * This function returns the number of bytes written to |buf| if it + * succeeds, or one of the following negative error codes: * * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. @@ -4734,8 +4789,8 @@ NGHTTP2_EXTERN ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, * * After this function returns, it is safe to delete the |nva|. * - * This function returns 0 if it succeeds, or one of the following - * negative error codes: + * This function returns the number of bytes written to |vec| if it + * succeeds, or one of the following negative error codes: * * :enum:`NGHTTP2_ERR_NOMEM` * Out of memory. diff --git a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h index 38c48bf041f1e8..455706a5868b3a 100644 --- a/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h +++ b/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h @@ -29,7 +29,7 @@ * @macro * Version number of the nghttp2 library release */ -#define NGHTTP2_VERSION "1.25.0" +#define NGHTTP2_VERSION "1.29.0" /** * @macro @@ -37,6 +37,6 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define NGHTTP2_VERSION_NUM 0x011900 +#define NGHTTP2_VERSION_NUM 0x011d00 #endif /* NGHTTP2VER_H */ diff --git a/deps/nghttp2/lib/nghttp2_buf.h b/deps/nghttp2/lib/nghttp2_buf.h index 06ab1e4c630cc3..9f484a221acb5f 100644 --- a/deps/nghttp2/lib/nghttp2_buf.h +++ b/deps/nghttp2/lib/nghttp2_buf.h @@ -398,7 +398,7 @@ int nghttp2_bufs_advance(nghttp2_bufs *bufs); void nghttp2_bufs_seek_last_present(nghttp2_bufs *bufs); /* - * Returns nonzero if bufs->cur->next is not emtpy. + * Returns nonzero if bufs->cur->next is not empty. */ int nghttp2_bufs_next_present(nghttp2_bufs *bufs); diff --git a/deps/nghttp2/lib/nghttp2_callbacks.c b/deps/nghttp2/lib/nghttp2_callbacks.c index b6cf5957f01b59..3c38214859b17a 100644 --- a/deps/nghttp2/lib/nghttp2_callbacks.c +++ b/deps/nghttp2/lib/nghttp2_callbacks.c @@ -168,3 +168,8 @@ void nghttp2_session_callbacks_set_error_callback( nghttp2_session_callbacks *cbs, nghttp2_error_callback error_callback) { cbs->error_callback = error_callback; } + +void nghttp2_session_callbacks_set_error_callback2( + nghttp2_session_callbacks *cbs, nghttp2_error_callback2 error_callback2) { + cbs->error_callback2 = error_callback2; +} diff --git a/deps/nghttp2/lib/nghttp2_callbacks.h b/deps/nghttp2/lib/nghttp2_callbacks.h index 5967524e0c6493..b607bbb58b8e3d 100644 --- a/deps/nghttp2/lib/nghttp2_callbacks.h +++ b/deps/nghttp2/lib/nghttp2_callbacks.h @@ -119,6 +119,7 @@ struct nghttp2_session_callbacks { nghttp2_unpack_extension_callback unpack_extension_callback; nghttp2_on_extension_chunk_recv_callback on_extension_chunk_recv_callback; nghttp2_error_callback error_callback; + nghttp2_error_callback2 error_callback2; }; #endif /* NGHTTP2_CALLBACKS_H */ diff --git a/deps/nghttp2/lib/nghttp2_frame.h b/deps/nghttp2/lib/nghttp2_frame.h index 891289f61bf5e7..35ca214a4a7a59 100644 --- a/deps/nghttp2/lib/nghttp2_frame.h +++ b/deps/nghttp2/lib/nghttp2_frame.h @@ -70,7 +70,9 @@ #define NGHTTP2_MAX_PADLEN 256 /* Union of extension frame payload */ -typedef union { nghttp2_ext_altsvc altsvc; } nghttp2_ext_frame_payload; +typedef union { + nghttp2_ext_altsvc altsvc; +} nghttp2_ext_frame_payload; void nghttp2_frame_pack_frame_hd(uint8_t *buf, const nghttp2_frame_hd *hd); diff --git a/deps/nghttp2/lib/nghttp2_hd.h b/deps/nghttp2/lib/nghttp2_hd.h index 458edafe4d5847..760bfbc357efdc 100644 --- a/deps/nghttp2/lib/nghttp2_hd.h +++ b/deps/nghttp2/lib/nghttp2_hd.h @@ -211,7 +211,9 @@ typedef struct { #define HD_MAP_SIZE 128 -typedef struct { nghttp2_hd_entry *table[HD_MAP_SIZE]; } nghttp2_hd_map; +typedef struct { + nghttp2_hd_entry *table[HD_MAP_SIZE]; +} nghttp2_hd_map; struct nghttp2_hd_deflater { nghttp2_hd_context ctx; @@ -313,7 +315,7 @@ void nghttp2_hd_deflate_free(nghttp2_hd_deflater *deflater); * * This function expands |bufs| as necessary to store the result. If * buffers is full and the process still requires more space, this - * funtion fails and returns NGHTTP2_ERR_HEADER_COMP. + * function fails and returns NGHTTP2_ERR_HEADER_COMP. * * After this function returns, it is safe to delete the |nva|. * diff --git a/deps/nghttp2/lib/nghttp2_helper.c b/deps/nghttp2/lib/nghttp2_helper.c index b00c9073a92a13..3b282c7301f95b 100644 --- a/deps/nghttp2/lib/nghttp2_helper.c +++ b/deps/nghttp2/lib/nghttp2_helper.c @@ -322,6 +322,9 @@ const char *nghttp2_strerror(int error_code) { return "Internal error"; case NGHTTP2_ERR_CANCEL: return "Cancel"; + case NGHTTP2_ERR_SETTINGS_EXPECTED: + return "When a local endpoint expects to receive SETTINGS frame, it " + "receives an other type of frame"; case NGHTTP2_ERR_NOMEM: return "Out of memory"; case NGHTTP2_ERR_CALLBACK_FAILURE: diff --git a/deps/nghttp2/lib/nghttp2_outbound_item.h b/deps/nghttp2/lib/nghttp2_outbound_item.h index 8bda776bfe2728..89a8a92668dd5c 100644 --- a/deps/nghttp2/lib/nghttp2_outbound_item.h +++ b/deps/nghttp2/lib/nghttp2_outbound_item.h @@ -112,7 +112,7 @@ struct nghttp2_outbound_item { nghttp2_ext_frame_payload ext_frame_payload; nghttp2_aux_data aux_data; /* The priority used in priority comparion. Smaller is served - ealier. For PING, SETTINGS and non-DATA frames (excluding + earlier. For PING, SETTINGS and non-DATA frames (excluding response HEADERS frame) have dedicated cycle value defined above. For DATA frame, cycle is computed by taking into account of effective weight and frame payload length previously sent, so diff --git a/deps/nghttp2/lib/nghttp2_pq.h b/deps/nghttp2/lib/nghttp2_pq.h index 1426bef760132c..71cf96a14e0c77 100644 --- a/deps/nghttp2/lib/nghttp2_pq.h +++ b/deps/nghttp2/lib/nghttp2_pq.h @@ -35,7 +35,9 @@ /* Implementation of priority queue */ -typedef struct { size_t index; } nghttp2_pq_entry; +typedef struct { + size_t index; +} nghttp2_pq_entry; typedef struct { /* The pointer to the pointer to the item stored */ @@ -71,7 +73,7 @@ void nghttp2_pq_free(nghttp2_pq *pq); /* * Adds |item| to the priority queue |pq|. * - * This function returns 0 if it succeds, or one of the following + * This function returns 0 if it succeeds, or one of the following * negative error codes: * * NGHTTP2_ERR_NOMEM diff --git a/deps/nghttp2/lib/nghttp2_queue.h b/deps/nghttp2/lib/nghttp2_queue.h index d872b07bde961c..c7eb753ca92182 100644 --- a/deps/nghttp2/lib/nghttp2_queue.h +++ b/deps/nghttp2/lib/nghttp2_queue.h @@ -36,7 +36,9 @@ typedef struct nghttp2_queue_cell { struct nghttp2_queue_cell *next; } nghttp2_queue_cell; -typedef struct { nghttp2_queue_cell *front, *back; } nghttp2_queue; +typedef struct { + nghttp2_queue_cell *front, *back; +} nghttp2_queue; void nghttp2_queue_init(nghttp2_queue *queue); void nghttp2_queue_free(nghttp2_queue *queue); diff --git a/deps/nghttp2/lib/nghttp2_session.c b/deps/nghttp2/lib/nghttp2_session.c index 4bc94cbb1982ad..b14ed77a25c293 100644 --- a/deps/nghttp2/lib/nghttp2_session.c +++ b/deps/nghttp2/lib/nghttp2_session.c @@ -148,14 +148,16 @@ static int check_ext_type_set(const uint8_t *ext_types, uint8_t type) { } static int session_call_error_callback(nghttp2_session *session, - const char *fmt, ...) { + int lib_error_code, const char *fmt, + ...) { size_t bufsize; va_list ap; char *buf; int rv; nghttp2_mem *mem; - if (!session->callbacks.error_callback) { + if (!session->callbacks.error_callback && + !session->callbacks.error_callback2) { return 0; } @@ -189,8 +191,13 @@ static int session_call_error_callback(nghttp2_session *session, return 0; } - rv = session->callbacks.error_callback(session, buf, (size_t)rv, - session->user_data); + if (session->callbacks.error_callback2) { + rv = session->callbacks.error_callback2(session, lib_error_code, buf, + (size_t)rv, session->user_data); + } else { + rv = session->callbacks.error_callback(session, buf, (size_t)rv, + session->user_data); + } nghttp2_mem_free(mem, buf); @@ -541,9 +548,8 @@ static int session_new(nghttp2_session **session_ptr, if (nghttp2_enable_strict_preface) { nghttp2_inbound_frame *iframe = &(*session_ptr)->iframe; - if (server && - ((*session_ptr)->opt_flags & NGHTTP2_OPTMASK_NO_RECV_CLIENT_MAGIC) == - 0) { + if (server && ((*session_ptr)->opt_flags & + NGHTTP2_OPTMASK_NO_RECV_CLIENT_MAGIC) == 0) { iframe->state = NGHTTP2_IB_READ_CLIENT_MAGIC; iframe->payloadleft = NGHTTP2_CLIENT_MAGIC_LEN; } else { @@ -2183,7 +2189,7 @@ static int session_prep_frame(nghttp2_session *session, closed. */ stream = nghttp2_session_get_stream(session, frame->hd.stream_id); - /* predicte should fail if stream is NULL. */ + /* predicate should fail if stream is NULL. */ rv = session_predicate_push_promise_send(session, stream); if (rv != 0) { return rv; @@ -2411,19 +2417,16 @@ static int session_close_stream_on_goaway(nghttp2_session *session, nghttp2_stream *stream, *next_stream; nghttp2_close_stream_on_goaway_arg arg = {session, NULL, last_stream_id, incoming}; - uint32_t error_code; rv = nghttp2_map_each(&session->streams, find_stream_on_goaway_func, &arg); assert(rv == 0); - error_code = - session->server && incoming ? NGHTTP2_REFUSED_STREAM : NGHTTP2_CANCEL; - stream = arg.head; while (stream) { next_stream = stream->closed_next; stream->closed_next = NULL; - rv = nghttp2_session_close_stream(session, stream->stream_id, error_code); + rv = nghttp2_session_close_stream(session, stream->stream_id, + NGHTTP2_REFUSED_STREAM); /* stream may be deleted here */ @@ -3608,7 +3611,7 @@ static int inflate_header_block(nghttp2_session *session, nghttp2_frame *frame, nv.name->base, (int)nv.value->len, nv.value->base); rv2 = session_call_error_callback( - session, + session, NGHTTP2_ERR_HTTP_HEADER, "Ignoring received invalid HTTP header field: frame type: " "%u, stream: %d, name: [%.*s], value: [%.*s]", frame->hd.type, frame->hd.stream_id, (int)nv.name->len, @@ -3626,8 +3629,9 @@ static int inflate_header_block(nghttp2_session *session, nghttp2_frame *frame, nv.name->base, (int)nv.value->len, nv.value->base); rv = session_call_error_callback( - session, "Invalid HTTP header field was received: frame type: " - "%u, stream: %d, name: [%.*s], value: [%.*s]", + session, NGHTTP2_ERR_HTTP_HEADER, + "Invalid HTTP header field was received: frame type: " + "%u, stream: %d, name: [%.*s], value: [%.*s]", frame->hd.type, frame->hd.stream_id, (int)nv.name->len, nv.name->base, (int)nv.value->len, nv.value->base); @@ -3781,7 +3785,7 @@ int nghttp2_session_on_request_headers_received(nghttp2_session *session, session, frame, NGHTTP2_ERR_PROTO, "request HEADERS: stream_id == 0"); } - /* If client recieves idle stream from server, it is invalid + /* If client receives idle stream from server, it is invalid regardless stream ID is even or odd. This is because client is not expected to receive request from server. */ if (!session->server) { @@ -5345,9 +5349,10 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in, iframe->state = NGHTTP2_IB_IGN_ALL; rv = session_call_error_callback( - session, "Remote peer returned unexpected data while we expected " - "SETTINGS frame. Perhaps, peer does not support HTTP/2 " - "properly."); + session, NGHTTP2_ERR_SETTINGS_EXPECTED, + "Remote peer returned unexpected data while we expected " + "SETTINGS frame. Perhaps, peer does not support HTTP/2 " + "properly."); if (nghttp2_is_fatal(rv)) { return rv; @@ -5588,13 +5593,13 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session, const uint8_t *in, if (iframe->payloadleft) { nghttp2_settings_entry *min_header_table_size_entry; - /* We allocate iv with addtional one entry, to store the + /* We allocate iv with additional one entry, to store the minimum header table size. */ iframe->max_niv = iframe->frame.hd.length / NGHTTP2_FRAME_SETTINGS_ENTRY_LENGTH + 1; - iframe->iv = nghttp2_mem_malloc( - mem, sizeof(nghttp2_settings_entry) * iframe->max_niv); + iframe->iv = nghttp2_mem_malloc(mem, sizeof(nghttp2_settings_entry) * + iframe->max_niv); if (!iframe->iv) { return NGHTTP2_ERR_NOMEM; diff --git a/deps/nghttp2/lib/nghttp2_session.h b/deps/nghttp2/lib/nghttp2_session.h index 3e1467f6a356d7..c7cb27d77c1e25 100644 --- a/deps/nghttp2/lib/nghttp2_session.h +++ b/deps/nghttp2/lib/nghttp2_session.h @@ -319,7 +319,7 @@ struct nghttp2_session { uint8_t pending_enable_push; /* Nonzero if the session is server side. */ uint8_t server; - /* Flags indicating GOAWAY is sent and/or recieved. The flags are + /* Flags indicating GOAWAY is sent and/or received. The flags are composed by bitwise OR-ing nghttp2_goaway_flag. */ uint8_t goaway_flags; /* This flag is used to reduce excessive queuing of WINDOW_UPDATE to @@ -722,7 +722,7 @@ int nghttp2_session_on_goaway_received(nghttp2_session *session, nghttp2_frame *frame); /* - * Called when WINDOW_UPDATE is recieved, assuming |frame| is properly + * Called when WINDOW_UPDATE is received, assuming |frame| is properly * initialized. * * This function returns 0 if it succeeds, or one of the following @@ -737,7 +737,7 @@ int nghttp2_session_on_window_update_received(nghttp2_session *session, nghttp2_frame *frame); /* - * Called when ALTSVC is recieved, assuming |frame| is properly + * Called when ALTSVC is received, assuming |frame| is properly * initialized. * * This function returns 0 if it succeeds, or one of the following diff --git a/deps/nghttp2/lib/nghttp2_stream.c b/deps/nghttp2/lib/nghttp2_stream.c index 8dee6ef660983c..eccd3174ef7bda 100644 --- a/deps/nghttp2/lib/nghttp2_stream.c +++ b/deps/nghttp2/lib/nghttp2_stream.c @@ -366,8 +366,9 @@ static void check_queued(nghttp2_stream *stream) { } } if (queued == 0) { - fprintf(stderr, "stream(%p)=%d, stream->queued == 1, and " - "!stream_active(), but no descendants is queued\n", + fprintf(stderr, + "stream(%p)=%d, stream->queued == 1, and " + "!stream_active(), but no descendants is queued\n", stream, stream->stream_id); assert(0); } @@ -378,9 +379,10 @@ static void check_queued(nghttp2_stream *stream) { } } else { if (stream_active(stream) || !nghttp2_pq_empty(&stream->obq)) { - fprintf(stderr, "stream(%p) = %d, stream->queued == 0, but " - "stream_active(stream) == %d and " - "nghttp2_pq_size(&stream->obq) = %zu\n", + fprintf(stderr, + "stream(%p) = %d, stream->queued == 0, but " + "stream_active(stream) == %d and " + "nghttp2_pq_size(&stream->obq) = %zu\n", stream, stream->stream_id, stream_active(stream), nghttp2_pq_size(&stream->obq)); assert(0); diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index 8d24a458c10643..108ecf905913b7 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -7,7 +7,7 @@ language: node_js matrix: include: # LTS is our most important target - - node_js: "6" + - node_js: "8" # DEPLOY_VERSION is used to set the couchapp setup mode for test/tap/registry.js # only gather coverage info for LTS env: DEPLOY_VERSION=testing COVERALLS_REPO_TOKEN="$COVERALLS_OPTIONAL_TOKEN" @@ -17,10 +17,12 @@ matrix: # previous LTS is next most important - node_js: "4" env: DEPLOY_VERSION=testing + - node_js: "6" + env: DEPLOY_VERSION=testing - node_js: "7" env: DEPLOY_VERSION=testing # then master - - node_js: "8" + - node_js: "9" env: DEPLOY_VERSION=testing script: - "standard" diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 9f3aadba0eb2dc..014462125a90a3 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -526,3 +526,13 @@ Carsten Brandt Marcin Szczepanski Josh Clow Jakub Holy +Alexandra Ulsh +Tom MacWright +Felicio Mununga +Gabor Szabo +Andreas Müller +Andrew Pitman +Jacob Wejendorp +Alejandro López +Victor Belozyorov +Bradley Farias diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 1c650d724bd66d..0e42392d652854 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,238 @@ +## v5.6.0 (2017-11-27): + +### Features! + +You may have noticed this is a semver-minor bump. Wondering why? This is why! + +* [`bc263c3fd`](https://github.com/npm/npm/commit/bc263c3fde6ff4b04deee132d0a9d89379e28c27) + [#19054](https://github.com/npm/npm/pull/19054) + **Fully cross-platform `package-lock.json`**. Installing a failing optional + dependency on one platform no longer removes it from the dependency tree, + meaning that `package-lock.json` should now be generated consistently across + platforms! 🎉 + ([@iarna](https://github.com/iarna)) +* [`f94fcbc50`](https://github.com/npm/npm/commit/f94fcbc50d8aec7350164df898d1e12a1e3da77f) + [#19160](https://github.com/npm/npm/pull/19160) + Add `--package-lock-only` config option. This makes it so you can generate a + target `package-lock.json` without performing a full install of + `node_modules`. + ([@alopezsanchez](https://github.com/alopezsanchez)) +* [`66d18280c`](https://github.com/npm/npm/commit/66d18280ca320f880f4377cf80a8052491bbccbe) + [#19104](https://github.com/npm/npm/pull/19104) + Add new `--node-options` config to pass through a custom `NODE_OPTIONS` for + lifecycle scripts. + ([@bmeck](https://github.com/bmeck)) +* [`114d518c7`](https://github.com/npm/npm/commit/114d518c75732c42acbef3acab36ba1d0fd724e2) + Ignore mtime when packing tarballs: This means that doing `npm pack` on the + same repository should yield two tarballs with the same checksum. This will + also help prevent cache bloat when using git dependencies. In the future, this + will allow npm to explicitly cache git dependencies. + ([@isaacs](https://github.com/isaacs)) + +### Performance + +* [`39ba4aa74`](https://github.com/npm/npm/commit/39ba4aa7479220e61573c0c1977124c2199f49d0) + `tar@4.1.0`: Reduce number of overall fs operations during packing/unpacking. + +### Node 9 + +Previously, it turns out npm broke on the latest Node, `node@9`. We went ahead +and fixed it up so y'all should be able to use the latest npm again! + +* [`4ca695819`](https://github.com/npm/npm/commit/4ca6958196ae41cef179473e3f7dbed9df9a32f1) + `minizlib@1.0.4`: `Fix node@9` incompatibility. + ([@isaacs](https://github.com/isaacs)) +* [`c851bb503`](https://github.com/npm/npm/commit/c851bb503a756b7cd48d12ef0e12f39e6f30c577) + `tar@4.0.2`: Fix `node@9` incompatibility. + ([@isaacs](https://github.com/isaacs)) +* [`6caf23096`](https://github.com/npm/npm/commit/6caf2309613d14ce77923ad3d1275cb89c6cf223) + Remove "unsupported" warning for Node 9 now that things are fixed. + ([@iarna](https://github.com/iarna)) +* [`1930b0f8c`](https://github.com/npm/npm/commit/1930b0f8c44373301edc9fb6ccdf7efcb350fa42) + Update test matrix with `node@8` LTS and `node@9`. + ([@iarna](https://github.com/iarna)) + +### Bug Fixes + +* [`b70321733`](https://github.com/npm/npm/commit/b7032173361665a12c9e4200bdc3f0eb4dee682f) + [#18881](https://github.com/npm/npm/pull/18881) + When dealing with a `node_modules` that was created with older versions of npm + (and thus older versions of npa) we need to gracefully handle older spec + entries. Failing to do so results in us treating those packages as if they + were http remote deps, which results in invalid lock files with `version` set + to tarball URLs. This should now be fixed. + ([@iarna](https://github.com/iarna)) +* [`2f9c5dd00`](https://github.com/npm/npm/commit/2f9c5dd0046a53ece3482e92a412413f5aed6955) + [#18880](https://github.com/npm/npm/pull/18880) + Stop overwriting version in package data on disk. This is another safeguard + against the version overwriting that's plagued some folks upgrading from older + package-locks. + ([@iarna](https://github.com/iarna)) + ([@joshclow](https://github.com/joshclow)) +* [`a93e0a51d`](https://github.com/npm/npm/commit/a93e0a51d3dafc31c809ca28cd7dfa71b2836f86) + [#18846](https://github.com/npm/npm/pull/18846) + Correctly save transitive dependencies when using `npm update` in + `package-lock.json`. + ([@iarna](https://github.com/iarna)) +* [`fdde7b649`](https://github.com/npm/npm/commit/fdde7b649987b2acd9a37ef203f1e263fdf6fece) + [#18825](https://github.com/npm/npm/pull/18825) + Fix typo and concatenation in error handling. + ([@alulsh](https://github.com/alulsh)) +* [`be67de7b9`](https://github.com/npm/npm/commit/be67de7b90790cef0a9f63f91c2f1a00942205ee) + [#18711](https://github.com/npm/npm/pull/18711) + Upgrade to bearer tokens from legacy auth when enabling 2FA. + ([@iarna](https://github.com/iarna)) +* [`bfdf0fd39`](https://github.com/npm/npm/commit/bfdf0fd39646b03db8e543e2bec7092da7880596) + [#19033](https://github.com/npm/npm/pull/19033) + Fix issue where files with `@` signs in their names would not get included + when packing tarballs. + ([@zkat](https://github.com/zkat)) +* [`b65b89bde`](https://github.com/npm/npm/commit/b65b89bdeaa65516f3e13afdb6e9aeb22d8508f4) + [#19048](https://github.com/npm/npm/pull/19048) + Fix problem where `npm login` was ignoring various networking-related options, + such as custom certs. + ([@wejendorp](https://github.com/wejendorp)) +* [`8c194b86e`](https://github.com/npm/npm/commit/8c194b86ec9617e2bcc31f30ee4772469a0bb440) + `npm-packlist@1.1.10`: Include `node_modules/` directories not in the root. + ([@isaacs](https://github.com/isaacs)) +* [`d7ef6a20b`](https://github.com/npm/npm/commit/d7ef6a20b44e968cb92babab1beb51f99110781d) + `libnpx@9.7.1`: Fix some *nix binary path escaping issues. + ([@zkat](https://github.com/zkat)) +* [`981828466`](https://github.com/npm/npm/commit/981828466a5936c70abcccea319b227c443e812b) + `cacache@10.0.1`: Fix fallback to `copy-concurrently` when file move fails. + This might fix permissions and such issues on platforms that were getting + weird filesystem errors during install. + ([@karolba](https://github.com/karolba)) +* [`a0be6bafb`](https://github.com/npm/npm/commit/a0be6bafb6dd7acb3e7b717c27c8575a2215bfff) + `pacote@7.0.2`: Includes a bunch of fixes, specially for issues around git + dependencies. Shasum-related errors should be way less common now, too. + ([@zkat](https://github.com/zkat)) +* [`b80d650de`](https://github.com/npm/npm/commit/b80d650def417645d2525863e9f17af57a917b42) + [#19163](https://github.com/npm/npm/pull/19163) + Fix a number of git and tarball specs and checksum errors. + ([@zkat](https://github.com/zkat)) +* [`cac225025`](https://github.com/npm/npm/commit/cac225025fa06cd055286e75541138cd95f52def) + [#19054](https://github.com/npm/npm/pull/19054) + Don't count failed optionals when summarizing installed packages. + ([@iarna](https://github.com/iarna)) + +### UX + +* [`b1ec2885c`](https://github.com/npm/npm/commit/b1ec2885c43f8038c4e05b83253041992fdfe382) + [#18326](https://github.com/npm/npm/pull/18326) + Stop truncating output of `npm view`. This means, for example, that you no + longer need to use `--json` when a package has a lot of versions, to see the + whole list. + ([@SimenB](https://github.com/SimenB)) +* [`55a124e0a`](https://github.com/npm/npm/commit/55a124e0aa6097cb46f1484f666444b2a445ba57) + [#18884](https://github.com/npm/npm/pull/18884) + Profile UX improvements: better messaging on unexpected responses, and stop + claiming we set passwords to null when resetting them. + ([@iarna](https://github.com/iarna)) +* [`635481c61`](https://github.com/npm/npm/commit/635481c6143bbe10a6f89747795bf4b83f75a7e9) + [#18844](https://github.com/npm/npm/pull/18844) + Improve error messaging for OTP/2FA. + ([@iarna](https://github.com/iarna)) +* [`52b142ed5`](https://github.com/npm/npm/commit/52b142ed5e0f13f23c99209932e8de3f7649fd47) + [#19054](https://github.com/npm/npm/pull/19054) + Stop running the same rollback multiple times. This should address issues + where Windows users saw strange failures when `fsevents` failed to install. + ([@iarna](https://github.com/iarna)) +* [`798428b0b`](https://github.com/npm/npm/commit/798428b0b7b6cfd6ce98041c45fc0a36396e170c) + [#19172](https://github.com/npm/npm/pull/19172) + `bin-links@1.1.0`: Log the fact line endings are being changed upon install. + ([@marcosscriven](https://github.com/marcosscriven)) + +### Refactors + +Usually, we don't include internal refactor stuff in our release notes, but it's +worth calling out some of them because they're part of a larger effort the CLI +team and associates are undertaking to modularize npm itself so other package +managers and associated tools can reuse all that code! + +* [`9d22c96b7`](https://github.com/npm/npm/commit/9d22c96b7160729c8126a38dcf554611b9e3ba87) + [#18500](https://github.com/npm/npm/pull/18500) + Extract bin-links and gentle-fs to a separate library. This will allow + external tools to do bin linking and certain fs operations in an + npm-compatible way! + ([@mikesherov](https://github.com/mikesherov)) +* [`015a7803b`](https://github.com/npm/npm/commit/015a7803b7b63bc8543882196d987b92b461932d) + [#18883](https://github.com/npm/npm/pull/18883) + Capture logging from log events on the process global. This allows npm to use + npmlog to report logging from external libraries like `npm-profile`. + ([@iarna](https://github.com/iarna)) +* [`c930e98ad`](https://github.com/npm/npm/commit/c930e98adc03cef357ae5716269a04d74744a852) + `npm-lifecycle@2.0.0`: Use our own `node-gyp`. This means npm no longer needs + to pull some maneuvers to make sure `node-gyp` is in the right place, and that + external packages using `npm-lifecycle` will get working native builds without + having to do their own `node-gyp` maneuvers. + ([@zkochan](https://github.com/zkochan)) +* [`876f0c8f3`](https://github.com/npm/npm/commit/876f0c8f341f8915e338b409f4b8616bb5263500) [`829893d61`](https://github.com/npm/npm/commit/829893d617bf81bba0d1ce4ea303f76ea37a2b2d) + [#19099](https://github.com/npm/npm/pull/19099) + `find-npm-prefix@1.0.1`: npm's prefix-finding logic is now a standalone + module. That is, the logic that figures out where the root of your project is + if you've `cd`'d into a subdirectory. Did you know you can run `npm install` + from these subdirectories, and it'll only affect the root? It works like git! + ([@iarna](https://github.com/iarna)) + +### Docs + +* [`7ae12b21c`](https://github.com/npm/npm/commit/7ae12b21cc841f76417d3bb13b74f177319d4deb) + [#18823](https://github.com/npm/npm/pull/18823) + Fix spelling of the word authenticator. Because English is hard. + ([@tmcw](https://github.com/tmcw)) +* [`5dfc3ab7b`](https://github.com/npm/npm/commit/5dfc3ab7bc2cb0fa7d9a8c00aa95fecdd14d7ae1) + [#18742](https://github.com/npm/npm/pull/18742) + Explicitly state 'github:foo/bar' as a valid shorthand for hosted git specs. + ([@felicio](https://github.com/felicio)) +* [`a9dc098a6`](https://github.com/npm/npm/commit/a9dc098a6eb7a87895f52a101ac0d41492da698e) + [#18679](https://github.com/npm/npm/pull/18679) + Add some documentation about the `script-shell` config. + ([@gszabo](https://github.com/gszabo)) +* [`24d7734d1`](https://github.com/npm/npm/commit/24d7734d1a1e906c83c53b6d1853af8dc758a998) + [#18571](https://github.com/npm/npm/pull/18571) + Change `verboten` to `forbidden`. + ([@devmount](https://github.com/devmount)) +* [`a8a45668f`](https://github.com/npm/npm/commit/a8a45668fb9b8eb84234fe89234bdcdf644ead58) + [#18568](https://github.com/npm/npm/pull/18568) + Improve wording for the docs for the "engines" section of package.json files. + ([@apitman](https://github.com/apitman)) +* [`dbc7e5b60`](https://github.com/npm/npm/commit/dbc7e5b602870330a8cdaf63bd303cd9050f792f) + [#19118](https://github.com/npm/npm/pull/19118) + Use valid JSON in example for bundledDependencies. + ([@charmander](https://github.com/charmander)) +* [`779339485`](https://github.com/npm/npm/commit/779339485bab5137d0fdc68d1ed6fa987aa8965a) + [#19162](https://github.com/npm/npm/pull/19162) + Remove trailing white space from `npm access` docs. + ([@WispProxy](https://github.com/WispProxy)) + +### Dependency Bumps + +* [`0e7cac941`](https://github.com/npm/npm/commit/0e7cac9413ff1104cf242cc3006f42aa1c2ab63f) + `bluebird@3.5.1` + ([@petkaantonov](https://github.com/petkaantonov)) +* [`c4d5887d9`](https://github.com/npm/npm/commit/c4d5887d978849ddbe2673630de657f141ae5bcf) + `update-notifier@2.3.0` + ([@sindresorhus](https://github.com/sindresorhus)) +* [`eb19a9691`](https://github.com/npm/npm/commit/eb19a9691cf76fbc9c5b66aa7aadb5d905af467a) + `npm-package-arg@6.0.0` + ([@zkat](https://github.com/zkat)) +* [`91d5dca96`](https://github.com/npm/npm/commit/91d5dca96772bc5c45511ddcbeeb2685c7ea68e8) + `npm-profile@2.0.5` + ([@iarna](https://github.com/iarna)) +* [`8de66c46e`](https://github.com/npm/npm/commit/8de66c46e57e4b449c9540c8ecafbc4fd58faff5) + `ssri@5.0.0` + ([@zkat](https://github.com/zkat)) +* [`cfbc3ea69`](https://github.com/npm/npm/commit/cfbc3ea69a8c62dc8e8543193c3ac472631dcef9) + `worker-farm@1.5.1` + ([@rvagg](https://github.com/rvagg)) +* [`60c228160`](https://github.com/npm/npm/commit/60c228160f22d41c2b36745166c9e8c2d84fee58) + `query-string@5.0.1` + ([@sindresorhus](https://github.com/sindresorhus)) +* [`72cad8c66`](https://github.com/npm/npm/commit/72cad8c664efd8eb1bec9a418bccd6c6ca9290de) + `copy-concurrently@1.0.5` + ([@iarna](https://github.com/iarna)) + ## v5.5.1 (2017-10-04): A very quick, record time, patch release, of a bug fix to a (sigh) last minute bug fix. diff --git a/deps/npm/doc/cli/npm-access.md b/deps/npm/doc/cli/npm-access.md index a338673c8d84a6..bbccfc70937c7f 100644 --- a/deps/npm/doc/cli/npm-access.md +++ b/deps/npm/doc/cli/npm-access.md @@ -29,7 +29,6 @@ subcommand. access to a package. * ls-packages: - Show all of the packages a user or a team is able to access, along with the access level, except for read-only public packages (it won't print the whole registry listing) diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md index 74e5e04bca4fd6..0489ddf94e046e 100644 --- a/deps/npm/doc/cli/npm-install.md +++ b/deps/npm/doc/cli/npm-install.md @@ -310,6 +310,9 @@ versions. The `--dry-run` argument will report in the usual way what the install would have done without actually installing anything. +The `--package-lock-only` argument will only update the `package-lock.json`, +instead of checking `node_modules` and downloading dependencies. + The `-f` or `--force` argument will force npm to fetch remote resources even if a local copy exists on disk. diff --git a/deps/npm/doc/cli/npm-run-script.md b/deps/npm/doc/cli/npm-run-script.md index c1ce3429537c03..ee907d8c73021b 100644 --- a/deps/npm/doc/cli/npm-run-script.md +++ b/deps/npm/doc/cli/npm-run-script.md @@ -44,6 +44,12 @@ instead of to run your tests. +The actual shell your script is run within is platform dependent. By default, +on Unix-like systems it is the `/bin/sh` command, on Windows it is the `cmd.exe`. +The actual shell referred to by `/bin/sh` also depends on the system. +As of [`npm@5.1.0`](https://github.com/npm/npm/releases/tag/v5.1.0) you can +customize the shell with the `script-shell` configuration. + Scripts are run from the root of the module, regardless of what your current working directory is when you call `npm run`. If you want your script to use different behavior based on what subdirectory you're in, you can use the @@ -69,3 +75,4 @@ You can use the `--silent` flag to prevent showing `npm ERR!` output on error. * npm-start(1) * npm-restart(1) * npm-stop(1) +* npm-config(7) diff --git a/deps/npm/doc/cli/npm-token.md b/deps/npm/doc/cli/npm-token.md index bc0d7596fe0cf4..82ab158af67eb4 100644 --- a/deps/npm/doc/cli/npm-token.md +++ b/deps/npm/doc/cli/npm-token.md @@ -5,11 +5,11 @@ npm-token(1) -- Manage your authentication tokens npm token list [--json|--parseable] npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16] - npm token delete + npm token revoke ## DESCRIPTION -This list you list, create and delete authentication tokens. +This list you list, create and revoke authentication tokens. * `npm token list`: Shows a table of all active authentication tokens. You can request this as @@ -52,7 +52,7 @@ This list you list, create and delete authentication tokens. +----------------+--------------------------------------+ ``` -* `npm token delete `: +* `npm token revoke `: This removes an authentication token, making it immediately unusable. This can accept both complete tokens (as you get back from `npm token create` and will find in your `.npmrc`) and ids as seen in the `npm token list` output. diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index 071d23a4159e7c..d91984d1d483b9 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -373,11 +373,13 @@ shortcut syntax you use for `npm install`: "repository": "npm/npm" + "repository": "github:user/repo" + "repository": "gist:11081aaa281" - "repository": "bitbucket:example/repo" + "repository": "bitbucket:user/repo" - "repository": "gitlab:another/repo" + "repository": "gitlab:user/repo" ## scripts @@ -618,7 +620,7 @@ If we define a package.json like this: "name": "awesome-web-framework", "version": "1.0.0", "bundledDependencies": [ - 'renderized', 'super-streams' + "renderized", "super-streams" ] } ``` @@ -678,7 +680,7 @@ are capable of properly installing your program. For example: { "engines" : { "npm" : "~1.0.20" } } Unless the user has set the `engine-strict` config flag, this -field is advisory only will produce warnings when your package is installed as a dependency. +field is advisory only and will only produce warnings when your package is installed as a dependency. ## engineStrict diff --git a/deps/npm/doc/misc/npm-coding-style.md b/deps/npm/doc/misc/npm-coding-style.md index a105b1aa53b39a..e6837bfbf3eb82 100644 --- a/deps/npm/doc/misc/npm-coding-style.md +++ b/deps/npm/doc/misc/npm-coding-style.md @@ -184,7 +184,7 @@ When something is intentionally missing or removed, set it to `null`. Don't set things to `undefined`. Reserve that value to mean "not yet set to anything." -Boolean objects are verboten. +Boolean objects are forbidden. ## SEE ALSO diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 3c9ec38817754e..0ab041891820a3 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -656,6 +656,15 @@ Any "%s" in the message will be replaced with the version number. The registry you want to send cli metrics to if `send-metrics` is true. +### node-options + +* Default: null +* Type: String + +Options to pass through to Node.js via the `NODE_OPTIONS` environment +variable. This does not impact how npm itself is executed but it does +impact how lifecycle scripts are called. + ### node-version * Default: process.version @@ -724,6 +733,14 @@ will also prevent _writing_ `package-lock.json` if `save` is true. This option is an alias for `--shrinkwrap`. +### package-lock-only + +* Default: false +* Type: Boolean + +If set to true, it will update only the `package-json`, +instead of checking `node_modules` and downloading dependencies. + ### parseable * Default: false diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 296bbb0697e58d..48f8433f62ecba 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -127,5 +127,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index ab140aade0c82a..5fb7cfb0029da5 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -33,8 +33,8 @@

SYNOPSIS

Add or remove the ability of users and teams to have read-only or read-write access to a package.

-
  • ls-packages:

    -

    Show all of the packages a user or a team is able to access, along with the +

  • ls-packages: +Show all of the packages a user or a team is able to access, along with the access level, except for read-only public packages (it won't print the whole registry listing)

  • @@ -86,5 +86,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index 282d6268b78b3c..90d247f5f5ed66 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -81,5 +81,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 9af0c17e26af55..677f621a9730f6 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 069bcf2938bfc6..3437dd4380ba39 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -55,5 +55,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index 091b28bb172a3f..51544a4532bf5c 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -40,5 +40,5 @@

    DESCRIPTION

           - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 7b4e0c71936ab5..94cf6ed12b4ae0 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index d2394086d4faea..71d5297a9cf9d6 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -89,5 +89,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index d94785492335cf..7a37048a8a7cc8 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -43,5 +43,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index 9dfa27aa5463a2..ccacfe9c39e490 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -68,5 +68,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index 1349617d0dab44..e21605193f0106 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -61,5 +61,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 32433db75a0f50..f82a6b6d18f76c 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html index 230013c3e2f7cb..6f8bc9744f2389 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -88,5 +88,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index e3cd2accf3d6f0..165159af15f912 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -56,5 +56,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-doctor.html b/deps/npm/html/doc/cli/npm-doctor.html index 4afb484fc3092a..8eba9f172d792f 100644 --- a/deps/npm/html/doc/cli/npm-doctor.html +++ b/deps/npm/html/doc/cli/npm-doctor.html @@ -103,4 +103,4 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 5a1f979d7a08c4..651990084dd4dd 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 97f2346320aeff..bab3a861ec25f1 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index 9e69e5612af52b..01b1ff62d2516a 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 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 3fca1c02dd7633..8adf3b3843c425 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -50,5 +50,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index 53f555d8790782..115c9b2185adc1 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -48,5 +48,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-install-test.html b/deps/npm/html/doc/cli/npm-install-test.html index 595cdd022985ee..71262400b3d716 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 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 2aa508a3facfb9..5989cc25a10dc8 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -255,6 +255,8 @@

    SYNOPSIS

    versions.

    The --dry-run argument will report in the usual way what the install would have done without actually installing anything.

    +

    The --package-lock-only argument will only update the package-lock.json, +instead of checking node_modules and downloading dependencies.

    The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk.

    npm install sax --force
    @@ -367,5 +369,5 @@ 

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index b93b23929f9135..57a6ae86731520 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -74,5 +74,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index 0d76cf93b39dcc..a06341b2d2dd19 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -51,5 +51,5 @@

    scope

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index 06c207de00c768..4ba0917179dc32 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -21,7 +21,7 @@

    SYNOPSIS

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

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

    @@ -110,5 +110,5 @@

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 707ea4bf9d3748..6b28ab48d15c74 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -54,5 +54,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index 73319eb3bfe213..35e6670bef21e5 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index 9eb3be589d7fb2..4b67c2686e9e17 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -36,5 +36,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 09bd66affe41d3..ebb2f6a3c60cff 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-profile.html b/deps/npm/html/doc/cli/npm-profile.html index 106695ee84f343..3d952205f435d5 100644 --- a/deps/npm/html/doc/cli/npm-profile.html +++ b/deps/npm/html/doc/cli/npm-profile.html @@ -90,4 +90,4 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index 0e03cd52e3814d..f71aa0c212fbc8 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -40,5 +40,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index 14bac448e3622b..c8a0b691e1364e 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -85,5 +85,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index 021ecf7f55123f..136192342a4b2f 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index fdf446784b70f6..12e6b1748efbd2 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 01f57667e48237..4f9aacecf1d68a 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -53,5 +53,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index a513f8c7a44563..a4e9aa9bd63505 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index 72b946b21e28f1..489fbccb093d72 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -40,6 +40,11 @@

    SYNOPSIS

    instead of

    "scripts": {"test": "node_modules/.bin/tap test/\*.js"}
     

    to run your tests.

    +

    The actual shell your script is run within is platform dependent. By default, +on Unix-like systems it is the /bin/sh command, on Windows it is the cmd.exe. +The actual shell referred to by /bin/sh also depends on the system. +As of npm@5.1.0 you can +customize the shell with the script-shell configuration.

    Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run. If you want your script to use different behavior based on what subdirectory you're in, you can use the @@ -61,6 +66,7 @@

    SEE ALSO

  • npm-start(1)
  • npm-restart(1)
  • npm-stop(1)
  • +
  • npm-config(7)
  • @@ -74,5 +80,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 413da85416ba10..df759928a739a2 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -109,5 +109,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index a8d3d7e5e9501c..629f5b69a7b0fa 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index dd57a76118a3a9..a957ff479f4d88 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -36,5 +36,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 060faeed4b6c49..ff6dbfb3143de4 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -36,5 +36,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index 6cd9df603bbff7..0c0dfb3ae1ea70 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -39,5 +39,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 7e795163b86a68..9c04332e681ffd 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -34,5 +34,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index a24bc6558ae980..81d74fa0a7faa6 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -67,5 +67,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index 1aaa8687c1c312..280e69f3a18ed9 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -36,5 +36,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-token.html b/deps/npm/html/doc/cli/npm-token.html index a2e4ce181494bf..8ec2f5fbec22b7 100644 --- a/deps/npm/html/doc/cli/npm-token.html +++ b/deps/npm/html/doc/cli/npm-token.html @@ -13,9 +13,9 @@

    npm-token

    Manage your authentica

    SYNOPSIS

    npm token list [--json|--parseable]
     npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16]
    -npm token delete <id|token>
    +npm token revoke <id|token>
     

    DESCRIPTION

    -

    This list you list, create and delete authentication tokens.

    +

    This list you list, create and revoke authentication tokens.

    • npm token list: Shows a table of all active authentication tokens. You can request this as @@ -55,7 +55,7 @@

      SYNOPSIS

      | created | 2017-10-02T07:52:24.838Z | +----------------+--------------------------------------+
      -
    • npm token delete <token|id>: +
    • npm token revoke <token|id>: This removes an authentication token, making it immediately unusable. This can accept both complete tokens (as you get back from npm token create and will find in your .npmrc) and ids as seen in the npm token list output. @@ -73,4 +73,4 @@

      SYNOPSIS

             - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 454f575ce3aa91..dd430d07966eaf 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -63,5 +63,5 @@

      SYNOPSIS

             - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index e278eb29efeceb..721de2828ffbc3 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -51,5 +51,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index c2ee6bfe1064a8..ddaf4104df1c98 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -118,5 +118,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index 5e1d389d777a4e..e8da71b67a0938 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -120,5 +120,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 691ea8ee431911..a94ea56271e91e 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -86,5 +86,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index f4190a368294b2..5995b1e11c572f 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -33,5 +33,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index c6a68d7652e07d..52f4a22544f00e 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -13,7 +13,7 @@

      npm

      javascript package manager

      SYNOPSIS

      npm <command> [args]
       

      VERSION

      -

      5.5.1

      +

      5.6.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 @@

      AUTHOR

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

      +i@izs.me

      SEE ALSO

      • npm-help(1)
      • @@ -150,5 +150,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index 295df46b520710..ff8a247b5a8fbc 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -181,5 +181,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index 295df46b520710..ff8a247b5a8fbc 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -181,5 +181,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index 6bf69dca1d3b06..3a6e77c9812970 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -281,11 +281,13 @@

        repository

        shortcut syntax you use for npm install:

        "repository": "npm/npm"
         
        +"repository": "github:user/repo"
        +
         "repository": "gist:11081aaa281"
         
        -"repository": "bitbucket:example/repo"
        +"repository": "bitbucket:user/repo"
         
        -"repository": "gitlab:another/repo"
        +"repository": "gitlab:user/repo"
         

        scripts

        The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle @@ -470,7 +472,7 @@

        bundledDependencies

        "name": "awesome-web-framework", "version": "1.0.0", "bundledDependencies": [ - 'renderized', 'super-streams' + "renderized", "super-streams" ] }

        we can obtain awesome-web-framework-1.0.0.tgz file by running npm pack. @@ -515,7 +517,7 @@

        engines

        are capable of properly installing your program. For example:

        { "engines" : { "npm" : "~1.0.20" } }
         

        Unless the user has set the engine-strict config flag, this -field is advisory only will produce warnings when your package is installed as a dependency.

        +field is advisory only and will only produce warnings when your package is installed as a dependency.

        engineStrict

        This feature was removed in npm 3.0.0

        Prior to npm 3.0.0, this feature was used to treat this package as if the @@ -601,5 +603,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npm-package-locks.html b/deps/npm/html/doc/files/npm-package-locks.html index 91b18778b91bec..775c6b4ca2a0de 100644 --- a/deps/npm/html/doc/files/npm-package-locks.html +++ b/deps/npm/html/doc/files/npm-package-locks.html @@ -145,4 +145,4 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npm-shrinkwrap.json.html b/deps/npm/html/doc/files/npm-shrinkwrap.json.html index 76a15983c36043..50718ad9fd5795 100644 --- a/deps/npm/html/doc/files/npm-shrinkwrap.json.html +++ b/deps/npm/html/doc/files/npm-shrinkwrap.json.html @@ -42,4 +42,4 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index 1fbd619fb6f44b..7441c92b7eda28 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -85,5 +85,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/package-lock.json.html b/deps/npm/html/doc/files/package-lock.json.html index fe2f07f4274922..3f6a2e21f56d12 100644 --- a/deps/npm/html/doc/files/package-lock.json.html +++ b/deps/npm/html/doc/files/package-lock.json.html @@ -124,4 +124,4 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 6bf69dca1d3b06..3a6e77c9812970 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -281,11 +281,13 @@

        repository

        shortcut syntax you use for npm install:

        "repository": "npm/npm"
         
        +"repository": "github:user/repo"
        +
         "repository": "gist:11081aaa281"
         
        -"repository": "bitbucket:example/repo"
        +"repository": "bitbucket:user/repo"
         
        -"repository": "gitlab:another/repo"
        +"repository": "gitlab:user/repo"
         

        scripts

        The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle @@ -470,7 +472,7 @@

        bundledDependencies

        "name": "awesome-web-framework", "version": "1.0.0", "bundledDependencies": [ - 'renderized', 'super-streams' + "renderized", "super-streams" ] }

        we can obtain awesome-web-framework-1.0.0.tgz file by running npm pack. @@ -515,7 +517,7 @@

        engines

        are capable of properly installing your program. For example:

        { "engines" : { "npm" : "~1.0.20" } }
         

        Unless the user has set the engine-strict config flag, this -field is advisory only will produce warnings when your package is installed as a dependency.

        +field is advisory only and will only produce warnings when your package is installed as a dependency.

        engineStrict

        This feature was removed in npm 3.0.0

        Prior to npm 3.0.0, this feature was used to treat this package as if the @@ -601,5 +603,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index 998683bafd9898..914307420c84d5 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -172,5 +172,5 @@

        semver(7)

               - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index 62569622aa3842..f96dd270bfa7ff 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -135,7 +135,7 @@

        null, undefined, false, 0

        When something is intentionally missing or removed, set it to null.

        Don't set things to undefined. Reserve that value to mean "not yet set to anything."

        -

        Boolean objects are verboten.

        +

        Boolean objects are forbidden.

        SEE ALSO

        • npm-developers(7)
        • @@ -153,5 +153,5 @@

          SEE ALSO

                 - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index cd989b0832650f..a23b10727af0f7 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -564,6 +564,14 @@

          metrics-registry

        • Type: String

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

        +

        node-options

        +
          +
        • Default: null
        • +
        • Type: String
        • +
        +

        Options to pass through to Node.js via the NODE_OPTIONS environment +variable. This does not impact how npm itself is executed but it does +impact how lifecycle scripts are called.

        node-version

        • Default: process.version
        • @@ -621,6 +629,13 @@

          package-lock

          If set to false, then ignore package-lock.json files when installing. This will also prevent writing package-lock.json if save is true.

          This option is an alias for --shrinkwrap.

          +

          package-lock-only

          +
            +
          • Default: false
          • +
          • Type: Boolean
          • +
          +

          If set to true, it will update only the package-json, +instead of checking node_modules and downloading dependencies.

          parseable

          • Default: false
          • @@ -1009,5 +1024,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index b6a570f33ae482..bdf212ed4b1859 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -204,5 +204,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index 265d7587d500ab..fdf53fcad0c460 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -20,7 +20,7 @@

            npm-disputes

            Handling Module

            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 @@

            DESCRIPTION

          • 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 @@

            EXCEPTIONS

            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 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 2dd78912097566..927748e176c958 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -172,5 +172,5 @@

            semver(7)

                   - + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index 07ab32833d548b..5a11a10ca812a8 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -86,5 +86,5 @@

            Team Admins create teams

                   - + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index 23d6de02a48e11..cfa610d0e8d481 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -90,5 +90,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index f6e107ed04afe8..e610f3e9e36784 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -99,5 +99,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index b24fb3d74727a7..bc43c028f106ad 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -239,5 +239,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index 5e50674c544870..1727455c627b47 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -57,5 +57,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index ccbedc47b7dd01..afe72d3099907b 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -336,5 +336,5 @@

            Ranges

                   - + diff --git a/deps/npm/lib/auth/legacy.js b/deps/npm/lib/auth/legacy.js index 4c75ca67317821..92bf44c119af39 100644 --- a/deps/npm/lib/auth/legacy.js +++ b/deps/npm/lib/auth/legacy.js @@ -4,6 +4,8 @@ const profile = require('npm-profile') const log = require('npmlog') const npm = require('../npm.js') const output = require('../utils/output.js') +const pacoteOpts = require('../config/pacote') +const fetchOpts = require('../config/fetch-opts') module.exports.login = function login (creds, registry, scope, cb) { let username = creds.username || '' @@ -22,10 +24,13 @@ module.exports.login = function login (creds, registry, scope, cb) { email = e return profile.login(username, password, {registry: registry, auth: auth}).catch((err) => { if (err.code === 'EOTP') throw err - return profile.adduser(username, email, password, {registry: registry}) + return profile.adduser(username, email, password, { + registry: registry, + opts: fetchOpts.fromPacote(pacoteOpts()) + }) }).catch((err) => { if (err.code === 'EOTP' && !auth.otp) { - return read.otp('Authenicator provided OTP:').then((otp) => { + return read.otp('Authenticator provided OTP:').then((otp) => { auth.otp = otp return profile.login(username, password, {registry: registry, auth: auth}) }) diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js index 6a788bc8575c2b..395f9437b4576c 100644 --- a/deps/npm/lib/build.js +++ b/deps/npm/lib/build.js @@ -10,21 +10,14 @@ var npm = require('./npm.js') var log = require('npmlog') var chain = require('slide').chain -var fs = require('graceful-fs') var path = require('path') +var fs = require('graceful-fs') var lifecycle = require('./utils/lifecycle.js') var readJson = require('read-package-json') -var link = require('./utils/link.js') -var linkIfExists = link.ifExists -var cmdShim = require('cmd-shim') -var cmdShimIfExists = cmdShim.ifExists -var isHashbangFile = require('./utils/is-hashbang-file.js') -var dos2Unix = require('./utils/convert-line-endings.js').dos2Unix -var asyncMap = require('slide').asyncMap +var binLinks = require('bin-links') +var binLinksConfig = require('./config/bin-links.js') var ini = require('ini') var writeFile = require('write-file-atomic') -var packageId = require('./utils/package-id.js') -var output = require('./utils/output.js') module.exports = build build.usage = 'npm build []' @@ -74,7 +67,8 @@ function build_ (global, didPre, didRB) { if (er) return cb(er) chain([ !didPre && [lifecycle, pkg, 'preinstall', folder], - [linkStuff, pkg, folder, global, didRB], + [linkStuff, pkg, folder, global], + !didRB && [rebuildBundles, pkg, folder], [writeBuiltinConf, pkg, folder], didPre !== build._noLC && [lifecycle, pkg, 'install', folder], didPre !== build._noLC && [lifecycle, pkg, 'postinstall', folder] @@ -102,35 +96,13 @@ var writeBuiltinConf = build.writeBuiltinConf = function (pkg, folder, cb) { writeFile(path.resolve(folder, 'npmrc'), data, cb) } -var linkStuff = build.linkStuff = function (pkg, folder, global, didRB, cb) { +var linkStuff = build.linkStuff = function (pkg, folder, global, cb) { // allow to opt out of linking binaries. if (npm.config.get('bin-links') === false) return cb() - - // if it's global, and folder is in {prefix}/node_modules, - // then bins are in {prefix}/bin - // otherwise, then bins are in folder/../.bin - var parent = pkg.name && pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder) - var gnm = global && npm.globalDir - var gtop = parent === gnm - - log.info('linkStuff', packageId(pkg)) - log.silly('linkStuff', packageId(pkg), 'has', parent, 'as its parent node_modules') - if (global) log.silly('linkStuff', packageId(pkg), 'is part of a global install') - if (gnm) log.silly('linkStuff', packageId(pkg), 'is installed into a global node_modules') - if (gtop) log.silly('linkStuff', packageId(pkg), 'is installed into the top-level global node_modules') - - asyncMap( - [linkBins, linkMans, !didRB && rebuildBundles], - function (fn, cb) { - if (!fn) return cb() - log.verbose(fn.name, packageId(pkg)) - fn(pkg, folder, parent, gtop, cb) - }, - cb - ) + return binLinks(pkg, folder, global, binLinksConfig(pkg), cb) } -function rebuildBundles (pkg, folder, parent, gtop, cb) { +function rebuildBundles (pkg, folder, cb) { if (!npm.config.get('rebuild-bundle')) return cb() var deps = Object.keys(pkg.dependencies || {}) @@ -166,89 +138,3 @@ function rebuildBundles (pkg, folder, parent, gtop, cb) { }), cb) }) } - -function linkBins (pkg, folder, parent, gtop, cb) { - if (!pkg.bin || !gtop && path.basename(parent) !== 'node_modules') { - return cb() - } - var binRoot = gtop ? npm.globalBin - : path.resolve(parent, '.bin') - log.verbose('linkBins', [pkg.bin, binRoot, gtop]) - - asyncMap(Object.keys(pkg.bin), function (b, cb) { - linkBin( - path.resolve(folder, pkg.bin[b]), - path.resolve(binRoot, b), - gtop && folder, - function (er) { - if (er) return cb(er) - // bins should always be executable. - // XXX skip chmod on windows? - var src = path.resolve(folder, pkg.bin[b]) - fs.chmod(src, npm.modes.exec, function (er) { - if (er && er.code === 'ENOENT' && npm.config.get('ignore-scripts')) { - return cb() - } - if (er) return cb(er) - isHashbangFile(src).then((isHashbang) => { - if (isHashbang) return dos2Unix(src) - }).then(() => { - if (!gtop) return cb() - var dest = path.resolve(binRoot, b) - var out = npm.config.get('parseable') - ? dest + '::' + src + ':BINFILE' - : dest + ' -> ' + src - if (!npm.config.get('json') && !npm.config.get('parseable')) output(out) - cb() - }).catch(cb) - }) - } - ) - }, cb) -} - -function linkBin (from, to, gently, cb) { - if (process.platform !== 'win32') { - return linkIfExists(from, to, gently, cb) - } else { - return cmdShimIfExists(from, to, cb) - } -} - -function linkMans (pkg, folder, parent, gtop, cb) { - if (!pkg.man || !gtop || process.platform === 'win32') return cb() - - var manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man') - log.verbose('linkMans', 'man files are', pkg.man, 'in', manRoot) - - // make sure that the mans are unique. - // otherwise, if there are dupes, it'll fail with EEXIST - var set = pkg.man.reduce(function (acc, man) { - acc[path.basename(man)] = man - return acc - }, {}) - pkg.man = pkg.man.filter(function (man) { - return set[path.basename(man)] === man - }) - - asyncMap(pkg.man, function (man, cb) { - if (typeof man !== 'string') return cb() - log.silly('linkMans', 'preparing to link', man) - var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) - if (!parseMan) { - return cb(new Error( - man + ' is not a valid name for a man file. ' + - 'Man files must end with a number, ' + - 'and optionally a .gz suffix if they are compressed.' - )) - } - - var stem = parseMan[1] - var sxn = parseMan[2] - var bn = path.basename(stem) - var manSrc = path.resolve(folder, man) - var manDest = path.join(manRoot, 'man' + sxn, bn) - - linkIfExists(manSrc, manDest, gtop && folder, cb) - }, cb) -} diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index af1ac57e719bd3..8bd2d5fcb1aea4 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -4,6 +4,7 @@ const BB = require('bluebird') const assert = require('assert') const cacache = require('cacache') +const finished = BB.promisify(require('mississippi').finished) const log = require('npmlog') const npa = require('npm-package-arg') const npm = require('./npm.js') @@ -105,7 +106,7 @@ function add (args, where) { log.verbose('cache add', 'spec', spec) if (!spec) return BB.reject(new Error(usage)) log.silly('cache add', 'parsed spec', spec) - return pacote.prefetch(spec, pacoteOpts({where})) + return finished(pacote.tarball.stream(spec, pacoteOpts({where})).resume()) } cache.verify = verify diff --git a/deps/npm/lib/config/bin-links.js b/deps/npm/lib/config/bin-links.js new file mode 100644 index 00000000000000..1ee90cc35e92f5 --- /dev/null +++ b/deps/npm/lib/config/bin-links.js @@ -0,0 +1,32 @@ +'use strict' + +const npm = require('../npm.js') +var packageId = require('../utils/package-id.js') +const log = require('npmlog') + +module.exports = binLinksOpts + +function binLinksOpts (pkg) { + return { + ignoreScripts: npm.config.get('ignore-scripts'), + force: npm.config.get('force'), + globalBin: npm.globalBin, + globalDir: npm.globalDir, + json: npm.config.get('json'), + log: log, + name: 'npm', + parseable: npm.config.get('parseable'), + pkgId: packageId(pkg), + prefix: npm.config.get('prefix'), + prefixes: [ + npm.prefix, + npm.globalPrefix, + npm.dir, + npm.root, + npm.globalDir, + npm.bin, + npm.globalBin + ], + umask: npm.config.get('umask') + } +} diff --git a/deps/npm/lib/config/core.js b/deps/npm/lib/config/core.js index 15a1674b3daf91..50cf4772e79f48 100644 --- a/deps/npm/lib/config/core.js +++ b/deps/npm/lib/config/core.js @@ -225,7 +225,6 @@ Conf.prototype.loadPrefix = require('./load-prefix.js') Conf.prototype.loadCAFile = require('./load-cafile.js') Conf.prototype.loadUid = require('./load-uid.js') Conf.prototype.setUser = require('./set-user.js') -Conf.prototype.findPrefix = require('./find-prefix.js') Conf.prototype.getCredentialsByURI = require('./get-credentials-by-uri.js') Conf.prototype.setCredentialsByURI = require('./set-credentials-by-uri.js') Conf.prototype.clearCredentialsByURI = require('./clear-credentials-by-uri.js') diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js index 35617fd6381428..c049f213fa76d1 100644 --- a/deps/npm/lib/config/defaults.js +++ b/deps/npm/lib/config/defaults.js @@ -176,6 +176,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { maxsockets: 50, message: '%s', 'metrics-registry': null, + 'node-options': null, 'node-version': process.version, 'offline': false, 'onload-script': false, @@ -183,6 +184,7 @@ Object.defineProperty(exports, 'defaults', {get: function () { optional: true, otp: null, 'package-lock': true, + 'package-lock-only': false, parseable: false, 'prefer-offline': false, 'prefer-online': false, @@ -308,6 +310,7 @@ exports.types = { maxsockets: Number, message: String, 'metrics-registry': [null, String], + 'node-options': [null, String], 'node-version': [null, semver], offline: Boolean, 'onload-script': [null, String], @@ -315,6 +318,7 @@ exports.types = { optional: Boolean, 'package-lock': Boolean, otp: Number, + 'package-lock-only': Boolean, parseable: Boolean, 'prefer-offline': Boolean, 'prefer-online': Boolean, diff --git a/deps/npm/lib/config/fetch-opts.js b/deps/npm/lib/config/fetch-opts.js new file mode 100644 index 00000000000000..1a030c378ea09c --- /dev/null +++ b/deps/npm/lib/config/fetch-opts.js @@ -0,0 +1,77 @@ +'use strict' + +const url = require('url') + +module.exports.fromPacote = fromPacote + +function fromPacote (opts) { + return { + cache: getCacheMode(opts), + cacheManager: opts.cache, + ca: opts.ca, + cert: opts.cert, + headers: getHeaders('', opts.registry, opts), + key: opts.key, + localAddress: opts.localAddress, + maxSockets: opts.maxSockets, + proxy: opts.proxy, + referer: opts.refer, + retry: opts.retry, + strictSSL: !!opts.strictSSL, + timeout: opts.timeout, + uid: opts.uid, + gid: opts.gid + } +} + +function getCacheMode (opts) { + return opts.offline + ? 'only-if-cached' + : opts.preferOffline + ? 'force-cache' + : opts.preferOnline + ? 'no-cache' + : 'default' +} + +function getHeaders (uri, registry, opts) { + const headers = Object.assign({ + 'npm-in-ci': opts.isFromCI, + 'npm-scope': opts.projectScope, + 'npm-session': opts.npmSession, + 'user-agent': opts.userAgent, + 'referer': opts.refer + }, opts.headers) + // check for auth settings specific to this registry + let auth = ( + opts.auth && + opts.auth[registryKey(registry)] + ) || opts.auth + // If a tarball is hosted on a different place than the manifest, only send + // credentials on `alwaysAuth` + const shouldAuth = auth && ( + auth.alwaysAuth || + url.parse(uri).host === url.parse(registry).host + ) + if (shouldAuth && auth.token) { + headers.authorization = `Bearer ${auth.token}` + } else if (shouldAuth && auth.username && auth.password) { + const encoded = Buffer.from( + `${auth.username}:${auth.password}`, 'utf8' + ).toString('base64') + headers.authorization = `Basic ${encoded}` + } else if (shouldAuth && auth._auth) { + headers.authorization = `Basic ${auth._auth}` + } + return headers +} + +function registryKey (registry) { + const parsed = url.parse(registry) + const formatted = url.format({ + host: parsed.host, + pathname: parsed.pathname, + slashes: parsed.slashes + }) + return url.resolve(formatted, '.') +} diff --git a/deps/npm/lib/config/find-prefix.js b/deps/npm/lib/config/find-prefix.js deleted file mode 100644 index 58f5cc8040b4d6..00000000000000 --- a/deps/npm/lib/config/find-prefix.js +++ /dev/null @@ -1,56 +0,0 @@ -// try to find the most reasonable prefix to use - -module.exports = findPrefix - -var fs = require('fs') -var path = require('path') - -function findPrefix (p, cb_) { - function cb (er, p) { - process.nextTick(function () { - cb_(er, p) - }) - } - - p = path.resolve(p) - // if there's no node_modules folder, then - // walk up until we hopefully find one. - // if none anywhere, then use cwd. - var walkedUp = false - while (path.basename(p) === 'node_modules') { - p = path.dirname(p) - walkedUp = true - } - if (walkedUp) return cb(null, p) - - findPrefix_(p, p, cb) -} - -function findPrefix_ (p, original, cb) { - if (p === '/' || - (process.platform === 'win32' && p.match(/^[a-zA-Z]:(\\|\/)?$/))) { - return cb(null, original) - } - fs.readdir(p, function (er, files) { - // an error right away is a bad sign. - // unless the prefix was simply a non - // existent directory. - if (er && p === original) { - if (er.code === 'ENOENT') return cb(null, original) - return cb(er) - } - - // walked up too high or something. - if (er) return cb(null, original) - - if (files.indexOf('node_modules') !== -1 || - files.indexOf('package.json') !== -1) { - return cb(null, p) - } - - var d = path.dirname(p) - if (d === p) return cb(null, original) - - return findPrefix_(d, original, cb) - }) -} diff --git a/deps/npm/lib/config/gentle-fs.js b/deps/npm/lib/config/gentle-fs.js new file mode 100644 index 00000000000000..c4a1f9fa22db43 --- /dev/null +++ b/deps/npm/lib/config/gentle-fs.js @@ -0,0 +1,32 @@ +'use strict' + +const npm = require('../npm.js') +const log = require('npmlog') + +module.exports = gentleFSOpts + +function gentleFSOpts (gently, base, abs) { + return { + // never rm the root, prefix, or bin dirs + // + // globals included because of `npm link` -- as far as the package + // requesting the link is concerned, the linked package is always + // installed globally + prefixes: [ + npm.prefix, + npm.globalPrefix, + npm.dir, + npm.root, + npm.globalDir, + npm.bin, + npm.globalBin + ], + absolute: abs, + log: log, + prefix: npm.prefix, + force: npm.config.get('force'), + gently: gently, + base: base, + name: 'npm' + } +} diff --git a/deps/npm/lib/config/lifecycle.js b/deps/npm/lib/config/lifecycle.js index 5fca93939db5fe..86941edcd8e45b 100644 --- a/deps/npm/lib/config/lifecycle.js +++ b/deps/npm/lib/config/lifecycle.js @@ -18,6 +18,7 @@ function lifecycleOpts (moreOpts) { ignorePrepublish: npm.config.get('ignore-prepublish'), ignoreScripts: npm.config.get('ignore-scripts'), log: log, + nodeOptions: npm.config.get('node-options'), production: npm.config.get('production'), scriptShell: npm.config.get('script-shell'), scriptsPrependNodePath: npm.config.get('scripts-prepend-node-path'), diff --git a/deps/npm/lib/config/load-prefix.js b/deps/npm/lib/config/load-prefix.js index bb5d9f3be56bf1..c2af00c7f61da5 100644 --- a/deps/npm/lib/config/load-prefix.js +++ b/deps/npm/lib/config/load-prefix.js @@ -1,6 +1,6 @@ module.exports = loadPrefix -var findPrefix = require('./find-prefix.js') +var findPrefix = require('find-npm-prefix') var path = require('path') function loadPrefix (cb) { @@ -43,9 +43,9 @@ function loadPrefix (cb) { p = path.resolve(cli.prefix) process.nextTick(cb) } else { - findPrefix(process.cwd(), function (er, found) { + findPrefix(process.cwd()).then((found) => { p = found - cb(er) - }) + cb() + }, cb) } } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 029f806f835b45..42906f2394e895 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -106,6 +106,8 @@ var mkdirp = require('mkdirp') var rimraf = require('rimraf') var iferr = require('iferr') var validate = require('aproba') +var uniq = require('lodash.uniq') +var Bluebird = require('bluebird') // npm internal utils var npm = require('./npm.js') @@ -132,6 +134,7 @@ var decomposeActions = require('./install/decompose-actions.js') var validateTree = require('./install/validate-tree.js') var validateArgs = require('./install/validate-args.js') var saveRequested = require('./install/save.js').saveRequested +var saveShrinkwrap = require('./install/save.js').saveShrinkwrap var getSaveType = require('./install/save.js').getSaveType var doSerialActions = require('./install/actions.js').doSerial var doReverseSerialActions = require('./install/actions.js').doReverseSerial @@ -199,8 +202,9 @@ function install (where, args, cb) { new Installer(where, dryrun, args).run(cb) } -function Installer (where, dryrun, args) { - validate('SBA', arguments) +function Installer (where, dryrun, args, opts) { + validate('SBA|SBAO', arguments) + if (!opts) opts = {} this.where = where this.dryrun = dryrun this.args = args @@ -215,23 +219,40 @@ function Installer (where, dryrun, args) { this.progress = {} this.noPackageJsonOk = !!args.length this.topLevelLifecycles = !args.length - this.dev = npm.config.get('dev') || (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || /^dev(elopment)?$/.test(npm.config.get('only')) - this.prod = !/^dev(elopment)?$/.test(npm.config.get('only')) - this.rollback = npm.config.get('rollback') - this.link = npm.config.get('link') - this.global = this.where === path.resolve(npm.globalDir, '..') + + const dev = npm.config.get('dev') + const only = npm.config.get('only') + const onlyProd = /^prod(uction)?$/.test(only) + const onlyDev = /^dev(elopment)?$/.test(only) + const prod = npm.config.get('production') + this.dev = opts.dev != null ? opts.dev : dev || (!onlyProd && !prod) || onlyDev + this.prod = opts.prod != null ? opts.prod : !onlyDev + + this.packageLockOnly = opts.packageLockOnly != null + ? opts.packageLockOnly : npm.config.get('package-lock-only') + this.rollback = opts.rollback != null ? opts.rollback : npm.config.get('rollback') + this.link = opts.link != null ? opts.link : npm.config.get('link') + this.saveOnlyLock = opts.saveOnlyLock + this.global = opts.global != null ? opts.global : this.where === path.resolve(npm.globalDir, '..') this.started = Date.now() } Installer.prototype = {} Installer.prototype.run = function (_cb) { - validate('F', arguments) - - var cb = function (err) { - saveMetrics(!err) - return _cb.apply(this, arguments) + validate('F|', arguments) + + var result + var cb + if (_cb) { + cb = function (err) { + saveMetrics(!err) + return _cb.apply(this, arguments) + } + } else { + result = new Promise((resolve, reject) => { + cb = (err, value) => err ? reject(err) : resolve(value) + }) } - // FIXME: This is bad and I should feel bad. // lib/install needs to have some way of sharing _limited_ // state with the things it calls. Passing the object is too @@ -274,7 +295,11 @@ Installer.prototype.run = function (_cb) { [this, this.debugActions, 'diffTrees', 'differences'], [this, this.debugActions, 'decomposeActions', 'todo']) - if (!this.dryrun) { + + if (this.packageLockOnly) { + postInstallSteps.push( + [this, this.saveToDependencies]) + } else if (!this.dryrun) { installSteps.push( [this.newTracker(log, 'executeActions', 8)], [this, this.executeActions], @@ -296,6 +321,7 @@ Installer.prototype.run = function (_cb) { // until after we extract them [this, (next) => { computeMetadata(this.idealTree); next() }], [this, this.pruneIdealTree], + [this, this.debugLogicalTree, 'saveTree', 'idealTree'], [this, this.saveToDependencies]) } } @@ -319,6 +345,7 @@ Installer.prototype.run = function (_cb) { cb(installEr || postInstallEr, self.getInstalledModules(), self.idealTree) }) }) + return result } Installer.prototype.loadArgMetadata = function (next) { @@ -544,17 +571,15 @@ Installer.prototype.executeActions = function (cb) { Installer.prototype.rollbackFailedOptional = function (staging, actionsToRun, cb) { if (!this.rollback) return cb() - var failed = actionsToRun.map(function (action) { + var failed = uniq(actionsToRun.map(function (action) { return action[1] }).filter(function (pkg) { return pkg.failed && pkg.rollback - }) + })) var top = this.currentTree && this.currentTree.path - asyncMap(failed, function (pkg, next) { - asyncMap(pkg.rollback, function (rollback, done) { - rollback(top, staging, pkg, done) - }, next) - }, cb) + Bluebird.map(failed, (pkg) => { + return Bluebird.map(pkg.rollback, (rollback) => rollback(top, staging, pkg)) + }).asCallback(cb) } Installer.prototype.commit = function (staging, actionsToRun, cb) { @@ -609,7 +634,11 @@ Installer.prototype.saveToDependencies = function (cb) { validate('F', arguments) if (this.failing) return cb() log.silly('install', 'saveToDependencies') - saveRequested(this.idealTree, cb) + if (this.saveOnlyLock) { + saveShrinkwrap(this.idealTree, cb) + } else { + saveRequested(this.idealTree, cb) + } } Installer.prototype.readGlobalPackageData = function (cb) { @@ -747,6 +776,8 @@ Installer.prototype.printInstalledForHuman = function (diffs, cb) { var moved = 0 diffs.forEach(function (action) { var mutation = action[0] + var pkg = action[1] + if (pkg.failed) return if (mutation === 'remove') { ++removed } else if (mutation === 'move') { @@ -885,11 +916,33 @@ Installer.prototype.debugActions = function (name, actionListName, cb) { // to define the arguments for use by chain before the property exists yet. Installer.prototype.debugTree = function (name, treeName, cb) { validate('SSF', arguments) - log.silly(name, this.prettify(this[treeName]).trim()) + log.silly(name, this.archyDebugTree(this[treeName]).trim()) + cb() +} + +Installer.prototype.archyDebugTree = function (tree) { + validate('O', arguments) + var seen = new Set() + function byName (aa, bb) { + return packageId(aa).localeCompare(packageId(bb)) + } + function expandTree (tree) { + seen.add(tree) + return { + label: packageId(tree), + nodes: tree.children.filter((tree) => { return !seen.has(tree) && !tree.removed }).sort(byName).map(expandTree) + } + } + return archy(expandTree(tree), '', { unicode: npm.config.get('unicode') }) +} + +Installer.prototype.debugLogicalTree = function (name, treeName, cb) { + validate('SSF', arguments) + this[treeName] && log.silly(name, this.archyDebugLogicalTree(this[treeName]).trim()) cb() } -Installer.prototype.prettify = function (tree) { +Installer.prototype.archyDebugLogicalTree = function (tree) { validate('O', arguments) var seen = new Set() function byName (aa, bb) { @@ -899,7 +952,7 @@ Installer.prototype.prettify = function (tree) { seen.add(tree) return { label: packageId(tree), - nodes: tree.children.filter((tree) => { return !seen.has(tree) && !tree.removed && !tree.failed }).sort(byName).map(expandTree) + nodes: tree.requires.filter((tree) => { return !seen.has(tree) && !tree.removed }).sort(byName).map(expandTree) } } return archy(expandTree(tree), '', { unicode: npm.config.get('unicode') }) diff --git a/deps/npm/lib/install/action/build.js b/deps/npm/lib/install/action/build.js index f59b852e84821f..be2c141f0dc97b 100644 --- a/deps/npm/lib/install/action/build.js +++ b/deps/npm/lib/install/action/build.js @@ -7,7 +7,7 @@ var packageId = require('../../utils/package-id.js') module.exports = function (staging, pkg, log, next) { log.silly('build', packageId(pkg)) chain([ - [build.linkStuff, pkg.package, pkg.path, npm.config.get('global'), true], + [build.linkStuff, pkg.package, pkg.path, npm.config.get('global')], [build.writeBuiltinConf, pkg.package, pkg.path] ], next) } diff --git a/deps/npm/lib/install/action/extract.js b/deps/npm/lib/install/action/extract.js index 8e80d4adda383f..6b827f36ea92fd 100644 --- a/deps/npm/lib/install/action/extract.js +++ b/deps/npm/lib/install/action/extract.js @@ -16,6 +16,7 @@ let pacoteOpts const path = require('path') const localWorker = require('./extract-worker.js') const workerFarm = require('worker-farm') +const isRegistry = require('../../utils/is-registry.js') const WORKER_PATH = require.resolve('./extract-worker.js') let workers @@ -72,7 +73,7 @@ function extract (staging, pkg, log) { let msg = args const spec = typeof args[0] === 'string' ? npa(args[0]) : args[0] args[0] = spec.raw - if (ENABLE_WORKERS && (spec.registry || spec.type === 'remote')) { + if (ENABLE_WORKERS && (isRegistry(spec) || spec.type === 'remote')) { // We can't serialize these options opts.loglevel = opts.log.level opts.log = null diff --git a/deps/npm/lib/install/action/fetch.js b/deps/npm/lib/install/action/fetch.js index 474e00b05c9e8d..a4d760fe829a2b 100644 --- a/deps/npm/lib/install/action/fetch.js +++ b/deps/npm/lib/install/action/fetch.js @@ -1,5 +1,8 @@ 'use strict' +const BB = require('bluebird') + +const finished = BB.promisify(require('mississippi').finished) const packageId = require('../../utils/package-id.js') const pacote = require('pacote') const pacoteOpts = require('../../config/pacote') @@ -8,5 +11,6 @@ module.exports = fetch function fetch (staging, pkg, log, next) { log.silly('fetch', packageId(pkg)) const opts = pacoteOpts({integrity: pkg.package._integrity}) - pacote.prefetch(pkg.package._requested, opts).then(() => next(), next) + return finished(pacote.tarball.stream(pkg.package._requested, opts)) + .then(() => next(), next) } diff --git a/deps/npm/lib/install/action/finalize.js b/deps/npm/lib/install/action/finalize.js index a50ec8a6bdbfc8..e46f1b9d833966 100644 --- a/deps/npm/lib/install/action/finalize.js +++ b/deps/npm/lib/install/action/finalize.js @@ -7,11 +7,13 @@ const mkdirp = Bluebird.promisify(require('mkdirp')) const lstat = Bluebird.promisify(fs.lstat) const readdir = Bluebird.promisify(fs.readdir) const symlink = Bluebird.promisify(fs.symlink) -const gentlyRm = require('../../utils/gently-rm') +const gentlyRm = Bluebird.promisify(require('../../utils/gently-rm')) const moduleStagingPath = require('../module-staging-path.js') const move = require('move-concurrently') const moveOpts = {fs: fs, Promise: Bluebird, maxConcurrency: 4} const getRequested = require('../get-requested.js') +const log = require('npmlog') +const packageId = require('../../utils/package-id.js') module.exports = function (staging, pkg, log) { log.silly('finalize', pkg.realpath) @@ -88,8 +90,17 @@ module.exports = function (staging, pkg, log) { } } -module.exports.rollback = function (top, staging, pkg, next) { - const requested = pkg.package._requested || getRequested(pkg) - if (requested && requested.type === 'directory') return next() - gentlyRm(pkg.path, false, top, next) +module.exports.rollback = function (top, staging, pkg) { + return Bluebird.try(() => { + const requested = pkg.package._requested || getRequested(pkg) + if (requested && requested.type === 'directory') return Promise.resolve() + // strictly speaking rolling back a finalize should ONLY remove module that + // was being finalized, not any of the things under it. But currently + // those modules are guaranteed to be useless so we may as well remove them too. + // When/if we separate `commit` step and can rollback to previous versions + // of upgraded modules then we'll need to revisit this… + return gentlyRm(pkg.path, false, top).catch((err) => { + log.warn('rollback', `Rolling back ${packageId(pkg)} failed (this is probably harmless): ${err.message ? err.message : err}`) + }) + }) } diff --git a/deps/npm/lib/install/action/refresh-package-json.js b/deps/npm/lib/install/action/refresh-package-json.js index 42f80121006d33..32e64444445cbd 100644 --- a/deps/npm/lib/install/action/refresh-package-json.js +++ b/deps/npm/lib/install/action/refresh-package-json.js @@ -14,7 +14,7 @@ module.exports = function (staging, pkg, log) { return readJson(path.join(pkg.path, 'package.json'), false).then((metadata) => { Object.keys(pkg.package).forEach(function (key) { - if (key !== 'dependencies' && !isEmpty(pkg.package[key])) { + if (key !== 'version' && key !== 'dependencies' && !isEmpty(pkg.package[key])) { metadata[key] = pkg.package[key] } }) diff --git a/deps/npm/lib/install/actions.js b/deps/npm/lib/install/actions.js index 9f0dcfa5dc2996..9608a943a5aeec 100644 --- a/deps/npm/lib/install/actions.js +++ b/deps/npm/lib/install/actions.js @@ -83,10 +83,8 @@ function markAsFailed (pkg) { if (pkg.failed) return pkg.failed = true pkg.requires.forEach((req) => { - req.requiredBy = req.requiredBy.filter((reqReqBy) => { - return reqReqBy !== pkg - }) - if (req.requiredBy.length === 0 && !req.userRequired) { + var requiredBy = req.requiredBy.filter((reqReqBy) => !reqReqBy.failed) + if (requiredBy.length === 0 && !req.userRequired) { markAsFailed(req) } }) @@ -94,12 +92,7 @@ function markAsFailed (pkg) { function handleOptionalDepErrors (pkg, err) { markAsFailed(pkg) - var anyFatal = pkg.userRequired || pkg.isTop - for (var ii = 0; ii < pkg.requiredBy.length; ++ii) { - var parent = pkg.requiredBy[ii] - var isFatal = failedDependency(parent, pkg) - if (isFatal) anyFatal = true - } + var anyFatal = failedDependency(pkg) if (anyFatal) { throw err } else { diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js index c93907a416337a..93c4adffd7e554 100644 --- a/deps/npm/lib/install/deps.js +++ b/deps/npm/lib/install/deps.js @@ -32,6 +32,7 @@ var reportOptionalFailure = require('./report-optional-failure.js') var getSaveType = require('./save.js').getSaveType var unixFormatPath = require('../utils/unix-format-path.js') var isExtraneous = require('./is-extraneous.js') +var isRegistry = require('../utils/is-registry.js') // The export functions in this module mutate a dependency tree, adding // items to them. @@ -121,7 +122,7 @@ function computeMetadata (tree, seen) { } } - tree.children.filter((child) => !child.removed && !child.failed).forEach((child) => computeMetadata(child, seen)) + tree.children.filter((child) => !child.removed).forEach((child) => computeMetadata(child, seen)) return tree } @@ -276,7 +277,7 @@ function isNotEmpty (value) { return value != null && value !== '' } -module.exports.computeVersionSpec = computeVersionSpec +exports.computeVersionSpec = computeVersionSpec function computeVersionSpec (tree, child) { validate('OO', arguments) var requested @@ -288,7 +289,7 @@ function computeVersionSpec (tree, child) { } else { requested = npa.resolve(child.package.name, child.package.version) } - if (requested.registry) { + if (isRegistry(requested)) { var version = child.package.version var rangeDescriptor = '' if (semver.valid(version, true) && @@ -308,10 +309,6 @@ function moduleNameMatches (name) { return function (child) { return moduleName(child) === name } } -function noModuleNameMatches (name) { - return function (child) { return moduleName(child) !== name } -} - // while this implementation does not require async calling, doing so // gives this a consistent interface with loadDeps et al exports.removeDeps = function (args, tree, saveToDependencies, next) { @@ -377,19 +374,12 @@ function isDepOptional (tree, name, pkg) { return false } -var failedDependency = exports.failedDependency = function (tree, name_pkg) { - var name - var pkg = {} - if (typeof name_pkg === 'string') { - name = name_pkg - } else { - pkg = name_pkg - name = moduleName(pkg) - } - tree.children = tree.children.filter(noModuleNameMatches(name)) - - if (isDepOptional(tree, name, pkg)) { - return false +exports.failedDependency = failedDependency +function failedDependency (tree, name, pkg) { + if (name) { + if (isDepOptional(tree, name, pkg || {})) { + return false + } } tree.failed = true @@ -398,17 +388,16 @@ var failedDependency = exports.failedDependency = function (tree, name_pkg) { if (tree.userRequired) return true - removeObsoleteDep(tree) - if (!tree.requiredBy) return false + let anyFailed = false for (var ii = 0; ii < tree.requiredBy.length; ++ii) { var requireParent = tree.requiredBy[ii] - if (failedDependency(requireParent, tree.package)) { - return true + if (failedDependency(requireParent, moduleName(tree), tree)) { + anyFailed = true } } - return false + return anyFailed } function andHandleOptionalErrors (log, tree, name, done) { @@ -418,7 +407,6 @@ function andHandleOptionalErrors (log, tree, name, done) { if (!er) return done(er, child, childLog) var isFatal = failedDependency(tree, name) if (er && !isFatal) { - tree.children = tree.children.filter(noModuleNameMatches(name)) reportOptionalFailure(tree, name, er) return done() } else { @@ -443,7 +431,7 @@ function prefetchDeps (tree, deps, log, next) { var allDependencies = Object.keys(deps).map((dep) => { return npa.resolve(dep, deps[dep]) }).filter((dep) => { - return dep.registry && + return isRegistry(dep) && !seen.has(dep.toString()) && !findRequirement(tree, dep.name, dep) }) @@ -601,8 +589,9 @@ function resolveWithNewModule (pkg, tree, log, next) { validate('OOOF', arguments) log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') - return isInstallable(pkg, iferr(next, function () { - addBundled(pkg, iferr(next, function () { + return isInstallable(pkg, (err) => { + let installable = !err + addBundled(pkg, (bundleErr) => { var parent = earliestInstallable(tree, tree, pkg) || tree var isLink = pkg._requested.type === 'directory' var child = createChild({ @@ -613,8 +602,9 @@ function resolveWithNewModule (pkg, tree, log, next) { children: pkg._bundled || [], isLink: isLink, isInLink: parent.isLink, - knownInstallable: true + knownInstallable: installable }) + if (!installable || bundleErr) child.failed = true delete pkg._bundled var hasBundled = child.children.length @@ -630,13 +620,14 @@ function resolveWithNewModule (pkg, tree, log, next) { } if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { - return inflateShrinkwrap(child, pkg._shrinkwrap, function (er) { - next(er, child, log) + return inflateShrinkwrap(child, pkg._shrinkwrap, (swErr) => { + if (swErr) child.failed = true + next(err || bundleErr || swErr, child, log) }) } - next(null, child, log) - })) - })) + next(err || bundleErr, child, log) + }) + }) } var validatePeerDeps = exports.validatePeerDeps = function (tree, onInvalid) { @@ -669,7 +660,7 @@ var findRequirement = exports.findRequirement = function (tree, name, requested, validate('OSO', [tree, name, requested]) if (!requestor) requestor = tree var nameMatch = function (child) { - return moduleName(child) === name && child.parent && !child.removed && !child.failed + return moduleName(child) === name && child.parent && !child.removed } var versionMatch = function (child) { return doesChildVersionMatch(child, requested, requestor) diff --git a/deps/npm/lib/install/diff-trees.js b/deps/npm/lib/install/diff-trees.js index ac4f421a5012b1..4316f351cc6f6a 100644 --- a/deps/npm/lib/install/diff-trees.js +++ b/deps/npm/lib/install/diff-trees.js @@ -6,41 +6,98 @@ var flattenTree = require('./flatten-tree.js') var isOnlyDev = require('./is-only-dev.js') var log = require('npmlog') var path = require('path') +var ssri = require('ssri') +var moduleName = require('../utils/module-name.js') -function nonRegistrySource (pkg) { - validate('O', arguments) - var requested = pkg._requested || (pkg._from && npa(pkg._from)) - if (!requested) return false +// we don't use get-requested because we're operating on files on disk, and +// we don't want to extropolate from what _should_ be there. +function pkgRequested (pkg) { + return pkg._requested || (pkg._resolved && npa(pkg._resolved)) || (pkg._from && npa(pkg._from)) +} - if (requested.type === 'hosted') return true - if (requested.type === 'file' || requested.type === 'directory') return true +function nonRegistrySource (requested) { + if (fromGit(requested)) return true + if (fromLocal(requested)) return true + if (fromRemote(requested)) return true return false } -function pkgAreEquiv (aa, bb) { - var aaSha = (aa.dist && aa.dist.integrity) || aa._integrity - var bbSha = (bb.dist && bb.dist.integrity) || bb._integrity - if (aaSha === bbSha) return true - if (aaSha || bbSha) return false - if (nonRegistrySource(aa) || nonRegistrySource(bb)) return false - if (aa.version === bb.version) return true +function fromRemote (requested) { + if (requested.type === 'remote') return true +} + +function fromLocal (requested) { + // local is an npm@3 type that meant "file" + if (requested.type === 'file' || requested.type === 'directory' || requested.type === 'local') return true + return false +} + +function fromGit (requested) { + if (requested.type === 'hosted' || requested.type === 'git') return true return false } -function getUniqueId (pkg) { - var versionspec = pkg._integrity +function pkgIntegrity (pkg) { + try { + // dist is provided by the registry + var sri = (pkg.dist && pkg.dist.integrity) || + // _integrity is provided by pacote + pkg._integrity || + // _shasum is legacy + (pkg._shasum && ssri.fromHex(pkg._shasum, 'sha1').toString()) + if (!sri) return + var integrity = ssri.parse(sri) + if (Object.keys(integrity).length === 0) return + return integrity + } catch (ex) { + return + } +} - if (!versionspec && nonRegistrySource(pkg)) { - if (pkg._requested) { - versionspec = pkg._requested.fetchSpec - } else if (pkg._from) { - versionspec = npa(pkg._from).fetchSpec +function sriMatch (aa, bb) { + if (!aa || !bb) return false + for (let algo of Object.keys(aa)) { + if (!bb[algo]) continue + for (let aaHash of aa[algo]) { + for (let bbHash of bb[algo]) { + return aaHash.digest === bbHash.digest + } } } - if (!versionspec) { - versionspec = pkg.version + return false +} + +function pkgAreEquiv (aa, bb) { + // coming in we know they share a path… + + // if they share package metadata _identity_, they're the same thing + if (aa.package === bb.package) return true + // if they share integrity information, they're the same thing + var aaIntegrity = pkgIntegrity(aa.package) + var bbIntegrity = pkgIntegrity(bb.package) + if (aaIntegrity || bbIntegrity) return sriMatch(aaIntegrity, bbIntegrity) + + // if they're links and they share the same target, they're the same thing + if (aa.isLink && bb.isLink) return aa.realpath === bb.realpath + + // if we can't determine both their sources then we have no way to know + // if they're the same thing, so we have to assume they aren't + var aaReq = pkgRequested(aa.package) + var bbReq = pkgRequested(bb.package) + if (!aaReq || !bbReq) return false + + if (fromGit(aaReq) && fromGit(bbReq)) { + // if both are git and share a _resolved specifier (one with the + // comittish replaced by a commit hash) then they're the same + return aa.package._resolved && bb.package._resolved && + aa.package._resolved === bb.package._resolved } - return pkg.name + '@' + versionspec + + // we have to give up trying to find matches for non-registry sources at this point… + if (nonRegistrySource(aaReq) || nonRegistrySource(bbReq)) return false + + // finally, if they ARE a registry source then version matching counts + return aa.package.version === bb.package.version } function pushAll (aa, bb) { @@ -118,41 +175,56 @@ var diffTrees = module.exports._diffTrees = function (oldTree, newTree) { var flatOldTree = flattenTree(oldTree) var flatNewTree = flattenTree(newTree) var toRemove = {} - var toRemoveByUniqueId = {} - // find differences + var toRemoveByName = {} + + // Build our tentative remove list. We don't add remove actions yet + // because we might resuse them as part of a move. Object.keys(flatOldTree).forEach(function (flatname) { + if (flatname === '/') return if (flatNewTree[flatname]) return var pkg = flatOldTree[flatname] if (pkg.isInLink && /^[.][.][/\\]/.test(path.relative(newTree.realpath, pkg.realpath))) return toRemove[flatname] = pkg - var pkgunique = getUniqueId(pkg.package) - if (!toRemoveByUniqueId[pkgunique]) toRemoveByUniqueId[pkgunique] = [] - toRemoveByUniqueId[pkgunique].push(flatname) + var name = moduleName(pkg) + if (!toRemoveByName[name]) toRemoveByName[name] = [] + toRemoveByName[name].push({flatname: flatname, pkg: pkg}) }) - Object.keys(flatNewTree).forEach(function (path) { - var pkg = flatNewTree[path] - pkg.oldPkg = flatOldTree[path] - if (pkg.oldPkg) { - if (!pkg.userRequired && pkgAreEquiv(pkg.oldPkg.package, pkg.package)) return + + // generate our add/update/move actions + Object.keys(flatNewTree).forEach(function (flatname) { + if (flatname === '/') return + var pkg = flatNewTree[flatname] + var oldPkg = pkg.oldPkg = flatOldTree[flatname] + if (oldPkg) { + // if the versions are equivalent then we don't need to update… unless + // the user explicitly asked us to. + if (!pkg.userRequired && pkgAreEquiv(oldPkg, pkg)) return setAction(differences, 'update', pkg) } else { - var vername = getUniqueId(pkg.package) - var removing = toRemoveByUniqueId[vername] && toRemoveByUniqueId[vername].length + var name = moduleName(pkg) + // find any packages we're removing that share the same name and are equivalent + var removing = (toRemoveByName[name] || []).filter((rm) => pkgAreEquiv(rm.pkg, pkg)) var bundlesOrFromBundle = pkg.fromBundle || pkg.package.bundleDependencies - if (removing && !bundlesOrFromBundle) { - var flatname = toRemoveByUniqueId[vername].shift() - pkg.fromPath = toRemove[flatname].path + // if we have any removes that match AND we're not working with a bundle then upgrade to a move + if (removing.length && !bundlesOrFromBundle) { + var toMv = removing.shift() + toRemoveByName[name] = toRemoveByName[name].filter((rm) => rm !== toMv) + pkg.fromPath = toMv.pkg.path setAction(differences, 'move', pkg) - delete toRemove[flatname] + delete toRemove[toMv.flatname] + // we don't generate add actions for things found in links (which already exist on disk) or + // for bundled modules (which will be installed when we install their parent) } else if (!(pkg.isInLink && pkg.fromBundle)) { setAction(differences, 'add', pkg) } } }) + + // finally generate our remove actions from any not consumed by moves Object .keys(toRemove) - .map((path) => toRemove[path]) + .map((flatname) => toRemove[flatname]) .forEach((pkg) => setAction(differences, 'remove', pkg)) const includeDev = npm.config.get('dev') || diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js index 48be93d0952e72..43ac9136f010f4 100644 --- a/deps/npm/lib/install/inflate-shrinkwrap.js +++ b/deps/npm/lib/install/inflate-shrinkwrap.js @@ -13,6 +13,7 @@ const npm = require('../npm.js') const realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier.js') const validate = require('aproba') const path = require('path') +const isRegistry = require('../utils/is-registry.js') module.exports = function (tree, sw, opts, finishInflating) { if (!fetchPackageMetadata) { @@ -147,7 +148,7 @@ function adaptResolved (requested, resolved) { const registry = requested.scope ? npm.config.get(`${requested.scope}:registry`) || npm.config.get('registry') : npm.config.get('registry') - if (!requested.registry || (resolved && resolved.indexOf(registry) === 0)) { + if (!isRegistry(requested) || (resolved && resolved.indexOf(registry) === 0)) { // Nothing to worry about here. Pass it through. return resolved } else { @@ -199,7 +200,7 @@ function childIsEquivalent (sw, requested, child) { if (child.isLink && requested.type === 'directory') return path.relative(child.realpath, requested.fetchSpec) === '' if (sw.resolved) return child.package._resolved === sw.resolved - if (!requested.registry && sw.from) return child.package._from === sw.from - if (!requested.registry && child.package._resolved) return sw.version === child.package._resolved + if (!isRegistry(requested) && sw.from) return child.package._from === sw.from + if (!isRegistry(requested) && child.package._resolved) return sw.version === child.package._resolved return child.package.version === sw.version } diff --git a/deps/npm/lib/install/realize-shrinkwrap-specifier.js b/deps/npm/lib/install/realize-shrinkwrap-specifier.js index ac700278fff9fa..e4b14b1f0d9597 100644 --- a/deps/npm/lib/install/realize-shrinkwrap-specifier.js +++ b/deps/npm/lib/install/realize-shrinkwrap-specifier.js @@ -1,5 +1,6 @@ 'use strict' var npa = require('npm-package-arg') +const isRegistry = require('../utils/is-registry.js') module.exports = function (name, sw, where) { try { @@ -7,7 +8,7 @@ module.exports = function (name, sw, where) { return npa.resolve(name, sw.version, where) } else if (sw.from) { const spec = npa(sw.from, where) - if (spec.registry && sw.version) { + if (isRegistry(spec) && sw.version) { return npa.resolve(name, sw.version, where) } else if (!sw.resolved) { return spec diff --git a/deps/npm/lib/install/save.js b/deps/npm/lib/install/save.js index e1a94fcff7a6ad..f0c61f555d64e4 100644 --- a/deps/npm/lib/install/save.js +++ b/deps/npm/lib/install/save.js @@ -39,6 +39,8 @@ function andWarnErrors (cb) { } } +exports.saveShrinkwrap = saveShrinkwrap + function saveShrinkwrap (tree, next) { validate('OF', arguments) if (!npm.config.get('shrinkwrap') || !npm.config.get('package-lock')) { diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index 54b8dcac7a428e..158d9b06456ba3 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -122,7 +122,7 @@ function linkInstall (pkgs, cb) { log.verbose('link', 'symlinking %s to %s', pp, target) cb() } ], - [symlink, pp, target], + [symlink, pp, target, false, false], // do not run any scripts rp && [build, [target], npm.config.get('global'), build._noLC, true], [resultPrinter, pkg, pp, target, rp] diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 3a84947f79fcd3..e58712603bf839 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -24,6 +24,16 @@ var npm = module.exports = new EventEmitter() var npmconf = require('./config/core.js') var log = require('npmlog') + var inspect = require('util').inspect + + // capture global logging + process.on('log', function (level) { + try { + return log[level].apply(log, [].slice.call(arguments, 1)) + } catch (ex) { + log.verbose('attempt to log ' + inspect(arguments) + ' crashed: ' + ex.message) + } + }) var path = require('path') var abbrev = require('abbrev') diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index c428482035c98b..f6a0eff805f50f 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -6,7 +6,6 @@ const BB = require('bluebird') -const cache = require('./cache') const cacache = require('cacache') const cp = require('child_process') const deprCheck = require('./utils/depr-check') @@ -18,6 +17,7 @@ const log = require('npmlog') const move = require('move-concurrently') const npm = require('./npm') const output = require('./utils/output') +const pacote = require('pacote') const pacoteOpts = require('./config/pacote') const path = require('path') const PassThrough = require('stream').PassThrough @@ -26,7 +26,6 @@ const pipe = BB.promisify(require('mississippi').pipe) const prepublishWarning = require('./utils/warn-deprecated')('prepublish-on-install') const pinflight = require('promise-inflight') const readJson = BB.promisify(require('read-package-json')) -const writeStreamAtomic = require('fs-write-stream-atomic') const tar = require('tar') const packlist = require('npm-packlist') @@ -69,12 +68,8 @@ function pack_ (pkg, dir) { return packDirectory(mani, mani._resolved, target) }) } else { - return cache.add(pkg).then((info) => { - return pipe( - cacache.get.stream.byDigest(pacoteOpts().cache, info.integrity || mani._integrity), - writeStreamAtomic(target) - ) - }).then(() => target) + return pacote.tarball.toFile(pkg, target, pacoteOpts()) + .then(() => target) } }) }) @@ -125,11 +120,15 @@ function packDirectory (mani, dir, target) { cwd: dir, prefix: 'package/', portable: true, + noMtime: true, gzip: true } return packlist({ path: dir }) - .then((files) => tar.create(tarOpt, files)) + // NOTE: node-tar does some Magic Stuff depending on prefixes for files + // specifically with @ signs, so we just neutralize that one + // and any such future "features" by prepending `./` + .then((files) => tar.create(tarOpt, files.map((f) => `./${f}`))) .then(() => move(tmpTarget, target, {Promise: BB, fs})) .then(() => lifecycle(pkg, 'postpack', dir)) .then(() => target) diff --git a/deps/npm/lib/profile.js b/deps/npm/lib/profile.js index 4238e142760828..587a26ca8b5e68 100644 --- a/deps/npm/lib/profile.js +++ b/deps/npm/lib/profile.js @@ -12,6 +12,7 @@ const qrcodeTerminal = require('qrcode-terminal') const url = require('url') const queryString = require('query-string') const pulseTillDone = require('./utils/pulse-till-done.js') +const inspect = require('util').inspect module.exports = profileCmd @@ -87,11 +88,11 @@ function config () { } const knownProfileKeys = qw` - name email ${'two factor auth'} fullname homepage + name email ${'two-factor auth'} fullname homepage freenode twitter github created updated` function get (args) { - const tfa = 'two factor auth' + const tfa = 'two-factor auth' const conf = config() return pulseTillDone.withPromise(profile.get(conf)).then((info) => { if (!info.cidr_whitelist) delete info.cidr_whitelist @@ -188,8 +189,10 @@ function set (args) { output(JSON.stringify({[prop]: result[prop]}, null, 2)) } else if (conf.parseable) { output(prop + '\t' + result[prop]) - } else { + } else if (result[prop] != null) { output('Set', prop, 'to', result[prop]) + } else { + output('Set', prop) } }) })) @@ -202,7 +205,7 @@ function enable2fa (args) { } const mode = args[0] || 'auth-and-writes' if (mode !== 'auth-only' && mode !== 'auth-and-writes') { - return Promise.reject(new Error(`Invalid two factor authentication mode "${mode}".\n` + + return Promise.reject(new Error(`Invalid two-factor authentication mode "${mode}".\n` + 'Valid modes are:\n' + ' auth-only - Require two-factor authentication only when logging in\n' + ' auth-and-writes - Require two-factor authentication when logging in AND when publishing')) @@ -210,16 +213,31 @@ function enable2fa (args) { const conf = config() if (conf.json || conf.parseable) { return Promise.reject(new Error( - 'Enabling two-factor authentication is an interactive opperation and ' + - (conf.json ? 'JSON' : 'parseable') + 'output mode is not available')) + 'Enabling two-factor authentication is an interactive operation and ' + + (conf.json ? 'JSON' : 'parseable') + ' output mode is not available')) } - log.notice('profile', 'Enabling two factor authentication for ' + mode) + const info = { tfa: { mode: mode } } - return readUserInfo.password().then((password) => { + + return Bluebird.try(() => { + // if they're using legacy auth currently then we have to update them to a + // bearer token before continuing. + if (conf.auth.basic) { + log.info('profile', 'Updating authentication to bearer token') + return profile.login(conf.auth.basic.username, conf.auth.basic.password, conf).then((result) => { + if (!result.token) throw new Error('Your registry ' + conf.registry + 'does not seem to support bearer tokens. Bearer tokens are required for two-factor authentication') + npm.config.setCredentialsByURI(conf.registry, {token: result.token}) + return Bluebird.fromNode((cb) => npm.config.save('user', cb)) + }) + } + }).then(() => { + log.notice('profile', 'Enabling two factor authentication for ' + mode) + return readUserInfo.password() + }).then((password) => { info.tfa.password = password log.info('profile', 'Determine if tfa is pending') return pulseTillDone.withPromise(profile.get(conf)).then((info) => { @@ -235,7 +253,7 @@ function enable2fa (args) { } }) }).then(() => { - log.info('profile', 'Setting two factor authentication to ' + mode) + log.info('profile', 'Setting two-factor authentication to ' + mode) return pulseTillDone.withPromise(profile.set(info, conf)) }).then((challenge) => { if (challenge.tfa === null) { @@ -243,7 +261,7 @@ function enable2fa (args) { return } if (typeof challenge.tfa !== 'string' || !/^otpauth:[/][/]/.test(challenge.tfa)) { - throw new Error('Unknown error enabling two-factor authentication. Expected otpauth URL, got: ' + challenge.tfa) + throw new Error('Unknown error enabling two-factor authentication. Expected otpauth URL, got: ' + inspect(challenge.tfa)) } const otpauth = url.parse(challenge.tfa) const opts = queryString.parse(otpauth.query) @@ -252,10 +270,10 @@ function enable2fa (args) { }).then((code) => { return readUserInfo.otp('And an OTP code from your authenticator: ') }).then((otp1) => { - log.info('profile', 'Finalizing two factor authentication') + log.info('profile', 'Finalizing two-factor authentication') return profile.set({tfa: [otp1]}, conf) }).then((result) => { - output('TFA successfully enabled. Below are your recovery codes, please print these out.') + output('2FA successfully enabled. Below are your recovery codes, please print these out.') output('You will need these to recover access to your account if you lose your authentication device.') result.tfa.forEach((c) => output('\t' + c)) }) diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index bf60e1d5a69a92..20bd2603e6ff0a 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -3,7 +3,6 @@ const BB = require('bluebird') const cacache = require('cacache') -const cache = require('./cache') const createReadStream = require('graceful-fs').createReadStream const getPublishConfig = require('./utils/get-publish-config.js') const lifecycle = BB.promisify(require('./utils/lifecycle.js')) @@ -16,11 +15,9 @@ const pack = require('./pack') const pacote = require('pacote') const pacoteOpts = require('./config/pacote') const path = require('path') -const pipe = BB.promisify(require('mississippi').pipe) const readJson = BB.promisify(require('read-package-json')) const semver = require('semver') const statAsync = BB.promisify(require('graceful-fs').stat) -const writeStreamAtomic = require('fs-write-stream-atomic') const readUserInfo = require('./utils/read-user-info.js') publish.usage = 'npm publish [|] [--tag ] [--access ]' + @@ -105,20 +102,11 @@ function publishFromPackage (arg) { return cacache.tmp.withTmp(npm.tmp, {tmpPrefix: 'fromPackage'}, (tmp) => { const extracted = path.join(tmp, 'package') const target = path.join(tmp, 'package.json') - return cache.add(arg).then((info) => { - const opts = pacoteOpts({integrity: info.integrity}) - return BB.all([ - pipe( - cacache.get.stream.byDigest(opts.cache, info.integrity), - writeStreamAtomic(target) - ).then(() => target), - pacote.extract(arg, extracted, opts).then(() => { - return readJson(path.join(extracted, 'package.json')) - }) - ]).spread((target, pkg) => { - return upload(arg, pkg, false, target) - }) - }) + const opts = pacoteOpts() + return pacote.tarball.toFile(arg, target, opts) + .then(() => pacote.extract(arg, extracted, opts)) + .then(() => readJson(path.join(extracted, 'package.json'))) + .tap((pkg) => upload(arg, pkg, false, target)) }) } diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index 956a6936468916..ddfff2c681655e 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -21,6 +21,7 @@ const ssri = require('ssri') const validate = require('aproba') const writeFileAtomic = require('write-file-atomic') const unixFormatPath = require('./utils/unix-format-path.js') +const isRegistry = require('./utils/is-registry.js') const PKGLOCK = 'package-lock.json' const SHRINKWRAP = 'npm-shrinkwrap.json' @@ -113,7 +114,7 @@ function shrinkwrapDeps (deps, top, tree, seen) { if (child.fromBundle || child.isInLink) { pkginfo.bundled = true } else { - if (requested.registry) { + if (isRegistry(requested)) { pkginfo.resolved = child.package._resolved } // no integrity for git deps as integirty hashes are based on the @@ -153,7 +154,7 @@ function sortModules (modules) { function childVersion (top, child, req) { if (req.type === 'directory' || req.type === 'file') { return 'file:' + unixFormatPath(path.relative(top.path, child.package._resolved || req.fetchSpec)) - } else if (!req.registry && !child.fromBundle) { + } else if (!isRegistry(req) && !child.fromBundle) { return child.package._resolved || req.saveSpec || req.rawSpec } else { return child.package.version diff --git a/deps/npm/lib/token.js b/deps/npm/lib/token.js index a182b633d20c29..2a3b65e6ad7015 100644 --- a/deps/npm/lib/token.js +++ b/deps/npm/lib/token.js @@ -15,17 +15,17 @@ module.exports = token token.usage = 'npm token list\n' + - 'npm token delete \n' + + 'npm token revoke \n' + 'npm token create [--read-only] [--cidr=list]\n' -token.subcommands = ['list', 'delete', 'create'] +token.subcommands = ['list', 'revoke', 'create'] token.completion = function (opts, cb) { var argv = opts.conf.argv.remain switch (argv[2]) { case 'list': - case 'delete': + case 'revoke': case 'create': return cb(null, []) default: @@ -46,7 +46,7 @@ function token (args, cb) { withCb(list(), cb) break case 'delete': - case 'rel': + case 'revoke': case 'remove': case 'rm': withCb(rm(args.slice(1)), cb) @@ -127,7 +127,7 @@ function list (args) { function rm (args) { if (args.length === 0) { - throw new Error('npm token delete ') + throw new Error('npm token revoke ') } const conf = config() const toRemove = [] diff --git a/deps/npm/lib/update.js b/deps/npm/lib/update.js index 2c1d1e82a814bc..efb56f5e415ba7 100644 --- a/deps/npm/lib/update.js +++ b/deps/npm/lib/update.js @@ -1,11 +1,13 @@ +'use strict' module.exports = update -var url = require('url') -var log = require('npmlog') -var chain = require('slide').chain -var npm = require('./npm.js') -var Installer = require('./install.js').Installer -var usage = require('./utils/usage') +const url = require('url') +const log = require('npmlog') +const Bluebird = require('bluebird') +const npm = require('./npm.js') +const Installer = require('./install.js').Installer +const usage = require('./utils/usage') +const outdated = Bluebird.promisify(npm.commands.outdated) update.usage = usage( 'update', @@ -15,12 +17,16 @@ update.usage = usage( update.completion = npm.commands.outdated.completion function update (args, cb) { - var dryrun = false + return update_(args).asCallback(cb) +} + +function update_ (args) { + let dryrun = false if (npm.config.get('dry-run')) dryrun = true - npm.commands.outdated(args, true, function (er, rawOutdated) { - if (er) return cb(er) - var outdated = rawOutdated.map(function (ww) { + log.verbose('update', 'computing outdated modules to update') + return outdated(args, true).then((rawOutdated) => { + const outdated = rawOutdated.map(function (ww) { return { dep: ww[0], depname: ww[1], @@ -32,7 +38,7 @@ function update (args, cb) { } }) - var wanted = outdated.filter(function (ww) { + const wanted = outdated.filter(function (ww) { if (ww.current === ww.wanted && ww.wanted !== ww.latest) { log.verbose( 'outdated', @@ -42,23 +48,25 @@ function update (args, cb) { } return ww.current !== ww.wanted && ww.latest !== 'linked' }) - if (wanted.length === 0) return cb() + if (wanted.length === 0) return log.info('outdated', 'updating', wanted) - var toInstall = {} + const toInstall = {} + wanted.forEach(function (ww) { // use the initial installation method (repo, tar, git) for updating if (url.parse(ww.req).protocol) ww.what = ww.req - var where = ww.dep.parent && ww.dep.parent.path || ww.dep.path - if (toInstall[where]) { - toInstall[where].push(ww.what) - } else { - toInstall[where] = [ww.what] - } + const where = ww.dep.parent && ww.dep.parent.path || ww.dep.path + const isTransitive = !(ww.dep.requiredBy || []).some((p) => p.isTop) + const key = where + ':' + String(isTransitive) + if (!toInstall[key]) toInstall[key] = {where: where, opts: {saveOnlyLock: isTransitive}, what: []} + if (toInstall[key].what.indexOf(ww.what) === -1) toInstall[key].what.push(ww.what) + }) + return Bluebird.each(Object.keys(toInstall), (key) => { + const deps = toInstall[key] + const inst = new Installer(deps.where, dryrun, deps.what, deps.opts) + return inst.run() }) - chain(Object.keys(toInstall).map(function (where) { - return [new Installer(where, dryrun, toInstall[where]), 'run'] - }), cb) }) } diff --git a/deps/npm/lib/utils/convert-line-endings.js b/deps/npm/lib/utils/convert-line-endings.js deleted file mode 100644 index b05d328aacdcb6..00000000000000 --- a/deps/npm/lib/utils/convert-line-endings.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict' - -const Transform = require('stream').Transform -const Bluebird = require('bluebird') -const fs = require('graceful-fs') -const stat = Bluebird.promisify(fs.stat) -const chmod = Bluebird.promisify(fs.chmod) -const fsWriteStreamAtomic = require('fs-write-stream-atomic') - -module.exports.dos2Unix = dos2Unix - -function dos2Unix (file) { - return stat(file).then((stats) => { - let previousChunkEndedInCR = false - return new Bluebird((resolve, reject) => { - fs.createReadStream(file) - .on('error', reject) - .pipe(new Transform({ - transform: function (chunk, encoding, done) { - let data = chunk.toString() - if (previousChunkEndedInCR) { - data = '\r' + data - } - if (data[data.length - 1] === '\r') { - data = data.slice(0, -1) - previousChunkEndedInCR = true - } else { - previousChunkEndedInCR = false - } - done(null, data.replace(/\r\n/g, '\n')) - }, - flush: function (done) { - if (previousChunkEndedInCR) { - this.push('\r') - } - done() - } - })) - .on('error', reject) - .pipe(fsWriteStreamAtomic(file)) - .on('error', reject) - .on('finish', function () { - resolve(chmod(file, stats.mode)) - }) - }) - }) -} - -// could add unix2Dos and legacy Mac functions if need be diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index 028a18bbb6b183..85504f5edc5bb5 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -67,49 +67,53 @@ function errorMessage (er) { break case 'EOTP': - short.push(['', 'This operation requires a one-time password from your authenticator.']) - detail.push([ - '', - [ - 'You can provide a one-time password by passing --otp= to the command you ran.', - 'If you already provided a one-time password then it is likely that you either typoed', - 'it, or it timed out. Please try again.' - ].join('\n') - ]) - break - case 'E401': - // npm ERR! code E401 - // npm ERR! Unable to authenticate, need: Basic - if (er.headers && er.headers['www-authenticate']) { - const auth = er.headers['www-authenticate'] - if (auth.indexOf('Bearer') !== -1) { - short.push(['', 'Unable to authenticate, your authentication token seems to be invalid.']) - detail.push([ - '', - [ - 'To correct this please trying logging in again with:', - ' npm login' - ].join('\n') - ]) - break - } else if (auth.indexOf('Basic') !== -1) { - short.push(['', 'Incorrect or missing password.']) - detail.push([ - '', - [ - 'If you were trying to login, change your password, create an', - 'authentication token or enable two-factor authentication then', - 'that means you likely typed your password in incorectly.', - 'Please try again, or recover your password at:', - ' https://www.npmjs.com/forgot', + // the E401 message checking is a hack till we replace npm-registry-client with something + // OTP aware. + if (er.code === 'EOTP' || (er.code === 'E401' && /one-time pass/.test(er.message))) { + short.push(['', 'This operation requires a one-time password from your authenticator.']) + detail.push([ + '', + [ + 'You can provide a one-time password by passing --otp= to the command you ran.', + 'If you already provided a one-time password then it is likely that you either typoed', + 'it, or it timed out. Please try again.' + ].join('\n') + ]) + break + } else { + // npm ERR! code E401 + // npm ERR! Unable to authenticate, need: Basic + if (er.headers && er.headers['www-authenticate']) { + const auth = er.headers['www-authenticate'].map((au) => au.split(/,\s*/))[0] || [] + if (auth.indexOf('Bearer') !== -1) { + short.push(['', 'Unable to authenticate, your authentication token seems to be invalid.']) + detail.push([ + '', + [ + 'To correct this please trying logging in again with:', + ' npm login' + ].join('\n') + ]) + break + } else if (auth.indexOf('Basic') !== -1) { + short.push(['', 'Incorrect or missing password.']) + detail.push([ '', - 'If you were doing some other operation then your saved credentials are', - 'probably out of date. To correct this please try logging in again with:', - ' npm login' - ].join('\n') - ]) - break + [ + 'If you were trying to login, change your password, create an', + 'authentication token or enable two-factor authentication then', + 'that means you likely typed your password in incorrectly.', + 'Please try again, or recover your password at:', + ' https://www.npmjs.com/forgot', + '', + 'If you were doing some other operation then your saved credentials are', + 'probably out of date. To correct this please try logging in again with:', + ' npm login' + ].join('\n') + ]) + break + } } } diff --git a/deps/npm/lib/utils/gently-rm.js b/deps/npm/lib/utils/gently-rm.js index 7253e873c626dc..16d0aa9bd7f447 100644 --- a/deps/npm/lib/utils/gently-rm.js +++ b/deps/npm/lib/utils/gently-rm.js @@ -3,20 +3,8 @@ exports = module.exports = gentlyRm -var resolve = require('path').resolve -var dirname = require('path').dirname -var normalize = require('path').normalize -var validate = require('aproba') -var log = require('npmlog') -var lstat = require('graceful-fs').lstat -var readlink = require('graceful-fs').readlink -var isInside = require('path-is-inside') -var vacuum = require('fs-vacuum') -var chain = require('slide').chain -var asyncMap = require('slide').asyncMap -var readCmdShim = require('read-cmd-shim') -var iferr = require('iferr') -var npm = require('../npm.js') +var gentleFS = require('gentle-fs') +var gentleFSOpts = require('../config/gentle-fs.js') function gentlyRm (target, gently, base, cb) { if (!cb) { @@ -29,258 +17,5 @@ function gentlyRm (target, gently, base, cb) { gently = false } - // never rm the root, prefix, or bin dirs - // - // globals included because of `npm link` -- as far as the package - // requesting the link is concerned, the linked package is always - // installed globally - var prefixes = [ - npm.prefix, - npm.globalPrefix, - npm.dir, - npm.root, - npm.globalDir, - npm.bin, - npm.globalBin - ] - - var targetPath = normalize(resolve(npm.prefix, target)) - if (prefixes.indexOf(targetPath) !== -1) { - return cb(new Error('May not delete: ' + targetPath)) - } - var options = { } - if (npm.config.get('force') || !gently) options.purge = true - if (base) options.base = normalize(resolve(npm.prefix, base)) - - if (!gently) { - return vacuum(targetPath, options, cb) - } - - var parent = options.base = options.base || normalize(npm.prefix) - - // Do all the async work we'll need to do in order to tell if this is a - // safe operation - chain([ - [isEverInside, parent, prefixes], - [readLinkOrShim, targetPath], - [isEverInside, targetPath, prefixes], - [isEverInside, targetPath, [parent]] - ], function (er, results) { - if (er) { - if (er.code === 'ENOENT') return cb() - return cb(er) - } - var parentInfo = { - path: parent, - managed: results[0] - } - var targetInfo = { - path: targetPath, - symlink: results[1], - managed: results[2], - inParent: results[3] - } - - isSafeToRm(parentInfo, targetInfo, iferr(cb, thenRemove)) - - function thenRemove (toRemove, removeBase) { - if (!toRemove) return cb() - if (removeBase) options.base = removeBase - return vacuum(toRemove, options, cb) - } - }) -} - -exports._isSafeToRm = isSafeToRm -function isSafeToRm (parent, target, cb) { - log.silly('gentlyRm', 'parent.path =', parent.path) - log.silly('gentlyRm', 'parent.managed =', - parent.managed && parent.managed.target + ' is in ' + parent.managed.path) - log.silly('gentlyRm', 'target.path = ', target.path) - log.silly('gentlyRm', 'target.symlink =', target.symlink) - log.silly('gentlyRm', 'target.managed =', - target.managed && target.managed.target + ' is in ' + target.managed.path) - log.silly('gentlyRm', 'target.inParent = ', target.inParent) - - // The parent directory or something it symlinks to must eventually be in - // a folder that npm maintains. - if (!parent.managed) { - log.info('gentlyRm', parent.path, - 'is not contained in any diretory npm is known to control or ' + - 'any place they link to') - return cb(clobberFail(target.path, 'containing path ' + parent.path + - " isn't under npm's control")) - } - - // The target or something it symlinks to must eventually be in the parent - // or something the parent symlinks to - if (target.inParent) { - var actualTarget = target.inParent.target - var targetsParent = target.inParent.path - // if the target.path was what we found in some version of parent, remove - // using that parent as the base - if (target.path === actualTarget) { - return cb(null, target.path, targetsParent) - } else { - // If something the target.path links to was what was found, just - // remove target.path in the location it was found. - return cb(null, target.path, dirname(target.path)) - } - } - - // If the target is in a managed directory and is in a symlink, but was - // not in our parent that usually means someone else installed a bin file - // with the same name as one of our bin files. - if (target.managed && target.symlink) { - log.warn('gentlyRm', 'not removing', target.path, - "as it wasn't installed by", parent.path) - return cb() - } - - if (target.symlink) { - return cb(clobberFail(target.path, target.symlink + - ' symlink target is not controlled by npm ' + parent.path)) - } else { - return cb(clobberFail(target.path, 'is outside ' + parent.path + - ' and not a link')) - } -} - -function clobberFail (target, msg) { - validate('SS', arguments) - var er = new Error('Refusing to delete ' + target + ': ' + msg) - er.code = 'EEXIST' - er.path = target - return er -} - -function isENOENT (err) { - return err && err.code === 'ENOENT' -} - -function notENOENT (err) { - return !isENOENT(err) -} - -function skipENOENT (cb) { - return function (err, value) { - if (isENOENT(err)) { - return cb(null, false) - } else { - return cb(err, value) - } - } -} - -function errorsToValues (fn) { - return function () { - var args = Array.prototype.slice.call(arguments) - var cb = args.pop() - args.push(function (err, value) { - if (err) { - return cb(null, err) - } else { - return cb(null, value) - } - }) - fn.apply(null, args) - } -} - -function isNotError (value) { - return !(value instanceof Error) -} - -exports._isEverInside = isEverInside -// return the first of path, where target (or anything it symlinks to) -// isInside the path (or anything it symlinks to) -function isEverInside (target, paths, cb) { - validate('SAF', arguments) - asyncMap(paths, errorsToValues(readAllLinks), iferr(cb, function (resolvedPaths) { - var errorFree = resolvedPaths.filter(isNotError) - if (errorFree.length === 0) { - var badErrors = resolvedPaths.filter(notENOENT) - if (badErrors.length === 0) { - return cb(null, false) - } else { - return cb(badErrors[0]) - } - } - readAllLinks(target, iferr(skipENOENT(cb), function (targets) { - cb(null, areAnyInsideAny(targets, errorFree)) - })) - })) -} - -exports._areAnyInsideAny = areAnyInsideAny -// Return the first path found that any target is inside -function areAnyInsideAny (targets, paths) { - validate('AA', arguments) - var toCheck = [] - paths.forEach(function (path) { - targets.forEach(function (target) { - toCheck.push([target, path]) - }) - }) - for (var ii = 0; ii < toCheck.length; ++ii) { - var target = toCheck[ii][0] - var path = toCheck[ii][1] - var inside = isInside(target, path) - if (!inside) log.silly('isEverInside', target, 'is not inside', path) - if (inside && path) return inside && path && {target: target, path: path} - } - return false -} - -exports._readAllLinks = readAllLinks -// resolves chains of symlinks of unlimited depth, returning a list of paths -// it's seen in the process when it hits either a symlink cycle or a -// non-symlink -function readAllLinks (path, cb) { - validate('SF', arguments) - var seen = {} - _readAllLinks(path) - - function _readAllLinks (path) { - if (seen[path]) return cb(null, Object.keys(seen)) - seen[path] = true - resolveSymlink(path, iferr(cb, _readAllLinks)) - } -} - -exports._resolveSymlink = resolveSymlink -var resolvedPaths = {} -function resolveSymlink (symlink, cb) { - validate('SF', arguments) - var cached = resolvedPaths[symlink] - if (cached) return cb(null, cached) - - readLinkOrShim(symlink, iferr(cb, function (symlinkTarget) { - if (symlinkTarget) { - resolvedPaths[symlink] = resolve(dirname(symlink), symlinkTarget) - } else { - resolvedPaths[symlink] = symlink - } - return cb(null, resolvedPaths[symlink]) - })) -} - -exports._readLinkOrShim = readLinkOrShim -function readLinkOrShim (path, cb) { - validate('SF', arguments) - lstat(path, iferr(cb, function (stat) { - if (stat.isSymbolicLink()) { - readlink(path, cb) - } else { - readCmdShim(path, function (er, source) { - if (!er) return cb(null, source) - // lstat wouldn't return an error on these, so we don't either. - if (er.code === 'ENOTASHIM' || er.code === 'EISDIR') { - return cb(null, null) - } else { - return cb(er) - } - }) - } - })) + return gentleFS.rm(target, gentleFSOpts(gently, base), cb) } diff --git a/deps/npm/lib/utils/is-hashbang-file.js b/deps/npm/lib/utils/is-hashbang-file.js deleted file mode 100644 index f1677381fa129c..00000000000000 --- a/deps/npm/lib/utils/is-hashbang-file.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict' -const Bluebird = require('bluebird') -const fs = require('graceful-fs') -const open = Bluebird.promisify(fs.open) -const close = Bluebird.promisify(fs.close) - -module.exports = isHashbangFile - -function isHashbangFile (file) { - return open(file, 'r').then((fileHandle) => { - return new Bluebird((resolve, reject) => { - fs.read(fileHandle, new Buffer(new Array(2)), 0, 2, 0, function (err, bytesRead, buffer) { - close(fileHandle).then(() => { - resolve(!err && buffer.toString() === '#!') - }).catch(reject) - }) - }) - }) -} diff --git a/deps/npm/lib/utils/is-registry.js b/deps/npm/lib/utils/is-registry.js new file mode 100644 index 00000000000000..e5f08e16a0b961 --- /dev/null +++ b/deps/npm/lib/utils/is-registry.js @@ -0,0 +1,11 @@ +'use strict' +module.exports = isRegistry + +function isRegistry (req) { + if (req == null) return false + // modern metadata + if ('registry' in req) return req.registry + // legacy metadata + if (req.type === 'range' || req.type === 'version' || req.type === 'tag') return true + return false +} diff --git a/deps/npm/lib/utils/link.js b/deps/npm/lib/utils/link.js index 15331740a450ec..c2642481444ec4 100644 --- a/deps/npm/lib/utils/link.js +++ b/deps/npm/lib/utils/link.js @@ -1,73 +1,8 @@ module.exports = link -link.ifExists = linkIfExists -var fs = require('graceful-fs') -var chain = require('slide').chain -var mkdir = require('mkdirp') -var rm = require('./gently-rm.js') -var path = require('path') -var npm = require('../npm.js') - -function linkIfExists (from, to, gently, cb) { - fs.stat(from, function (er) { - if (er) return cb() - fs.readlink(to, function (er, fromOnDisk) { - // if the link already exists and matches what we would do, - // we don't need to do anything - if (!er) { - var toDir = path.dirname(to) - var absoluteFrom = path.resolve(toDir, from) - var absoluteFromOnDisk = path.resolve(toDir, fromOnDisk) - if (absoluteFrom === absoluteFromOnDisk) return cb() - } - link(from, to, gently, cb) - }) - }) -} - -function resolveIfSymlink (maybeSymlinkPath, cb) { - fs.lstat(maybeSymlinkPath, function (err, stat) { - if (err) return cb.apply(this, arguments) - if (!stat.isSymbolicLink()) return cb(null, maybeSymlinkPath) - fs.readlink(maybeSymlinkPath, cb) - }) -} - -function ensureFromIsNotSource (from, to, cb) { - resolveIfSymlink(from, function (err, fromDestination) { - if (err) return cb.apply(this, arguments) - if (path.resolve(path.dirname(from), fromDestination) === path.resolve(to)) { - return cb(new Error('Link target resolves to the same directory as link source: ' + to)) - } - cb.apply(this, arguments) - }) -} +var gentleFS = require('gentle-fs') +var gentleFSOpts = require('../config/gentle-fs.js') function link (from, to, gently, abs, cb) { - if (typeof cb !== 'function') { - cb = abs - abs = false - } - if (typeof cb !== 'function') { - cb = gently - gently = null - } - if (npm.config.get('force')) gently = false - - to = path.resolve(to) - var toDir = path.dirname(to) - var absTarget = path.resolve(toDir, from) - var relativeTarget = path.relative(toDir, absTarget) - var target = abs ? absTarget : relativeTarget - - chain( - [ - [ensureFromIsNotSource, absTarget, to], - [fs, 'stat', absTarget], - [rm, to, gently, path.dirname(to)], - [mkdir, path.dirname(to)], - [fs, 'symlink', target, to, 'junction'] - ], - cb - ) + return gentleFS.link(from, to, gentleFSOpts(gently, undefined, abs), cb) } diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 2f06aea624dc03..e0904048df8ab4 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -264,7 +264,7 @@ function printData (data, name, cb) { if (npm.config.get('json')) { msgJson[msgJson.length - 1][f] = d } else { - d = util.inspect(d, false, 5, npm.color) + d = util.inspect(d, { showHidden: false, depth: 5, colors: npm.color, maxArrayLength: null }) } } else if (typeof d === 'string' && npm.config.get('json')) { d = JSON.stringify(d) diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index b3822ede6c2a99..a878813f91af92 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "October 2017" "" "" +.TH "NPM" "1" "December 2017" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 0501df5268a5c7..124fb542efd81f 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" "October 2017" "" "" +.TH "NPM\-ACCESS" "1" "December 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 b49cd008136f25..1d0dc7d63f2822 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "October 2017" "" "" +.TH "NPM\-ADDUSER" "1" "December 2017" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 7f6a47eb60dc37..a146ed8ce2eec1 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" "October 2017" "" "" +.TH "NPM\-BIN" "1" "December 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 ab89fd618bb661..e4a74891780807 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" "October 2017" "" "" +.TH "NPM\-BUGS" "1" "December 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 fa27f24e90a103..6ea78934f15927 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" "October 2017" "" "" +.TH "NPM\-BUILD" "1" "December 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 982a48844d15c9..6eb57d7c1022a9 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" "October 2017" "" "" +.TH "NPM\-BUNDLE" "1" "December 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 47c7b779caddc6..133b61730f7268 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" "October 2017" "" "" +.TH "NPM\-CACHE" "1" "December 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 809c97d663660d..131cd3f0d6062e 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" "October 2017" "" "" +.TH "NPM\-COMPLETION" "1" "December 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 22bd768f94ba24..c284370d3f0ac7 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" "October 2017" "" "" +.TH "NPM\-CONFIG" "1" "December 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 6f6365224b84d2..c1ccfc6bf2d5d4 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" "October 2017" "" "" +.TH "NPM\-DEDUPE" "1" "December 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 32df69bf3091aa..d50b3eb39a8060 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" "October 2017" "" "" +.TH "NPM\-DEPRECATE" "1" "December 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 3e77ec58edf26a..ba49d77fa835f9 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" "October 2017" "" "" +.TH "NPM\-DIST\-TAG" "1" "December 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 a2cec0fe66fd05..f913d4ee51e74c 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" "October 2017" "" "" +.TH "NPM\-DOCS" "1" "December 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 58bc8239bf528f..649b81f2e7f727 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" "October 2017" "" "" +.TH "NPM\-DOCTOR" "1" "December 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 51e952d3876462..96275a8d9a104f 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" "October 2017" "" "" +.TH "NPM\-EDIT" "1" "December 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 5788365fc53854..9ed823aeef37cf 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" "October 2017" "" "" +.TH "NPM\-EXPLORE" "1" "December 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 dec9f7811fbc64..4252dff6987cfd 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" "October 2017" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "December 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 1f1efc0241c3be..dea51fb5dc857a 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" "October 2017" "" "" +.TH "NPM\-HELP" "1" "December 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 88942c347356f1..3395281ac75769 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" "October 2017" "" "" +.TH "NPM\-INIT" "1" "December 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 d89fc1fbb914e6..34a306b520b807 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" "" "October 2017" "" "" +.TH "NPM" "" "December 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 5327cdd9116fd8..bdbc6794c9bf2f 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" "October 2017" "" "" +.TH "NPM\-INSTALL" "1" "December 2017" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS @@ -356,6 +356,9 @@ versions\. The \fB\-\-dry\-run\fP argument will report in the usual way what the install would have done without actually installing anything\. .P +The \fB\-\-package\-lock\-only\fP argument will only update the \fBpackage\-lock\.json\fP, +instead of checking \fBnode_modules\fP and downloading dependencies\. +.P The \fB\-f\fP or \fB\-\-force\fP argument will force npm to fetch remote resources even if a local copy exists on disk\. .P diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 5776f241ba8e1c..471db86d33ef75 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" "October 2017" "" "" +.TH "NPM\-LINK" "1" "December 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 d596d4e55e9790..fab4c6c13577d0 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" "October 2017" "" "" +.TH "NPM\-LOGOUT" "1" "December 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 1d0ffbd059bc44..c28056f2d076cb 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" "October 2017" "" "" +.TH "NPM\-LS" "1" "December 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@5.5.1 /path/to/npm +npm@5.6.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 9650351655209a..e301f08e44b25e 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" "October 2017" "" "" +.TH "NPM\-OUTDATED" "1" "December 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 bc0b952ad2c164..8e0617d6e79585 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" "October 2017" "" "" +.TH "NPM\-OWNER" "1" "December 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 0dc0fe8d6ba663..633ceac020d8d0 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" "October 2017" "" "" +.TH "NPM\-PACK" "1" "December 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 f541b907e22ff4..3c5a3ed9997a7a 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" "October 2017" "" "" +.TH "NPM\-PING" "1" "December 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 78df65f4193b88..f69b65b9cacf6b 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" "October 2017" "" "" +.TH "NPM\-PREFIX" "1" "December 2017" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 1df97a4af6bcc6..37252a530e1417 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PROFILE" "1" "October 2017" "" "" +.TH "NPM\-PROFILE" "1" "December 2017" "" "" .SH "NAME" \fBnpm-profile\fR \- Change settings on your registry profile .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index c4e531d38dc31e..f84d2e41ec7e51 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" "October 2017" "" "" +.TH "NPM\-PRUNE" "1" "December 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 e4a91f68c5c6a7..2764e9e4c49d89 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" "October 2017" "" "" +.TH "NPM\-PUBLISH" "1" "December 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 f16b8533256288..ab2b80391a8749 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" "October 2017" "" "" +.TH "NPM\-REBUILD" "1" "December 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 37e33975a2cede..85b22ead2d04bf 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" "October 2017" "" "" +.TH "NPM\-REPO" "1" "December 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 0c5ffab3eddc03..b269a5fb75bbbd 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" "October 2017" "" "" +.TH "NPM\-RESTART" "1" "December 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 90a8d751c7ee71..63901eef3c51a5 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" "October 2017" "" "" +.TH "NPM\-ROOT" "1" "December 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 08c746453cd796..2cdde2a46cd374 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" "October 2017" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "December 2017" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS @@ -59,6 +59,12 @@ instead of .P to run your tests\. .P +The actual shell your script is run within is platform dependent\. By default, +on Unix\-like systems it is the \fB/bin/sh\fP command, on Windows it is the \fBcmd\.exe\fP\|\. +The actual shell referred to by \fB/bin/sh\fP also depends on the system\. +As of \fBnpm@5\.1\.0\fP \fIhttps://github\.com/npm/npm/releases/tag/v5\.1\.0\fR you can +customize the shell with the \fBscript\-shell\fP configuration\. +.P Scripts are run from the root of the module, regardless of what your current working directory is when you call \fBnpm run\fP\|\. If you want your script to use different behavior based on what subdirectory you're in, you can use the @@ -88,6 +94,8 @@ npm help start npm help restart .IP \(bu 2 npm help stop +.IP \(bu 2 +npm help 7 config .RE diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 482faf5a55d3b8..f175c8628cbe60 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" "October 2017" "" "" +.TH "NPM\-SEARCH" "1" "December 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 656592987e81ac..00347defa6d2d2 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" "October 2017" "" "" +.TH "NPM\-SHRINKWRAP" "1" "December 2017" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 0eef64651928cd..44e51472051377 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" "October 2017" "" "" +.TH "NPM\-STAR" "1" "December 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 af8cad012dd70f..c5a7de3cc3e0e0 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" "October 2017" "" "" +.TH "NPM\-STARS" "1" "December 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 decb160d3a2188..57b75de5b8e5b4 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" "October 2017" "" "" +.TH "NPM\-START" "1" "December 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 c95dcffeb55ef8..674ed9a530d149 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" "October 2017" "" "" +.TH "NPM\-STOP" "1" "December 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 2779ef4072512b..cb75eeeec92fa1 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" "October 2017" "" "" +.TH "NPM\-TEAM" "1" "December 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 3efbe88127a479..2b03620434dfc5 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" "October 2017" "" "" +.TH "NPM\-TEST" "1" "December 2017" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index 4a587202c997c0..8eb645e9fa4c67 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TOKEN" "1" "October 2017" "" "" +.TH "NPM\-TOKEN" "1" "December 2017" "" "" .SH "NAME" \fBnpm-token\fR \- Manage your authentication tokens .SH SYNOPSIS @@ -7,12 +7,12 @@ .nf npm token list [\-\-json|\-\-parseable] npm token create [\-\-read\-only] [\-\-cidr=1\.1\.1\.1/24,2\.2\.2\.2/16] -npm token delete +npm token revoke .fi .RE .SH DESCRIPTION .P -This list you list, create and delete authentication tokens\. +This list you list, create and revoke authentication tokens\. .RS 0 .IP \(bu 2 \fBnpm token list\fP: @@ -64,7 +64,7 @@ two\-factor authentication enabled, an otp\. .RE .RS 0 .IP \(bu 2 -\fBnpm token delete \fP: +\fBnpm token revoke \fP: This removes an authentication token, making it immediately unusable\. This can accept both complete tokens (as you get back from \fBnpm token create\fP and will find in your \fB\|\.npmrc\fP) and ids as seen in the \fBnpm token list\fP output\. diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 8cd5f3bddae293..be83b3f7a8deb9 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" "October 2017" "" "" +.TH "NPM\-UNINSTALL" "1" "December 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 41326205ecca4e..224e04f1bb2882 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" "October 2017" "" "" +.TH "NPM\-UNPUBLISH" "1" "December 2017" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 125fe133a583f4..d8ae500df08140 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" "October 2017" "" "" +.TH "NPM\-UPDATE" "1" "December 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 9454f269e11f8b..9601e4f1883d5c 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" "October 2017" "" "" +.TH "NPM\-VERSION" "1" "December 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 6b76a4afd2e9f2..2c18268271a435 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" "October 2017" "" "" +.TH "NPM\-VIEW" "1" "December 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 6f7646bd843173..2f096ac2a0c0cd 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" "October 2017" "" "" +.TH "NPM\-WHOAMI" "1" "December 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 39de90d4c241ff..42eb2962500dbe 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "October 2017" "" "" +.TH "NPM" "1" "December 2017" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -5.5.1 +5.6.0 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index aeb74cf012e86d..912effdc3bdc7c 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "August 2017" "npx@9.5.0" "User Commands" +.TH "NPX" "1" "October 2017" "npx@9.7.0" "User Commands" .SH "NAME" \fBnpx\fR \- execute npm package binaries .SH SYNOPSIS diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index 909cdac38befc9..a252685bd0e43a 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" "October 2017" "" "" +.TH "NPM\-FOLDERS" "5" "December 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 909cdac38befc9..a252685bd0e43a 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" "October 2017" "" "" +.TH "NPM\-FOLDERS" "5" "December 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 625f7987fe7ded..0a4328f73fda3b 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" "October 2017" "" "" +.TH "PACKAGE\.JSON" "5" "December 2017" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -455,11 +455,13 @@ shortcut syntax you use for \fBnpm install\fP: .nf "repository": "npm/npm" +"repository": "github:user/repo" + "repository": "gist:11081aaa281" -"repository": "bitbucket:example/repo" +"repository": "bitbucket:user/repo" -"repository": "gitlab:another/repo" +"repository": "gitlab:user/repo" .fi .RE .SH scripts @@ -752,7 +754,7 @@ If we define a package\.json like this: "name": "awesome\-web\-framework", "version": "1\.0\.0", "bundledDependencies": [ - 'renderized', 'super\-streams' + "renderized", "super\-streams" ] } .fi @@ -824,7 +826,7 @@ are capable of properly installing your program\. For example: .RE .P Unless the user has set the \fBengine\-strict\fP config flag, this -field is advisory only will produce warnings when your package is installed as a dependency\. +field is advisory only and will only produce warnings when your package is installed as a dependency\. .SH engineStrict .P \fBThis feature was removed in npm 3\.0\.0\fR diff --git a/deps/npm/man/man5/npm-package-locks.5 b/deps/npm/man/man5/npm-package-locks.5 index 9795226f7a0454..241a45d9bb9a81 100644 --- a/deps/npm/man/man5/npm-package-locks.5 +++ b/deps/npm/man/man5/npm-package-locks.5 @@ -1,4 +1,4 @@ -.TH "NPM\-PACKAGE\-LOCKS" "5" "October 2017" "" "" +.TH "NPM\-PACKAGE\-LOCKS" "5" "December 2017" "" "" .SH "NAME" \fBnpm-package-locks\fR \- An explanation of npm lockfiles .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-shrinkwrap.json.5 b/deps/npm/man/man5/npm-shrinkwrap.json.5 index 9ef40bfd9acd31..a832963dc633a3 100644 --- a/deps/npm/man/man5/npm-shrinkwrap.json.5 +++ b/deps/npm/man/man5/npm-shrinkwrap.json.5 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP\.JSON" "5" "October 2017" "" "" +.TH "NPM\-SHRINKWRAP\.JSON" "5" "December 2017" "" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR \- A publishable lockfile .SH DESCRIPTION diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index ef6ad56f1a87e7..26d65c2598d1ee 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "October 2017" "" "" +.TH "NPMRC" "5" "December 2017" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION diff --git a/deps/npm/man/man5/package-lock.json.5 b/deps/npm/man/man5/package-lock.json.5 index 6e161e69d430b1..0196cc87e6f07a 100644 --- a/deps/npm/man/man5/package-lock.json.5 +++ b/deps/npm/man/man5/package-lock.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCK\.JSON" "5" "October 2017" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "December 2017" "" "" .SH "NAME" \fBpackage-lock.json\fR \- A manifestation of the manifest .SH DESCRIPTION diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index 625f7987fe7ded..0a4328f73fda3b 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" "October 2017" "" "" +.TH "PACKAGE\.JSON" "5" "December 2017" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -455,11 +455,13 @@ shortcut syntax you use for \fBnpm install\fP: .nf "repository": "npm/npm" +"repository": "github:user/repo" + "repository": "gist:11081aaa281" -"repository": "bitbucket:example/repo" +"repository": "bitbucket:user/repo" -"repository": "gitlab:another/repo" +"repository": "gitlab:user/repo" .fi .RE .SH scripts @@ -752,7 +754,7 @@ If we define a package\.json like this: "name": "awesome\-web\-framework", "version": "1\.0\.0", "bundledDependencies": [ - 'renderized', 'super\-streams' + "renderized", "super\-streams" ] } .fi @@ -824,7 +826,7 @@ are capable of properly installing your program\. For example: .RE .P Unless the user has set the \fBengine\-strict\fP config flag, this -field is advisory only will produce warnings when your package is installed as a dependency\. +field is advisory only and will only produce warnings when your package is installed as a dependency\. .SH engineStrict .P \fBThis feature was removed in npm 3\.0\.0\fR diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 8a2a6bbdd32134..508198722dfdea 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" "October 2017" "" "" +.TH "NPM\-CODING\-STYLE" "7" "December 2017" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION @@ -210,7 +210,7 @@ When something is intentionally missing or removed, set it to \fBnull\fP\|\. Don't set things to \fBundefined\fP\|\. Reserve that value to mean "not yet set to anything\." .P -Boolean objects are verboten\. +Boolean objects are forbidden\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 7fc80370ca4600..aec6d8014caf84 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" "October 2017" "" "" +.TH "NPM\-CONFIG" "7" "December 2017" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -909,6 +909,18 @@ Type: String .RE .P The registry you want to send cli metrics to if \fBsend\-metrics\fP is true\. +.SS node\-options +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: String + +.RE +.P +Options to pass through to Node\.js via the \fBNODE_OPTIONS\fP environment +variable\. This does not impact how npm itself is executed but it does +impact how lifecycle scripts are called\. .SS node\-version .RS 0 .IP \(bu 2 @@ -998,6 +1010,17 @@ If set to false, then ignore \fBpackage\-lock\.json\fP files when installing\. T will also prevent \fIwriting\fR \fBpackage\-lock\.json\fP if \fBsave\fP is true\. .P This option is an alias for \fB\-\-shrinkwrap\fP\|\. +.SS package\-lock\-only +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +If set to true, it will update only the \fBpackage\-json\fP, +instead of checking \fBnode_modules\fP and downloading dependencies\. .SS parseable .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 08712ef9a978fe..d9e483206a4fdb 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" "October 2017" "" "" +.TH "NPM\-DEVELOPERS" "7" "December 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 36dfcf57a428ea..642abcf178351b 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" "October 2017" "" "" +.TH "NPM\-DISPUTES" "7" "December 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 eaa989cba4e2bf..77a70e6cc62ef0 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" "October 2017" "" "" +.TH "NPM\-INDEX" "7" "December 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 4c0d0420b00b59..d1c3588ad8e683 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" "October 2017" "" "" +.TH "NPM\-ORGS" "7" "December 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 4831cdb4807756..a51170a387bda1 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" "October 2017" "" "" +.TH "NPM\-REGISTRY" "7" "December 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 0f396cf68735cc..16e42f4bf0d71d 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" "October 2017" "" "" +.TH "NPM\-SCOPE" "7" "December 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 84181d682d0a8e..bd0383116b79c1 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" "October 2017" "" "" +.TH "NPM\-SCRIPTS" "7" "December 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 e639fd96779406..62c5ae42615e6b 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" "October 2017" "" "" +.TH "NPM\-REMOVAL" "1" "December 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 58d3b8fc160ebd..23c1e018d53f03 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "October 2017" "" "" +.TH "SEMVER" "7" "December 2017" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Install diff --git a/deps/npm/node_modules/bin-links/CHANGELOG.md b/deps/npm/node_modules/bin-links/CHANGELOG.md new file mode 100644 index 00000000000000..c21734b67dc68b --- /dev/null +++ b/deps/npm/node_modules/bin-links/CHANGELOG.md @@ -0,0 +1,22 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [1.1.0](https://github.com/npm/bin-links/compare/v1.0.0...v1.1.0) (2017-11-20) + + +### Features + +* **dos2unix:** Log the fact line endings are being changed upon install. ([e9f8a6f](https://github.com/npm/bin-links/commit/e9f8a6f)) + + + + +# 1.0.0 (2017-10-07) + + +### Features + +* **import:** initial extraction from npm ([6ed0bfb](https://github.com/npm/bin-links/commit/6ed0bfb)) +* **initial commit:** README ([3fc9cf0](https://github.com/npm/bin-links/commit/3fc9cf0)) diff --git a/deps/npm/node_modules/bin-links/LICENSE b/deps/npm/node_modules/bin-links/LICENSE new file mode 100644 index 00000000000000..0b6c2287459632 --- /dev/null +++ b/deps/npm/node_modules/bin-links/LICENSE @@ -0,0 +1,235 @@ +The npm application +Copyright (c) npm, Inc. and Contributors +Licensed on the terms of The Artistic License 2.0 + +Node package dependencies of the npm application +Copyright (c) their respective copyright owners +Licensed on their respective license terms + +The npm public registry at https://registry.npmjs.org +and the npm website at https://www.npmjs.com +Operated by npm, Inc. +Use governed by terms published on https://www.npmjs.com + +"Node.js" +Trademark Joyent, Inc., https://joyent.com +Neither npm nor npm, Inc. are affiliated with Joyent, Inc. + +The Node.js application +Project of Node Foundation, https://nodejs.org + +The npm Logo +Copyright (c) Mathias Pettersson and Brian Hammond + +"Gubblebum Blocky" typeface +Copyright (c) Tjarda Koster, https://jelloween.deviantart.com +Used with permission + + +-------- + + +The Artistic License 2.0 + +Copyright (c) 2000-2006, The Perl Foundation. + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or redistributed. +The intent is that the Copyright Holder maintains some artistic +control over the development of that Package while still keeping the +Package available as open source and free software. + +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. + +Definitions + + "Copyright Holder" means the individual(s) or organization(s) + named in the copyright notice for the entire Package. + + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. + + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. + + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. + + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. + + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. + + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested + by the Copyright Holder. + + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright + Holder. + + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. + + "Source" form means the source code, documentation source, and + configuration files for the Package. + + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. + + +Permission for Use and Modification Without Distribution + +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. + + +Permissions for Redistribution of the Standard Version + +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. + +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. + + +Distribution of Modified Versions of the Package as Source + +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: + + (a) make the Modified Version available to the Copyright Holder + of the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, + modify and redistribute the Modified Version using the same + licensing terms that apply to the copy that the licensee + received, and requires that the Source form of the Modified + Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor + Fees are allowed. + + +Distribution of Compiled Forms of the Standard Version +or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further distribution. +If you provide valid instructions or cease distribution within thirty +days after you become aware that the instructions are invalid, then +you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without +the Source, provided that you comply with Section 4 with respect to +the Source of the Modified Version. + + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified +Version made by someone other than you, you are nevertheless required +to ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: +THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS +IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL +LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +-------- diff --git a/deps/npm/node_modules/bin-links/README.md b/deps/npm/node_modules/bin-links/README.md new file mode 100644 index 00000000000000..558d5c74b2952a --- /dev/null +++ b/deps/npm/node_modules/bin-links/README.md @@ -0,0 +1,47 @@ +# bin-links [![npm version](https://img.shields.io/npm/v/bin-links.svg)](https://npm.im/bin-links) [![license](https://img.shields.io/npm/l/bin-links.svg)](https://npm.im/bin-links) [![Travis](https://img.shields.io/travis/npm/bin-links.svg)](https://travis-ci.org/npm/bin-links) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/bin-links?svg=true)](https://ci.appveyor.com/project/npm/bin-links) [![Coverage Status](https://coveralls.io/repos/github/npm/bin-links/badge.svg?branch=latest)](https://coveralls.io/github/npm/bin-links?branch=latest) + +[`bin-links`](https://github.com/npm/bin-links) is a standalone library that links +binaries and man pages for Javascript packages + +## Install + +`$ npm install bin-links` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [Contributing](#contributing) +* [API](#api) + * [`binLinks`](#binLinks) + +### Example + +```javascript +// todo +``` + +### Features + +* Links bin files listed under the `bin` property of pkg to the node_modules/.bin +directory of the installing environment. +* Links man files listed under the `man` property of pkg to the share/man directory +of the provided optional directory prefix. + +### Contributing + +The npm team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! The [Contributor +Guide](CONTRIBUTING.md) has all the information you need for everything from +reporting bugs to contributing entire new features. Please don't hesitate to +jump in if you'd like to, or even ask us questions if something isn't clear. + +### API + +#### `> binLinks(pkg, folder, global, opts, cb)` + +##### Example + +```javascript +binLinks(pkg, folder, global, opts, cb) +``` \ No newline at end of file diff --git a/deps/npm/node_modules/bin-links/index.js b/deps/npm/node_modules/bin-links/index.js new file mode 100644 index 00000000000000..e6370acad5407f --- /dev/null +++ b/deps/npm/node_modules/bin-links/index.js @@ -0,0 +1,187 @@ +'use strict' + +const path = require('path') +const fs = require('graceful-fs') +const linkIfExists = require('gentle-fs').linkIfExists +const cmdShimIfExists = require('cmd-shim').ifExists +const asyncMap = require('slide').asyncMap +const BB = require('bluebird') +const open = BB.promisify(fs.open) +const close = BB.promisify(fs.close) +const stat = BB.promisify(fs.stat) +const chmod = BB.promisify(fs.chmod) +const Transform = require('stream').Transform +const fsWriteStreamAtomic = require('fs-write-stream-atomic') + +module.exports = BB.promisify(binLinks) + +function binLinks (pkg, folder, global, opts, cb) { + // if it's global, and folder is in {prefix}/node_modules, + // then bins are in {prefix}/bin + // otherwise, then bins are in folder/../.bin + var parent = pkg.name && pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder) + var gnm = global && opts.globalDir + var gtop = parent === gnm + + opts.log.info('linkStuff', opts.pkgId) + opts.log.silly('linkStuff', opts.pkgId, 'has', parent, 'as its parent node_modules') + if (global) opts.log.silly('linkStuff', opts.pkgId, 'is part of a global install') + if (gnm) opts.log.silly('linkStuff', opts.pkgId, 'is installed into a global node_modules') + if (gtop) opts.log.silly('linkStuff', opts.pkgId, 'is installed into the top-level global node_modules') + + asyncMap( + [linkBins, linkMans], + function (fn, cb) { + if (!fn) return cb() + opts.log.verbose(fn.name, opts.pkgId) + fn(pkg, folder, parent, gtop, opts, cb) + }, + cb + ) +} + +function isHashbangFile (file) { + return open(file, 'r').then((fileHandle) => { + return new BB((resolve, reject) => { + fs.read(fileHandle, Buffer.from(new Array(2)), 0, 2, 0, function (err, bytesRead, buffer) { + close(fileHandle).then(() => { + resolve(!err && buffer.toString() === '#!') + }).catch(reject) + }) + }) + }) +} + +function dos2Unix (file) { + return stat(file).then((stats) => { + let previousChunkEndedInCR = false + return new BB((resolve, reject) => { + fs.createReadStream(file) + .on('error', reject) + .pipe(new Transform({ + transform: function (chunk, encoding, done) { + let data = chunk.toString() + if (previousChunkEndedInCR) { + data = '\r' + data + } + if (data[data.length - 1] === '\r') { + data = data.slice(0, -1) + previousChunkEndedInCR = true + } else { + previousChunkEndedInCR = false + } + done(null, data.replace(/\r\n/g, '\n')) + }, + flush: function (done) { + if (previousChunkEndedInCR) { + this.push('\r') + } + done() + } + })) + .on('error', reject) + .pipe(fsWriteStreamAtomic(file)) + .on('error', reject) + .on('finish', function () { + resolve(chmod(file, stats.mode)) + }) + }) + }) +} + +function getLinkOpts (opts, gently) { + return Object.assign({}, opts, { gently: gently }) +} + +function linkBins (pkg, folder, parent, gtop, opts, cb) { + if (!pkg.bin || (!gtop && path.basename(parent) !== 'node_modules')) { + return cb() + } + var linkOpts = getLinkOpts(opts, gtop && folder) + var execMode = parseInt('0777', 8) & (~opts.umask) + var binRoot = gtop ? opts.globalBin + : path.resolve(parent, '.bin') + opts.log.verbose('linkBins', [pkg.bin, binRoot, gtop]) + + asyncMap(Object.keys(pkg.bin), function (bin, cb) { + var dest = path.resolve(binRoot, bin) + var src = path.resolve(folder, pkg.bin[bin]) + + linkBin(src, dest, linkOpts, function (er) { + if (er) return cb(er) + // bins should always be executable. + // XXX skip chmod on windows? + fs.chmod(src, execMode, function (er) { + if (er && er.code === 'ENOENT' && opts.ignoreScripts) { + return cb() + } + if (er) return cb(er) + isHashbangFile(src).then((isHashbang) => { + if (isHashbang) { + opts.log.silly('linkBins', 'Converting line endings of hashbang file:', src) + return dos2Unix(src) + } + }).then(() => { + if (!gtop) return cb() + var dest = path.resolve(binRoot, bin) + var out = opts.parseable + ? dest + '::' + src + ':BINFILE' + : dest + ' -> ' + src + + if (!opts.json && !opts.parseable) { + opts.log.clearProgress() + console.log(out) + opts.log.showProgress() + } + cb() + }).catch(cb) + }) + }) + }, cb) +} + +function linkBin (from, to, opts, cb) { + if (process.platform !== 'win32') { + return linkIfExists(from, to, opts, cb) + } else { + return cmdShimIfExists(from, to, cb) + } +} + +function linkMans (pkg, folder, parent, gtop, opts, cb) { + if (!pkg.man || !gtop || process.platform === 'win32') return cb() + + var manRoot = path.resolve(opts.prefix, 'share', 'man') + opts.log.verbose('linkMans', 'man files are', pkg.man, 'in', manRoot) + + // make sure that the mans are unique. + // otherwise, if there are dupes, it'll fail with EEXIST + var set = pkg.man.reduce(function (acc, man) { + acc[path.basename(man)] = man + return acc + }, {}) + pkg.man = pkg.man.filter(function (man) { + return set[path.basename(man)] === man + }) + + asyncMap(pkg.man, function (man, cb) { + if (typeof man !== 'string') return cb() + opts.log.silly('linkMans', 'preparing to link', man) + var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) + if (!parseMan) { + return cb(new Error( + man + ' is not a valid name for a man file. ' + + 'Man files must end with a number, ' + + 'and optionally a .gz suffix if they are compressed.' + )) + } + + var stem = parseMan[1] + var sxn = parseMan[2] + var bn = path.basename(stem) + var manSrc = path.resolve(folder, man) + var manDest = path.join(manRoot, 'man' + sxn, bn) + + linkIfExists(manSrc, manDest, getLinkOpts(opts, gtop && folder), cb) + }, cb) +} diff --git a/deps/npm/node_modules/bin-links/package.json b/deps/npm/node_modules/bin-links/package.json new file mode 100644 index 00000000000000..318e84e5ce9548 --- /dev/null +++ b/deps/npm/node_modules/bin-links/package.json @@ -0,0 +1,77 @@ +{ + "_from": "bin-links@latest", + "_id": "bin-links@1.1.0", + "_inBundle": false, + "_integrity": "sha512-3desjIEoSt86s+BRZlkLpBPPcHhr4vyUPL/+X1cQuE96NIlkELqnb4Yq+I5gZe47gHsZztA6cm38uMrT9+FWpA==", + "_location": "/bin-links", + "_phantomChildren": {}, + "_requested": { + "type": "tag", + "registry": true, + "raw": "bin-links@latest", + "name": "bin-links", + "escapedName": "bin-links", + "rawSpec": "latest", + "saveSpec": null, + "fetchSpec": "latest" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/bin-links/-/bin-links-1.1.0.tgz", + "_shasum": "e0a92cb57f01c4dc1088bca2bae6be110b9f64f9", + "_spec": "bin-links@latest", + "_where": "/Users/rebecca/code/npm", + "author": { + "name": "Mike Sherov" + }, + "bugs": { + "url": "https://github.com/npm/bin-links/issues" + }, + "bundleDependencies": false, + "dependencies": { + "bluebird": "^3.5.0", + "cmd-shim": "^2.0.2", + "fs-write-stream-atomic": "^1.0.10", + "gentle-fs": "^2.0.0", + "graceful-fs": "^4.1.11", + "slide": "^1.1.6" + }, + "deprecated": false, + "description": "JavaScript package binary linker", + "devDependencies": { + "nyc": "^11.1.0", + "standard": "^10.0.3", + "standard-version": "^4.2.0", + "tap": "^10.7.2", + "weallbehave": "^1.2.0", + "weallcontribute": "^1.0.8" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/npm/bin-links#readme", + "keywords": [ + "npm", + "gentle", + "fs" + ], + "license": "Artistic-2.0", + "main": "index.js", + "name": "bin-links", + "repository": { + "type": "git", + "url": "git://github.com/npm/bin-links.git" + }, + "scripts": { + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --nyc-arg=--all --coverage test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/bluebird/README.md b/deps/npm/node_modules/bluebird/README.md index 538b182ef16cbf..19a63f40ea9f6f 100644 --- a/deps/npm/node_modules/bluebird/README.md +++ b/deps/npm/node_modules/bluebird/README.md @@ -2,8 +2,9 @@ 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) +[![coverage-98%](https://img.shields.io/badge/coverage-98%25-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) diff --git a/deps/npm/node_modules/bluebird/js/browser/bluebird.core.js b/deps/npm/node_modules/bluebird/js/browser/bluebird.core.js index 3ed2f6a689fd1c..6adcea1d6d08e5 100644 --- a/deps/npm/node_modules/bluebird/js/browser/bluebird.core.js +++ b/deps/npm/node_modules/bluebird/js/browser/bluebird.core.js @@ -23,7 +23,7 @@ * */ /** - * bluebird build version 3.5.0 + * bluebird build version 3.5.1 * Features enabled: core * Features disabled: race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each */ @@ -559,7 +559,10 @@ Promise.prototype.suppressUnhandledRejections = function() { Promise.prototype._ensurePossibleRejectionHandled = function () { if ((this._bitField & 524288) !== 0) return; this._setRejectionIsUnhandled(); - async.invokeLater(this._notifyUnhandledRejection, this, undefined); + var self = this; + setTimeout(function() { + self._notifyUnhandledRejection(); + }, 1); }; Promise.prototype._notifyUnhandledRejectionIsHandled = function () { @@ -2848,7 +2851,7 @@ _dereq_("./synchronous_inspection")(Promise); _dereq_("./join")( Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); Promise.Promise = Promise; -Promise.version = "3.5.0"; +Promise.version = "3.5.1"; util.toFastProperties(Promise); util.toFastProperties(Promise.prototype); @@ -3618,10 +3621,11 @@ function safeToString(obj) { } function isError(obj) { - return obj !== null && + return obj instanceof Error || + (obj !== null && typeof obj === "object" && typeof obj.message === "string" && - typeof obj.name === "string"; + typeof obj.name === "string"); } function markAsOriginatingFromRejection(e) { 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 index a556a428d9d5fe..84268e7c4fb2fd 100644 --- a/deps/npm/node_modules/bluebird/js/browser/bluebird.core.min.js +++ b/deps/npm/node_modules/bluebird/js/browser/bluebird.core.min.js @@ -23,9 +23,9 @@ * */ /** - * bluebird build version 3.5.0 + * bluebird build version 3.5.1 * 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 +!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 N?N(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,N,L=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(){if(0===(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},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=L();A="function"==typeof t?null===e?t:I.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=L();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&&(N=function(t){console.warn(t)},I.isNode&&process.stderr.isTTY?N=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:I.isNode||"string"!=typeof(new Error).stack||(N=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.1",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 N.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 t instanceof Error||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 index 8dd65f2870679d..df2041448f7f01 100644 --- a/deps/npm/node_modules/bluebird/js/browser/bluebird.js +++ b/deps/npm/node_modules/bluebird/js/browser/bluebird.js @@ -23,7 +23,7 @@ * */ /** - * bluebird build version 3.5.0 + * bluebird build version 3.5.1 * 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;o0;){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 +!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(){if(0===(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},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.1",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 t instanceof Error||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/debuggability.js b/deps/npm/node_modules/bluebird/js/release/debuggability.js index bf0587ce7d409c..6956804131112f 100644 --- a/deps/npm/node_modules/bluebird/js/release/debuggability.js +++ b/deps/npm/node_modules/bluebird/js/release/debuggability.js @@ -38,7 +38,10 @@ Promise.prototype.suppressUnhandledRejections = function() { Promise.prototype._ensurePossibleRejectionHandled = function () { if ((this._bitField & 524288) !== 0) return; this._setRejectionIsUnhandled(); - async.invokeLater(this._notifyUnhandledRejection, this, undefined); + var self = this; + setTimeout(function() { + self._notifyUnhandledRejection(); + }, 1); }; Promise.prototype._notifyUnhandledRejectionIsHandled = function () { diff --git a/deps/npm/node_modules/bluebird/js/release/promise.js b/deps/npm/node_modules/bluebird/js/release/promise.js index 2a1d002adfb2e9..6ef173ef60c97a 100644 --- a/deps/npm/node_modules/bluebird/js/release/promise.js +++ b/deps/npm/node_modules/bluebird/js/release/promise.js @@ -733,7 +733,7 @@ require("./synchronous_inspection")(Promise); require("./join")( Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); Promise.Promise = Promise; -Promise.version = "3.5.0"; +Promise.version = "3.5.1"; require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); require('./call_get.js')(Promise); require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); diff --git a/deps/npm/node_modules/bluebird/js/release/util.js b/deps/npm/node_modules/bluebird/js/release/util.js index 84c28ec4759aca..7ac0e2fa1986c2 100644 --- a/deps/npm/node_modules/bluebird/js/release/util.js +++ b/deps/npm/node_modules/bluebird/js/release/util.js @@ -223,10 +223,11 @@ function safeToString(obj) { } function isError(obj) { - return obj !== null && + return obj instanceof Error || + (obj !== null && typeof obj === "object" && typeof obj.message === "string" && - typeof obj.name === "string"; + typeof obj.name === "string"); } function markAsOriginatingFromRejection(e) { diff --git a/deps/npm/node_modules/bluebird/package.json b/deps/npm/node_modules/bluebird/package.json index 34a878be3cb6c7..524230df6d9192 100644 --- a/deps/npm/node_modules/bluebird/package.json +++ b/deps/npm/node_modules/bluebird/package.json @@ -1,42 +1,42 @@ { - "_from": "bluebird@~3.5.0", - "_id": "bluebird@3.5.0", - "_integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=", + "_from": "bluebird@latest", + "_id": "bluebird@3.5.1", + "_inBundle": false, + "_integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", "_location": "/bluebird", "_phantomChildren": {}, "_requested": { - "type": "range", + "type": "tag", "registry": true, - "raw": "bluebird@~3.5.0", + "raw": "bluebird@latest", "name": "bluebird", "escapedName": "bluebird", - "rawSpec": "~3.5.0", + "rawSpec": "latest", "saveSpec": null, - "fetchSpec": "~3.5.0" + "fetchSpec": "latest" }, "_requiredBy": [ + "#USER", "/", + "/bin-links", "/cacache", "/pacote", "/tap" ], - "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", - "_shasum": "791420d7f551eea2897453a8a77653f96606d67c", - "_shrinkwrap": null, - "_spec": "bluebird@~3.5.0", + "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "_shasum": "d9551f9de98f1fcda1e683d17ee91a0602ee2eb9", + "_spec": "bluebird@latest", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Petka Antonov", "email": "petka_antonov@hotmail.com", "url": "http://github.com/petkaantonov/" }, - "bin": null, "browser": "./js/browser/bluebird.js", "bugs": { "url": "http://github.com/petkaantonov/bluebird/issues" }, "bundleDependencies": false, - "dependencies": {}, "deprecated": false, "description": "Full featured Promises/A+ implementation with exceptionally good performance", "devDependencies": { @@ -89,8 +89,6 @@ "license": "MIT", "main": "./js/release/bluebird.js", "name": "bluebird", - "optionalDependencies": {}, - "peerDependencies": {}, "repository": { "type": "git", "url": "git://github.com/petkaantonov/bluebird.git" @@ -103,6 +101,6 @@ "prepublish": "npm run generate-browser-core && npm run generate-browser-full", "test": "node tools/test.js" }, - "version": "3.5.0", + "version": "3.5.1", "webpack": "./js/release/bluebird.js" } diff --git a/deps/npm/node_modules/cacache/CHANGELOG.md b/deps/npm/node_modules/cacache/CHANGELOG.md index 9e8f8d6dddeb42..0903d1d5780f5f 100644 --- a/deps/npm/node_modules/cacache/CHANGELOG.md +++ b/deps/npm/node_modules/cacache/CHANGELOG.md @@ -2,6 +2,46 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [10.0.1](https://github.com/zkat/cacache/compare/v10.0.0...v10.0.1) (2017-11-15) + + +### Bug Fixes + +* **move-file:** actually use the fallback to `move-concurrently` (#110) ([073fbe1](https://github.com/zkat/cacache/commit/073fbe1)) + + + + +# [10.0.0](https://github.com/zkat/cacache/compare/v9.3.0...v10.0.0) (2017-10-23) + + +### Features + +* **license:** relicense to ISC (#111) ([fdbb4e5](https://github.com/zkat/cacache/commit/fdbb4e5)) + + +### Performance Improvements + +* more copyFile benchmarks ([63787bb](https://github.com/zkat/cacache/commit/63787bb)) + + +### BREAKING CHANGES + +* **license:** the license has been changed from CC0-1.0 to ISC. + + + + +# [9.3.0](https://github.com/zkat/cacache/compare/v9.2.9...v9.3.0) (2017-10-07) + + +### Features + +* **copy:** added cacache.get.copy api for fast copies (#107) ([067b5f6](https://github.com/zkat/cacache/commit/067b5f6)) + + + ## [9.2.9](https://github.com/zkat/cacache/compare/v9.2.8...v9.2.9) (2017-06-17) diff --git a/deps/npm/node_modules/cacache/LICENSE.md b/deps/npm/node_modules/cacache/LICENSE.md index c05cb09586fccd..8d28acf866d932 100644 --- a/deps/npm/node_modules/cacache/LICENSE.md +++ b/deps/npm/node_modules/cacache/LICENSE.md @@ -1,3 +1,16 @@ -To the extent possible under law, maintainers for this project have waived all copyright and related or neighboring rights to this project. +ISC License -For more information on this waiver, see: https://creativecommons.org/publicdomain/zero/1.0/ +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER 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/cacache/README.es.md b/deps/npm/node_modules/cacache/README.es.md new file mode 100644 index 00000000000000..783a0a19b01dab --- /dev/null +++ b/deps/npm/node_modules/cacache/README.es.md @@ -0,0 +1,628 @@ +# cacache [![npm version](https://img.shields.io/npm/v/cacache.svg)](https://npm.im/cacache) [![license](https://img.shields.io/npm/l/cacache.svg)](https://npm.im/cacache) [![Travis](https://img.shields.io/travis/zkat/cacache.svg)](https://travis-ci.org/zkat/cacache) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/cacache?svg=true)](https://ci.appveyor.com/project/zkat/cacache) [![Coverage Status](https://coveralls.io/repos/github/zkat/cacache/badge.svg?branch=latest)](https://coveralls.io/github/zkat/cacache?branch=latest) + +[`cacache`](https://github.com/zkat/cacache) es una librería de Node.js para +manejar caches locales en disco, con acceso tanto con claves únicas como +direcciones de contenido (hashes/hacheos). Es súper rápida, excelente con el +acceso concurrente, y jamás te dará datos incorrectos, aún si se corrompen o +manipulan directamente los ficheros del cache. + +El propósito original era reemplazar el caché local de +[npm](https://npm.im/npm), pero se puede usar por su propia cuenta. + +_Traducciones: [English](README.md)_ + +## Instalación + +`$ npm install --save cacache` + +## Índice + +* [Ejemplo](#ejemplo) +* [Características](#características) +* [Cómo Contribuir](#cómo-contribuir) +* [API](#api) + * [Usando el API en español](#localized-api) + * Leer + * [`ls`](#ls) + * [`ls.flujo`](#ls-stream) + * [`saca`](#get-data) + * [`saca.flujo`](#get-stream) + * [`saca.info`](#get-info) + * [`saca.tieneDatos`](#get-hasContent) + * Escribir + * [`mete`](#put-data) + * [`mete.flujo`](#put-stream) + * [opciones para `mete*`](#put-options) + * [`rm.todo`](#rm-all) + * [`rm.entrada`](#rm-entry) + * [`rm.datos`](#rm-content) + * Utilidades + * [`ponLenguaje`](#set-locale) + * [`limpiaMemoizado`](#clear-memoized) + * [`tmp.hazdir`](#tmp-mkdir) + * [`tmp.conTmp`](#with-tmp) + * Integridad + * [Subresource Integrity](#integrity) + * [`verifica`](#verify) + * [`verifica.ultimaVez`](#verify-last-run) + +### Ejemplo + +```javascript +const cacache = require('cacache/es') +const fs = require('fs') + +const tarbol = '/ruta/a/mi-tar.tgz' +const rutaCache = '/tmp/my-toy-cache' +const clave = 'mi-clave-única-1234' + +// ¡Añádelo al caché! Usa `rutaCache` como raíz del caché. +cacache.mete(rutaCache, clave, '10293801983029384').then(integrity => { + console.log(`Saved content to ${rutaCache}.`) +}) + +const destino = '/tmp/mytar.tgz' + +// Copia el contenido del caché a otro fichero, pero esta vez con flujos. +cacache.saca.flujo( + rutaCache, clave +).pipe( + fs.createWriteStream(destino) +).on('finish', () => { + console.log('extracción completada') +}) + +// La misma cosa, pero accesando el contenido directamente, sin tocar el índice. +cacache.saca.porHacheo(rutaCache, integridad).then(datos => { + fs.writeFile(destino, datos, err => { + console.log('datos del tarbol sacados basado en su sha512, y escrito a otro fichero') + }) +}) +``` + +### Características + +* Extracción por clave o por dirección de contenido (shasum, etc) +* Usa el estándard de web, [Subresource Integrity](#integrity) +* Compatible con multiples algoritmos - usa sha1, sha512, etc, en el mismo caché sin problema +* Entradas con contenido idéntico comparten ficheros +* Tolerancia de fallas (inmune a corrupción, ficheros parciales, carreras de proceso, etc) +* Verificación completa de datos cuando (escribiendo y leyendo) +* Concurrencia rápida, segura y "lockless" +* Compatible con `stream`s (flujos) +* Compatible con `Promise`s (promesas) +* Bastante rápida -- acceso, incluyendo verificación, en microsegundos +* Almacenaje de metadatos arbitrarios +* Colección de basura y verificación adicional fuera de banda +* Cobertura rigurosa de pruebas +* Probablente hay un "Bloom filter" por ahí en algún lado. Eso le mola a la gente, ¿Verdad? 🤔 + +### Cómo Contribuir + +El equipo de cacache felizmente acepta contribuciones de código y otras maneras de participación. ¡Hay muchas formas diferentes de contribuir! La [Guía de Colaboradores](CONTRIBUTING.md) (en inglés) tiene toda la información que necesitas para cualquier tipo de contribución: todo desde cómo reportar errores hasta cómo someter parches con nuevas características. Con todo y eso, no se preocupe por si lo que haces está exáctamente correcto: no hay ningún problema en hacer preguntas si algo no está claro, o no lo encuentras. + +El equipo de cacache tiene miembros hispanohablantes: es completamente aceptable crear `issues` y `pull requests` en español/castellano. + +Todos los participantes en este proyecto deben obedecer el [Código de Conducta](CODE_OF_CONDUCT.md) (en inglés), y en general actuar de forma amable y respetuosa mientras participan en esta comunidad. + +Por favor refiérase al [Historial de Cambios](CHANGELOG.md) (en inglés) para detalles sobre cambios importantes incluídos en cada versión. + +Finalmente, cacache tiene un sistema de localización de lenguaje. Si te interesa añadir lenguajes o mejorar los que existen, mira en el directorio `./locales` para comenzar. + +Happy hacking! + +### API + +#### Usando el API en español + +cacache incluye una traducción completa de su API al castellano, con las mismas +características. Para usar el API como está documentado en este documento, usa +`require('cacache/es')` + +cacache también tiene otros lenguajes: encuéntralos bajo `./locales`, y podrás +usar el API en ese lenguaje con `require('cacache/')` + +#### `> cacache.ls(cache) -> Promise` + +Enumera todas las entradas en el caché, dentro de un solo objeto. Cada entrada +en el objeto tendrá como clave la clave única usada para el índice, el valor +siendo un objeto de [`saca.info`](#get-info). + +##### Ejemplo + +```javascript +cacache.ls(rutaCache).then(console.log) +// Salida +{ + 'my-thing': { + key: 'my-thing', + integrity: 'sha512-BaSe64/EnCoDED+HAsh==' + path: '.testcache/content/deadbeef', // unido con `rutaCache` + time: 12345698490, + size: 4023948, + metadata: { + name: 'blah', + version: '1.2.3', + description: 'this was once a package but now it is my-thing' + } + }, + 'other-thing': { + key: 'other-thing', + integrity: 'sha1-ANothER+hasH=', + path: '.testcache/content/bada55', + time: 11992309289, + size: 111112 + } +} +``` + +#### `> cacache.ls.flujo(cache) -> Readable` + +Enumera todas las entradas en el caché, emitiendo un objeto de +[`saca.info`](#get-info) por cada evento de `data` en el flujo. + +##### Ejemplo + +```javascript +cacache.ls.flujo(rutaCache).on('data', console.log) +// Salida +{ + key: 'my-thing', + integrity: 'sha512-BaSe64HaSh', + path: '.testcache/content/deadbeef', // unido con `rutaCache` + time: 12345698490, + size: 13423, + metadata: { + name: 'blah', + version: '1.2.3', + description: 'this was once a package but now it is my-thing' + } +} + +{ + key: 'other-thing', + integrity: 'whirlpool-WoWSoMuchSupport', + path: '.testcache/content/bada55', + time: 11992309289, + size: 498023984029 +} + +{ + ... +} +``` + +#### `> cacache.saca(cache, clave, [ops]) -> Promise({data, metadata, integrity})` + +Devuelve un objeto con los datos, hacheo de integridad y metadatos identificados +por la `clave`. La propiedad `data` de este objeto será una instancia de +`Buffer` con los datos almacenados en el caché. to do with it! cacache just +won't care. + +`integrity` es un `string` de [Subresource Integrity](#integrity). Dígase, un +`string` que puede ser usado para verificar a la `data`, que tiene como formato +`-`. + +So no existe ninguna entrada identificada por `clave`, o se los datos +almacenados localmente fallan verificación, el `Promise` fallará. + +Una sub-función, `saca.porHacheo`, tiene casi el mismo comportamiento, excepto +que busca entradas usando el hacheo de integridad, sin tocar el índice general. +Esta versión *sólo* devuelve `data`, sin ningún objeto conteniéndola. + +##### Nota + +Esta función lee la entrada completa a la memoria antes de devolverla. Si estás +almacenando datos Muy Grandes, es posible que [`saca.flujo`](#get-stream) sea +una mejor solución. + +##### Ejemplo + +```javascript +// Busca por clave +cache.saca(rutaCache, 'my-thing').then(console.log) +// Salida: +{ + metadata: { + thingName: 'my' + }, + integrity: 'sha512-BaSe64HaSh', + data: Buffer#, + size: 9320 +} + +// Busca por hacheo +cache.saca.porHacheo(rutaCache, 'sha512-BaSe64HaSh').then(console.log) +// Salida: +Buffer# +``` + +#### `> cacache.saca.flujo(cache, clave, [ops]) -> Readable` + +Devuelve un [Readable +Stream](https://nodejs.org/api/stream.html#stream_readable_streams) de los datos +almacenados bajo `clave`. + +So no existe ninguna entrada identificada por `clave`, o se los datos +almacenados localmente fallan verificación, el `Promise` fallará. + +`metadata` y `integrity` serán emitidos como eventos antes de que el flujo +cierre. + +Una sub-función, `saca.flujo.porHacheo`, tiene casi el mismo comportamiento, +excepto que busca entradas usando el hacheo de integridad, sin tocar el índice +general. Esta versión no emite eventos de `metadata` o `integrity`. + +##### Ejemplo + +```javascript +// Busca por clave +cache.saca.flujo( + rutaCache, 'my-thing' +).on('metadata', metadata => { + console.log('metadata:', metadata) +}).on('integrity', integrity => { + console.log('integrity:', integrity) +}).pipe( + fs.createWriteStream('./x.tgz') +) +// Salidas: +metadata: { ... } +integrity: 'sha512-SoMeDIGest+64==' + +// Busca por hacheo +cache.saca.flujo.porHacheo( + rutaCache, 'sha512-SoMeDIGest+64==' +).pipe( + fs.createWriteStream('./x.tgz') +) +``` + +#### `> cacache.saca.info(cache, clave) -> Promise` + +Busca la `clave` en el índice del caché, devolviendo información sobre la +entrada si existe. + +##### Campos + +* `key` - Clave de la entrada. Igual al argumento `clave`. +* `integrity` - [hacheo de Subresource Integrity](#integrity) del contenido al que se refiere esta entrada. +* `path` - Dirección del fichero de datos almacenados, relativa al argumento `cache`. +* `time` - Hora de creación de la entrada +* `metadata` - Metadatos asignados a esta entrada por el usuario + +##### Ejemplo + +```javascript +cacache.saca.info(rutaCache, 'my-thing').then(console.log) + +// Salida +{ + key: 'my-thing', + integrity: 'sha256-MUSTVERIFY+ALL/THINGS==' + path: '.testcache/content/deadbeef', + time: 12345698490, + size: 849234, + metadata: { + name: 'blah', + version: '1.2.3', + description: 'this was once a package but now it is my-thing' + } +} +``` + +#### `> cacache.saca.tieneDatos(cache, integrity) -> Promise` + +Busca un [hacheo Subresource Integrity](#integrity) en el caché. Si existe el +contenido asociado con `integrity`, devuelve un objeto con dos campos: el hacheo +_específico_ que se usó para la búsqueda, `sri`, y el tamaño total del +contenido, `size`. Si no existe ningún contenido asociado con `integrity`, +devuelve `false`. + +##### Ejemplo + +```javascript +cacache.saca.tieneDatos(rutaCache, 'sha256-MUSTVERIFY+ALL/THINGS==').then(console.log) + +// Salida +{ + sri: { + source: 'sha256-MUSTVERIFY+ALL/THINGS==', + algorithm: 'sha256', + digest: 'MUSTVERIFY+ALL/THINGS==', + options: [] + }, + size: 9001 +} + +cacache.saca.tieneDatos(rutaCache, 'sha521-NOT+IN/CACHE==').then(console.log) + +// Salida +false +``` + +#### `> cacache.mete(cache, clave, datos, [ops]) -> Promise` + +Inserta `datos` en el caché. El `Promise` devuelto se resuelve con un hacheo +(generado conforme a [`ops.algorithms`](#optsalgorithms)) después que la entrada +haya sido escrita en completo. + +##### Ejemplo + +```javascript +fetch( + 'https://registry.npmjs.org/cacache/-/cacache-1.0.0.tgz' +).then(datos => { + return cacache.mete(rutaCache, 'registry.npmjs.org|cacache@1.0.0', datos) +}).then(integridad => { + console.log('el hacheo de integridad es', integridad) +}) +``` + +#### `> cacache.mete.flujo(cache, clave, [ops]) -> Writable` + +Devuelve un [Writable +Stream](https://nodejs.org/api/stream.html#stream_writable_streams) que inserta +al caché los datos escritos a él. Emite un evento `integrity` con el hacheo del +contenido escrito, cuando completa. + +##### Ejemplo + +```javascript +request.get( + 'https://registry.npmjs.org/cacache/-/cacache-1.0.0.tgz' +).pipe( + cacache.mete.flujo( + rutaCache, 'registry.npmjs.org|cacache@1.0.0' + ).on('integrity', d => console.log(`integrity digest is ${d}`)) +) +``` + +#### `> opciones para cacache.mete` + +La funciones `cacache.mete` tienen un número de opciones en común. + +##### `ops.metadata` + +Metadatos del usuario que se almacenarán con la entrada. + +##### `ops.size` + +El tamaño declarado de los datos que se van a insertar. Si es proveído, cacache +verificará que los datos escritos sean de ese tamaño, o si no, fallará con un +error con código `EBADSIZE`. + +##### `ops.integrity` + +El hacheo de integridad de los datos siendo escritos. + +Si es proveído, y los datos escritos no le corresponden, la operación fallará +con un error con código `EINTEGRITY`. + +`ops.algorithms` no tiene ningún efecto si esta opción está presente. + +##### `ops.algorithms` + +Por Defecto: `['sha512']` + +Algoritmos que se deben usar cuando se calcule el hacheo de [subresource +integrity](#integrity) para los datos insertados. Puede usar cualquier algoritmo +enumerado en `crypto.getHashes()`. + +Por el momento, sólo se acepta un algoritmo (dígase, un array con exáctamente un +valor). No tiene ningún efecto si `ops.integrity` también ha sido proveido. + +##### `ops.uid`/`ops.gid` + +Si están presentes, cacache hará todo lo posible para asegurarse que todos los +ficheros creados en el proceso de sus operaciones en el caché usen esta +combinación en particular. + +##### `ops.memoize` + +Por Defecto: `null` + +Si es verdad, cacache tratará de memoizar los datos de la entrada en memoria. La +próxima vez que el proceso corriente trate de accesar los datos o entrada, +cacache buscará en memoria antes de buscar en disco. + +Si `ops.memoize` es un objeto regular o un objeto como `Map` (es decir, un +objeto con métodos `get()` y `set()`), este objeto en sí sera usado en vez del +caché de memoria global. Esto permite tener lógica específica a tu aplicación +encuanto al almacenaje en memoria de tus datos. + +Si quieres asegurarte que los datos se lean del disco en vez de memoria, usa +`memoize: false` cuando uses funciones de `cacache.saca`. + +#### `> cacache.rm.todo(cache) -> Promise` + +Borra el caché completo, incluyendo ficheros temporeros, ficheros de datos, y el +índice del caché. + +##### Ejemplo + +```javascript +cacache.rm.todo(rutaCache).then(() => { + console.log('THE APOCALYPSE IS UPON US 😱') +}) +``` + +#### `> cacache.rm.entrada(cache, clave) -> Promise` + +Alias: `cacache.rm` + +Borra la entrada `clave` del índuce. El contenido asociado con esta entrada +seguirá siendo accesible por hacheo usando +[`saca.flujo.porHacheo`](#get-stream). + +Para borrar el contenido en sí, usa [`rm.datos`](#rm-content). Si quieres hacer +esto de manera más segura (pues ficheros de contenido pueden ser usados por +multiples entradas), usa [`verifica`](#verify) para borrar huérfanos. + +##### Ejemplo + +```javascript +cacache.rm.entrada(rutaCache, 'my-thing').then(() => { + console.log('I did not like it anyway') +}) +``` + +#### `> cacache.rm.datos(cache, integrity) -> Promise` + +Borra el contenido identificado por `integrity`. Cualquier entrada que se +refiera a este contenido quedarán huérfanas y se invalidarán si se tratan de +accesar, al menos que contenido idéntico sea añadido bajo `integrity`. + +##### Ejemplo + +```javascript +cacache.rm.datos(rutaCache, 'sha512-SoMeDIGest/IN+BaSE64==').then(() => { + console.log('los datos para `mi-cosa` se borraron') +}) +``` + +#### `> cacache.ponLenguaje(locale)` + +Configura el lenguaje usado para mensajes y errores de cacache. La lista de +lenguajes disponibles está en el directorio `./locales` del proyecto. + +_Te interesa añadir más lenguajes? [Somete un PR](CONTRIBUTING.md)!_ + +#### `> cacache.limpiaMemoizado()` + +Completamente reinicializa el caché de memoria interno. Si estás usando tu +propio objecto con `ops.memoize`, debes hacer esto de manera específica a él. + +#### `> tmp.hazdir(cache, ops) -> Promise` + +Alias: `tmp.mkdir` + +Devuelve un directorio único dentro del directorio `tmp` del caché. + +Una vez tengas el directorio, es responsabilidad tuya asegurarte que todos los +ficheros escrito a él sean creados usando los permisos y `uid`/`gid` concordante +con el caché. Si no, puedes pedirle a cacache que lo haga llamando a +[`cacache.tmp.fix()`](#tmp-fix). Esta función arreglará todos los permisos en el +directorio tmp. + +Si quieres que cacache limpie el directorio automáticamente cuando termines, usa +[`cacache.tmp.conTmp()`](#with-tpm). + +##### Ejemplo + +```javascript +cacache.tmp.mkdir(cache).then(dir => { + fs.writeFile(path.join(dir, 'blablabla'), Buffer#<1234>, ...) +}) +``` + +#### `> tmp.conTmp(cache, ops, cb) -> Promise` + +Crea un directorio temporero con [`tmp.mkdir()`](#tmp-mkdir) y ejecuta `cb` con +él como primer argumento. El directorio creado será removido automáticamente +cuando el valor devolvido por `cb()` se resuelva. + +Las mismas advertencias aplican en cuanto a manejando permisos para los ficheros +dentro del directorio. + +##### Ejemplo + +```javascript +cacache.tmp.conTmp(cache, dir => { + return fs.writeFileAsync(path.join(dir, 'blablabla'), Buffer#<1234>, ...) +}).then(() => { + // `dir` no longer exists +}) +``` + +#### Hacheos de Subresource Integrity + +cacache usa strings que siguen la especificación de [Subresource Integrity +spec](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity). + +Es decir, donde quiera cacache espera un argumento o opción `integrity`, ese +string debería usar el formato `-`. + +Una variación importante sobre los hacheos que cacache acepta es que acepta el +nombre de cualquier algoritmo aceptado por el proceso de Node.js donde se usa. +Puedes usar `crypto.getHashes()` para ver cuales están disponibles. + +##### Generando tus propios hacheos + +Si tienes un `shasum`, en general va a estar en formato de string hexadecimal +(es decir, un `sha1` se vería como algo así: +`5f5513f8822fdbe5145af33b64d8d970dcf95c6e`). + +Para ser compatible con cacache, necesitas convertir esto a su equivalente en +subresource integrity. Por ejemplo, el hacheo correspondiente al ejemplo +anterior sería: `sha1-X1UT+IIv2+UUWvM7ZNjZcNz5XG4=`. + +Puedes usar código así para generarlo por tu cuenta: + +```javascript +const crypto = require('crypto') +const algoritmo = 'sha512' +const datos = 'foobarbaz' + +const integrity = ( + algorithm + + '-' + + crypto.createHash(algoritmo).update(datos).digest('base64') +) +``` + +También puedes usar [`ssri`](https://npm.im/ssri) para deferir el trabajo a otra +librería que garantiza que todo esté correcto, pues maneja probablemente todas +las operaciones que tendrías que hacer con SRIs, incluyendo convirtiendo entre +hexadecimal y el formato SRI. + +#### `> cacache.verifica(cache, ops) -> Promise` + +Examina y arregla tu caché: + +* Limpia entradas inválidas, huérfanas y corrompidas +* Te deja filtrar cuales entradas retener, con tu propio filtro +* Reclama cualquier ficheros de contenido sin referencias en el índice +* Verifica integridad de todos los ficheros de contenido y remueve los malos +* Arregla permisos del caché +* Remieve el directorio `tmp` en el caché, y todo su contenido. + +Cuando termine, devuelve un objeto con varias estadísticas sobre el proceso de +verificación, por ejemplo la cantidad de espacio de disco reclamado, el número +de entradas válidas, número de entradas removidas, etc. + +##### Opciones + +* `ops.uid` - uid para asignarle al caché y su contenido +* `ops.gid` - gid para asignarle al caché y su contenido +* `ops.filter` - recibe una entrada como argumento. Devuelve falso para removerla. Nota: es posible que esta función sea invocada con la misma entrada más de una vez. + +##### Example + +```sh +echo somegarbage >> $RUTACACHE/content/deadbeef +``` + +```javascript +cacache.verifica(rutaCache).then(stats => { + // deadbeef collected, because of invalid checksum. + console.log('cache is much nicer now! stats:', stats) +}) +``` + +#### `> cacache.verifica.ultimaVez(cache) -> Promise` + +Alias: `últimaVez` + +Devuelve un `Date` que representa la última vez que `cacache.verifica` fue +ejecutada en `cache`. + +##### Example + +```javascript +cacache.verifica(rutaCache).then(() => { + cacache.verifica.ultimaVez(rutaCache).then(última => { + console.log('La última vez que se usó cacache.verifica() fue ' + última) + }) +}) +``` diff --git a/deps/npm/node_modules/cacache/get.js b/deps/npm/node_modules/cacache/get.js index 58adb8e9f60a5a..2bb3afa5281ca4 100644 --- a/deps/npm/node_modules/cacache/get.js +++ b/deps/npm/node_modules/cacache/get.js @@ -2,6 +2,7 @@ const BB = require('bluebird') +const fs = require('fs') const index = require('./lib/entry-index') const memo = require('./lib/memoization') const pipe = require('mississippi').pipe @@ -152,3 +153,38 @@ function info (cache, key, opts) { } module.exports.hasContent = read.hasContent + +module.exports.copy = function cp (cache, key, dest, opts) { + return copy(false, cache, key, dest, opts) +} +module.exports.copy.byDigest = function cpDigest (cache, digest, dest, opts) { + return copy(true, cache, digest, dest, opts) +} +function copy (byDigest, cache, key, dest, opts) { + opts = opts || {} + if (read.copy) { + return ( + byDigest ? BB.resolve(null) : index.find(cache, key, opts) + ).then(entry => { + if (!entry && !byDigest) { + throw new index.NotFoundError(cache, key) + } + return read.copy( + cache, byDigest ? key : entry.integrity, dest, opts + ).then(() => byDigest ? key : { + metadata: entry.metadata, + size: entry.size, + integrity: entry.integrity + }) + }) + } else { + return getData(byDigest, cache, key, opts).then(res => { + return fs.writeFileAsync(dest, byDigest ? res : res.data) + .then(() => byDigest ? key : { + metadata: res.metadata, + size: res.size, + integrity: res.integrity + }) + }) + } +} diff --git a/deps/npm/node_modules/cacache/lib/content/read.js b/deps/npm/node_modules/cacache/lib/content/read.js index 14ca7d905dfdb6..b09ad5cb4096bc 100644 --- a/deps/npm/node_modules/cacache/lib/content/read.js +++ b/deps/npm/node_modules/cacache/lib/content/read.js @@ -52,6 +52,18 @@ function readStream (cache, integrity, opts) { return stream } +if (fs.copyFile) { + module.exports.copy = copy +} +function copy (cache, integrity, dest, opts) { + opts = opts || {} + return pickContentSri(cache, integrity).then(content => { + const sri = content.sri + const cpath = contentPath(cache, sri) + return fs.copyFileAsync(cpath, dest).then(() => content.size) + }) +} + module.exports.hasContent = hasContent function hasContent (cache, integrity) { if (!integrity) { return BB.resolve(false) } diff --git a/deps/npm/node_modules/cacache/lib/util/move-file.js b/deps/npm/node_modules/cacache/lib/util/move-file.js index e12e98188c42c0..b43744b3da8673 100644 --- a/deps/npm/node_modules/cacache/lib/util/move-file.js +++ b/deps/npm/node_modules/cacache/lib/util/move-file.js @@ -34,22 +34,18 @@ function moveFile (src, dest) { }).then(() => { // content should never change for any reason, so make it read-only return BB.join(unlink(src), process.platform !== 'win32' && chmod(dest, '0444')) - }).catch(err => { - if (process.platform !== 'win32') { - throw err - } else { - if (!pinflight) { pinflight = require('promise-inflight') } - return pinflight('cacache-move-file:' + dest, () => { - return BB.promisify(fs.stat)(dest).catch(err => { - if (err !== 'ENOENT') { - // Something else is wrong here. Bail bail bail - throw err - } - // file doesn't already exist! let's try a rename -> copy fallback - if (!move) { move = require('move-concurrently') } - return move(src, dest, { BB, fs }) - }) + }).catch(() => { + if (!pinflight) { pinflight = require('promise-inflight') } + return pinflight('cacache-move-file:' + dest, () => { + return BB.promisify(fs.stat)(dest).catch(err => { + if (err.code !== 'ENOENT') { + // Something else is wrong here. Bail bail bail + throw err + } + // file doesn't already exist! let's try a rename -> copy fallback + if (!move) { move = require('move-concurrently') } + return move(src, dest, { BB, fs }) }) - } + }) }) } diff --git a/deps/npm/node_modules/cacache/locales/en.js b/deps/npm/node_modules/cacache/locales/en.js index 22382c96b38596..22025cf0e895e6 100644 --- a/deps/npm/node_modules/cacache/locales/en.js +++ b/deps/npm/node_modules/cacache/locales/en.js @@ -20,6 +20,8 @@ x.get = (cache, key, opts) => get(cache, key, opts) x.get.byDigest = (cache, hash, opts) => get.byDigest(cache, hash, opts) x.get.stream = (cache, key, opts) => get.stream(cache, key, opts) x.get.stream.byDigest = (cache, hash, opts) => get.stream.byDigest(cache, hash, opts) +x.get.copy = (cache, key, dest, opts) => get.copy(cache, key, dest, opts) +x.get.copy.byDigest = (cache, hash, dest, opts) => get.copy.byDigest(cache, hash, dest, opts) x.get.info = (cache, key) => get.info(cache, key) x.get.hasContent = (cache, hash) => get.hasContent(cache, hash) diff --git a/deps/npm/node_modules/cacache/locales/es.js b/deps/npm/node_modules/cacache/locales/es.js index 6cb9d0c0d28be9..9a27de6585a231 100644 --- a/deps/npm/node_modules/cacache/locales/es.js +++ b/deps/npm/node_modules/cacache/locales/es.js @@ -20,6 +20,8 @@ x.saca = (cache, clave, ops) => get(cache, clave, ops) x.saca.porHacheo = (cache, hacheo, ops) => get.byDigest(cache, hacheo, ops) x.saca.flujo = (cache, clave, ops) => get.stream(cache, clave, ops) x.saca.flujo.porHacheo = (cache, hacheo, ops) => get.stream.byDigest(cache, hacheo, ops) +x.sava.copia = (cache, clave, destino, opts) => get.copy(cache, clave, destino, opts) +x.sava.copia.porHacheo = (cache, hacheo, destino, opts) => get.copy.byDigest(cache, hacheo, destino, opts) x.saca.info = (cache, clave) => get.info(cache, clave) x.saca.tieneDatos = (cache, hacheo) => get.hasContent(cache, hacheo) diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/README.md b/deps/npm/node_modules/cacache/node_modules/lru-cache/README.md deleted file mode 100644 index f646c1cb8e50b1..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/README.md +++ /dev/null @@ -1,152 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) - -## Installation: - -```javascript -npm install lru-cache --save -``` - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n, key) { return n * 2 + key.length } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -// non-string keys ARE fully supported -var someObject = {} -cache.set(someObject, 'a value') -cache.set('[object Object]', 'a different value') -assert.equal(cache.get(someObject), 'a value') - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n, key){return n.length}`. The default is - `function(){return 1}`, which is fine if you want to store `max` - like-sized things. The item is passed as the first argument, and - the key is passed as the second argumnet. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. -* `noDisposeOnSet` By default, if you set a `dispose()` method, then - it'll be called whenever a `set()` operation overwrites an existing - key. If you set this option, `dispose()` will only be called when a - key falls out of the cache, not when it is overwritten. - -## API - -* `set(key, value, maxAge)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. `maxAge` is optional and overrides the - cache `maxAge` option if provided. - - If the key is not found, `get()` will return `undefined`. - - The key and val can be any value. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `rforEach(function(value,key,cache), [thisp])` - - The same as `cache.forEach(...)` but items are iterated over in - reverse order. (ie, less recently used items are iterated over - first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. - -* `length` - - Return total length of objects in cache taking into account - `length` options function. - -* `itemCount` - - Return total quantity of objects currently in cache. Note, that - `stale` (see options) items are returned as part of this item - count. - -* `dump()` - - Return an array of the cache entries ready for serialization and usage - with 'destinationCache.load(arr)`. - -* `load(cacheEntriesArray)` - - Loads another cache entries array, obtained with `sourceCache.dump()`, - into the cache. The destination cache is reset before loading new entries - -* `prune()` - - Manually iterates over the entire cache proactively pruning old entries diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/index.js b/deps/npm/node_modules/cacache/node_modules/lru-cache/index.js deleted file mode 100644 index 460462aadc9dd9..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/index.js +++ /dev/null @@ -1,467 +0,0 @@ -'use strict' - -module.exports = LRUCache - -// This will be a proper iterable 'Map' in engines that support it, -// or a fakey-fake PseudoMap in older versions. -var Map = require('pseudomap') -var util = require('util') - -// A linked list to keep track of recently-used-ness -var Yallist = require('yallist') - -// use symbols if possible, otherwise just _props -var hasSymbol = typeof Symbol === 'function' -var makeSymbol -if (hasSymbol) { - makeSymbol = function (key) { - return Symbol.for(key) - } -} else { - makeSymbol = function (key) { - return '_' + key - } -} - -var MAX = makeSymbol('max') -var LENGTH = makeSymbol('length') -var LENGTH_CALCULATOR = makeSymbol('lengthCalculator') -var ALLOW_STALE = makeSymbol('allowStale') -var MAX_AGE = makeSymbol('maxAge') -var DISPOSE = makeSymbol('dispose') -var NO_DISPOSE_ON_SET = makeSymbol('noDisposeOnSet') -var LRU_LIST = makeSymbol('lruList') -var CACHE = makeSymbol('cache') - -function naiveLength () { return 1 } - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -function LRUCache (options) { - if (!(this instanceof LRUCache)) { - return new LRUCache(options) - } - - if (typeof options === 'number') { - options = { max: options } - } - - if (!options) { - options = {} - } - - var max = this[MAX] = options.max - // Kind of weird to have a default max of Infinity, but oh well. - if (!max || - !(typeof max === 'number') || - max <= 0) { - this[MAX] = Infinity - } - - var lc = options.length || naiveLength - if (typeof lc !== 'function') { - lc = naiveLength - } - this[LENGTH_CALCULATOR] = lc - - this[ALLOW_STALE] = options.stale || false - this[MAX_AGE] = options.maxAge || 0 - this[DISPOSE] = options.dispose - this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, 'max', { - set: function (mL) { - if (!mL || !(typeof mL === 'number') || mL <= 0) { - mL = Infinity - } - this[MAX] = mL - trim(this) - }, - get: function () { - return this[MAX] - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'allowStale', { - set: function (allowStale) { - this[ALLOW_STALE] = !!allowStale - }, - get: function () { - return this[ALLOW_STALE] - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'maxAge', { - set: function (mA) { - if (!mA || !(typeof mA === 'number') || mA < 0) { - mA = 0 - } - this[MAX_AGE] = mA - trim(this) - }, - get: function () { - return this[MAX_AGE] - }, - enumerable: true -}) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { - set: function (lC) { - if (typeof lC !== 'function') { - lC = naiveLength - } - if (lC !== this[LENGTH_CALCULATOR]) { - this[LENGTH_CALCULATOR] = lC - this[LENGTH] = 0 - this[LRU_LIST].forEach(function (hit) { - hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) - this[LENGTH] += hit.length - }, this) - } - trim(this) - }, - get: function () { return this[LENGTH_CALCULATOR] }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'length', { - get: function () { return this[LENGTH] }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'itemCount', { - get: function () { return this[LRU_LIST].length }, - enumerable: true -}) - -LRUCache.prototype.rforEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this[LRU_LIST].tail; walker !== null;) { - var prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev - } -} - -function forEachStep (self, fn, node, thisp) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) { - hit = undefined - } - } - if (hit) { - fn.call(thisp, hit.value, hit.key, self) - } -} - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this[LRU_LIST].head; walker !== null;) { - var next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next - } -} - -LRUCache.prototype.keys = function () { - return this[LRU_LIST].toArray().map(function (k) { - return k.key - }, this) -} - -LRUCache.prototype.values = function () { - return this[LRU_LIST].toArray().map(function (k) { - return k.value - }, this) -} - -LRUCache.prototype.reset = function () { - if (this[DISPOSE] && - this[LRU_LIST] && - this[LRU_LIST].length) { - this[LRU_LIST].forEach(function (hit) { - this[DISPOSE](hit.key, hit.value) - }, this) - } - - this[CACHE] = new Map() // hash of items by key - this[LRU_LIST] = new Yallist() // list of items in order of use recency - this[LENGTH] = 0 // length of items in the list -} - -LRUCache.prototype.dump = function () { - return this[LRU_LIST].map(function (hit) { - if (!isStale(this, hit)) { - return { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - } - } - }, this).toArray().filter(function (h) { - return h - }) -} - -LRUCache.prototype.dumpLru = function () { - return this[LRU_LIST] -} - -LRUCache.prototype.inspect = function (n, opts) { - var str = 'LRUCache {' - var extras = false - - var as = this[ALLOW_STALE] - if (as) { - str += '\n allowStale: true' - extras = true - } - - var max = this[MAX] - if (max && max !== Infinity) { - if (extras) { - str += ',' - } - str += '\n max: ' + util.inspect(max, opts) - extras = true - } - - var maxAge = this[MAX_AGE] - if (maxAge) { - if (extras) { - str += ',' - } - str += '\n maxAge: ' + util.inspect(maxAge, opts) - extras = true - } - - var lc = this[LENGTH_CALCULATOR] - if (lc && lc !== naiveLength) { - if (extras) { - str += ',' - } - str += '\n length: ' + util.inspect(this[LENGTH], opts) - extras = true - } - - var didFirst = false - this[LRU_LIST].forEach(function (item) { - if (didFirst) { - str += ',\n ' - } else { - if (extras) { - str += ',\n' - } - didFirst = true - str += '\n ' - } - var key = util.inspect(item.key).split('\n').join('\n ') - var val = { value: item.value } - if (item.maxAge !== maxAge) { - val.maxAge = item.maxAge - } - if (lc !== naiveLength) { - val.length = item.length - } - if (isStale(this, item)) { - val.stale = true - } - - val = util.inspect(val, opts).split('\n').join('\n ') - str += key + ' => ' + val - }) - - if (didFirst || extras) { - str += '\n' - } - str += '}' - - return str -} - -LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || this[MAX_AGE] - - var now = maxAge ? Date.now() : 0 - var len = this[LENGTH_CALCULATOR](value, key) - - if (this[CACHE].has(key)) { - if (len > this[MAX]) { - del(this, this[CACHE].get(key)) - return false - } - - var node = this[CACHE].get(key) - var item = node.value - - // dispose of the old one before overwriting - // split out into 2 ifs for better coverage tracking - if (this[DISPOSE]) { - if (!this[NO_DISPOSE_ON_SET]) { - this[DISPOSE](key, item.value) - } - } - - item.now = now - item.maxAge = maxAge - item.value = value - this[LENGTH] += len - item.length - item.length = len - this.get(key) - trim(this) - return true - } - - var hit = new Entry(key, value, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this[MAX]) { - if (this[DISPOSE]) { - this[DISPOSE](key, value) - } - return false - } - - this[LENGTH] += hit.length - this[LRU_LIST].unshift(hit) - this[CACHE].set(key, this[LRU_LIST].head) - trim(this) - return true -} - -LRUCache.prototype.has = function (key) { - if (!this[CACHE].has(key)) return false - var hit = this[CACHE].get(key).value - if (isStale(this, hit)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var node = this[LRU_LIST].tail - if (!node) return null - del(this, node) - return node.value -} - -LRUCache.prototype.del = function (key) { - del(this, this[CACHE].get(key)) -} - -LRUCache.prototype.load = function (arr) { - // reset the cache - this.reset() - - var now = Date.now() - // A previous serialized cache has the most recent items first - for (var l = arr.length - 1; l >= 0; l--) { - var hit = arr[l] - var expiresAt = hit.e || 0 - if (expiresAt === 0) { - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - } else { - var maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) - } - } - } -} - -LRUCache.prototype.prune = function () { - var self = this - this[CACHE].forEach(function (value, key) { - get(self, key, false) - }) -} - -function get (self, key, doUse) { - var node = self[CACHE].get(key) - if (node) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!self[ALLOW_STALE]) hit = undefined - } else { - if (doUse) { - self[LRU_LIST].unshiftNode(node) - } - } - if (hit) hit = hit.value - } - return hit -} - -function isStale (self, hit) { - if (!hit || (!hit.maxAge && !self[MAX_AGE])) { - return false - } - var stale = false - var diff = Date.now() - hit.now - if (hit.maxAge) { - stale = diff > hit.maxAge - } else { - stale = self[MAX_AGE] && (diff > self[MAX_AGE]) - } - return stale -} - -function trim (self) { - if (self[LENGTH] > self[MAX]) { - for (var walker = self[LRU_LIST].tail; - self[LENGTH] > self[MAX] && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - var prev = walker.prev - del(self, walker) - walker = prev - } - } -} - -function del (self, node) { - if (node) { - var hit = node.value - if (self[DISPOSE]) { - self[DISPOSE](hit.key, hit.value) - } - self[LENGTH] -= hit.length - self[CACHE].delete(hit.key) - self[LRU_LIST].removeNode(node) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md deleted file mode 100644 index 778bf01dfaaf9f..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# pseudomap - -A thing that is a lot like ES6 `Map`, but without iterators, for use -in environments where `for..of` syntax and `Map` are not available. - -If you need iterators, or just in general a more faithful polyfill to -ES6 Maps, check out [es6-map](http://npm.im/es6-map). - -If you are in an environment where `Map` is supported, then that will -be returned instead, unless `process.env.TEST_PSEUDOMAP` is set. - -You can use any value as keys, and any value as data. Setting again -with the identical key will overwrite the previous value. - -Internally, data is stored on an `Object.create(null)` style object. -The key is coerced to a string to generate the key on the internal -data-bag object. The original key used is stored along with the data. - -In the event of a stringified-key collision, a new key is generated by -appending an increasing number to the stringified-key until finding -either the intended key or an empty spot. - -Note that because object traversal order of plain objects is not -guaranteed to be identical to insertion order, the insertion order -guarantee of `Map.prototype.forEach` is not guaranteed in this -implementation. However, in all versions of Node.js and V8 where this -module works, `forEach` does traverse data in insertion order. - -## API - -Most of the [Map -API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), -with the following exceptions: - -1. A `Map` object is not an iterator. -2. `values`, `keys`, and `entries` methods are not implemented, - because they return iterators. -3. The argument to the constructor can be an Array of `[key, value]` - pairs, or a `Map` or `PseudoMap` object. But, since iterators - aren't used, passing any plain-old iterator won't initialize the - map properly. - -## USAGE - -Use just like a regular ES6 Map. - -```javascript -var PseudoMap = require('pseudomap') - -// optionally provide a pseudomap, or an array of [key,value] pairs -// as the argument to initialize the map with -var myMap = new PseudoMap() - -myMap.set(1, 'number 1') -myMap.set('1', 'string 1') -var akey = {} -var bkey = {} -myMap.set(akey, { some: 'data' }) -myMap.set(bkey, { some: 'other data' }) -``` diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/map.js b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/map.js deleted file mode 100644 index 7db15994612fd9..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/map.js +++ /dev/null @@ -1,9 +0,0 @@ -if (process.env.npm_package_name === 'pseudomap' && - process.env.npm_lifecycle_script === 'test') - process.env.TEST_PSEUDOMAP = 'true' - -if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { - module.exports = Map -} else { - module.exports = require('./pseudomap') -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/package.json b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/package.json deleted file mode 100644 index 3b5bd1e0eefc3f..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "_from": "pseudomap@^1.0.2", - "_id": "pseudomap@1.0.2", - "_inBundle": false, - "_integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "_location": "/cacache/lru-cache/pseudomap", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "pseudomap@^1.0.2", - "name": "pseudomap", - "escapedName": "pseudomap", - "rawSpec": "^1.0.2", - "saveSpec": null, - "fetchSpec": "^1.0.2" - }, - "_requiredBy": [ - "/cacache/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "_shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", - "_spec": "pseudomap@^1.0.2", - "_where": "/Users/rebecca/code/npm/node_modules/cacache/node_modules/lru-cache", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/pseudomap/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.", - "devDependencies": { - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, - "homepage": "https://github.com/isaacs/pseudomap#readme", - "license": "ISC", - "main": "map.js", - "name": "pseudomap", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/pseudomap.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js deleted file mode 100644 index 25a21d829e8b3f..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js +++ /dev/null @@ -1,113 +0,0 @@ -var hasOwnProperty = Object.prototype.hasOwnProperty - -module.exports = PseudoMap - -function PseudoMap (set) { - if (!(this instanceof PseudoMap)) // whyyyyyyy - throw new TypeError("Constructor PseudoMap requires 'new'") - - this.clear() - - if (set) { - if ((set instanceof PseudoMap) || - (typeof Map === 'function' && set instanceof Map)) - set.forEach(function (value, key) { - this.set(key, value) - }, this) - else if (Array.isArray(set)) - set.forEach(function (kv) { - this.set(kv[0], kv[1]) - }, this) - else - throw new TypeError('invalid argument') - } -} - -PseudoMap.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - Object.keys(this._data).forEach(function (k) { - if (k !== 'size') - fn.call(thisp, this._data[k].value, this._data[k].key) - }, this) -} - -PseudoMap.prototype.has = function (k) { - return !!find(this._data, k) -} - -PseudoMap.prototype.get = function (k) { - var res = find(this._data, k) - return res && res.value -} - -PseudoMap.prototype.set = function (k, v) { - set(this._data, k, v) -} - -PseudoMap.prototype.delete = function (k) { - var res = find(this._data, k) - if (res) { - delete this._data[res._index] - this._data.size-- - } -} - -PseudoMap.prototype.clear = function () { - var data = Object.create(null) - data.size = 0 - - Object.defineProperty(this, '_data', { - value: data, - enumerable: false, - configurable: true, - writable: false - }) -} - -Object.defineProperty(PseudoMap.prototype, 'size', { - get: function () { - return this._data.size - }, - set: function (n) {}, - enumerable: true, - configurable: true -}) - -PseudoMap.prototype.values = -PseudoMap.prototype.keys = -PseudoMap.prototype.entries = function () { - throw new Error('iterators are not implemented in this version') -} - -// Either identical, or both NaN -function same (a, b) { - return a === b || a !== a && b !== b -} - -function Entry (k, v, i) { - this.key = k - this.value = v - this._index = i -} - -function find (data, k) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) - return data[key] - } -} - -function set (data, k, v) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) { - data[key].value = v - return - } - } - data.size++ - data[key] = new Entry(k, v, key) -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/test/basic.js deleted file mode 100644 index 4378e4541e9a14..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/pseudomap/test/basic.js +++ /dev/null @@ -1,86 +0,0 @@ -var t = require('tap') - -process.env.TEST_PSEUDOMAP = 'true' - -var PM = require('../') -runTests(PM) - -// if possible, verify that Map also behaves the same way -if (typeof Map === 'function') - runTests(Map) - - -function runTests (Map) { - t.throws(Map) - - var m = new Map() - - t.equal(m.size, 0) - - m.set(1, '1 string') - t.equal(m.get(1), '1 string') - t.equal(m.size, 1) - m.size = 1000 - t.equal(m.size, 1) - m.size = 0 - t.equal(m.size, 1) - - m = new Map([[1, 'number 1'], ['1', 'string 1']]) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - m = new Map(m) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - var akey = {} - var bkey = {} - m.set(akey, { some: 'data' }) - m.set(bkey, { some: 'other data' }) - t.same(m.get(akey), { some: 'data' }) - t.same(m.get(bkey), { some: 'other data' }) - t.equal(m.size, 4) - - var x = /x/ - var y = /x/ - m.set(x, 'x regex') - m.set(y, 'y regex') - t.equal(m.get(x), 'x regex') - m.set(x, 'x again') - t.equal(m.get(x), 'x again') - t.equal(m.size, 6) - - m.set(NaN, 'not a number') - t.equal(m.get(NaN), 'not a number') - m.set(NaN, 'it is a ' + typeof NaN) - t.equal(m.get(NaN), 'it is a number') - m.set('NaN', 'stringie nan') - t.equal(m.get(NaN), 'it is a number') - t.equal(m.get('NaN'), 'stringie nan') - t.equal(m.size, 8) - - m.delete(NaN) - t.equal(m.get(NaN), undefined) - t.equal(m.size, 7) - - var expect = [ - { value: 'number 1', key: 1 }, - { value: 'string 1', key: '1' }, - { value: { some: 'data' }, key: {} }, - { value: { some: 'other data' }, key: {} }, - { value: 'x again', key: /x/ }, - { value: 'y regex', key: /x/ }, - { value: 'stringie nan', key: 'NaN' } - ] - var actual = [] - - m.forEach(function (value, key) { - actual.push({ value: value, key: key }) - }) - t.same(actual, expect) - - m.clear() - t.equal(m.size, 0) -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/README.md b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/README.md deleted file mode 100644 index f5861018696688..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# yallist - -Yet Another Linked List - -There are many doubly-linked list implementations like it, but this -one is mine. - -For when an array would be too big, and a Map can't be iterated in -reverse order. - - -[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) - -## basic usage - -```javascript -var yallist = require('yallist') -var myList = yallist.create([1, 2, 3]) -myList.push('foo') -myList.unshift('bar') -// of course pop() and shift() are there, too -console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] -myList.forEach(function (k) { - // walk the list head to tail -}) -myList.forEachReverse(function (k, index, list) { - // walk the list tail to head -}) -var myDoubledList = myList.map(function (k) { - return k + k -}) -// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] -// mapReverse is also a thing -var myDoubledListReverse = myList.mapReverse(function (k) { - return k + k -}) // ['foofoo', 6, 4, 2, 'barbar'] - -var reduced = myList.reduce(function (set, entry) { - set += entry - return set -}, 'start') -console.log(reduced) // 'startfoo123bar' -``` - -## api - -The whole API is considered "public". - -Functions with the same name as an Array method work more or less the -same way. - -There's reverse versions of most things because that's the point. - -### Yallist - -Default export, the class that holds and manages a list. - -Call it with either a forEach-able (like an array) or a set of -arguments, to initialize the list. - -The Array-ish methods all act like you'd expect. No magic length, -though, so if you change that it won't automatically prune or add -empty spots. - -### Yallist.create(..) - -Alias for Yallist function. Some people like factories. - -#### yallist.head - -The first node in the list - -#### yallist.tail - -The last node in the list - -#### yallist.length - -The number of nodes in the list. (Change this at your peril. It is -not magic like Array length.) - -#### yallist.toArray() - -Convert the list to an array. - -#### yallist.forEach(fn, [thisp]) - -Call a function on each item in the list. - -#### yallist.forEachReverse(fn, [thisp]) - -Call a function on each item in the list, in reverse order. - -#### yallist.get(n) - -Get the data at position `n` in the list. If you use this a lot, -probably better off just using an Array. - -#### yallist.getReverse(n) - -Get the data at position `n`, counting from the tail. - -#### yallist.map(fn, thisp) - -Create a new Yallist with the result of calling the function on each -item. - -#### yallist.mapReverse(fn, thisp) - -Same as `map`, but in reverse. - -#### yallist.pop() - -Get the data from the list tail, and remove the tail from the list. - -#### yallist.push(item, ...) - -Insert one or more items to the tail of the list. - -#### yallist.reduce(fn, initialValue) - -Like Array.reduce. - -#### yallist.reduceReverse - -Like Array.reduce, but in reverse. - -#### yallist.reverse - -Reverse the list in place. - -#### yallist.shift() - -Get the data from the list head, and remove the head from the list. - -#### yallist.slice([from], [to]) - -Just like Array.slice, but returns a new Yallist. - -#### yallist.sliceReverse([from], [to]) - -Just like yallist.slice, but the result is returned in reverse. - -#### yallist.toArray() - -Create an array representation of the list. - -#### yallist.toArrayReverse() - -Create a reversed array representation of the list. - -#### yallist.unshift(item, ...) - -Insert one or more items to the head of the list. - -#### yallist.unshiftNode(node) - -Move a Node object to the front of the list. (That is, pull it out of -wherever it lives, and make it the new head.) - -If the node belongs to a different list, then that list will remove it -first. - -#### yallist.pushNode(node) - -Move a Node object to the end of the list. (That is, pull it out of -wherever it lives, and make it the new tail.) - -If the node belongs to a list already, then that list will remove it -first. - -#### yallist.removeNode(node) - -Remove a node from the list, preserving referential integrity of head -and tail and other nodes. - -Will throw an error if you try to have a list remove a node that -doesn't belong to it. - -### Yallist.Node - -The class that holds the data and is actually the list. - -Call with `var n = new Node(value, previousNode, nextNode)` - -Note that if you do direct operations on Nodes themselves, it's very -easy to get into weird states where the list is broken. Be careful :) - -#### node.next - -The next node in the list. - -#### node.prev - -The previous node in the list. - -#### node.value - -The data the node contains. - -#### node.list - -The list to which this node belongs. (Null if it does not belong to -any list.) diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/iterator.js b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/iterator.js deleted file mode 100644 index 4a15bf22c40032..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/iterator.js +++ /dev/null @@ -1,7 +0,0 @@ -var Yallist = require('./yallist.js') - -Yallist.prototype[Symbol.iterator] = function* () { - for (let walker = this.head; walker; walker = walker.next) { - yield walker.value - } -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/package.json b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/package.json deleted file mode 100644 index b0fdf0d0a6fdf6..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "yallist@^2.1.2", - "_id": "yallist@2.1.2", - "_inBundle": false, - "_integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "_location": "/cacache/lru-cache/yallist", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "yallist@^2.1.2", - "name": "yallist", - "escapedName": "yallist", - "rawSpec": "^2.1.2", - "saveSpec": null, - "fetchSpec": "^2.1.2" - }, - "_requiredBy": [ - "/cacache/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "_shasum": "1c11f9218f076089a47dd512f93c6699a6a81d52", - "_spec": "yallist@^2.1.2", - "_where": "/Users/rebecca/code/npm/node_modules/cacache/node_modules/lru-cache", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/yallist/issues" - }, - "bundleDependencies": false, - "dependencies": {}, - "deprecated": false, - "description": "Yet Another Linked List", - "devDependencies": { - "tap": "^10.3.0" - }, - "directories": { - "test": "test" - }, - "files": [ - "yallist.js", - "iterator.js" - ], - "homepage": "https://github.com/isaacs/yallist#readme", - "license": "ISC", - "main": "yallist.js", - "name": "yallist", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100" - }, - "version": "2.1.2" -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/yallist.js b/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/yallist.js deleted file mode 100644 index 518d23330b936c..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/node_modules/yallist/yallist.js +++ /dev/null @@ -1,370 +0,0 @@ -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length-- - node.next = null - node.prev = null - node.list = null -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) { - return undefined - } - - var res = this.tail.value - this.tail = this.tail.prev - if (this.tail) { - this.tail.next = null - } else { - this.head = null - } - this.length-- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) { - return undefined - } - - var res = this.head.value - this.head = this.head.next - if (this.head) { - this.head.prev = null - } else { - this.tail = null - } - this.length-- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} diff --git a/deps/npm/node_modules/cacache/node_modules/lru-cache/package.json b/deps/npm/node_modules/cacache/node_modules/lru-cache/package.json deleted file mode 100644 index b0b037c12876f9..00000000000000 --- a/deps/npm/node_modules/cacache/node_modules/lru-cache/package.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "lru-cache@^4.1.1", - "_id": "lru-cache@4.1.1", - "_inBundle": false, - "_integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", - "_location": "/cacache/lru-cache", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lru-cache@^4.1.1", - "name": "lru-cache", - "escapedName": "lru-cache", - "rawSpec": "^4.1.1", - "saveSpec": null, - "fetchSpec": "^4.1.1" - }, - "_requiredBy": [ - "/cacache" - ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "_shasum": "622e32e82488b49279114a4f9ecf45e7cd6bba55", - "_spec": "lru-cache@^4.1.1", - "_where": "/Users/rebecca/code/npm/node_modules/cacache", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "bundleDependencies": false, - "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - }, - "deprecated": false, - "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "benchmark": "^2.1.4", - "standard": "^5.4.1", - "tap": "^10.3.3" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "keywords": [ - "mru", - "lru", - "cache" - ], - "license": "ISC", - "main": "index.js", - "name": "lru-cache", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "scripts": { - "postpublish": "git push origin --all; git push origin --tags", - "posttest": "standard test/*.js index.js", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap test/*.js --100 -J" - }, - "version": "4.1.1" -} diff --git a/deps/npm/node_modules/cacache/node_modules/ssri/CHANGELOG.md b/deps/npm/node_modules/cacache/node_modules/ssri/CHANGELOG.md new file mode 100644 index 00000000000000..7ae2b000dce8c2 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/ssri/CHANGELOG.md @@ -0,0 +1,190 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [5.0.0](https://github.com/zkat/ssri/compare/v4.1.6...v5.0.0) (2017-10-23) + + +### Features + +* **license:** relicense to ISC (#9) ([c82983a](https://github.com/zkat/ssri/commit/c82983a)) + + +### BREAKING CHANGES + +* **license:** the license has been changed from CC0-1.0 to ISC. + + + + +## [4.1.6](https://github.com/zkat/ssri/compare/v4.1.5...v4.1.6) (2017-06-07) + + +### Bug Fixes + +* **checkStream:** make sure to pass all opts through ([0b1bcbe](https://github.com/zkat/ssri/commit/0b1bcbe)) + + + + +## [4.1.5](https://github.com/zkat/ssri/compare/v4.1.4...v4.1.5) (2017-06-05) + + +### Bug Fixes + +* **integrityStream:** stop crashing if opts.algorithms and opts.integrity have an algo mismatch ([fb1293e](https://github.com/zkat/ssri/commit/fb1293e)) + + + + +## [4.1.4](https://github.com/zkat/ssri/compare/v4.1.3...v4.1.4) (2017-05-31) + + +### Bug Fixes + +* **node:** older versions of node[@4](https://github.com/4) do not support base64buffer string parsing ([513df4e](https://github.com/zkat/ssri/commit/513df4e)) + + + + +## [4.1.3](https://github.com/zkat/ssri/compare/v4.1.2...v4.1.3) (2017-05-24) + + +### Bug Fixes + +* **check:** handle various bad hash corner cases better ([c2c262b](https://github.com/zkat/ssri/commit/c2c262b)) + + + + +## [4.1.2](https://github.com/zkat/ssri/compare/v4.1.1...v4.1.2) (2017-04-18) + + +### Bug Fixes + +* **stream:** _flush can be called multiple times. use on("end") ([b1c4805](https://github.com/zkat/ssri/commit/b1c4805)) + + + + +## [4.1.1](https://github.com/zkat/ssri/compare/v4.1.0...v4.1.1) (2017-04-12) + + +### Bug Fixes + +* **pickAlgorithm:** error if pickAlgorithm() is used in an empty Integrity ([fab470e](https://github.com/zkat/ssri/commit/fab470e)) + + + + +# [4.1.0](https://github.com/zkat/ssri/compare/v4.0.0...v4.1.0) (2017-04-07) + + +### Features + +* adding ssri.create for a crypto style interface (#2) ([96f52ad](https://github.com/zkat/ssri/commit/96f52ad)) + + + + +# [4.0.0](https://github.com/zkat/ssri/compare/v3.0.2...v4.0.0) (2017-04-03) + + +### Bug Fixes + +* **integrity:** should have changed the error code before. oops ([8381afa](https://github.com/zkat/ssri/commit/8381afa)) + + +### BREAKING CHANGES + +* **integrity:** EBADCHECKSUM -> EINTEGRITY for verification errors + + + + +## [3.0.2](https://github.com/zkat/ssri/compare/v3.0.1...v3.0.2) (2017-04-03) + + + + +## [3.0.1](https://github.com/zkat/ssri/compare/v3.0.0...v3.0.1) (2017-04-03) + + +### Bug Fixes + +* **package.json:** really should have these in the keywords because search ([a6ac6d0](https://github.com/zkat/ssri/commit/a6ac6d0)) + + + + +# [3.0.0](https://github.com/zkat/ssri/compare/v2.0.0...v3.0.0) (2017-04-03) + + +### Bug Fixes + +* **hashes:** IntegrityMetadata -> Hash ([d04aa1f](https://github.com/zkat/ssri/commit/d04aa1f)) + + +### Features + +* **check:** return IntegrityMetadata on check success ([2301e74](https://github.com/zkat/ssri/commit/2301e74)) +* **fromHex:** ssri.fromHex to make it easier to generate them from hex valus ([049b89e](https://github.com/zkat/ssri/commit/049b89e)) +* **hex:** utility function for getting hex version of digest ([a9f021c](https://github.com/zkat/ssri/commit/a9f021c)) +* **hexDigest:** added hexDigest method to Integrity objects too ([85208ba](https://github.com/zkat/ssri/commit/85208ba)) +* **integrity:** add .isIntegrity and .isIntegrityMetadata ([1b29e6f](https://github.com/zkat/ssri/commit/1b29e6f)) +* **integrityStream:** new stream that can both generate and check streamed data ([fd23e1b](https://github.com/zkat/ssri/commit/fd23e1b)) +* **parse:** allow parsing straight into a single IntegrityMetadata object ([c8ddf48](https://github.com/zkat/ssri/commit/c8ddf48)) +* **pickAlgorithm:** Intergrity#pickAlgorithm() added ([b97a796](https://github.com/zkat/ssri/commit/b97a796)) +* **size:** calculate and update stream sizes ([02ed1ad](https://github.com/zkat/ssri/commit/02ed1ad)) + + +### BREAKING CHANGES + +* **hashes:** `.isIntegrityMetadata` is now `.isHash`. Also, any references to `IntegrityMetadata` now refer to `Hash`. +* **integrityStream:** createCheckerStream has been removed and replaced with a general-purpose integrityStream. + +To convert existing createCheckerStream code, move the `sri` argument into `opts.integrity` in integrityStream. All other options should be the same. +* **check:** `checkData`, `checkStream`, and `createCheckerStream` now yield a whole IntegrityMetadata instance representing the first successful hash match. + + + + +# [2.0.0](https://github.com/zkat/ssri/compare/v1.0.0...v2.0.0) (2017-03-24) + + +### Bug Fixes + +* **strict-mode:** make regexes more rigid ([122a32c](https://github.com/zkat/ssri/commit/122a32c)) + + +### Features + +* **api:** added serialize alias for unparse ([999b421](https://github.com/zkat/ssri/commit/999b421)) +* **concat:** add Integrity#concat() ([cae12c7](https://github.com/zkat/ssri/commit/cae12c7)) +* **pickAlgo:** pick the strongest algorithm provided, by default ([58c18f7](https://github.com/zkat/ssri/commit/58c18f7)) +* **strict-mode:** strict SRI support ([3f0b64c](https://github.com/zkat/ssri/commit/3f0b64c)) +* **stringify:** replaced unparse/serialize with stringify ([4acad30](https://github.com/zkat/ssri/commit/4acad30)) +* **verification:** add opts.pickAlgorithm ([f72e658](https://github.com/zkat/ssri/commit/f72e658)) + + +### BREAKING CHANGES + +* **pickAlgo:** ssri will prioritize specific hashes now +* **stringify:** serialize and unparse have been removed. Use ssri.stringify instead. +* **strict-mode:** functions that accepted an optional `sep` argument now expect `opts.sep`. + + + + +# 1.0.0 (2017-03-23) + + +### Features + +* **api:** implemented initial api ([4fbb16b](https://github.com/zkat/ssri/commit/4fbb16b)) + + +### BREAKING CHANGES + +* **api:** Initial API established. diff --git a/deps/npm/node_modules/cacache/node_modules/ssri/LICENSE.md b/deps/npm/node_modules/cacache/node_modules/ssri/LICENSE.md new file mode 100644 index 00000000000000..8d28acf866d932 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/ssri/LICENSE.md @@ -0,0 +1,16 @@ +ISC License + +Copyright (c) npm, Inc. + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE COPYRIGHT HOLDER DISCLAIMS +ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +COPYRIGHT HOLDER 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/cacache/node_modules/ssri/README.md b/deps/npm/node_modules/cacache/node_modules/ssri/README.md new file mode 100644 index 00000000000000..f2fc035da52d72 --- /dev/null +++ b/deps/npm/node_modules/cacache/node_modules/ssri/README.md @@ -0,0 +1,462 @@ +# ssri [![npm version](https://img.shields.io/npm/v/ssri.svg)](https://npm.im/ssri) [![license](https://img.shields.io/npm/l/ssri.svg)](https://npm.im/ssri) [![Travis](https://img.shields.io/travis/zkat/ssri.svg)](https://travis-ci.org/zkat/ssri) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/ssri?svg=true)](https://ci.appveyor.com/project/zkat/ssri) [![Coverage Status](https://coveralls.io/repos/github/zkat/ssri/badge.svg?branch=latest)](https://coveralls.io/github/zkat/ssri?branch=latest) + +[`ssri`](https://github.com/zkat/ssri), short for Standard Subresource +Integrity, is a Node.js utility for parsing, manipulating, serializing, +generating, and verifying [Subresource +Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) hashes. + +## Install + +`$ npm install --save ssri` + +## Table of Contents + +* [Example](#example) +* [Features](#features) +* [Contributing](#contributing) +* [API](#api) + * Parsing & Serializing + * [`parse`](#parse) + * [`stringify`](#stringify) + * [`Integrity#concat`](#integrity-concat) + * [`Integrity#toString`](#integrity-to-string) + * [`Integrity#toJSON`](#integrity-to-json) + * [`Integrity#pickAlgorithm`](#integrity-pick-algorithm) + * [`Integrity#hexDigest`](#integrity-hex-digest) + * Integrity Generation + * [`fromHex`](#from-hex) + * [`fromData`](#from-data) + * [`fromStream`](#from-stream) + * [`create`](#create) + * Integrity Verification + * [`checkData`](#check-data) + * [`checkStream`](#check-stream) + * [`integrityStream`](#integrity-stream) + +### Example + +```javascript +const ssri = require('ssri') + +const integrity = 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' + +// Parsing and serializing +const parsed = ssri.parse(integrity) +ssri.stringify(parsed) // === integrity (works on non-Integrity objects) +parsed.toString() // === integrity + +// Async stream functions +ssri.checkStream(fs.createReadStream('./my-file'), integrity).then(...) +ssri.fromStream(fs.createReadStream('./my-file')).then(sri => { + sri.toString() === integrity +}) +fs.createReadStream('./my-file').pipe(ssri.createCheckerStream(sri)) + +// Sync data functions +ssri.fromData(fs.readFileSync('./my-file')) // === parsed +ssri.checkData(fs.readFileSync('./my-file'), integrity) // => 'sha512' +``` + +### Features + +* Parses and stringifies SRI strings. +* Generates SRI strings from raw data or Streams. +* Strict standard compliance. +* `?foo` metadata option support. +* Multiple entries for the same algorithm. +* Object-based integrity hash manipulation. +* Small footprint: no dependencies, concise implementation. +* Full test coverage. +* Customizable algorithm picker. + +### Contributing + +The ssri team enthusiastically welcomes contributions and project participation! +There's a bunch of things you can do if you want to contribute! The [Contributor +Guide](CONTRIBUTING.md) has all the information you need for everything from +reporting bugs to contributing entire new features. Please don't hesitate to +jump in if you'd like to, or even ask us questions if something isn't clear. + +### API + +#### `> ssri.parse(sri, [opts]) -> Integrity` + +Parses `sri` into an `Integrity` data structure. `sri` can be an integrity +string, an `Hash`-like with `digest` and `algorithm` fields and an optional +`options` field, or an `Integrity`-like object. The resulting object will be an +`Integrity` instance that has this shape: + +```javascript +{ + 'sha1': [{algorithm: 'sha1', digest: 'deadbeef', options: []}], + 'sha512': [ + {algorithm: 'sha512', digest: 'c0ffee', options: []}, + {algorithm: 'sha512', digest: 'bad1dea', options: ['foo']} + ], +} +``` + +If `opts.single` is truthy, a single `Hash` object will be returned. That is, a +single object that looks like `{algorithm, digest, options}`, as opposed to a +larger object with multiple of these. + +If `opts.strict` is truthy, the resulting object will be filtered such that +it strictly follows the Subresource Integrity spec, throwing away any entries +with any invalid components. This also means a restricted set of algorithms +will be used -- the spec limits them to `sha256`, `sha384`, and `sha512`. + +Strict mode is recommended if the integrity strings are intended for use in +browsers, or in other situations where strict adherence to the spec is needed. + +##### Example + +```javascript +ssri.parse('sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo') // -> Integrity object +``` + +#### `> ssri.stringify(sri, [opts]) -> String` + +This function is identical to [`Integrity#toString()`](#integrity-to-string), +except it can be used on _any_ object that [`parse`](#parse) can handle -- that +is, a string, an `Hash`-like, or an `Integrity`-like. + +The `opts.sep` option defines the string to use when joining multiple entries +together. To be spec-compliant, this _must_ be whitespace. The default is a +single space (`' '`). + +If `opts.strict` is true, the integrity string will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +// Useful for cleaning up input SRI strings: +ssri.stringify('\n\rsha512-foo\n\t\tsha384-bar') +// -> 'sha512-foo sha384-bar' + +// Hash-like: only a single entry. +ssri.stringify({ + algorithm: 'sha512', + digest:'9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==', + options: ['foo'] +}) +// -> +// 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' + +// Integrity-like: full multi-entry syntax. Similar to output of `ssri.parse` +ssri.stringify({ + 'sha512': [ + { + algorithm: 'sha512', + digest:'9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==', + options: ['foo'] + } + ] +}) +// -> +// 'sha512-9KhgCRIx/AmzC8xqYJTZRrnO8OW2Pxyl2DIMZSBOr0oDvtEFyht3xpp71j/r/pAe1DM+JI/A+line3jUBgzQ7A==?foo' +``` + +#### `> Integrity#concat(otherIntegrity, [opts]) -> Integrity` + +Concatenates an `Integrity` object with another IntegrityLike, or an integrity +string. + +This is functionally equivalent to concatenating the string format of both +integrity arguments, and calling [`ssri.parse`](#ssri-parse) on the new string. + +If `opts.strict` is true, the new `Integrity` will be created using strict +parsing rules. See [`ssri.parse`](#parse). + +##### Example + +```javascript +// This will combine the integrity checks for two different versions of +// your index.js file so you can use a single integrity string and serve +// either of these to clients, from a single `