diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index f17fabd84056bc..699efb39d17e35 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -1,6 +1,10 @@ name: Build from tarball -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master env: FLAKY_TESTS: dontcare @@ -9,7 +13,7 @@ jobs: build-tarball: env: PYTHON_VERSION: 3.8 - runs-on: macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Python ${{ env.PYTHON_VERSION }} @@ -22,8 +26,8 @@ jobs: run: | export DISTTYPE=nightly export DATESTRING=`date "+%Y-%m-%d"` - export COMMIT=xxxx - ./configure && make tar -j8 + export COMMIT=$(git rev-parse --short=10 "$GITHUB_SHA") + ./configure && make tar -j8 SKIP_XZ=1 mkdir tarballs mv *.tar.gz tarballs - name: Upload tarball artifact @@ -64,78 +68,3 @@ jobs: run: | cd $TAR_DIR make run-ci -j2 V=1 TEST_CI_ARGS="-p dots" - test-tarball-windows: - needs: build-tarball - runs-on: windows-latest - steps: - - name: Set up autocrlf - run: | - git config --global core.autocrlf true - - uses: actions/checkout@v2 - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Environment Information - run: npx envinfo - - name: Download tarball - uses: actions/download-artifact@v1 - with: - name: tarballs - - name: Extract tarball - run: | - 7z x tarballs/*.tar.gz - 7z x *.tar -ttar - - name: Install deps - run: choco install nasm - - name: Build - run: | - $env:DEBUG_HELPER=1 - $tarfile = dir *.tar - cd $tarfile.BaseName - $env:msbuild_args="/binaryLogger:node.binlog" - ./vcbuild.bat x64 release msi - echo "::set-env name=TAR_DIR::$pwd" - - name: Copy out directory to checkout dir - run: Move-Item -Path "$env:TAR_DIR\out" -Destination "$env:GITHUB_WORKSPACE" - - name: "Test JS Suites" - shell: cmd - run: | - set DEBUG_HELPER=1 - ./vcbuild.bat release noprojgen nobuild ignore-flaky test-ci-js - - name: "Test C++ Suites" - shell: cmd - run: | - set DEBUG_HELPER=1 - ./vcbuild.bat release noprojgen nobuild ignore-flaky test-ci-native - test-tarball-macOS: - needs: build-tarball - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v1 - with: - PYTHON_VERSION: ${{ env.PYTHON_VERSION }} - - name: Environment Information - run: npx envinfo - - name: Download tarball - uses: actions/download-artifact@v1 - with: - name: tarballs - - name: Extract tarball - run: | - tar xzf tarballs/*.tar.gz - echo "::set-env name=TAR_DIR::`basename tarballs/*.tar.gz .tar.gz`" - - name: Copy directories needed for testing - run: | - cp -r tools/node_modules $TAR_DIR/tools - cp -r tools/eslint-rules $TAR_DIR/tools - - name: Build - run: | - cd $TAR_DIR - make build-ci -j8 V=1 - - name: Test - run: | - cd $TAR_DIR - make run-ci -j8 V=1 TEST_CI_ARGS="-p dots" diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 8a9dbf90415688..76ab1ec8ced2cf 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -1,6 +1,10 @@ name: build-windows -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master env: PYTHON_VERSION: 3.8 diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 4453db5c751c7f..afab3284879499 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,6 +1,10 @@ name: linters -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master env: PYTHON_VERSION: 3.8 diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml index b23120ae0f1d74..4b4b305e7b25c9 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/misc.yml @@ -1,6 +1,10 @@ name: misc -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master env: NODE_VERSION: 12.x diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index 54d6cae049badb..d2d619f786cb0e 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -2,6 +2,8 @@ name: test-asan on: push: + branches: + - master paths-ignore: - 'doc/**' pull_request: diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index cfe0ca4ab70334..163f5a1fb7aa90 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -1,6 +1,10 @@ name: test-linux -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master env: PYTHON_VERSION: 3.8 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index c78ab45e4b2398..97074c5238659c 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -1,6 +1,10 @@ name: test-macOS -on: [push, pull_request] +on: + pull_request: + push: + branches: + - master env: PYTHON_VERSION: 3.8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 05b09f01324623..c7f796691c38d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,8 @@ release. -14.6.0
+14.7.0
+14.6.0
14.5.0
14.4.0
14.3.0
@@ -40,23 +41,6 @@ release. 14.0.0
-13.12.0
-13.11.0
-13.10.1
-13.10.0
-13.9.0
-13.8.0
-13.7.0
-13.6.0
-13.5.0
-13.4.0
-13.3.0
-13.2.0
-13.1.0
-13.0.1
-13.0.0
- - 12.16.2
12.16.1
12.16.0
diff --git a/GOVERNANCE.md b/GOVERNANCE.md index b54f2e81b14d54..aeb1d9c65e1f11 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -2,16 +2,30 @@ +* [Triagers](#triagers) * [Collaborators](#collaborators) - * [Collaborator Activities](#collaborator-activities) -* [Technical Steering Committee](#technical-steering-committee) - * [TSC Meetings](#tsc-meetings) -* [Collaborator Nominations](#collaborator-nominations) + * [Collaborator activities](#collaborator-activities) +* [Technical steering committee](#technical-steering-committee) + * [TSC meetings](#tsc-meetings) +* [Collaborator nominations](#collaborator-nominations) * [Onboarding](#onboarding) -* [Consensus Seeking Process](#consensus-seeking-process) +* [Consensus seeking process](#consensus-seeking-process) +## Triagers + +Triagers assess newly-opened issues in the nodejs/node and nodejs/help +repositories. There is no GitHub team for triagers at the moment. + +Triagers have: +* ability to label issues +* ability to comment, close, and reopen issues + +See: + +* [A guide for triagers](./doc/guides/contributing/issues.md#triaging-a-bug-report) + ## Collaborators Node.js Core Collaborators maintain the [nodejs/node][] GitHub repository. @@ -41,7 +55,7 @@ See: * [List of Collaborators](./README.md#current-project-team-members) * [A guide for Collaborators](./doc/guides/collaborator-guide.md) -### Collaborator Activities +### Collaborator activities * Helping users and novice contributors * Contributing code and documentation changes that improve the project @@ -70,7 +84,7 @@ The current list of TSC members is in The [TSC Charter][] governs the operations of the TSC. All changes to the Charter need approval by the OpenJS Foundation Board of Directors. -### TSC Meetings +### TSC meetings The TSC meets in a voice conference call. Each year, the TSC elects a chair to run the meetings. The TSC streams its meetings for public viewing on YouTube or @@ -104,7 +118,7 @@ the issue tracker is: and no TSC opposition. * If there is an extended impasse, a TSC member may make a motion for a vote. -## Collaborator Nominations +## Collaborator nominations Existing Collaborators can nominate someone to become a Collaborator. Nominees should have significant and valuable contributions across the Node.js @@ -151,7 +165,7 @@ After the nomination passes, a TSC member onboards the new Collaborator. See [the onboarding guide](./onboarding.md) for details of the onboarding process. -## Consensus Seeking Process +## Consensus seeking process The TSC follows a [Consensus Seeking][] decision-making model per the [TSC Charter][]. diff --git a/Makefile b/Makefile index 4391499052a449..6b3818b01d5dee 100644 --- a/Makefile +++ b/Makefile @@ -298,8 +298,8 @@ v8: jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addon tests and JS tests $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ --skip-tests=$(CI_SKIP_TESTS) \ - $(CI_JS_SUITES) \ - $(CI_NATIVE_SUITES) + $(JS_SUITES) \ + $(NATIVE_SUITES) .PHONY: tooltest tooltest: @@ -492,9 +492,11 @@ test-all-valgrind: test-build test-all-suites: | clear-stalled test-build bench-addons-build doc-only ## Run all test suites. $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) test/* +JS_SUITES ?= default +NATIVE_SUITES ?= addons js-native-api node-api # CI_* variables should be kept synchronized with the ones in vcbuild.bat -CI_NATIVE_SUITES ?= addons js-native-api node-api -CI_JS_SUITES ?= default +CI_NATIVE_SUITES ?= $(NATIVE_SUITES) benchmark +CI_JS_SUITES ?= $(JS_SUITES) ifeq ($(node_use_openssl), false) CI_DOC := doctool else @@ -505,7 +507,7 @@ endif # 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/js-native-api/.buildstamp test/node-api/.buildstamp +test-ci-native: | benchmark/napi/.buildstamp test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) $(CI_NATIVE_SUITES) @@ -527,7 +529,7 @@ test-ci-js: | clear-stalled .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-js-native-api-tests build-node-api-tests doc-only +test-ci: | clear-stalled bench-addons-build build-addons build-js-native-api-tests build-node-api-tests doc-only out/Release/cctest --gtest_output=xml:out/junit/cctest.xml $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=$(BUILDTYPE_LOWER) --flaky-tests=$(FLAKY_TESTS) \ @@ -654,8 +656,8 @@ test-with-async-hooks: $(MAKE) build-node-api-tests $(MAKE) cctest NODE_TEST_WITH_ASYNC_HOOKS=1 $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) \ - $(CI_JS_SUITES) \ - $(CI_NATIVE_SUITES) + $(JS_SUITES) \ + $(NATIVE_SUITES) .PHONY: test-v8 @@ -1034,7 +1036,7 @@ pkg-upload: pkg scp -p $(TARNAME).pkg $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).pkg ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME).pkg.done" -$(TARBALL): release-only $(NODE_EXE) doc +$(TARBALL): release-only doc-only git checkout-index -a -f --prefix=$(TARNAME)/ mkdir -p $(TARNAME)/doc/api cp doc/node.1 $(TARNAME)/doc/node.1 diff --git a/README.md b/README.md index 85211650f71096..84ab9cd5862138 100644 --- a/README.md +++ b/README.md @@ -247,6 +247,8 @@ For information about the governance of the Node.js project, see **Anto Aravinth** <anto.aravinth.cse@gmail.com> (he/him) * [apapirovski](https://github.com/apapirovski) - **Anatoli Papirovski** <apapirovski@mac.com> (he/him) +* [AshCripps](https://github.com/AshCripps) - +**Ash Cripps** <ashley.cripps@ibm.com> * [bcoe](https://github.com/bcoe) - **Ben Coe** <bencoe@gmail.com> (he/him) * [bengl](https://github.com/bengl) - @@ -311,6 +313,8 @@ For information about the governance of the Node.js project, see **Gireesh Punathil** <gpunathi@in.ibm.com> (he/him) * [guybedford](https://github.com/guybedford) - **Guy Bedford** <guybedford@gmail.com> (he/him) +* [HarshithaKP](https://github.com/HarshithaKP) - +**Harshitha K P** <harshitha014@gmail.com> (she/her) * [hashseed](https://github.com/hashseed) - **Yang Guo** <yangguo@chromium.org> (he/him) * [himself65](https://github.com/himself65) - @@ -373,6 +377,8 @@ For information about the governance of the Node.js project, see **Stephen Belanger** <admin@stephenbelanger.com> (he/him) * [refack](https://github.com/refack) - **Refael Ackermann (רפאל פלחי)** <refack@gmail.com> (he/him/הוא/אתה) +* [rexagod](https://github.com/rexagod) - +**Pranshu Srivastava** <rexagod@gmail.com> (he/him) * [richardlau](https://github.com/richardlau) - **Richard Lau** <riclau@uk.ibm.com> * [ronag](https://github.com/ronag) - @@ -407,8 +413,6 @@ For information about the governance of the Node.js project, see **Stewart X Addison** <sxa@uk.ibm.com> * [targos](https://github.com/targos) - **Michaël Zasso** <targos@protonmail.com> (he/him) -* [thefourtheye](https://github.com/thefourtheye) - -**Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> (he/him) * [TimothyGu](https://github.com/TimothyGu) - **Tiancheng "Timothy" Gu** <timothygu99@gmail.com> (he/him) * [tniessen](https://github.com/tniessen) - @@ -540,6 +544,8 @@ For information about the governance of the Node.js project, see **Stefan Budeanu** <stefan@budeanu.com> * [tellnes](https://github.com/tellnes) - **Christian Tellnes** <christian@tellnes.no> +* [thefourtheye](https://github.com/thefourtheye) - +**Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> (he/him) * [thlorenz](https://github.com/thlorenz) - **Thorsten Lorenz** <thlorenz@gmx.de> * [trevnorris](https://github.com/trevnorris) - @@ -571,6 +577,8 @@ Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): `8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600` * **Myles Borins** <myles.borins@gmail.com> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8` +* **Richard Lau** <riclau@uk.ibm.com> +`C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C` * **Rod Vagg** <rod@vagg.org> `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` * **Ruben Bridgewater** <ruben@bridgewater.de> @@ -586,6 +594,7 @@ gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434 gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 gpg --keyserver pool.sks-keyservers.net --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 +gpg --keyserver pool.sks-keyservers.net --recv-keys C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D gpg --keyserver pool.sks-keyservers.net --recv-keys A48C2BEE680E841632CD4E44F07496B3EB3C1762 gpg --keyserver pool.sks-keyservers.net --recv-keys B9E2F5981AA6E0CD28160D9FF13993A75599653C diff --git a/benchmark/async_hooks/promises.js b/benchmark/async_hooks/promises.js index 5632a6901d611b..9927ec0dc504e9 100644 --- a/benchmark/async_hooks/promises.js +++ b/benchmark/async_hooks/promises.js @@ -19,6 +19,11 @@ const tests = { promiseResolve() {}, destroy() {} }).enable(); + }, + enabledWithInitOnly() { + hook = createHook({ + init() {} + }).enable(); } }; @@ -27,6 +32,7 @@ const bench = common.createBenchmark(main, { asyncHooks: [ 'enabled', 'enabledWithDestroy', + 'enabledWithInitOnly', 'disabled', ] }); diff --git a/benchmark/napi/ref/index.js b/benchmark/napi/ref/index.js index 3a5e1988275eaa..a8642a54b21990 100644 --- a/benchmark/napi/ref/index.js +++ b/benchmark/napi/ref/index.js @@ -10,8 +10,10 @@ function callNewWeak() { function main({ n }) { addon.count = 0; bench.start(); - while (addon.count < n) { - callNewWeak(); - } - bench.end(n); + new Promise((resolve) => { + (function oneIteration() { + callNewWeak(); + setImmediate(() => ((addon.count < n) ? oneIteration() : resolve())); + })(); + }).then(() => bench.end(n)); } diff --git a/benchmark/worker/messageport.js b/benchmark/worker/messageport.js index 8e2ddae73ff3ab..2f0d6f0621e8c8 100644 --- a/benchmark/worker/messageport.js +++ b/benchmark/worker/messageport.js @@ -4,6 +4,7 @@ const common = require('../common.js'); const { MessageChannel } = require('worker_threads'); const bench = common.createBenchmark(main, { payload: ['string', 'object'], + style: ['eventtarget', 'eventemitter'], n: [1e6] }); @@ -25,14 +26,26 @@ function main(conf) { const { port1, port2 } = new MessageChannel(); let messages = 0; - port2.onmessage = () => { + function listener() { if (messages++ === n) { bench.end(n); port1.close(); } else { write(); } - }; + } + + switch (conf.style) { + case 'eventtarget': + port2.onmessage = listener; + break; + case 'eventemitter': + port2.on('message', listener); + break; + default: + throw new Error('Unsupported listener type'); + } + bench.start(); write(); diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 313dba9e161f89..427166a068bf50 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -699,3 +699,6 @@ Peter Fich Maxwell Gerber Sean Poulter vanishcode +Jean-Charles Sisk +Martin Packman +Danielle Adams diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 85230c8e185636..f8f356d46cf026 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,23 @@ +## 6.14.7 (2020-07-21) + +### BUG FIXES +* [`de5108836`](https://github.com/npm/cli/commit/de5108836189bddf28d4d3542f9bd5869cc5c2e9) [#784](https://github.com/npm/cli/pull/784) npm explore spawn shell correctly ([@jasisk](https://github.com/jasisk)) +* [`36e6c01d3`](https://github.com/npm/cli/commit/36e6c01d334c4db75018bc6a4a0bef726fd41ce4) git tag handling regression on shrinkwrap ([@claudiahdz](https://github.com/claudiahdz)) +* [`1961c9369`](https://github.com/npm/cli/commit/1961c9369c92bf8fe530cecba9834ca3c7f5567c) [#288](https://github.com/npm/cli/pull/288) Fix package id in shrinkwrap lifecycle step output ([@bz2](https://github.com/bz2)) +* [`87888892a`](https://github.com/npm/cli/commit/87888892a1282cc3edae968c3ae4ec279189271c) [#1009](https://github.com/npm/cli/pull/1009) gracefully handle error during npm install ([@danielleadams](https://github.com/danielleadams)) +* [`6fe2bdc25`](https://github.com/npm/cli/commit/6fe2bdc25e7961956e5c0067fa4db54ff1bd0dbd) [#1547](https://github.com/npm/cli/pull/1547) npm ls --parseable --long output ([@ruyadorno](https://github.com/ruyadorno)) + +### DEPENDENCIES +* [`2d78481c7`](https://github.com/npm/cli/commit/2d78481c7ec178e628ce23df940f73a05d5c6367) update mkdirp on tacks ([@claudiahdz](https://github.com/claudiahdz)) +* [`4e129d105`](https://github.com/npm/cli/commit/4e129d105eba3b12d474caa6e5ca216a98deb75a) uninstall npm-registry-couchapp ([@claudiahdz](https://github.com/claudiahdz)) +* [`8e1869e27`](https://github.com/npm/cli/commit/8e1869e278d1dd37ddefd6b4e961d1bb17fc9d09) update marked dev dep ([@claudiahdz](https://github.com/claudiahdz)) +* [`6a6151f37`](https://github.com/npm/cli/commit/6a6151f377063c6aca852c859c01910edd235ec6) `libnpx@10.2.4` ([@claudiahdz](https://github.com/claudiahdz)) +* [`dc21422eb`](https://github.com/npm/cli/commit/dc21422eb1ca1a4a19f160fad0e924566e08c496) `bin-links@1.1.8` ([@claudiahdz](https://github.com/claudiahdz)) +* [`d341f88ce`](https://github.com/npm/cli/commit/d341f88ce6feb3df1dcb37f34910fcc6c1db85f2) `gentle-fs@2.3.1` ([@claudiahdz](https://github.com/claudiahdz)) +* [`3e168d49b`](https://github.com/npm/cli/commit/3e168d49b41574809cae2ad013776a00d3f20ff4) `libcipm@4.0.8` ([@claudiahdz](https://github.com/claudiahdz)) +* [`6ae942a51`](https://github.com/npm/cli/commit/6ae942a510520b7dff11b5b78eebeff1706e38af) `npm-audit-report@1.3.3` ([@claudiahdz](https://github.com/claudiahdz)) +* [`6a35e3dee`](https://github.com/npm/cli/commit/6a35e3deec275bf2ae76603acd424a0640458047) `npm-lifecycle@3.1.5` ([@claudiahdz](https://github.com/claudiahdz)) + ## 6.14.6 (2020-07-07) ### BUG FIXES diff --git a/deps/npm/CONTRIBUTING.md b/deps/npm/CONTRIBUTING.md index c08bd090cb64b4..3e3512ffeaec05 100644 --- a/deps/npm/CONTRIBUTING.md +++ b/deps/npm/CONTRIBUTING.md @@ -123,7 +123,7 @@ We often want to know if the bug we've fixed for the feature we've added has any 1. Make a pull-request against this repository 2. Add the following comment to the pull-request: "`test this please ✅`" -This will trigger the [benmark suite](https://github.com/npm/benchmarks) to run against your pull-request, and when it's finished running it will post a comment on your pull-request just like bellow. You'll be able to see the results from the suite inline in your pull-request. +This will trigger the [benchmark suite](https://github.com/npm/benchmarks) to run against your pull-request, and when it's finished running it will post a comment on your pull-request just like below. You'll be able to see the results from the suite inline in your pull-request. > You'll notice that the bot-user will also add a 🚀 reaction to your comment to let you know that it's sent the request to start the benchmark suite. @@ -186,7 +186,6 @@ You'll need a few things installed in order to update and test the CLI project d > Package vendoring is commonly referred to as the case where dependent packages are stored in the same place as your project. That usually means you dependencies are checked into your source management system, such as Git. -The CLI project vendors it's dependencies in the `node_modules/` folder. Meaning all the dependencies that the CLI project uses are contained withing the project itself. This is represented by the `bundledDependencies` section in the root level `package.json` file. The main reason for this is because the `npm` CLI project is distributed with the NodeJS runtime and needs to work out of the box, which means all dependencies need to be available after the runtime is installed. +The CLI project vendors its dependencies in the `node_modules/` folder. Meaning all the dependencies that the CLI project uses are contained within the project itself. This is represented by the `bundledDependencies` section in the root level `package.json` file. The main reason for this is because the `npm` CLI project is distributed with the NodeJS runtime and needs to work out of the box, which means all dependencies need to be available after the runtime is installed. There are a couple scripts created to help manage this process in the `scripts/` folder. - diff --git a/deps/npm/docs/public/cli-commands/npm-access/index.html b/deps/npm/docs/public/cli-commands/npm-access/index.html index 2088d14aa48344..9ad76a3e9f5e91 100644 --- a/deps/npm/docs/public/cli-commands/npm-access/index.html +++ b/deps/npm/docs/public/cli-commands/npm-access/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm access

+

npm access

Set access level on published packages

Synopsis

npm access public [<package>]
@@ -148,4 +148,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-adduser/index.html b/deps/npm/docs/public/cli-commands/npm-adduser/index.html index 9a510fbdc9e0a6..8ed326ce683cb5 100644 --- a/deps/npm/docs/public/cli-commands/npm-adduser/index.html +++ b/deps/npm/docs/public/cli-commands/npm-adduser/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

+

section: cli-commands title: npm-adduser description: Set access level on published packages

@@ -143,4 +143,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-audit/index.html b/deps/npm/docs/public/cli-commands/npm-audit/index.html index cc6e8b20ab54f0..8825351c97229c 100644 --- a/deps/npm/docs/public/cli-commands/npm-audit/index.html +++ b/deps/npm/docs/public/cli-commands/npm-audit/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm audit

+

npm audit

Run a security audit

Synopsis

npm audit [--json|--parseable|--audit-level=(low|moderate|high|critical)]
@@ -165,4 +165,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-bin/index.html b/deps/npm/docs/public/cli-commands/npm-bin/index.html index b41e26a87282e9..a5ae1a0759c973 100644 --- a/deps/npm/docs/public/cli-commands/npm-bin/index.html +++ b/deps/npm/docs/public/cli-commands/npm-bin/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm bin

+

npm bin

Display npm bin folder

Synopsis

npm bin [-g|--global]
@@ -94,4 +94,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-bugs/index.html b/deps/npm/docs/public/cli-commands/npm-bugs/index.html index d8746297f7d09c..3c32373c87467b 100644 --- a/deps/npm/docs/public/cli-commands/npm-bugs/index.html +++ b/deps/npm/docs/public/cli-commands/npm-bugs/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm bugs

+

npm bugs

Bugs for a package in a web browser maybe

Synopsis

npm bugs [<pkgname>]
@@ -114,4 +114,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-build/index.html b/deps/npm/docs/public/cli-commands/npm-build/index.html index 88b6dc62eb11e3..c79bdfe8387e5b 100644 --- a/deps/npm/docs/public/cli-commands/npm-build/index.html +++ b/deps/npm/docs/public/cli-commands/npm-build/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm build

+

npm build

Build a package

Synopsis

npm build [<package-folder>]
@@ -100,4 +100,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-bundle/index.html b/deps/npm/docs/public/cli-commands/npm-bundle/index.html index ec7ccad93575e4..e66fa96a322543 100644 --- a/deps/npm/docs/public/cli-commands/npm-bundle/index.html +++ b/deps/npm/docs/public/cli-commands/npm-bundle/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm bundle

+

npm bundle

REMOVED

Description

The npm bundle command has been removed in 1.0, for the simple reason @@ -91,4 +91,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-cache/index.html b/deps/npm/docs/public/cli-commands/npm-cache/index.html index f12d72477cecc9..d3c54c4c63ff52 100644 --- a/deps/npm/docs/public/cli-commands/npm-cache/index.html +++ b/deps/npm/docs/public/cli-commands/npm-cache/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm cache

+

npm cache

Manipulates packages cache

Synopsis

npm cache add <tarball file>
@@ -145,4 +145,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-ci/index.html b/deps/npm/docs/public/cli-commands/npm-ci/index.html index 73494a2414237a..2714900c68c9f2 100644 --- a/deps/npm/docs/public/cli-commands/npm-ci/index.html +++ b/deps/npm/docs/public/cli-commands/npm-ci/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm ci

+

npm ci

Install a project with a clean slate

Synopsis

npm ci
@@ -122,4 +122,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-completion/index.html b/deps/npm/docs/public/cli-commands/npm-completion/index.html index 44def5512c9609..aa609533076172 100644 --- a/deps/npm/docs/public/cli-commands/npm-completion/index.html +++ b/deps/npm/docs/public/cli-commands/npm-completion/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm completion

+

npm completion

Tab Completion for npm

Synopsis

source <(npm completion)
@@ -104,4 +104,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-config/index.html b/deps/npm/docs/public/cli-commands/npm-config/index.html index 0e41b818e61205..3845bc0b44697d 100644 --- a/deps/npm/docs/public/cli-commands/npm-config/index.html +++ b/deps/npm/docs/public/cli-commands/npm-config/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm config

+

npm config

Manage the npm configuration files

Synopsis

npm config set <key> <value> [-g|--global]
@@ -128,4 +128,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-dedupe/index.html b/deps/npm/docs/public/cli-commands/npm-dedupe/index.html index 98e3e7b24d7ac8..eb375342f73311 100644 --- a/deps/npm/docs/public/cli-commands/npm-dedupe/index.html +++ b/deps/npm/docs/public/cli-commands/npm-dedupe/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm dedupe

+

npm dedupe

Reduce duplication

Synopsis

npm dedupe
@@ -121,4 +121,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-deprecate/index.html b/deps/npm/docs/public/cli-commands/npm-deprecate/index.html index 7e7f8eebb795b6..d33cee56047b30 100644 --- a/deps/npm/docs/public/cli-commands/npm-deprecate/index.html +++ b/deps/npm/docs/public/cli-commands/npm-deprecate/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm deprecate

+

npm deprecate

Deprecate a version of a package

Synopsis

npm deprecate <pkg>[@<version>] <message>
@@ -100,4 +100,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html b/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html index 99be58532a39a7..f1bee221ba743f 100644 --- a/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html +++ b/deps/npm/docs/public/cli-commands/npm-dist-tag/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

+

section: cli-commands title: npm-dist-tag description: Modify package distribution tags

@@ -149,4 +149,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-docs/index.html b/deps/npm/docs/public/cli-commands/npm-docs/index.html index a6b000989321c5..36363aca0aa131 100644 --- a/deps/npm/docs/public/cli-commands/npm-docs/index.html +++ b/deps/npm/docs/public/cli-commands/npm-docs/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm docs

+

npm docs

Docs for a package in a web browser maybe

Synopsis

npm docs [<pkgname> [<pkgname> ...]]
@@ -115,4 +115,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-doctor/index.html b/deps/npm/docs/public/cli-commands/npm-doctor/index.html index 9dbe85beb39fc6..a8158fb8629899 100644 --- a/deps/npm/docs/public/cli-commands/npm-doctor/index.html +++ b/deps/npm/docs/public/cli-commands/npm-doctor/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm doctor

+

npm doctor

Check your environments

Synopsis

npm doctor
@@ -163,4 +163,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-edit/index.html b/deps/npm/docs/public/cli-commands/npm-edit/index.html index 3611c6797dc19f..278352607aa08a 100644 --- a/deps/npm/docs/public/cli-commands/npm-edit/index.html +++ b/deps/npm/docs/public/cli-commands/npm-edit/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm edit

+

npm edit

Edit an installed package

Synopsis

npm edit <pkg>[/<subpkg>...]
@@ -110,4 +110,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-explore/index.html b/deps/npm/docs/public/cli-commands/npm-explore/index.html index 0af32ce1958ac3..bf53625afde152 100644 --- a/deps/npm/docs/public/cli-commands/npm-explore/index.html +++ b/deps/npm/docs/public/cli-commands/npm-explore/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

+

section: cli-commands title: npm-explore description: Browse an installed package

@@ -114,4 +114,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-fund/index.html b/deps/npm/docs/public/cli-commands/npm-fund/index.html index 9ec2766e846ae3..8562c1c8911ca7 100644 --- a/deps/npm/docs/public/cli-commands/npm-fund/index.html +++ b/deps/npm/docs/public/cli-commands/npm-fund/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm fund

+

npm fund

Retrieve funding information

Synopsis

    npm fund [<pkg>]
@@ -128,4 +128,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-help-search/index.html b/deps/npm/docs/public/cli-commands/npm-help-search/index.html index 1fe08bdb605b8f..3ab934e6396d52 100644 --- a/deps/npm/docs/public/cli-commands/npm-help-search/index.html +++ b/deps/npm/docs/public/cli-commands/npm-help-search/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm help-search

+

npm help-search

Search npm help documentation

Synopsis

npm help-search <text>
@@ -105,4 +105,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-help/index.html b/deps/npm/docs/public/cli-commands/npm-help/index.html index 1d3e10e9dcaf08..99cde2a28efada 100644 --- a/deps/npm/docs/public/cli-commands/npm-help/index.html +++ b/deps/npm/docs/public/cli-commands/npm-help/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm help

+

npm help

Get help on npm

Synopsis

npm help <term> [<terms..>]
@@ -107,4 +107,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-hook/index.html b/deps/npm/docs/public/cli-commands/npm-hook/index.html index b132e67eaa914a..6620807093be85 100644 --- a/deps/npm/docs/public/cli-commands/npm-hook/index.html +++ b/deps/npm/docs/public/cli-commands/npm-hook/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm hook

+

npm hook

Manage registry hooks

Synopsis

npm hook ls [pkg]
@@ -119,4 +119,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-init/index.html b/deps/npm/docs/public/cli-commands/npm-init/index.html index a17f9bdac61075..9045b6726eea3d 100644 --- a/deps/npm/docs/public/cli-commands/npm-init/index.html +++ b/deps/npm/docs/public/cli-commands/npm-init/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm init

+

npm init

create a package.json file

Synopsis

npm init [--force|-f|--yes|-y|--scope]
@@ -126,4 +126,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html b/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html index 510d59aeb6f986..fecb8986a3e519 100644 --- a/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html +++ b/deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm install-ci-test

+

npm install-ci-test

Install a project with a clean slate and run tests

Synopsis

npm install-ci-test
@@ -93,4 +93,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-install-test/index.html b/deps/npm/docs/public/cli-commands/npm-install-test/index.html index 3dc480e0f9a58f..f9712faea156c9 100644 --- a/deps/npm/docs/public/cli-commands/npm-install-test/index.html +++ b/deps/npm/docs/public/cli-commands/npm-install-test/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm install-test

+

npm install-test

Install package(s) and run tests

Synopsis

npm install-test (with no args, in package dir)
@@ -102,4 +102,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-install/index.html b/deps/npm/docs/public/cli-commands/npm-install/index.html index 503b02e58bbd9d..75e44db559ae6b 100644 --- a/deps/npm/docs/public/cli-commands/npm-install/index.html +++ b/deps/npm/docs/public/cli-commands/npm-install/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm install

+

npm install

Install a package

Synopsis

npm install (with no args, in package dir)
@@ -468,4 +468,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-link/index.html b/deps/npm/docs/public/cli-commands/npm-link/index.html index 407d16777f9e8e..4755b712232fcb 100644 --- a/deps/npm/docs/public/cli-commands/npm-link/index.html +++ b/deps/npm/docs/public/cli-commands/npm-link/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm link

+

npm link

Synopsis

npm link (in package dir)
@@ -134,4 +134,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-logout/index.html b/deps/npm/docs/public/cli-commands/npm-logout/index.html index 0c91eae6ce1b13..488d5f8e417618 100644 --- a/deps/npm/docs/public/cli-commands/npm-logout/index.html +++ b/deps/npm/docs/public/cli-commands/npm-logout/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm logout

+

npm logout

Log out of the registry

Synopsis

npm logout [--registry=<url>] [--scope=<@scope>]
@@ -109,4 +109,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-ls/index.html b/deps/npm/docs/public/cli-commands/npm-ls/index.html index 55905a20608257..1ea19ccbfe1af1 100644 --- a/deps/npm/docs/public/cli-commands/npm-ls/index.html +++ b/deps/npm/docs/public/cli-commands/npm-ls/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm ls

+
\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-org/index.html b/deps/npm/docs/public/cli-commands/npm-org/index.html index c0d4e3c73f05ab..6c9bad4851dd6a 100644 --- a/deps/npm/docs/public/cli-commands/npm-org/index.html +++ b/deps/npm/docs/public/cli-commands/npm-org/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm org

+

npm org

Manage orgs

Synopsis

npm org set <orgname> <username> [developer | admin | owner]
@@ -107,4 +107,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-outdated/index.html b/deps/npm/docs/public/cli-commands/npm-outdated/index.html index 1ee0e6f43e96d0..8d00c8be54f71e 100644 --- a/deps/npm/docs/public/cli-commands/npm-outdated/index.html +++ b/deps/npm/docs/public/cli-commands/npm-outdated/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm outdated

+

npm outdated

Check for outdated packages

Synopsis

npm outdated [[<@scope>/]<pkg> ...]
@@ -178,4 +178,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-owner/index.html b/deps/npm/docs/public/cli-commands/npm-owner/index.html index e642382b8aa700..1c12f4f6196402 100644 --- a/deps/npm/docs/public/cli-commands/npm-owner/index.html +++ b/deps/npm/docs/public/cli-commands/npm-owner/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm owner

+

npm owner

Manage package owners

Synopsis

npm owner add <user> [<@scope>/]<pkg>
@@ -114,4 +114,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-pack/index.html b/deps/npm/docs/public/cli-commands/npm-pack/index.html index fb38a2f659c21e..7e71c5b22bbf31 100644 --- a/deps/npm/docs/public/cli-commands/npm-pack/index.html +++ b/deps/npm/docs/public/cli-commands/npm-pack/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm pack

+

npm pack

Create a tarball from a package

Synopsis

npm pack [[<@scope>/]<pkg>...] [--dry-run]
@@ -102,4 +102,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-ping/index.html b/deps/npm/docs/public/cli-commands/npm-ping/index.html index 6550262d06af95..0eae22ffe01083 100644 --- a/deps/npm/docs/public/cli-commands/npm-ping/index.html +++ b/deps/npm/docs/public/cli-commands/npm-ping/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm ping

+

npm ping

Ping npm registry

Synopsis

npm ping [--registry <registry>]
@@ -95,4 +95,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-prefix/index.html b/deps/npm/docs/public/cli-commands/npm-prefix/index.html index 1feda5ab9e2e8c..eceda1227c0e7c 100644 --- a/deps/npm/docs/public/cli-commands/npm-prefix/index.html +++ b/deps/npm/docs/public/cli-commands/npm-prefix/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm prefix

+

npm prefix

Display prefix

Synopsis

npm prefix [-g]
@@ -98,4 +98,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-profile/index.html b/deps/npm/docs/public/cli-commands/npm-profile/index.html index 9f7eea56ed3327..194196c9992a9e 100644 --- a/deps/npm/docs/public/cli-commands/npm-profile/index.html +++ b/deps/npm/docs/public/cli-commands/npm-profile/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm profile

+

npm profile

Change settings on your registry profile

Synopsis

npm profile get [--json|--parseable] [<property>]
@@ -148,4 +148,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-prune/index.html b/deps/npm/docs/public/cli-commands/npm-prune/index.html index 5d6d3657ac150c..2a53f28756d702 100644 --- a/deps/npm/docs/public/cli-commands/npm-prune/index.html +++ b/deps/npm/docs/public/cli-commands/npm-prune/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm prune

+

npm prune

Remove extraneous packages

Synopsis

npm prune [[<@scope>/]<pkg>...] [--production] [--dry-run] [--json]
@@ -108,4 +108,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-publish/index.html b/deps/npm/docs/public/cli-commands/npm-publish/index.html index 2d6539b00266e4..0b0b2e792e9574 100644 --- a/deps/npm/docs/public/cli-commands/npm-publish/index.html +++ b/deps/npm/docs/public/cli-commands/npm-publish/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm publish

+

npm publish

Publish a package

Synopsis

npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode] [--dry-run]
@@ -140,4 +140,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-rebuild/index.html b/deps/npm/docs/public/cli-commands/npm-rebuild/index.html index 21ce5153e2dea7..ed449954e381af 100644 --- a/deps/npm/docs/public/cli-commands/npm-rebuild/index.html +++ b/deps/npm/docs/public/cli-commands/npm-rebuild/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm rebuild

+

npm rebuild

Rebuild a package

Synopsis

npm rebuild [[<@scope>/<name>]...]
@@ -93,4 +93,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-repo/index.html b/deps/npm/docs/public/cli-commands/npm-repo/index.html index 2b1ab88a192642..6df62a1a0978f0 100644 --- a/deps/npm/docs/public/cli-commands/npm-repo/index.html +++ b/deps/npm/docs/public/cli-commands/npm-repo/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm repo

+

npm repo

Open package repository page in the browser

Synopsis

npm repo [<pkg>]
@@ -101,4 +101,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-restart/index.html b/deps/npm/docs/public/cli-commands/npm-restart/index.html index 786125b6a9739c..a09224c6181e31 100644 --- a/deps/npm/docs/public/cli-commands/npm-restart/index.html +++ b/deps/npm/docs/public/cli-commands/npm-restart/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm restart

+

npm restart

Restart a package

Synopsis

npm restart [-- <args>]
@@ -113,4 +113,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-root/index.html b/deps/npm/docs/public/cli-commands/npm-root/index.html index f89cdc22492b01..d951e9e64b744d 100644 --- a/deps/npm/docs/public/cli-commands/npm-root/index.html +++ b/deps/npm/docs/public/cli-commands/npm-root/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm root

+

npm root

Display npm root

Synopsis

npm root [-g]
@@ -94,4 +94,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-run-script/index.html b/deps/npm/docs/public/cli-commands/npm-run-script/index.html index 4f41911b29bb6f..445bbe58b270aa 100644 --- a/deps/npm/docs/public/cli-commands/npm-run-script/index.html +++ b/deps/npm/docs/public/cli-commands/npm-run-script/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm run-script

+

npm run-script

Run arbitrary package scripts

Synopsis

npm run-script <command> [--silent] [-- <args>...]
@@ -143,4 +143,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-search/index.html b/deps/npm/docs/public/cli-commands/npm-search/index.html index 29e55995fb9668..8269b12203d727 100644 --- a/deps/npm/docs/public/cli-commands/npm-search/index.html +++ b/deps/npm/docs/public/cli-commands/npm-search/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm search

+

npm search

Search for packages

Synopsis

npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
@@ -168,4 +168,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html b/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html index 036d9202fffc5d..52fd8d568d0c99 100644 --- a/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html +++ b/deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm shrinkwrap

+

npm shrinkwrap

Lock down dependency versions for publication

Synopsis

npm shrinkwrap
@@ -101,4 +101,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-star/index.html b/deps/npm/docs/public/cli-commands/npm-star/index.html index ce866055c27fe8..53add0203fc467 100644 --- a/deps/npm/docs/public/cli-commands/npm-star/index.html +++ b/deps/npm/docs/public/cli-commands/npm-star/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm star

+

npm star

Mark your favorite packages

Synopsis

npm star [<pkg>...]
@@ -96,4 +96,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-stars/index.html b/deps/npm/docs/public/cli-commands/npm-stars/index.html index e4b8d1b4002195..e87ca475a895d4 100644 --- a/deps/npm/docs/public/cli-commands/npm-stars/index.html +++ b/deps/npm/docs/public/cli-commands/npm-stars/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm stars

+

npm stars

View packages marked as favorites

Synopsis

npm stars [<user>]
@@ -96,4 +96,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-start/index.html b/deps/npm/docs/public/cli-commands/npm-start/index.html index d6c4fde8bf4522..0d2c010f195770 100644 --- a/deps/npm/docs/public/cli-commands/npm-start/index.html +++ b/deps/npm/docs/public/cli-commands/npm-start/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm start

+

npm start

Start a package

Synopsis

npm start [-- <args>]
@@ -98,4 +98,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-stop/index.html b/deps/npm/docs/public/cli-commands/npm-stop/index.html index b32ea8f0b4f57b..6f28d221cc5de4 100644 --- a/deps/npm/docs/public/cli-commands/npm-stop/index.html +++ b/deps/npm/docs/public/cli-commands/npm-stop/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm stop

+

npm stop

Stop a package

Synopsis

npm stop [-- <args>]
@@ -94,4 +94,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-team/index.html b/deps/npm/docs/public/cli-commands/npm-team/index.html index f00e13b980a107..b368026ba5a7b9 100644 --- a/deps/npm/docs/public/cli-commands/npm-team/index.html +++ b/deps/npm/docs/public/cli-commands/npm-team/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm team

+

npm team

Manage organization teams and team memberships

Synopsis

npm team create <scope:team>
@@ -125,4 +125,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-test/index.html b/deps/npm/docs/public/cli-commands/npm-test/index.html index 25fd1f5c52c9b4..d02df67c554ae2 100644 --- a/deps/npm/docs/public/cli-commands/npm-test/index.html +++ b/deps/npm/docs/public/cli-commands/npm-test/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm test

+

npm test

Test a package

Synopsis

npm test [-- <args>]
@@ -96,4 +96,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-token/index.html b/deps/npm/docs/public/cli-commands/npm-token/index.html index 19debc1b6eaff3..e460a9387a5062 100644 --- a/deps/npm/docs/public/cli-commands/npm-token/index.html +++ b/deps/npm/docs/public/cli-commands/npm-token/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm token

+

npm token

Manage your authentication tokens

Synopsis

  npm token list [--json|--parseable]
@@ -133,4 +133,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-uninstall/index.html b/deps/npm/docs/public/cli-commands/npm-uninstall/index.html index dcd2c090a839f3..b9421f84640148 100644 --- a/deps/npm/docs/public/cli-commands/npm-uninstall/index.html +++ b/deps/npm/docs/public/cli-commands/npm-uninstall/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm uninstall

+

npm uninstall

Remove a package

Synopsis

npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]
@@ -118,4 +118,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-unpublish/index.html b/deps/npm/docs/public/cli-commands/npm-unpublish/index.html index 182342856bdc63..ca8a3dad1f8053 100644 --- a/deps/npm/docs/public/cli-commands/npm-unpublish/index.html +++ b/deps/npm/docs/public/cli-commands/npm-unpublish/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm unpublish

+

npm unpublish

Remove a package from the registry

Synopsis

Unpublishing a single version of a package

@@ -106,4 +106,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-update/index.html b/deps/npm/docs/public/cli-commands/npm-update/index.html index 7a4fc2c1eee844..f5ad2b56ca3a31 100644 --- a/deps/npm/docs/public/cli-commands/npm-update/index.html +++ b/deps/npm/docs/public/cli-commands/npm-update/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm update

+

npm update

Update a package

Synopsis

npm update [-g] [<pkg>...]
@@ -167,4 +167,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-version/index.html b/deps/npm/docs/public/cli-commands/npm-version/index.html index 2acdb5c565c579..6037a8b4c625b5 100644 --- a/deps/npm/docs/public/cli-commands/npm-version/index.html +++ b/deps/npm/docs/public/cli-commands/npm-version/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm version

+

npm version

Bump a package version

Synopsis

npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
@@ -180,4 +180,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-view/index.html b/deps/npm/docs/public/cli-commands/npm-view/index.html index 8fcf6998ac5131..0421f58c60312d 100644 --- a/deps/npm/docs/public/cli-commands/npm-view/index.html +++ b/deps/npm/docs/public/cli-commands/npm-view/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm view

+

npm view

View registry info

Synopsis

npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
@@ -145,4 +145,4 @@ 

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm-whoami/index.html b/deps/npm/docs/public/cli-commands/npm-whoami/index.html index 20af217b049175..41835b3cfb8c3e 100644 --- a/deps/npm/docs/public/cli-commands/npm-whoami/index.html +++ b/deps/npm/docs/public/cli-commands/npm-whoami/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm whoami

+

npm whoami

Display npm username

Synopsis

npm whoami [--registry <registry>]
@@ -92,4 +92,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/cli-commands/npm/index.html b/deps/npm/docs/public/cli-commands/npm/index.html index 1dd1fd8f503345..eb9061570b0382 100644 --- a/deps/npm/docs/public/cli-commands/npm/index.html +++ b/deps/npm/docs/public/cli-commands/npm/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm

+

npm

javascript package manager

Synopsis

npm <command> [args]

Version

-

6.14.6

+

6.14.7

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 @@ -211,4 +211,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/folders/index.html b/deps/npm/docs/public/configuring-npm/folders/index.html index 20597ce2934420..66bed102877b3a 100644 --- a/deps/npm/docs/public/configuring-npm/folders/index.html +++ b/deps/npm/docs/public/configuring-npm/folders/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

folders

+

folders

Folder Structures Used by npm

Description

npm puts various things on your computer. That's its job.

@@ -240,4 +240,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/install/index.html b/deps/npm/docs/public/configuring-npm/install/index.html index cdcfdaac5e4489..1c2c462c6cffd3 100644 --- a/deps/npm/docs/public/configuring-npm/install/index.html +++ b/deps/npm/docs/public/configuring-npm/install/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

install

+

install

Download and Install npm

Description

To publish and install packages to and from the public npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. We strongly recommend using a Node version manager to install Node.js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.

@@ -123,4 +123,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/npmrc/index.html b/deps/npm/docs/public/configuring-npm/npmrc/index.html index 2f95c53ba049ec..e885771095dd6a 100644 --- a/deps/npm/docs/public/configuring-npm/npmrc/index.html +++ b/deps/npm/docs/public/configuring-npm/npmrc/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npmrc

+

npmrc

The npm config files

Description

npm gets its config settings from the command line, environment @@ -145,4 +145,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/package-json/index.html b/deps/npm/docs/public/configuring-npm/package-json/index.html index 7c7ef3e7b2fb15..ab0a6a78bb91a5 100644 --- a/deps/npm/docs/public/configuring-npm/package-json/index.html +++ b/deps/npm/docs/public/configuring-npm/package-json/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

package.json

+

package.json

Specifics of npm's package.json handling

Description

This document is all you need to know about what's required in your package.json @@ -711,4 +711,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/package-lock-json/index.html b/deps/npm/docs/public/configuring-npm/package-lock-json/index.html index 4658bf4faba7e0..0201a325dc1427 100644 --- a/deps/npm/docs/public/configuring-npm/package-lock-json/index.html +++ b/deps/npm/docs/public/configuring-npm/package-lock-json/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

package-lock.json

+

package-lock.json

A manifestation of the manifest

Description

package-lock.json is automatically generated for any operations where npm @@ -186,4 +186,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/package-locks/index.html b/deps/npm/docs/public/configuring-npm/package-locks/index.html index c7bfeb4daa476e..ecec79e8a961b1 100644 --- a/deps/npm/docs/public/configuring-npm/package-locks/index.html +++ b/deps/npm/docs/public/configuring-npm/package-locks/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

package-locks

+

package-locks

An explanation of npm lockfiles

Description

Conceptually, the "input" to npm install is a package.json, while its @@ -214,4 +214,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html b/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html index 4e7f28f0550415..e3105b55b27b1b 100644 --- a/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html +++ b/deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

npm shrinkwrap.json

+

npm shrinkwrap.json

A publishable lockfile

Description

npm-shrinkwrap.json is a file created by npm shrinkwrap. It is identical to @@ -102,4 +102,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff new file mode 100644 index 00000000000000..4eefa3c24d47e9 Binary files /dev/null and b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 new file mode 100644 index 00000000000000..025dca3744b8ba Binary files /dev/null and b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff new file mode 100644 index 00000000000000..59b821e2d093a9 Binary files /dev/null and b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 new file mode 100644 index 00000000000000..bb0923bff92a7b Binary files /dev/null and b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfecg.woff2 b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfecg.woff2 new file mode 100644 index 00000000000000..36195bdd0448c4 Binary files /dev/null and b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfecg.woff2 differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfedA.woff b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfedA.woff new file mode 100644 index 00000000000000..62ac3144e28af6 Binary files /dev/null and b/deps/npm/docs/public/google-fonts/s/poppins/v12/pxiEyp8kv8JHgFVrJJfedA.woff differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff b/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff deleted file mode 100644 index cdafba1a23117d..00000000000000 Binary files a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLDz8Z1xlEw.woff and /dev/null differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 b/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 deleted file mode 100644 index f0dad30bf8d852..00000000000000 Binary files a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLDz8Z1xlFQ.woff2 and /dev/null differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff b/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff deleted file mode 100644 index a2d64a1fb360d4..00000000000000 Binary files a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLGT9Z1xlEw.woff and /dev/null differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 b/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 deleted file mode 100644 index fcf632b49d3edb..00000000000000 Binary files a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiByp8kv8JHgFVrLGT9Z1xlFQ.woff2 and /dev/null differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiEyp8kv8JHgFVrJJfecg.woff2 b/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiEyp8kv8JHgFVrJJfecg.woff2 deleted file mode 100644 index 6711b0b85fcf49..00000000000000 Binary files a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiEyp8kv8JHgFVrJJfecg.woff2 and /dev/null differ diff --git a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiEyp8kv8JHgFVrJJfedA.woff b/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiEyp8kv8JHgFVrJJfedA.woff deleted file mode 100644 index 606db1d7a31299..00000000000000 Binary files a/deps/npm/docs/public/google-fonts/s/poppins/v9/pxiEyp8kv8JHgFVrJJfedA.woff and /dev/null differ diff --git a/deps/npm/docs/public/index.html b/deps/npm/docs/public/index.html index af748547064c90..56d2a53c3c722b 100644 --- a/deps/npm/docs/public/index.html +++ b/deps/npm/docs/public/index.html @@ -80,7 +80,7 @@ /* sc-component-id: sc-keyframes-gxCBeh */ @-webkit-keyframes gxCBeh{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}33%{-webkit-transform:rotate(8deg);-ms-transform:rotate(8deg);transform:rotate(8deg);}100%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}} @keyframes gxCBeh{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}33%{-webkit-transform:rotate(8deg);-ms-transform:rotate(8deg);transform:rotate(8deg);}100%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}} /* sc-component-id: sc-keyframes-hlcKXx */ -@-webkit-keyframes hlcKXx{0%{opacity:0;}50%{opacity:1;}100%{opacity:0;}} @keyframes hlcKXx{0%{opacity:0;}50%{opacity:1;}100%{opacity:0;}}
npm cli _
The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
npm cli _
The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
npm cli _
The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!

The current stable version of npm is available on GitHub.

To upgrade, run: npm install npm@latest -g

\ No newline at end of file +
npm cli _
The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
npm cli _
The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!
npm cli _
The intelligent package manager for the Node Javascript Platform. Install stuff and get coding!

The current stable version of npm is available on GitHub.

To upgrade, run: npm install npm@latest -g

\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/config/index.html b/deps/npm/docs/public/using-npm/config/index.html index 6c888f75147774..ace39d04339dbc 100644 --- a/deps/npm/docs/public/using-npm/config/index.html +++ b/deps/npm/docs/public/using-npm/config/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

config

+

config

More than you probably want to know about npm configuration

Description

npm gets its configuration values from the following sources, sorted by priority:

@@ -1161,4 +1161,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/developers/index.html b/deps/npm/docs/public/using-npm/developers/index.html index 7c2222013b53b5..995a0cecdf5424 100644 --- a/deps/npm/docs/public/using-npm/developers/index.html +++ b/deps/npm/docs/public/using-npm/developers/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

developers

+

developers

Developer Guide

Description

So, you've decided to use npm to develop (and maybe publish/deploy) @@ -259,4 +259,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/disputes/index.html b/deps/npm/docs/public/using-npm/disputes/index.html index 4d5212db60f0a6..148e2fb96a11a1 100644 --- a/deps/npm/docs/public/using-npm/disputes/index.html +++ b/deps/npm/docs/public/using-npm/disputes/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

disputes

+

disputes

Handling Module Name Disputes

This document describes the steps that you should take to resolve module name disputes with other npm publishers. It also describes special steps you should @@ -192,4 +192,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/orgs/index.html b/deps/npm/docs/public/using-npm/orgs/index.html index 56ab196954ae77..98d7ed33ae11e9 100644 --- a/deps/npm/docs/public/using-npm/orgs/index.html +++ b/deps/npm/docs/public/using-npm/orgs/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

orgs

+

orgs

Working with Teams & Orgs

Description

There are three levels of org users:

@@ -144,4 +144,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/registry/index.html b/deps/npm/docs/public/using-npm/registry/index.html index 01878b663e3ef8..5058b573dc1eb8 100644 --- a/deps/npm/docs/public/using-npm/registry/index.html +++ b/deps/npm/docs/public/using-npm/registry/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

registry

+

registry

The JavaScript Package Registry

Description

To resolve packages by name and version, npm talks to a registry website @@ -156,4 +156,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/removal/index.html b/deps/npm/docs/public/using-npm/removal/index.html index 0940caa467e23a..da9c8fa79ae340 100644 --- a/deps/npm/docs/public/using-npm/removal/index.html +++ b/deps/npm/docs/public/using-npm/removal/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

removal

+

removal

Cleaning the Slate

Synopsis

So sad to see you go.

@@ -116,4 +116,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/scope/index.html b/deps/npm/docs/public/using-npm/scope/index.html index 910986ab952ae8..cb798bc61b4480 100644 --- a/deps/npm/docs/public/using-npm/scope/index.html +++ b/deps/npm/docs/public/using-npm/scope/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

scope

+

scope

Scoped packages

Description

All npm packages have a name. Some package names also have a scope. A scope @@ -159,4 +159,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/scripts/index.html b/deps/npm/docs/public/using-npm/scripts/index.html index 7cf37ff1d7d03c..a9faac5c43ff98 100644 --- a/deps/npm/docs/public/using-npm/scripts/index.html +++ b/deps/npm/docs/public/using-npm/scripts/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

scripts

+

scripts

How npm handles the "scripts" field

Description

The "scripts" property of of your package.json file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts. These all can be executed by running npm run-script <stage> or npm run <stage> for short. Pre and post commands with matching names will be run for those as well (e.g. premyscript, myscript, postmyscript). Scripts from dependencies can be run with npm explore <pkg> -- npm run <stage>.

@@ -323,4 +323,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/docs/public/using-npm/semver/index.html b/deps/npm/docs/public/using-npm/semver/index.html index 7232ebb75efcfa..2e2d18d55e586c 100644 --- a/deps/npm/docs/public/using-npm/semver/index.html +++ b/deps/npm/docs/public/using-npm/semver/index.html @@ -26,7 +26,7 @@ /* sc-component-id: FoundTypo__Container-sc-1e373sc-0 */ .fMOzaj{margin:80px 0;border-top:1px solid black;padding:20px 0;} /* sc-component-id: Page__Content-sc-4b62ym-0 */ -.gJQTGP{max-width:760px;margin:auto;padding:0 30px 120px;}

semver(7) -- The semantic versioner for npm

+

semver(7) -- The semantic versioner for npm

Install

npm install --save semver

Usage

@@ -435,4 +435,4 @@

\ No newline at end of file +
\ No newline at end of file diff --git a/deps/npm/lib/explore.js b/deps/npm/lib/explore.js index 0c9930f8e4ca75..32c93d6553ac96 100644 --- a/deps/npm/lib/explore.js +++ b/deps/npm/lib/explore.js @@ -23,14 +23,13 @@ function explore (args, cb) { var opts = {cwd: cwd, stdio: 'inherit'} var shellArgs = [] - if (args) { + if (args.length) { if (isWindows) { var execCmd = escapeExecPath(args.shift()) var execArgs = [execCmd].concat(args.map(escapeArg)) opts.windowsVerbatimArguments = true shellArgs = ['/d', '/s', '/c'].concat(execArgs) } else { - shellArgs.unshift('-c') shellArgs = ['-c', args.map(escapeArg).join(' ').trim()] } } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 378ada7b05c061..ef492063b3a46e 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -650,6 +650,9 @@ Installer.prototype.saveToDependencies = function (cb) { validate('F', arguments) if (this.failing) return cb() log.silly('install', 'saveToDependencies') + // Note idealTree will be mutated during the save operations below as the + // package is reloaded from disk to preserve additional details. This means + // steps after postInstall will see a slightly different package object. if (this.saveOnlyLock) { saveShrinkwrap(this.idealTree, cb) } else { diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js index 72c71929630009..960dd375d05bb6 100644 --- a/deps/npm/lib/install/deps.js +++ b/deps/npm/lib/install/deps.js @@ -76,7 +76,7 @@ function doesChildVersionMatch (child, requested, requestor) { if (childReq.rawSpec === requested.rawSpec) return true if (childReq.type === requested.type) { if (childReq.saveSpec === requested.saveSpec) return true - if (childReq.fetchSpec === requested.fetchSpec) return true + if ((childReq.fetchSpec === requested.fetchSpec) && requested.type !== 'git') return true } } // If _requested didn't exist OR if it didn't match then we'll try using diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js index 122068c2012872..f89aa815497a18 100644 --- a/deps/npm/lib/install/inflate-shrinkwrap.js +++ b/deps/npm/lib/install/inflate-shrinkwrap.js @@ -52,6 +52,14 @@ function inflateShrinkwrap (topPath, tree, swdeps, opts) { const sw = swdeps[name] const dependencies = sw.dependencies || {} const requested = realizeShrinkwrapSpecifier(name, sw, topPath) + + if (Object.keys(sw).length === 0) { + let message = `Object for dependency "${name}" is empty.\n` + message += 'Something went wrong. Regenerate the package-lock.json with "npm install".\n' + message += 'If using a shrinkwrap, regenerate with "npm shrinkwrap".' + return Promise.reject(new Error(message)) + } + return inflatableChild( onDisk[name], name, topPath, tree, sw, requested, opts ).then((child) => { diff --git a/deps/npm/lib/install/save.js b/deps/npm/lib/install/save.js index 92b44a108099b9..986233a516a7c5 100644 --- a/deps/npm/lib/install/save.js +++ b/deps/npm/lib/install/save.js @@ -8,6 +8,7 @@ const iferr = require('iferr') const log = require('npmlog') const moduleName = require('../utils/module-name.js') const npm = require('../npm.js') +const packageId = require('../utils/package-id.js') const parseJSON = require('../utils/parse-json.js') const path = require('path') const stringifyPackage = require('stringify-package') @@ -131,6 +132,9 @@ function savePackageJson (tree, next) { } else { writeFileAtomic(saveTarget, json, next) } + + // Restore derived id as it was removed when reloading from disk + tree.package._id = packageId(tree.package) })) } diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index 78a2b1d791c7d5..c333f236bad31d 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -545,7 +545,7 @@ function makeParseable_ (data, long, dir, depth, parent, d) { return data.path + ':' + (data._id || '') + - ':' + (data.realPath !== data.path ? data.realPath : '') + + (data.link && data.link !== data.path ? ':' + data.link : '') + (data.extraneous ? ':EXTRANEOUS' : '') + (data.error && data.path !== path.resolve(npm.globalDir, '..') ? ':ERROR' : '') + (data.invalid ? ':INVALID' : '') + diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 48451071c47b44..f71e7c427f1443 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -2,7 +2,8 @@ .P section: cli\-commands title: npm\-adduser -.SH description: Set access level on published packages +description: Set access level on published packages +.HR .TH "NPM\-ADDUSER" "1" "July 2020" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index b702b46e6be65d..9107230ac652d5 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -2,7 +2,8 @@ .P section: cli\-commands title: npm\-dist\-tag -.SH description: Modify package distribution tags +description: Modify package distribution tags +.HR .TH "NPM\-DIST\-TAG" "1" "July 2020" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index f57ce725d610bc..2eda1a6698534e 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -2,7 +2,8 @@ .P section: cli\-commands title: npm\-explore -.SH description: Browse an installed package +description: Browse an installed package +.HR .TH "NPM\-EXPLORE" "1" "July 2020" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 2d5ffc138e66e2..da9832cdd48e4f 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf - npm@6\.14\.6 /path/to/npm + npm@6\.14\.7 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index d8b8bef621c09c..47aa62c9080ece 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -10,7 +10,7 @@ npm [args] .RE .SS Version .P -6\.14\.6 +6\.14\.7 .SS 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 e5fc2d48e6fa5d..8d0588f6bf2b1e 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "January 2020" "npx@10.2.1" "User Commands" +.TH "NPX" "1" "July 2020" "npx@10.2.3" "User Commands" .SH "NAME" \fBnpx\fR \- execute npm package binaries .SH SYNOPSIS diff --git a/deps/npm/node_modules/bin-links/CHANGELOG.md b/deps/npm/node_modules/bin-links/CHANGELOG.md index e7b640c08d13fe..48860e2b78e38a 100644 --- a/deps/npm/node_modules/bin-links/CHANGELOG.md +++ b/deps/npm/node_modules/bin-links/CHANGELOG.md @@ -2,6 +2,11 @@ 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.8](https://github.com/npm/bin-links/compare/v1.1.7...v1.1.8) (2020-03-24) + + + ## [1.1.7](https://github.com/npm/bin-links/compare/v1.1.6...v1.1.7) (2019-12-26) diff --git a/deps/npm/node_modules/bin-links/package.json b/deps/npm/node_modules/bin-links/package.json index 45393d11c5fc87..2a2659dfa82310 100644 --- a/deps/npm/node_modules/bin-links/package.json +++ b/deps/npm/node_modules/bin-links/package.json @@ -1,19 +1,19 @@ { - "_from": "bin-links@1.1.7", - "_id": "bin-links@1.1.7", + "_from": "bin-links@1.1.8", + "_id": "bin-links@1.1.8", "_inBundle": false, - "_integrity": "sha512-/eaLaTu7G7/o7PV04QPy1HRT65zf+1tFkPGv0sPTV0tRwufooYBQO3zrcyGgm+ja+ZtBf2GEuKjDRJ2pPG+yqA==", + "_integrity": "sha512-KgmVfx+QqggqP9dA3iIc5pA4T1qEEEL+hOhOhNPaUm77OTrJoOXE/C05SJLNJe6m/2wUK7F1tDSou7n5TfCDzQ==", "_location": "/bin-links", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "bin-links@1.1.7", + "raw": "bin-links@1.1.8", "name": "bin-links", "escapedName": "bin-links", - "rawSpec": "1.1.7", + "rawSpec": "1.1.8", "saveSpec": null, - "fetchSpec": "1.1.7" + "fetchSpec": "1.1.8" }, "_requiredBy": [ "#USER", @@ -21,10 +21,10 @@ "/libcipm", "/libnpm" ], - "_resolved": "https://registry.npmjs.org/bin-links/-/bin-links-1.1.7.tgz", - "_shasum": "34b79ea9d0e575d7308afeff0c6b2fc24c793359", - "_spec": "bin-links@1.1.7", - "_where": "/Users/mperrotte/npminc/cli", + "_resolved": "https://registry.npmjs.org/bin-links/-/bin-links-1.1.8.tgz", + "_shasum": "bd39aadab5dc4bdac222a07df5baf1af745b2228", + "_spec": "bin-links@1.1.8", + "_where": "/Users/claudiahdz/npm/cli", "author": { "name": "Mike Sherov" }, @@ -48,9 +48,7 @@ "rimraf": "^2.6.3", "standard": "^10.0.3", "standard-version": "^4.4.0", - "tap": "^12.1.3", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" + "tap": "^12.1.3" }, "files": [ "index.js" @@ -64,6 +62,9 @@ "license": "Artistic-2.0", "main": "index.js", "name": "bin-links", + "publishConfig": { + "tag": "legacy" + }, "repository": { "type": "git", "url": "git://github.com/npm/bin-links.git" @@ -73,9 +74,7 @@ "posttest": "standard", "prerelease": "npm t", "release": "standard-version -s", - "test": "tap -J --nyc-arg=--all --coverage test/*.js --100", - "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'" + "test": "tap -J --nyc-arg=--all --coverage test/*.js --100" }, - "version": "1.1.7" + "version": "1.1.8" } diff --git a/deps/npm/node_modules/cliui/CHANGELOG.md b/deps/npm/node_modules/cliui/CHANGELOG.md index d9e6fbb9a7c918..37f259a5ce41d8 100644 --- a/deps/npm/node_modules/cliui/CHANGELOG.md +++ b/deps/npm/node_modules/cliui/CHANGELOG.md @@ -2,6 +2,20 @@ 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/yargs/cliui/compare/v4.1.0...v5.0.0) (2019-04-10) + + +### Bug Fixes + +* Update wrap-ansi to fix compatibility with latest versions of chalk. ([#60](https://github.com/yargs/cliui/issues/60)) ([7bf79ae](https://github.com/yargs/cliui/commit/7bf79ae)) + + +### BREAKING CHANGES + +* Drop support for node < 6. + + + # [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23) diff --git a/deps/npm/node_modules/cliui/README.md b/deps/npm/node_modules/cliui/README.md index 7861976fc2d243..deacfa0dc5aaa4 100644 --- a/deps/npm/node_modules/cliui/README.md +++ b/deps/npm/node_modules/cliui/README.md @@ -46,7 +46,7 @@ console.log(ui.toString()) cliui exposes a simple layout DSL: -If you create a single `ui.row`, passing a string rather than an +If you create a single `ui.div`, passing a string rather than an object: * `\n`: characters will be interpreted as new rows. diff --git a/deps/npm/node_modules/cliui/node_modules/ansi-regex/index.js b/deps/npm/node_modules/cliui/node_modules/ansi-regex/index.js index c4aaecf5050639..c25448009f304d 100644 --- a/deps/npm/node_modules/cliui/node_modules/ansi-regex/index.js +++ b/deps/npm/node_modules/cliui/node_modules/ansi-regex/index.js @@ -1,10 +1,14 @@ 'use strict'; -module.exports = () => { +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', - '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))' + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' ].join('|'); - return new RegExp(pattern, 'g'); + return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); }; diff --git a/deps/npm/node_modules/cliui/node_modules/ansi-regex/package.json b/deps/npm/node_modules/cliui/node_modules/ansi-regex/package.json index 8e2c1b93e5b636..9397a8c3f4e4ec 100644 --- a/deps/npm/node_modules/cliui/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/cliui/node_modules/ansi-regex/package.json @@ -1,27 +1,27 @@ { - "_from": "ansi-regex@^3.0.0", - "_id": "ansi-regex@3.0.0", + "_from": "ansi-regex@^4.1.0", + "_id": "ansi-regex@4.1.0", "_inBundle": false, - "_integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "_integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "_location": "/cliui/ansi-regex", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "ansi-regex@^3.0.0", + "raw": "ansi-regex@^4.1.0", "name": "ansi-regex", "escapedName": "ansi-regex", - "rawSpec": "^3.0.0", + "rawSpec": "^4.1.0", "saveSpec": null, - "fetchSpec": "^3.0.0" + "fetchSpec": "^4.1.0" }, "_requiredBy": [ "/cliui/strip-ansi" ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "_shasum": "ed0317c322064f79466c02966bddb605ab37d998", - "_spec": "ansi-regex@^3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/cliui/node_modules/strip-ansi", + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "_shasum": "8b9f8f08cf1acb843756a839ca8c7e3168c51997", + "_spec": "ansi-regex@^4.1.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/cliui/node_modules/strip-ansi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -34,11 +34,11 @@ "deprecated": false, "description": "Regular expression for matching ANSI escape codes", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^0.25.0", + "xo": "^0.23.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -81,5 +81,5 @@ "test": "xo && ava", "view-supported": "node fixtures/view-codes.js" }, - "version": "3.0.0" + "version": "4.1.0" } diff --git a/deps/npm/node_modules/cliui/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/cliui/node_modules/ansi-regex/readme.md index 22db1c34055556..d19c44667e704b 100644 --- a/deps/npm/node_modules/cliui/node_modules/ansi-regex/readme.md +++ b/deps/npm/node_modules/cliui/node_modules/ansi-regex/readme.md @@ -2,6 +2,20 @@ > Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + ## Install @@ -23,9 +37,31 @@ ansiRegex().test('cake'); '\u001B[4mcake\u001B[0m'.match(ansiRegex()); //=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] ``` +## API + +### ansiRegex([options]) + +Returns a regex for matching ANSI escape codes. + +#### options + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + ## FAQ ### Why do you test for codes not in the ECMA 48 standard? @@ -35,6 +71,11 @@ Some of the codes we run as a test are codes that we acquired finding various li On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + ## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) diff --git a/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..d506327c3e5576 --- /dev/null +++ b/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +/* eslint-disable yoda */ +module.exports = x => { + if (Number.isNaN(x)) { + return false; + } + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + x === 0x2329 || // LEFT-POINTING ANGLE BRACKET + x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= x && x <= 0x4dbf) || + // CJK Unified Ideographs .. Yi Radicals + (0x4e00 <= x && x <= 0xa4c6) || + // Hangul Jamo Extended-A + (0xa960 <= x && x <= 0xa97c) || + // Hangul Syllables + (0xac00 <= x && x <= 0xd7a3) || + // CJK Compatibility Ideographs + (0xf900 <= x && x <= 0xfaff) || + // Vertical Forms + (0xfe10 <= x && x <= 0xfe19) || + // CJK Compatibility Forms .. Small Form Variants + (0xfe30 <= x && x <= 0xfe6b) || + // Halfwidth and Fullwidth Forms + (0xff01 <= x && x <= 0xff60) || + (0xffe0 <= x && x <= 0xffe6) || + // Kana Supplement + (0x1b000 <= x && x <= 0x1b001) || + // Enclosed Ideographic Supplement + (0x1f200 <= x && x <= 0x1f251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= x && x <= 0x3fffd) + ) + ) { + return true; + } + + return false; +}; diff --git a/deps/npm/node_modules/find-up/license b/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/license similarity index 100% rename from deps/npm/node_modules/find-up/license rename to deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/license diff --git a/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..bea9e8359c6494 --- /dev/null +++ b/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,77 @@ +{ + "_from": "is-fullwidth-code-point@^2.0.0", + "_id": "is-fullwidth-code-point@2.0.0", + "_inBundle": false, + "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "_location": "/cliui/is-fullwidth-code-point", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-fullwidth-code-point@^2.0.0", + "name": "is-fullwidth-code-point", + "escapedName": "is-fullwidth-code-point", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/cliui/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", + "_spec": "is-fullwidth-code-point@^2.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/cliui/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..093b0281b2c46b --- /dev/null +++ b/deps/npm/node_modules/cliui/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/cliui/node_modules/string-width/index.js b/deps/npm/node_modules/cliui/node_modules/string-width/index.js new file mode 100644 index 00000000000000..33c9d6c06f7a59 --- /dev/null +++ b/deps/npm/node_modules/cliui/node_modules/string-width/index.js @@ -0,0 +1,39 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex')(); + +module.exports = input => { + input = input.replace(emojiRegex, ' '); + + if (typeof input !== 'string' || input.length === 0) { + return 0; + } + + input = stripAnsi(input); + + let width = 0; + + for (let i = 0; i < input.length; i++) { + const code = input.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; diff --git a/deps/npm/node_modules/invert-kv/license b/deps/npm/node_modules/cliui/node_modules/string-width/license similarity index 100% rename from deps/npm/node_modules/invert-kv/license rename to deps/npm/node_modules/cliui/node_modules/string-width/license diff --git a/deps/npm/node_modules/cliui/node_modules/string-width/package.json b/deps/npm/node_modules/cliui/node_modules/string-width/package.json new file mode 100644 index 00000000000000..8c314e0a0f8bc4 --- /dev/null +++ b/deps/npm/node_modules/cliui/node_modules/string-width/package.json @@ -0,0 +1,88 @@ +{ + "_from": "string-width@^3.1.0", + "_id": "string-width@3.1.0", + "_inBundle": false, + "_integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "_location": "/cliui/string-width", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string-width@^3.1.0", + "name": "string-width", + "escapedName": "string-width", + "rawSpec": "^3.1.0", + "saveSpec": null, + "fetchSpec": "^3.1.0" + }, + "_requiredBy": [ + "/cliui" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "_shasum": "22767be21b62af1081574306f69ac51b62203961", + "_spec": "string-width@^3.1.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/cliui", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "bundleDependencies": false, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "deprecated": false, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "^1.0.1", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/string-width#readme", + "keywords": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "name": "string-width", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.1.0" +} diff --git a/deps/npm/node_modules/cliui/node_modules/string-width/readme.md b/deps/npm/node_modules/cliui/node_modules/string-width/readme.md new file mode 100644 index 00000000000000..d39d95f56cf3f8 --- /dev/null +++ b/deps/npm/node_modules/cliui/node_modules/string-width/readme.md @@ -0,0 +1,45 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 + +stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +// => 5 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/cliui/node_modules/strip-ansi/index.d.ts b/deps/npm/node_modules/cliui/node_modules/strip-ansi/index.d.ts new file mode 100644 index 00000000000000..44e954d0c724d8 --- /dev/null +++ b/deps/npm/node_modules/cliui/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,15 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +export default function stripAnsi(string: string): string; diff --git a/deps/npm/node_modules/cliui/node_modules/strip-ansi/index.js b/deps/npm/node_modules/cliui/node_modules/strip-ansi/index.js index 96e0292c8e2f64..9788c96dfa3b0c 100644 --- a/deps/npm/node_modules/cliui/node_modules/strip-ansi/index.js +++ b/deps/npm/node_modules/cliui/node_modules/strip-ansi/index.js @@ -1,4 +1,7 @@ 'use strict'; const ansiRegex = require('ansi-regex'); -module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input; +const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; + +module.exports = stripAnsi; +module.exports.default = stripAnsi; diff --git a/deps/npm/node_modules/cliui/node_modules/strip-ansi/package.json b/deps/npm/node_modules/cliui/node_modules/strip-ansi/package.json index b45e23c1183f00..1185f87f668319 100644 --- a/deps/npm/node_modules/cliui/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/cliui/node_modules/strip-ansi/package.json @@ -1,27 +1,28 @@ { - "_from": "strip-ansi@^4.0.0", - "_id": "strip-ansi@4.0.0", + "_from": "strip-ansi@^5.2.0", + "_id": "strip-ansi@5.2.0", "_inBundle": false, - "_integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "_integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "_location": "/cliui/strip-ansi", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "strip-ansi@^4.0.0", + "raw": "strip-ansi@^5.2.0", "name": "strip-ansi", "escapedName": "strip-ansi", - "rawSpec": "^4.0.0", + "rawSpec": "^5.2.0", "saveSpec": null, - "fetchSpec": "^4.0.0" + "fetchSpec": "^5.2.0" }, "_requiredBy": [ - "/cliui" + "/cliui", + "/cliui/string-width" ], - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "_shasum": "a8479022eb1ac368a871389b635262c505ee368f", - "_spec": "strip-ansi@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/cliui", + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "_shasum": "8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae", + "_spec": "strip-ansi@^5.2.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/cliui", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -32,19 +33,21 @@ }, "bundleDependencies": false, "dependencies": { - "ansi-regex": "^3.0.0" + "ansi-regex": "^4.1.0" }, "deprecated": false, - "description": "Strip ANSI escape codes", + "description": "Strip ANSI escape codes from a string", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/chalk/strip-ansi#readme", "keywords": [ @@ -78,7 +81,7 @@ "url": "git+https://github.com/chalk/strip-ansi.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd-check" }, - "version": "4.0.0" + "version": "5.2.0" } diff --git a/deps/npm/node_modules/cliui/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/cliui/node_modules/strip-ansi/readme.md index dc76f0cb1a0595..8681fe8af44242 100644 --- a/deps/npm/node_modules/cliui/node_modules/strip-ansi/readme.md +++ b/deps/npm/node_modules/cliui/node_modules/strip-ansi/readme.md @@ -1,7 +1,20 @@ # strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) -> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string +--- + +
+ + Get professional support for 'strip-ansi' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- ## Install @@ -17,12 +30,21 @@ const stripAnsi = require('strip-ansi'); stripAnsi('\u001B[4mUnicorn\u001B[0m'); //=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' ``` +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + ## Related - [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module - [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes - [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right diff --git a/deps/npm/node_modules/cliui/package.json b/deps/npm/node_modules/cliui/package.json index 2571f5322533ee..c3f92f9c564ef0 100644 --- a/deps/npm/node_modules/cliui/package.json +++ b/deps/npm/node_modules/cliui/package.json @@ -1,27 +1,29 @@ { - "_from": "cliui@^4.0.0", - "_id": "cliui@4.1.0", + "_from": "cliui@^5.0.0", + "_id": "cliui@5.0.0", "_inBundle": false, - "_integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "_integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "_location": "/cliui", - "_phantomChildren": {}, + "_phantomChildren": { + "emoji-regex": "7.0.3" + }, "_requested": { "type": "range", "registry": true, - "raw": "cliui@^4.0.0", + "raw": "cliui@^5.0.0", "name": "cliui", "escapedName": "cliui", - "rawSpec": "^4.0.0", + "rawSpec": "^5.0.0", "saveSpec": null, - "fetchSpec": "^4.0.0" + "fetchSpec": "^5.0.0" }, "_requiredBy": [ "/yargs" ], - "_resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "_shasum": "348422dbe82d800b3022eef4f6ac10bf2e4d1b49", - "_spec": "cliui@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/yargs", + "_resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "_shasum": "deefcfdb2e800784aa34f46fa08e06851c7bbbc5", + "_spec": "cliui@^5.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", "author": { "name": "Ben Coe", "email": "ben@npmjs.com" @@ -43,23 +45,23 @@ } }, "dependencies": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" }, "deprecated": false, "description": "easily create complex multi-column command-line-interfaces", "devDependencies": { - "chai": "^3.5.0", - "chalk": "^1.1.2", - "coveralls": "^2.11.8", - "mocha": "^3.0.0", - "nyc": "^10.0.0", - "standard": "^8.0.0", - "standard-version": "^3.0.0" + "chai": "^4.2.0", + "chalk": "^2.4.2", + "coveralls": "^3.0.3", + "mocha": "^6.0.2", + "nyc": "^13.3.0", + "standard": "^12.0.1", + "standard-version": "^5.0.2" }, "engine": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -95,5 +97,5 @@ "it" ] }, - "version": "4.1.0" + "version": "5.0.0" } diff --git a/deps/npm/node_modules/emoji-regex/LICENSE-MIT.txt b/deps/npm/node_modules/emoji-regex/LICENSE-MIT.txt new file mode 100644 index 00000000000000..a41e0a7ef970ec --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +Copyright Mathias Bynens + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/emoji-regex/README.md b/deps/npm/node_modules/emoji-regex/README.md new file mode 100644 index 00000000000000..37cf14e01f72a5 --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/README.md @@ -0,0 +1,73 @@ +# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex) + +_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard. + +This repository contains a script that generates this regular expression based on [the data from Unicode Technical Report #51](https://github.com/mathiasbynens/unicode-tr51). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install emoji-regex +``` + +In [Node.js](https://nodejs.org/): + +```js +const emojiRegex = require('emoji-regex'); +// Note: because the regular expression has the global flag set, this module +// exports a function that returns the regex rather than exporting the regular +// expression itself, to make it impossible to (accidentally) mutate the +// original regular expression. + +const text = ` +\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation) +\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji +\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base) +\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier +`; + +const regex = emojiRegex(); +let match; +while (match = regex.exec(text)) { + const emoji = match[0]; + console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`); +} +``` + +Console output: + +``` +Matched sequence ⌚ — code points: 1 +Matched sequence ⌚ — code points: 1 +Matched sequence ↔️ — code points: 2 +Matched sequence ↔️ — code points: 2 +Matched sequence 👩 — code points: 1 +Matched sequence 👩 — code points: 1 +Matched sequence 👩🏿 — code points: 2 +Matched sequence 👩🏿 — code points: 2 +``` + +To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex: + +```js +const emojiRegex = require('emoji-regex/text.js'); +``` + +Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes: + +```js +const emojiRegex = require('emoji-regex/es2015/index.js'); +const emojiRegexText = require('emoji-regex/es2015/text.js'); +``` + +## Author + +| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | +|---| +| [Mathias Bynens](https://mathiasbynens.be/) | + +## License + +_emoji-regex_ is available under the [MIT](https://mths.be/mit) license. diff --git a/deps/npm/node_modules/emoji-regex/es2015/index.js b/deps/npm/node_modules/emoji-regex/es2015/index.js new file mode 100644 index 00000000000000..0216db95876da0 --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/es2015/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/deps/npm/node_modules/emoji-regex/es2015/text.js b/deps/npm/node_modules/emoji-regex/es2015/text.js new file mode 100644 index 00000000000000..d0a771d36e487f --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/es2015/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = () => { + // https://mths.be/emoji + return /\u{1F3F4}(?:\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0077}\u{E006C}\u{E0073}|\u{E0073}\u{E0063}\u{E0074})\u{E007F}|\u200D\u2620\uFE0F)|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F468}(?:\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}])|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u{1F468}(?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F469}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|\u{1F468}(?:\u200D(?:[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u{1F466}\u{1F467}])|[\u{1F3FB}-\u{1F3FF}])|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F469}\u200D\u{1F467}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9B0}-\u{1F9B3}]|\u{1F469}\u200D\u{1F466}|\u{1F1F6}\u{1F1E6}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|[#\*0-9]\uFE0F\u20E3|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9D1}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6F9}\u{1F910}-\u{1F93A}\u{1F93C}-\u{1F93E}\u{1F940}-\u{1F945}\u{1F947}-\u{1F970}\u{1F973}-\u{1F976}\u{1F97A}\u{1F97C}-\u{1F9A2}\u{1F9B0}-\u{1F9B9}\u{1F9C0}-\u{1F9C2}\u{1F9D0}-\u{1F9FF}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F469}\u{1F46E}\u{1F470}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9D1}-\u{1F9DD}]/gu; +}; diff --git a/deps/npm/node_modules/emoji-regex/index.d.ts b/deps/npm/node_modules/emoji-regex/index.d.ts new file mode 100644 index 00000000000000..2c317cdad43dbe --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/index.d.ts @@ -0,0 +1,5 @@ +declare module 'emoji-regex' { + function emojiRegex(): RegExp; + + export default emojiRegex; +} diff --git a/deps/npm/node_modules/emoji-regex/index.js b/deps/npm/node_modules/emoji-regex/index.js new file mode 100644 index 00000000000000..e2237a4e805327 --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/index.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; +}; diff --git a/deps/npm/node_modules/emoji-regex/package.json b/deps/npm/node_modules/emoji-regex/package.json new file mode 100644 index 00000000000000..356ae530db0171 --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/package.json @@ -0,0 +1,82 @@ +{ + "_args": [ + [ + "emoji-regex@7.0.3", + "/Users/claudiahdz/npm/cli" + ] + ], + "_development": true, + "_from": "emoji-regex@7.0.3", + "_id": "emoji-regex@7.0.3", + "_inBundle": false, + "_integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "_location": "/emoji-regex", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "emoji-regex@7.0.3", + "name": "emoji-regex", + "escapedName": "emoji-regex", + "rawSpec": "7.0.3", + "saveSpec": null, + "fetchSpec": "7.0.3" + }, + "_requiredBy": [ + "/nyc/string-width" + ], + "_resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "_spec": "7.0.3", + "_where": "/Users/claudiahdz/npm/cli", + "author": { + "name": "Mathias Bynens", + "url": "https://mathiasbynens.be/" + }, + "bugs": { + "url": "https://github.com/mathiasbynens/emoji-regex/issues" + }, + "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.", + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "mocha": "^5.2.0", + "regexgen": "^1.3.0", + "unicode-11.0.0": "^0.7.7", + "unicode-tr51": "^9.0.1" + }, + "files": [ + "LICENSE-MIT.txt", + "index.js", + "index.d.ts", + "text.js", + "es2015/index.js", + "es2015/text.js" + ], + "homepage": "https://mths.be/emoji-regex", + "keywords": [ + "unicode", + "regex", + "regexp", + "regular expressions", + "code points", + "symbols", + "characters", + "emoji" + ], + "license": "MIT", + "main": "index.js", + "name": "emoji-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/mathiasbynens/emoji-regex.git" + }, + "scripts": { + "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js", + "test": "mocha", + "test:watch": "npm run test -- --watch" + }, + "types": "index.d.ts", + "version": "7.0.3" +} diff --git a/deps/npm/node_modules/emoji-regex/text.js b/deps/npm/node_modules/emoji-regex/text.js new file mode 100644 index 00000000000000..199ae3be35b418 --- /dev/null +++ b/deps/npm/node_modules/emoji-regex/text.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = function () { + // https://mths.be/emoji + return /\uD83C\uDFF4(?:\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74)\uDB40\uDC7F|\u200D\u2620\uFE0F)|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3]))|\uD83D\uDC69\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83D\uDC69\u200D[\u2695\u2696\u2708])\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC68(?:\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDB0-\uDDB3])|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF9]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD70\uDD73-\uDD76\uDD7A\uDD7C-\uDDA2\uDDB0-\uDDB9\uDDC0-\uDDC2\uDDD0-\uDDFF])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDD1-\uDDDD])/g; +}; diff --git a/deps/npm/node_modules/gentle-fs/CHANGELOG.md b/deps/npm/node_modules/gentle-fs/CHANGELOG.md index 50dfcd74c99f1c..116c0118f0efe6 100644 --- a/deps/npm/node_modules/gentle-fs/CHANGELOG.md +++ b/deps/npm/node_modules/gentle-fs/CHANGELOG.md @@ -2,6 +2,11 @@ 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. + +## [2.3.1](https://github.com/npm/gentle-fs/compare/v2.3.0...v2.3.1) (2020-03-25) + + + # [2.3.0](https://github.com/npm/gentle-fs/compare/v2.2.1...v2.3.0) (2019-12-11) diff --git a/deps/npm/node_modules/gentle-fs/README.md b/deps/npm/node_modules/gentle-fs/README.md index 54af51cf99288e..f8a3020ac50937 100644 --- a/deps/npm/node_modules/gentle-fs/README.md +++ b/deps/npm/node_modules/gentle-fs/README.md @@ -11,7 +11,6 @@ * [Example](#example) * [Features](#features) -* [Contributing](#contributing) * [API](#api) * [`rm`](#rm) * [`link`](#link) @@ -28,14 +27,6 @@ * Performs filesystem operations "gently". Please see details in the API specs below for a more precise definition of "gently". -### 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 #### `> rm(target, opts, cb)` diff --git a/deps/npm/node_modules/gentle-fs/package.json b/deps/npm/node_modules/gentle-fs/package.json index d162899757b0f7..b01e0c16beeaff 100644 --- a/deps/npm/node_modules/gentle-fs/package.json +++ b/deps/npm/node_modules/gentle-fs/package.json @@ -1,29 +1,29 @@ { - "_from": "gentle-fs@2.3.0", - "_id": "gentle-fs@2.3.0", + "_from": "gentle-fs@2.3.1", + "_id": "gentle-fs@2.3.1", "_inBundle": false, - "_integrity": "sha512-3k2CgAmPxuz7S6nKK+AqFE2AdM1QuwqKLPKzIET3VRwK++3q96MsNFobScDjlCrq97ZJ8y5R725MOlm6ffUCjg==", + "_integrity": "sha512-OlwBBwqCFPcjm33rF2BjW+Pr6/ll2741l+xooiwTCeaX2CA1ZuclavyMBe0/KlR21/XGsgY6hzEQZ15BdNa13Q==", "_location": "/gentle-fs", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "gentle-fs@2.3.0", + "raw": "gentle-fs@2.3.1", "name": "gentle-fs", "escapedName": "gentle-fs", - "rawSpec": "2.3.0", + "rawSpec": "2.3.1", "saveSpec": null, - "fetchSpec": "2.3.0" + "fetchSpec": "2.3.1" }, "_requiredBy": [ "#USER", "/", "/bin-links" ], - "_resolved": "https://registry.npmjs.org/gentle-fs/-/gentle-fs-2.3.0.tgz", - "_shasum": "13538db5029400f98684be4894e8a7d8f0d1ea7f", - "_spec": "gentle-fs@2.3.0", - "_where": "/Users/isaacs/dev/npm/cli", + "_resolved": "https://registry.npmjs.org/gentle-fs/-/gentle-fs-2.3.1.tgz", + "_shasum": "11201bf66c18f930ddca72cf69460bdfa05727b1", + "_spec": "gentle-fs@2.3.1", + "_where": "/Users/claudiahdz/npm/cli", "author": { "name": "Mike Sherov" }, @@ -52,9 +52,7 @@ "require-inject": "^1.4.2", "standard": "^10.0.3", "standard-version": "^4.2.0", - "tap": "^10.7.2", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" + "tap": "^10.7.2" }, "files": [ "index.js", @@ -78,9 +76,7 @@ "posttest": "standard", "prerelease": "npm t", "release": "standard-version -s", - "test": "tap -J --nyc-arg=--all --coverage test", - "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'" + "test": "tap -J --nyc-arg=--all --coverage test" }, - "version": "2.3.0" + "version": "2.3.1" } diff --git a/deps/npm/node_modules/get-caller-file/README.md b/deps/npm/node_modules/get-caller-file/README.md index 194492736bc4fe..a7d8c079707355 100644 --- a/deps/npm/node_modules/get-caller-file/README.md +++ b/deps/npm/node_modules/get-caller-file/README.md @@ -2,3 +2,40 @@ [![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master) + +This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked. + +Inspired by http://stackoverflow.com/questions/13227489 + +*note: this relies on Node/V8 specific APIs, as such other runtimes may not work* + +## Installation + +```bash +yarn add get-caller-file +``` + +## Usage + +Given: + +```js +// ./foo.js +const getCallerFile = require('get-caller-file'); + +module.exports = function() { + return getCallerFile(); // figures out who called it +}; +``` + +```js +// index.js +const foo = require('./foo'); + +foo() // => /full/path/to/this/file/index.js +``` + + +## Options: + +* `getCallerFile(position = 2)`: where position is stack frame whos fileName we want. diff --git a/deps/npm/node_modules/get-caller-file/index.d.ts b/deps/npm/node_modules/get-caller-file/index.d.ts new file mode 100644 index 00000000000000..babed696ae00ee --- /dev/null +++ b/deps/npm/node_modules/get-caller-file/index.d.ts @@ -0,0 +1,2 @@ +declare const _default: (position?: number) => any; +export = _default; diff --git a/deps/npm/node_modules/get-caller-file/index.js b/deps/npm/node_modules/get-caller-file/index.js index 03e7dfc39b0408..57304f80345dd0 100644 --- a/deps/npm/node_modules/get-caller-file/index.js +++ b/deps/npm/node_modules/get-caller-file/index.js @@ -1,20 +1,22 @@ -'use strict'; - +"use strict"; // Call this function in a another function to find out the file from // which that function was called from. (Inspects the v8 stack trace) // // Inspired by http://stackoverflow.com/questions/13227489 - -module.exports = function getCallerFile(_position) { - var oldPrepareStackTrace = Error.prepareStackTrace; - Error.prepareStackTrace = function(err, stack) { return stack; }; - var stack = new Error().stack; - Error.prepareStackTrace = oldPrepareStackTrace; - - var position = _position ? _position : 2; - - // stack[0] holds this file - // stack[1] holds where this function was called - // stack[2] holds the file we're interested in - return stack[position] ? stack[position].getFileName() : undefined; +module.exports = function getCallerFile(position) { + if (position === void 0) { position = 2; } + if (position >= Error.stackTraceLimit) { + throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`'); + } + var oldPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack; }; + var stack = new Error().stack; + Error.prepareStackTrace = oldPrepareStackTrace; + if (stack !== null && typeof stack === 'object') { + // stack[0] holds this file + // stack[1] holds where this function was called + // stack[2] holds the file we're interested in + return stack[position] ? stack[position].getFileName() : undefined; + } }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/deps/npm/node_modules/get-caller-file/index.js.map b/deps/npm/node_modules/get-caller-file/index.js.map new file mode 100644 index 00000000000000..89c655c06da4ac --- /dev/null +++ b/deps/npm/node_modules/get-caller-file/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAE1D,iBAAS,SAAS,aAAa,CAAC,QAAY;IAAZ,yBAAA,EAAA,YAAY;IAC1C,IAAI,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE;QACrC,MAAM,IAAI,SAAS,CAAC,kGAAkG,GAAG,QAAQ,GAAG,oCAAoC,GAAG,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC;KACzM;IAED,IAAM,oBAAoB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,KAAK,CAAC,iBAAiB,GAAG,UAAC,CAAC,EAAE,KAAK,IAAM,OAAA,KAAK,EAAL,CAAK,CAAC;IAC/C,IAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IAChC,KAAK,CAAC,iBAAiB,GAAG,oBAAoB,CAAC;IAG/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC/C,2BAA2B;QAC3B,gDAAgD;QAChD,8CAA8C;QAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,QAAQ,CAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KAC7E;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/deps/npm/node_modules/get-caller-file/package.json b/deps/npm/node_modules/get-caller-file/package.json index e853deec1b0563..5e58bc7cc07a8a 100644 --- a/deps/npm/node_modules/get-caller-file/package.json +++ b/deps/npm/node_modules/get-caller-file/package.json @@ -1,27 +1,27 @@ { - "_from": "get-caller-file@^1.0.1", - "_id": "get-caller-file@1.0.3", + "_from": "get-caller-file@^2.0.1", + "_id": "get-caller-file@2.0.5", "_inBundle": false, - "_integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "_integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "_location": "/get-caller-file", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "get-caller-file@^1.0.1", + "raw": "get-caller-file@^2.0.1", "name": "get-caller-file", "escapedName": "get-caller-file", - "rawSpec": "^1.0.1", + "rawSpec": "^2.0.1", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "^2.0.1" }, "_requiredBy": [ "/yargs" ], - "_resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "_shasum": "f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a", - "_spec": "get-caller-file@^1.0.1", - "_where": "/Users/mperrotte/npminc/cli/node_modules/yargs", + "_resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "_shasum": "4f94412a82db32f36e3b0b9741f8a97feb031f7e", + "_spec": "get-caller-file@^2.0.1", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", "author": { "name": "Stefan Penner" }, @@ -32,15 +32,25 @@ "deprecated": false, "description": "[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file) [![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)", "devDependencies": { + "@types/chai": "^4.1.7", + "@types/ensure-posix-path": "^1.0.0", + "@types/mocha": "^5.2.6", + "@types/node": "^11.10.5", "chai": "^4.1.2", "ensure-posix-path": "^1.0.1", - "mocha": "^5.2.0" + "mocha": "^5.2.0", + "typescript": "^3.3.3333" }, "directories": { "test": "tests" }, + "engines": { + "node": "6.* || 8.* || >= 10.*" + }, "files": [ - "index.js" + "index.js", + "index.js.map", + "index.d.ts" ], "homepage": "https://github.com/stefanpenner/get-caller-file#readme", "license": "ISC", @@ -51,8 +61,9 @@ "url": "git+https://github.com/stefanpenner/get-caller-file.git" }, "scripts": { + "prepare": "tsc", "test": "mocha test", "test:debug": "mocha test" }, - "version": "1.0.3" + "version": "2.0.5" } diff --git a/deps/npm/node_modules/invert-kv/index.js b/deps/npm/node_modules/invert-kv/index.js deleted file mode 100644 index 27f9cbb8eaf281..00000000000000 --- a/deps/npm/node_modules/invert-kv/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; -module.exports = object => { - if (typeof object !== 'object') { - throw new TypeError('Expected an object'); - } - - const ret = {}; - - for (const key of Object.keys(object)) { - const value = object[key]; - ret[value] = key; - } - - return ret; -}; diff --git a/deps/npm/node_modules/invert-kv/package.json b/deps/npm/node_modules/invert-kv/package.json deleted file mode 100644 index beb77fa37f6fa7..00000000000000 --- a/deps/npm/node_modules/invert-kv/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "_from": "invert-kv@^2.0.0", - "_id": "invert-kv@2.0.0", - "_inBundle": false, - "_integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "_location": "/invert-kv", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "invert-kv@^2.0.0", - "name": "invert-kv", - "escapedName": "invert-kv", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/lcid" - ], - "_resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "_shasum": "7393f5afa59ec9ff5f67a27620d11c226e3eec02", - "_spec": "invert-kv@^2.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/lcid", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/invert-kv/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}`", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/invert-kv#readme", - "keywords": [ - "object", - "key", - "value", - "kv", - "invert" - ], - "license": "MIT", - "name": "invert-kv", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/invert-kv.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/invert-kv/readme.md b/deps/npm/node_modules/invert-kv/readme.md deleted file mode 100644 index 365a97997cac3f..00000000000000 --- a/deps/npm/node_modules/invert-kv/readme.md +++ /dev/null @@ -1,25 +0,0 @@ -# invert-kv [![Build Status](https://travis-ci.org/sindresorhus/invert-kv.svg?branch=master)](https://travis-ci.org/sindresorhus/invert-kv) - -> Invert the key/value of an object. Example: `{foo: 'bar'}` → `{bar: 'foo'}` - - -## Install - -``` -$ npm install invert-kv -``` - - -## Usage - -```js -const invertKv = require('invert-kv'); - -invertKv({foo: 'bar', unicorn: 'rainbow'}); -//=> {bar: 'foo', rainbow: 'unicorn'} -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/lcid/index.js b/deps/npm/node_modules/lcid/index.js deleted file mode 100644 index b666ef00a4504c..00000000000000 --- a/deps/npm/node_modules/lcid/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; -const invertKv = require('invert-kv'); -const all = require('./lcid.json'); - -const inverted = invertKv(all); - -exports.from = lcidCode => { - if (typeof lcidCode !== 'number') { - throw new TypeError('Expected a number'); - } - - return inverted[lcidCode]; -}; - -exports.to = localeId => { - if (typeof localeId !== 'string') { - throw new TypeError('Expected a string'); - } - - return all[localeId]; -}; - -exports.all = all; diff --git a/deps/npm/node_modules/lcid/lcid.json b/deps/npm/node_modules/lcid/lcid.json deleted file mode 100644 index 9c89f6a496548d..00000000000000 --- a/deps/npm/node_modules/lcid/lcid.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "af_ZA": 1078, - "am_ET": 1118, - "ar_AE": 14337, - "ar_BH": 15361, - "ar_DZ": 5121, - "ar_EG": 3073, - "ar_IQ": 2049, - "ar_JO": 11265, - "ar_KW": 13313, - "ar_LB": 12289, - "ar_LY": 4097, - "ar_MA": 6145, - "ar_OM": 8193, - "ar_QA": 16385, - "ar_SA": 1025, - "ar_SY": 10241, - "ar_TN": 7169, - "ar_YE": 9217, - "arn_CL": 1146, - "as_IN": 1101, - "az_AZ": 2092, - "ba_RU": 1133, - "be_BY": 1059, - "bg_BG": 1026, - "bn_IN": 1093, - "bo_BT": 2129, - "bo_CN": 1105, - "br_FR": 1150, - "bs_BA": 8218, - "ca_ES": 1027, - "co_FR": 1155, - "cs_CZ": 1029, - "cy_GB": 1106, - "da_DK": 1030, - "de_AT": 3079, - "de_CH": 2055, - "de_DE": 1031, - "de_LI": 5127, - "de_LU": 4103, - "div_MV": 1125, - "dsb_DE": 2094, - "el_GR": 1032, - "en_AU": 3081, - "en_BZ": 10249, - "en_CA": 4105, - "en_CB": 9225, - "en_GB": 2057, - "en_IE": 6153, - "en_IN": 18441, - "en_JA": 8201, - "en_MY": 17417, - "en_NZ": 5129, - "en_PH": 13321, - "en_TT": 11273, - "en_US": 1033, - "en_ZA": 7177, - "en_ZW": 12297, - "es_AR": 11274, - "es_BO": 16394, - "es_CL": 13322, - "es_CO": 9226, - "es_CR": 5130, - "es_DO": 7178, - "es_EC": 12298, - "es_ES": 3082, - "es_GT": 4106, - "es_HN": 18442, - "es_MX": 2058, - "es_NI": 19466, - "es_PA": 6154, - "es_PE": 10250, - "es_PR": 20490, - "es_PY": 15370, - "es_SV": 17418, - "es_UR": 14346, - "es_US": 21514, - "es_VE": 8202, - "et_EE": 1061, - "eu_ES": 1069, - "fa_IR": 1065, - "fi_FI": 1035, - "fil_PH": 1124, - "fo_FO": 1080, - "fr_BE": 2060, - "fr_CA": 3084, - "fr_CH": 4108, - "fr_FR": 1036, - "fr_LU": 5132, - "fr_MC": 6156, - "fy_NL": 1122, - "ga_IE": 2108, - "gbz_AF": 1164, - "gl_ES": 1110, - "gsw_FR": 1156, - "gu_IN": 1095, - "ha_NG": 1128, - "he_IL": 1037, - "hi_IN": 1081, - "hr_BA": 4122, - "hr_HR": 1050, - "hu_HU": 1038, - "hy_AM": 1067, - "id_ID": 1057, - "ii_CN": 1144, - "is_IS": 1039, - "it_CH": 2064, - "it_IT": 1040, - "iu_CA": 2141, - "ja_JP": 1041, - "ka_GE": 1079, - "kh_KH": 1107, - "kk_KZ": 1087, - "kl_GL": 1135, - "kn_IN": 1099, - "ko_KR": 1042, - "kok_IN": 1111, - "ky_KG": 1088, - "lb_LU": 1134, - "lo_LA": 1108, - "lt_LT": 1063, - "lv_LV": 1062, - "mi_NZ": 1153, - "mk_MK": 1071, - "ml_IN": 1100, - "mn_CN": 2128, - "mn_MN": 1104, - "moh_CA": 1148, - "mr_IN": 1102, - "ms_BN": 2110, - "ms_MY": 1086, - "mt_MT": 1082, - "my_MM": 1109, - "nb_NO": 1044, - "ne_NP": 1121, - "nl_BE": 2067, - "nl_NL": 1043, - "nn_NO": 2068, - "ns_ZA": 1132, - "oc_FR": 1154, - "or_IN": 1096, - "pa_IN": 1094, - "pl_PL": 1045, - "ps_AF": 1123, - "pt_BR": 1046, - "pt_PT": 2070, - "qut_GT": 1158, - "quz_BO": 1131, - "quz_EC": 2155, - "quz_PE": 3179, - "rm_CH": 1047, - "ro_RO": 1048, - "ru_RU": 1049, - "rw_RW": 1159, - "sa_IN": 1103, - "sah_RU": 1157, - "se_FI": 3131, - "se_NO": 1083, - "se_SE": 2107, - "si_LK": 1115, - "sk_SK": 1051, - "sl_SI": 1060, - "sma_NO": 6203, - "sma_SE": 7227, - "smj_NO": 4155, - "smj_SE": 5179, - "smn_FI": 9275, - "sms_FI": 8251, - "sq_AL": 1052, - "sr_BA": 7194, - "sr_SP": 3098, - "sv_FI": 2077, - "sv_SE": 1053, - "sw_KE": 1089, - "syr_SY": 1114, - "ta_IN": 1097, - "te_IN": 1098, - "tg_TJ": 1064, - "th_TH": 1054, - "tk_TM": 1090, - "tmz_DZ": 2143, - "tn_ZA": 1074, - "tr_TR": 1055, - "tt_RU": 1092, - "ug_CN": 1152, - "uk_UA": 1058, - "ur_IN": 2080, - "ur_PK": 1056, - "uz_UZ": 2115, - "vi_VN": 1066, - "wen_DE": 1070, - "wo_SN": 1160, - "xh_ZA": 1076, - "yo_NG": 1130, - "zh_CHS": 4, - "zh_CHT": 31748, - "zh_CN": 2052, - "zh_HK": 3076, - "zh_MO": 5124, - "zh_SG": 4100, - "zh_TW": 1028, - "zu_ZA": 1077 -} diff --git a/deps/npm/node_modules/lcid/package.json b/deps/npm/node_modules/lcid/package.json deleted file mode 100644 index 3de023722441e6..00000000000000 --- a/deps/npm/node_modules/lcid/package.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_from": "lcid@^2.0.0", - "_id": "lcid@2.0.0", - "_inBundle": false, - "_integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "_location": "/lcid", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "lcid@^2.0.0", - "name": "lcid", - "escapedName": "lcid", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/os-locale" - ], - "_resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "_shasum": "6ef5d2df60e52f82eb228a4c373e8d1f397253cf", - "_spec": "lcid@^2.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/os-locale", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/lcid/issues" - }, - "bundleDependencies": false, - "dependencies": { - "invert-kv": "^2.0.0" - }, - "deprecated": false, - "description": "Mapping between standard locale identifiers and Windows locale identifiers (LCID)", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "lcid.json" - ], - "homepage": "https://github.com/sindresorhus/lcid#readme", - "keywords": [ - "lcid", - "locale", - "string", - "str", - "id", - "identifier", - "windows", - "language", - "lang", - "map", - "mapping", - "convert", - "json", - "bcp47", - "ietf", - "tag" - ], - "license": "MIT", - "name": "lcid", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/lcid.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/lcid/readme.md b/deps/npm/node_modules/lcid/readme.md deleted file mode 100644 index 2b1aa798b69301..00000000000000 --- a/deps/npm/node_modules/lcid/readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# lcid [![Build Status](https://travis-ci.org/sindresorhus/lcid.svg?branch=master)](https://travis-ci.org/sindresorhus/lcid) - -> Mapping between [standard locale identifiers](https://en.wikipedia.org/wiki/Locale_(computer_software)) and [Windows locale identifiers (LCID)](http://en.wikipedia.org/wiki/Locale#Specifics_for_Microsoft_platforms) - -Based on the [mapping](https://github.com/python/cpython/blob/8f7bb100d0fa7fb2714f3953b5b627878277c7c6/Lib/locale.py#L1465-L1674) used in the Python standard library. - -The mapping itself is just a [JSON file](lcid.json) and can be used wherever. - - -## Install - -``` -$ npm install lcid -``` - - -## Usage - -```js -const lcid = require('lcid'); - -lcid.from(1044); -//=> 'nb_NO' - -lcid.to('nb_NO'); -//=> 1044 - -lcid.all; -//=> {'af_ZA': 1078, ...} -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/libcipm/CHANGELOG.md b/deps/npm/node_modules/libcipm/CHANGELOG.md index 80411f300698c4..985d6df39e5f76 100644 --- a/deps/npm/node_modules/libcipm/CHANGELOG.md +++ b/deps/npm/node_modules/libcipm/CHANGELOG.md @@ -2,6 +2,16 @@ 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. + +## [4.0.8](https://github.com/npm/libcipm/compare/v4.0.7...v4.0.8) (2020-03-25) + + +### Bug Fixes + +* add repo to bin pkg, bump to 2.0.1 ([ed2d735](https://github.com/npm/libcipm/commit/ed2d735)) + + + ## [4.0.7](https://github.com/npm/libcipm/compare/v4.0.4...v4.0.7) (2019-10-09) diff --git a/deps/npm/node_modules/libcipm/README.md b/deps/npm/node_modules/libcipm/README.md index 3dd9cbe149220a..2316f0eaabf855 100644 --- a/deps/npm/node_modules/libcipm/README.md +++ b/deps/npm/node_modules/libcipm/README.md @@ -1,4 +1,9 @@ -[![npm](https://img.shields.io/npm/v/libcipm.svg)](https://npm.im/libcipm) [![license](https://img.shields.io/npm/l/libcipm.svg)](https://npm.im/libcipm) [![Travis](https://img.shields.io/travis/npm/libcipm.svg)](https://travis-ci.org/npm/libcipm) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/libcipm?svg=true)](https://ci.appveyor.com/project/npm/libcipm) [![Coverage Status](https://coveralls.io/repos/github/npm/libcipm/badge.svg?branch=latest)](https://coveralls.io/github/npm/libcipm?branch=latest) +# Note: pending imminent deprecation + +**This module will be deprecated once npm v7 is released. Please do not rely +on it more than absolutely necessary.** + +---- [`libcipm`](https://github.com/npm/libcipm) installs npm projects in a way that's optimized for continuous integration/deployment/etc scenarios. It gives up @@ -16,7 +21,6 @@ For documentation about the associated command-line tool, see ## Table of Contents * [Features](#features) -* [Contributing](#contributing) * [API](#api) ### Features @@ -26,12 +30,3 @@ For documentation about the associated command-line tool, see * blazing fast * npm-compatible caching * errors if `package.json` and `package-lock.json` are out of sync, instead of fixing it like npm does. Essentially provides a `--frozen` install. - -### Contributing - -The libcipm 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. diff --git a/deps/npm/node_modules/libcipm/package.json b/deps/npm/node_modules/libcipm/package.json index 1411b409500048..f2317ba5f5fe83 100644 --- a/deps/npm/node_modules/libcipm/package.json +++ b/deps/npm/node_modules/libcipm/package.json @@ -1,28 +1,28 @@ { - "_from": "libcipm@4.0.7", - "_id": "libcipm@4.0.7", + "_from": "libcipm@4.0.8", + "_id": "libcipm@4.0.8", "_inBundle": false, - "_integrity": "sha512-fTq33otU3PNXxxCTCYCYe7V96o59v/o7bvtspmbORXpgFk+wcWrGf5x6tBgui5gCed/45/wtPomBsZBYm5KbIw==", + "_integrity": "sha512-IN3hh2yDJQtZZ5paSV4fbvJg4aHxCCg5tcZID/dSVlTuUiWktsgaldVljJv6Z5OUlYspx6xQkbR0efNodnIrOA==", "_location": "/libcipm", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "libcipm@4.0.7", + "raw": "libcipm@4.0.8", "name": "libcipm", "escapedName": "libcipm", - "rawSpec": "4.0.7", + "rawSpec": "4.0.8", "saveSpec": null, - "fetchSpec": "4.0.7" + "fetchSpec": "4.0.8" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/libcipm/-/libcipm-4.0.7.tgz", - "_shasum": "76cd675c98bdaae64db88b782b01b804b6d02c8a", - "_spec": "libcipm@4.0.7", - "_where": "/Users/mperrotte/npminc/cli", + "_resolved": "https://registry.npmjs.org/libcipm/-/libcipm-4.0.8.tgz", + "_shasum": "dcea4919e10dfbce420327e63901613b9141bc89", + "_spec": "libcipm@4.0.8", + "_where": "/Users/claudiahdz/npm/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -46,7 +46,7 @@ "find-npm-prefix": "^1.0.2", "graceful-fs": "^4.1.11", "ini": "^1.3.5", - "lock-verify": "^2.0.2", + "lock-verify": "^2.1.0", "mkdirp": "^0.5.1", "npm-lifecycle": "^3.0.0", "npm-logical-tree": "^1.2.1", @@ -65,9 +65,7 @@ "standard": "^11.0.1", "standard-version": "^4.4.0", "tacks": "^1.2.6", - "tap": "^12.0.1", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" + "tap": "^12.0.1" }, "files": [ "*.js", @@ -92,9 +90,7 @@ "prerelease": "npm t", "pretest": "standard", "release": "standard-version -s", - "test": "tap -J --nyc-arg=--all --coverage test/specs", - "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'" + "test": "tap -J --nyc-arg=--all --coverage test/specs" }, - "version": "4.0.7" + "version": "4.0.8" } diff --git a/deps/npm/node_modules/libnpx/CHANGELOG.md b/deps/npm/node_modules/libnpx/CHANGELOG.md index 74da62235d696e..d8ea8b4e874116 100644 --- a/deps/npm/node_modules/libnpx/CHANGELOG.md +++ b/deps/npm/node_modules/libnpx/CHANGELOG.md @@ -2,6 +2,16 @@ 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.2.4](https://github.com/npm/npx/compare/v10.2.3...v10.2.4) (2020-07-20) + + + + +## [10.2.3](https://github.com/npm/npx/compare/v10.2.2...v10.2.3) (2020-03-24) + + + ## [10.2.2](https://github.com/npm/npx/compare/v10.2.1...v10.2.2) (2020-01-28) diff --git a/deps/npm/node_modules/libnpx/libnpx.1 b/deps/npm/node_modules/libnpx/libnpx.1 index aea3ffe8f41922..1f5669d3c9d76e 100644 --- a/deps/npm/node_modules/libnpx/libnpx.1 +++ b/deps/npm/node_modules/libnpx/libnpx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "January 2020" "libnpx@10.2.1" "User Commands" +.TH "NPX" "1" "July 2020" "libnpx@10.2.3" "User Commands" .SH "NAME" \fBnpx\fR \- execute npm package binaries .SH SYNOPSIS diff --git a/deps/npm/node_modules/libnpx/package.json b/deps/npm/node_modules/libnpx/package.json index 9b9949cd3ca4f4..53073ae79a2a03 100644 --- a/deps/npm/node_modules/libnpx/package.json +++ b/deps/npm/node_modules/libnpx/package.json @@ -1,28 +1,28 @@ { - "_from": "libnpx@10.2.2", - "_id": "libnpx@10.2.2", + "_from": "libnpx@10.2.4", + "_id": "libnpx@10.2.4", "_inBundle": false, - "_integrity": "sha512-ujaYToga1SAX5r7FU5ShMFi88CWpY75meNZtr6RtEyv4l2ZK3+Wgvxq2IqlwWBiDZOqhumdeiocPS1aKrCMe3A==", + "_integrity": "sha512-BPc0D1cOjBeS8VIBKUu5F80s6njm0wbVt7CsGMrIcJ+SI7pi7V0uVPGpEMH9H5L8csOcclTxAXFE2VAsJXUhfA==", "_location": "/libnpx", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "libnpx@10.2.2", + "raw": "libnpx@10.2.4", "name": "libnpx", "escapedName": "libnpx", - "rawSpec": "10.2.2", + "rawSpec": "10.2.4", "saveSpec": null, - "fetchSpec": "10.2.2" + "fetchSpec": "10.2.4" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/libnpx/-/libnpx-10.2.2.tgz", - "_shasum": "5a4171b9b92dd031463ef66a4af9f5cbd6b09572", - "_spec": "libnpx@10.2.2", - "_where": "/Users/mperrotte/npminc/cli", + "_resolved": "https://registry.npmjs.org/libnpx/-/libnpx-10.2.4.tgz", + "_shasum": "ef0e3258e29aef2ec7ee3276115e20e67f67d4ee", + "_spec": "libnpx@10.2.4", + "_where": "/Users/claudiahdz/npm/cli", "author": { "name": "Kat Marchán", "email": "kzm@sykosomatic.org" @@ -47,7 +47,7 @@ "update-notifier": "^2.3.0", "which": "^1.3.0", "y18n": "^4.0.0", - "yargs": "^11.0.0" + "yargs": "^14.2.3" }, "deprecated": false, "description": "support library for npx -- an tool for executing npm-based packages.", @@ -62,9 +62,7 @@ "standard": "^11.0.0", "standard-version": "^4.3.0", "tacks": "^1.2.6", - "tap": "^11.1.2", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" + "tap": "^11.1.2" }, "engines": { "node": ">=4" @@ -101,9 +99,7 @@ "pretest": "standard *.js test bin/*.js locales", "publish-bin": "npm run bin && cd bin && npm publish", "release": "standard-version -s", - "test": "cross-env NPX_UPDATE_LOCALE_FILES=true LC_ALL=en nyc --all -- tap -J 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'" + "test": "cross-env NPX_UPDATE_LOCALE_FILES=true LC_ALL=en nyc --all -- tap -J test/*.js" }, - "version": "10.2.2" + "version": "10.2.4" } diff --git a/deps/npm/node_modules/locate-path/index.js b/deps/npm/node_modules/locate-path/index.js deleted file mode 100644 index 32b108d19b813f..00000000000000 --- a/deps/npm/node_modules/locate-path/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const path = require('path'); -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -module.exports = (iterable, opts) => { - opts = Object.assign({ - cwd: process.cwd() - }, opts); - - return pLocate(iterable, el => pathExists(path.resolve(opts.cwd, el)), opts); -}; - -module.exports.sync = (iterable, opts) => { - opts = Object.assign({ - cwd: process.cwd() - }, opts); - - for (const el of iterable) { - if (pathExists.sync(path.resolve(opts.cwd, el))) { - return el; - } - } -}; diff --git a/deps/npm/node_modules/map-age-cleaner/dist/index.d.ts b/deps/npm/node_modules/map-age-cleaner/dist/index.d.ts deleted file mode 100644 index fbf5ce08f5fc18..00000000000000 --- a/deps/npm/node_modules/map-age-cleaner/dist/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -interface Entry { - [key: string]: any; -} -interface MaxAgeEntry extends Entry { - maxAge: number; -} -/** - * Automatically cleanup the items in the provided `map`. The property of the expiration timestamp should be named `maxAge`. - * - * @param map - Map instance which should be cleaned up. - */ -export default function mapAgeCleaner(map: Map): any; -/** - * Automatically cleanup the items in the provided `map`. - * - * @param map - Map instance which should be cleaned up. - * @param property - Name of the property which olds the expiry timestamp. - */ -export default function mapAgeCleaner(map: Map, property: string): any; -export {}; diff --git a/deps/npm/node_modules/map-age-cleaner/dist/index.js b/deps/npm/node_modules/map-age-cleaner/dist/index.js deleted file mode 100644 index ff137dec85f56d..00000000000000 --- a/deps/npm/node_modules/map-age-cleaner/dist/index.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const p_defer_1 = __importDefault(require("p-defer")); -function mapAgeCleaner(map, property = 'maxAge') { - let processingKey; - let processingTimer; - let processingDeferred; - const cleanup = () => __awaiter(this, void 0, void 0, function* () { - if (processingKey !== undefined) { - // If we are already processing an item, we can safely exit - return; - } - const setupTimer = (item) => __awaiter(this, void 0, void 0, function* () { - processingDeferred = p_defer_1.default(); - const delay = item[1][property] - Date.now(); - if (delay <= 0) { - // Remove the item immediately if the delay is equal to or below 0 - map.delete(item[0]); - processingDeferred.resolve(); - return; - } - // Keep track of the current processed key - processingKey = item[0]; - processingTimer = setTimeout(() => { - // Remove the item when the timeout fires - map.delete(item[0]); - if (processingDeferred) { - processingDeferred.resolve(); - } - }, delay); - // tslint:disable-next-line:strict-type-predicates - if (typeof processingTimer.unref === 'function') { - // Don't hold up the process from exiting - processingTimer.unref(); - } - return processingDeferred.promise; - }); - try { - for (const entry of map) { - yield setupTimer(entry); - } - } - catch (_a) { - // Do nothing if an error occurs, this means the timer was cleaned up and we should stop processing - } - processingKey = undefined; - }); - const reset = () => { - processingKey = undefined; - if (processingTimer !== undefined) { - clearTimeout(processingTimer); - processingTimer = undefined; - } - if (processingDeferred !== undefined) { // tslint:disable-line:early-exit - processingDeferred.reject(undefined); - processingDeferred = undefined; - } - }; - const originalSet = map.set.bind(map); - map.set = (key, value) => { - if (map.has(key)) { - // If the key already exist, remove it so we can add it back at the end of the map. - map.delete(key); - } - // Call the original `map.set` - const result = originalSet(key, value); - // If we are already processing a key and the key added is the current processed key, stop processing it - if (processingKey && processingKey === key) { - reset(); - } - // Always run the cleanup method in case it wasn't started yet - cleanup(); // tslint:disable-line:no-floating-promises - return result; - }; - cleanup(); // tslint:disable-line:no-floating-promises - return map; -} -exports.default = mapAgeCleaner; -// Add support for CJS -module.exports = mapAgeCleaner; -module.exports.default = mapAgeCleaner; diff --git a/deps/npm/node_modules/map-age-cleaner/package.json b/deps/npm/node_modules/map-age-cleaner/package.json deleted file mode 100644 index fc6be6aac5f145..00000000000000 --- a/deps/npm/node_modules/map-age-cleaner/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_args": [ - [ - "map-age-cleaner@0.1.3", - "/Users/mperrotte/npminc/cli" - ] - ], - "_development": true, - "_from": "map-age-cleaner@0.1.3", - "_id": "map-age-cleaner@0.1.3", - "_inBundle": false, - "_integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "_location": "/map-age-cleaner", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "map-age-cleaner@0.1.3", - "name": "map-age-cleaner", - "escapedName": "map-age-cleaner", - "rawSpec": "0.1.3", - "saveSpec": null, - "fetchSpec": "0.1.3" - }, - "_requiredBy": [ - "/nyc/mem" - ], - "_resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "_spec": "0.1.3", - "_where": "/Users/mperrotte/npminc/cli", - "author": { - "name": "Sam Verschueren", - "email": "sam.verschueren@gmail.com", - "url": "github.com/SamVerschueren" - }, - "bugs": { - "url": "https://github.com/SamVerschueren/map-age-cleaner/issues" - }, - "dependencies": { - "p-defer": "^1.0.0" - }, - "description": "Automatically cleanup expired items in a Map", - "devDependencies": { - "@types/delay": "^2.0.1", - "@types/node": "^10.7.1", - "ava": "^0.25.0", - "codecov": "^3.0.0", - "del-cli": "^1.1.0", - "delay": "^3.0.0", - "nyc": "^12.0.0", - "tslint": "^5.11.0", - "tslint-xo": "^0.9.0", - "typescript": "^3.0.1" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "dist/index.js", - "dist/index.d.ts" - ], - "homepage": "https://github.com/SamVerschueren/map-age-cleaner#readme", - "keywords": [ - "map", - "age", - "cleaner", - "maxage", - "expire", - "expiration", - "expiring" - ], - "license": "MIT", - "main": "dist/index.js", - "name": "map-age-cleaner", - "nyc": { - "exclude": [ - "dist/test.js" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/SamVerschueren/map-age-cleaner.git" - }, - "scripts": { - "build": "npm run clean && tsc", - "clean": "del-cli dist", - "lint": "tslint --format stylish --project .", - "prepublishOnly": "npm run build", - "pretest": "npm run build -- --sourceMap", - "test": "npm run lint && nyc ava dist/test.js" - }, - "sideEffects": false, - "typings": "dist/index.d.ts", - "version": "0.1.3" -} diff --git a/deps/npm/node_modules/map-age-cleaner/readme.md b/deps/npm/node_modules/map-age-cleaner/readme.md deleted file mode 100644 index 471d93353a07ec..00000000000000 --- a/deps/npm/node_modules/map-age-cleaner/readme.md +++ /dev/null @@ -1,67 +0,0 @@ -# map-age-cleaner - -[![Build Status](https://travis-ci.org/SamVerschueren/map-age-cleaner.svg?branch=master)](https://travis-ci.org/SamVerschueren/map-age-cleaner) [![codecov](https://codecov.io/gh/SamVerschueren/map-age-cleaner/badge.svg?branch=master)](https://codecov.io/gh/SamVerschueren/map-age-cleaner?branch=master) - -> Automatically cleanup expired items in a Map - - -## Install - -``` -$ npm install map-age-cleaner -``` - - -## Usage - -```js -import mapAgeCleaner from 'map-age-cleaner'; - -const map = new Map([ - ['unicorn', {data: '🦄', maxAge: Date.now() + 1000}] -]); - -mapAgeCleaner(map); - -map.has('unicorn'); -//=> true - -// Wait for 1 second... - -map.has('unicorn'); -//=> false -``` - -> **Note**: Items have to be ordered ascending based on the expiry property. This means that the item which will be expired first, should be in the first position of the `Map`. - - -## API - -### mapAgeCleaner(map, [property]) - -Returns the `Map` instance. - -#### map - -Type: `Map` - -Map instance which should be cleaned up. - -#### property - -Type: `string`
-Default: `maxAge` - -Name of the property which olds the expiry timestamp. - - -## Related - -- [expiry-map](https://github.com/SamVerschueren/expiry-map) - A `Map` implementation with expirable items -- [expiry-set](https://github.com/SamVerschueren/expiry-set) - A `Set` implementation with expirable keys -- [mem](https://github.com/sindresorhus/mem) - Memoize functions - - -## License - -MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/deps/npm/node_modules/mem/index.d.ts b/deps/npm/node_modules/mem/index.d.ts deleted file mode 100644 index 786625520b2034..00000000000000 --- a/deps/npm/node_modules/mem/index.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -declare namespace mem { - interface CacheStorage { - has(key: KeyType): boolean; - get(key: KeyType): ValueType | undefined; - set(key: KeyType, value: ValueType): void; - delete(key: KeyType): void; - clear?: () => void; - } - - interface Options< - ArgumentsType extends unknown[], - CacheKeyType extends unknown, - ReturnType extends unknown - > { - /** - Milliseconds until the cache expires. - - @default Infinity - */ - readonly maxAge?: number; - - /** - Determines the cache key for storing the result based on the function arguments. By default, if there's only one argument and it's a [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive), it's used directly as a key, otherwise it's all the function arguments JSON stringified as an array. - - You could for example change it to only cache on the first argument `x => JSON.stringify(x)`. - */ - readonly cacheKey?: (...arguments: ArgumentsType) => CacheKeyType; - - /** - Use a different cache storage. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache. - - @default new Map() - */ - readonly cache?: CacheStorage; - - /** - Cache rejected promises. - - @default false - */ - readonly cachePromiseRejection?: boolean; - } -} - -declare const mem: { - /** - [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input. - - @param fn - Function to be memoized. - - @example - ``` - import mem = require('mem'); - - let i = 0; - const counter = () => ++i; - const memoized = mem(counter); - - memoized('foo'); - //=> 1 - - // Cached as it's the same arguments - memoized('foo'); - //=> 1 - - // Not cached anymore as the arguments changed - memoized('bar'); - //=> 2 - - memoized('bar'); - //=> 2 - ``` - */ - < - ArgumentsType extends unknown[], - ReturnType extends unknown, - CacheKeyType extends unknown - >( - fn: (...arguments: ArgumentsType) => ReturnType, - options?: mem.Options - ): (...arguments: ArgumentsType) => ReturnType; - - /** - Clear all cached data of a memoized function. - - @param fn - Memoized function. - */ - clear( - fn: (...arguments: ArgumentsType) => ReturnType - ): void; - - // TODO: Remove this for the next major release - default: typeof mem; -}; - -export = mem; diff --git a/deps/npm/node_modules/mem/index.js b/deps/npm/node_modules/mem/index.js deleted file mode 100644 index 51faf012c2fc44..00000000000000 --- a/deps/npm/node_modules/mem/index.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; -const mimicFn = require('mimic-fn'); -const isPromise = require('p-is-promise'); -const mapAgeCleaner = require('map-age-cleaner'); - -const cacheStore = new WeakMap(); - -const defaultCacheKey = (...arguments_) => { - if (arguments_.length === 0) { - return '__defaultKey'; - } - - if (arguments_.length === 1) { - const [firstArgument] = arguments_; - if ( - firstArgument === null || - firstArgument === undefined || - (typeof firstArgument !== 'function' && typeof firstArgument !== 'object') - ) { - return firstArgument; - } - } - - return JSON.stringify(arguments_); -}; - -const mem = (fn, options) => { - options = Object.assign({ - cacheKey: defaultCacheKey, - cache: new Map(), - cachePromiseRejection: false - }, options); - - if (typeof options.maxAge === 'number') { - mapAgeCleaner(options.cache); - } - - const {cache} = options; - options.maxAge = options.maxAge || 0; - - const setData = (key, data) => { - cache.set(key, { - data, - maxAge: Date.now() + options.maxAge - }); - }; - - const memoized = function (...arguments_) { - const key = options.cacheKey(...arguments_); - - if (cache.has(key)) { - return cache.get(key).data; - } - - const cacheItem = fn.call(this, ...arguments_); - - setData(key, cacheItem); - - if (isPromise(cacheItem) && options.cachePromiseRejection === false) { - // Remove rejected promises from cache unless `cachePromiseRejection` is set to `true` - cacheItem.catch(() => cache.delete(key)); - } - - return cacheItem; - }; - - try { - // The below call will throw in some host environments - // See https://github.com/sindresorhus/mimic-fn/issues/10 - mimicFn(memoized, fn); - } catch (_) {} - - cacheStore.set(memoized, options.cache); - - return memoized; -}; - -module.exports = mem; -// TODO: Remove this for the next major release -module.exports.default = mem; - -module.exports.clear = fn => { - const cache = cacheStore.get(fn); - - if (cache && typeof cache.clear === 'function') { - cache.clear(); - } -}; diff --git a/deps/npm/node_modules/mem/node_modules/mimic-fn/index.d.ts b/deps/npm/node_modules/mem/node_modules/mimic-fn/index.d.ts deleted file mode 100644 index b4047d58902ebf..00000000000000 --- a/deps/npm/node_modules/mem/node_modules/mimic-fn/index.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -declare const mimicFn: { - /** - Make a function mimic another one. It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set. - - @param to - Mimicking function. - @param from - Function to mimic. - @returns The modified `to` function. - - @example - ``` - import mimicFn = require('mimic-fn'); - - function foo() {} - foo.unicorn = '🦄'; - - function wrapper() { - return foo(); - } - - console.log(wrapper.name); - //=> 'wrapper' - - mimicFn(wrapper, foo); - - console.log(wrapper.name); - //=> 'foo' - - console.log(wrapper.unicorn); - //=> '🦄' - ``` - */ - < - ArgumentsType extends unknown[], - ReturnType, - FunctionType extends (...arguments: ArgumentsType) => ReturnType - >( - to: (...arguments: ArgumentsType) => ReturnType, - from: FunctionType - ): FunctionType; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function mimicFn< - // ArgumentsType extends unknown[], - // ReturnType, - // FunctionType extends (...arguments: ArgumentsType) => ReturnType - // >( - // to: (...arguments: ArgumentsType) => ReturnType, - // from: FunctionType - // ): FunctionType; - // export = mimicFn; - default: typeof mimicFn; -}; - -export = mimicFn; diff --git a/deps/npm/node_modules/mem/node_modules/mimic-fn/index.js b/deps/npm/node_modules/mem/node_modules/mimic-fn/index.js deleted file mode 100644 index 1a597051750da2..00000000000000 --- a/deps/npm/node_modules/mem/node_modules/mimic-fn/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -const mimicFn = (to, from) => { - for (const prop of Reflect.ownKeys(from)) { - Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); - } - - return to; -}; - -module.exports = mimicFn; -// TODO: Remove this for the next major release -module.exports.default = mimicFn; diff --git a/deps/npm/node_modules/mem/node_modules/mimic-fn/package.json b/deps/npm/node_modules/mem/node_modules/mimic-fn/package.json deleted file mode 100644 index b4970a28d40c8a..00000000000000 --- a/deps/npm/node_modules/mem/node_modules/mimic-fn/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_from": "mimic-fn@^2.0.0", - "_id": "mimic-fn@2.1.0", - "_inBundle": false, - "_integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "_location": "/mem/mimic-fn", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "mimic-fn@^2.0.0", - "name": "mimic-fn", - "escapedName": "mimic-fn", - "rawSpec": "^2.0.0", - "saveSpec": null, - "fetchSpec": "^2.0.0" - }, - "_requiredBy": [ - "/mem" - ], - "_resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "_shasum": "7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b", - "_spec": "mimic-fn@^2.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/mem", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/mimic-fn/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Make a function mimic another one", - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.1", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/mimic-fn#readme", - "keywords": [ - "function", - "mimic", - "imitate", - "rename", - "copy", - "inherit", - "properties", - "name", - "func", - "fn", - "set", - "infer", - "change" - ], - "license": "MIT", - "name": "mimic-fn", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/mimic-fn.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.1.0" -} diff --git a/deps/npm/node_modules/mem/node_modules/mimic-fn/readme.md b/deps/npm/node_modules/mem/node_modules/mimic-fn/readme.md deleted file mode 100644 index 0ef8a13d7e0d95..00000000000000 --- a/deps/npm/node_modules/mem/node_modules/mimic-fn/readme.md +++ /dev/null @@ -1,69 +0,0 @@ -# mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn) - -> Make a function mimic another one - -Useful when you wrap a function in another function and like to preserve the original name and other properties. - - -## Install - -``` -$ npm install mimic-fn -``` - - -## Usage - -```js -const mimicFn = require('mimic-fn'); - -function foo() {} -foo.unicorn = '🦄'; - -function wrapper() { - return foo(); -} - -console.log(wrapper.name); -//=> 'wrapper' - -mimicFn(wrapper, foo); - -console.log(wrapper.name); -//=> 'foo' - -console.log(wrapper.unicorn); -//=> '🦄' -``` - - -## API - -It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set. - -### mimicFn(to, from) - -Modifies the `to` function and returns it. - -#### to - -Type: `Function` - -Mimicking function. - -#### from - -Type: `Function` - -Function to mimic. - - -## Related - -- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function -- [keep-func-props](https://github.com/ehmicky/keep-func-props) - Wrap a function without changing its name, length and other properties - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/mem/package.json b/deps/npm/node_modules/mem/package.json deleted file mode 100644 index eedf07469c4c3c..00000000000000 --- a/deps/npm/node_modules/mem/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "mem@^4.0.0", - "_id": "mem@4.3.0", - "_inBundle": false, - "_integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", - "_location": "/mem", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "mem@^4.0.0", - "name": "mem", - "escapedName": "mem", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/os-locale" - ], - "_resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "_shasum": "461af497bc4ae09608cdb2e60eefb69bff744178", - "_spec": "mem@^4.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/os-locale", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/mem/issues" - }, - "bundleDependencies": false, - "dependencies": { - "map-age-cleaner": "^0.1.1", - "mimic-fn": "^2.0.0", - "p-is-promise": "^2.0.0" - }, - "deprecated": false, - "description": "Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input", - "devDependencies": { - "ava": "^1.4.1", - "delay": "^4.1.0", - "tsd": "^0.7.1", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/mem#readme", - "keywords": [ - "memoize", - "function", - "mem", - "memoization", - "cache", - "caching", - "optimize", - "performance", - "ttl", - "expire", - "promise" - ], - "license": "MIT", - "name": "mem", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/mem.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "4.3.0" -} diff --git a/deps/npm/node_modules/mem/readme.md b/deps/npm/node_modules/mem/readme.md deleted file mode 100644 index add4222b62d71a..00000000000000 --- a/deps/npm/node_modules/mem/readme.md +++ /dev/null @@ -1,167 +0,0 @@ -# mem [![Build Status](https://travis-ci.org/sindresorhus/mem.svg?branch=master)](https://travis-ci.org/sindresorhus/mem) - -> [Memoize](https://en.wikipedia.org/wiki/Memoization) functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input - -Memory is automatically released when an item expires. - - -## Install - -``` -$ npm install mem -``` - - -## Usage - -```js -const mem = require('mem'); - -let i = 0; -const counter = () => ++i; -const memoized = mem(counter); - -memoized('foo'); -//=> 1 - -// Cached as it's the same arguments -memoized('foo'); -//=> 1 - -// Not cached anymore as the arguments changed -memoized('bar'); -//=> 2 - -memoized('bar'); -//=> 2 -``` - -##### Works fine with promise returning functions - -```js -const mem = require('mem'); - -let i = 0; -const counter = async () => ++i; -const memoized = mem(counter); - -(async () => { - console.log(await memoized()); - //=> 1 - - // The return value didn't increase as it's cached - console.log(await memoized()); - //=> 1 -})(); -``` - -```js -const mem = require('mem'); -const got = require('got'); -const delay = require('delay'); - -const memGot = mem(got, {maxAge: 1000}); - -(async () => { - await memGot('sindresorhus.com'); - - // This call is cached - await memGot('sindresorhus.com'); - - await delay(2000); - - // This call is not cached as the cache has expired - await memGot('sindresorhus.com'); -})(); -``` - - -## API - -### mem(fn, [options]) - -#### fn - -Type: `Function` - -Function to be memoized. - -#### options - -Type: `Object` - -##### maxAge - -Type: `number`
-Default: `Infinity` - -Milliseconds until the cache expires. - -##### cacheKey - -Type: `Function` - -Determines the cache key for storing the result based on the function arguments. By default, if there's only one argument and it's a [primitive](https://developer.mozilla.org/en-US/docs/Glossary/Primitive), it's used directly as a key, otherwise it's all the function arguments JSON stringified as an array. - -You could for example change it to only cache on the first argument `x => JSON.stringify(x)`. - -##### cache - -Type: `Object`
-Default: `new Map()` - -Use a different cache storage. Must implement the following methods: `.has(key)`, `.get(key)`, `.set(key, value)`, `.delete(key)`, and optionally `.clear()`. You could for example use a `WeakMap` instead or [`quick-lru`](https://github.com/sindresorhus/quick-lru) for a LRU cache. - -##### cachePromiseRejection - -Type: `boolean`
-Default: `false` - -Cache rejected promises. - -### mem.clear(fn) - -Clear all cached data of a memoized function. - -#### fn - -Type: `Function` - -Memoized function. - - -## Tips - -### Cache statistics - -If you want to know how many times your cache had a hit or a miss, you can make use of [stats-map](https://github.com/SamVerschueren/stats-map) as a replacement for the default cache. - -#### Example - -```js -const mem = require('mem'); -const StatsMap = require('stats-map'); -const got = require('got'); - -const cache = new StatsMap(); -const memGot = mem(got, {cache}); - -(async () => { - await memGot('sindresorhus.com'); - await memGot('sindresorhus.com'); - await memGot('sindresorhus.com'); - - console.log(cache.stats); - //=> {hits: 2, misses: 1} -})(); -``` - - -## Related - -- [p-memoize](https://github.com/sindresorhus/p-memoize) - Memoize promise-returning & async functions - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/nice-try/CHANGELOG.md b/deps/npm/node_modules/nice-try/CHANGELOG.md deleted file mode 100644 index 9e6baf2fb59be2..00000000000000 --- a/deps/npm/node_modules/nice-try/CHANGELOG.md +++ /dev/null @@ -1,21 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - -## [1.0.5] - 2018-08-25 - -### Changed - -- Removed `prepublish` script from `package.json` - -## [1.0.4] - 2017-08-08 - -### New - -- Added a changelog - -### Changed - -- Ignore `yarn.lock` and `package-lock.json` files \ No newline at end of file diff --git a/deps/npm/node_modules/nice-try/LICENSE b/deps/npm/node_modules/nice-try/LICENSE deleted file mode 100644 index 681c8f507b00e7..00000000000000 --- a/deps/npm/node_modules/nice-try/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Tobias Reich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/nice-try/README.md b/deps/npm/node_modules/nice-try/README.md deleted file mode 100644 index 5b83b78824a0e5..00000000000000 --- a/deps/npm/node_modules/nice-try/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# nice-try - -[![Travis Build Status](https://travis-ci.org/electerious/nice-try.svg?branch=master)](https://travis-ci.org/electerious/nice-try) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/8tqb09wrwci3xf8l?svg=true)](https://ci.appveyor.com/project/electerious/nice-try) [![Coverage Status](https://coveralls.io/repos/github/electerious/nice-try/badge.svg?branch=master)](https://coveralls.io/github/electerious/nice-try?branch=master) [![Dependencies](https://david-dm.org/electerious/nice-try.svg)](https://david-dm.org/electerious/nice-try#info=dependencies) [![Greenkeeper badge](https://badges.greenkeeper.io/electerious/nice-try.svg)](https://greenkeeper.io/) - -A function that tries to execute a function and discards any error that occurs. - -## Install - -``` -npm install nice-try -``` - -## Usage - -```js -const niceTry = require('nice-try') - -niceTry(() => JSON.parse('true')) // true -niceTry(() => JSON.parse('truee')) // undefined -niceTry() // undefined -niceTry(true) // undefined -``` - -## API - -### Parameters - -- `fn` `{Function}` Function that might or might not throw an error. - -### Returns - -- `{?*}` Return-value of the function when no error occurred. \ No newline at end of file diff --git a/deps/npm/node_modules/nice-try/package.json b/deps/npm/node_modules/nice-try/package.json deleted file mode 100644 index 787ce7a7a846e5..00000000000000 --- a/deps/npm/node_modules/nice-try/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_args": [ - [ - "nice-try@1.0.5", - "/Users/mperrotte/npminc/cli" - ] - ], - "_development": true, - "_from": "nice-try@1.0.5", - "_id": "nice-try@1.0.5", - "_inBundle": false, - "_integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "_location": "/nice-try", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "nice-try@1.0.5", - "name": "nice-try", - "escapedName": "nice-try", - "rawSpec": "1.0.5", - "saveSpec": null, - "fetchSpec": "1.0.5" - }, - "_requiredBy": [ - "/nyc/cross-spawn" - ], - "_resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "_spec": "1.0.5", - "_where": "/Users/mperrotte/npminc/cli", - "authors": [ - "Tobias Reich " - ], - "bugs": { - "url": "https://github.com/electerious/nice-try/issues" - }, - "description": "Tries to execute a function and discards any error that occurs", - "devDependencies": { - "chai": "^4.1.2", - "coveralls": "^3.0.0", - "mocha": "^5.1.1", - "nyc": "^12.0.1" - }, - "files": [ - "src" - ], - "homepage": "https://github.com/electerious/nice-try", - "keywords": [ - "try", - "catch", - "error" - ], - "license": "MIT", - "main": "src/index.js", - "name": "nice-try", - "repository": { - "type": "git", - "url": "git+https://github.com/electerious/nice-try.git" - }, - "scripts": { - "coveralls": "nyc report --reporter=text-lcov | coveralls", - "test": "nyc node_modules/mocha/bin/_mocha" - }, - "version": "1.0.5" -} diff --git a/deps/npm/node_modules/nice-try/src/index.js b/deps/npm/node_modules/nice-try/src/index.js deleted file mode 100644 index 837506f2cc2db3..00000000000000 --- a/deps/npm/node_modules/nice-try/src/index.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict' - -/** - * Tries to execute a function and discards any error that occurs. - * @param {Function} fn - Function that might or might not throw an error. - * @returns {?*} Return-value of the function when no error occurred. - */ -module.exports = function(fn) { - - try { return fn() } catch (e) {} - -} \ No newline at end of file diff --git a/deps/npm/node_modules/npm-audit-report/CHANGELOG.md b/deps/npm/node_modules/npm-audit-report/CHANGELOG.md index 941a18741b6006..58819a43b4d110 100644 --- a/deps/npm/node_modules/npm-audit-report/CHANGELOG.md +++ b/deps/npm/node_modules/npm-audit-report/CHANGELOG.md @@ -2,6 +2,11 @@ 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.3.3](https://github.com/npm/npm-audit-report/compare/v1.3.2...v1.3.3) (2020-03-26) + + + ## [1.3.2](https://github.com/npm/npm-audit-report/compare/v1.3.1...v1.3.2) (2018-12-18) diff --git a/deps/npm/node_modules/npm-audit-report/package.json b/deps/npm/node_modules/npm-audit-report/package.json index 905c0ce33da3db..dfc8bda28f844d 100644 --- a/deps/npm/node_modules/npm-audit-report/package.json +++ b/deps/npm/node_modules/npm-audit-report/package.json @@ -1,28 +1,28 @@ { - "_from": "npm-audit-report@1.3.2", - "_id": "npm-audit-report@1.3.2", + "_from": "npm-audit-report@1.3.3", + "_id": "npm-audit-report@1.3.3", "_inBundle": false, - "_integrity": "sha512-abeqS5ONyXNaZJPGAf6TOUMNdSe1Y6cpc9MLBRn+CuUoYbfdca6AxOyXVlfIv9OgKX+cacblbG5w7A6ccwoTPw==", + "_integrity": "sha512-8nH/JjsFfAWMvn474HB9mpmMjrnKb1Hx/oTAdjv4PT9iZBvBxiZ+wtDUapHCJwLqYGQVPaAfs+vL5+5k9QndXw==", "_location": "/npm-audit-report", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-audit-report@1.3.2", + "raw": "npm-audit-report@1.3.3", "name": "npm-audit-report", "escapedName": "npm-audit-report", - "rawSpec": "1.3.2", + "rawSpec": "1.3.3", "saveSpec": null, - "fetchSpec": "1.3.2" + "fetchSpec": "1.3.3" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-1.3.2.tgz", - "_shasum": "303bc78cd9e4c226415076a4f7e528c89fc77018", - "_spec": "npm-audit-report@1.3.2", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-1.3.3.tgz", + "_shasum": "8226deeb253b55176ed147592a3995442f2179ed", + "_spec": "npm-audit-report@1.3.3", + "_where": "/Users/claudiahdz/npm/cli", "author": { "name": "Adam Baldwin" }, @@ -40,9 +40,7 @@ "keyfob": "^1.0.0", "standard": "^11.0.1", "standard-version": "^4.3.0", - "tap": "^11.1.5", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" + "tap": "^11.1.5" }, "directories": { "lib": "lib", @@ -72,9 +70,7 @@ "prerelease": "npm t", "pretest": "standard", "release": "standard-version -s", - "test": "tap --100 -J --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'" + "test": "tap --100 -J --coverage test/*.js" }, - "version": "1.3.2" + "version": "1.3.3" } diff --git a/deps/npm/node_modules/npm-lifecycle/CHANGELOG.md b/deps/npm/node_modules/npm-lifecycle/CHANGELOG.md index ccdd777ee19755..cf10c2f580aced 100644 --- a/deps/npm/node_modules/npm-lifecycle/CHANGELOG.md +++ b/deps/npm/node_modules/npm-lifecycle/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [3.1.5](https://github.com/npm/lifecycle/compare/v3.1.4...v3.1.5) (2020-03-26) + + + ## [3.1.4](https://github.com/npm/lifecycle/compare/v3.1.3...v3.1.4) (2019-09-18) diff --git a/deps/npm/node_modules/npm-lifecycle/README.md b/deps/npm/node_modules/npm-lifecycle/README.md index c81d3d7a10df75..a22adf1c22421c 100644 --- a/deps/npm/node_modules/npm-lifecycle/README.md +++ b/deps/npm/node_modules/npm-lifecycle/README.md @@ -1,4 +1,15 @@ -# npm-lifecycle [![npm version](https://img.shields.io/npm/v/npm-lifecycle.svg)](https://npm.im/npm-lifecycle) [![license](https://img.shields.io/npm/l/npm-lifecycle.svg)](https://npm.im/npm-lifecycle) [![Travis](https://img.shields.io/travis/npm/npm-lifecycle/latest.svg)](https://travis-ci.org/npm/npm-lifecycle) [![AppVeyor](https://img.shields.io/appveyor/ci/npm/npm-lifecycle/latest.svg)](https://ci.appveyor.com/project/npm/npm-lifecycle) [![Coverage Status](https://coveralls.io/repos/github/npm/npm-lifecycle/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-lifecycle?branch=latest) +# Note: pending imminent deprecation + +**This module will be deprecated once npm v7 is released. Please do not rely +on it more than absolutely necessary.** + +The lifecycle script runner used in npm v7 is +[@npmcli/run-script](http://npm.im/@npmcli/run-script). Please use that +module moving forward. + +----- + +# npm-lifecycle [`npm-lifecycle`](https://github.com/npm/npm-lifecycle) is a standalone library for executing packages' lifecycle scripts. It is extracted from npm itself and @@ -22,18 +33,6 @@ intended to be fully compatible with the way npm executes individual scripts. // idk yet ``` -### Features - -* something cool - -### 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 #### `> lifecycle(name, pkg, wd, [opts]) -> Promise` diff --git a/deps/npm/node_modules/npm-lifecycle/package.json b/deps/npm/node_modules/npm-lifecycle/package.json index beeb598957898c..35fdaa709901f3 100644 --- a/deps/npm/node_modules/npm-lifecycle/package.json +++ b/deps/npm/node_modules/npm-lifecycle/package.json @@ -1,19 +1,19 @@ { - "_from": "npm-lifecycle@3.1.4", - "_id": "npm-lifecycle@3.1.4", + "_from": "npm-lifecycle@3.1.5", + "_id": "npm-lifecycle@3.1.5", "_inBundle": false, - "_integrity": "sha512-tgs1PaucZwkxECGKhC/stbEgFyc3TGh2TJcg2CDr6jbvQRdteHNhmMeljRzpe4wgFAXQADoy1cSqqi7mtiAa5A==", + "_integrity": "sha512-lDLVkjfZmvmfvpvBzA4vzee9cn+Me4orq0QF8glbswJVEbIcSNWib7qGOffolysc3teCqbbPZZkzbr3GQZTL1g==", "_location": "/npm-lifecycle", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "npm-lifecycle@3.1.4", + "raw": "npm-lifecycle@3.1.5", "name": "npm-lifecycle", "escapedName": "npm-lifecycle", - "rawSpec": "3.1.4", + "rawSpec": "3.1.5", "saveSpec": null, - "fetchSpec": "3.1.4" + "fetchSpec": "3.1.5" }, "_requiredBy": [ "#USER", @@ -21,10 +21,10 @@ "/libcipm", "/libnpm" ], - "_resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.4.tgz", - "_shasum": "de6975c7d8df65f5150db110b57cce498b0b604c", - "_spec": "npm-lifecycle@3.1.4", - "_where": "/Users/mperrotte/npminc/cli", + "_resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.5.tgz", + "_shasum": "9882d3642b8c82c815782a12e6a1bfeed0026309", + "_spec": "npm-lifecycle@3.1.5", + "_where": "/Users/claudiahdz/npm/cli", "author": { "name": "Mike Sherov" }, @@ -49,9 +49,7 @@ "sinon": "^7.2.3", "standard": "^12.0.1", "standard-version": "^4.4.0", - "tap": "^12.7.0", - "weallbehave": "^1.2.0", - "weallcontribute": "^1.0.8" + "tap": "^12.7.0" }, "files": [ "index.js", @@ -78,9 +76,7 @@ "pretest": "standard", "release": "standard-version -s", "snap": "TAP_SNAPSHOT=1 npm test", - "test": "tap -J --cov 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'" + "test": "tap -J --cov test/*.js" }, - "version": "3.1.4" + "version": "3.1.5" } diff --git a/deps/npm/node_modules/os-locale/index.js b/deps/npm/node_modules/os-locale/index.js deleted file mode 100644 index 8c73c99f20e2f1..00000000000000 --- a/deps/npm/node_modules/os-locale/index.js +++ /dev/null @@ -1,114 +0,0 @@ -'use strict'; -const execa = require('execa'); -const lcid = require('lcid'); -const mem = require('mem'); - -const defaultOptions = {spawn: true}; -const defaultLocale = 'en_US'; - -function getEnvLocale(env = process.env) { - return env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE; -} - -function parseLocale(string) { - const env = string.split('\n').reduce((env, def) => { - const [key, value] = def.split('='); - env[key] = value.replace(/^"|"$/g, ''); - return env; - }, {}); - - return getEnvLocale(env); -} - -function getLocale(string) { - return (string && string.replace(/[.:].*/, '')); -} - -function getLocales() { - return execa.stdout('locale', ['-a']); -} - -function getLocalesSync() { - return execa.sync('locale', ['-a']).stdout; -} - -function getSupportedLocale(locale, locales = '') { - return locales.includes(locale) ? locale : defaultLocale; -} - -function getAppleLocale() { - return Promise.all([ - execa.stdout('defaults', ['read', '-globalDomain', 'AppleLocale']), - getLocales() - ]).then(results => getSupportedLocale(results[0], results[1])); -} - -function getAppleLocaleSync() { - return getSupportedLocale( - execa.sync('defaults', ['read', '-globalDomain', 'AppleLocale']).stdout, - getLocalesSync() - ); -} - -function getUnixLocale() { - if (process.platform === 'darwin') { - return getAppleLocale(); - } - - return execa.stdout('locale') - .then(stdout => getLocale(parseLocale(stdout))); -} - -function getUnixLocaleSync() { - if (process.platform === 'darwin') { - return getAppleLocaleSync(); - } - - return getLocale(parseLocale(execa.sync('locale').stdout)); -} - -function getWinLocale() { - return execa.stdout('wmic', ['os', 'get', 'locale']) - .then(stdout => { - const lcidCode = parseInt(stdout.replace('Locale', ''), 16); - return lcid.from(lcidCode); - }); -} - -function getWinLocaleSync() { - const {stdout} = execa.sync('wmic', ['os', 'get', 'locale']); - const lcidCode = parseInt(stdout.replace('Locale', ''), 16); - return lcid.from(lcidCode); -} - -module.exports = mem((options = defaultOptions) => { - const envLocale = getEnvLocale(); - - let thenable; - if (envLocale || options.spawn === false) { - thenable = Promise.resolve(getLocale(envLocale)); - } else if (process.platform === 'win32') { - thenable = getWinLocale(); - } else { - thenable = getUnixLocale(); - } - - return thenable - .then(locale => locale || defaultLocale) - .catch(() => defaultLocale); -}); - -module.exports.sync = mem((options = defaultOptions) => { - const envLocale = getEnvLocale(); - - let res; - if (envLocale || options.spawn === false) { - res = getLocale(envLocale); - } else { - try { - res = process.platform === 'win32' ? getWinLocaleSync() : getUnixLocaleSync(); - } catch (_) {} - } - - return res || defaultLocale; -}); diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/CHANGELOG.md b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/CHANGELOG.md deleted file mode 100644 index ded9620b18d252..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/CHANGELOG.md +++ /dev/null @@ -1,100 +0,0 @@ -# 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. - - -## [6.0.5](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.4...v6.0.5) (2018-03-02) - - -### Bug Fixes - -* avoid using deprecated Buffer constructor ([#94](https://github.com/moxystudio/node-cross-spawn/issues/94)) ([d5770df](https://github.com/moxystudio/node-cross-spawn/commit/d5770df)), closes [/nodejs.org/api/deprecations.html#deprecations_dep0005](https://github.com//nodejs.org/api/deprecations.html/issues/deprecations_dep0005) - - - - -## [6.0.4](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.3...v6.0.4) (2018-01-31) - - -### Bug Fixes - -* fix paths being incorrectly normalized on unix ([06ee3c6](https://github.com/moxystudio/node-cross-spawn/commit/06ee3c6)), closes [#90](https://github.com/moxystudio/node-cross-spawn/issues/90) - - - - -## [6.0.3](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.2...v6.0.3) (2018-01-23) - - - - -## [6.0.2](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.1...v6.0.2) (2018-01-23) - - - - -## [6.0.1](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.0...v6.0.1) (2018-01-23) - - - - -# [6.0.0](https://github.com/moxystudio/node-cross-spawn/compare/5.1.0...6.0.0) (2018-01-23) - - -### Bug Fixes - -* fix certain arguments not being correctly escaped or causing batch syntax error ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)), closes [#82](https://github.com/moxystudio/node-cross-spawn/issues/82) [#51](https://github.com/moxystudio/node-cross-spawn/issues/51) -* fix commands as posix relatixe paths not working correctly, e.g.: `./my-command` ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) -* fix `options` argument being mutated ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) -* fix commands resolution when PATH was actually Path ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) - - -### Features - -* improve compliance with node's ENOENT errors ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) -* improve detection of node's shell option support ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)) - - -### Chores - -* upgrade tooling -* upgrate project to es6 (node v4) - - -### BREAKING CHANGES - -* remove support for older nodejs versions, only `node >= 4` is supported - - - -## [5.1.0](https://github.com/moxystudio/node-cross-spawn/compare/5.0.1...5.1.0) (2017-02-26) - - -### Bug Fixes - -* fix `options.shell` support for NodeJS [v4.8](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#4.8.0) - - - -## [5.0.1](https://github.com/moxystudio/node-cross-spawn/compare/5.0.0...5.0.1) (2016-11-04) - - -### Bug Fixes - -* fix `options.shell` support for NodeJS v7 - - - -# [5.0.0](https://github.com/moxystudio/node-cross-spawn/compare/4.0.2...5.0.0) (2016-10-30) - - -## Features - -* add support for `options.shell` -* improve parsing of shebangs by using [`shebang-command`](https://github.com/kevva/shebang-command) module - - -## Chores - -* refactor some code to make it more clear -* update README caveats diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/LICENSE b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/LICENSE deleted file mode 100644 index 8407b9a30f51b0..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 Made With MOXY Lda - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/README.md b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/README.md deleted file mode 100644 index 72c718c9d5bec2..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# cross-spawn - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url] [![Greenkeeper badge][greenkeeper-image]][greenkeeper-url] - -[npm-url]:https://npmjs.org/package/cross-spawn -[downloads-image]:http://img.shields.io/npm/dm/cross-spawn.svg -[npm-image]:http://img.shields.io/npm/v/cross-spawn.svg -[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn -[travis-image]:http://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg -[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn -[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg -[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn -[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg -[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn -[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg -[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev -[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg -[greenkeeper-image]:https://badges.greenkeeper.io/moxystudio/node-cross-spawn.svg -[greenkeeper-url]:https://greenkeeper.io/ - -A cross platform solution to node's spawn and spawnSync. - - -## Installation - -`$ npm install cross-spawn` - - -## Why - -Node has issues when using spawn on Windows: - -- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318) -- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix)) -- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367) -- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`) -- Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149) -- No `options.shell` support on node `` where `` must not contain any arguments. -If you would like to have the shebang support improved, feel free to contribute via a pull-request. - -Remember to always test your code on Windows! - - -## Tests - -`$ npm test` -`$ npm test -- --watch` during development - -## License - -Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php). diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/index.js b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/index.js deleted file mode 100644 index 5509742ca9fa8f..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/index.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -const cp = require('child_process'); -const parse = require('./lib/parse'); -const enoent = require('./lib/enoent'); - -function spawn(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - - // Spawn the child process - const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); - - // Hook into child process "exit" event to emit an error if the command - // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - enoent.hookChildProcess(spawned, parsed); - - return spawned; -} - -function spawnSync(command, args, options) { - // Parse the arguments - const parsed = parse(command, args, options); - - // Spawn the child process - const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); - - // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16 - result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); - - return result; -} - -module.exports = spawn; -module.exports.spawn = spawn; -module.exports.sync = spawnSync; - -module.exports._parse = parse; -module.exports._enoent = enoent; diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/enoent.js b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/enoent.js deleted file mode 100644 index 14df9b623d0a20..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/enoent.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -const isWin = process.platform === 'win32'; - -function notFoundError(original, syscall) { - return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), { - code: 'ENOENT', - errno: 'ENOENT', - syscall: `${syscall} ${original.command}`, - path: original.command, - spawnargs: original.args, - }); -} - -function hookChildProcess(cp, parsed) { - if (!isWin) { - return; - } - - const originalEmit = cp.emit; - - cp.emit = function (name, arg1) { - // If emitting "exit" event and exit code is 1, we need to check if - // the command exists and emit an "error" instead - // See https://github.com/IndigoUnited/node-cross-spawn/issues/16 - if (name === 'exit') { - const err = verifyENOENT(arg1, parsed, 'spawn'); - - if (err) { - return originalEmit.call(cp, 'error', err); - } - } - - return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params - }; -} - -function verifyENOENT(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawn'); - } - - return null; -} - -function verifyENOENTSync(status, parsed) { - if (isWin && status === 1 && !parsed.file) { - return notFoundError(parsed.original, 'spawnSync'); - } - - return null; -} - -module.exports = { - hookChildProcess, - verifyENOENT, - verifyENOENTSync, - notFoundError, -}; diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/parse.js b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/parse.js deleted file mode 100644 index 962827a94e8c07..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/parse.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict'; - -const path = require('path'); -const niceTry = require('nice-try'); -const resolveCommand = require('./util/resolveCommand'); -const escape = require('./util/escape'); -const readShebang = require('./util/readShebang'); -const semver = require('semver'); - -const isWin = process.platform === 'win32'; -const isExecutableRegExp = /\.(?:com|exe)$/i; -const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i; - -// `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0 -const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false; - -function detectShebang(parsed) { - parsed.file = resolveCommand(parsed); - - const shebang = parsed.file && readShebang(parsed.file); - - if (shebang) { - parsed.args.unshift(parsed.file); - parsed.command = shebang; - - return resolveCommand(parsed); - } - - return parsed.file; -} - -function parseNonShell(parsed) { - if (!isWin) { - return parsed; - } - - // Detect & add support for shebangs - const commandFile = detectShebang(parsed); - - // We don't need a shell if the command filename is an executable - const needsShell = !isExecutableRegExp.test(commandFile); - - // If a shell is required, use cmd.exe and take care of escaping everything correctly - // Note that `forceShell` is an hidden option used only in tests - if (parsed.options.forceShell || needsShell) { - // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/` - // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument - // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called, - // we need to double escape them - const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - - // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar) - // This is necessary otherwise it will always fail with ENOENT in those cases - parsed.command = path.normalize(parsed.command); - - // Escape command & arguments - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); - - const shellCommand = [parsed.command].concat(parsed.args).join(' '); - - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.command = process.env.comspec || 'cmd.exe'; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } - - return parsed; -} - -function parseShell(parsed) { - // If node supports the shell option, there's no need to mimic its behavior - if (supportsShellOption) { - return parsed; - } - - // Mimic node shell option - // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335 - const shellCommand = [parsed.command].concat(parsed.args).join(' '); - - if (isWin) { - parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe'; - parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`]; - parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped - } else { - if (typeof parsed.options.shell === 'string') { - parsed.command = parsed.options.shell; - } else if (process.platform === 'android') { - parsed.command = '/system/bin/sh'; - } else { - parsed.command = '/bin/sh'; - } - - parsed.args = ['-c', shellCommand]; - } - - return parsed; -} - -function parse(command, args, options) { - // Normalize arguments, similar to nodejs - if (args && !Array.isArray(args)) { - options = args; - args = null; - } - - args = args ? args.slice(0) : []; // Clone array to avoid changing the original - options = Object.assign({}, options); // Clone object to avoid changing the original - - // Build our parsed object - const parsed = { - command, - args, - options, - file: undefined, - original: { - command, - args, - }, - }; - - // Delegate further parsing to shell or non-shell - return options.shell ? parseShell(parsed) : parseNonShell(parsed); -} - -module.exports = parse; diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/escape.js b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/escape.js deleted file mode 100644 index b0bb84c3a14092..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/escape.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -// See http://www.robvanderwoude.com/escapechars.php -const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g; - -function escapeCommand(arg) { - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - return arg; -} - -function escapeArgument(arg, doubleEscapeMetaChars) { - // Convert to string - arg = `${arg}`; - - // Algorithm below is based on https://qntm.org/cmd - - // Sequence of backslashes followed by a double quote: - // double up all the backslashes and escape the double quote - arg = arg.replace(/(\\*)"/g, '$1$1\\"'); - - // Sequence of backslashes followed by the end of the string - // (which will become a double quote later): - // double up all the backslashes - arg = arg.replace(/(\\*)$/, '$1$1'); - - // All other backslashes occur literally - - // Quote the whole thing: - arg = `"${arg}"`; - - // Escape meta chars - arg = arg.replace(metaCharsRegExp, '^$1'); - - // Double escape meta chars if necessary - if (doubleEscapeMetaChars) { - arg = arg.replace(metaCharsRegExp, '^$1'); - } - - return arg; -} - -module.exports.command = escapeCommand; -module.exports.argument = escapeArgument; diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/readShebang.js b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/readShebang.js deleted file mode 100644 index bd4f1280c9cadb..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/readShebang.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const shebangCommand = require('shebang-command'); - -function readShebang(command) { - // Read the first 150 bytes from the file - const size = 150; - let buffer; - - if (Buffer.alloc) { - // Node.js v4.5+ / v5.10+ - buffer = Buffer.alloc(size); - } else { - // Old Node.js API - buffer = new Buffer(size); - buffer.fill(0); // zero-fill - } - - let fd; - - try { - fd = fs.openSync(command, 'r'); - fs.readSync(fd, buffer, 0, size, 0); - fs.closeSync(fd); - } catch (e) { /* Empty */ } - - // Attempt to extract shebang (null is returned if not a shebang) - return shebangCommand(buffer.toString()); -} - -module.exports = readShebang; diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/resolveCommand.js b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/resolveCommand.js deleted file mode 100644 index 2fd5ad27056078..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/lib/util/resolveCommand.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -const path = require('path'); -const which = require('which'); -const pathKey = require('path-key')(); - -function resolveCommandAttempt(parsed, withoutPathExt) { - const cwd = process.cwd(); - const hasCustomCwd = parsed.options.cwd != null; - - // If a custom `cwd` was specified, we need to change the process cwd - // because `which` will do stat calls but does not support a custom cwd - if (hasCustomCwd) { - try { - process.chdir(parsed.options.cwd); - } catch (err) { - /* Empty */ - } - } - - let resolved; - - try { - resolved = which.sync(parsed.command, { - path: (parsed.options.env || process.env)[pathKey], - pathExt: withoutPathExt ? path.delimiter : undefined, - }); - } catch (e) { - /* Empty */ - } finally { - process.chdir(cwd); - } - - // If we successfully resolved, ensure that an absolute path is returned - // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it - if (resolved) { - resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved); - } - - return resolved; -} - -function resolveCommand(parsed) { - return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true); -} - -module.exports = resolveCommand; diff --git a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/package.json b/deps/npm/node_modules/os-locale/node_modules/cross-spawn/package.json deleted file mode 100644 index 3fdff9f498b270..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/cross-spawn/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "_from": "cross-spawn@^6.0.0", - "_id": "cross-spawn@6.0.5", - "_inBundle": false, - "_integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "_location": "/os-locale/cross-spawn", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "cross-spawn@^6.0.0", - "name": "cross-spawn", - "escapedName": "cross-spawn", - "rawSpec": "^6.0.0", - "saveSpec": null, - "fetchSpec": "^6.0.0" - }, - "_requiredBy": [ - "/os-locale/execa" - ], - "_resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "_shasum": "4a5ec7c64dfae22c3a14124dbacdee846d80cbc4", - "_spec": "cross-spawn@^6.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/os-locale/node_modules/execa", - "author": { - "name": "André Cruz", - "email": "andre@moxy.studio" - }, - "bugs": { - "url": "https://github.com/moxystudio/node-cross-spawn/issues" - }, - "bundleDependencies": false, - "commitlint": { - "extends": [ - "@commitlint/config-conventional" - ] - }, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "deprecated": false, - "description": "Cross platform child_process#spawn and child_process#spawnSync", - "devDependencies": { - "@commitlint/cli": "^6.0.0", - "@commitlint/config-conventional": "^6.0.2", - "babel-core": "^6.26.0", - "babel-jest": "^22.1.0", - "babel-preset-moxy": "^2.2.1", - "eslint": "^4.3.0", - "eslint-config-moxy": "^5.0.0", - "husky": "^0.14.3", - "jest": "^22.0.0", - "lint-staged": "^7.0.0", - "mkdirp": "^0.5.1", - "regenerator-runtime": "^0.11.1", - "rimraf": "^2.6.2", - "standard-version": "^4.2.0" - }, - "engines": { - "node": ">=4.8" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/moxystudio/node-cross-spawn", - "keywords": [ - "spawn", - "spawnSync", - "windows", - "cross-platform", - "path-ext", - "shebang", - "cmd", - "execute" - ], - "license": "MIT", - "lint-staged": { - "*.js": [ - "eslint --fix", - "git add" - ] - }, - "main": "index.js", - "name": "cross-spawn", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/moxystudio/node-cross-spawn.git" - }, - "scripts": { - "commitmsg": "commitlint -e $GIT_PARAMS", - "lint": "eslint .", - "precommit": "lint-staged", - "prerelease": "npm t && npm run lint", - "release": "standard-version", - "test": "jest --env node --coverage" - }, - "standard-version": { - "scripts": { - "posttag": "git push --follow-tags origin master && npm publish" - } - }, - "version": "6.0.5" -} diff --git a/deps/npm/node_modules/os-locale/node_modules/execa/index.js b/deps/npm/node_modules/os-locale/node_modules/execa/index.js deleted file mode 100644 index aad9ac88775cbc..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/execa/index.js +++ /dev/null @@ -1,361 +0,0 @@ -'use strict'; -const path = require('path'); -const childProcess = require('child_process'); -const crossSpawn = require('cross-spawn'); -const stripEof = require('strip-eof'); -const npmRunPath = require('npm-run-path'); -const isStream = require('is-stream'); -const _getStream = require('get-stream'); -const pFinally = require('p-finally'); -const onExit = require('signal-exit'); -const errname = require('./lib/errname'); -const stdio = require('./lib/stdio'); - -const TEN_MEGABYTES = 1000 * 1000 * 10; - -function handleArgs(cmd, args, opts) { - let parsed; - - opts = Object.assign({ - extendEnv: true, - env: {} - }, opts); - - if (opts.extendEnv) { - opts.env = Object.assign({}, process.env, opts.env); - } - - if (opts.__winShell === true) { - delete opts.__winShell; - parsed = { - command: cmd, - args, - options: opts, - file: cmd, - original: { - cmd, - args - } - }; - } else { - parsed = crossSpawn._parse(cmd, args, opts); - } - - opts = Object.assign({ - maxBuffer: TEN_MEGABYTES, - buffer: true, - stripEof: true, - preferLocal: true, - localDir: parsed.options.cwd || process.cwd(), - encoding: 'utf8', - reject: true, - cleanup: true - }, parsed.options); - - opts.stdio = stdio(opts); - - if (opts.preferLocal) { - opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); - } - - if (opts.detached) { - // #115 - opts.cleanup = false; - } - - if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') { - // #116 - parsed.args.unshift('/q'); - } - - return { - cmd: parsed.command, - args: parsed.args, - opts, - parsed - }; -} - -function handleInput(spawned, input) { - if (input === null || input === undefined) { - return; - } - - if (isStream(input)) { - input.pipe(spawned.stdin); - } else { - spawned.stdin.end(input); - } -} - -function handleOutput(opts, val) { - if (val && opts.stripEof) { - val = stripEof(val); - } - - return val; -} - -function handleShell(fn, cmd, opts) { - let file = '/bin/sh'; - let args = ['-c', cmd]; - - opts = Object.assign({}, opts); - - if (process.platform === 'win32') { - opts.__winShell = true; - file = process.env.comspec || 'cmd.exe'; - args = ['/s', '/c', `"${cmd}"`]; - opts.windowsVerbatimArguments = true; - } - - if (opts.shell) { - file = opts.shell; - delete opts.shell; - } - - return fn(file, args, opts); -} - -function getStream(process, stream, {encoding, buffer, maxBuffer}) { - if (!process[stream]) { - return null; - } - - let ret; - - if (!buffer) { - // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10 - ret = new Promise((resolve, reject) => { - process[stream] - .once('end', resolve) - .once('error', reject); - }); - } else if (encoding) { - ret = _getStream(process[stream], { - encoding, - maxBuffer - }); - } else { - ret = _getStream.buffer(process[stream], {maxBuffer}); - } - - return ret.catch(err => { - err.stream = stream; - err.message = `${stream} ${err.message}`; - throw err; - }); -} - -function makeError(result, options) { - const {stdout, stderr} = result; - - let err = result.error; - const {code, signal} = result; - - const {parsed, joinedCmd} = options; - const timedOut = options.timedOut || false; - - if (!err) { - let output = ''; - - if (Array.isArray(parsed.opts.stdio)) { - if (parsed.opts.stdio[2] !== 'inherit') { - output += output.length > 0 ? stderr : `\n${stderr}`; - } - - if (parsed.opts.stdio[1] !== 'inherit') { - output += `\n${stdout}`; - } - } else if (parsed.opts.stdio !== 'inherit') { - output = `\n${stderr}${stdout}`; - } - - err = new Error(`Command failed: ${joinedCmd}${output}`); - err.code = code < 0 ? errname(code) : code; - } - - err.stdout = stdout; - err.stderr = stderr; - err.failed = true; - err.signal = signal || null; - err.cmd = joinedCmd; - err.timedOut = timedOut; - - return err; -} - -function joinCmd(cmd, args) { - let joinedCmd = cmd; - - if (Array.isArray(args) && args.length > 0) { - joinedCmd += ' ' + args.join(' '); - } - - return joinedCmd; -} - -module.exports = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const {encoding, buffer, maxBuffer} = parsed.opts; - const joinedCmd = joinCmd(cmd, args); - - let spawned; - try { - spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); - } catch (err) { - return Promise.reject(err); - } - - let removeExitHandler; - if (parsed.opts.cleanup) { - removeExitHandler = onExit(() => { - spawned.kill(); - }); - } - - let timeoutId = null; - let timedOut = false; - - const cleanup = () => { - if (timeoutId) { - clearTimeout(timeoutId); - timeoutId = null; - } - - if (removeExitHandler) { - removeExitHandler(); - } - }; - - if (parsed.opts.timeout > 0) { - timeoutId = setTimeout(() => { - timeoutId = null; - timedOut = true; - spawned.kill(parsed.opts.killSignal); - }, parsed.opts.timeout); - } - - const processDone = new Promise(resolve => { - spawned.on('exit', (code, signal) => { - cleanup(); - resolve({code, signal}); - }); - - spawned.on('error', err => { - cleanup(); - resolve({error: err}); - }); - - if (spawned.stdin) { - spawned.stdin.on('error', err => { - cleanup(); - resolve({error: err}); - }); - } - }); - - function destroy() { - if (spawned.stdout) { - spawned.stdout.destroy(); - } - - if (spawned.stderr) { - spawned.stderr.destroy(); - } - } - - const handlePromise = () => pFinally(Promise.all([ - processDone, - getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}), - getStream(spawned, 'stderr', {encoding, buffer, maxBuffer}) - ]).then(arr => { - const result = arr[0]; - result.stdout = arr[1]; - result.stderr = arr[2]; - - if (result.error || result.code !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed, - timedOut - }); - - // TODO: missing some timeout logic for killed - // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 - // err.killed = spawned.killed || killed; - err.killed = err.killed || spawned.killed; - - if (!parsed.opts.reject) { - return err; - } - - throw err; - } - - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - killed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; - }), destroy); - - crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); - - handleInput(spawned, parsed.opts.input); - - spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); - spawned.catch = onrejected => handlePromise().catch(onrejected); - - return spawned; -}; - -// TODO: set `stderr: 'ignore'` when that option is implemented -module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout); - -// TODO: set `stdout: 'ignore'` when that option is implemented -module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr); - -module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); - -module.exports.sync = (cmd, args, opts) => { - const parsed = handleArgs(cmd, args, opts); - const joinedCmd = joinCmd(cmd, args); - - if (isStream(parsed.opts.input)) { - throw new TypeError('The `input` option cannot be a stream in sync mode'); - } - - const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); - result.code = result.status; - - if (result.error || result.status !== 0 || result.signal !== null) { - const err = makeError(result, { - joinedCmd, - parsed - }); - - if (!parsed.opts.reject) { - return err; - } - - throw err; - } - - return { - stdout: handleOutput(parsed.opts, result.stdout), - stderr: handleOutput(parsed.opts, result.stderr), - code: 0, - failed: false, - signal: null, - cmd: joinedCmd, - timedOut: false - }; -}; - -module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); diff --git a/deps/npm/node_modules/os-locale/node_modules/execa/lib/errname.js b/deps/npm/node_modules/os-locale/node_modules/execa/lib/errname.js deleted file mode 100644 index a93a435dfc6663..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/execa/lib/errname.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; -// Older verions of Node.js might not have `util.getSystemErrorName()`. -// In that case, fall back to a deprecated internal. -const util = require('util'); - -let uv; - -if (typeof util.getSystemErrorName === 'function') { - module.exports = util.getSystemErrorName; -} else { - try { - uv = process.binding('uv'); - - if (typeof uv.errname !== 'function') { - throw new TypeError('uv.errname is not a function'); - } - } catch (err) { - console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); - uv = null; - } - - module.exports = code => errname(uv, code); -} - -// Used for testing the fallback behavior -module.exports.__test__ = errname; - -function errname(uv, code) { - if (uv) { - return uv.errname(code); - } - - if (!(code < 0)) { - throw new Error('err >= 0'); - } - - return `Unknown system error ${code}`; -} diff --git a/deps/npm/node_modules/os-locale/node_modules/execa/lib/stdio.js b/deps/npm/node_modules/os-locale/node_modules/execa/lib/stdio.js deleted file mode 100644 index a82d46838ac9b9..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/execa/lib/stdio.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; -const alias = ['stdin', 'stdout', 'stderr']; - -const hasAlias = opts => alias.some(x => Boolean(opts[x])); - -module.exports = opts => { - if (!opts) { - return null; - } - - if (opts.stdio && hasAlias(opts)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); - } - - if (typeof opts.stdio === 'string') { - return opts.stdio; - } - - const stdio = opts.stdio || []; - - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); - } - - const result = []; - const len = Math.max(stdio.length, alias.length); - - for (let i = 0; i < len; i++) { - let value = null; - - if (stdio[i] !== undefined) { - value = stdio[i]; - } else if (opts[alias[i]] !== undefined) { - value = opts[alias[i]]; - } - - result[i] = value; - } - - return result; -}; diff --git a/deps/npm/node_modules/os-locale/node_modules/execa/package.json b/deps/npm/node_modules/os-locale/node_modules/execa/package.json deleted file mode 100644 index 7ab0a5777c7cd5..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/execa/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_from": "execa@^1.0.0", - "_id": "execa@1.0.0", - "_inBundle": false, - "_integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "_location": "/os-locale/execa", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "execa@^1.0.0", - "name": "execa", - "escapedName": "execa", - "rawSpec": "^1.0.0", - "saveSpec": null, - "fetchSpec": "^1.0.0" - }, - "_requiredBy": [ - "/os-locale" - ], - "_resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "_shasum": "c6236a5bb4df6d6f15e88e7f017798216749ddd8", - "_spec": "execa@^1.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/os-locale", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/execa/issues" - }, - "bundleDependencies": false, - "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "deprecated": false, - "description": "A better `child_process`", - "devDependencies": { - "ava": "*", - "cat-names": "^1.0.2", - "coveralls": "^3.0.1", - "delay": "^3.0.0", - "is-running": "^2.0.0", - "nyc": "^13.0.1", - "tempfile": "^2.0.0", - "xo": "*" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "lib" - ], - "homepage": "https://github.com/sindresorhus/execa#readme", - "keywords": [ - "exec", - "child", - "process", - "execute", - "fork", - "execfile", - "spawn", - "file", - "shell", - "bin", - "binary", - "binaries", - "npm", - "path", - "local" - ], - "license": "MIT", - "name": "execa", - "nyc": { - "reporter": [ - "text", - "lcov" - ], - "exclude": [ - "**/fixtures/**", - "**/test.js", - "**/test/**" - ] - }, - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/execa.git" - }, - "scripts": { - "test": "xo && nyc ava" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/os-locale/node_modules/execa/readme.md b/deps/npm/node_modules/os-locale/node_modules/execa/readme.md deleted file mode 100644 index f3f533d92915eb..00000000000000 --- a/deps/npm/node_modules/os-locale/node_modules/execa/readme.md +++ /dev/null @@ -1,327 +0,0 @@ -# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master) - -> A better [`child_process`](https://nodejs.org/api/child_process.html) - - -## Why - -- Promise interface. -- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`. -- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform. -- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why) -- Higher max buffer. 10 MB instead of 200 KB. -- [Executes locally installed binaries by name.](#preferlocal) -- [Cleans up spawned processes when the parent process dies.](#cleanup) - - -## Install - -``` -$ npm install execa -``` - - - - - - -## Usage - -```js -const execa = require('execa'); - -(async () => { - const {stdout} = await execa('echo', ['unicorns']); - console.log(stdout); - //=> 'unicorns' -})(); -``` - -Additional examples: - -```js -const execa = require('execa'); - -(async () => { - // Pipe the child process stdout to the current stdout - execa('echo', ['unicorns']).stdout.pipe(process.stdout); - - - // Run a shell command - const {stdout} = await execa.shell('echo unicorns'); - //=> 'unicorns' - - - // Catching an error - try { - await execa.shell('exit 3'); - } catch (error) { - console.log(error); - /* - { - message: 'Command failed: /bin/sh -c exit 3' - killed: false, - code: 3, - signal: null, - cmd: '/bin/sh -c exit 3', - stdout: '', - stderr: '', - timedOut: false - } - */ - } -})(); - -// Catching an error with a sync method -try { - execa.shellSync('exit 3'); -} catch (error) { - console.log(error); - /* - { - message: 'Command failed: /bin/sh -c exit 3' - code: 3, - signal: null, - cmd: '/bin/sh -c exit 3', - stdout: '', - stderr: '', - timedOut: false - } - */ -} -``` - - -## API - -### execa(file, [arguments], [options]) - -Execute a file. - -Think of this as a mix of `child_process.execFile` and `child_process.spawn`. - -Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. - -### execa.stdout(file, [arguments], [options]) - -Same as `execa()`, but returns only `stdout`. - -### execa.stderr(file, [arguments], [options]) - -Same as `execa()`, but returns only `stderr`. - -### execa.shell(command, [options]) - -Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer. - -Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess). - -The `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties. - -### execa.sync(file, [arguments], [options]) - -Execute a file synchronously. - -Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). - -This method throws an `Error` if the command fails. - -### execa.shellSync(file, [options]) - -Execute a command synchronously through the system shell. - -Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). - -### options - -Type: `Object` - -#### cwd - -Type: `string`
-Default: `process.cwd()` - -Current working directory of the child process. - -#### env - -Type: `Object`
-Default: `process.env` - -Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this. - -#### extendEnv - -Type: `boolean`
-Default: `true` - -Set to `false` if you don't want to extend the environment variables when providing the `env` property. - -#### argv0 - -Type: `string` - -Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified. - -#### stdio - -Type: `string[]` `string`
-Default: `pipe` - -Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration. - -#### detached - -Type: `boolean` - -Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached). - -#### uid - -Type: `number` - -Sets the user identity of the process. - -#### gid - -Type: `number` - -Sets the group identity of the process. - -#### shell - -Type: `boolean` `string`
-Default: `false` - -If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows. - -#### stripEof - -Type: `boolean`
-Default: `true` - -[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output. - -#### preferLocal - -Type: `boolean`
-Default: `true` - -Prefer locally installed binaries when looking for a binary to execute.
-If you `$ npm install foo`, you can then `execa('foo')`. - -#### localDir - -Type: `string`
-Default: `process.cwd()` - -Preferred path to find locally installed binaries in (use with `preferLocal`). - -#### input - -Type: `string` `Buffer` `stream.Readable` - -Write some input to the `stdin` of your binary.
-Streams are not allowed when using the synchronous methods. - -#### reject - -Type: `boolean`
-Default: `true` - -Setting this to `false` resolves the promise with the error instead of rejecting it. - -#### cleanup - -Type: `boolean`
-Default: `true` - -Keep track of the spawned process and `kill` it when the parent process exits. - -#### encoding - -Type: `string`
-Default: `utf8` - -Specify the character encoding used to decode the `stdout` and `stderr` output. - -#### timeout - -Type: `number`
-Default: `0` - -If timeout is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than timeout milliseconds. - -#### buffer - -Type: `boolean`
-Default: `true` - -Buffer the output from the spawned process. When buffering is disabled you must consume the output of the `stdout` and `stderr` streams because the promise will not be resolved/rejected until they have completed. - -#### maxBuffer - -Type: `number`
-Default: `10000000` (10MB) - -Largest amount of data in bytes allowed on `stdout` or `stderr`. - -#### killSignal - -Type: `string` `number`
-Default: `SIGTERM` - -Signal value to be used when the spawned process will be killed. - -#### stdin - -Type: `string` `number` `Stream` `undefined` `null`
-Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### stdout - -Type: `string` `number` `Stream` `undefined` `null`
-Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### stderr - -Type: `string` `number` `Stream` `undefined` `null`
-Default: `pipe` - -Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). - -#### windowsVerbatimArguments - -Type: `boolean`
-Default: `false` - -If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`. - - -## Tips - -### Save and pipe output from a child process - -Let's say you want to show the output of a child process in real-time while also saving it to a variable. - -```js -const execa = require('execa'); -const getStream = require('get-stream'); - -const stream = execa('echo', ['foo']).stdout; - -stream.pipe(process.stdout); - -getStream(stream).then(value => { - console.log('child output:', value); -}); -``` - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/os-locale/package.json b/deps/npm/node_modules/os-locale/package.json deleted file mode 100644 index fb6646ec9974b8..00000000000000 --- a/deps/npm/node_modules/os-locale/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_from": "os-locale@^3.1.0", - "_id": "os-locale@3.1.0", - "_inBundle": false, - "_integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", - "_location": "/os-locale", - "_phantomChildren": { - "get-stream": "4.1.0", - "is-stream": "1.1.0", - "nice-try": "1.0.5", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "path-key": "2.0.1", - "semver": "5.7.1", - "shebang-command": "1.2.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0", - "which": "1.3.1" - }, - "_requested": { - "type": "range", - "registry": true, - "raw": "os-locale@^3.1.0", - "name": "os-locale", - "escapedName": "os-locale", - "rawSpec": "^3.1.0", - "saveSpec": null, - "fetchSpec": "^3.1.0" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "_shasum": "a802a6ee17f24c10483ab9935719cef4ed16bf1a", - "_spec": "os-locale@^3.1.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/yargs", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/os-locale/issues" - }, - "bundleDependencies": false, - "dependencies": { - "execa": "^1.0.0", - "lcid": "^2.0.0", - "mem": "^4.0.0" - }, - "deprecated": false, - "description": "Get the system locale", - "devDependencies": { - "ava": "^1.0.1", - "import-fresh": "^3.0.0", - "xo": "^0.23.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/os-locale#readme", - "keywords": [ - "locale", - "lang", - "language", - "system", - "os", - "string", - "str", - "user", - "country", - "id", - "identifier", - "region" - ], - "license": "MIT", - "name": "os-locale", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/os-locale.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "3.1.0" -} diff --git a/deps/npm/node_modules/os-locale/readme.md b/deps/npm/node_modules/os-locale/readme.md deleted file mode 100644 index 8f9c280eedb85e..00000000000000 --- a/deps/npm/node_modules/os-locale/readme.md +++ /dev/null @@ -1,71 +0,0 @@ -# os-locale [![Build Status](https://travis-ci.org/sindresorhus/os-locale.svg?branch=master)](https://travis-ci.org/sindresorhus/os-locale) - -> Get the system [locale](https://en.wikipedia.org/wiki/Locale_(computer_software)) - -Useful for localizing your module or app. - -POSIX systems: The returned locale refers to the [`LC_MESSAGE`](http://www.gnu.org/software/libc/manual/html_node/Locale-Categories.html#Locale-Categories) category, suitable for selecting the language used in the user interface for message translation. - ---- - -
- - Get professional support for 'os-locale' with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-
- ---- - -## Install - -``` -$ npm install os-locale -``` - - -## Usage - -```js -const osLocale = require('os-locale'); - -(async () => { - console.log(await osLocale()); - //=> 'en_US' -})(); -``` - - -## API - -### osLocale([options]) - -Returns a `Promise` for the locale. - -### osLocale.sync([options]) - -Returns the locale. - -#### options - -Type: `Object` - -##### spawn - -Type: `boolean`
-Default: `true` - -Set to `false` to avoid spawning subprocesses and instead only resolve the locale from environment variables. - - -## Security - -To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/p-defer/index.js b/deps/npm/node_modules/p-defer/index.js deleted file mode 100644 index eaef75e4e5f723..00000000000000 --- a/deps/npm/node_modules/p-defer/index.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; -module.exports = () => { - const ret = {}; - - ret.promise = new Promise((resolve, reject) => { - ret.resolve = resolve; - ret.reject = reject; - }); - - return ret; -}; diff --git a/deps/npm/node_modules/p-defer/package.json b/deps/npm/node_modules/p-defer/package.json deleted file mode 100644 index ee706cd9308589..00000000000000 --- a/deps/npm/node_modules/p-defer/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_args": [ - [ - "p-defer@1.0.0", - "/Users/mperrotte/npminc/cli" - ] - ], - "_development": true, - "_from": "p-defer@1.0.0", - "_id": "p-defer@1.0.0", - "_inBundle": false, - "_integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "_location": "/p-defer", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "p-defer@1.0.0", - "name": "p-defer", - "escapedName": "p-defer", - "rawSpec": "1.0.0", - "saveSpec": null, - "fetchSpec": "1.0.0" - }, - "_requiredBy": [ - "/map-age-cleaner" - ], - "_resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "_spec": "1.0.0", - "_where": "/Users/mperrotte/npminc/cli", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-defer/issues" - }, - "description": "Create a deferred promise", - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "engines": { - "node": ">=4" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/sindresorhus/p-defer#readme", - "keywords": [ - "promise", - "defer", - "deferred", - "resolve", - "reject", - "lazy", - "later", - "async", - "await", - "promises", - "bluebird" - ], - "license": "MIT", - "name": "p-defer", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-defer.git" - }, - "scripts": { - "test": "xo && ava" - }, - "version": "1.0.0", - "xo": { - "esnext": true - } -} diff --git a/deps/npm/node_modules/p-defer/readme.md b/deps/npm/node_modules/p-defer/readme.md deleted file mode 100644 index b94f137129d9df..00000000000000 --- a/deps/npm/node_modules/p-defer/readme.md +++ /dev/null @@ -1,47 +0,0 @@ -# p-defer [![Build Status](https://travis-ci.org/sindresorhus/p-defer.svg?branch=master)](https://travis-ci.org/sindresorhus/p-defer) - -> Create a deferred promise - -[**Don't use this unless you know what you're doing!**](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns#the-deferred-anti-pattern) Prefer the `Promise` constructor. - - -## Install - -``` -$ npm install --save p-defer -``` - - -## Usage - -```js -const pDefer = require('p-defer'); - -function delay(ms) { - const deferred = pDefer(); - setTimeout(deferred.resolve, ms, '🦄'); - return deferred.promise; -} - -delay(100).then(console.log); -//=> '🦄' -``` - -*The above is just an example. Use [`delay`](https://github.com/sindresorhus/delay) if you need to delay a promise.* - - -## API - -### pDefer() - -Returns an `Object` with a `promise` property and functions to `resolve()` and `reject()`. - - -## Related - -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/p-is-promise/index.d.ts b/deps/npm/node_modules/p-is-promise/index.d.ts deleted file mode 100644 index 662d9e0c420f60..00000000000000 --- a/deps/npm/node_modules/p-is-promise/index.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -declare const pIsPromise: { - /** - Check if `input` is a ES2015 promise. - - @param input - Value to be checked. - - @example - ``` - import isPromise = require('p-is-promise'); - - isPromise(Promise.resolve('🦄')); - //=> true - ``` - */ - (input: unknown): input is Promise; - - // TODO: Remove this for the next major release, refactor the whole definition to: - // declare function pIsPromise(input: unknown): input is Promise; - // export = pIsPromise; - default: typeof pIsPromise; -}; - -export = pIsPromise; diff --git a/deps/npm/node_modules/p-is-promise/index.js b/deps/npm/node_modules/p-is-promise/index.js deleted file mode 100644 index 389d38fc55f6f4..00000000000000 --- a/deps/npm/node_modules/p-is-promise/index.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -const isPromise = input => ( - input instanceof Promise || - ( - input !== null && - typeof input === 'object' && - typeof input.then === 'function' && - typeof input.catch === 'function' - ) -); - -module.exports = isPromise; -// TODO: Remove this for the next major release -module.exports.default = isPromise; diff --git a/deps/npm/node_modules/p-is-promise/package.json b/deps/npm/node_modules/p-is-promise/package.json deleted file mode 100644 index 3315effdfb15df..00000000000000 --- a/deps/npm/node_modules/p-is-promise/package.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_args": [ - [ - "p-is-promise@2.1.0", - "/Users/mperrotte/npminc/cli" - ] - ], - "_development": true, - "_from": "p-is-promise@2.1.0", - "_id": "p-is-promise@2.1.0", - "_inBundle": false, - "_integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", - "_location": "/p-is-promise", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "p-is-promise@2.1.0", - "name": "p-is-promise", - "escapedName": "p-is-promise", - "rawSpec": "2.1.0", - "saveSpec": null, - "fetchSpec": "2.1.0" - }, - "_requiredBy": [ - "/nyc/mem" - ], - "_resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "_spec": "2.1.0", - "_where": "/Users/mperrotte/npminc/cli", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/p-is-promise/issues" - }, - "description": "Check if something is a promise", - "devDependencies": { - "ava": "^1.4.1", - "bluebird": "^3.5.4", - "tsd": "^0.7.2", - "xo": "^0.24.0" - }, - "engines": { - "node": ">=6" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/sindresorhus/p-is-promise#readme", - "keywords": [ - "promise", - "is", - "detect", - "check", - "kind", - "type", - "thenable", - "es2015", - "async", - "await", - "promises", - "bluebird" - ], - "license": "MIT", - "name": "p-is-promise", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/p-is-promise.git" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "version": "2.1.0" -} diff --git a/deps/npm/node_modules/p-is-promise/readme.md b/deps/npm/node_modules/p-is-promise/readme.md deleted file mode 100644 index 0e0e48171a919d..00000000000000 --- a/deps/npm/node_modules/p-is-promise/readme.md +++ /dev/null @@ -1,43 +0,0 @@ -# p-is-promise [![Build Status](https://travis-ci.org/sindresorhus/p-is-promise.svg?branch=master)](https://travis-ci.org/sindresorhus/p-is-promise) - -> Check if something is a promise - -Why not [`is-promise`](https://github.com/then/is-promise)? That module [checks for a thenable](https://github.com/then/is-promise/issues/6), not an ES2015 promise. This one is stricter. - -You most likely don't need this. Just pass your value to `Promise.resolve()` and let it handle it. - -Can be useful if you need to create a fast path for a synchronous operation. - - -## Install - -``` -$ npm install p-is-promise -``` - - -## Usage - -```js -const pIsPromise = require('p-is-promise'); -const Bluebird = require('bluebird'); - -pIsPromise(Promise.resolve('🦄')); -//=> true - -pIsPromise(Bluebird.resolve('🦄')); -//=> true - -pIsPromise('🦄'); -//=> false -``` - - -## Related - -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/p-limit/index.js b/deps/npm/node_modules/p-limit/index.js deleted file mode 100644 index 8767db1ca7503d..00000000000000 --- a/deps/npm/node_modules/p-limit/index.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; -const pTry = require('p-try'); - -module.exports = concurrency => { - if (concurrency < 1) { - throw new TypeError('Expected `concurrency` to be a number from 1 and up'); - } - - const queue = []; - let activeCount = 0; - - const next = () => { - activeCount--; - - if (queue.length > 0) { - queue.shift()(); - } - }; - - return fn => new Promise((resolve, reject) => { - const run = () => { - activeCount++; - - pTry(() => fn()).then( - val => { - resolve(val); - next(); - }, - err => { - reject(err); - next(); - } - ); - }; - - if (activeCount < concurrency) { - run(); - } else { - queue.push(run); - } - }); -}; diff --git a/deps/npm/node_modules/p-limit/readme.md b/deps/npm/node_modules/p-limit/readme.md deleted file mode 100644 index 90129925c1b0ae..00000000000000 --- a/deps/npm/node_modules/p-limit/readme.md +++ /dev/null @@ -1,69 +0,0 @@ -# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) - -> Run multiple promise-returning & async functions with limited concurrency - - -## Install - -``` -$ npm install p-limit -``` - - -## Usage - -```js -const pLimit = require('p-limit'); - -const limit = pLimit(1); - -const input = [ - limit(() => fetchSomething('foo')), - limit(() => fetchSomething('bar')), - limit(() => doSomething()) -]; - -(async () => { - // Only one promise is run at once - const result = await Promise.all(input); - console.log(result); -})(); -``` - - -## API - -### pLimit(concurrency) - -Returns a `limit` function. - -#### concurrency - -Type: `number`
-Minimum: `1` - -Concurrency limit. - -### limit(fn) - -Returns the promise returned by calling `fn`. - -#### fn - -Type: `Function` - -Promise-returning/async function. - - -## Related - -- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control -- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions -- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions -- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/p-locate/license b/deps/npm/node_modules/p-locate/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/p-locate/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/p-try/index.js b/deps/npm/node_modules/p-try/index.js deleted file mode 100644 index efa2f743381dd4..00000000000000 --- a/deps/npm/node_modules/p-try/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = cb => new Promise(resolve => { - resolve(cb()); -}); diff --git a/deps/npm/node_modules/p-try/license b/deps/npm/node_modules/p-try/license deleted file mode 100644 index 654d0bfe943437..00000000000000 --- a/deps/npm/node_modules/p-try/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/deps/npm/node_modules/p-try/readme.md b/deps/npm/node_modules/p-try/readme.md deleted file mode 100644 index 8e5fdddbe142b5..00000000000000 --- a/deps/npm/node_modules/p-try/readme.md +++ /dev/null @@ -1,38 +0,0 @@ -# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) - -> [`Promise#try()`](https://github.com/ljharb/proposal-promise-try) [ponyfill](https://ponyfill.com) - Starts a promise chain - -[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) - - -## Install - -``` -$ npm install --save p-try -``` - - -## Usage - -```js -const pTry = require('p-try'); - -pTry(() => { - return synchronousFunctionThatMightThrow(); -}).then(value => { - console.log(value); -}).catch(error => { - console.error(error); -}); -``` - - -## Related - -- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome -- [More…](https://github.com/sindresorhus/promise-fun) - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/require-main-filename/.npmignore b/deps/npm/node_modules/require-main-filename/.npmignore deleted file mode 100644 index 6f9fe6badf97de..00000000000000 --- a/deps/npm/node_modules/require-main-filename/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -.DS_Store -.nyc_output diff --git a/deps/npm/node_modules/require-main-filename/.travis.yml b/deps/npm/node_modules/require-main-filename/.travis.yml deleted file mode 100644 index ab61ce77ebe3da..00000000000000 --- a/deps/npm/node_modules/require-main-filename/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -os: - - linux -node_js: - - "0.10" - - "0.12" - - "4.1" - - "node" diff --git a/deps/npm/node_modules/require-main-filename/CHANGELOG.md b/deps/npm/node_modules/require-main-filename/CHANGELOG.md new file mode 100644 index 00000000000000..717d59e35e2e17 --- /dev/null +++ b/deps/npm/node_modules/require-main-filename/CHANGELOG.md @@ -0,0 +1,26 @@ +# 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. + + +# [2.0.0](https://github.com/yargs/require-main-filename/compare/v1.0.2...v2.0.0) (2019-01-28) + + +### Chores + +* drop support for Node 0.10 ([#11](https://github.com/yargs/require-main-filename/issues/11)) ([87f4e13](https://github.com/yargs/require-main-filename/commit/87f4e13)) + + +### BREAKING CHANGES + +* drop support for Node 0.10/0.12 + + + + +## [1.0.2](https://github.com/yargs/require-main-filename/compare/v1.0.1...v1.0.2) (2017-06-16) + + +### Bug Fixes + +* add files to package.json ([#4](https://github.com/yargs/require-main-filename/issues/4)) ([fa29988](https://github.com/yargs/require-main-filename/commit/fa29988)) diff --git a/deps/npm/node_modules/require-main-filename/package.json b/deps/npm/node_modules/require-main-filename/package.json index ed6ca5399fb5db..db63765c7fa725 100644 --- a/deps/npm/node_modules/require-main-filename/package.json +++ b/deps/npm/node_modules/require-main-filename/package.json @@ -1,27 +1,27 @@ { - "_from": "require-main-filename@^1.0.1", - "_id": "require-main-filename@1.0.1", + "_from": "require-main-filename@^2.0.0", + "_id": "require-main-filename@2.0.0", "_inBundle": false, - "_integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "_integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "_location": "/require-main-filename", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "require-main-filename@^1.0.1", + "raw": "require-main-filename@^2.0.0", "name": "require-main-filename", "escapedName": "require-main-filename", - "rawSpec": "^1.0.1", + "rawSpec": "^2.0.0", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "^2.0.0" }, "_requiredBy": [ "/yargs" ], - "_resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "_shasum": "97f717b69d48784f5f526a6c5aa8ffdda055a4d1", - "_spec": "require-main-filename@^1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/yargs", + "_resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "_shasum": "d0b329ecc7cc0f61649f62215be69af54aa8989b", + "_spec": "require-main-filename@^2.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", "author": { "name": "Ben Coe", "email": "ben@npmjs.com" @@ -33,10 +33,14 @@ "deprecated": false, "description": "shim for require.main.filename() that works in as many environments as possible", "devDependencies": { - "chai": "^3.5.0", - "standard": "^6.0.5", - "tap": "^5.2.0" + "chai": "^4.0.0", + "standard": "^10.0.3", + "standard-version": "^4.0.0", + "tap": "^11.0.0" }, + "files": [ + "index.js" + ], "homepage": "https://github.com/yargs/require-main-filename#readme", "keywords": [ "require", @@ -52,7 +56,8 @@ }, "scripts": { "pretest": "standard", + "release": "standard-version", "test": "tap --coverage test.js" }, - "version": "1.0.1" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/require-main-filename/test.js b/deps/npm/node_modules/require-main-filename/test.js deleted file mode 100644 index d89e7dcbaf03d1..00000000000000 --- a/deps/npm/node_modules/require-main-filename/test.js +++ /dev/null @@ -1,36 +0,0 @@ -/* global describe, it */ - -var requireMainFilename = require('./') - -require('tap').mochaGlobals() -require('chai').should() - -describe('require-main-filename', function () { - it('returns require.main.filename in normal circumstances', function () { - requireMainFilename().should.match(/test\.js/) - }) - - it('should use children[0].filename when running on iisnode', function () { - var main = { - filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js', - children: [ {filename: 'D:\\home\\site\\wwwroot\\server.js'} ] - } - requireMainFilename({ - main: main - }).should.match(/server\.js/) - }) - - it('should not use children[0] if no children exist', function () { - var main = { - filename: 'D:\\Program Files (x86)\\iisnode\\interceptor.js', - children: [] - } - requireMainFilename({ - main: main - }).should.match(/interceptor\.js/) - }) - - it('should default to process.cwd() if require.main is undefined', function () { - requireMainFilename({}).should.match(/require-main-filename/) - }) -}) diff --git a/deps/npm/node_modules/wrap-ansi/index.js b/deps/npm/node_modules/wrap-ansi/index.js index ff625435fa1053..5038bb0c534aee 100755 --- a/deps/npm/node_modules/wrap-ansi/index.js +++ b/deps/npm/node_modules/wrap-ansi/index.js @@ -1,68 +1,42 @@ 'use strict'; -var stringWidth = require('string-width'); -var stripAnsi = require('strip-ansi'); - -var ESCAPES = [ - '\u001b', - '\u009b' -]; - -var END_CODE = 39; - -var ESCAPE_CODES = { - 0: 0, - 1: 22, - 2: 22, - 3: 23, - 4: 24, - 7: 27, - 8: 28, - 9: 29, - 30: 39, - 31: 39, - 32: 39, - 33: 39, - 34: 39, - 35: 39, - 36: 39, - 37: 39, - 90: 39, - 40: 49, - 41: 49, - 42: 49, - 43: 49, - 44: 49, - 45: 49, - 46: 49, - 47: 49 -}; +const stringWidth = require('string-width'); +const stripAnsi = require('strip-ansi'); +const ansiStyles = require('ansi-styles'); + +const ESCAPES = new Set([ + '\u001B', + '\u009B' +]); + +const END_CODE = 39; + +const wrapAnsi = code => `${ESCAPES.values().next().value}[${code}m`; -function wrapAnsi(code) { - return ESCAPES[0] + '[' + code + 'm'; -} +// Calculate the length of words split on ' ', ignoring +// the extra characters added by ansi escape codes +const wordLengths = string => string.split(' ').map(character => stringWidth(character)); -// calculate the length of words split on ' ', ignoring -// the extra characters added by ansi escape codes. -function wordLengths(str) { - return str.split(' ').map(function (s) { - return stringWidth(s); - }); -} +// Wrap a long word across multiple rows +// Ansi escape codes do not count towards length +const wrapWord = (rows, word, columns) => { + const characters = [...word]; -// wrap a long word across multiple rows. -// ansi escape codes do not count towards length. -function wrapWord(rows, word, cols) { - var insideEscape = false; - var visible = stripAnsi(rows[rows.length - 1]).length; + let insideEscape = false; + let visible = stringWidth(stripAnsi(rows[rows.length - 1])); - for (var i = 0; i < word.length; i++) { - var x = word[i]; + for (const [index, character] of characters.entries()) { + const characterLength = stringWidth(character); - rows[rows.length - 1] += x; + if (visible + characterLength <= columns) { + rows[rows.length - 1] += character; + } else { + rows.push(character); + visible = 0; + } - if (ESCAPES.indexOf(x) !== -1) { + if (ESCAPES.has(character)) { insideEscape = true; - } else if (insideEscape && x === 'm') { + } else if (insideEscape && character === 'm') { insideEscape = false; continue; } @@ -71,98 +45,144 @@ function wrapWord(rows, word, cols) { continue; } - visible++; + visible += characterLength; - if (visible >= cols && i < word.length - 1) { + if (visible === columns && index < characters.length - 1) { rows.push(''); visible = 0; } } - // it's possible that the last row we copy over is only - // ansi escape characters, handle this edge-case. + // It's possible that the last row we copy over is only + // ansi escape characters, handle this edge-case if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) { rows[rows.length - 2] += rows.pop(); } -} +}; + +// Trims spaces from a string ignoring invisible sequences +const stringVisibleTrimSpacesRight = str => { + const words = str.split(' '); + let last = words.length; + + while (last > 0) { + if (stringWidth(words[last - 1]) > 0) { + break; + } + + last--; + } + + if (last === words.length) { + return str; + } + + return words.slice(0, last).join(' ') + words.slice(last).join(''); +}; -// the wrap-ansi module can be invoked -// in either 'hard' or 'soft' wrap mode. +// The wrap-ansi module can be invoked +// in either 'hard' or 'soft' wrap mode // // 'hard' will never allow a string to take up more -// than cols characters. +// than columns characters // -// 'soft' allows long words to expand past the column length. -function exec(str, cols, opts) { - var options = opts || {}; +// 'soft' allows long words to expand past the column length +const exec = (string, columns, options = {}) => { + if (options.trim !== false && string.trim() === '') { + return ''; + } + + let pre = ''; + let ret = ''; + let escapeCode; + + const lengths = wordLengths(string); + let rows = ['']; - var pre = ''; - var ret = ''; - var escapeCode; + for (const [index, word] of string.split(' ').entries()) { + if (options.trim !== false) { + rows[rows.length - 1] = rows[rows.length - 1].trimLeft(); + } - var lengths = wordLengths(str); - var words = str.split(' '); - var rows = ['']; + let rowLength = stringWidth(rows[rows.length - 1]); - for (var i = 0, word; (word = words[i]) !== undefined; i++) { - var rowLength = stringWidth(rows[rows.length - 1]); + if (index !== 0) { + if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) { + // If we start with a new word but the current row length equals the length of the columns, add a new row + rows.push(''); + rowLength = 0; + } - if (rowLength) { - rows[rows.length - 1] += ' '; - rowLength++; + if (rowLength > 0 || options.trim === false) { + rows[rows.length - 1] += ' '; + rowLength++; + } } - // in 'hard' wrap mode, the length of a line is - // never allowed to extend past 'cols'. - if (lengths[i] > cols && options.hard) { - if (rowLength) { + // In 'hard' wrap mode, the length of a line is + // never allowed to extend past 'columns' + if (options.hard && lengths[index] > columns) { + const remainingColumns = (columns - rowLength); + const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns); + const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns); + if (breaksStartingNextLine < breaksStartingThisLine) { rows.push(''); } - wrapWord(rows, word, cols); + + wrapWord(rows, word, columns); continue; } - if (rowLength + lengths[i] > cols && rowLength > 0) { - if (options.wordWrap === false && rowLength < cols) { - wrapWord(rows, word, cols); + if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) { + if (options.wordWrap === false && rowLength < columns) { + wrapWord(rows, word, columns); continue; } rows.push(''); } + if (rowLength + lengths[index] > columns && options.wordWrap === false) { + wrapWord(rows, word, columns); + continue; + } + rows[rows.length - 1] += word; } - pre = rows.map(function (r) { - return r.trim(); - }).join('\n'); + if (options.trim !== false) { + rows = rows.map(stringVisibleTrimSpacesRight); + } - for (var j = 0; j < pre.length; j++) { - var y = pre[j]; + pre = rows.join('\n'); - ret += y; + for (const [index, character] of [...pre].entries()) { + ret += character; - if (ESCAPES.indexOf(y) !== -1) { - var code = parseFloat(/[0-9][^m]*/.exec(pre.slice(j, j + 4))); + if (ESCAPES.has(character)) { + const code = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4))); escapeCode = code === END_CODE ? null : code; } - if (escapeCode && ESCAPE_CODES[escapeCode]) { - if (pre[j + 1] === '\n') { - ret += wrapAnsi(ESCAPE_CODES[escapeCode]); - } else if (y === '\n') { + const code = ansiStyles.codes.get(Number(escapeCode)); + + if (escapeCode && code) { + if (pre[index + 1] === '\n') { + ret += wrapAnsi(code); + } else if (character === '\n') { ret += wrapAnsi(escapeCode); } } } return ret; -} +}; -// for each line break, invoke the method separately. -module.exports = function (str, cols, opts) { - return String(str).split('\n').map(function (substr) { - return exec(substr, cols, opts); - }).join('\n'); +// For each newline, invoke the method separately +module.exports = (string, columns, options) => { + return String(string) + .normalize() + .split('\n') + .map(line => exec(line, columns, options)) + .join('\n'); }; diff --git a/deps/npm/node_modules/wrap-ansi/license b/deps/npm/node_modules/wrap-ansi/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/deps/npm/node_modules/wrap-ansi/license +++ b/deps/npm/node_modules/wrap-ansi/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..c25448009f304d --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/index.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/lcid/license b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license similarity index 100% rename from deps/npm/node_modules/lcid/license rename to deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/license diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..d12a58a622317f --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/package.json @@ -0,0 +1,85 @@ +{ + "_from": "ansi-regex@^4.1.0", + "_id": "ansi-regex@4.1.0", + "_inBundle": false, + "_integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "_location": "/wrap-ansi/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^4.1.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/wrap-ansi/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "_shasum": "8b9f8f08cf1acb843756a839ca8c7e3168c51997", + "_spec": "ansi-regex@^4.1.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi/node_modules/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "^0.25.0", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "4.1.0" +} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000000000..d19c44667e704b --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/ansi-regex/readme.md @@ -0,0 +1,87 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex([options]) + +Returns a regex for matching ANSI escape codes. + +#### options + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..d506327c3e5576 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +/* eslint-disable yoda */ +module.exports = x => { + if (Number.isNaN(x)) { + return false; + } + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + x === 0x2329 || // LEFT-POINTING ANGLE BRACKET + x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= x && x <= 0x4dbf) || + // CJK Unified Ideographs .. Yi Radicals + (0x4e00 <= x && x <= 0xa4c6) || + // Hangul Jamo Extended-A + (0xa960 <= x && x <= 0xa97c) || + // Hangul Syllables + (0xac00 <= x && x <= 0xd7a3) || + // CJK Compatibility Ideographs + (0xf900 <= x && x <= 0xfaff) || + // Vertical Forms + (0xfe10 <= x && x <= 0xfe19) || + // CJK Compatibility Forms .. Small Form Variants + (0xfe30 <= x && x <= 0xfe6b) || + // Halfwidth and Fullwidth Forms + (0xff01 <= x && x <= 0xff60) || + (0xffe0 <= x && x <= 0xffe6) || + // Kana Supplement + (0x1b000 <= x && x <= 0x1b001) || + // Enclosed Ideographic Supplement + (0x1f200 <= x && x <= 0x1f251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= x && x <= 0x3fffd) + ) + ) { + return true; + } + + return false; +}; diff --git a/deps/npm/node_modules/locate-path/license b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license similarity index 100% rename from deps/npm/node_modules/locate-path/license rename to deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/license diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..f28d7996ce3a72 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,77 @@ +{ + "_from": "is-fullwidth-code-point@^2.0.0", + "_id": "is-fullwidth-code-point@2.0.0", + "_inBundle": false, + "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "_location": "/wrap-ansi/is-fullwidth-code-point", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-fullwidth-code-point@^2.0.0", + "name": "is-fullwidth-code-point", + "escapedName": "is-fullwidth-code-point", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/wrap-ansi/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", + "_spec": "is-fullwidth-code-point@^2.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..093b0281b2c46b --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js index b9bec62440a468..33c9d6c06f7a59 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js +++ b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/index.js @@ -1,36 +1,38 @@ 'use strict'; -var stripAnsi = require('strip-ansi'); -var codePointAt = require('code-point-at'); -var isFullwidthCodePoint = require('is-fullwidth-code-point'); +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex')(); -// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 -module.exports = function (str) { - if (typeof str !== 'string' || str.length === 0) { +module.exports = input => { + input = input.replace(emojiRegex, ' '); + + if (typeof input !== 'string' || input.length === 0) { return 0; } - var width = 0; + input = stripAnsi(input); - str = stripAnsi(str); + let width = 0; - for (var i = 0; i < str.length; i++) { - var code = codePointAt(str, i); + for (let i = 0; i < input.length; i++) { + const code = input.codePointAt(i); - // ignore control characters - if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { continue; } - // surrogates - if (code >= 0x10000) { - i++; + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; } - if (isFullwidthCodePoint(code)) { - width += 2; - } else { - width++; + // Surrogates + if (code > 0xFFFF) { + i++; } + + width += isFullwidthCodePoint(code) ? 2 : 1; } return width; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/license b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/license index 654d0bfe943437..e7af2f77107d73 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/license +++ b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/license @@ -1,21 +1,9 @@ -The MIT License (MIT) +MIT License Copyright (c) Sindre Sorhus (sindresorhus.com) -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json index 1f4dda52ae19ea..d68196008b7678 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json +++ b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/package.json @@ -1,27 +1,27 @@ { - "_from": "string-width@^1.0.1", - "_id": "string-width@1.0.2", + "_from": "string-width@^3.0.0", + "_id": "string-width@3.1.0", "_inBundle": false, - "_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "_integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "_location": "/wrap-ansi/string-width", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "string-width@^1.0.1", + "raw": "string-width@^3.0.0", "name": "string-width", "escapedName": "string-width", - "rawSpec": "^1.0.1", + "rawSpec": "^3.0.0", "saveSpec": null, - "fetchSpec": "^1.0.1" + "fetchSpec": "^3.0.0" }, "_requiredBy": [ "/wrap-ansi" ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", - "_spec": "string-width@^1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/wrap-ansi", + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "_shasum": "22767be21b62af1081574306f69ac51b62203961", + "_spec": "string-width@^3.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -32,18 +32,18 @@ }, "bundleDependencies": false, "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" }, "deprecated": false, "description": "Get the visual width of a string - the number of columns required to display it", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^1.0.1", + "xo": "^0.23.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" }, "files": [ "index.js" @@ -84,5 +84,5 @@ "scripts": { "test": "xo && ava" }, - "version": "1.0.2" + "version": "3.1.0" } diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md index 1ab42c93580ecb..d39d95f56cf3f8 100644 --- a/deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md +++ b/deps/npm/node_modules/wrap-ansi/node_modules/string-width/readme.md @@ -2,7 +2,7 @@ > Get the visual width of a string - the number of columns required to display it -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. Useful to be able to measure the actual width of command-line output. @@ -10,7 +10,7 @@ Useful to be able to measure the actual width of command-line output. ## Install ``` -$ npm install --save string-width +$ npm install string-width ``` @@ -27,6 +27,9 @@ stringWidth('\u001b[1m古\u001b[22m'); stringWidth('a'); //=> 1 + +stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +// => 5 ``` diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts new file mode 100644 index 00000000000000..44e954d0c724d8 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,15 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +export default function stripAnsi(string: string): string; diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9788c96dfa3b0c --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/index.js @@ -0,0 +1,7 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; + +module.exports = stripAnsi; +module.exports.default = stripAnsi; diff --git a/deps/npm/node_modules/mem/license b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license similarity index 100% rename from deps/npm/node_modules/mem/license rename to deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/license diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..c217180370483d --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/package.json @@ -0,0 +1,87 @@ +{ + "_from": "strip-ansi@^5.0.0", + "_id": "strip-ansi@5.2.0", + "_inBundle": false, + "_integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "_location": "/wrap-ansi/strip-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-ansi@^5.0.0", + "name": "strip-ansi", + "escapedName": "strip-ansi", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/wrap-ansi", + "/wrap-ansi/string-width" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "_shasum": "8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae", + "_spec": "strip-ansi@^5.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/wrap-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "deprecated": false, + "description": "Strip ANSI escape codes from a string", + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/chalk/strip-ansi#readme", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "strip-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "version": "5.2.0" +} diff --git a/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000000000..8681fe8af44242 --- /dev/null +++ b/deps/npm/node_modules/wrap-ansi/node_modules/strip-ansi/readme.md @@ -0,0 +1,61 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + +--- + +
+ + Get professional support for 'strip-ansi' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/deps/npm/node_modules/wrap-ansi/package.json b/deps/npm/node_modules/wrap-ansi/package.json index 6ac0d86498986d..f4e7ba490720d3 100644 --- a/deps/npm/node_modules/wrap-ansi/package.json +++ b/deps/npm/node_modules/wrap-ansi/package.json @@ -1,31 +1,29 @@ { - "_from": "wrap-ansi@^2.0.0", - "_id": "wrap-ansi@2.1.0", + "_from": "wrap-ansi@^5.1.0", + "_id": "wrap-ansi@5.1.0", "_inBundle": false, - "_integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "_integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "_location": "/wrap-ansi", "_phantomChildren": { - "code-point-at": "1.1.0", - "number-is-nan": "1.0.1" + "emoji-regex": "7.0.3" }, "_requested": { "type": "range", "registry": true, - "raw": "wrap-ansi@^2.0.0", + "raw": "wrap-ansi@^5.1.0", "name": "wrap-ansi", "escapedName": "wrap-ansi", - "rawSpec": "^2.0.0", + "rawSpec": "^5.1.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "^5.1.0" }, "_requiredBy": [ - "/cliui", - "/tacks/cliui" + "/cliui" ], - "_resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "_shasum": "d8fc3d284dd05794fe84973caecdd1cf824fdd85", - "_spec": "wrap-ansi@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/cliui", + "_resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "_shasum": "1fd1f67235d5b6d0fee781056001bfb694c03b09", + "_spec": "wrap-ansi@^5.1.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/cliui", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -36,22 +34,22 @@ }, "bundleDependencies": false, "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" }, "deprecated": false, "description": "Wordwrap a string with ANSI escape codes", "devDependencies": { - "ava": "^0.16.0", - "chalk": "^1.1.0", - "coveralls": "^2.11.4", - "has-ansi": "^2.0.0", - "nyc": "^6.2.1", - "strip-ansi": "^3.0.0", - "xo": "*" + "ava": "^1.2.1", + "chalk": "^2.4.2", + "coveralls": "^3.0.3", + "has-ansi": "^3.0.0", + "nyc": "^13.3.0", + "xo": "^0.24.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" }, "files": [ "index.js" @@ -85,36 +83,13 @@ "text" ], "license": "MIT", - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - }, - { - "name": "JD Ballard", - "email": "i.am.qix@gmail.com", - "url": "github.com/qix-" - }, - { - "name": "Benjamin Coe", - "email": "ben@npmjs.com", - "url": "github.com/bcoe" - } - ], "name": "wrap-ansi", "repository": { "type": "git", "url": "git+https://github.com/chalk/wrap-ansi.git" }, "scripts": { - "coveralls": "nyc report --reporter=text-lcov | coveralls", "test": "xo && nyc ava" }, - "version": "2.1.0" + "version": "5.1.0" } diff --git a/deps/npm/node_modules/wrap-ansi/readme.md b/deps/npm/node_modules/wrap-ansi/readme.md index 59fc96bda4c0c6..73b87de22f52fb 100644 --- a/deps/npm/node_modules/wrap-ansi/readme.md +++ b/deps/npm/node_modules/wrap-ansi/readme.md @@ -1,12 +1,12 @@ # wrap-ansi [![Build Status](https://travis-ci.org/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.org/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master) -> Wordwrap a string with [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) +> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) ## Install ``` -$ npm install --save wrap-ansi +$ npm install wrap-ansi ``` @@ -24,6 +24,20 @@ console.log(wrapAnsi(input, 20)); +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + ## API @@ -45,6 +59,8 @@ Number of columns to wrap the text to. #### options +Type: `Object` + ##### hard Type: `boolean`
@@ -59,6 +75,13 @@ Default: `true` By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary. +##### trim + +Type: `boolean`
+Default: `true` + +Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim. + ## Related @@ -68,6 +91,18 @@ By default, an attempt is made to split words at spaces, ensuring that they don' - [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures. +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) +- [Benjamin Coe](https://github.com/bcoe) + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + ## License -MIT © [Sindre Sorhus](https://sindresorhus.com) +MIT diff --git a/deps/npm/node_modules/yargs-parser/CHANGELOG.md b/deps/npm/node_modules/yargs-parser/CHANGELOG.md index a0186f2330f1c1..18ed4b34cbccaa 100644 --- a/deps/npm/node_modules/yargs-parser/CHANGELOG.md +++ b/deps/npm/node_modules/yargs-parser/CHANGELOG.md @@ -1,7 +1,214 @@ -# Change Log +# Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [15.0.0](https://github.com/yargs/yargs-parser/compare/v14.0.0...v15.0.0) (2019-10-07) + + +### Features + +* rework `collect-unknown-options` into `unknown-options-as-args`, providing more comprehensive functionality ([ef771ca](https://github.com/yargs/yargs-parser/commit/ef771ca)) + + +### BREAKING CHANGES + +* rework `collect-unknown-options` into `unknown-options-as-args`, providing more comprehensive functionality + + + +## [14.0.0](https://github.com/yargs/yargs-parser/compare/v13.1.1...v14.0.0) (2019-09-06) + + +### Bug Fixes + +* boolean arrays with default values ([#185](https://github.com/yargs/yargs-parser/issues/185)) ([7d42572](https://github.com/yargs/yargs-parser/commit/7d42572)) +* boolean now behaves the same as other array types ([#184](https://github.com/yargs/yargs-parser/issues/184)) ([17ca3bd](https://github.com/yargs/yargs-parser/commit/17ca3bd)) +* eatNargs() for 'opt.narg === 0' and boolean typed options ([#188](https://github.com/yargs/yargs-parser/issues/188)) ([c5a1db0](https://github.com/yargs/yargs-parser/commit/c5a1db0)) +* maybeCoerceNumber now takes precedence over coerce return value ([#182](https://github.com/yargs/yargs-parser/issues/182)) ([2f26436](https://github.com/yargs/yargs-parser/commit/2f26436)) +* take into account aliases when appending arrays from config object ([#199](https://github.com/yargs/yargs-parser/issues/199)) ([f8a2d3f](https://github.com/yargs/yargs-parser/commit/f8a2d3f)) + + +### Features + +* add configuration option to "collect-unknown-options" ([#181](https://github.com/yargs/yargs-parser/issues/181)) ([7909cc4](https://github.com/yargs/yargs-parser/commit/7909cc4)) +* maybeCoerceNumber() now takes into account arrays ([#187](https://github.com/yargs/yargs-parser/issues/187)) ([31c204b](https://github.com/yargs/yargs-parser/commit/31c204b)) + + +### BREAKING CHANGES + +* unless "parse-numbers" is set to "false", arrays of numeric strings are now parsed as numbers, rather than strings. +* we have dropped the broken "defaulted" functionality; we would like to revisit adding this in the future. +* maybeCoerceNumber now takes precedence over coerce return value (#182) + + + +### [13.1.1](https://www.github.com/yargs/yargs-parser/compare/v13.1.0...v13.1.1) (2019-06-10) + + +### Bug Fixes + +* convert values to strings when tokenizing ([#167](https://www.github.com/yargs/yargs-parser/issues/167)) ([57b7883](https://www.github.com/yargs/yargs-parser/commit/57b7883)) +* nargs should allow duplicates when duplicate-arguments-array=false ([#164](https://www.github.com/yargs/yargs-parser/issues/164)) ([47ccb0b](https://www.github.com/yargs/yargs-parser/commit/47ccb0b)) +* should populate "_" when given config with "short-option-groups" false ([#179](https://www.github.com/yargs/yargs-parser/issues/179)) ([6055974](https://www.github.com/yargs/yargs-parser/commit/6055974)) + +## [13.1.0](https://github.com/yargs/yargs-parser/compare/v13.0.0...v13.1.0) (2019-05-05) + + +### Features + +* add `strip-aliased` and `strip-dashed` configuration options. ([#172](https://github.com/yargs/yargs-parser/issues/172)) ([a3936aa](https://github.com/yargs/yargs-parser/commit/a3936aa)) +* support boolean which do not consume next argument. ([#171](https://github.com/yargs/yargs-parser/issues/171)) ([0ae7fcb](https://github.com/yargs/yargs-parser/commit/0ae7fcb)) + + + + +# [13.0.0](https://github.com/yargs/yargs-parser/compare/v12.0.0...v13.0.0) (2019-02-02) + + +### Features + +* don't coerce number from string with leading '0' or '+' ([#158](https://github.com/yargs/yargs-parser/issues/158)) ([18d0fd5](https://github.com/yargs/yargs-parser/commit/18d0fd5)) + + +### BREAKING CHANGES + +* options with leading '+' or '0' now parse as strings + + + + +# [12.0.0](https://github.com/yargs/yargs-parser/compare/v11.1.1...v12.0.0) (2019-01-29) + + +### Bug Fixes + +* better handling of quoted strings ([#153](https://github.com/yargs/yargs-parser/issues/153)) ([2fb71b2](https://github.com/yargs/yargs-parser/commit/2fb71b2)) + + +### Features + +* default value is now used if no right-hand value provided for numbers/strings ([#156](https://github.com/yargs/yargs-parser/issues/156)) ([5a7c46a](https://github.com/yargs/yargs-parser/commit/5a7c46a)) + + +### BREAKING CHANGES + +* a flag with no right-hand value no longer populates defaulted options with `undefined`. +* quotes at beginning and endings of strings are not removed during parsing. + + + + +## [11.1.1](https://github.com/yargs/yargs-parser/compare/v11.1.0...v11.1.1) (2018-11-19) + + +### Bug Fixes + +* ensure empty string is added into argv._ ([#140](https://github.com/yargs/yargs-parser/issues/140)) ([79cda98](https://github.com/yargs/yargs-parser/commit/79cda98)) + + +### Reverts + +* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([f4a3063](https://github.com/yargs/yargs-parser/commit/f4a3063)) + + + + +# [11.1.0](https://github.com/yargs/yargs-parser/compare/v11.0.0...v11.1.0) (2018-11-10) + + +### Bug Fixes + +* handling of one char alias ([#139](https://github.com/yargs/yargs-parser/issues/139)) ([ee56e31](https://github.com/yargs/yargs-parser/commit/ee56e31)) + + +### Features + +* add halt-at-non-option configuration option ([#130](https://github.com/yargs/yargs-parser/issues/130)) ([a849fce](https://github.com/yargs/yargs-parser/commit/a849fce)) + + + + +# [11.0.0](https://github.com/yargs/yargs-parser/compare/v10.1.0...v11.0.0) (2018-10-06) + + +### Bug Fixes + +* flatten-duplicate-arrays:false for more than 2 arrays ([#128](https://github.com/yargs/yargs-parser/issues/128)) ([2bc395f](https://github.com/yargs/yargs-parser/commit/2bc395f)) +* hyphenated flags combined with dot notation broke parsing ([#131](https://github.com/yargs/yargs-parser/issues/131)) ([dc788da](https://github.com/yargs/yargs-parser/commit/dc788da)) +* make requiresArg work in conjunction with arrays ([#136](https://github.com/yargs/yargs-parser/issues/136)) ([77ae1d4](https://github.com/yargs/yargs-parser/commit/77ae1d4)) + + +### Chores + +* update dependencies ([6dc42a1](https://github.com/yargs/yargs-parser/commit/6dc42a1)) + + +### Features + +* also add camelCase array options ([#125](https://github.com/yargs/yargs-parser/issues/125)) ([08c0117](https://github.com/yargs/yargs-parser/commit/08c0117)) +* array.type can now be provided, supporting coercion ([#132](https://github.com/yargs/yargs-parser/issues/132)) ([4b8cfce](https://github.com/yargs/yargs-parser/commit/4b8cfce)) + + +### BREAKING CHANGES + +* drops Node 4 support +* the argv object is now populated differently (correctly) when hyphens and dot notation are used in conjunction. + + + + +# [10.1.0](https://github.com/yargs/yargs-parser/compare/v10.0.0...v10.1.0) (2018-06-29) + + +### Features + +* add `set-placeholder-key` configuration ([#123](https://github.com/yargs/yargs-parser/issues/123)) ([19386ee](https://github.com/yargs/yargs-parser/commit/19386ee)) + + + + +# [10.0.0](https://github.com/yargs/yargs-parser/compare/v9.0.2...v10.0.0) (2018-04-04) + + +### Bug Fixes + +* do not set boolean flags if not defined in `argv` ([#119](https://github.com/yargs/yargs-parser/issues/119)) ([f6e6599](https://github.com/yargs/yargs-parser/commit/f6e6599)) + + +### BREAKING CHANGES + +* `boolean` flags defined without a `default` value will now behave like other option type and won't be set in the parsed results when the user doesn't set the corresponding CLI arg. + +Previous behavior: +```js +var parse = require('yargs-parser'); + +parse('--flag', {boolean: ['flag']}); +// => { _: [], flag: true } + +parse('--no-flag', {boolean: ['flag']}); +// => { _: [], flag: false } + +parse('', {boolean: ['flag']}); +// => { _: [], flag: false } +``` + +New behavior: +```js +var parse = require('yargs-parser'); + +parse('--flag', {boolean: ['flag']}); +// => { _: [], flag: true } + +parse('--no-flag', {boolean: ['flag']}); +// => { _: [], flag: false } + +parse('', {boolean: ['flag']}); +// => { _: [] } => flag not set similarly to other option type +``` + + + ## [9.0.2](https://github.com/yargs/yargs-parser/compare/v9.0.1...v9.0.2) (2018-01-20) diff --git a/deps/npm/node_modules/yargs-parser/README.md b/deps/npm/node_modules/yargs-parser/README.md index 6d6d0d4c9c6832..5f1ccb987db443 100644 --- a/deps/npm/node_modules/yargs-parser/README.md +++ b/deps/npm/node_modules/yargs-parser/README.md @@ -1,9 +1,8 @@ # yargs-parser -[![Build Status](https://travis-ci.org/yargs/yargs-parser.png)](https://travis-ci.org/yargs/yargs-parser) +[![Build Status](https://travis-ci.org/yargs/yargs-parser.svg)](https://travis-ci.org/yargs/yargs-parser) [![Coverage Status](https://coveralls.io/repos/yargs/yargs-parser/badge.svg?branch=)](https://coveralls.io/r/yargs/yargs-parser?branch=master) [![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser) -[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/yargs-parser/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/yargs-parser) [![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) @@ -32,7 +31,7 @@ node example.js --foo=33 --bar hello _or parse a string!_ ```js -var argv = require('./')('--foo=99 --bar=33') +var argv = require('yargs-parser')('--foo=99 --bar=33') console.log(argv) ``` @@ -59,20 +58,24 @@ Parses command line arguments returning a simple mapping of keys and values. * `args`: a string or array of strings representing the options to parse. * `opts`: provide a set of hints indicating how `args` should be parsed: * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`. - * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`. + * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.
+ Indicate that keys should be parsed as an array and coerced to booleans / numbers:
+ `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`. * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`. - * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided - (or throws an error), e.g. `{coerce: {foo: function (arg) {return modifiedArg}}}`. + (or throws an error). For arrays the function is called only once for the entire array:
+ `{coerce: {foo: function (arg) {return modifiedArg}}}`. + * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed). + * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:
+ `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`. + * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`. * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`. * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed. * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`. * `opts.normalize`: `path.normalize()` will be applied to values set to this key. - * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). - * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)). * `opts.number`: keys should be treated as numbers. - * `opts['--']`: arguments after the end-of-options flag `--` will be set to the `argv.['--']` array instead of being set to the `argv._` array. + * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`). **returns:** @@ -298,6 +301,113 @@ node example.js a -b -- x y { _: [ 'a' ], '--': [ 'x', 'y' ], b: true } ``` +### set placeholder key + +* default: `false`. +* key: `set-placeholder-key`. + +Should a placeholder be added for keys not set via the corresponding CLI argument? + +_If disabled:_ + +```sh +node example.js -a 1 -c 2 +{ _: [], a: 1, c: 2 } +``` + +_If enabled:_ + +```sh +node example.js -a 1 -c 2 +{ _: [], a: 1, b: undefined, c: 2 } +``` + +### halt at non-option + +* default: `false`. +* key: `halt-at-non-option`. + +Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line. + +_If disabled:_ + +```sh +node example.js -a run b -x y +{ _: [ 'b' ], a: 'run', x: 'y' } +``` + +_If enabled:_ + +```sh +node example.js -a run b -x y +{ _: [ 'b', '-x', 'y' ], a: 'run' } +``` + +### strip aliased + +* default: `false` +* key: `strip-aliased` + +Should aliases be removed before returning results? + +_If disabled:_ + +```sh +node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 } +``` + +_If enabled:_ + +```sh +node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +### strip dashed + +* default: `false` +* key: `strip-dashed` + +Should dashed keys be removed before returning results? This option has no effect if +`camel-case-expansion` is disabled. + +_If disabled:_ + +```sh +node example.js --test-field 1 +{ _: [], 'test-field': 1, testField: 1 } +``` + +_If enabled:_ + +```sh +node example.js --test-field 1 +{ _: [], testField: 1 } +``` + +### unknown options as args + +* default: `false` +* key: `unknown-options-as-args` + +Should unknown options be treated like regular arguments? An unknown option is one that is not +configured in `opts`. + +_If disabled_ + +```sh +node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true } +``` + +_If enabled_ + +```sh +node example.js --unknown-option --known-option 2 --string-option --unknown-option2 +{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' } +``` + ## Special Thanks The yargs project evolves from optimist and minimist. It owes its diff --git a/deps/npm/node_modules/yargs-parser/index.js b/deps/npm/node_modules/yargs-parser/index.js index d39414b73782bb..72685532119949 100644 --- a/deps/npm/node_modules/yargs-parser/index.js +++ b/deps/npm/node_modules/yargs-parser/index.js @@ -1,4 +1,5 @@ var camelCase = require('camelcase') +var decamelize = require('decamelize') var path = require('path') var tokenizeArgString = require('./lib/tokenize-arg-string') var util = require('util') @@ -8,9 +9,10 @@ function parse (args, opts) { // allow a string argument to be passed in rather // than an argv array. args = tokenizeArgString(args) + // aliases might have transitive relationships, normalize this. var aliases = combineAliases(opts.alias || {}) - var configuration = assign({ + var configuration = Object.assign({ 'short-option-groups': true, 'camel-case-expansion': true, 'dot-notation': true, @@ -20,7 +22,12 @@ function parse (args, opts) { 'duplicate-arguments-array': true, 'flatten-duplicate-arrays': true, 'populate--': false, - 'combine-arrays': false + 'combine-arrays': false, + 'set-placeholder-key': false, + 'halt-at-non-option': false, + 'strip-aliased': false, + 'strip-dashed': false, + 'unknown-options-as-args': false }, opts.configuration) var defaults = opts.default || {} var configObjects = opts.configObjects || [] @@ -29,9 +36,7 @@ function parse (args, opts) { var notFlagsArgv = notFlagsOption ? '--' : '_' var newAliases = {} // allow a i18n handler to be passed in, default to a fake one (util.format). - var __ = opts.__ || function (str) { - return util.format.apply(util, Array.prototype.slice.call(arguments)) - } + var __ = opts.__ || util.format var error = null var flags = { aliases: {}, @@ -42,43 +47,67 @@ function parse (args, opts) { counts: {}, normalize: {}, configs: {}, - defaulted: {}, nargs: {}, - coercions: {} + coercions: {}, + keys: [] } var negative = /^-[0-9]+(\.[0-9]+)?/ var negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)') - ;[].concat(opts.array).filter(Boolean).forEach(function (key) { + ;[].concat(opts.array).filter(Boolean).forEach(function (opt) { + var key = opt.key || opt + + // assign to flags[bools|strings|numbers] + const assignment = Object.keys(opt).map(function (key) { + return ({ + boolean: 'bools', + string: 'strings', + number: 'numbers' + })[key] + }).filter(Boolean).pop() + + // assign key to be coerced + if (assignment) { + flags[assignment][key] = true + } + flags.arrays[key] = true + flags.keys.push(key) }) ;[].concat(opts.boolean).filter(Boolean).forEach(function (key) { flags.bools[key] = true + flags.keys.push(key) }) ;[].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true + flags.keys.push(key) }) ;[].concat(opts.number).filter(Boolean).forEach(function (key) { flags.numbers[key] = true + flags.keys.push(key) }) ;[].concat(opts.count).filter(Boolean).forEach(function (key) { flags.counts[key] = true + flags.keys.push(key) }) ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) { flags.normalize[key] = true + flags.keys.push(key) }) Object.keys(opts.narg || {}).forEach(function (k) { flags.nargs[k] = opts.narg[k] + flags.keys.push(k) }) Object.keys(opts.coerce || {}).forEach(function (k) { flags.coercions[k] = opts.coerce[k] + flags.keys.push(k) }) if (Array.isArray(opts.config) || typeof opts.config === 'string') { @@ -103,17 +132,7 @@ function parse (args, opts) { }) var argv = { _: [] } - - Object.keys(flags.bools).forEach(function (key) { - setArg(key, !(key in defaults) ? false : defaults[key]) - setDefaulted(key) - }) - var notFlags = [] - if (args.indexOf('--') !== -1) { - notFlags = args.slice(args.indexOf('--') + 1) - args = args.slice(0, args.indexOf('--')) - } for (var i = 0; i < args.length; i++) { var arg = args[i] @@ -124,8 +143,10 @@ function parse (args, opts) { var next var value - // -- seperated by = - if (arg.match(/^--.+=/) || ( + if (isUnknownOptionAsArg(arg)) { + argv._.push(arg) + // -- separated by = + } else if (arg.match(/^--.+=/) || ( !configuration['short-option-groups'] && arg.match(/^-.+=/) )) { // Using [\s\S] instead of . because js doesn't support the @@ -138,7 +159,7 @@ function parse (args, opts) { args.splice(i + 1, 0, m[2]) i = eatNargs(i, m[1], args) // arrays format = '--f=a b c' - } else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) { + } else if (checkAllAliases(m[1], flags.arrays)) { args.splice(i + 1, 0, m[2]) i = eatArray(i, m[1], args) } else { @@ -146,19 +167,20 @@ function parse (args, opts) { } } else if (arg.match(negatedBoolean) && configuration['boolean-negation']) { key = arg.match(negatedBoolean)[1] - setArg(key, false) + setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false) - // -- seperated by space. + // -- separated by space. } else if (arg.match(/^--.+/) || ( - !configuration['short-option-groups'] && arg.match(/^-.+/) + !configuration['short-option-groups'] && arg.match(/^-[^-]+/) )) { key = arg.match(/^--?(.+)/)[1] // nargs format = '--foo a b c' - if (checkAllAliases(key, flags.nargs)) { + // should be truthy even if: flags.nargs[key] === 0 + if (checkAllAliases(key, flags.nargs) !== false) { i = eatNargs(i, key, args) // array format = '--foo a b c' - } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) { + } else if (checkAllAliases(key, flags.arrays)) { i = eatArray(i, key, args) } else { next = args[i + 1] @@ -173,16 +195,16 @@ function parse (args, opts) { setArg(key, next) i++ } else { - setArg(key, defaultForType(guessType(key, flags))) + setArg(key, defaultValue(key)) } } - // dot-notation flag seperated by '='. + // dot-notation flag separated by '='. } else if (arg.match(/^-.\..+=/)) { m = arg.match(/^-([^=]+)=([\s\S]*)$/) setArg(m[1], m[2]) - // dot-notation flag seperated by space. + // dot-notation flag separated by space. } else if (arg.match(/^-.\..+/)) { next = args[i + 1] key = arg.match(/^-(.\..+)/)[1] @@ -193,7 +215,7 @@ function parse (args, opts) { setArg(key, next) i++ } else { - setArg(key, defaultForType(guessType(key, flags))) + setArg(key, defaultValue(key)) } } else if (arg.match(/^-[^-]+/) && !arg.match(negative)) { letters = arg.slice(1, -1).split('') @@ -211,7 +233,7 @@ function parse (args, opts) { args.splice(i + 1, 0, value) i = eatNargs(i, key, args) // array format = '-f=a b c' - } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) { + } else if (checkAllAliases(key, flags.arrays)) { args.splice(i + 1, 0, value) i = eatArray(i, key, args) } else { @@ -240,7 +262,7 @@ function parse (args, opts) { broken = true break } else { - setArg(letters[j], defaultForType(guessType(letters[j], flags))) + setArg(letters[j], defaultValue(letters[j])) } } @@ -248,10 +270,11 @@ function parse (args, opts) { if (!broken && key !== '-') { // nargs format = '-f a b c' - if (checkAllAliases(key, flags.nargs)) { + // should be truthy even if: flags.nargs[key] === 0 + if (checkAllAliases(key, flags.nargs) !== false) { i = eatNargs(i, key, args) // array format = '-f a b c' - } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) { + } else if (checkAllAliases(key, flags.arrays)) { i = eatArray(i, key, args) } else { next = args[i + 1] @@ -266,10 +289,16 @@ function parse (args, opts) { setArg(key, next) i++ } else { - setArg(key, defaultForType(guessType(key, flags))) + setArg(key, defaultValue(key)) } } } + } else if (arg === '--') { + notFlags = args.slice(i + 1) + break + } else if (configuration['halt-at-non-option']) { + notFlags = args.slice(i) + break } else { argv._.push(maybeCoerceNumber('_', arg)) } @@ -287,6 +316,7 @@ function parse (args, opts) { setConfigObjects() applyDefaultsAndAliases(argv, flags.aliases, defaults) applyCoercions(argv) + if (configuration['set-placeholder-key']) setPlaceholderKeys(argv) // for any counts either not in args or without an explicit default, set to 0 Object.keys(flags.counts).forEach(function (key) { @@ -299,17 +329,39 @@ function parse (args, opts) { argv[notFlagsArgv].push(key) }) + if (configuration['camel-case-expansion'] && configuration['strip-dashed']) { + Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => { + delete argv[key] + }) + } + + if (configuration['strip-aliased']) { + // XXX Switch to [].concat(...Object.values(aliases)) once node.js 6 is dropped + ;[].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => { + if (configuration['camel-case-expansion']) { + delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')] + } + + delete argv[alias] + }) + } + // how many arguments should we consume, based // on the nargs option? function eatNargs (i, key, args) { var ii const toEat = checkAllAliases(key, flags.nargs) + if (toEat === 0) { + setArg(key, defaultValue(key)) + return i + } + // nargs will not consume flag arguments, e.g., -abc, --foo, // and terminates when one is observed. var available = 0 for (ii = i + 1; ii < args.length; ii++) { - if (!args[ii].match(/^-[^0-9]/)) available++ + if (!args[ii].match(/^-[^0-9]/) || isUnknownOptionAsArg(args[ii])) available++ else break } @@ -327,38 +379,36 @@ function parse (args, opts) { // following it... YUM! // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"] function eatArray (i, key, args) { - var start = i + 1 - var argsToSet = [] - var multipleArrayFlag = i > 0 - for (var ii = i + 1; ii < args.length; ii++) { - if (/^-/.test(args[ii]) && !negative.test(args[ii])) { - if (ii === start) { - setArg(key, defaultForType('array')) - } - multipleArrayFlag = true - break + let argsToSet = [] + let next = args[i + 1] + + if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) { + argsToSet.push(true) + } else if (isUndefined(next) || (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) { + // for keys without value ==> argsToSet remains an empty [] + // set user default value, if available + if (defaults.hasOwnProperty(key)) { + argsToSet.push(defaults[key]) } - i = ii - argsToSet.push(args[ii]) - } - if (multipleArrayFlag) { - setArg(key, argsToSet.map(function (arg) { - return processValue(key, arg) - })) } else { - argsToSet.forEach(function (arg) { - setArg(key, arg) - }) + for (var ii = i + 1; ii < args.length; ii++) { + next = args[ii] + if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next)) break + i = ii + argsToSet.push(processValue(key, next)) + } } + setArg(key, argsToSet) return i } function setArg (key, val) { - unsetDefaulted(key) - if (/-/.test(key) && configuration['camel-case-expansion']) { - addNewAlias(key, camelCase(key)) + var alias = key.split('.').map(function (prop) { + return camelCase(prop) + }).join('.') + addNewAlias(key, alias) } var value = processValue(key, val) @@ -367,7 +417,7 @@ function parse (args, opts) { setKey(argv, splitKey, value) // handle populating aliases of the full key - if (flags.aliases[key]) { + if (flags.aliases[key] && flags.aliases[key].forEach) { flags.aliases[key].forEach(function (x) { x = x.split('.') setKey(argv, x, value) @@ -414,12 +464,22 @@ function parse (args, opts) { } function processValue (key, val) { + // strings may be quoted, clean this up as we assign values. + if (typeof val === 'string' && + (val[0] === "'" || val[0] === '"') && + val[val.length - 1] === val[0] + ) { + val = val.substring(1, val.length - 1) + } + // handle parsing boolean arguments --foo=true --bar false. if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) { if (typeof val === 'string') val = val === 'true' } - var value = maybeCoerceNumber(key, val) + var value = Array.isArray(val) + ? val.map(function (v) { return maybeCoerceNumber(key, v) }) + : maybeCoerceNumber(key, val) // increment a count given as arg (either no value or value parsed as boolean) if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) { @@ -435,7 +495,7 @@ function parse (args, opts) { } function maybeCoerceNumber (key, value) { - if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.coercions)) { + if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) { const shouldCoerceNumber = isNumber(value) && configuration['parse-numbers'] && ( Number.isSafeInteger(Math.floor(value)) ) @@ -498,7 +558,7 @@ function parse (args, opts) { } else { // setting arguments via CLI takes precedence over // values within the config file. - if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) { + if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) { setArg(fullKey, value) } } @@ -527,7 +587,7 @@ function parse (args, opts) { return camelCase(key) }) - if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && (!hasKey(argv, keys) || flags.defaulted[keys.join('.')])) { + if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) { setArg(keys.join('.'), process.env[envVar]) } } @@ -542,7 +602,7 @@ function parse (args, opts) { coerce = checkAllAliases(key, flags.coercions) if (typeof coerce === 'function') { try { - var value = coerce(argv[key]) + var value = maybeCoerceNumber(key, coerce(argv[key])) ;([].concat(flags.aliases[key] || [], key)).forEach(ali => { applied[ali] = argv[ali] = value }) @@ -554,6 +614,15 @@ function parse (args, opts) { }) } + function setPlaceholderKeys (argv) { + flags.keys.forEach((key) => { + // don't set placeholder keys for dot notation options 'foo.bar'. + if (~key.indexOf('.')) return + if (typeof argv[key] === 'undefined') argv[key] = undefined + }) + return argv + } + function applyDefaultsAndAliases (obj, aliases, defaults) { Object.keys(defaults).forEach(function (key) { if (!hasKey(obj, key.split('.'))) { @@ -588,6 +657,10 @@ function parse (args, opts) { if (!configuration['dot-notation']) keys = [keys.join('.')] keys.slice(0, -1).forEach(function (key, index) { + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + key = sanitizeKey(key) + if (typeof o === 'object' && o[key] === undefined) { o[key] = {} } @@ -607,17 +680,27 @@ function parse (args, opts) { } }) - var key = keys[keys.length - 1] + // TODO(bcoe): in the next major version of yargs, switch to + // Object.create(null) for dot notation: + const key = sanitizeKey(keys[keys.length - 1]) + + const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays) + const isValueArray = Array.isArray(value) + let duplicate = configuration['duplicate-arguments-array'] - var isTypeArray = checkAllAliases(keys.join('.'), flags.arrays) - var isValueArray = Array.isArray(value) - var duplicate = configuration['duplicate-arguments-array'] + // nargs has higher priority than duplicate + if (!duplicate && checkAllAliases(key, flags.nargs)) { + duplicate = true + if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) { + o[key] = undefined + } + } if (value === increment) { o[key] = increment(o[key]) } else if (Array.isArray(o[key])) { if (duplicate && isTypeArray && isValueArray) { - o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : [o[key]].concat([value]) + o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]) } else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) { o[key] = value } else { @@ -625,7 +708,7 @@ function parse (args, opts) { } } else if (o[key] === undefined && isTypeArray) { o[key] = isValueArray ? value : [value] - } else if (duplicate && !(o[key] === undefined || checkAllAliases(key, flags.bools) || checkAllAliases(keys.join('.'), flags.bools) || checkAllAliases(key, flags.counts))) { + } else if (duplicate && !(o[key] === undefined || checkAllAliases(key, flags.counts))) { o[key] = [ o[key], value ] } else { o[key] = value @@ -633,8 +716,8 @@ function parse (args, opts) { } // extend the aliases list with inferred aliases. - function extendAliases () { - Array.prototype.slice.call(arguments).forEach(function (obj) { + function extendAliases (...args) { + args.forEach(function (obj) { Object.keys(obj || {}).forEach(function (key) { // short-circuit if we've already added a key // to the aliases array, for example it might @@ -652,6 +735,16 @@ function parse (args, opts) { } } }) + // For "--optionName", also set argv['option-name'] + flags.aliases[key].concat(key).forEach(function (x) { + if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) { + var c = decamelize(x, '-') + if (c !== key && flags.aliases[key].indexOf(c) === -1) { + flags.aliases[key].push(c) + newAliases[c] = true + } + } + }) flags.aliases[key].forEach(function (x) { flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) { return x !== y @@ -667,24 +760,89 @@ function parse (args, opts) { var toCheck = [].concat(flags.aliases[key] || [], key) toCheck.forEach(function (key) { - if (flag[key]) isSet = flag[key] + if (flag.hasOwnProperty(key)) isSet = flag[key] }) return isSet } - function setDefaulted (key) { - [].concat(flags.aliases[key] || [], key).forEach(function (k) { - flags.defaulted[k] = true + function hasAnyFlag (key) { + // XXX Switch to [].concat(...Object.values(flags)) once node.js 6 is dropped + var toCheck = [].concat(...Object.keys(flags).map(k => flags[k])) + + return toCheck.some(function (flag) { + return flag[key] }) } - function unsetDefaulted (key) { - [].concat(flags.aliases[key] || [], key).forEach(function (k) { - delete flags.defaulted[k] + function hasFlagsMatching (arg, ...patterns) { + var toCheck = [].concat(...patterns) + return toCheck.some(function (pattern) { + var match = arg.match(pattern) + return match && hasAnyFlag(match[1]) }) } + // based on a simplified version of the short flag group parsing logic + function hasAllShortFlags (arg) { + // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group + if (arg.match(negative) || !arg.match(/^-[^-]+/)) { return false } + var hasAllFlags = true + var letters = arg.slice(1).split('') + var next + for (var j = 0; j < letters.length; j++) { + next = arg.slice(j + 2) + + if (!hasAnyFlag(letters[j])) { + hasAllFlags = false + break + } + + if ((letters[j + 1] && letters[j + 1] === '=') || + next === '-' || + (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) || + (letters[j + 1] && letters[j + 1].match(/\W/))) { + break + } + } + return hasAllFlags + } + + function isUnknownOptionAsArg (arg) { + return configuration['unknown-options-as-args'] && isUnknownOption(arg) + } + + function isUnknownOption (arg) { + // ignore negative numbers + if (arg.match(negative)) { return false } + // if this is a short option group and all of them are configured, it isn't unknown + if (hasAllShortFlags(arg)) { return false } + // e.g. '--count=2' + const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/ + // e.g. '-a' or '--arg' + const normalFlag = /^-+([^=]+?)$/ + // e.g. '-a-' + const flagEndingInHyphen = /^-+([^=]+?)-$/ + // e.g. '-abc123' + const flagEndingInDigits = /^-+([^=]+?)\d+$/ + // e.g. '-a/usr/local' + const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/ + // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method + return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters) + } + + // make a best effor to pick a default value + // for an option based on name and type. + function defaultValue (key) { + if (!checkAllAliases(key, flags.bools) && + !checkAllAliases(key, flags.counts) && + `${key}` in defaults) { + return defaults[key] + } else { + return defaultForType(guessType(key)) + } + } + // return a default value, given the type of a flag., // e.g., key of type 'string' will default to '', rather than 'true'. function defaultForType (type) { @@ -699,20 +857,26 @@ function parse (args, opts) { } // given a flag, enforce a default type. - function guessType (key, flags) { + function guessType (key) { var type = 'boolean' if (checkAllAliases(key, flags.strings)) type = 'string' else if (checkAllAliases(key, flags.numbers)) type = 'number' + else if (checkAllAliases(key, flags.bools)) type = 'boolean' else if (checkAllAliases(key, flags.arrays)) type = 'array' return type } function isNumber (x) { + if (x === null || x === undefined) return false + // if loaded from config, may already be a number. if (typeof x === 'number') return true + // hexadecimal. if (/^0x[0-9a-f]+$/i.test(x)) return true - return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) + // don't treat 0123 as a number; as it drops the leading '0'. + if (x.length > 1 && x[0] === '0') return false + return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x) } function isUndefined (num) { @@ -775,20 +939,6 @@ function combineAliases (aliases) { return combined } -function assign (defaults, configuration) { - var o = {} - configuration = configuration || {} - - Object.keys(defaults).forEach(function (k) { - o[k] = defaults[k] - }) - Object.keys(configuration).forEach(function (k) { - o[k] = configuration[k] - }) - - return o -} - // this function should only be called when a count is given as an arg // it is NOT called to set a default value // thus we can start the count at 1 instead of 0 @@ -808,4 +958,11 @@ Parser.detailed = function (args, opts) { return parse(args.slice(), opts) } +// TODO(bcoe): in the next major version of yargs, switch to +// Object.create(null) for dot notation: +function sanitizeKey (key) { + if (key === '__proto__') return '___proto___' + return key +} + module.exports = Parser diff --git a/deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js b/deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js index 6c8d23ef2143a0..fe05e27fdda7ca 100644 --- a/deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js +++ b/deps/npm/node_modules/yargs-parser/lib/tokenize-arg-string.js @@ -1,6 +1,8 @@ // take an un-split argv string and tokenize it. module.exports = function (argString) { - if (Array.isArray(argString)) return argString + if (Array.isArray(argString)) { + return argString.map(e => typeof e !== 'string' ? e + '' : e) + } argString = argString.trim() @@ -26,10 +28,8 @@ module.exports = function (argString) { // opening or closing single and double quotes. if (c === opening) { opening = null - continue } else if ((c === "'" || c === '"') && !opening) { opening = c - continue } if (!args[i]) args[i] = '' diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts new file mode 100644 index 00000000000000..58f2069adc52b8 --- /dev/null +++ b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.d.ts @@ -0,0 +1,63 @@ +declare namespace camelcase { + interface Options { + /** + Uppercase the first character: `foo-bar` → `FooBar`. + + @default false + */ + readonly pascalCase?: boolean; + } +} + +declare const camelcase: { + /** + Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. + + @param input - String to convert to camel case. + + @example + ``` + import camelCase = require('camelcase'); + + camelCase('foo-bar'); + //=> 'fooBar' + + camelCase('foo_bar'); + //=> 'fooBar' + + camelCase('Foo-Bar'); + //=> 'fooBar' + + camelCase('Foo-Bar', {pascalCase: true}); + //=> 'FooBar' + + camelCase('--foo.bar', {pascalCase: false}); + //=> 'fooBar' + + camelCase('foo bar'); + //=> 'fooBar' + + console.log(process.argv[3]); + //=> '--foo-bar' + camelCase(process.argv[3]); + //=> 'fooBar' + + camelCase(['foo', 'bar']); + //=> 'fooBar' + + camelCase(['__foo__', '--bar'], {pascalCase: true}); + //=> 'FooBar' + ``` + */ + (input: string | ReadonlyArray, options?: camelcase.Options): string; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function camelcase( + // input: string | ReadonlyArray, + // options?: camelcase.Options + // ): string; + // export = camelcase; + default: typeof camelcase; +}; + +export = camelcase; diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.js b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.js new file mode 100644 index 00000000000000..579f99b47f772a --- /dev/null +++ b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/index.js @@ -0,0 +1,76 @@ +'use strict'; + +const preserveCamelCase = string => { + let isLastCharLower = false; + let isLastCharUpper = false; + let isLastLastCharUpper = false; + + for (let i = 0; i < string.length; i++) { + const character = string[i]; + + if (isLastCharLower && /[a-zA-Z]/.test(character) && character.toUpperCase() === character) { + string = string.slice(0, i) + '-' + string.slice(i); + isLastCharLower = false; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = true; + i++; + } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(character) && character.toLowerCase() === character) { + string = string.slice(0, i - 1) + '-' + string.slice(i - 1); + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = false; + isLastCharLower = true; + } else { + isLastCharLower = character.toLowerCase() === character && character.toUpperCase() !== character; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = character.toUpperCase() === character && character.toLowerCase() !== character; + } + } + + return string; +}; + +const camelCase = (input, options) => { + if (!(typeof input === 'string' || Array.isArray(input))) { + throw new TypeError('Expected the input to be `string | string[]`'); + } + + options = Object.assign({ + pascalCase: false + }, options); + + const postProcess = x => options.pascalCase ? x.charAt(0).toUpperCase() + x.slice(1) : x; + + if (Array.isArray(input)) { + input = input.map(x => x.trim()) + .filter(x => x.length) + .join('-'); + } else { + input = input.trim(); + } + + if (input.length === 0) { + return ''; + } + + if (input.length === 1) { + return options.pascalCase ? input.toUpperCase() : input.toLowerCase(); + } + + const hasUpperCase = input !== input.toLowerCase(); + + if (hasUpperCase) { + input = preserveCamelCase(input); + } + + input = input + .replace(/^[_.\- ]+/, '') + .toLowerCase() + .replace(/[_.\- ]+(\w|$)/g, (_, p1) => p1.toUpperCase()) + .replace(/\d+(\w|$)/g, m => m.toUpperCase()); + + return postProcess(input); +}; + +module.exports = camelCase; +// TODO: Remove this for the next major release +module.exports.default = camelCase; diff --git a/deps/npm/node_modules/mem/node_modules/mimic-fn/license b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/license similarity index 100% rename from deps/npm/node_modules/mem/node_modules/mimic-fn/license rename to deps/npm/node_modules/yargs-parser/node_modules/camelcase/license diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/package.json b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/package.json new file mode 100644 index 00000000000000..560c2e1d7356fe --- /dev/null +++ b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/package.json @@ -0,0 +1,75 @@ +{ + "_from": "camelcase@^5.0.0", + "_id": "camelcase@5.3.1", + "_inBundle": false, + "_integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "_location": "/yargs-parser/camelcase", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "camelcase@^5.0.0", + "name": "camelcase", + "escapedName": "camelcase", + "rawSpec": "^5.0.0", + "saveSpec": null, + "fetchSpec": "^5.0.0" + }, + "_requiredBy": [ + "/yargs-parser" + ], + "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "_shasum": "e3c9b31569e106811df242f715725a1f4c494320", + "_spec": "camelcase@^5.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs-parser", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/camelcase/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/sindresorhus/camelcase#readme", + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert", + "pascalcase", + "pascal-case" + ], + "license": "MIT", + "name": "camelcase", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/camelcase.git" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "version": "5.3.1" +} diff --git a/deps/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md new file mode 100644 index 00000000000000..fde27261b2a823 --- /dev/null +++ b/deps/npm/node_modules/yargs-parser/node_modules/camelcase/readme.md @@ -0,0 +1,99 @@ +# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase) + +> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` + +--- + +
+ + Get professional support for 'camelcase' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + +## Install + +``` +$ npm install camelcase +``` + + +## Usage + +```js +const camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' +``` + + +## API + +### camelCase(input, [options]) + +#### input + +Type: `string` `string[]` + +String to convert to camel case. + +#### options + +Type: `Object` + +##### pascalCase + +Type: `boolean`
+Default: `false` + +Uppercase the first character: `foo-bar` → `FooBar` + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Related + +- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module +- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase +- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string +- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs-parser/package.json b/deps/npm/node_modules/yargs-parser/package.json index c4d1ca1ce59902..467593e5d9f894 100644 --- a/deps/npm/node_modules/yargs-parser/package.json +++ b/deps/npm/node_modules/yargs-parser/package.json @@ -1,27 +1,27 @@ { - "_from": "yargs-parser@^9.0.2", - "_id": "yargs-parser@9.0.2", + "_from": "yargs-parser@^15.0.1", + "_id": "yargs-parser@15.0.1", "_inBundle": false, - "_integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "_integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", "_location": "/yargs-parser", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "yargs-parser@^9.0.2", + "raw": "yargs-parser@^15.0.1", "name": "yargs-parser", "escapedName": "yargs-parser", - "rawSpec": "^9.0.2", + "rawSpec": "^15.0.1", "saveSpec": null, - "fetchSpec": "^9.0.2" + "fetchSpec": "^15.0.1" }, "_requiredBy": [ "/yargs" ], - "_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", - "_shasum": "9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077", - "_spec": "yargs-parser@^9.0.2", - "_where": "/Users/rebecca/code/npm/node_modules/yargs", + "_resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "_shasum": "54786af40b820dcb2fb8025b11b4d659d76323b3", + "_spec": "yargs-parser@^15.0.1", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", "author": { "name": "Ben Coe", "email": "ben@npmjs.com" @@ -31,17 +31,21 @@ }, "bundleDependencies": false, "dependencies": { - "camelcase": "^4.1.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "deprecated": false, "description": "the mighty option parser used by yargs", "devDependencies": { - "chai": "^3.5.0", - "coveralls": "^2.11.12", - "mocha": "^3.0.1", - "nyc": "^11.4.1", - "standard": "^10.0.2", - "standard-version": "^4.3.0" + "chai": "^4.2.0", + "coveralls": "^3.0.2", + "mocha": "^5.2.0", + "nyc": "^14.1.0", + "standard": "^12.0.1", + "standard-version": "^6.0.0" + }, + "engine": { + "node": ">=6" }, "files": [ "lib", @@ -71,5 +75,5 @@ "release": "standard-version", "test": "nyc mocha test/*.js" }, - "version": "9.0.2" + "version": "15.0.1" } diff --git a/deps/npm/node_modules/yargs/CHANGELOG.md b/deps/npm/node_modules/yargs/CHANGELOG.md index 2cccca04c4113c..343ffc9ab0718d 100644 --- a/deps/npm/node_modules/yargs/CHANGELOG.md +++ b/deps/npm/node_modules/yargs/CHANGELOG.md @@ -1,11 +1,265 @@ -# Change Log +# Changelog All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -# [11.1.1](https://github.com/yargs/yargs/compare/v11.1.0...v11.1.1) (2019-10-06) +### 14.2.2 + +### Bug Fixes + +* temporary fix for libraries that call Object.freeze() ([#1483](https://www.github.com/yargs/yargs/issues/1483)) ([99c2dc8](https://www.github.com/yargs/yargs/commit/99c2dc850e67c606644f8b0c0bca1a59c87dcbcd)) + +### [14.2.1](https://github.com/yargs/yargs/compare/v14.2.0...v14.2.1) (2019-10-30) + + +### Bug Fixes + +* stop-parse was not being respected by commands ([#1459](https://github.com/yargs/yargs/issues/1459)) ([e78e76e](https://github.com/yargs/yargs/commit/e78e76e3ac0551d4f30c71a05ddb21582960fcef)) + +## [14.2.0](https://github.com/yargs/yargs/compare/v14.1.0...v14.2.0) (2019-10-07) + + +### Bug Fixes + +* async middleware was called twice ([#1422](https://github.com/yargs/yargs/issues/1422)) ([9a42b63](https://github.com/yargs/yargs/commit/9a42b63)) +* fix promise check to accept any spec conform object ([#1424](https://github.com/yargs/yargs/issues/1424)) ([0be43d2](https://github.com/yargs/yargs/commit/0be43d2)) +* groups were not being maintained for nested commands ([#1430](https://github.com/yargs/yargs/issues/1430)) ([d38650e](https://github.com/yargs/yargs/commit/d38650e)) +* **docs:** broken markdown link ([#1426](https://github.com/yargs/yargs/issues/1426)) ([236e24e](https://github.com/yargs/yargs/commit/236e24e)) +* support merging deeply nested configuration ([#1423](https://github.com/yargs/yargs/issues/1423)) ([bae66fe](https://github.com/yargs/yargs/commit/bae66fe)) + + +### Features + +* **deps:** introduce yargs-parser with support for unknown-options-as-args ([#1440](https://github.com/yargs/yargs/issues/1440)) ([4d21520](https://github.com/yargs/yargs/commit/4d21520)) + +## [14.1.0](https://github.com/yargs/yargs/compare/v14.0.0...v14.1.0) (2019-09-06) + + +### Bug Fixes + +* **docs:** fix incorrect parserConfiguration documentation ([2a99124](https://github.com/yargs/yargs/commit/2a99124)) +* detect zsh when zsh isnt run as a login prompt ([#1395](https://github.com/yargs/yargs/issues/1395)) ([8792d13](https://github.com/yargs/yargs/commit/8792d13)) +* populate correct value on yargs.parsed and stop warning on access ([#1412](https://github.com/yargs/yargs/issues/1412)) ([bb0eb52](https://github.com/yargs/yargs/commit/bb0eb52)) +* showCompletionScript was logging script twice ([#1388](https://github.com/yargs/yargs/issues/1388)) ([07c8537](https://github.com/yargs/yargs/commit/07c8537)) +* strict() should not ignore hyphenated arguments ([#1414](https://github.com/yargs/yargs/issues/1414)) ([b774b5e](https://github.com/yargs/yargs/commit/b774b5e)) +* **docs:** formalize existing callback argument to showHelp ([#1386](https://github.com/yargs/yargs/issues/1386)) ([d217764](https://github.com/yargs/yargs/commit/d217764)) + + +### Features + +* make it possible to merge configurations when extending other config. ([#1411](https://github.com/yargs/yargs/issues/1411)) ([5d7ad98](https://github.com/yargs/yargs/commit/5d7ad98)) + +## [14.0.0](https://github.com/yargs/yargs/compare/v13.3.0...v14.0.0) (2019-07-30) + + +### ⚠ BREAKING CHANGES + +* we now only officially support yargs.$0 parameter and discourage direct access to yargs.parsed +* previously to this fix methods like `yargs.getOptions()` contained the state of the last command to execute. +* do not allow additional positionals in strict mode + +### Bug Fixes + +* calling parse multiple times now appropriately maintains state ([#1137](https://github.com/yargs/yargs/issues/1137)) ([#1369](https://github.com/yargs/yargs/issues/1369)) ([026b151](https://github.com/yargs/yargs/commit/026b151)) +* prefer user supplied script name in usage ([#1383](https://github.com/yargs/yargs/issues/1383)) ([28c74b9](https://github.com/yargs/yargs/commit/28c74b9)) +* **deps:** use decamelize from npm instead of vendored copy ([#1377](https://github.com/yargs/yargs/issues/1377)) ([015eeb9](https://github.com/yargs/yargs/commit/015eeb9)) +* **examples:** fix usage-options.js to reflect current API ([#1375](https://github.com/yargs/yargs/issues/1375)) ([6e5b76b](https://github.com/yargs/yargs/commit/6e5b76b)) +* do not allow additional positionals in strict mode ([35d777c](https://github.com/yargs/yargs/commit/35d777c)) +* properties accessed on singleton now reflect current state of instance ([#1366](https://github.com/yargs/yargs/issues/1366)) ([409d35b](https://github.com/yargs/yargs/commit/409d35b)) +* tolerate null prototype for config objects with `extends` ([#1376](https://github.com/yargs/yargs/issues/1376)) ([3d26d11](https://github.com/yargs/yargs/commit/3d26d11)), closes [#1372](https://github.com/yargs/yargs/issues/1372) +* yargs.parsed now populated before returning, when yargs.parse() called with no args (#1382) ([e3981fd](https://github.com/yargs/yargs/commit/e3981fd)), closes [#1382](https://github.com/yargs/yargs/issues/1382) + +### Features + +* adds support for multiple epilog messages ([#1384](https://github.com/yargs/yargs/issues/1384)) ([07a5554](https://github.com/yargs/yargs/commit/07a5554)) +* allow completionCommand to be set via showCompletionScript ([#1385](https://github.com/yargs/yargs/issues/1385)) ([5562853](https://github.com/yargs/yargs/commit/5562853)) + +## [13.3.0](https://www.github.com/yargs/yargs/compare/v13.2.4...v13.3.0) (2019-06-10) + + +### Bug Fixes + +* **deps:** yargs-parser update addressing several parsing bugs ([#1357](https://www.github.com/yargs/yargs/issues/1357)) ([e230d5b](https://www.github.com/yargs/yargs/commit/e230d5b)) + + +### Features + +* **i18n:** swap out os-locale dependency for simple inline implementation ([#1356](https://www.github.com/yargs/yargs/issues/1356)) ([4dfa19b](https://www.github.com/yargs/yargs/commit/4dfa19b)) +* support defaultDescription for positional arguments ([812048c](https://www.github.com/yargs/yargs/commit/812048c)) + +### [13.2.4](https://github.com/yargs/yargs/compare/v13.2.3...v13.2.4) (2019-05-13) + + +### Bug Fixes + +* **i18n:** rename unclear 'implication failed' to 'missing dependent arguments' ([#1317](https://github.com/yargs/yargs/issues/1317)) ([bf46813](https://github.com/yargs/yargs/commit/bf46813)) + + + +### [13.2.3](https://github.com/yargs/yargs/compare/v13.2.2...v13.2.3) (2019-05-05) + + +### Bug Fixes + +* **deps:** upgrade cliui for compatibility with latest chalk. ([#1330](https://github.com/yargs/yargs/issues/1330)) ([b20db65](https://github.com/yargs/yargs/commit/b20db65)) +* address issues with dutch translation ([#1316](https://github.com/yargs/yargs/issues/1316)) ([0295132](https://github.com/yargs/yargs/commit/0295132)) + + +### Tests + +* accept differently formatted output ([#1327](https://github.com/yargs/yargs/issues/1327)) ([c294d1b](https://github.com/yargs/yargs/commit/c294d1b)) + + + +## [13.2.2](https://github.com/yargs/yargs/compare/v13.2.1...v13.2.2) (2019-03-06) + + + +## [13.2.1](https://github.com/yargs/yargs/compare/v13.2.0...v13.2.1) (2019-02-18) + + +### Bug Fixes + +* add zsh script to files array ([3180224](https://github.com/yargs/yargs/commit/3180224)) +* support options/sub-commands in zsh completion ([0a96394](https://github.com/yargs/yargs/commit/0a96394)) + + +# [13.2.0](https://github.com/yargs/yargs/compare/v13.1.0...v13.2.0) (2019-02-15) + + +### Features + +* zsh auto completion ([#1292](https://github.com/yargs/yargs/issues/1292)) ([16c5d25](https://github.com/yargs/yargs/commit/16c5d25)), closes [#1156](https://github.com/yargs/yargs/issues/1156) + + + +# [13.1.0](https://github.com/yargs/yargs/compare/v13.0.0...v13.1.0) (2019-02-12) + + +### Features + +* add applyBeforeValidation, for applying sync middleware before validation ([5be206a](https://github.com/yargs/yargs/commit/5be206a)) + + + + +# [13.0.0](https://github.com/yargs/yargs/compare/v12.0.5...v13.0.0) (2019-02-02) + + +### Bug Fixes + +* **deps:** Update os-locale to avoid security vulnerability ([#1270](https://github.com/yargs/yargs/issues/1270)) ([27bf739](https://github.com/yargs/yargs/commit/27bf739)) +* **validation:** Use the error as a message when none exists otherwise ([#1268](https://github.com/yargs/yargs/issues/1268)) ([0510fe6](https://github.com/yargs/yargs/commit/0510fe6)) +* better bash path completion ([#1272](https://github.com/yargs/yargs/issues/1272)) ([da75ea2](https://github.com/yargs/yargs/commit/da75ea2)) +* middleware added multiple times due to reference bug ([#1282](https://github.com/yargs/yargs/issues/1282)) ([64af518](https://github.com/yargs/yargs/commit/64af518)) + + +### Chores + +* ~drop Node 6 from testing matrix ([#1287](https://github.com/yargs/yargs/issues/1287)) ([ef16792](https://github.com/yargs/yargs/commit/ef16792))~ + * _opting to not drop Node 6 support until April, [see](https://github.com/nodejs/Release)._ +* update dependencies ([#1284](https://github.com/yargs/yargs/issues/1284)) ([f25de4f](https://github.com/yargs/yargs/commit/f25de4f)) + + +### Features + +* Add `.parserConfiguration()` method, deprecating package.json config ([#1262](https://github.com/yargs/yargs/issues/1262)) ([3c6869a](https://github.com/yargs/yargs/commit/3c6869a)) +* adds config option for sorting command output ([#1256](https://github.com/yargs/yargs/issues/1256)) ([6916ce9](https://github.com/yargs/yargs/commit/6916ce9)) +* options/positionals with leading '+' and '0' no longer parse as numbers ([#1286](https://github.com/yargs/yargs/issues/1286)) ([e9dc3aa](https://github.com/yargs/yargs/commit/e9dc3aa)) +* support promises in middleware ([f3a4e4f](https://github.com/yargs/yargs/commit/f3a4e4f)) + + +### BREAKING CHANGES + +* options with leading '+' or '0' now parse as strings +* dropping Node 6 which hits end of life in April 2019 +* see [yargs-parser@12.0.0 CHANGELOG](https://github.com/yargs/yargs-parser/blob/master/CHANGELOG.md#breaking-changes) +* we now warn if the yargs stanza package.json is used. + + + + +## [12.0.5](https://github.com/yargs/yargs/compare/v12.0.4...v12.0.5) (2018-11-19) + + +### Bug Fixes + +* allows camel-case, variadic arguments, and strict mode to be combined ([#1247](https://github.com/yargs/yargs/issues/1247)) ([eacc035](https://github.com/yargs/yargs/commit/eacc035)) + + + + +## [12.0.4](https://github.com/yargs/yargs/compare/v12.0.3...v12.0.4) (2018-11-10) + + +### Bug Fixes + +* don't load config when processing positionals ([5d0dc92](https://github.com/yargs/yargs/commit/5d0dc92)) + + + + +## [12.0.3](https://github.com/yargs/yargs/compare/v12.0.2...v12.0.3) (2018-10-06) + + +### Bug Fixes + +* $0 contains first arg in bundled electron apps ([#1206](https://github.com/yargs/yargs/issues/1206)) ([567820b](https://github.com/yargs/yargs/commit/567820b)) +* accept single function for middleware ([66fd6f7](https://github.com/yargs/yargs/commit/66fd6f7)), closes [#1214](https://github.com/yargs/yargs/issues/1214) [#1214](https://github.com/yargs/yargs/issues/1214) +* hide `hidden` options from help output even if they are in a group ([#1221](https://github.com/yargs/yargs/issues/1221)) ([da54028](https://github.com/yargs/yargs/commit/da54028)) +* improve Norwegian Bokmål translations ([#1208](https://github.com/yargs/yargs/issues/1208)) ([a458fa4](https://github.com/yargs/yargs/commit/a458fa4)) +* improve Norwegian Nynorsk translations ([#1207](https://github.com/yargs/yargs/issues/1207)) ([d422eb5](https://github.com/yargs/yargs/commit/d422eb5)) + + + + +## [12.0.2](https://github.com/yargs/yargs/compare/v12.0.1...v12.0.2) (2018-09-04) + + +### Bug Fixes + +* middleware should work regardless of when method is called ([664b265](https://github.com/yargs/yargs/commit/664b265)), closes [#1178](https://github.com/yargs/yargs/issues/1178) +* translation not working when using __ with a single parameter ([#1183](https://github.com/yargs/yargs/issues/1183)) ([f449aea](https://github.com/yargs/yargs/commit/f449aea)) +* upgrade os-locale to version that addresses license issue ([#1195](https://github.com/yargs/yargs/issues/1195)) ([efc0970](https://github.com/yargs/yargs/commit/efc0970)) + + + + +## [12.0.1](https://github.com/yargs/yargs/compare/v12.0.0...v12.0.1) (2018-06-29) + + + + +# [12.0.0](https://github.com/yargs/yargs/compare/v11.1.0...v12.0.0) (2018-06-26) + + +### Bug Fixes + +* .argv and .parse() now invoke identical code path ([#1126](https://github.com/yargs/yargs/issues/1126)) ([f13ebf4](https://github.com/yargs/yargs/commit/f13ebf4)) +* remove the trailing white spaces from the help output ([#1090](https://github.com/yargs/yargs/issues/1090)) ([3f0746c](https://github.com/yargs/yargs/commit/3f0746c)) +* **completion:** Avoid default command and recommendations during completion ([#1123](https://github.com/yargs/yargs/issues/1123)) ([036e7c5](https://github.com/yargs/yargs/commit/036e7c5)) + + +### Chores + +* test Node.js 6, 8 and 10 ([#1160](https://github.com/yargs/yargs/issues/1160)) ([84f9d2b](https://github.com/yargs/yargs/commit/84f9d2b)) +* upgrade to version of yargs-parser that does not populate value for unset boolean ([#1104](https://github.com/yargs/yargs/issues/1104)) ([d4705f4](https://github.com/yargs/yargs/commit/d4705f4)) + + +### Features + +* add support for global middleware, useful for shared tasks like metrics ([#1119](https://github.com/yargs/yargs/issues/1119)) ([9d71ac7](https://github.com/yargs/yargs/commit/9d71ac7)) +* allow setting scriptName $0 ([#1143](https://github.com/yargs/yargs/issues/1143)) ([a2f2eae](https://github.com/yargs/yargs/commit/a2f2eae)) +* remove `setPlaceholderKeys` ([#1105](https://github.com/yargs/yargs/issues/1105)) ([6ee2c82](https://github.com/yargs/yargs/commit/6ee2c82)) + + +### BREAKING CHANGES + +* Options absent from `argv` (not set via CLI argument) are now absent from the parsed result object rather than being set with `undefined` +* drop Node 4 from testing matrix, such that we'll gradually start drifting away from supporting Node 4. +* yargs-parser does not populate 'false' when boolean flag is not passed +* tests that assert against help output will need to be updated + -* backport security fix for os-locale. # [11.1.0](https://github.com/yargs/yargs/compare/v11.0.0...v11.1.0) (2018-03-04) @@ -21,6 +275,8 @@ All notable changes to this project will be documented in this file. See [standa * allow hidden options to be displayed with --show-hidden ([#1061](https://github.com/yargs/yargs/issues/1061)) ([ea862ae](https://github.com/yargs/yargs/commit/ea862ae)) * extend *.rc files in addition to json ([#1080](https://github.com/yargs/yargs/issues/1080)) ([11691a6](https://github.com/yargs/yargs/commit/11691a6)) + + # [11.0.0](https://github.com/yargs/yargs/compare/v10.1.2...v11.0.0) (2018-01-22) @@ -656,7 +912,7 @@ All notable changes to this project will be documented in this file. See [standa - [#308](https://github.com/bcoe/yargs/pull/308) Yargs now handles environment variables (@nexdrew) - [#302](https://github.com/bcoe/yargs/pull/302) Add Indonesian translation (@rilut) - [#300](https://github.com/bcoe/yargs/pull/300) Add Turkish translation (@feyzo) -- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus) +- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus) - [#297](https://github.com/bcoe/yargs/pull/297) Fix for layout of cjk characters (@disjukr) - [#296](https://github.com/bcoe/yargs/pull/296) Add Korean translation (@disjukr) diff --git a/deps/npm/node_modules/yargs/README.md b/deps/npm/node_modules/yargs/README.md index d16b82d177c117..679a3eeea9e6bb 100644 --- a/deps/npm/node_modules/yargs/README.md +++ b/deps/npm/node_modules/yargs/README.md @@ -1,20 +1,24 @@ -# Yargs +

+ +

+

Yargs

+

+ Yargs be a node.js library fer hearties tryin' ter parse optstrings +

+ +
[![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![NPM version][npm-image]][npm-url] -[![Windows Tests][windows-image]][windows-url] [![js-standard-style][standard-image]][standard-url] [![Conventional Commits][conventional-commits-image]][conventional-commits-url] [![Slack][slack-image]][slack-url] -_Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com)_. - -> Yargs be a node.js library fer hearties tryin' ter parse optstrings. +## Description : +Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. - - -Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you: +It gives you: * commands and (grouped) options (`my-program.js serve --port=5000`). * a dynamically generated help menu based on your arguments. @@ -26,11 +30,19 @@ Yargs helps you build interactive command line tools, by parsing arguments and g ## Installation +Stable version: +```bash +npm i yargs +``` + +Bleeding edge version with the most recent features: ```bash -npm i yargs --save +npm i yargs@next ``` -## Simple Example +## Usage : + +### Simple Example ````javascript #!/usr/bin/env node @@ -51,9 +63,9 @@ $ ./plunder.js --ships 12 --distance 98.7 Retreat from the xupptumblers! ``` -## Complex Example +### Complex Example -```js +```javascript #!/usr/bin/env node require('yargs') // eslint-disable-line .command('serve [port]', 'start the server', (yargs) => { @@ -68,14 +80,31 @@ require('yargs') // eslint-disable-line }) .option('verbose', { alias: 'v', - default: false + type: 'boolean', + description: 'Run with verbose logging' }) .argv ``` Run the example above with `--help` to see the help for the application. -## Table of Contents +## TypeScript + +yargs has type definitions at [@types/yargs][type-definitions]. + +``` +npm i @types/yargs --save-dev +``` + +See usage examples in [docs](/docs/typescript.md). + +## Community : + +Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com). + +## Documentation : + +### Table of Contents * [Yargs' API](/docs/api.md) * [Examples](/docs/examples.md) @@ -85,6 +114,7 @@ Run the example above with `--help` to see the help for the application. * [Numbers](/docs/tricks.md#numbers) * [Arrays](/docs/tricks.md#arrays) * [Objects](/docs/tricks.md#objects) + * [Quotes](/docs/tricks.md#quotes) * [Advanced Topics](/docs/advanced.md) * [Composing Your App Using Commands](/docs/advanced.md#commands) * [Building Configurable CLI Apps](/docs/advanced.md#configuration) @@ -97,11 +127,10 @@ Run the example above with `--help` to see the help for the application. [coveralls-image]: https://img.shields.io/coveralls/yargs/yargs.svg [npm-url]: https://www.npmjs.com/package/yargs [npm-image]: https://img.shields.io/npm/v/yargs.svg -[windows-url]: https://ci.appveyor.com/project/bcoe/yargs-ljwvf -[windows-image]: https://img.shields.io/appveyor/ci/bcoe/yargs-ljwvf/master.svg?label=Windows%20Tests [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg [standard-url]: http://standardjs.com/ [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg [conventional-commits-url]: https://conventionalcommits.org/ [slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg [slack-url]: http://devtoolscommunity.herokuapp.com +[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs diff --git a/deps/npm/node_modules/yargs/completion.sh.hbs b/deps/npm/node_modules/yargs/completion.sh.hbs deleted file mode 100644 index 819c8ae83a7e48..00000000000000 --- a/deps/npm/node_modules/yargs/completion.sh.hbs +++ /dev/null @@ -1,28 +0,0 @@ -###-begin-{{app_name}}-completions-### -# -# yargs command completion script -# -# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc -# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. -# -_yargs_completions() -{ - local cur_word args type_list - - cur_word="${COMP_WORDS[COMP_CWORD]}" - args=("${COMP_WORDS[@]}") - - # ask yargs to generate completions. - type_list=$({{app_path}} --get-yargs-completions "${args[@]}") - - COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) ) - - # if no match was found, fall back to filename completion - if [ ${#COMPREPLY[@]} -eq 0 ]; then - COMPREPLY=( $(compgen -f -- "${cur_word}" ) ) - fi - - return 0 -} -complete -F _yargs_completions {{app_name}} -###-end-{{app_name}}-completions-### diff --git a/deps/npm/node_modules/yargs/index.js b/deps/npm/node_modules/yargs/index.js index dfed54bc51686d..2db543ed3a698e 100644 --- a/deps/npm/node_modules/yargs/index.js +++ b/deps/npm/node_modules/yargs/index.js @@ -25,8 +25,15 @@ function singletonify (inst) { Object.keys(inst).forEach((key) => { if (key === 'argv') { Argv.__defineGetter__(key, inst.__lookupGetter__(key)) + } else if (typeof inst[key] === 'function') { + Argv[key] = inst[key].bind(inst) } else { - Argv[key] = typeof inst[key] === 'function' ? inst[key].bind(inst) : inst[key] + Argv.__defineGetter__('$0', () => { + return inst.$0 + }) + Argv.__defineGetter__('parsed', () => { + return inst.parsed + }) } }) } diff --git a/deps/npm/node_modules/yargs/lib/apply-extends.js b/deps/npm/node_modules/yargs/lib/apply-extends.js index 530b022ac57b5a..643c91335a0906 100644 --- a/deps/npm/node_modules/yargs/lib/apply-extends.js +++ b/deps/npm/node_modules/yargs/lib/apply-extends.js @@ -16,12 +16,26 @@ function getPathToDefaultConfig (cwd, pathToExtend) { return path.resolve(cwd, pathToExtend) } -function applyExtends (config, cwd) { +function mergeDeep (config1, config2) { + const target = {} + const isObject = obj => obj && typeof obj === 'object' && !Array.isArray(obj) + Object.assign(target, config1) + for (let key of Object.keys(config2)) { + if (isObject(config2[key]) && isObject(target[key])) { + target[key] = mergeDeep(config1[key], config2[key]) + } else { + target[key] = config2[key] + } + } + return target +} + +function applyExtends (config, cwd, mergeExtends) { let defaultConfig = {} - if (config.hasOwnProperty('extends')) { + if (Object.prototype.hasOwnProperty.call(config, 'extends')) { if (typeof config.extends !== 'string') return defaultConfig - const isPath = /\.json$/.test(config.extends) + const isPath = /\.json|\..*rc$/.test(config.extends) let pathToDefault = null if (!isPath) { try { @@ -42,12 +56,12 @@ function applyExtends (config, cwd) { defaultConfig = isPath ? JSON.parse(fs.readFileSync(pathToDefault, 'utf8')) : require(config.extends) delete config.extends - defaultConfig = applyExtends(defaultConfig, path.dirname(pathToDefault)) + defaultConfig = applyExtends(defaultConfig, path.dirname(pathToDefault), mergeExtends) } previouslyVisitedConfigs = [] - return Object.assign({}, defaultConfig, config) + return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config) } module.exports = applyExtends diff --git a/deps/npm/node_modules/yargs/lib/argsert.js b/deps/npm/node_modules/yargs/lib/argsert.js index ed1d598713df90..f310b4e7479a68 100644 --- a/deps/npm/node_modules/yargs/lib/argsert.js +++ b/deps/npm/node_modules/yargs/lib/argsert.js @@ -1,16 +1,18 @@ 'use strict' + +// hoisted due to circular dependency on command. +module.exports = argsert const command = require('./command')() const YError = require('./yerror') const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth'] - -module.exports = function argsert (expected, callerArguments, length) { +function argsert (expected, callerArguments, length) { // TODO: should this eventually raise an exception. try { // preface the argument description with "cmd", so // that we can run it through yargs' command parser. let position = 0 - let parsed = {demanded: [], optional: []} + let parsed = { demanded: [], optional: [] } if (typeof expected === 'object') { length = callerArguments callerArguments = expected diff --git a/deps/npm/node_modules/yargs/lib/command.js b/deps/npm/node_modules/yargs/lib/command.js index 65322dbbdbd3d3..d2a6e4d49355b5 100644 --- a/deps/npm/node_modules/yargs/lib/command.js +++ b/deps/npm/node_modules/yargs/lib/command.js @@ -1,6 +1,8 @@ 'use strict' const inspect = require('util').inspect +const isPromise = require('./is-promise') +const { applyMiddleware, commandMiddlewareFactory } = require('./middleware') const path = require('path') const Parser = require('yargs-parser') @@ -9,15 +11,18 @@ const DEFAULT_MARKER = /(^\*)|(^\$0)/ // handles parsing positional arguments, // and populating argv with said positional // arguments. -module.exports = function command (yargs, usage, validation) { +module.exports = function command (yargs, usage, validation, globalMiddleware) { const self = {} let handlers = {} let aliasMap = {} let defaultCommand - self.addHandler = function addHandler (cmd, description, builder, handler, middlewares) { + globalMiddleware = globalMiddleware || [] + + self.addHandler = function addHandler (cmd, description, builder, handler, commandMiddleware) { let aliases = [] + const middlewares = commandMiddlewareFactory(commandMiddleware) handler = handler || (() => {}) - middlewares = middlewares || [] + if (Array.isArray(cmd)) { aliases = cmd.slice(1) cmd = cmd[0] @@ -169,7 +174,7 @@ module.exports = function command (yargs, usage, validation) { let numFiles = currentContext.files.length const parentCommands = currentContext.commands.slice() - // what does yargs look like after the buidler is run? + // what does yargs look like after the builder is run? let innerArgv = parsed.argv let innerYargs = null let positionalMap = {} @@ -181,24 +186,17 @@ module.exports = function command (yargs, usage, validation) { // a function can be provided, which builds // up a yargs chain and possibly returns it. innerYargs = commandHandler.builder(yargs.reset(parsed.aliases)) - // if the builder function did not yet parse argv with reset yargs - // and did not explicitly set a usage() string, then apply the - // original command string as usage() for consistent behavior with - // options object below. - if (yargs.parsed === false) { - if (shouldUpdateUsage(yargs)) { - yargs.getUsageInstance().usage( - usageFromParentCommandsCommandHandler(parentCommands, commandHandler), - commandHandler.description - ) - } - innerArgv = innerYargs ? innerYargs._parseArgs(null, null, true, commandIndex) : yargs._parseArgs(null, null, true, commandIndex) - } else { - innerArgv = yargs.parsed.argv + if (!innerYargs || (typeof innerYargs._parseArgs !== 'function')) { + innerYargs = yargs } - - if (innerYargs && yargs.parsed === false) aliases = innerYargs.parsed.aliases - else aliases = yargs.parsed.aliases + if (shouldUpdateUsage(innerYargs)) { + innerYargs.getUsageInstance().usage( + usageFromParentCommandsCommandHandler(parentCommands, commandHandler), + commandHandler.description + ) + } + innerArgv = innerYargs._parseArgs(null, null, true, commandIndex) + aliases = innerYargs.parsed.aliases } else if (typeof commandHandler.builder === 'object') { // as a short hand, an object can instead be provided, specifying // the options that a command takes. @@ -220,24 +218,37 @@ module.exports = function command (yargs, usage, validation) { positionalMap = populatePositionals(commandHandler, innerArgv, currentContext, yargs) } + const middlewares = globalMiddleware.slice(0).concat(commandHandler.middlewares || []) + applyMiddleware(innerArgv, yargs, middlewares, true) + // we apply validation post-hoc, so that custom // checks get passed populated positional arguments. if (!yargs._hasOutput()) yargs._runValidation(innerArgv, aliases, positionalMap, yargs.parsed.error) if (commandHandler.handler && !yargs._hasOutput()) { yargs._setHasOutput() - if (commandHandler.middlewares.length > 0) { - const middlewareArgs = commandHandler.middlewares.reduce(function (initialObj, middleware) { - return Object.assign(initialObj, middleware(innerArgv)) - }, {}) - Object.assign(innerArgv, middlewareArgs) + // to simplify the parsing of positionals in commands, + // we temporarily populate '--' rather than _, with arguments + const populateDoubleDash = !!yargs.getOptions().configuration['populate--'] + if (!populateDoubleDash) yargs._copyDoubleDash(innerArgv) + + innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false) + let handlerResult + if (isPromise(innerArgv)) { + handlerResult = innerArgv.then(argv => commandHandler.handler(argv)) + } else { + handlerResult = commandHandler.handler(innerArgv) } - const handlerResult = commandHandler.handler(innerArgv) - if (handlerResult && typeof handlerResult.then === 'function') { - handlerResult.then( - null, - (error) => yargs.getUsageInstance().fail(null, error) - ) + + if (isPromise(handlerResult)) { + yargs.getUsageInstance().cacheHelpMessage() + handlerResult.catch(error => { + try { + yargs.getUsageInstance().fail(null, error) + } catch (err) { + // fail's throwing would cause an unhandled rejection. + } + }) } } @@ -328,6 +339,7 @@ module.exports = function command (yargs, usage, validation) { options.default = Object.assign(parseOptions.default, options.default) options.alias = Object.assign(parseOptions.alias, options.alias) options.array = options.array.concat(parseOptions.array) + delete options.config // don't load config when processing positionals. const unparsed = [] Object.keys(positionalMap).forEach((key) => { @@ -340,7 +352,12 @@ module.exports = function command (yargs, usage, validation) { // short-circuit parse. if (!unparsed.length) return - const parsed = Parser.detailed(unparsed, options) + const config = Object.assign({}, options.configuration, { + 'populate--': true + }) + const parsed = Parser.detailed(unparsed, Object.assign({}, options, { + configuration: config + })) if (parsed.error) { yargs.getUsageInstance().fail(parsed.error.message, parsed.error) @@ -354,6 +371,9 @@ module.exports = function command (yargs, usage, validation) { Object.keys(parsed.argv).forEach((key) => { if (positionalKeys.indexOf(key) !== -1) { + // any new aliases need to be placed in positionalMap, which + // is used for validation. + if (!positionalMap[key]) positionalMap[key] = parsed.argv[key] argv[key] = parsed.argv[key] } }) @@ -408,18 +428,19 @@ module.exports = function command (yargs, usage, validation) { // the state of commands such that // we can apply .parse() multiple times // with the same yargs instance. - let frozen + let frozens = [] self.freeze = () => { - frozen = {} + let frozen = {} + frozens.push(frozen) frozen.handlers = handlers frozen.aliasMap = aliasMap frozen.defaultCommand = defaultCommand } self.unfreeze = () => { + let frozen = frozens.pop() handlers = frozen.handlers aliasMap = frozen.aliasMap defaultCommand = frozen.defaultCommand - frozen = undefined } return self diff --git a/deps/npm/node_modules/yargs/lib/completion-templates.js b/deps/npm/node_modules/yargs/lib/completion-templates.js new file mode 100644 index 00000000000000..43714fb6ed96a3 --- /dev/null +++ b/deps/npm/node_modules/yargs/lib/completion-templates.js @@ -0,0 +1,49 @@ +exports.completionShTemplate = +`###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc +# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. +# +_yargs_completions() +{ + local cur_word args type_list + + cur_word="\${COMP_WORDS[COMP_CWORD]}" + args=("\${COMP_WORDS[@]}") + + # ask yargs to generate completions. + type_list=$({{app_path}} --get-yargs-completions "\${args[@]}") + + COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) ) + + # if no match was found, fall back to filename completion + if [ \${#COMPREPLY[@]} -eq 0 ]; then + COMPREPLY=() + fi + + return 0 +} +complete -o default -F _yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +` + +exports.completionZshTemplate = `###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc +# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX. +# +_{{app_name}}_yargs_completions() +{ + local reply + local si=$IFS + IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}")) + IFS=$si + _describe 'values' reply +} +compdef _{{app_name}}_yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +` diff --git a/deps/npm/node_modules/yargs/lib/completion.js b/deps/npm/node_modules/yargs/lib/completion.js index ad6969a2d932f0..3f3bf16e1c9384 100644 --- a/deps/npm/node_modules/yargs/lib/completion.js +++ b/deps/npm/node_modules/yargs/lib/completion.js @@ -1,5 +1,4 @@ 'use strict' -const fs = require('fs') const path = require('path') // add bash completions to your @@ -9,6 +8,8 @@ module.exports = function completion (yargs, usage, command) { completionKey: 'get-yargs-completions' } + const zshShell = (process.env.SHELL && process.env.SHELL.indexOf('zsh') !== -1) || + (process.env.ZSH_NAME && process.env.ZSH_NAME.indexOf('zsh') !== -1) // get a list of completion commands. // 'args' is the array of strings from the line to be completed self.getCompletion = function getCompletion (args, done) { @@ -16,6 +17,7 @@ module.exports = function completion (yargs, usage, command) { const current = args.length ? args[args.length - 1] : '' const argv = yargs.parse(args, true) const aliases = yargs.parsed.aliases + const parentCommands = yargs.getContext().commands // a custom completion function can be provided // to completion(). @@ -54,22 +56,33 @@ module.exports = function completion (yargs, usage, command) { } } - if (!current.match(/^-/)) { + if (!current.match(/^-/) && parentCommands[parentCommands.length - 1] !== current) { usage.getCommands().forEach((usageCommand) => { const commandName = command.parseCommand(usageCommand[0]).cmd if (args.indexOf(commandName) === -1) { - completions.push(commandName) + if (!zshShell) { + completions.push(commandName) + } else { + const desc = usageCommand[1] || '' + completions.push(commandName.replace(/:/g, '\\:') + ':' + desc) + } } }) } - if (current.match(/^-/)) { + if (current.match(/^-/) || (current === '' && completions.length === 0)) { + const descs = usage.getDescriptions() Object.keys(yargs.getOptions().key).forEach((key) => { // If the key and its aliases aren't in 'args', add the key to 'completions' const keyAndAliases = [key].concat(aliases[key] || []) const notInArgs = keyAndAliases.every(val => args.indexOf(`--${val}`) === -1) if (notInArgs) { - completions.push(`--${key}`) + if (!zshShell) { + completions.push(`--${key}`) + } else { + const desc = descs[key] || '' + completions.push(`--${key.replace(/:/g, '\\:')}:${desc.replace('__yargsString__:', '')}`) + } } }) } @@ -79,10 +92,8 @@ module.exports = function completion (yargs, usage, command) { // generate the completion script to add to your .bashrc. self.generateCompletionScript = function generateCompletionScript ($0, cmd) { - let script = fs.readFileSync( - path.resolve(__dirname, '../completion.sh.hbs'), - 'utf-8' - ) + const templates = require('./completion-templates') + let script = zshShell ? templates.completionZshTemplate : templates.completionShTemplate const name = path.basename($0) // add ./to applications not yet installed as bin. diff --git a/deps/npm/node_modules/yargs/lib/is-promise.js b/deps/npm/node_modules/yargs/lib/is-promise.js new file mode 100644 index 00000000000000..271d93b2d121a2 --- /dev/null +++ b/deps/npm/node_modules/yargs/lib/is-promise.js @@ -0,0 +1,3 @@ +module.exports = function isPromise (maybePromise) { + return !!maybePromise && !!maybePromise.then && (typeof maybePromise.then === 'function') +} diff --git a/deps/npm/node_modules/yargs/lib/levenshtein.js b/deps/npm/node_modules/yargs/lib/levenshtein.js index f32b0c277125fc..c66c1babbc3d92 100644 --- a/deps/npm/node_modules/yargs/lib/levenshtein.js +++ b/deps/npm/node_modules/yargs/lib/levenshtein.js @@ -1,11 +1,22 @@ /* Copyright (c) 2011 Andrei Mackenzie -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // levenshtein distance algorithm, pulled from Andrei Mackenzie's MIT licensed. @@ -37,8 +48,8 @@ module.exports = function levenshtein (a, b) { matrix[i][j] = matrix[i - 1][j - 1] } else { matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution - Math.min(matrix[i][j - 1] + 1, // insertion - matrix[i - 1][j] + 1)) // deletion + Math.min(matrix[i][j - 1] + 1, // insertion + matrix[i - 1][j] + 1)) // deletion } } } diff --git a/deps/npm/node_modules/yargs/lib/middleware.js b/deps/npm/node_modules/yargs/lib/middleware.js new file mode 100644 index 00000000000000..56dab75277b470 --- /dev/null +++ b/deps/npm/node_modules/yargs/lib/middleware.js @@ -0,0 +1,64 @@ +'use strict' + +// hoisted due to circular dependency on command. +module.exports = { + applyMiddleware, + commandMiddlewareFactory, + globalMiddlewareFactory +} +const isPromise = require('./is-promise') +const argsert = require('./argsert') + +function globalMiddlewareFactory (globalMiddleware, context) { + return function (callback, applyBeforeValidation = false) { + argsert(' [boolean]', [callback, applyBeforeValidation], arguments.length) + if (Array.isArray(callback)) { + for (let i = 0; i < callback.length; i++) { + if (typeof callback[i] !== 'function') { + throw Error('middleware must be a function') + } + callback[i].applyBeforeValidation = applyBeforeValidation + } + Array.prototype.push.apply(globalMiddleware, callback) + } else if (typeof callback === 'function') { + callback.applyBeforeValidation = applyBeforeValidation + globalMiddleware.push(callback) + } + return context + } +} + +function commandMiddlewareFactory (commandMiddleware) { + if (!commandMiddleware) return [] + return commandMiddleware.map(middleware => { + middleware.applyBeforeValidation = false + return middleware + }) +} + +function applyMiddleware (argv, yargs, middlewares, beforeValidation) { + const beforeValidationError = new Error('middleware cannot return a promise when applyBeforeValidation is true') + return middlewares + .reduce((accumulation, middleware) => { + if (middleware.applyBeforeValidation !== beforeValidation) { + return accumulation + } + + if (isPromise(accumulation)) { + return accumulation + .then(initialObj => + Promise.all([initialObj, middleware(initialObj, yargs)]) + ) + .then(([initialObj, middlewareObj]) => + Object.assign(initialObj, middlewareObj) + ) + } else { + const result = middleware(argv, yargs) + if (beforeValidation && isPromise(result)) throw beforeValidationError + + return isPromise(result) + ? result.then(middlewareObj => Object.assign(accumulation, middlewareObj)) + : Object.assign(accumulation, result) + } + }, argv) +} diff --git a/deps/npm/node_modules/yargs/lib/usage.js b/deps/npm/node_modules/yargs/lib/usage.js index bd0906a89dbc29..92bf378620c5c9 100644 --- a/deps/npm/node_modules/yargs/lib/usage.js +++ b/deps/npm/node_modules/yargs/lib/usage.js @@ -1,6 +1,7 @@ 'use strict' // this file handles outputting usage instructions, // failures, etc. keeps logging in one place. +const decamelize = require('decamelize') const stringWidth = require('string-width') const objFilter = require('./obj-filter') const path = require('path') @@ -45,7 +46,10 @@ module.exports = function usage (yargs, y18n) { // don't output failure message more than once if (!failureOutput) { failureOutput = true - if (showHelpOnFail) yargs.showHelp('error') + if (showHelpOnFail) { + yargs.showHelp('error') + logger.error() + } if (msg || err) logger.error(msg || err) if (failMessage) { if (msg || err) logger.error('') @@ -118,9 +122,9 @@ module.exports = function usage (yargs, y18n) { } self.getDescriptions = () => descriptions - let epilog + let epilogs = [] self.epilog = (msg) => { - epilog = msg + epilogs.push(msg) } let wrapSet = false @@ -144,24 +148,26 @@ module.exports = function usage (yargs, y18n) { const defaultGroup = 'Options:' self.help = function help () { + if (cachedHelpMessage) return cachedHelpMessage normalizeAliases() // handle old demanded API - const base$0 = path.basename(yargs.$0) + const base$0 = yargs.customScriptName ? yargs.$0 : path.basename(yargs.$0) const demandedOptions = yargs.getDemandedOptions() const demandedCommands = yargs.getDemandedCommands() const groups = yargs.getGroups() const options = yargs.getOptions() - let keys = Object.keys( - Object.keys(descriptions) - .concat(Object.keys(demandedOptions)) - .concat(Object.keys(demandedCommands)) - .concat(Object.keys(options.default)) - .reduce((acc, key) => { - if (key !== '_') acc[key] = true - return acc - }, {}) - ) + + let keys = [] + keys = keys.concat(Object.keys(descriptions)) + keys = keys.concat(Object.keys(demandedOptions)) + keys = keys.concat(Object.keys(demandedCommands)) + keys = keys.concat(Object.keys(options.default)) + keys = keys.filter(filterHiddenOptions) + keys = Object.keys(keys.reduce((acc, key) => { + if (key !== '_') acc[key] = true + return acc + }, {})) const theWrap = getWrap() const ui = require('cliui')({ @@ -176,7 +182,7 @@ module.exports = function usage (yargs, y18n) { usages.forEach((usage) => { ui.div(`${usage[0].replace(/\$0/g, base$0)}`) if (usage[1]) { - ui.div({text: `${usage[1]}`, padding: [1, 0, 0, 0]}) + ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] }) } }) ui.div() @@ -200,6 +206,10 @@ module.exports = function usage (yargs, y18n) { const context = yargs.getContext() const parentCommands = context.commands.length ? `${context.commands.join(' ')} ` : '' + if (yargs.getParserConfiguration()['sort-commands'] === true) { + commands = commands.sort((a, b) => a[0].localeCompare(b[0])) + } + commands.forEach((command) => { const commandString = `${base$0} ${parentCommands}${command[0].replace(/^\$0 ?/, '')}` // drop $0 from default commands. ui.span( @@ -208,7 +218,7 @@ module.exports = function usage (yargs, y18n) { padding: [0, 2, 0, 2], width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4 }, - {text: command[1]} + { text: command[1] } ) const hints = [] if (command[2]) hints.push(`[${__('default:').slice(0, -1)}]`) // TODO hacking around i18n here @@ -216,7 +226,7 @@ module.exports = function usage (yargs, y18n) { hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`) } if (hints.length) { - ui.div({text: hints.join(' '), padding: [0, 0, 0, 2], align: 'right'}) + ui.div({ text: hints.join(' '), padding: [0, 0, 0, 2], align: 'right' }) } else { ui.div() } @@ -241,11 +251,9 @@ module.exports = function usage (yargs, y18n) { Object.keys(groups).forEach((groupName) => { if (!groups[groupName].length) return - ui.div(__(groupName)) - // if we've grouped the key 'f', but 'f' aliases 'foobar', // normalizedKeys should contain only 'foobar'. - const normalizedKeys = groups[groupName].map((key) => { + const normalizedKeys = groups[groupName].filter(filterHiddenOptions).map((key) => { if (~aliasKeys.indexOf(key)) return key for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) { if (~(options.alias[aliasKey] || []).indexOf(key)) return aliasKey @@ -253,6 +261,10 @@ module.exports = function usage (yargs, y18n) { return key }) + if (normalizedKeys.length < 1) return + + ui.div(__(groupName)) + // actually generate the switches string --foo, -f, --bar. const switches = normalizedKeys.reduce((acc, key) => { acc[key] = [ key ].concat(options.alias[key] || []) @@ -290,11 +302,11 @@ module.exports = function usage (yargs, y18n) { ].filter(Boolean).join(' ') ui.span( - {text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches, theWrap) + 4}, + { text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches, theWrap) + 4 }, desc ) - if (extra) ui.div({text: extra, padding: [0, 0, 0, 2], align: 'right'}) + if (extra) ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' }) else ui.div() }) @@ -334,12 +346,13 @@ module.exports = function usage (yargs, y18n) { } // the usage string. - if (epilog) { - const e = epilog.replace(/\$0/g, base$0) + if (epilogs.length > 0) { + const e = epilogs.map(epilog => epilog.replace(/\$0/g, base$0)).join('\n') ui.div(`${e}\n`) } - return ui.toString() + // Remove the trailing white spaces + return ui.toString().replace(/\s*$/, '') } // return the maximum width of a string @@ -391,6 +404,13 @@ module.exports = function usage (yargs, y18n) { }) } + // if yargs is executing an async handler, we take a snapshot of the + // help message to display on failure: + let cachedHelpMessage + self.cacheHelpMessage = function () { + cachedHelpMessage = this.help() + } + // given a set of keys, place any keys that are // ungrouped under the 'Options:' grouping. function addUngroupedKeys (keys, aliases, groups) { @@ -409,6 +429,10 @@ module.exports = function usage (yargs, y18n) { return groupedKeys } + function filterHiddenOptions (key) { + return yargs.getOptions().hiddenOptions.indexOf(key) < 0 || yargs.parsed.argv[yargs.getOptions().showHiddenOpt] + } + self.showHelp = (level) => { const logger = yargs._getLoggerInstance() if (!level) level = 'error' @@ -417,7 +441,7 @@ module.exports = function usage (yargs, y18n) { } self.functionDescription = (fn) => { - const description = fn.name ? require('decamelize')(fn.name, '-') : __('generated-value') + const description = fn.name ? decamelize(fn.name, '-') : __('generated-value') return ['(', description, ')'].join('') } @@ -489,35 +513,36 @@ module.exports = function usage (yargs, y18n) { failureOutput = false usages = [] usageDisabled = false - epilog = undefined + epilogs = [] examples = [] commands = [] descriptions = objFilter(descriptions, (k, v) => !localLookup[k]) return self } - let frozen + let frozens = [] self.freeze = function freeze () { - frozen = {} + let frozen = {} + frozens.push(frozen) frozen.failMessage = failMessage frozen.failureOutput = failureOutput frozen.usages = usages frozen.usageDisabled = usageDisabled - frozen.epilog = epilog + frozen.epilogs = epilogs frozen.examples = examples frozen.commands = commands frozen.descriptions = descriptions } self.unfreeze = function unfreeze () { + let frozen = frozens.pop() failMessage = frozen.failMessage failureOutput = frozen.failureOutput usages = frozen.usages usageDisabled = frozen.usageDisabled - epilog = frozen.epilog + epilogs = frozen.epilogs examples = frozen.examples commands = frozen.commands descriptions = frozen.descriptions - frozen = undefined } return self diff --git a/deps/npm/node_modules/yargs/lib/validation.js b/deps/npm/node_modules/yargs/lib/validation.js index f4655b4fdc7ac5..35659a356b8101 100644 --- a/deps/npm/node_modules/yargs/lib/validation.js +++ b/deps/npm/node_modules/yargs/lib/validation.js @@ -37,7 +37,7 @@ module.exports = function validation (yargs, usage, y18n) { ) } else { usage.fail( - __('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max) + __('Too many non-option arguments: got %s, maximum of %s', _s, demandedCommands._.max) ) } } @@ -96,13 +96,13 @@ module.exports = function validation (yargs, usage, y18n) { if (specialKeys.indexOf(key) === -1 && !positionalMap.hasOwnProperty(key) && !yargs._getParseContext().hasOwnProperty(key) && - !aliases.hasOwnProperty(key) + !self.isValidAndSomeAliasIsNotNew(key, aliases) ) { unknown.push(key) } }) - if (commandKeys.length > 0) { + if ((currentContext.commands.length > 0) || (commandKeys.length > 0)) { argv._.slice(currentContext.commands.length).forEach((key) => { if (commandKeys.indexOf(key) === -1) { unknown.push(key) @@ -120,6 +120,21 @@ module.exports = function validation (yargs, usage, y18n) { } } + // check for a key that is not an alias, or for which every alias is new, + // implying that it was invented by the parser, e.g., during camelization + self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew (key, aliases) { + if (!aliases.hasOwnProperty(key)) { + return false + } + const newAliases = yargs.parsed.newAliases + for (let a of [key, ...aliases[key]]) { + if (!newAliases.hasOwnProperty(a) || !newAliases[key]) { + return true + } + } + return false + } + // validate arguments limited to enumerated choices self.limitedChoices = function limitedChoices (argv) { const options = yargs.getOptions() @@ -209,43 +224,36 @@ module.exports = function validation (yargs, usage, y18n) { return implied } + function keyExists (argv, val) { + // convert string '1' to number 1 + let num = Number(val) + val = isNaN(num) ? val : num + + if (typeof val === 'number') { + // check length of argv._ + val = argv._.length >= val + } else if (val.match(/^--no-.+/)) { + // check if key/value doesn't exist + val = val.match(/^--no-(.+)/)[1] + val = !argv[val] + } else { + // check if key/value exists + val = argv[val] + } + return val + } + self.implications = function implications (argv) { const implyFail = [] Object.keys(implied).forEach((key) => { const origKey = key ;(implied[key] || []).forEach((value) => { - let num let key = origKey const origValue = value + key = keyExists(argv, key) + value = keyExists(argv, value) - // convert string '1' to number 1 - num = Number(key) - key = isNaN(num) ? key : num - - if (typeof key === 'number') { - // check length of argv._ - key = argv._.length >= key - } else if (key.match(/^--no-.+/)) { - // check if key doesn't exist - key = key.match(/^--no-(.+)/)[1] - key = !argv[key] - } else { - // check if key exists - key = argv[key] - } - - num = Number(value) - value = isNaN(num) ? value : num - - if (typeof value === 'number') { - value = argv._.length >= value - } else if (value.match(/^--no-.+/)) { - value = value.match(/^--no-(.+)/)[1] - value = !argv[value] - } else { - value = argv[value] - } if (key && !value) { implyFail.push(` ${origKey} -> ${origValue}`) } @@ -292,7 +300,7 @@ module.exports = function validation (yargs, usage, y18n) { // we default keys to 'undefined' that have been configured, we should not // apply conflicting check unless they are a value other than 'undefined'. if (value && argv[key] !== undefined && argv[value] !== undefined) { - usage.fail(__(`Arguments ${key} and ${value} are mutually exclusive`)) + usage.fail(__('Arguments %s and %s are mutually exclusive', key, value)) } }) } @@ -323,18 +331,19 @@ module.exports = function validation (yargs, usage, y18n) { return self } - let frozen + let frozens = [] self.freeze = function freeze () { - frozen = {} + let frozen = {} + frozens.push(frozen) frozen.implied = implied frozen.checks = checks frozen.conflicting = conflicting } self.unfreeze = function unfreeze () { + let frozen = frozens.pop() implied = frozen.implied checks = frozen.checks conflicting = frozen.conflicting - frozen = undefined } return self diff --git a/deps/npm/node_modules/yargs/locales/de.json b/deps/npm/node_modules/yargs/locales/de.json index d805710b09a543..05d983737140fd 100644 --- a/deps/npm/node_modules/yargs/locales/de.json +++ b/deps/npm/node_modules/yargs/locales/de.json @@ -29,7 +29,7 @@ "Invalid values:": "Unzulässige Werte:", "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s", "Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s", - "Implications failed:": "Implikationen fehlgeschlagen:", + "Implications failed:": "Fehlende abhängige Argumente:", "Not enough arguments following: %s": "Nicht genügend Argumente nach: %s", "Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s", "Path to JSON config file": "Pfad zur JSON-Config Datei", diff --git a/deps/npm/node_modules/yargs/locales/en.json b/deps/npm/node_modules/yargs/locales/en.json index fc65c2a0d86f01..b32a63f27adba3 100644 --- a/deps/npm/node_modules/yargs/locales/en.json +++ b/deps/npm/node_modules/yargs/locales/en.json @@ -29,7 +29,7 @@ "Invalid values:": "Invalid values:", "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s", "Argument check failed: %s": "Argument check failed: %s", - "Implications failed:": "Implications failed:", + "Implications failed:": "Missing dependent arguments:", "Not enough arguments following: %s": "Not enough arguments following: %s", "Invalid JSON config file: %s": "Invalid JSON config file: %s", "Path to JSON config file": "Path to JSON config file", diff --git a/deps/npm/node_modules/yargs/locales/fr.json b/deps/npm/node_modules/yargs/locales/fr.json index 481f47e37fbc9d..cf9c74bf5b7504 100644 --- a/deps/npm/node_modules/yargs/locales/fr.json +++ b/deps/npm/node_modules/yargs/locales/fr.json @@ -28,7 +28,7 @@ "Invalid values:": "Valeurs invalides:", "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s", "Argument check failed: %s": "Echec de la vérification de l'argument: %s", - "Implications failed:": "Implications échouées:", + "Implications failed:": "Arguments dépendants manquants:", "Not enough arguments following: %s": "Pas assez d'arguments suivant: %s", "Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s", "Path to JSON config file": "Chemin du fichier de configuration JSON", diff --git a/deps/npm/node_modules/yargs/locales/it.json b/deps/npm/node_modules/yargs/locales/it.json index f9eb3756eacc1e..9ee900d34aca99 100644 --- a/deps/npm/node_modules/yargs/locales/it.json +++ b/deps/npm/node_modules/yargs/locales/it.json @@ -29,7 +29,7 @@ "Invalid values:": "Valori non validi:", "Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s", "Argument check failed: %s": "Controllo dell'argomento fallito: %s", - "Implications failed:": "Argomenti impliciti non soddisfatti:", + "Implications failed:": "Argomenti dipendenti mancanti:", "Not enough arguments following: %s": "Argomenti insufficienti dopo: %s", "Invalid JSON config file: %s": "File di configurazione JSON non valido: %s", "Path to JSON config file": "Percorso del file di configurazione JSON", diff --git a/deps/npm/node_modules/yargs/locales/nb.json b/deps/npm/node_modules/yargs/locales/nb.json index fc607fb1e19c11..55be1fbedeb699 100644 --- a/deps/npm/node_modules/yargs/locales/nb.json +++ b/deps/npm/node_modules/yargs/locales/nb.json @@ -27,7 +27,7 @@ }, "Invalid values:": "Ugyldige verdier:", "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s", - "Argument check failed: %s": "Argument sjekk mislyktes: %s", + "Argument check failed: %s": "Argumentsjekk mislyktes: %s", "Implications failed:": "Konsekvensene mislyktes:", "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s", "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", diff --git a/deps/npm/node_modules/yargs/locales/nl.json b/deps/npm/node_modules/yargs/locales/nl.json index 1d144724ec3b6a..5d62e0fc3b6114 100644 --- a/deps/npm/node_modules/yargs/locales/nl.json +++ b/deps/npm/node_modules/yargs/locales/nl.json @@ -1,42 +1,42 @@ { - "Commands:": "Opdrachten:", + "Commands:": "Commando's:", "Options:": "Opties:", "Examples:": "Voorbeelden:", - "boolean": "boolean", + "boolean": "booleaans", "count": "aantal", - "string": "text", - "number": "nummer", + "string": "string", + "number": "getal", "array": "lijst", "required": "verplicht", "default:": "standaard:", "choices:": "keuzes:", "aliases:": "aliassen:", "generated-value": "gegenereerde waarde", - "Not enough non-option arguments: got %s, need at least %s": "Niet genoeg non-optie argumenten. Gekregen: %s, minstens nodig: %s", - "Too many non-option arguments: got %s, maximum of %s": "Te veel non-optie argumenten. Gekregen: %s, maximum: %s", + "Not enough non-option arguments: got %s, need at least %s": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig", + "Too many non-option arguments: got %s, maximum of %s": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s", "Missing argument value: %s": { - "one": "Missing argument value: %s", - "other": "Missing argument values: %s" + "one": "Missende argumentwaarde: %s", + "other": "Missende argumentwaarden: %s" }, "Missing required argument: %s": { - "one": "Missend verplichte argument: %s", + "one": "Missend verplicht argument: %s", "other": "Missende verplichte argumenten: %s" }, "Unknown argument: %s": { "one": "Onbekend argument: %s", "other": "Onbekende argumenten: %s" }, - "Invalid values:": "Ongeldige waardes:", + "Invalid values:": "Ongeldige waarden:", "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s", - "Argument check failed: %s": "Argument check mislukt: %s", - "Implications failed:": "Implicaties mislukt:", + "Argument check failed: %s": "Argumentcontrole mislukt: %s", + "Implications failed:": "Ontbrekende afhankelijke argumenten:", "Not enough arguments following: %s": "Niet genoeg argumenten na: %s", - "Invalid JSON config file: %s": "Ongeldig JSON configuratiebestand: %s", - "Path to JSON config file": "Pad naar JSON configuratiebestand", + "Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s", + "Path to JSON config file": "Pad naar JSON-config-bestand", "Show help": "Toon help", - "Show version number": "Toon versie nummer", + "Show version number": "Toon versienummer", "Did you mean %s?": "Bedoelde u misschien %s?", - "Arguments %s and %s are mutually exclusive": "Argumenten %s en %s zijn onderling uitsluitend", + "Arguments %s and %s are mutually exclusive": "Argumenten %s en %s kunnen niet tegelijk gebruikt worden", "Positionals:": "Positie-afhankelijke argumenten", "command": "commando" } diff --git a/deps/npm/node_modules/yargs/locales/nn.json b/deps/npm/node_modules/yargs/locales/nn.json index 5e03c505ab75bd..5a3c9514dc5b07 100644 --- a/deps/npm/node_modules/yargs/locales/nn.json +++ b/deps/npm/node_modules/yargs/locales/nn.json @@ -29,9 +29,9 @@ }, "Invalid values:": "Ugyldige verdiar:", "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s", - "Argument check failed: %s": "Argument sjekk mislukkast: %s", + "Argument check failed: %s": "Argumentsjekk mislukkast: %s", "Implications failed:": "Konsekvensane mislukkast:", - "Not enough arguments following: %s": "Ikkje nok fylgande argument: %s", + "Not enough arguments following: %s": "Ikkje nok fylgjande argument: %s", "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s", "Path to JSON config file": "Bane til JSON konfigurasjonsfil", "Show help": "Vis hjelp", diff --git a/deps/npm/node_modules/yargs/locales/pirate.json b/deps/npm/node_modules/yargs/locales/pirate.json index 1f4e19e65de5e7..dcb5cb75377d70 100644 --- a/deps/npm/node_modules/yargs/locales/pirate.json +++ b/deps/npm/node_modules/yargs/locales/pirate.json @@ -8,5 +8,6 @@ "other": "Ye be havin' to set the followin' arguments land lubber: %s" }, "Show help": "Parlay this here code of conduct", - "Show version number": "'Tis the version ye be askin' fer" + "Show version number": "'Tis the version ye be askin' fer", + "Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench" } diff --git a/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js b/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000000..c25448009f304d --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/ansi-regex/index.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = options => { + options = Object.assign({ + onlyFirst: false + }, options); + + const pattern = [ + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' + ].join('|'); + + return new RegExp(pattern, options.onlyFirst ? undefined : 'g'); +}; diff --git a/deps/npm/node_modules/os-locale/license b/deps/npm/node_modules/yargs/node_modules/ansi-regex/license similarity index 100% rename from deps/npm/node_modules/os-locale/license rename to deps/npm/node_modules/yargs/node_modules/ansi-regex/license diff --git a/deps/npm/node_modules/yargs/node_modules/ansi-regex/package.json b/deps/npm/node_modules/yargs/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000000..32d176534fee2a --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/ansi-regex/package.json @@ -0,0 +1,85 @@ +{ + "_from": "ansi-regex@^4.1.0", + "_id": "ansi-regex@4.1.0", + "_inBundle": false, + "_integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "_location": "/yargs/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^4.1.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^4.1.0", + "saveSpec": null, + "fetchSpec": "^4.1.0" + }, + "_requiredBy": [ + "/yargs/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "_shasum": "8b9f8f08cf1acb843756a839ca8c7e3168c51997", + "_spec": "ansi-regex@^4.1.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/strip-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "^0.25.0", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "4.1.0" +} diff --git a/deps/npm/node_modules/yargs/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/yargs/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000000000..d19c44667e704b --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/ansi-regex/readme.md @@ -0,0 +1,87 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + + +## Install + +``` +$ npm install ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001B[4mcake\u001B[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001B[4mcake\u001B[0m'.match(ansiRegex()); +//=> ['\u001B[4m', '\u001B[0m'] + +'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true})); +//=> ['\u001B[4m'] + +'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex()); +//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007'] +``` + + +## API + +### ansiRegex([options]) + +Returns a regex for matching ANSI escape codes. + +#### options + +##### onlyFirst + +Type: `boolean`
+Default: `false` *(Matches any ANSI escape codes in a string)* + +Match only the first ANSI escape. + + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/deps/npm/node_modules/find-up/index.js b/deps/npm/node_modules/yargs/node_modules/find-up/index.js similarity index 77% rename from deps/npm/node_modules/find-up/index.js rename to deps/npm/node_modules/yargs/node_modules/find-up/index.js index 939c9553dceca2..8e83819cea5a95 100644 --- a/deps/npm/node_modules/find-up/index.js +++ b/deps/npm/node_modules/yargs/node_modules/find-up/index.js @@ -2,11 +2,9 @@ const path = require('path'); const locatePath = require('locate-path'); -module.exports = (filename, opts) => { - opts = opts || {}; - +module.exports = (filename, opts = {}) => { const startDir = path.resolve(opts.cwd || ''); - const root = path.parse(startDir).root; + const {root} = path.parse(startDir); const filenames = [].concat(filename); @@ -25,11 +23,9 @@ module.exports = (filename, opts) => { }); }; -module.exports.sync = (filename, opts) => { - opts = opts || {}; - +module.exports.sync = (filename, opts = {}) => { let dir = path.resolve(opts.cwd || ''); - const root = path.parse(dir).root; + const {root} = path.parse(dir); const filenames = [].concat(filename); @@ -39,7 +35,9 @@ module.exports.sync = (filename, opts) => { if (file) { return path.join(dir, file); - } else if (dir === root) { + } + + if (dir === root) { return null; } diff --git a/deps/npm/node_modules/os-locale/node_modules/execa/license b/deps/npm/node_modules/yargs/node_modules/find-up/license similarity index 100% rename from deps/npm/node_modules/os-locale/node_modules/execa/license rename to deps/npm/node_modules/yargs/node_modules/find-up/license diff --git a/deps/npm/node_modules/find-up/package.json b/deps/npm/node_modules/yargs/node_modules/find-up/package.json similarity index 63% rename from deps/npm/node_modules/find-up/package.json rename to deps/npm/node_modules/yargs/node_modules/find-up/package.json index 3647cbf41fd903..4ea5014dd40c68 100644 --- a/deps/npm/node_modules/find-up/package.json +++ b/deps/npm/node_modules/yargs/node_modules/find-up/package.json @@ -1,29 +1,27 @@ { - "_from": "find-up@^2.1.0", - "_id": "find-up@2.1.0", + "_from": "find-up@^3.0.0", + "_id": "find-up@3.0.0", "_inBundle": false, - "_integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "_location": "/find-up", + "_integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "_location": "/yargs/find-up", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "find-up@^2.1.0", + "raw": "find-up@^3.0.0", "name": "find-up", "escapedName": "find-up", - "rawSpec": "^2.1.0", + "rawSpec": "^3.0.0", "saveSpec": null, - "fetchSpec": "^2.1.0" + "fetchSpec": "^3.0.0" }, "_requiredBy": [ - "/pkg-conf", - "/read-pkg-up", "/yargs" ], - "_resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "_shasum": "45d1b7e506c717ddd482775a2b77920a3c0c57a7", - "_spec": "find-up@^2.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/yargs", + "_resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "_shasum": "49169f1d7993430646da61ecc5ae355c21c97b73", + "_spec": "find-up@^3.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -34,17 +32,17 @@ }, "bundleDependencies": false, "dependencies": { - "locate-path": "^2.0.0" + "locate-path": "^3.0.0" }, "deprecated": false, - "description": "Find a file by walking up parent directories", + "description": "Find a file or directory by walking up parent directories", "devDependencies": { "ava": "*", - "tempfile": "^1.1.1", + "tempy": "^0.2.1", "xo": "*" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -80,8 +78,5 @@ "scripts": { "test": "xo && ava" }, - "version": "2.1.0", - "xo": { - "esnext": true - } + "version": "3.0.0" } diff --git a/deps/npm/node_modules/find-up/readme.md b/deps/npm/node_modules/yargs/node_modules/find-up/readme.md similarity index 71% rename from deps/npm/node_modules/find-up/readme.md rename to deps/npm/node_modules/yargs/node_modules/find-up/readme.md index b5ad694552dfd1..810ad7ceb52766 100644 --- a/deps/npm/node_modules/find-up/readme.md +++ b/deps/npm/node_modules/yargs/node_modules/find-up/readme.md @@ -1,12 +1,12 @@ # find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master) -> Find a file by walking up parent directories +> Find a file or directory by walking up parent directories ## Install ``` -$ npm install --save find-up +$ npm install find-up ``` @@ -23,19 +23,18 @@ $ npm install --save find-up └── example.js ``` +`example.js` + ```js -// example.js const findUp = require('find-up'); -findUp('unicorn.png').then(filepath => { - console.log(filepath); +(async () => { + console.log(await findUp('unicorn.png')); //=> '/Users/sindresorhus/unicorn.png' -}); -findUp(['rainbow.png', 'unicorn.png']).then(filepath => { - console.log(filepath); + console.log(await findUp(['rainbow.png', 'unicorn.png'])); //=> '/Users/sindresorhus/unicorn.png' -}); +})(); ``` @@ -43,11 +42,11 @@ findUp(['rainbow.png', 'unicorn.png']).then(filepath => { ### findUp(filename, [options]) -Returns a `Promise` for the filepath or `null`. +Returns a `Promise` for either the filepath or `null` if it couldn't be found. ### findUp([filenameA, filenameB], [options]) -Returns a `Promise` for the first filepath found (by respecting the order) or `null`. +Returns a `Promise` for either the first filepath found (by respecting the order) or `null` if none could be found. ### findUp.sync(filename, [options]) @@ -65,6 +64,8 @@ Filename of the file to find. #### options +Type: `Object` + ##### cwd Type: `string`
@@ -78,6 +79,7 @@ Directory to start from. - [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module - [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file - [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package +- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path ## License diff --git a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..d506327c3e5576 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +/* eslint-disable yoda */ +module.exports = x => { + if (Number.isNaN(x)) { + return false; + } + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if ( + x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + x === 0x2329 || // LEFT-POINTING ANGLE BRACKET + x === 0x232a || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + (0x3250 <= x && x <= 0x4dbf) || + // CJK Unified Ideographs .. Yi Radicals + (0x4e00 <= x && x <= 0xa4c6) || + // Hangul Jamo Extended-A + (0xa960 <= x && x <= 0xa97c) || + // Hangul Syllables + (0xac00 <= x && x <= 0xd7a3) || + // CJK Compatibility Ideographs + (0xf900 <= x && x <= 0xfaff) || + // Vertical Forms + (0xfe10 <= x && x <= 0xfe19) || + // CJK Compatibility Forms .. Small Form Variants + (0xfe30 <= x && x <= 0xfe6b) || + // Halfwidth and Fullwidth Forms + (0xff01 <= x && x <= 0xff60) || + (0xffe0 <= x && x <= 0xffe6) || + // Kana Supplement + (0x1b000 <= x && x <= 0x1b001) || + // Enclosed Ideographic Supplement + (0x1f200 <= x && x <= 0x1f251) || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + (0x20000 <= x && x <= 0x3fffd) + ) + ) { + return true; + } + + return false; +}; diff --git a/deps/npm/node_modules/p-defer/license b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/license similarity index 100% rename from deps/npm/node_modules/p-defer/license rename to deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/license diff --git a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..88ca7956f19705 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,77 @@ +{ + "_from": "is-fullwidth-code-point@^2.0.0", + "_id": "is-fullwidth-code-point@2.0.0", + "_inBundle": false, + "_integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "_location": "/yargs/is-fullwidth-code-point", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "is-fullwidth-code-point@^2.0.0", + "name": "is-fullwidth-code-point", + "escapedName": "is-fullwidth-code-point", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/yargs/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "_shasum": "a3b30a5c4f199183167aaab93beefae3ddfb654f", + "_spec": "is-fullwidth-code-point@^2.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "name": "is-fullwidth-code-point", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..093b0281b2c46b --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +const isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/locate-path/index.js b/deps/npm/node_modules/yargs/node_modules/locate-path/index.js new file mode 100644 index 00000000000000..5aae6ee4ad0277 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/locate-path/index.js @@ -0,0 +1,24 @@ +'use strict'; +const path = require('path'); +const pathExists = require('path-exists'); +const pLocate = require('p-locate'); + +module.exports = (iterable, options) => { + options = Object.assign({ + cwd: process.cwd() + }, options); + + return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options); +}; + +module.exports.sync = (iterable, options) => { + options = Object.assign({ + cwd: process.cwd() + }, options); + + for (const el of iterable) { + if (pathExists.sync(path.resolve(options.cwd, el))) { + return el; + } + } +}; diff --git a/deps/npm/node_modules/p-is-promise/license b/deps/npm/node_modules/yargs/node_modules/locate-path/license similarity index 100% rename from deps/npm/node_modules/p-is-promise/license rename to deps/npm/node_modules/yargs/node_modules/locate-path/license diff --git a/deps/npm/node_modules/locate-path/package.json b/deps/npm/node_modules/yargs/node_modules/locate-path/package.json similarity index 68% rename from deps/npm/node_modules/locate-path/package.json rename to deps/npm/node_modules/yargs/node_modules/locate-path/package.json index 3e1b24f373489f..4800b6856bf929 100644 --- a/deps/npm/node_modules/locate-path/package.json +++ b/deps/npm/node_modules/yargs/node_modules/locate-path/package.json @@ -1,27 +1,27 @@ { - "_from": "locate-path@^2.0.0", - "_id": "locate-path@2.0.0", + "_from": "locate-path@^3.0.0", + "_id": "locate-path@3.0.0", "_inBundle": false, - "_integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "_location": "/locate-path", + "_integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "_location": "/yargs/locate-path", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "locate-path@^2.0.0", + "raw": "locate-path@^3.0.0", "name": "locate-path", "escapedName": "locate-path", - "rawSpec": "^2.0.0", + "rawSpec": "^3.0.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "^3.0.0" }, "_requiredBy": [ - "/find-up" + "/yargs/find-up" ], - "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "_shasum": "2b568b265eec944c6d9c0de9c3dbbbca0354cd8e", - "_spec": "locate-path@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/find-up", + "_resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "_shasum": "dbec3b3ab759758071b58fe59fc41871af21400e", + "_spec": "locate-path@^3.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/find-up", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -32,7 +32,7 @@ }, "bundleDependencies": false, "dependencies": { - "p-locate": "^2.0.0", + "p-locate": "^3.0.0", "path-exists": "^3.0.0" }, "deprecated": false, @@ -42,7 +42,7 @@ "xo": "*" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -72,8 +72,5 @@ "scripts": { "test": "xo && ava" }, - "version": "2.0.0", - "xo": { - "esnext": true - } + "version": "3.0.0" } diff --git a/deps/npm/node_modules/locate-path/readme.md b/deps/npm/node_modules/yargs/node_modules/locate-path/readme.md similarity index 89% rename from deps/npm/node_modules/locate-path/readme.md rename to deps/npm/node_modules/yargs/node_modules/locate-path/readme.md index f7b337bb2c1c6f..a1d2e628328c2b 100644 --- a/deps/npm/node_modules/locate-path/readme.md +++ b/deps/npm/node_modules/yargs/node_modules/locate-path/readme.md @@ -6,7 +6,7 @@ ## Install ``` -$ npm install --save locate-path +$ npm install locate-path ``` @@ -19,14 +19,14 @@ const locatePath = require('locate-path'); const files = [ 'unicorn.png', - 'rainbow.png', // only this one actually exists on disk + 'rainbow.png', // Only this one actually exists on disk 'pony.png' ]; -locatePath(files).then(foundPath => { - console.log(foundPath); +(async () => { + console(await locatePath(files)); //=> 'rainbow' -}); +})(); ``` diff --git a/deps/npm/node_modules/yargs/node_modules/p-limit/index.d.ts b/deps/npm/node_modules/yargs/node_modules/p-limit/index.d.ts new file mode 100644 index 00000000000000..6bbfad4ac77665 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/p-limit/index.d.ts @@ -0,0 +1,38 @@ +export interface Limit { + /** + @param fn - Promise-returning/async function. + @param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions. + @returns The promise returned by calling `fn(...arguments)`. + */ + ( + fn: (...arguments: Arguments) => PromiseLike | ReturnType, + ...arguments: Arguments + ): Promise; + + /** + The number of promises that are currently running. + */ + readonly activeCount: number; + + /** + The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + */ + readonly pendingCount: number; + + /** + Discard pending promises that are waiting to run. + + This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + + Note: This does not cancel promises that are already running. + */ + clearQueue(): void; +} + +/** +Run multiple promise-returning & async functions with limited concurrency. + +@param concurrency - Concurrency limit. Minimum: `1`. +@returns A `limit` function. +*/ +export default function pLimit(concurrency: number): Limit; diff --git a/deps/npm/node_modules/yargs/node_modules/p-limit/index.js b/deps/npm/node_modules/yargs/node_modules/p-limit/index.js new file mode 100644 index 00000000000000..6a72a4c4fc3c72 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/p-limit/index.js @@ -0,0 +1,57 @@ +'use strict'; +const pTry = require('p-try'); + +const pLimit = concurrency => { + if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) { + return Promise.reject(new TypeError('Expected `concurrency` to be a number from 1 and up')); + } + + const queue = []; + let activeCount = 0; + + const next = () => { + activeCount--; + + if (queue.length > 0) { + queue.shift()(); + } + }; + + const run = (fn, resolve, ...args) => { + activeCount++; + + const result = pTry(fn, ...args); + + resolve(result); + + result.then(next, next); + }; + + const enqueue = (fn, resolve, ...args) => { + if (activeCount < concurrency) { + run(fn, resolve, ...args); + } else { + queue.push(run.bind(null, fn, resolve, ...args)); + } + }; + + const generator = (fn, ...args) => new Promise(resolve => enqueue(fn, resolve, ...args)); + Object.defineProperties(generator, { + activeCount: { + get: () => activeCount + }, + pendingCount: { + get: () => queue.length + }, + clearQueue: { + value: () => { + queue.length = 0; + } + } + }); + + return generator; +}; + +module.exports = pLimit; +module.exports.default = pLimit; diff --git a/deps/npm/node_modules/p-limit/license b/deps/npm/node_modules/yargs/node_modules/p-limit/license similarity index 100% rename from deps/npm/node_modules/p-limit/license rename to deps/npm/node_modules/yargs/node_modules/p-limit/license diff --git a/deps/npm/node_modules/p-limit/package.json b/deps/npm/node_modules/yargs/node_modules/p-limit/package.json similarity index 59% rename from deps/npm/node_modules/p-limit/package.json rename to deps/npm/node_modules/yargs/node_modules/p-limit/package.json index 7d0377227e2a12..1aef677a317514 100644 --- a/deps/npm/node_modules/p-limit/package.json +++ b/deps/npm/node_modules/yargs/node_modules/p-limit/package.json @@ -1,27 +1,27 @@ { - "_from": "p-limit@^1.1.0", - "_id": "p-limit@1.2.0", + "_from": "p-limit@^2.0.0", + "_id": "p-limit@2.3.0", "_inBundle": false, - "_integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", - "_location": "/p-limit", + "_integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "_location": "/yargs/p-limit", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "p-limit@^1.1.0", + "raw": "p-limit@^2.0.0", "name": "p-limit", "escapedName": "p-limit", - "rawSpec": "^1.1.0", + "rawSpec": "^2.0.0", "saveSpec": null, - "fetchSpec": "^1.1.0" + "fetchSpec": "^2.0.0" }, "_requiredBy": [ - "/p-locate" + "/yargs/p-locate" ], - "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "_shasum": "0e92b6bedcb59f022c13d0f1949dc82d15909f1c", - "_spec": "p-limit@^1.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/p-locate", + "_resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "_shasum": "3dd33c647a214fdfffd835933eb086da0dc21db1", + "_spec": "p-limit@^2.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/p-locate", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -32,24 +32,27 @@ }, "bundleDependencies": false, "dependencies": { - "p-try": "^1.0.0" + "p-try": "^2.0.0" }, "deprecated": false, "description": "Run multiple promise-returning & async functions with limited concurrency", "devDependencies": { - "ava": "*", - "delay": "^2.0.0", + "ava": "^1.2.1", + "delay": "^4.1.0", "in-range": "^1.0.0", "random-int": "^1.0.0", "time-span": "^2.0.0", - "xo": "*" + "tsd-check": "^0.3.0", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], + "funding": "https://github.com/sponsors/sindresorhus", "homepage": "https://github.com/sindresorhus/p-limit#readme", "keywords": [ "promise", @@ -75,7 +78,7 @@ "url": "git+https://github.com/sindresorhus/p-limit.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd-check" }, - "version": "1.2.0" + "version": "2.3.0" } diff --git a/deps/npm/node_modules/yargs/node_modules/p-limit/readme.md b/deps/npm/node_modules/yargs/node_modules/p-limit/readme.md new file mode 100644 index 00000000000000..64aa476e2370c1 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/p-limit/readme.md @@ -0,0 +1,101 @@ +# p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit) + +> Run multiple promise-returning & async functions with limited concurrency + +## Install + +``` +$ npm install p-limit +``` + +## Usage + +```js +const pLimit = require('p-limit'); + +const limit = pLimit(1); + +const input = [ + limit(() => fetchSomething('foo')), + limit(() => fetchSomething('bar')), + limit(() => doSomething()) +]; + +(async () => { + // Only one promise is run at once + const result = await Promise.all(input); + console.log(result); +})(); +``` + +## API + +### pLimit(concurrency) + +Returns a `limit` function. + +#### concurrency + +Type: `number`\ +Minimum: `1`\ +Default: `Infinity` + +Concurrency limit. + +### limit(fn, ...args) + +Returns the promise returned by calling `fn(...args)`. + +#### fn + +Type: `Function` + +Promise-returning/async function. + +#### args + +Any arguments to pass through to `fn`. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +### limit.activeCount + +The number of promises that are currently running. + +### limit.pendingCount + +The number of promises that are waiting to run (i.e. their internal `fn` was not called yet). + +### limit.clearQueue() + +Discard pending promises that are waiting to run. + +This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app. + +Note: This does not cancel promises that are already running. + +## FAQ + +### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package? + +This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue. + +## Related + +- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control +- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions +- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions +- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency +- [More…](https://github.com/sindresorhus/promise-fun) + +--- + +
+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
diff --git a/deps/npm/node_modules/p-locate/index.js b/deps/npm/node_modules/yargs/node_modules/p-locate/index.js similarity index 56% rename from deps/npm/node_modules/p-locate/index.js rename to deps/npm/node_modules/yargs/node_modules/p-locate/index.js index 7461d665b560ad..4bd08aad193128 100644 --- a/deps/npm/node_modules/p-locate/index.js +++ b/deps/npm/node_modules/yargs/node_modules/p-locate/index.js @@ -8,7 +8,10 @@ class EndError extends Error { } } -// the input can also be a promise, so we `Promise.all()` them both +// The input can also be a promise, so we `Promise.resolve()` it +const testElement = (el, tester) => Promise.resolve(el).then(tester); + +// The input can also be a promise, so we `Promise.all()` them both const finder = el => Promise.all(el).then(val => val[1] === true && Promise.reject(new EndError(val[0]))); module.exports = (iterable, tester, opts) => { @@ -19,13 +22,13 @@ module.exports = (iterable, tester, opts) => { const limit = pLimit(opts.concurrency); - // start all the promises concurrently with optional limit - const items = Array.from(iterable).map(el => [el, limit(() => Promise.resolve(el).then(tester))]); + // Start all the promises concurrently with optional limit + const items = [...iterable].map(el => [el, limit(testElement, el, tester)]); - // check the promises either serially or concurrently + // Check the promises either serially or concurrently const checkLimit = pLimit(opts.preserveOrder ? 1 : Infinity); - return Promise.all(items.map(el => checkLimit(() => finder(el)))) + return Promise.all(items.map(el => checkLimit(finder, el))) .then(() => {}) .catch(err => err instanceof EndError ? err.value : Promise.reject(err)); }; diff --git a/deps/npm/node_modules/map-age-cleaner/license b/deps/npm/node_modules/yargs/node_modules/p-locate/license similarity index 92% rename from deps/npm/node_modules/map-age-cleaner/license rename to deps/npm/node_modules/yargs/node_modules/p-locate/license index 0711ab006f8a92..e7af2f77107d73 100644 --- a/deps/npm/node_modules/map-age-cleaner/license +++ b/deps/npm/node_modules/yargs/node_modules/p-locate/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sam Verschueren (github.com/SamVerschueren) +Copyright (c) Sindre Sorhus (sindresorhus.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/deps/npm/node_modules/p-locate/package.json b/deps/npm/node_modules/yargs/node_modules/p-locate/package.json similarity index 65% rename from deps/npm/node_modules/p-locate/package.json rename to deps/npm/node_modules/yargs/node_modules/p-locate/package.json index 5f64e9dd3cb248..b6cefbf4248c53 100644 --- a/deps/npm/node_modules/p-locate/package.json +++ b/deps/npm/node_modules/yargs/node_modules/p-locate/package.json @@ -1,27 +1,27 @@ { - "_from": "p-locate@^2.0.0", - "_id": "p-locate@2.0.0", + "_from": "p-locate@^3.0.0", + "_id": "p-locate@3.0.0", "_inBundle": false, - "_integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "_location": "/p-locate", + "_integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "_location": "/yargs/p-locate", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "p-locate@^2.0.0", + "raw": "p-locate@^3.0.0", "name": "p-locate", "escapedName": "p-locate", - "rawSpec": "^2.0.0", + "rawSpec": "^3.0.0", "saveSpec": null, - "fetchSpec": "^2.0.0" + "fetchSpec": "^3.0.0" }, "_requiredBy": [ - "/locate-path" + "/yargs/locate-path" ], - "_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "_shasum": "20a0103b222a70c8fd39cc2e580680f3dde5ec43", - "_spec": "p-locate@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/locate-path", + "_resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "_shasum": "322d69a05c0264b25997d9f40cd8a891ab0064a4", + "_spec": "p-locate@^3.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/locate-path", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -32,19 +32,19 @@ }, "bundleDependencies": false, "dependencies": { - "p-limit": "^1.1.0" + "p-limit": "^2.0.0" }, "deprecated": false, "description": "Get the first fulfilled promise that satisfies the provided testing function", "devDependencies": { "ava": "*", - "delay": "^1.3.1", + "delay": "^3.0.0", "in-range": "^1.0.0", - "time-span": "^1.0.0", + "time-span": "^2.0.0", "xo": "*" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js" @@ -79,8 +79,5 @@ "scripts": { "test": "xo && ava" }, - "version": "2.0.0", - "xo": { - "esnext": true - } + "version": "3.0.0" } diff --git a/deps/npm/node_modules/p-locate/readme.md b/deps/npm/node_modules/yargs/node_modules/p-locate/readme.md similarity index 91% rename from deps/npm/node_modules/p-locate/readme.md rename to deps/npm/node_modules/yargs/node_modules/p-locate/readme.md index 68b96a47ef2945..3b0173bc4ea784 100644 --- a/deps/npm/node_modules/p-locate/readme.md +++ b/deps/npm/node_modules/yargs/node_modules/p-locate/readme.md @@ -8,7 +8,7 @@ Think of it like an async version of [`Array#find`](https://developer.mozilla.or ## Install ``` -$ npm install --save p-locate +$ npm install p-locate ``` @@ -22,14 +22,16 @@ const pLocate = require('p-locate'); const files = [ 'unicorn.png', - 'rainbow.png', // only this one actually exists on disk + 'rainbow.png', // Only this one actually exists on disk 'pony.png' ]; -pLocate(files, file => pathExists(file)).then(foundPath => { +(async () => { + const foundPath = await pLocate(files, file => pathExists(file)); + console.log(foundPath); //=> 'rainbow' -}); +})(); ``` *The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.* diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/index.d.ts b/deps/npm/node_modules/yargs/node_modules/p-try/index.d.ts new file mode 100644 index 00000000000000..2a7319ec2a5568 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/p-try/index.d.ts @@ -0,0 +1,39 @@ +declare const pTry: { + /** + Start a promise chain. + + @param fn - The function to run to start the promise chain. + @param arguments - Arguments to pass to `fn`. + @returns The value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. + + @example + ``` + import pTry = require('p-try'); + + (async () => { + try { + const value = await pTry(() => { + return synchronousFunctionThatMightThrow(); + }); + console.log(value); + } catch (error) { + console.error(error); + } + })(); + ``` + */ + ( + fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, + ...arguments: ArgumentsType + ): Promise; + + // TODO: remove this in the next major version, refactor the whole definition to: + // declare function pTry( + // fn: (...arguments: ArgumentsType) => PromiseLike | ValueType, + // ...arguments: ArgumentsType + // ): Promise; + // export = pTry; + default: typeof pTry; +}; + +export = pTry; diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/index.js b/deps/npm/node_modules/yargs/node_modules/p-try/index.js new file mode 100644 index 00000000000000..db858da29252b8 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/p-try/index.js @@ -0,0 +1,9 @@ +'use strict'; + +const pTry = (fn, ...arguments_) => new Promise(resolve => { + resolve(fn(...arguments_)); +}); + +module.exports = pTry; +// TODO: remove this in the next major version +module.exports.default = pTry; diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/license b/deps/npm/node_modules/yargs/node_modules/p-try/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/p-try/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/p-try/package.json b/deps/npm/node_modules/yargs/node_modules/p-try/package.json similarity index 56% rename from deps/npm/node_modules/p-try/package.json rename to deps/npm/node_modules/yargs/node_modules/p-try/package.json index e394d884d19769..7ed46850f64d4c 100644 --- a/deps/npm/node_modules/p-try/package.json +++ b/deps/npm/node_modules/yargs/node_modules/p-try/package.json @@ -1,27 +1,27 @@ { - "_from": "p-try@^1.0.0", - "_id": "p-try@1.0.0", + "_from": "p-try@^2.0.0", + "_id": "p-try@2.2.0", "_inBundle": false, - "_integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "_location": "/p-try", + "_integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "_location": "/yargs/p-try", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, - "raw": "p-try@^1.0.0", + "raw": "p-try@^2.0.0", "name": "p-try", "escapedName": "p-try", - "rawSpec": "^1.0.0", + "rawSpec": "^2.0.0", "saveSpec": null, - "fetchSpec": "^1.0.0" + "fetchSpec": "^2.0.0" }, "_requiredBy": [ - "/p-limit" + "/yargs/p-limit" ], - "_resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "_shasum": "cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3", - "_spec": "p-try@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/p-limit", + "_resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "_shasum": "cb2868540e313d61de58fafbe35ce9004d5540e6", + "_spec": "p-try@^2.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/p-limit", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", @@ -32,16 +32,18 @@ }, "bundleDependencies": false, "deprecated": false, - "description": "`Promise#try()` ponyfill - Starts a promise chain", + "description": "`Start a promise chain", "devDependencies": { - "ava": "*", - "xo": "*" + "ava": "^1.4.1", + "tsd": "^0.7.1", + "xo": "^0.24.0" }, "engines": { - "node": ">=4" + "node": ">=6" }, "files": [ - "index.js" + "index.js", + "index.d.ts" ], "homepage": "https://github.com/sindresorhus/p-try#readme", "keywords": [ @@ -66,10 +68,7 @@ "url": "git+https://github.com/sindresorhus/p-try.git" }, "scripts": { - "test": "xo && ava" + "test": "xo && ava && tsd" }, - "version": "1.0.0", - "xo": { - "esnext": true - } + "version": "2.2.0" } diff --git a/deps/npm/node_modules/yargs/node_modules/p-try/readme.md b/deps/npm/node_modules/yargs/node_modules/p-try/readme.md new file mode 100644 index 00000000000000..4d7bd64dfcb8ba --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/p-try/readme.md @@ -0,0 +1,58 @@ +# p-try [![Build Status](https://travis-ci.org/sindresorhus/p-try.svg?branch=master)](https://travis-ci.org/sindresorhus/p-try) + +> Start a promise chain + +[How is it useful?](http://cryto.net/~joepie91/blog/2016/05/11/what-is-promise-try-and-why-does-it-matter/) + + +## Install + +``` +$ npm install p-try +``` + + +## Usage + +```js +const pTry = require('p-try'); + +(async () => { + try { + const value = await pTry(() => { + return synchronousFunctionThatMightThrow(); + }); + console.log(value); + } catch (error) { + console.error(error); + } +})(); +``` + + +## API + +### pTry(fn, ...arguments) + +Returns a `Promise` resolved with the value of calling `fn(...arguments)`. If the function throws an error, the returned `Promise` will be rejected with that error. + +Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions. + +#### fn + +The function to run to start the promise chain. + +#### arguments + +Arguments to pass to `fn`. + + +## Related + +- [p-finally](https://github.com/sindresorhus/p-finally) - `Promise#finally()` ponyfill - Invoked when the promise is settled regardless of outcome +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/string-width/index.js b/deps/npm/node_modules/yargs/node_modules/string-width/index.js new file mode 100644 index 00000000000000..33c9d6c06f7a59 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/string-width/index.js @@ -0,0 +1,39 @@ +'use strict'; +const stripAnsi = require('strip-ansi'); +const isFullwidthCodePoint = require('is-fullwidth-code-point'); +const emojiRegex = require('emoji-regex')(); + +module.exports = input => { + input = input.replace(emojiRegex, ' '); + + if (typeof input !== 'string' || input.length === 0) { + return 0; + } + + input = stripAnsi(input); + + let width = 0; + + for (let i = 0; i < input.length; i++) { + const code = input.codePointAt(i); + + // Ignore control characters + if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) { + continue; + } + + // Ignore combining characters + if (code >= 0x300 && code <= 0x36F) { + continue; + } + + // Surrogates + if (code > 0xFFFF) { + i++; + } + + width += isFullwidthCodePoint(code) ? 2 : 1; + } + + return width; +}; diff --git a/deps/npm/node_modules/yargs/node_modules/string-width/license b/deps/npm/node_modules/yargs/node_modules/string-width/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/string-width/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/yargs/node_modules/string-width/package.json b/deps/npm/node_modules/yargs/node_modules/string-width/package.json new file mode 100644 index 00000000000000..328f386cdc922e --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/string-width/package.json @@ -0,0 +1,88 @@ +{ + "_from": "string-width@^3.0.0", + "_id": "string-width@3.1.0", + "_inBundle": false, + "_integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "_location": "/yargs/string-width", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "string-width@^3.0.0", + "name": "string-width", + "escapedName": "string-width", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/yargs" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "_shasum": "22767be21b62af1081574306f69ac51b62203961", + "_spec": "string-width@^3.0.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "bundleDependencies": false, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "deprecated": false, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "^1.0.1", + "xo": "^0.23.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/string-width#readme", + "keywords": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "name": "string-width", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.1.0" +} diff --git a/deps/npm/node_modules/yargs/node_modules/string-width/readme.md b/deps/npm/node_modules/yargs/node_modules/string-width/readme.md new file mode 100644 index 00000000000000..d39d95f56cf3f8 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/string-width/readme.md @@ -0,0 +1,45 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 + +stringWidth('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +// => 5 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts b/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts new file mode 100644 index 00000000000000..44e954d0c724d8 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.d.ts @@ -0,0 +1,15 @@ +/** +Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string. + +@example +``` +import stripAnsi from 'strip-ansi'; + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` +*/ +export default function stripAnsi(string: string): string; diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.js b/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000000..9788c96dfa3b0c --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/strip-ansi/index.js @@ -0,0 +1,7 @@ +'use strict'; +const ansiRegex = require('ansi-regex'); + +const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string; + +module.exports = stripAnsi; +module.exports.default = stripAnsi; diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/license b/deps/npm/node_modules/yargs/node_modules/strip-ansi/license new file mode 100644 index 00000000000000..e7af2f77107d73 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/strip-ansi/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/package.json b/deps/npm/node_modules/yargs/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000000..127cf08941ca8c --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/strip-ansi/package.json @@ -0,0 +1,86 @@ +{ + "_from": "strip-ansi@^5.1.0", + "_id": "strip-ansi@5.2.0", + "_inBundle": false, + "_integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "_location": "/yargs/strip-ansi", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-ansi@^5.1.0", + "name": "strip-ansi", + "escapedName": "strip-ansi", + "rawSpec": "^5.1.0", + "saveSpec": null, + "fetchSpec": "^5.1.0" + }, + "_requiredBy": [ + "/yargs/string-width" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "_shasum": "8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae", + "_spec": "strip-ansi@^5.1.0", + "_where": "/Users/claudiahdz/npm/cli/node_modules/yargs/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/strip-ansi/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "deprecated": false, + "description": "Strip ANSI escape codes from a string", + "devDependencies": { + "ava": "^1.3.1", + "tsd-check": "^0.5.0", + "xo": "^0.24.0" + }, + "engines": { + "node": ">=6" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "homepage": "https://github.com/chalk/strip-ansi#readme", + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "name": "strip-ansi", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/strip-ansi.git" + }, + "scripts": { + "test": "xo && ava && tsd-check" + }, + "version": "5.2.0" +} diff --git a/deps/npm/node_modules/yargs/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/yargs/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000000000..8681fe8af44242 --- /dev/null +++ b/deps/npm/node_modules/yargs/node_modules/strip-ansi/readme.md @@ -0,0 +1,61 @@ +# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi) + +> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string + +--- + +
+ + Get professional support for 'strip-ansi' with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- + +## Install + +``` +$ npm install strip-ansi +``` + + +## Usage + +```js +const stripAnsi = require('strip-ansi'); + +stripAnsi('\u001B[4mUnicorn\u001B[0m'); +//=> 'Unicorn' + +stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007'); +//=> 'Click' +``` + + +## Security + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + + +## Related + +- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module +- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module +- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes +- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/deps/npm/node_modules/yargs/node_modules/y18n/LICENSE b/deps/npm/node_modules/yargs/node_modules/y18n/LICENSE deleted file mode 100644 index 3c157f0b9d9bed..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/y18n/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015, Contributors - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. diff --git a/deps/npm/node_modules/yargs/node_modules/y18n/README.md b/deps/npm/node_modules/yargs/node_modules/y18n/README.md deleted file mode 100644 index 9859458f20b856..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/y18n/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# y18n - -[![Build Status][travis-image]][travis-url] -[![Coverage Status][coveralls-image]][coveralls-url] -[![NPM version][npm-image]][npm-url] -[![js-standard-style][standard-image]][standard-url] - -The bare-bones internationalization library used by yargs. - -Inspired by [i18n](https://www.npmjs.com/package/i18n). - -## Examples - -_simple string translation:_ - -```js -var __ = require('y18n').__ - -console.log(__('my awesome string %s', 'foo')) -``` - -output: - -`my awesome string foo` - -_pluralization support:_ - -```js -var __n = require('y18n').__n - -console.log(__n('one fish %s', '%d fishes %s', 2, 'foo')) -``` - -output: - -`2 fishes foo` - -## JSON Language Files - -The JSON language files should be stored in a `./locales` folder. -File names correspond to locales, e.g., `en.json`, `pirate.json`. - -When strings are observed for the first time they will be -added to the JSON file corresponding to the current locale. - -## Methods - -### require('y18n')(config) - -Create an instance of y18n with the config provided, options include: - -* `directory`: the locale directory, default `./locales`. -* `updateFiles`: should newly observed strings be updated in file, default `true`. -* `locale`: what locale should be used. -* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`) - be allowed if a file matching the locale does not exist (e.g. `en_US.json`), - default `true`. - -### y18n.\_\_(str, arg, arg, arg) - -Print a localized string, `%s` will be replaced with `arg`s. - -### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg) - -Print a localized string with appropriate pluralization. If `%d` is provided -in the string, the `count` will replace this placeholder. - -### y18n.setLocale(str) - -Set the current locale being used. - -### y18n.getLocale() - -What locale is currently being used? - -### y18n.updateLocale(obj) - -Update the current locale with the key value pairs in `obj`. - -## License - -ISC - -[travis-url]: https://travis-ci.org/yargs/y18n -[travis-image]: https://img.shields.io/travis/yargs/y18n.svg -[coveralls-url]: https://coveralls.io/github/yargs/y18n -[coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg -[npm-url]: https://npmjs.org/package/y18n -[npm-image]: https://img.shields.io/npm/v/y18n.svg -[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg -[standard-url]: https://github.com/feross/standard diff --git a/deps/npm/node_modules/yargs/node_modules/y18n/index.js b/deps/npm/node_modules/yargs/node_modules/y18n/index.js deleted file mode 100644 index 91b159e34298ac..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/y18n/index.js +++ /dev/null @@ -1,172 +0,0 @@ -var fs = require('fs') -var path = require('path') -var util = require('util') - -function Y18N (opts) { - // configurable options. - opts = opts || {} - this.directory = opts.directory || './locales' - this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true - this.locale = opts.locale || 'en' - this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true - - // internal stuff. - this.cache = {} - this.writeQueue = [] -} - -Y18N.prototype.__ = function () { - var args = Array.prototype.slice.call(arguments) - var str = args.shift() - var cb = function () {} // start with noop. - - if (typeof args[args.length - 1] === 'function') cb = args.pop() - cb = cb || function () {} // noop. - - if (!this.cache[this.locale]) this._readLocaleFile() - - // we've observed a new string, update the language file. - if (!this.cache[this.locale][str] && this.updateFiles) { - this.cache[this.locale][str] = str - - // include the current directory and locale, - // since these values could change before the - // write is performed. - this._enqueueWrite([this.directory, this.locale, cb]) - } else { - cb() - } - - return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args)) -} - -Y18N.prototype._enqueueWrite = function (work) { - this.writeQueue.push(work) - if (this.writeQueue.length === 1) this._processWriteQueue() -} - -Y18N.prototype._processWriteQueue = function () { - var _this = this - var work = this.writeQueue[0] - - // destructure the enqueued work. - var directory = work[0] - var locale = work[1] - var cb = work[2] - - var languageFile = this._resolveLocaleFile(directory, locale) - var serializedLocale = JSON.stringify(this.cache[locale], null, 2) - - fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) { - _this.writeQueue.shift() - if (_this.writeQueue.length > 0) _this._processWriteQueue() - cb(err) - }) -} - -Y18N.prototype._readLocaleFile = function () { - var localeLookup = {} - var languageFile = this._resolveLocaleFile(this.directory, this.locale) - - try { - localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8')) - } catch (err) { - if (err instanceof SyntaxError) { - err.message = 'syntax error in ' + languageFile - } - - if (err.code === 'ENOENT') localeLookup = {} - else throw err - } - - this.cache[this.locale] = localeLookup -} - -Y18N.prototype._resolveLocaleFile = function (directory, locale) { - var file = path.resolve(directory, './', locale + '.json') - if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) { - // attempt fallback to language only - var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json') - if (this._fileExistsSync(languageFile)) file = languageFile - } - return file -} - -// this only exists because fs.existsSync() "will be deprecated" -// see https://nodejs.org/api/fs.html#fs_fs_existssync_path -Y18N.prototype._fileExistsSync = function (file) { - try { - return fs.statSync(file).isFile() - } catch (err) { - return false - } -} - -Y18N.prototype.__n = function () { - var args = Array.prototype.slice.call(arguments) - var singular = args.shift() - var plural = args.shift() - var quantity = args.shift() - - var cb = function () {} // start with noop. - if (typeof args[args.length - 1] === 'function') cb = args.pop() - - if (!this.cache[this.locale]) this._readLocaleFile() - - var str = quantity === 1 ? singular : plural - if (this.cache[this.locale][singular]) { - str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other'] - } - - // we've observed a new string, update the language file. - if (!this.cache[this.locale][singular] && this.updateFiles) { - this.cache[this.locale][singular] = { - one: singular, - other: plural - } - - // include the current directory and locale, - // since these values could change before the - // write is performed. - this._enqueueWrite([this.directory, this.locale, cb]) - } else { - cb() - } - - // if a %d placeholder is provided, add quantity - // to the arguments expanded by util.format. - var values = [str] - if (~str.indexOf('%d')) values.push(quantity) - - return util.format.apply(util, values.concat(args)) -} - -Y18N.prototype.setLocale = function (locale) { - this.locale = locale -} - -Y18N.prototype.getLocale = function () { - return this.locale -} - -Y18N.prototype.updateLocale = function (obj) { - if (!this.cache[this.locale]) this._readLocaleFile() - - for (var key in obj) { - this.cache[this.locale][key] = obj[key] - } -} - -module.exports = function (opts) { - var y18n = new Y18N(opts) - - // bind all functions to y18n, so that - // they can be used in isolation. - for (var key in y18n) { - if (typeof y18n[key] === 'function') { - y18n[key] = y18n[key].bind(y18n) - } - } - - return y18n -} diff --git a/deps/npm/node_modules/yargs/node_modules/y18n/package.json b/deps/npm/node_modules/yargs/node_modules/y18n/package.json deleted file mode 100644 index 89e1b7c57fbab9..00000000000000 --- a/deps/npm/node_modules/yargs/node_modules/y18n/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "_from": "y18n@^3.2.1", - "_id": "y18n@3.2.1", - "_inBundle": false, - "_integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "_location": "/yargs/y18n", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "y18n@^3.2.1", - "name": "y18n", - "escapedName": "y18n", - "rawSpec": "^3.2.1", - "saveSpec": null, - "fetchSpec": "^3.2.1" - }, - "_requiredBy": [ - "/yargs" - ], - "_resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "_shasum": "6d15fba884c08679c0d77e88e7759e811e07fa41", - "_spec": "y18n@^3.2.1", - "_where": "/Users/rebecca/code/npm/node_modules/yargs", - "author": { - "name": "Ben Coe", - "email": "ben@npmjs.com" - }, - "bugs": { - "url": "https://github.com/yargs/y18n/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "the bare-bones internationalization library used by yargs", - "devDependencies": { - "chai": "^3.4.1", - "coveralls": "^2.11.6", - "mocha": "^2.3.4", - "nyc": "^6.1.1", - "rimraf": "^2.5.0", - "standard": "^5.4.1" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/yargs/y18n", - "keywords": [ - "i18n", - "internationalization", - "yargs" - ], - "license": "ISC", - "main": "index.js", - "name": "y18n", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/yargs/y18n.git" - }, - "scripts": { - "coverage": "nyc report --reporter=text-lcov | coveralls", - "pretest": "standard", - "test": "nyc mocha" - }, - "version": "3.2.1" -} diff --git a/deps/npm/node_modules/yargs/package.json b/deps/npm/node_modules/yargs/package.json index fd0a1265c23ddb..3facc8afe3446a 100644 --- a/deps/npm/node_modules/yargs/package.json +++ b/deps/npm/node_modules/yargs/package.json @@ -1,65 +1,73 @@ { - "_from": "yargs@^11.0.0", - "_id": "yargs@11.1.1", + "_from": "yargs@^14.2.3", + "_id": "yargs@14.2.3", "_inBundle": false, - "_integrity": "sha512-PRU7gJrJaXv3q3yQZ/+/X6KBswZiaQ+zOmdprZcouPYtQgvNU35i+68M4b1ZHLZtYFT5QObFLV+ZkmJYcwKdiw==", + "_integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", "_location": "/yargs", - "_phantomChildren": {}, + "_phantomChildren": { + "emoji-regex": "7.0.3", + "path-exists": "3.0.0" + }, "_requested": { "type": "range", "registry": true, - "raw": "yargs@^11.0.0", + "raw": "yargs@^14.2.3", "name": "yargs", "escapedName": "yargs", - "rawSpec": "^11.0.0", + "rawSpec": "^14.2.3", "saveSpec": null, - "fetchSpec": "^11.0.0" + "fetchSpec": "^14.2.3" }, "_requiredBy": [ "/libnpx" ], - "_resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.1.tgz", - "_shasum": "5052efe3446a4df5ed669c995886cc0f13702766", - "_spec": "yargs@^11.0.0", - "_where": "/Users/mperrotte/npminc/cli/node_modules/libnpx", + "_resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "_shasum": "1a1c3edced1afb2a2fea33604bc6d1d8d688a414", + "_spec": "yargs@^14.2.3", + "_where": "/Users/claudiahdz/npm/cli/node_modules/libnpx", "bugs": { "url": "https://github.com/yargs/yargs/issues" }, "bundleDependencies": false, + "contributors": [ + { + "name": "Yargs Contributors", + "url": "https://github.com/yargs/yargs/graphs/contributors" + } + ], "dependencies": { - "cliui": "^4.0.0", - "decamelize": "^1.1.1", - "find-up": "^2.1.0", - "get-caller-file": "^1.0.1", - "os-locale": "^3.1.0", + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^2.0.0", + "string-width": "^3.0.0", "which-module": "^2.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^9.0.2" + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" }, "deprecated": false, "description": "yargs the modern, pirate-themed, successor to optimist.", "devDependencies": { - "chai": "^4.1.2", - "chalk": "^1.1.3", - "coveralls": "^2.11.11", - "cpr": "^2.0.0", + "chai": "^4.2.0", + "chalk": "^2.4.2", + "coveralls": "^3.0.3", + "cpr": "^3.0.1", "cross-spawn": "^6.0.4", - "es6-promise": "^4.0.2", + "es6-promise": "^4.2.5", "hashish": "0.0.4", - "mocha": "^3.0.1", - "nyc": "^11.2.1", - "rimraf": "^2.5.0", - "standard": "^8.6.0", - "standard-version": "^4.2.0", - "which": "^1.2.9", + "mocha": "^5.2.0", + "nyc": "^14.1.0", + "rimraf": "^2.6.3", + "standard": "^12.0.1", + "standard-version": "^7.0.0", + "which": "^1.3.1", "yargs-test-extends": "^1.0.1" }, "engine": { - "node": ">=4" + "node": ">=6" }, "files": [ "index.js", @@ -67,9 +75,10 @@ "lib", "locales", "completion.sh.hbs", + "completion.zsh.hbs", "LICENSE" ], - "homepage": "http://yargs.js.org/", + "homepage": "https://yargs.js.org/", "keywords": [ "argument", "args", @@ -84,18 +93,18 @@ "name": "yargs", "repository": { "type": "git", - "url": "git+ssh://git@github.com/yargs/yargs.git" + "url": "git+https://github.com/yargs/yargs.git" }, "scripts": { "coverage": "nyc report --reporter=text-lcov | coveralls", - "posttest": "standard", + "pretest": "standard", "release": "standard-version", - "test": "nyc --cache mocha --require ./test/before.js --timeout=8000 --check-leaks" + "test": "nyc --cache mocha --require ./test/before.js --timeout=12000 --check-leaks" }, "standard": { "ignore": [ "**/example/**" ] }, - "version": "11.1.1" + "version": "14.2.3" } diff --git a/deps/npm/node_modules/yargs/yargs.js b/deps/npm/node_modules/yargs/yargs.js index 38f1b2ea6e67f5..fdc8a095a97dc7 100644 --- a/deps/npm/node_modules/yargs/yargs.js +++ b/deps/npm/node_modules/yargs/yargs.js @@ -11,6 +11,7 @@ const Y18n = require('y18n') const objFilter = require('./lib/obj-filter') const setBlocking = require('set-blocking') const applyExtends = require('./lib/apply-extends') +const { globalMiddlewareFactory } = require('./lib/middleware') const YError = require('./lib/yerror') exports = module.exports = Yargs @@ -21,6 +22,7 @@ function Yargs (processArgs, cwd, parentRequire) { let command = null let completion = null let groups = {} + let globalMiddleware = [] let output = '' let preservedGroups = {} let usage = null @@ -31,14 +33,26 @@ function Yargs (processArgs, cwd, parentRequire) { updateFiles: false }) + self.middleware = globalMiddlewareFactory(globalMiddleware, self) + if (!cwd) cwd = process.cwd() - self.$0 = process.argv - .slice(0, 2) + self.scriptName = function (scriptName) { + self.customScriptName = true + self.$0 = scriptName + return self + } + + // ignore the node bin, specify this in your + // bin file with #!/usr/bin/env node + if (/\b(node|iojs|electron)(\.exe)?$/.test(process.argv[0])) { + self.$0 = process.argv.slice(1, 2) + } else { + self.$0 = process.argv.slice(0, 1) + } + + self.$0 = self.$0 .map((x, i) => { - // ignore the node bin, specify this in your - // bin file with #!/usr/bin/env node - if (i === 0 && /\b(node|iojs)(\.exe)?$/.test(x)) return const b = rebase(cwd, x) return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x }) @@ -80,20 +94,24 @@ function Yargs (processArgs, cwd, parentRequire) { }) }) - // preserve all groups not set to local. - preservedGroups = Object.keys(groups).reduce((acc, groupName) => { - const keys = groups[groupName].filter(key => !(key in localLookup)) - if (keys.length > 0) { - acc[groupName] = keys - } - return acc - }, {}) + // add all groups not set to local to preserved groups + Object.assign( + preservedGroups, + Object.keys(groups).reduce((acc, groupName) => { + const keys = groups[groupName].filter(key => !(key in localLookup)) + if (keys.length > 0) { + acc[groupName] = keys + } + return acc + }, {}) + ) // groups can now be reset groups = {} const arrayOptions = [ 'array', 'boolean', 'string', 'skipValidation', - 'count', 'normalize', 'number' + 'count', 'normalize', 'number', + 'hiddenOptions' ] const objectOptions = [ @@ -116,7 +134,7 @@ function Yargs (processArgs, cwd, parentRequire) { // instances of all our helpers -- otherwise just reset. usage = usage ? usage.reset(localLookup) : Usage(self, y18n) validation = validation ? validation.reset(localLookup) : Validation(self, usage, y18n) - command = command ? command.reset() : Command(self, usage, validation) + command = command ? command.reset() : Command(self, usage, validation, globalMiddleware) if (!completion) completion = Completion(self, usage, command) completionCommand = null @@ -130,9 +148,10 @@ function Yargs (processArgs, cwd, parentRequire) { self.resetOptions() // temporary hack: allow "freezing" of reset-able state for parse(msg, cb) - let frozen + let frozens = [] function freeze () { - frozen = {} + let frozen = {} + frozens.push(frozen) frozen.options = options frozen.configObjects = options.configObjects.slice(0) frozen.exitProcess = exitProcess @@ -146,8 +165,11 @@ function Yargs (processArgs, cwd, parentRequire) { frozen.exitError = exitError frozen.hasOutput = hasOutput frozen.parsed = self.parsed + frozen.parseFn = parseFn + frozen.parseContext = parseContext } function unfreeze () { + let frozen = frozens.pop() options = frozen.options options.configObjects = frozen.configObjects exitProcess = frozen.exitProcess @@ -161,9 +183,8 @@ function Yargs (processArgs, cwd, parentRequire) { command.unfreeze() strict = frozen.strict completionCommand = frozen.completionCommand - parseFn = null - parseContext = null - frozen = undefined + parseFn = frozen.parseFn + parseContext = frozen.parseContext } self.boolean = function (keys) { @@ -217,6 +238,7 @@ function Yargs (processArgs, cwd, parentRequire) { function populateParserHintArray (type, keys, value) { keys = [].concat(keys) keys.forEach((key) => { + key = sanitizeKey(key) options[type].push(key) }) } @@ -272,8 +294,8 @@ function Yargs (processArgs, cwd, parentRequire) { function populateParserHintObject (builder, isArray, type, key, value) { if (Array.isArray(key)) { + const temp = Object.create(null) // an array of keys with one value ['x', 'y', 'z'], function parse () {} - const temp = {} key.forEach((k) => { temp[k] = value }) @@ -284,6 +306,7 @@ function Yargs (processArgs, cwd, parentRequire) { builder(k, key[k]) }) } else { + key = sanitizeKey(key) // a single key value pair 'x', parse() {} if (isArray) { options[type][key] = (options[type][key] || []).concat(value) @@ -293,6 +316,13 @@ function Yargs (processArgs, cwd, parentRequire) { } } + // TODO(bcoe): in future major versions move more objects towards + // Object.create(null): + function sanitizeKey (key) { + if (key === '__proto__') return '___proto___' + return key + } + function deleteFromParserHintObject (optionKey) { // delete from all parsing hints: // boolean, array, key, alias, etc. @@ -312,7 +342,7 @@ function Yargs (processArgs, cwd, parentRequire) { argsert('[object|string] [string|function] [function]', [key, msg, parseFn], arguments.length) // allow a config object to be provided directly. if (typeof key === 'object') { - key = applyExtends(key, cwd) + key = applyExtends(key, cwd, self.getParserConfiguration()['deep-merge-config']) options.configObjects = (options.configObjects || []).concat(key) return self } @@ -486,7 +516,7 @@ function Yargs (processArgs, cwd, parentRequire) { // If an object exists in the key, add it to options.configObjects if (obj[key] && typeof obj[key] === 'object') { - conf = applyExtends(obj[key], rootPath || cwd) + conf = applyExtends(obj[key], rootPath || cwd, self.getParserConfiguration()['deep-merge-config']) options.configObjects = (options.configObjects || []).concat(conf) } @@ -524,7 +554,15 @@ function Yargs (processArgs, cwd, parentRequire) { let parseContext = null self.parse = function parse (args, shortCircuit, _parseFn) { argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length) - if (typeof args === 'undefined') args = processArgs + freeze() + if (typeof args === 'undefined') { + const argv = self._parseArgs(processArgs) + const tmpParsed = self.parsed + unfreeze() + // TODO: remove this compatibility hack when we release yargs@15.x: + self.parsed = tmpParsed + return argv + } // a context object can optionally be provided, this allows // additional information to be passed to a command handler. @@ -544,7 +582,6 @@ function Yargs (processArgs, cwd, parentRequire) { // skipping validation, etc. if (!shortCircuit) processArgs = args - freeze() if (parseFn) exitProcess = false const parsed = self._parseArgs(args, shortCircuit) @@ -657,8 +694,9 @@ function Yargs (processArgs, cwd, parentRequire) { } const desc = opt.describe || opt.description || opt.desc - if (!opt.hidden) { - self.describe(key, desc) + self.describe(key, desc) + if (opt.hidden) { + self.hide(key) } if (opt.requiresArg) { @@ -677,8 +715,8 @@ function Yargs (processArgs, cwd, parentRequire) { } // .positional() only supports a subset of the configuration - // options availble to .option(). - const supportedOpts = ['default', 'implies', 'normalize', + // options available to .option(). + const supportedOpts = ['default', 'defaultDescription', 'implies', 'normalize', 'choices', 'conflicts', 'coerce', 'type', 'describe', 'desc', 'description', 'alias'] opts = objFilter(opts, (k, v) => { @@ -748,6 +786,14 @@ function Yargs (processArgs, cwd, parentRequire) { } self.getStrict = () => strict + let parserConfig = {} + self.parserConfiguration = function parserConfiguration (config) { + argsert('', [config], arguments.length) + parserConfig = config + return self + } + self.getParserConfiguration = () => parserConfig + self.showHelp = function (level) { argsert('[string|function]', [level], arguments.length) if (!self.parsed) self._parseArgs(processArgs) // run parser, if it has not already been executed. @@ -824,6 +870,28 @@ function Yargs (processArgs, cwd, parentRequire) { return self } + const defaultShowHiddenOpt = 'show-hidden' + options.showHiddenOpt = defaultShowHiddenOpt + self.addShowHiddenOpt = self.showHidden = function addShowHiddenOpt (opt, msg) { + argsert('[string|boolean] [string]', [opt, msg], arguments.length) + + if (arguments.length === 1) { + if (opt === false) return self + } + + const showHiddenOpt = typeof opt === 'string' ? opt : defaultShowHiddenOpt + self.boolean(showHiddenOpt) + self.describe(showHiddenOpt, msg || usage.deferY18nLookup('Show hidden options')) + options.showHiddenOpt = showHiddenOpt + return self + } + + self.hide = function hide (key) { + argsert('', [key], arguments.length) + options.hiddenOptions.push(key) + return self + } + self.showHelpOnFail = function showHelpOnFail (enabled, message) { argsert('[boolean|string] [string]', [enabled, message], arguments.length) usage.showHelpOnFail(enabled, message) @@ -854,9 +922,9 @@ function Yargs (processArgs, cwd, parentRequire) { } // register the completion command. - completionCommand = cmd || 'completion' + completionCommand = cmd || completionCommand || 'completion' if (!desc && desc !== false) { - desc = 'generate bash completion script' + desc = 'generate completion script' } self.command(completionCommand, desc) @@ -866,10 +934,10 @@ function Yargs (processArgs, cwd, parentRequire) { return self } - self.showCompletionScript = function ($0) { - argsert('[string]', [$0], arguments.length) + self.showCompletionScript = function ($0, cmd) { + argsert('[string] [string]', [$0, cmd], arguments.length) $0 = $0 || self.$0 - _logger.log(completion.generateCompletionScript($0, completionCommand)) + _logger.log(completion.generateCompletionScript($0, cmd || completionCommand || 'completion')) return self } @@ -966,14 +1034,27 @@ function Yargs (processArgs, cwd, parentRequire) { enumerable: true }) - self._parseArgs = function parseArgs (args, shortCircuit, _skipValidation, commandIndex) { - let skipValidation = !!_skipValidation + self._parseArgs = function parseArgs (args, shortCircuit, _calledFromCommand, commandIndex) { + let skipValidation = !!_calledFromCommand args = args || processArgs options.__ = y18n.__ - options.configuration = pkgUp()['yargs'] || {} + options.configuration = self.getParserConfiguration() + // Deprecated + let pkgConfig = pkgUp()['yargs'] + if (pkgConfig) { + console.warn('Configuring yargs through package.json is deprecated and will be removed in a future major release, please use the JS API instead.') + options.configuration = Object.assign({}, pkgConfig, options.configuration) + } + + const populateDoubleDash = !!options.configuration['populate--'] + const config = Object.assign({}, options.configuration, { + 'populate--': true + }) + const parsed = Parser.detailed(args, Object.assign({}, options, { + configuration: config + })) - const parsed = Parser.detailed(args, options) let argv = parsed.argv if (parseContext) argv = Object.assign({}, argv, parseContext) const aliases = parsed.aliases @@ -988,7 +1069,7 @@ function Yargs (processArgs, cwd, parentRequire) { // are two passes through the parser. If completion // is being performed short-circuit on the first pass. if (shortCircuit) { - return argv + return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv) } // if there's a handler associated with a @@ -1006,8 +1087,11 @@ function Yargs (processArgs, cwd, parentRequire) { argv[helpOpt] = true } } + const handlerKeys = command.getCommands() - const skipDefaultCommand = argv[helpOpt] && (handlerKeys.length > 1 || handlerKeys[0] !== '$0') + const requestCompletions = completion.completionKey in argv + const skipRecommendation = argv[helpOpt] || requestCompletions + const skipDefaultCommand = skipRecommendation && (handlerKeys.length > 1 || handlerKeys[0] !== '$0') if (argv._.length) { if (handlerKeys.length) { @@ -1015,11 +1099,11 @@ function Yargs (processArgs, cwd, parentRequire) { for (let i = (commandIndex || 0), cmd; argv._[i] !== undefined; i++) { cmd = String(argv._[i]) if (~handlerKeys.indexOf(cmd) && cmd !== completionCommand) { - setPlaceholderKeys(argv) // commands are executed using a recursive algorithm that executes // the deepest command first; we keep track of the position in the // argv._ array that is currently being executed. - return command.runCommand(cmd, self, parsed, i + 1) + const innerArgv = command.runCommand(cmd, self, parsed, i + 1) + return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv) } else if (!firstUnknownCommand && cmd !== completionCommand) { firstUnknownCommand = cmd break @@ -1028,31 +1112,31 @@ function Yargs (processArgs, cwd, parentRequire) { // run the default command, if defined if (command.hasDefaultCommand() && !skipDefaultCommand) { - setPlaceholderKeys(argv) - return command.runCommand(null, self, parsed) + const innerArgv = command.runCommand(null, self, parsed) + return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv) } // recommend a command if recommendCommands() has // been enabled, and no commands were found to execute - if (recommendCommands && firstUnknownCommand && !argv[helpOpt]) { + if (recommendCommands && firstUnknownCommand && !skipRecommendation) { validation.recommendCommands(firstUnknownCommand, handlerKeys) } } // generate a completion script for adding to ~/.bashrc. - if (completionCommand && ~argv._.indexOf(completionCommand) && !argv[completion.completionKey]) { + if (completionCommand && ~argv._.indexOf(completionCommand) && !requestCompletions) { if (exitProcess) setBlocking(true) self.showCompletionScript() self.exit(0) } } else if (command.hasDefaultCommand() && !skipDefaultCommand) { - setPlaceholderKeys(argv) - return command.runCommand(null, self, parsed) + const innerArgv = command.runCommand(null, self, parsed) + return populateDoubleDash ? innerArgv : self._copyDoubleDash(innerArgv) } // we must run completions first, a user might // want to complete the --help or --version option. - if (completion.completionKey in argv) { + if (requestCompletions) { if (exitProcess) setBlocking(true) // we allow for asynchronous completions, @@ -1065,7 +1149,7 @@ function Yargs (processArgs, cwd, parentRequire) { self.exit(0) }) - return setPlaceholderKeys(argv) + return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv) } // Handle 'help' and 'version' options @@ -1100,7 +1184,7 @@ function Yargs (processArgs, cwd, parentRequire) { // if we're executed via bash completion, don't // bother with validation. - if (!argv[completion.completionKey]) { + if (!requestCompletions) { self._runValidation(argv, aliases, {}, parsed.error) } } @@ -1109,11 +1193,27 @@ function Yargs (processArgs, cwd, parentRequire) { else throw err } - return setPlaceholderKeys(argv) + return (populateDoubleDash || _calledFromCommand) ? argv : self._copyDoubleDash(argv) + } + + // to simplify the parsing of positionals in commands, + // we temporarily populate '--' rather than _, with arguments + // after the '--' directive. After the parse, we copy these back. + self._copyDoubleDash = function (argv) { + if (!argv._ || !argv['--']) return argv + argv._.push.apply(argv._, argv['--']) + + // TODO(bcoe): refactor command parsing such that this delete is not + // necessary: https://github.com/yargs/yargs/issues/1482 + try { + delete argv['--'] + } catch (_err) {} + + return argv } self._runValidation = function runValidation (argv, aliases, positionalMap, parseErrors) { - if (parseErrors) throw new YError(parseErrors.message) + if (parseErrors) throw new YError(parseErrors.message || parseErrors) validation.nonOptionCount(argv) validation.requiredArguments(argv) if (strict) validation.unknownArguments(argv, aliases, positionalMap) @@ -1127,24 +1227,15 @@ function Yargs (processArgs, cwd, parentRequire) { if (!detectLocale) return try { - const osLocale = require('os-locale') - self.locale(osLocale.sync({ spawn: false })) + const { env } = process + const locale = env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE || 'en_US' + self.locale(locale.replace(/[.:].*/, '')) } catch (err) { // if we explode looking up locale just noop // we'll keep using the default language 'en'. } } - function setPlaceholderKeys (argv) { - Object.keys(options.key).forEach((key) => { - // don't set placeholder keys for dot - // notation options 'foo.bar'. - if (~key.indexOf('.')) return - if (typeof argv[key] === 'undefined') argv[key] = undefined - }) - return argv - } - // an app should almost always have --version and --help, // if you *really* want to disable this use .help(false)/.version(false). self.help() diff --git a/deps/npm/package.json b/deps/npm/package.json index ea8deeb01e5ca8..c018aaf9784b7f 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "6.14.6", + "version": "6.14.7", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -39,7 +39,7 @@ "ansistyles": "~0.1.3", "aproba": "^2.0.0", "archy": "~1.0.0", - "bin-links": "^1.1.7", + "bin-links": "^1.1.8", "bluebird": "^3.5.5", "byte-size": "^5.0.1", "cacache": "^12.0.3", @@ -59,7 +59,7 @@ "find-npm-prefix": "^1.0.2", "fs-vacuum": "~1.2.10", "fs-write-stream-atomic": "~1.0.10", - "gentle-fs": "^2.3.0", + "gentle-fs": "^2.3.1", "glob": "^7.1.6", "graceful-fs": "^4.2.4", "has-unicode": "~2.0.1", @@ -73,14 +73,14 @@ "is-cidr": "^3.0.0", "json-parse-better-errors": "^1.0.2", "lazy-property": "~1.0.0", - "libcipm": "^4.0.7", + "libcipm": "^4.0.8", "libnpm": "^3.0.1", "libnpmaccess": "^3.0.2", "libnpmhook": "^5.0.3", "libnpmorg": "^1.0.1", "libnpmsearch": "^2.0.2", "libnpmteam": "^1.0.2", - "libnpx": "^10.2.2", + "libnpx": "^10.2.4", "lock-verify": "^2.1.0", "lockfile": "^1.0.4", "lodash._baseuniq": "~4.6.0", @@ -96,10 +96,10 @@ "node-gyp": "^5.1.0", "nopt": "^4.0.3", "normalize-package-data": "^2.5.0", - "npm-audit-report": "^1.3.2", + "npm-audit-report": "^1.3.3", "npm-cache-filename": "~1.0.2", "npm-install-checks": "^3.0.2", - "npm-lifecycle": "^3.1.4", + "npm-lifecycle": "^3.1.5", "npm-package-arg": "^6.1.1", "npm-packlist": "^1.4.8", "npm-pick-manifest": "^3.0.2", @@ -278,9 +278,8 @@ "deep-equal": "^1.0.1", "get-stream": "^4.1.0", "licensee": "^7.0.3", - "marked": "^0.6.3", - "marked-man": "^0.6.0", - "npm-registry-couchapp": "^2.7.4", + "marked": "^0.7.0", + "marked-man": "^0.7.0", "npm-registry-mock": "^1.3.1", "require-inject": "^1.4.4", "sprintf-js": "^1.1.2", diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index 9e38c7690fa71e..4ba92973ccfb2a 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -283,3 +283,8 @@ Environment.prototype.extend = function (env) { } return self } + +var reEscape = /[\\[\](){}*?+.^$|]/g +exports.escapeForRe = function (string) { + return string.replace(reEscape, '\\$&') +} diff --git a/deps/npm/test/fixtures/config/userconfig-with-gc b/deps/npm/test/fixtures/config/userconfig-with-gc new file mode 100644 index 00000000000000..b00d5195bd8361 --- /dev/null +++ b/deps/npm/test/fixtures/config/userconfig-with-gc @@ -0,0 +1,23 @@ +globalconfig = /Users/claudiahdz/npm/cli/test/fixtures/config/globalconfig +email = i@izs.me +env-thing = ${random_env_var} +init.author.name = Isaac Z. Schlueter +init.author.email = i@izs.me +init.author.url = http://blog.izs.me/ +init.version = 1.2.3 +npm:publishtest = true +_npmjs.org:couch = https://admin:password@localhost:5984/registry +npm-www:nocache = 1 +nodedir = /Users/isaacs/dev/js/node-v0.8 +sign-git-tag = true +message = v%s +strict-ssl = false +tmp = ~/.tmp +_auth = dXNlcm5hbWU6cGFzc3dvcmQ= + +[_token] +AuthSession = yabba-dabba-doodle +version = 1 +expires = 1345001053415 +path = / +httponly = true diff --git a/deps/npm/test/tap/install-lifecycle.js b/deps/npm/test/tap/install-lifecycle.js new file mode 100644 index 00000000000000..c5b0fd35a020e5 --- /dev/null +++ b/deps/npm/test/tap/install-lifecycle.js @@ -0,0 +1,35 @@ +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var common = require('../common-tap.js') +var pkg = common.pkg + +test('npm install execution order', function (t) { + const packageJson = { + name: 'life-test', + version: '0.0.1', + description: 'Test for npm install execution order', + scripts: { + install: 'true', + preinstall: 'true', + preshrinkwrap: 'true', + postinstall: 'true', + postshrinkwrap: 'true', + shrinkwrap: 'true' + } + } + fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(packageJson), 'utf8') + common.npm(['install', '--loglevel=error'], { cwd: pkg }, function (err, code, stdout, stderr) { + if (err) throw err + + t.comment(stdout) + t.comment(stderr) + + const steps = ['preinstall', 'install', 'postinstall', 'preshrinkwrap', 'shrinkwrap', 'postshrinkwrap'] + const expectedLines = steps.map(function (step) { + return '> ' + packageJson.name + '@' + packageJson.version + ' ' + step + }) + t.match(stdout, new RegExp(expectedLines.map(common.escapeForRe).join('(.|\n)*'))) + t.end() + }) +}) diff --git a/deps/npm/test/tap/lockfile-empty-dep-value.js b/deps/npm/test/tap/lockfile-empty-dep-value.js new file mode 100644 index 00000000000000..1e30889fcb5225 --- /dev/null +++ b/deps/npm/test/tap/lockfile-empty-dep-value.js @@ -0,0 +1,68 @@ +'use strict' + +const common = require('../common-tap.js') +const path = require('path') +const test = require('tap').test + +const Tacks = require('tacks') +const File = Tacks.File +const Dir = Tacks.Dir + +const basedir = common.pkg +const testdir = path.join(basedir, 'testdir') + +const fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + 'package-lock.json': File({ + name: 'http-locks', + version: '1.0.0', + lockfileVersion: 1, + requires: true, + dependencies: { + minimist: {} + } + }), + 'package.json': File({ + name: 'http-locks', + version: '1.0.0', + dependencies: { + minimist: common.registry + '/minimist/-/minimist-0.0.5.tgz' + } + }) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + t.done() +}) + +test('raises error to regenerate the lock file', function (t) { + common.npm(['install'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.match( + stderr, + 'npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".', + 'returns message to regenerate package-lock' + ) + + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) diff --git a/deps/npm/test/tap/ls.js b/deps/npm/test/tap/ls.js index b3bdbc613cbc8d..9dd3779b3d170b 100644 --- a/deps/npm/test/tap/ls.js +++ b/deps/npm/test/tap/ls.js @@ -169,6 +169,40 @@ test('cleanup', function (t) { t.done() }) +test('ls parseable long', function (t) { + var fixture = new Tacks( + Dir({ + 'npm-test-ls': Dir({ + 'package.json': File({ + name: 'npm-test-ls', + version: '1.0.0', + dependencies: { + 'dep': 'file:../dep' + } + }) + }), + 'dep': Dir({ + 'package.json': File({ + name: 'dep', + version: '1.0.0' + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + common.npm([ + 'ls', '--parseable', '--long' + ], { + cwd: pkgpath + }, function (err, code, stdout, stderr) { + t.ifErr(err, 'ls succeeded') + t.equal(0, code, 'exit 0 on ls') + t.notMatch(stdout, /undefined/, 'must not output undefined for non-symlinked items') + done() + }) + }) +}) + function withFixture (t, fixture, tester) { fixture.create(fixturepath) common.npm(['install'], { diff --git a/deps/npm/test/tap/shrinkwrap-empty-dep-value.js b/deps/npm/test/tap/shrinkwrap-empty-dep-value.js new file mode 100644 index 00000000000000..3a264f5a100542 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-empty-dep-value.js @@ -0,0 +1,66 @@ +'use strict' + +const common = require('../common-tap.js') +const path = require('path') +const test = require('tap').test + +const Tacks = require('tacks') +const File = Tacks.File +const Dir = Tacks.Dir + +const basedir = common.pkg +const testdir = path.join(basedir, 'testdir') + +const fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + 'npm-shrinkwrap.json': File({ + name: 'http-locks', + version: '0.0.0', + dependencies: { + minimist: {} + } + }), + 'package.json': File({ + name: 'http-locks', + version: '1.0.0', + dependencies: { + minimist: common.registry + '/minimist/-/minimist-0.0.5.tgz' + } + }) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + t.done() +}) + +test('raises error to regenerate the shrinkwrap', function (t) { + common.npm(['install'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.match( + stderr, + 'npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".', + 'returns message to regenerate shrinkwrap' + ) + + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) diff --git a/doc/api/assert.md b/doc/api/assert.md index 0f88c1829d1350..28339a3752b41f 100644 --- a/doc/api/assert.md +++ b/doc/api/assert.md @@ -18,7 +18,7 @@ changes: - v12.16.2 description: Changed "strict mode" to "strict assertion mode" and "legacy mode" to "legacy assertion mode" to avoid confusion with the - more usual meaining of "strict mode". + more usual meaning of "strict mode". - version: v9.9.0 pr-url: https://github.com/nodejs/node/pull/17615 description: Added error diffs to the strict assertion mode. diff --git a/doc/api/cli.md b/doc/api/cli.md index 4c5d8b4d36d690..ac7d46a6a703c0 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -108,6 +108,9 @@ added: v12.0.0 Specify the directory where the CPU profiles generated by `--cpu-prof` will be placed. +The default value is controlled by the +[--diagnostic-dir](#cli_diagnostic_dir_directory) command line option. + ### `--cpu-prof-interval` +* `--diagnostic-dir` * `--disable-proto` * `--enable-fips` * `--enable-source-maps` diff --git a/doc/api/dgram.md b/doc/api/dgram.md index be0323a306b27e..3cc2ea78297228 100644 --- a/doc/api/dgram.md +++ b/doc/api/dgram.md @@ -96,6 +96,12 @@ The event handler function is passed two arguments: `msg` and `rinfo`. * `port` {number} The sender port. * `size` {number} The message size. +If the source address of the incoming packet is an IPv6 link local +address, the interface name is added to the `address`. For +example, a packet received on the `en0` interface might have the +address field set to `'fe80::2618:1234:ab11:3b9c%en0'`, where `'%en0'` +is the interface name as a zone id suffix. + ### `socket.addMembership(multicastAddress[, multicastInterface])` -* [About these docs](documentation.html) +* [About this documentation](documentation.html) * [Usage and example](synopsis.html)
diff --git a/doc/api/n-api.md b/doc/api/n-api.md index 1c90c110104f17..489e0929485787 100644 --- a/doc/api/n-api.md +++ b/doc/api/n-api.md @@ -127,7 +127,7 @@ the native addon will also need to have a C/C++ toolchain installed. For Linux developers, the necessary C/C++ toolchain packages are readily available. [GCC][] is widely used in the Node.js community to build and -test across a variety of plarforms. For many developers, the [LLVM][] +test across a variety of platforms. For many developers, the [LLVM][] compiler infrastructure is also a good choice. For Mac developers, [Xcode][] offers all the required compiler tools. diff --git a/doc/api/tls.md b/doc/api/tls.md index 6c4d6cc63370da..943bf830762baf 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -85,8 +85,8 @@ all sessions). Methods implementing this technique are called "ephemeral". Currently two methods are commonly used to achieve perfect forward secrecy (note the character "E" appended to the traditional abbreviations): -* [DHE][]: An ephemeral version of the Diffie Hellman key-agreement protocol. -* [ECDHE][]: An ephemeral version of the Elliptic Curve Diffie Hellman +* [DHE][]: An ephemeral version of the Diffie-Hellman key-agreement protocol. +* [ECDHE][]: An ephemeral version of the Elliptic Curve Diffie-Hellman key-agreement protocol. Ephemeral methods may have some performance drawbacks, because key generation @@ -412,6 +412,10 @@ server.on('keylog', (line, tlsSocket) => { ### Event: `'newSession'` The `'newSession'` event is emitted upon creation of a new TLS session. This may @@ -1570,7 +1574,7 @@ changes: client certificate. * `crl` {string|string[]|Buffer|Buffer[]} PEM formatted CRLs (Certificate Revocation Lists). - * `dhparam` {string|Buffer} Diffie Hellman parameters, required for + * `dhparam` {string|Buffer} Diffie-Hellman parameters, required for [perfect forward secrecy][]. Use `openssl dhparam` to create the parameters. The key length must be greater than or equal to 1024 bits or else an error will be thrown. Although 1024 bits is permissible, use 2048 bits or larger diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index ef98f87ca40c92..7d1f3509c374c3 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -109,9 +109,10 @@ markAsUntransferable(pooledBuffer); const { port1 } = new MessageChannel(); port1.postMessage(typedArray1, [ typedArray1.buffer ]); -// The following line prints the contents of typedArray1 -- it still owns its -// memory and has been cloned, not transfered. Without `markAsUntransferable()`, -// this would print an empty Uint8Array. typedArray2 is intact as well. +// The following line prints the contents of typedArray1 -- it still owns +// its memory and has been cloned, not transferred. Without +// `markAsUntransferable()`, this would print an empty Uint8Array. +// typedArray2 is intact as well. console.log(typedArray1); console.log(typedArray2); ``` diff --git a/doc/api_assets/README.md b/doc/api_assets/README.md index 3c0e1d1cbb2976..07262bba4ce01a 100644 --- a/doc/api_assets/README.md +++ b/doc/api_assets/README.md @@ -1,22 +1,5 @@ # API Reference Document Assets -## highlight.pack.js - -_Generated by [highlightjs.org/download][] on 2020-06-07._ - -Grammars included in the custom bundle: - -* Bash -* C -* C++ -* CoffeeScript -* HTTP -* JavaScript -* JSON -* Markdown -* Plaintext -* Shell Session - ## hljs.css The syntax theme for code snippets in API reference documents. @@ -24,5 +7,3 @@ The syntax theme for code snippets in API reference documents. ## style.css The main stylesheet for API reference documents. - -[highlightjs.org/download]: https://highlightjs.org/download/ diff --git a/doc/api_assets/highlight.pack.js b/doc/api_assets/highlight.pack.js deleted file mode 100644 index bd134963d24609..00000000000000 --- a/doc/api_assets/highlight.pack.js +++ /dev/null @@ -1,6 +0,0 @@ -/* - Highlight.js 10.0.3 (a4b1bd2d) - License: BSD-3-Clause - Copyright (c) 2006-2020, Ivan Sagalaev -*/ -var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!n.hasOwnProperty(r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}function n(e){return e.replace(/&/g,"&").replace(//g,">")}function t(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach((function(e){for(n in e)t[n]=e[n]})),t}function r(e){return e.nodeName.toLowerCase()}var a=Object.freeze({__proto__:null,escapeHTML:n,inherit:t,nodeStream:function(e){var n=[];return function e(t,a){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?a+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=e(i,a),r(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n},mergeStreams:function(e,t,a){var i=0,s="",o=[];function l(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function u(e){s+=""}function d(e){("start"===e.event?c:u)(e.node)}for(;e.length||t.length;){var g=l();if(s+=n(a.substring(i,g[0].offset)),i=g[0].offset,g===e){o.reverse().forEach(u);do{d(g.splice(0,1)[0]),g=l()}while(g===e&&g.length&&g[0].offset===i);o.reverse().forEach(c)}else"start"===g[0].event?o.push(g[0].node):o.pop(),d(g.splice(0,1)[0])}return s+n(a.substr(i))}});const i="",s=e=>!!e.kind;class o{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=n(e)}openNode(e){if(!s(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){s(e)&&(this.buffer+=i)}span(e){this.buffer+=``}value(){return this.buffer}}class l{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){e.children&&(e.children.every(e=>"string"==typeof e)?(e.text=e.children.join(""),delete e.children):e.children.forEach(e=>{"string"!=typeof e&&l._collapse(e)}))}}class c extends l{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){let t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new o(this,this.options).value()}finalize(){}}function u(e){return e&&e.source||e}const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",g={begin:"\\\\[\\s\\S]",relevance:0},h={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[g]},f={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[g]},p={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},m=function(e,n,r){var a=t({className:"comment",begin:e,end:n,contains:[]},r||{});return a.contains.push(p),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),a},b=m("//","$"),v=m("/\\*","\\*/"),x=m("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",BACKSLASH_ESCAPE:g,APOS_STRING_MODE:h,QUOTE_STRING_MODE:f,PHRASAL_WORDS_MODE:p,COMMENT:m,C_LINE_COMMENT_MODE:b,C_BLOCK_COMMENT_MODE:v,HASH_COMMENT_MODE:x,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:d,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^\/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[g,{begin:/\[/,end:/\]/,relevance:0,contains:[g]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0}}),E="of and for in not or if then".split(" ");function R(e,n){return n?+n:(t=e,E.includes(t.toLowerCase())?0:1);var t}const N=n,w=t,{nodeStream:y,mergeStreams:O}=a;return function(n){var r=[],a={},i={},s=[],o=!0,l=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,d="Could not find the language '{}', did you forget to load/include a language module?",g={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0,__emitter:c};function h(e){return g.noHighlightRe.test(e)}function f(e,n,t,r){var a={code:n,language:e};T("before:highlight",a);var i=a.result?a.result:p(a.language,a.code,t,r);return i.code=a.code,T("after:highlight",i),i}function p(e,n,r,i){var s=n;function l(e,n){var t=v.case_insensitive?n[0].toLowerCase():n[0];return e.keywords.hasOwnProperty(t)&&e.keywords[t]}function c(){null!=_.subLanguage?function(){if(""!==k){var e="string"==typeof _.subLanguage;if(!e||a[_.subLanguage]){var n=e?p(_.subLanguage,k,!0,E[_.subLanguage]):m(k,_.subLanguage.length?_.subLanguage:void 0);_.relevance>0&&(T+=n.relevance),e&&(E[_.subLanguage]=n.top),w.addSublanguage(n.emitter,n.language)}else w.addText(k)}}():function(){var e,n,t,r;if(_.keywords){for(n=0,_.lexemesRe.lastIndex=0,t=_.lexemesRe.exec(k),r="";t;){r+=k.substring(n,t.index);var a=null;(e=l(_,t))?(w.addText(r),r="",T+=e[1],a=e[0],w.addKeyword(t[0],a)):r+=t[0],n=_.lexemesRe.lastIndex,t=_.lexemesRe.exec(k)}r+=k.substr(n),w.addText(r)}else w.addText(k)}(),k=""}function h(e){e.className&&w.openNode(e.className),_=Object.create(e,{parent:{value:_}})}var f={};function b(n,t){var a,i=t&&t[0];if(k+=n,null==i)return c(),0;if("begin"==f.type&&"end"==t.type&&f.index==t.index&&""===i){if(k+=s.slice(t.index,t.index+1),!o)throw(a=Error("0 width match regex")).languageName=e,a.badRule=f.rule,a;return 1}if(f=t,"begin"===t.type)return function(e){var n=e[0],t=e.rule;return t.__onBegin&&(t.__onBegin(e)||{}).ignoreMatch?function(e){return 0===_.matcher.regexIndex?(k+=e[0],1):(B=!0,0)}(n):(t&&t.endSameAsBegin&&(t.endRe=RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),t.skip?k+=n:(t.excludeBegin&&(k+=n),c(),t.returnBegin||t.excludeBegin||(k=n)),h(t),t.returnBegin?0:n.length)}(t);if("illegal"===t.type&&!r)throw(a=Error('Illegal lexeme "'+i+'" for mode "'+(_.className||"")+'"')).mode=_,a;if("end"===t.type){var l=function(e){var n=e[0],t=s.substr(e.index),r=function e(n,t){if(function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(n.endRe,t)){for(;n.endsParent&&n.parent;)n=n.parent;return n}if(n.endsWithParent)return e(n.parent,t)}(_,t);if(r){var a=_;a.skip?k+=n:(a.returnEnd||a.excludeEnd||(k+=n),c(),a.excludeEnd&&(k=n));do{_.className&&w.closeNode(),_.skip||_.subLanguage||(T+=_.relevance),_=_.parent}while(_!==r.parent);return r.starts&&(r.endSameAsBegin&&(r.starts.endRe=r.endRe),h(r.starts)),a.returnEnd?0:n.length}}(t);if(null!=l)return l}if("illegal"===t.type&&""===i)return 1;if(A>1e5&&A>3*t.index)throw Error("potential infinite loop, way more iterations than matches");return k+=i,i.length}var v=M(e);if(!v)throw console.error(d.replace("{}",e)),Error('Unknown language: "'+e+'"');!function(e){function n(n,t){return RegExp(u(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class r{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i0&&(a+="|"),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"==l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("==l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let n=this.matcherRe.exec(e);if(!n)return null;let t=n.findIndex((e,n)=>n>0&&null!=e),r=this.matchIndexes[t];return Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let n=new r;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){let n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&(this.regexIndex=0)),t}}function i(e){let n=e.input[e.index-1],t=e.input[e.index+e[0].length];if("."===n||"."===t)return{ignoreMatch:!0}}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");!function r(s,o){s.compiled||(s.compiled=!0,s.__onBegin=null,s.keywords=s.keywords||s.beginKeywords,s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,R(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemesRe=n(s.lexemes||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__onBegin=i),s.begin||(s.begin=/\B|\b/),s.beginRe=n(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(s.endRe=n(s.end)),s.terminator_end=u(s.end)||"",s.endsWithParent&&o.terminator_end&&(s.terminator_end+=(s.end?"|":"")+o.terminator_end)),s.illegal&&(s.illegalRe=n(s.illegal)),null==s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(n){return t(e,{variants:null},n)}))),e.cached_variants?e.cached_variants:function e(n){return!!n&&(n.endsWithParent||e(n.starts))}(e)?t(e,{starts:e.starts?t(e.starts):null}):Object.isFrozen(e)?t(e):e}("self"===e?s:e)}))),s.contains.forEach((function(e){r(e,s)})),s.starts&&r(s.starts,o),s.matcher=function(e){let n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&n.addRule(e.terminator_end,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(s))}(e)}(v);var x,_=i||v,E={},w=new g.__emitter(g);!function(){for(var e=[],n=_;n!==v;n=n.parent)n.className&&e.unshift(n.className);e.forEach(e=>w.openNode(e))}();var y,O,k="",T=0,L=0,A=0,B=!1;try{for(_.matcher.considerAll();A++,B?B=!1:(_.matcher.lastIndex=L,_.matcher.considerAll()),y=_.matcher.exec(s);)O=b(s.substring(L,y.index),y),L=y.index+O;return b(s.substr(L)),w.closeAllNodes(),w.finalize(),x=w.toHTML(),{relevance:T,value:x,language:e,illegal:!1,emitter:w,top:_}}catch(n){if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:n.message,context:s.slice(L-100,L+100),mode:n.mode},sofar:x,relevance:0,value:N(s),emitter:w};if(o)return{relevance:0,value:N(s),emitter:w,language:e,top:_,errorRaised:n};throw n}}function m(e,n){n=n||g.languages||Object.keys(a);var t=function(e){const n={relevance:0,emitter:new g.__emitter(g),value:N(e),illegal:!1,top:E};return n.emitter.addText(e),n}(e),r=t;return n.filter(M).filter(k).forEach((function(n){var a=p(n,e,!1);a.language=n,a.relevance>r.relevance&&(r=a),a.relevance>t.relevance&&(r=t,t=a)})),r.language&&(t.second_best=r),t}function b(e){return g.tabReplace||g.useBR?e.replace(l,(function(e,n){return g.useBR&&"\n"===e?"
":g.tabReplace?n.replace(/\t/g,g.tabReplace):""})):e}function v(e){var n,t,r,a,s,o=function(e){var n,t=e.className+" ";if(t+=e.parentNode?e.parentNode.className:"",n=g.languageDetectRe.exec(t)){var r=M(n[1]);return r||(console.warn(d.replace("{}",n[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>h(e)||M(e))}(e);h(o)||(T("before:highlightBlock",{block:e,language:o}),g.useBR?(n=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"):n=e,s=n.textContent,r=o?f(o,s,!0):m(s),(t=y(n)).length&&((a=document.createElement("div")).innerHTML=r.value,r.value=O(t,y(a),s)),r.value=b(r.value),T("after:highlightBlock",{block:e,result:r}),e.innerHTML=r.value,e.className=function(e,n,t){var r=n?i[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),e.includes(r)||a.push(r),a.join(" ").trim()}(e.className,o,r.language),e.result={language:r.language,re:r.relevance},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.relevance}))}function x(){if(!x.called){x.called=!0;var e=document.querySelectorAll("pre code");r.forEach.call(e,v)}}const E={disableAutodetect:!0,name:"Plain text"};function M(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]}function k(e){var n=M(e);return n&&!n.disableAutodetect}function T(e,n){var t=e;s.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(n,{highlight:f,highlightAuto:m,fixMarkup:b,highlightBlock:v,configure:function(e){g=w(g,e)},initHighlighting:x,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",x,!1)},registerLanguage:function(e,t){var r;try{r=t(n)}catch(n){if(console.error("Language definition for '{}' could not be registered.".replace("{}",e)),!o)throw n;console.error(n),r=E}r.name||(r.name=e),a[e]=r,r.rawDefinition=t.bind(null,n),r.aliases&&r.aliases.forEach((function(n){i[n]=e}))},listLanguages:function(){return Object.keys(a)},getLanguage:M,requireLanguage:function(e){var n=M(e);if(n)return n;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:k,inherit:w,addPlugin:function(e,n){s.push(e)}}),n.debugMode=function(){o=!1},n.safeMode=function(){o=!0},n.versionString="10.0.3";for(const n in _)"object"==typeof _[n]&&e(_[n]);return Object.assign(n,_),n}({})}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);hljs.registerLanguage("c-like",function(){"use strict";return function(e){function t(e){return"(?:"+e+")?"}var n="(decltype\\(auto\\)|"+t("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+t("<.*?>")+")",r={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},{begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\((?:.|\n)*?\)\1"/}]},s={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},i={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t("[a-zA-Z_]\\w*::")+e.IDENT_RE,relevance:0},o=t("[a-zA-Z_]\\w*::")+e.IDENT_RE+"\\s*\\(",l={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",literal:"true false nullptr NULL"},d=[r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,a],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:l,contains:d.concat([{begin:/\(/,end:/\)/,keywords:l,contains:d.concat(["self"]),relevance:0}]),relevance:0},u={className:"function",begin:"("+n+"[\\*&\\s]+)+"+o,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:l,illegal:/[^\w\s\*&:<>]/,contains:[{begin:"decltype\\(auto\\)",keywords:l,relevance:0},{begin:o,returnBegin:!0,contains:[c],relevance:0},{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,r,{begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:["self",e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,s,r]}]},r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i]};return{aliases:["c","cc","h","c++","h++","hpp","hh","hxx","cxx"],keywords:l,disableAutodetect:!0,illegal:"",keywords:l,contains:["self",r]},{begin:e.IDENT_RE+"::",keywords:l},{className:"class",beginKeywords:"class struct",end:/[{;:]/,contains:[{begin://,contains:["self"]},e.TITLE_MODE]}]),exports:{preprocessor:i,strings:a,keywords:l}}}}());hljs.registerLanguage("cpp",function(){"use strict";return function(e){var t=e.getLanguage("c-like").rawDefinition();return t.disableAutodetect=!1,t.name="C++",t.aliases=["cc","c++","h++","hpp","hh","hxx","cxx"],t}}());hljs.registerLanguage("xml",function(){"use strict";return function(e){var n={className:"symbol",begin:"&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;"},a={begin:"\\s",contains:[{className:"meta-keyword",begin:"#?[a-z_][a-z1-9_-]+",illegal:"\\n"}]},s=e.inherit(a,{begin:"\\(",end:"\\)"}),t=e.inherit(e.APOS_STRING_MODE,{className:"meta-string"}),i=e.inherit(e.QUOTE_STRING_MODE,{className:"meta-string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[a,i,t,s,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"",contains:[a,s,i,t]}]}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:")",end:">",keywords:{name:"style"},contains:[c],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:")",end:">",keywords:{name:"script"},contains:[c],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},c]}]}}}());hljs.registerLanguage("markdown",function(){"use strict";return function(n){const e={begin:"<",end:">",subLanguage:"xml",relevance:0},a={begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},i={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};i.contains.push(s),s.contains.push(i);var c=[e,a];return i.contains=i.contains.concat(c),s.contains=s.contains.concat(c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:c=c.concat(i,s)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:c}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:c,end:"$"},{className:"code",variants:[{begin:"(`{3,})(.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})(.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}}());hljs.registerLanguage("coffeescript",function(){"use strict";return function(e){var n={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},i="[A-Za-z$_][0-9A-Za-z$_]*",s={className:"subst",begin:/#\{/,end:/}/,keywords:n},a=[e.BINARY_NUMBER_MODE,e.inherit(e.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[e.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s]},{begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s]}]},{className:"regexp",variants:[{begin:"///",end:"///",contains:[s,e.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)",relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+i},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{begin:"```",end:"```"},{begin:"`",end:"`"}]}];s.contains=a;var t=e.inherit(e.TITLE_MODE,{begin:i}),r={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:n,contains:["self"].concat(a)}]};return{name:"CoffeeScript",aliases:["coffee","cson","iced"],keywords:n,illegal:/\/\*/,contains:a.concat([e.COMMENT("###","###"),e.HASH_COMMENT_MODE,{className:"function",begin:"^\\s*"+i+"\\s*=\\s*(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[t,r]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function",begin:"(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[r]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[t]},t]},{begin:i+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}}());hljs.registerLanguage("bash",function(){"use strict";return function(e){const s={};Object.assign(s,{className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{/,end:/\}/,contains:[{begin:/:-/,contains:[s]}]}]});const n={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},t={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,n]};n.contains.push(t);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,s]};return{name:"Bash",aliases:["sh","zsh"],lexemes:/\b-?[a-z\._]+\b/,keywords:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[{className:"meta",begin:/^#![^\n]+sh\s*$/,relevance:10},{className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},a,e.HASH_COMMENT_MODE,t,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},s]}}}());hljs.registerLanguage("shell",function(){"use strict";return function(s){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}}());hljs.registerLanguage("plaintext",function(){"use strict";return function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}}());hljs.registerLanguage("json",function(){"use strict";return function(n){var e={literal:"true false null"},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],t=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:e},l={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(a,{begin:/:/})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(a)],illegal:"\\S"};return t.push(l,s),i.forEach((function(n){t.push(n)})),{name:"JSON",contains:t,keywords:e,illegal:"\\S"}}}());hljs.registerLanguage("javascript",function(){"use strict";return function(e){var n={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/},a="[A-Za-z$_][0-9A-Za-z$_]*",s={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},r={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:e.C_NUMBER_RE+"n?"}],relevance:0},i={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},t={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"xml"}},c={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"css"}},o={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,i]};i.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,t,c,o,r,e.REGEXP_MODE];var l=i.contains.concat([e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]),d={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:l};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,contains:[{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},{className:"meta",begin:/^#!/,end:/$/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,t,c,o,e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,r,{begin:/[{,\n]\s*/,relevance:0,contains:[{begin:a+"\\s*:",returnBegin:!0,relevance:0,contains:[{className:"attr",begin:a,relevance:0}]}]},{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+a+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:a},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:l}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:"<>",end:""},{begin:n.begin,end:n.end}],subLanguage:"xml",contains:[{begin:n.begin,end:n.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:a}),d],illegal:/\[|%/},{begin:/\$[(.]/},e.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0},{begin:"(get|set)\\s+(?="+a+"\\()",end:/{/,keywords:"get set",contains:[e.inherit(e.TITLE_MODE,{begin:a}),{begin:/\(\)/},d]}],illegal:/#(?!!)/}}}());hljs.registerLanguage("typescript",function(){"use strict";return function(e){var n={keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class public private protected get set super static implements enum export import declare type namespace abstract as from extends async await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document any number boolean string void Promise"},r={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},a={begin:"\\(",end:/\)/,keywords:n,contains:["self",e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.NUMBER_MODE]},t={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,r,a]},s={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:e.C_NUMBER_RE+"n?"}],relevance:0},i={className:"subst",begin:"\\$\\{",end:"\\}",keywords:n,contains:[]},o={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"xml"}},c={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,i],subLanguage:"css"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,i]};return i.contains=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,o,c,E,s,e.REGEXP_MODE],{name:"TypeScript",aliases:["ts"],keywords:n,contains:[{className:"meta",begin:/^\s*['"]use strict['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,o,c,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.REGEXP_MODE,{className:"function",begin:"(\\(.*?\\)|"+e.IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.IDENT_RE},{begin:/\(\s*\)/},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,contains:["self",e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]}]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[\{;]/,excludeEnd:!0,keywords:n,contains:["self",e.inherit(e.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*"}),t],illegal:/%/,relevance:0},{beginKeywords:"constructor",end:/[\{;]/,excludeEnd:!0,contains:["self",t]},{begin:/module\./,keywords:{built_in:"module"},relevance:0},{beginKeywords:"module",end:/\{/,excludeEnd:!0},{beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},{begin:/\$[(.]/},{begin:"\\."+e.IDENT_RE,relevance:0},r,a]}}}());hljs.registerLanguage("c",function(){"use strict";return function(e){var n=e.getLanguage("c-like").rawDefinition();return n.name="C",n.aliases=["c","h"],n}}());hljs.registerLanguage("http",function(){"use strict";return function(e){var n="HTTP/[0-9\\.]+";return{name:"HTTP",aliases:["https"],illegal:"\\S",contains:[{begin:"^"+n,end:"$",contains:[{className:"number",begin:"\\b\\d{3}\\b"}]},{begin:"^[A-Z]+ (.*?) "+n+"$",returnBegin:!0,end:"$",contains:[{className:"string",begin:" ",end:" ",excludeBegin:!0,excludeEnd:!0},{begin:n},{className:"keyword",begin:"[A-Z]+"}]},{className:"attribute",begin:"^\\w",end:": ",excludeEnd:!0,illegal:"\\n|\\s|=",starts:{end:"$",relevance:0}},{begin:"\\n\\n",starts:{subLanguage:[],endsWithParent:!0}}]}}}()); \ No newline at end of file diff --git a/doc/changelogs/CHANGELOG_V14.md b/doc/changelogs/CHANGELOG_V14.md index 36b9c459b94dd0..9df37eb9ad3ec2 100644 --- a/doc/changelogs/CHANGELOG_V14.md +++ b/doc/changelogs/CHANGELOG_V14.md @@ -10,6 +10,7 @@ +14.7.0
14.6.0
14.5.0
14.4.0
@@ -37,6 +38,105 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2020-07-29, Version 14.7.0 (Current), @MylesBorins prepared by @ruyadorno + +### Notable Changes + +* **deps**: + * upgrade npm to 6.14.7 (claudiahdz) [#34468](https://github.com/nodejs/node/pull/34468) +* **dgram**: + * **(SEMVER-MINOR)** add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) [#14500](https://github.com/nodejs/node/pull/14500) +* **src**: + * **(SEMVER-MINOR)** allow preventing SetPromiseRejectCallback (Shelley Vohr) [#34387](https://github.com/nodejs/node/pull/34387) + * **(SEMVER-MINOR)** allow setting a dir for all diagnostic output (AshCripps) [#33584](https://github.com/nodejs/node/pull/33584) +* **worker**: + * **(SEMVER-MINOR)** make MessagePort inherit from EventTarget (Anna Henningsen) [#34057](https://github.com/nodejs/node/pull/34057) +* **zlib**: + * switch to lazy init for zlib streams (Andrey Pechkurov) [#34048](https://github.com/nodejs/node/pull/34048) +* **New Collaborators**: + * add rexagod to collaborators (Pranshu Srivastava) [#34457](https://github.com/nodejs/node/pull/34457) + * add AshCripps to collaborators (AshCripps) [#34494](https://github.com/nodejs/node/pull/34494) + * add HarshithaKP to collaborators (Harshitha K P) [#34417](https://github.com/nodejs/node/pull/34417) + * add release key for Richard Lau (Richard Lau) [#34397](https://github.com/nodejs/node/pull/34397) + +### Commits + +* [[`dd2988917f`](https://github.com/nodejs/node/commit/dd2988917f)] - **async_hooks**: optimize fast-path promise hook for ALS (Andrey Pechkurov) [#34512](https://github.com/nodejs/node/pull/34512) +* [[`358b934284`](https://github.com/nodejs/node/commit/358b934284)] - **build**: fix test-ci-js task in Makefile (Rich Trott) [#34433](https://github.com/nodejs/node/pull/34433) +* [[`24e1beb829`](https://github.com/nodejs/node/commit/24e1beb829)] - **build**: do not run benchmark tests on 'make test' (Rich Trott) [#34434](https://github.com/nodejs/node/pull/34434) +* [[`b24f254472`](https://github.com/nodejs/node/commit/b24f254472)] - **build**: add benchmark tests to CI runs (Rich Trott) [#34288](https://github.com/nodejs/node/pull/34288) +* [[`a4806e2d12`](https://github.com/nodejs/node/commit/a4806e2d12)] - **build**: speed up source tarball creation (Richard Lau) [#34508](https://github.com/nodejs/node/pull/34508) +* [[`cce1f3e3a8`](https://github.com/nodejs/node/commit/cce1f3e3a8)] - **build**: don't run test-asan workflow on non-master pushes (Richard Lau) [#34509](https://github.com/nodejs/node/pull/34509) +* [[`70f23eb405`](https://github.com/nodejs/node/commit/70f23eb405)] - **build**: remove test-tarball action for windows + osx (Myles Borins) [#34440](https://github.com/nodejs/node/pull/34440) +* [[`3fda3d4bf3`](https://github.com/nodejs/node/commit/3fda3d4bf3)] - **build**: don't run Actions on non-master pushes (Shelley Vohr) [#34464](https://github.com/nodejs/node/pull/34464) +* [[`f7600d5ab6`](https://github.com/nodejs/node/commit/f7600d5ab6)] - **deps**: upgrade npm to 6.14.7 (claudiahdz) [#34468](https://github.com/nodejs/node/pull/34468) +* [[`02ae6d65d4`](https://github.com/nodejs/node/commit/02ae6d65d4)] - **(SEMVER-MINOR)** **dgram**: add IPv6 scope id suffix to received udp6 dgrams (Pekka Nikander) [#14500](https://github.com/nodejs/node/pull/14500) +* [[`e5f380052f`](https://github.com/nodejs/node/commit/e5f380052f)] - ***Revert*** "**doc**: move ronkorving to emeritus" (Rich Trott) [#34507](https://github.com/nodejs/node/pull/34507) +* [[`17bca62428`](https://github.com/nodejs/node/commit/17bca62428)] - **doc**: use sentence-case for GOVERNANCE.md headers (Rich Trott) [#34503](https://github.com/nodejs/node/pull/34503) +* [[`37752cde43`](https://github.com/nodejs/node/commit/37752cde43)] - **doc**: revise onboarding-extras (Rich Trott) [#34496](https://github.com/nodejs/node/pull/34496) +* [[`050866ddf1`](https://github.com/nodejs/node/commit/050866ddf1)] - **doc**: remove breaking-change-helper from onboarding-extras (Rich Trott) [#34497](https://github.com/nodejs/node/pull/34497) +* [[`2297d74fd8`](https://github.com/nodejs/node/commit/2297d74fd8)] - **doc**: add Triagers section to table of contents in GOVERNANCE.md (Rich Trott) [#34504](https://github.com/nodejs/node/pull/34504) +* [[`99a648738c`](https://github.com/nodejs/node/commit/99a648738c)] - **doc**: onboarding process extras (Gireesh Punathil) [#34455](https://github.com/nodejs/node/pull/34455) +* [[`bbc7eeadd9`](https://github.com/nodejs/node/commit/bbc7eeadd9)] - **doc**: mention triage in GOVERNANCE.md (Gireesh Punathil) [#34426](https://github.com/nodejs/node/pull/34426) +* [[`92c57b284b`](https://github.com/nodejs/node/commit/92c57b284b)] - **doc**: move thefourtheye to emeritus (Rich Trott) [#34471](https://github.com/nodejs/node/pull/34471) +* [[`657f2d78ee`](https://github.com/nodejs/node/commit/657f2d78ee)] - **doc**: move ronkorving to emeritus (Rich Trott) [#34471](https://github.com/nodejs/node/pull/34471) +* [[`455dd9cc76`](https://github.com/nodejs/node/commit/455dd9cc76)] - **doc**: match link text in index to doc headline (Rich Trott) [#34449](https://github.com/nodejs/node/pull/34449) +* [[`f4a63f3d9a`](https://github.com/nodejs/node/commit/f4a63f3d9a)] - **doc**: add AshCripps to collaborators (AshCripps) [#34494](https://github.com/nodejs/node/pull/34494) +* [[`7d058a4c01`](https://github.com/nodejs/node/commit/7d058a4c01)] - **doc**: add author-ready label ref to onboarding doc (Ruy Adorno) [#34381](https://github.com/nodejs/node/pull/34381) +* [[`a3c9f75b7e`](https://github.com/nodejs/node/commit/a3c9f75b7e)] - **doc**: add HarshithaKP to collaborators (Harshitha K P) [#34417](https://github.com/nodejs/node/pull/34417) +* [[`4b4eb5f130`](https://github.com/nodejs/node/commit/4b4eb5f130)] - **doc**: add rexagod to collaborators (Pranshu Srivastava) [#34457](https://github.com/nodejs/node/pull/34457) +* [[`29ad6fb34e`](https://github.com/nodejs/node/commit/29ad6fb34e)] - **doc**: add statement of purpose to documentation style guide (Rich Trott) [#34424](https://github.com/nodejs/node/pull/34424) +* [[`631dd21709`](https://github.com/nodejs/node/commit/631dd21709)] - **doc**: mark Node.js 13 as End-of-Life (Antoine du Hamel) [#34436](https://github.com/nodejs/node/pull/34436) +* [[`905e3d18c0`](https://github.com/nodejs/node/commit/905e3d18c0)] - **doc**: fix line length in worker\_threads.md (Jucke) [#34419](https://github.com/nodejs/node/pull/34419) +* [[`d67a2b8d38`](https://github.com/nodejs/node/commit/d67a2b8d38)] - **doc**: fix typos in n-api, tls and worker\_threads (Jucke) [#34419](https://github.com/nodejs/node/pull/34419) +* [[`39894f8842`](https://github.com/nodejs/node/commit/39894f8842)] - **doc**: add release key for Richard Lau (Richard Lau) [#34397](https://github.com/nodejs/node/pull/34397) +* [[`4a828c6c06`](https://github.com/nodejs/node/commit/4a828c6c06)] - **doc**: use correct identifier for callback argument (Rich Trott) [#34405](https://github.com/nodejs/node/pull/34405) +* [[`10830732f6`](https://github.com/nodejs/node/commit/10830732f6)] - **doc**: add changes metadata to TLS newSession event (Tobias Nießen) [#34294](https://github.com/nodejs/node/pull/34294) +* [[`10962c81e1`](https://github.com/nodejs/node/commit/10962c81e1)] - **doc**: introduce a triager role (Gireesh Punathil) [#34295](https://github.com/nodejs/node/pull/34295) +* [[`50fd2b9de9`](https://github.com/nodejs/node/commit/50fd2b9de9)] - **doc**: strengthen suggestion in errors.md (Rich Trott) [#34390](https://github.com/nodejs/node/pull/34390) +* [[`346c201c4e`](https://github.com/nodejs/node/commit/346c201c4e)] - **doc**: strengthen wording about fs.access() misuse (Rich Trott) [#34352](https://github.com/nodejs/node/pull/34352) +* [[`c28453aff4`](https://github.com/nodejs/node/commit/c28453aff4)] - **doc**: fix typo in assert.md (Ye-hyoung Kang) [#34316](https://github.com/nodejs/node/pull/34316) +* [[`f60e58b6c9`](https://github.com/nodejs/node/commit/f60e58b6c9)] - **doc,tools**: syntax highlight api docs at compile-time (Francisco Ryan Tolmasky I) [#34148](https://github.com/nodejs/node/pull/34148) +* [[`d90967b346`](https://github.com/nodejs/node/commit/d90967b346)] - **events**: re-use the same isTrusted getter (Anna Henningsen) [#34459](https://github.com/nodejs/node/pull/34459) +* [[`c93a898028`](https://github.com/nodejs/node/commit/c93a898028)] - **(SEMVER-MINOR)** **events**: expand NodeEventTarget functionality (Anna Henningsen) [#34057](https://github.com/nodejs/node/pull/34057) +* [[`9b91467aac`](https://github.com/nodejs/node/commit/9b91467aac)] - **http**: don't write error to socket (Robert Nagy) [#34465](https://github.com/nodejs/node/pull/34465) +* [[`098b193eab`](https://github.com/nodejs/node/commit/098b193eab)] - **http2**: avoid unnecessary buffer resize (Denys Otrishko) [#34480](https://github.com/nodejs/node/pull/34480) +* [[`3024927c9b`](https://github.com/nodejs/node/commit/3024927c9b)] - **lib**: initialize instance members in class constructors (Joyee Cheung) [#32984](https://github.com/nodejs/node/pull/32984) +* [[`82fad58ade`](https://github.com/nodejs/node/commit/82fad58ade)] - **lib**: simplify assignment (sapics) [#33718](https://github.com/nodejs/node/pull/33718) +* [[`e1199af50a`](https://github.com/nodejs/node/commit/e1199af50a)] - **module**: self referential modules in repl or `-r` (Daniele Belardi) [#32261](https://github.com/nodejs/node/pull/32261) +* [[`e7c64af404`](https://github.com/nodejs/node/commit/e7c64af404)] - **n-api**: run all finalizers via SetImmediate() (Gabriel Schulhof) [#34386](https://github.com/nodejs/node/pull/34386) +* [[`668632d531`](https://github.com/nodejs/node/commit/668632d531)] - **net**: allow wider regex in interface name (Stewart X Addison) [#34364](https://github.com/nodejs/node/pull/34364) +* [[`c05b63d8b2`](https://github.com/nodejs/node/commit/c05b63d8b2)] - **src**: skip weak references for memory tracking (Anna Henningsen) [#34469](https://github.com/nodejs/node/pull/34469) +* [[`b12211eeca`](https://github.com/nodejs/node/commit/b12211eeca)] - **src**: prefer internal fields in ModuleWrap (Anna Henningsen) [#34470](https://github.com/nodejs/node/pull/34470) +* [[`cbe6385880`](https://github.com/nodejs/node/commit/cbe6385880)] - **src**: remove unused variable in node\_file.cc (sapics) [#34317](https://github.com/nodejs/node/pull/34317) +* [[`d6ee1fd0c2`](https://github.com/nodejs/node/commit/d6ee1fd0c2)] - **src**: do not crash if ToggleAsyncHook fails during termination (Anna Henningsen) [#34362](https://github.com/nodejs/node/pull/34362) +* [[`bd9ab00acd`](https://github.com/nodejs/node/commit/bd9ab00acd)] - **(SEMVER-MINOR)** **src**: allow preventing SetPromiseRejectCallback (Shelley Vohr) [#34387](https://github.com/nodejs/node/pull/34387) +* [[`5c943588bc`](https://github.com/nodejs/node/commit/5c943588bc)] - **(SEMVER-MINOR)** **src**: allow setting a dir for all diagnostic output (AshCripps) [#33584](https://github.com/nodejs/node/pull/33584) +* [[`9d40af54a6`](https://github.com/nodejs/node/commit/9d40af54a6)] - **src**: avoid strcmp in SecureContext::Init (Tobias Nießen) [#34329](https://github.com/nodejs/node/pull/34329) +* [[`aef41e5b52`](https://github.com/nodejs/node/commit/aef41e5b52)] - **src**: refactor CertCbDone to avoid goto statement (Tobias Nießen) [#34325](https://github.com/nodejs/node/pull/34325) +* [[`3d4f608e42`](https://github.com/nodejs/node/commit/3d4f608e42)] - **stream**: rename opts to options (rickyes) [#34339](https://github.com/nodejs/node/pull/34339) +* [[`fced3ce5ad`](https://github.com/nodejs/node/commit/fced3ce5ad)] - **test**: add ref comment to test-regress-GH-814\_2 (Rich Trott) [#34516](https://github.com/nodejs/node/pull/34516) +* [[`d5c8b386c6`](https://github.com/nodejs/node/commit/d5c8b386c6)] - **test**: add ref comment to test-regress-GH-814 (Rich Trott) [#34516](https://github.com/nodejs/node/pull/34516) +* [[`cc279db29f`](https://github.com/nodejs/node/commit/cc279db29f)] - **test**: remove superfluous check in pummel/test-timers (Rich Trott) [#34488](https://github.com/nodejs/node/pull/34488) +* [[`3f11ba1c69`](https://github.com/nodejs/node/commit/3f11ba1c69)] - **test**: fix test-heapdump-zlib (Andrey Pechkurov) [#34499](https://github.com/nodejs/node/pull/34499) +* [[`81eaaa27d5`](https://github.com/nodejs/node/commit/81eaaa27d5)] - **test**: remove duplicate checks in pummel/test-timers (Rich Trott) [#34473](https://github.com/nodejs/node/pull/34473) +* [[`1a9138d679`](https://github.com/nodejs/node/commit/1a9138d679)] - **test**: delete invalid test (Anna Henningsen) [#34445](https://github.com/nodejs/node/pull/34445) +* [[`4e2f5fa907`](https://github.com/nodejs/node/commit/4e2f5fa907)] - **test**: fixup worker + source map test (Anna Henningsen) [#34446](https://github.com/nodejs/node/pull/34446) +* [[`cd35d00518`](https://github.com/nodejs/node/commit/cd35d00518)] - **test**: force resigning of app (Colin Ihrig) [#34331](https://github.com/nodejs/node/pull/34331) +* [[`eecb92c9da`](https://github.com/nodejs/node/commit/eecb92c9da)] - **test**: fix flaky test-watch-file (Rich Trott) [#34420](https://github.com/nodejs/node/pull/34420) +* [[`30da332314`](https://github.com/nodejs/node/commit/30da332314)] - **test**: fix flaky test-heapdump-http2 (Rich Trott) [#34415](https://github.com/nodejs/node/pull/34415) +* [[`77542a4a7a`](https://github.com/nodejs/node/commit/77542a4a7a)] - **test**: do not write to fixtures dir in test-watch-file (Rich Trott) [#34376](https://github.com/nodejs/node/pull/34376) +* [[`699da05b29`](https://github.com/nodejs/node/commit/699da05b29)] - **test**: remove common.localhostIPv6 (Rich Trott) [#34373](https://github.com/nodejs/node/pull/34373) +* [[`ec1393db63`](https://github.com/nodejs/node/commit/ec1393db63)] - **test**: fix test-net-pingpong pummel test for non-IPv6 hosts (Rich Trott) [#34359](https://github.com/nodejs/node/pull/34359) +* [[`8ca80427db`](https://github.com/nodejs/node/commit/8ca80427db)] - **test**: fix flaky test-net-connect-econnrefused (Rich Trott) [#34330](https://github.com/nodejs/node/pull/34330) +* [[`e9c7722ea4`](https://github.com/nodejs/node/commit/e9c7722ea4)] - **tls**: remove setMaxSendFragment guards (Tobias Nießen) [#34323](https://github.com/nodejs/node/pull/34323) +* [[`f4d61c7ce9`](https://github.com/nodejs/node/commit/f4d61c7ce9)] - **tools**: update ESLint to 7.5.0 (Colin Ihrig) [#34423](https://github.com/nodejs/node/pull/34423) +* [[`74da2c44ca`](https://github.com/nodejs/node/commit/74da2c44ca)] - **util**: improve getStringWidth performance (Ruben Bridgewater) [#33674](https://github.com/nodejs/node/pull/33674) +* [[`c9b652f13f`](https://github.com/nodejs/node/commit/c9b652f13f)] - **vm**: add tests for function declarations using \[\[DefineOwnProperty\]\] (ExE Boss) [#34032](https://github.com/nodejs/node/pull/34032) +* [[`0aa3809b6b`](https://github.com/nodejs/node/commit/0aa3809b6b)] - **(SEMVER-MINOR)** **worker**: make MessagePort inherit from EventTarget (Anna Henningsen) [#34057](https://github.com/nodejs/node/pull/34057) +* [[`252f37630a`](https://github.com/nodejs/node/commit/252f37630a)] - **zlib**: switch to lazy init for zlib streams (Andrey Pechkurov) [#34048](https://github.com/nodejs/node/pull/34048) + ## 2020-07-21, Version 14.6.0 (Current), @MylesBorins diff --git a/doc/guides/contributing/issues.md b/doc/guides/contributing/issues.md index 5e123f03e10117..70f649a6105921 100644 --- a/doc/guides/contributing/issues.md +++ b/doc/guides/contributing/issues.md @@ -89,6 +89,22 @@ around it. Some contributors may have differing opinions about the issue, including whether the behavior being seen is a bug or a feature. This discussion is part of the process and should be kept focused, helpful, and professional. +The objective of helping with triaging issues (in core and help repos) is to +help reduce the issue backlog and keep the issue tracker healthy, while enabling +newcomers another meaningful way to get engaged and contribute. + +Anyone with a reasonable understanding of Node.js programming and the +project's GitHub organization plus a few contributions to the project +(commenting on issues or PRs) can apply for and become a triager. Open a PR +on the README.md of this project with: i) a request to be added as a triager, +ii) the motivation for becoming a triager, and iii) agreement on reading, +understanding, and adhering to the project's [Code Of Conduct](https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md). + +The triage role enables the ability to carry the out most common triage +activities, such as applying labels and close/repoening/assigning issues. +For more information on the roles and permissions, see ["Permission levels for +repositories owned by an organization"](https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization). + ## Resolving a Bug Report In the vast majority of cases, issues are resolved by opening a Pull Request. diff --git a/doc/guides/doc-style-guide.md b/doc/guides/doc-style-guide.md index c4e1f0aa36a371..4813c4a1fbd282 100644 --- a/doc/guides/doc-style-guide.md +++ b/doc/guides/doc-style-guide.md @@ -1,4 +1,12 @@ -# Style Guide +# Documentation style guide + +This style guide helps us create organized and easy-to-read documentation. It +provides guidelines for organization, spelling, formatting, and more. + +These are guidelines rather than strict rules. Content is more important than +formatting. You do not need to learn the entire style guide before contributing +to documentation. Someone can always edit your material later to conform with +this guide. * Documentation is in markdown files with names formatted as `lowercase-with-dashes.md`. diff --git a/doc/guides/onboarding-extras.md b/doc/guides/onboarding-extras.md index 91ed05d9d3658e..030074093eef36 100644 --- a/doc/guides/onboarding-extras.md +++ b/doc/guides/onboarding-extras.md @@ -1,4 +1,4 @@ -# Additional Onboarding Information +# Additional onboarding information ## Labels @@ -11,20 +11,31 @@ * `test` * `tools` -There may be more than one subsystem valid for any particular issue or pull -request. +More than one subsystem may be valid for any particular issue or pull request. ### General -* `confirmed-bug` - Bugs you have verified exist -* `discuss` - Things that need larger discussion -* `feature request` - Any issue that requests a new feature (usually not PRs) -* `good first issue` - Issues suitable for newcomers to process -* `meta` - For issues whose topic is governance, policies, procedures, etc. -* `tsc-agenda` - Open issues and pull requests with this label will be added to +* `confirmed-bug`: Bugs you have verified +* `discuss`: Things that need larger discussion +* `feature request`: Any issue that requests a new feature +* `good first issue`: Issues suitable for newcomers to fix +* `meta`: Governance, policies, procedures, etc. +* `tsc-agenda`: Open issues and pull requests with this label will be added to the Technical Steering Committee meeting agenda --- +--- + +* `author-ready` - A pull request is _author ready_ when: + * There is a CI run in progress or completed. + * There is at least one Collaborator approval (or two TSC approvals for + semver-major PRs). + * There are no outstanding review comments. + +Please always add the `author ready` label to pull requests that qualify. +Please always remove it again as soon as the conditions are not met anymore, +such as if the CI run fails or a new outstanding review comment is posted. + +--- * `semver-{minor,major}` * be conservative – that is, if a change has the remote *chance* of breaking @@ -34,16 +45,8 @@ request. section to the docs" * major vs. everything else: run last versions tests against this version, if they pass, **probably** minor or patch - * A breaking change helper - ([full source](https://gist.github.com/chrisdickinson/ba532fa0e4e243fb7b44)): - - ```bash - SHOW=$(git show-ref -d $(git describe --abbrev=0) | tail -n1 | awk '{print $1}') - git checkout $(git show -s --pretty='%T' $SHOW) -- test - make -j4 test - ``` -### LTS/Version labels +### LTS/version labels We use labels to keep track of which branches a commit should land on: @@ -78,11 +81,11 @@ We use labels to keep track of which branches a commit should land on: Once a release line enters maintenance mode, the corresponding labels do not need to be attached anymore, as only important bugfixes will be included. -### Other Labels +### Other labels * Operating system labels * `macos`, `windows`, `smartos`, `aix` - * No linux, linux is the implied default + * No `linux` label because it is the implied default * Architecture labels * `arm`, `mips`, `s390`, `ppc` - * No x86{_64}, since that is the implied default + * No `x86{_64}` label because it is the implied default diff --git a/doc/node.1 b/doc/node.1 index 1a217a8bcf900a..d9285cb54a36e4 100644 --- a/doc/node.1 +++ b/doc/node.1 @@ -89,6 +89,9 @@ with a generated file name. The directory where the CPU profiles generated by .Fl -cpu-prof will be placed. +The default value is controlled by the +.Fl -diagnostic-dir . +command line option. . .It Fl -cpu-prof-interval The sampling interval in microseconds for the CPU profiles generated by @@ -100,6 +103,17 @@ The default is File name of the V8 CPU profile generated with .Fl -cpu-prof . +.It Fl -diagnostic-dir +Set the directory for all diagnostic output files. +Default is current working directory. +Set the directory to which all diagnostic output files will be written to. +Defaults to current working directory. +. +Affects the default output directory of: +.Fl -cpu-prof-dir . +.Fl -heap-prof-dir . +.Fl -redirect-warnings . +. .It Fl -disable-proto Ns = Ns Ar mode Disable the `Object.prototype.__proto__` property. If .Ar mode @@ -181,6 +195,9 @@ with a generated file name. The directory where the heap profiles generated by .Fl -heap-prof will be placed. +The default value is controlled by the +.Fl -diagnostic-dir . +command line option. . .It Fl -heap-prof-interval The average sampling interval in bytes for the heap profiles generated by @@ -298,6 +315,10 @@ in a compact format, single-line JSON. Location at which the .Sy diagnostic report will be generated. +The `file` name may be an absolute path. If it is not, the default directory it will +be written to is controlled by the +.Fl -diagnostic-dir . +command line option. . .It Fl -report-filename Name of the file to which the diff --git a/doc/template.html b/doc/template.html index 2f330a41718af2..6caf5a82bc31a7 100644 --- a/doc/template.html +++ b/doc/template.html @@ -3,6 +3,7 @@ + __SECTION__ | Node.js __VERSION__ Documentation @@ -48,10 +49,9 @@

Table of Contents

__CONTENT__ +
- - diff --git a/lib/_http_server.js b/lib/_http_server.js index bef14bc880165c..c34f8092ecb6ce 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -599,7 +599,7 @@ function socketOnError(e) { this.on('error', noop); if (!this.server.emit('clientError', e, this)) { - if (this.writable) { + if (this.writable && this.bytesWritten === 0) { const response = e.code === 'HPE_HEADER_OVERFLOW' ? requestHeaderFieldsTooLargeResponse : badRequestResponse; this.write(response); diff --git a/lib/internal/event_target.js b/lib/internal/event_target.js index 983e2671b7bb6e..a2a6452a3fcf60 100644 --- a/lib/internal/event_target.js +++ b/lib/internal/event_target.js @@ -7,6 +7,7 @@ const { Map, NumberIsInteger, Object, + ObjectDefineProperty, Symbol, SymbolFor, SymbolToStringTag, @@ -31,8 +32,13 @@ const kEvents = Symbol('kEvents'); const kStop = Symbol('kStop'); const kTarget = Symbol('kTarget'); +const kHybridDispatch = Symbol.for('nodejs.internal.kHybridDispatch'); +const kCreateEvent = Symbol('kCreateEvent'); const kNewListener = Symbol('kNewListener'); const kRemoveListener = Symbol('kRemoveListener'); +const kIsNodeStyleListener = Symbol('kIsNodeStyleListener'); +const kMaxListeners = Symbol('kMaxListeners'); +const kMaxListenersWarned = Symbol('kMaxListenersWarned'); // Lazy load perf_hooks to avoid the additional overhead on startup let perf_hooks; @@ -42,35 +48,36 @@ function lazyNow() { return perf_hooks.performance.now(); } -class Event { - #type = undefined; - #defaultPrevented = false; - #cancelable = false; - #timestamp = lazyNow(); - - // None of these are currently used in the Node.js implementation - // of EventTarget because there is no concept of bubbling or - // composition. We preserve their values in Event but they are - // non-ops and do not carry any semantics in Node.js - #bubbles = false; - #composed = false; - #propagationStopped = false; +// TODO(joyeecheung): V8 snapshot does not support instance member +// initializers for now: +// https://bugs.chromium.org/p/v8/issues/detail?id=10704 +const kType = Symbol('type'); +const kDefaultPrevented = Symbol('defaultPrevented'); +const kCancelable = Symbol('cancelable'); +const kTimestamp = Symbol('timestamp'); +const kBubbles = Symbol('bubbles'); +const kComposed = Symbol('composed'); +const kPropagationStopped = Symbol('propagationStopped'); +const isTrusted = () => false; +class Event { constructor(type, options) { if (arguments.length === 0) throw new ERR_MISSING_ARGS('type'); if (options != null) validateObject(options, 'options'); const { cancelable, bubbles, composed } = { ...options }; - this.#cancelable = !!cancelable; - this.#bubbles = !!bubbles; - this.#composed = !!composed; - this.#type = `${type}`; - this.#propagationStopped = false; + this[kCancelable] = !!cancelable; + this[kBubbles] = !!bubbles; + this[kComposed] = !!composed; + this[kType] = `${type}`; + this[kDefaultPrevented] = false; + this[kTimestamp] = lazyNow(); + this[kPropagationStopped] = false; // isTrusted is special (LegacyUnforgeable) - Object.defineProperty(this, 'isTrusted', { - get() { return false; }, + ObjectDefineProperty(this, 'isTrusted', { + get: isTrusted, enumerable: true, configurable: false }); @@ -87,10 +94,10 @@ class Event { }); return `${name} ${inspect({ - type: this.#type, - defaultPrevented: this.#defaultPrevented, - cancelable: this.#cancelable, - timeStamp: this.#timestamp, + type: this[kType], + defaultPrevented: this[kDefaultPrevented], + cancelable: this[kCancelable], + timeStamp: this[kTimestamp], }, opts)}`; } @@ -99,20 +106,22 @@ class Event { } preventDefault() { - this.#defaultPrevented = true; + this[kDefaultPrevented] = true; } get target() { return this[kTarget]; } get currentTarget() { return this[kTarget]; } get srcElement() { return this[kTarget]; } - get type() { return this.#type; } + get type() { return this[kType]; } - get cancelable() { return this.#cancelable; } + get cancelable() { return this[kCancelable]; } - get defaultPrevented() { return this.#cancelable && this.#defaultPrevented; } + get defaultPrevented() { + return this[kCancelable] && this[kDefaultPrevented]; + } - get timeStamp() { return this.#timestamp; } + get timeStamp() { return this[kTimestamp]; } // The following are non-op and unused properties/methods from Web API Event. @@ -121,19 +130,19 @@ class Event { composedPath() { return this[kTarget] ? [this[kTarget]] : []; } get returnValue() { return !this.defaultPrevented; } - get bubbles() { return this.#bubbles; } - get composed() { return this.#composed; } + get bubbles() { return this[kBubbles]; } + get composed() { return this[kComposed]; } get eventPhase() { return this[kTarget] ? Event.AT_TARGET : Event.NONE; } - get cancelBubble() { return this.#propagationStopped; } + get cancelBubble() { return this[kPropagationStopped]; } set cancelBubble(value) { if (value) { this.stopPropagation(); } } stopPropagation() { - this.#propagationStopped = true; + this[kPropagationStopped] = true; } static NONE = 0; @@ -157,15 +166,8 @@ Object.defineProperty(Event.prototype, SymbolToStringTag, { // the linked list makes dispatching faster, even if adding/removing is // slower. class Listener { - next; - previous; - listener; - callback; - once; - capture; - passive; - - constructor(previous, listener, once, capture, passive) { + constructor(previous, listener, once, capture, passive, isNodeStyleListener) { + this.next = undefined; if (previous !== undefined) previous.next = this; this.previous = previous; @@ -173,6 +175,7 @@ class Listener { this.once = once; this.capture = capture; this.passive = passive; + this.isNodeStyleListener = isNodeStyleListener; this.callback = typeof listener === 'function' ? @@ -192,12 +195,18 @@ class Listener { } } +function initEventTarget(self) { + self[kEvents] = new Map(); +} + class EventTarget { // Used in checking whether an object is an EventTarget. This is a well-known // symbol as EventTarget may be used cross-realm. See discussion in #33661. static [kIsEventTarget] = true; - [kEvents] = new Map(); + constructor() { + initEventTarget(this); + } [kNewListener](size, type, listener, once, capture, passive) {} [kRemoveListener](size, type, listener, capture) {} @@ -211,7 +220,8 @@ class EventTarget { const { once, capture, - passive + passive, + isNodeStyleListener } = validateEventListenerOptions(options); if (!shouldAddListener(listener)) { @@ -233,7 +243,7 @@ class EventTarget { if (root === undefined) { root = { size: 1, next: undefined }; // This is the first handler in our linked list. - new Listener(root, listener, once, capture, passive); + new Listener(root, listener, once, capture, passive, isNodeStyleListener); this[kNewListener](root.size, type, listener, once, capture, passive); this[kEvents].set(type, root); return; @@ -252,7 +262,8 @@ class EventTarget { return; } - new Listener(previous, listener, once, capture, passive); + new Listener(previous, listener, once, capture, passive, + isNodeStyleListener); root.size++; this[kNewListener](root.size, type, listener, once, capture, passive); } @@ -295,39 +306,61 @@ class EventTarget { if (event[kTarget] !== null) throw new ERR_EVENT_RECURSION(event.type); - const root = this[kEvents].get(event.type); + this[kHybridDispatch](event, event.type, event); + + return event.defaultPrevented !== true; + } + + [kHybridDispatch](nodeValue, type, event) { + const createEvent = () => { + if (event === undefined) { + event = this[kCreateEvent](nodeValue, type); + event[kTarget] = this; + } + return event; + }; + + const root = this[kEvents].get(type); if (root === undefined || root.next === undefined) return true; - event[kTarget] = this; + if (event !== undefined) + event[kTarget] = this; let handler = root.next; let next; while (handler !== undefined && - (handler.passive || event[kStop] !== true)) { + (handler.passive || event?.[kStop] !== true)) { // Cache the next item in case this iteration removes the current one next = handler.next; if (handler.once) { handler.remove(); root.size--; + const { listener, capture } = handler; + this[kRemoveListener](root.size, type, listener, capture); } try { - const result = handler.callback.call(this, event); + let arg; + if (handler.isNodeStyleListener) { + arg = nodeValue; + } else { + arg = createEvent(); + } + const result = handler.callback.call(this, arg); if (result !== undefined && result !== null) - addCatch(this, result, event); + addCatch(this, result, createEvent()); } catch (err) { - emitUnhandledRejectionOrErr(this, err, event); + emitUnhandledRejectionOrErr(this, err, createEvent()); } handler = next; } - event[kTarget] = undefined; - - return event.defaultPrevented !== true; + if (event !== undefined) + event[kTarget] = undefined; } [customInspectSymbol](depth, options) { @@ -355,17 +388,26 @@ Object.defineProperty(EventTarget.prototype, SymbolToStringTag, { value: 'EventTarget', }); +function initNodeEventTarget(self) { + initEventTarget(self); + // eslint-disable-next-line no-use-before-define + self[kMaxListeners] = NodeEventTarget.defaultMaxListeners; + self[kMaxListenersWarned] = false; +} + class NodeEventTarget extends EventTarget { static defaultMaxListeners = 10; - #maxListeners = NodeEventTarget.defaultMaxListeners; - #maxListenersWarned = false; + constructor() { + super(); + initNodeEventTarget(this); + } [kNewListener](size, type, listener, once, capture, passive) { - if (this.#maxListeners > 0 && - size > this.#maxListeners && - !this.#maxListenersWarned) { - this.#maxListenersWarned = true; + if (this[kMaxListeners] > 0 && + size > this[kMaxListeners] && + !this[kMaxListenersWarned]) { + this[kMaxListenersWarned] = true; // No error code for this since it is a Warning // eslint-disable-next-line no-restricted-syntax const w = new Error('Possible EventTarget memory leak detected. ' + @@ -382,12 +424,12 @@ class NodeEventTarget extends EventTarget { setMaxListeners(n) { validateInteger(n, 'n', 0); - this.#maxListeners = n; + this[kMaxListeners] = n; return this; } getMaxListeners() { - return this.#maxListeners; + return this[kMaxListeners]; } eventNames() { @@ -410,17 +452,18 @@ class NodeEventTarget extends EventTarget { } on(type, listener) { - this.addEventListener(type, listener); + this.addEventListener(type, listener, { [kIsNodeStyleListener]: true }); return this; } addListener(type, listener) { - this.addEventListener(type, listener); + this.addEventListener(type, listener, { [kIsNodeStyleListener]: true }); return this; } once(type, listener) { - this.addEventListener(type, listener, { once: true }); + this.addEventListener(type, listener, + { once: true, [kIsNodeStyleListener]: true }); return this; } @@ -470,6 +513,7 @@ function validateEventListenerOptions(options) { once: Boolean(options.once), capture: Boolean(options.capture), passive: Boolean(options.passive), + isNodeStyleListener: Boolean(options[kIsNodeStyleListener]) }; } @@ -520,4 +564,9 @@ module.exports = { EventTarget, NodeEventTarget, defineEventHandler, + initEventTarget, + initNodeEventTarget, + kCreateEvent, + kNewListener, + kRemoveListener, }; diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index d069f726db7795..9025850469de7a 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -542,7 +542,7 @@ const assertWithinRange = hideStackFrames( function toHeaderObject(headers) { const obj = ObjectCreate(null); - for (var n = 0; n < headers.length; n = n + 2) { + for (var n = 0; n < headers.length; n += 2) { const name = headers[n]; let value = headers[n + 1]; if (name === HTTP2_HEADER_STATUS) diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 1f672dd1ff2d4d..83a49599469b19 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -29,6 +29,7 @@ module.exports = { const { ArrayIsArray, + ArrayPrototypeJoin, Error, JSONParse, Map, @@ -408,7 +409,23 @@ function findLongestRegisteredExtension(filename) { return '.js'; } +function trySelfParentPath(parent) { + if (!parent) return false; + + if (parent.filename) { + return parent.filename; + } else if (parent.id === '' || parent.id === 'internal/preload') { + try { + return process.cwd() + path.sep; + } catch { + return false; + } + } +} + function trySelf(parentPath, request) { + if (!parentPath) return false; + const { data: pkg, path: basePath } = readPackageScope(parentPath) || {}; if (!pkg || pkg.exports === undefined) return false; if (typeof pkg.name !== 'string') return false; @@ -1039,13 +1056,16 @@ Module._resolveFilename = function(request, parent, isMain, options) { } } } - const filename = trySelf(parent.filename, request); - if (filename) { - const cacheKey = request + '\x00' + - (paths.length === 1 ? paths[0] : paths.join('\x00')); - Module._pathCache[cacheKey] = filename; - return filename; - } + } + + // Try module self resoultion first + const parentPath = trySelfParentPath(parent); + const selfResolved = trySelf(parentPath, request); + if (selfResolved) { + const cacheKey = request + '\x00' + + (paths.length === 1 ? paths[0] : ArrayPrototypeJoin(paths, '\x00')); + Module._pathCache[cacheKey] = selfResolved; + return selfResolved; } // Look up the filename first, since that's the cache key. diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index de08845a820d77..37191f65bf0b7e 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -1,5 +1,8 @@ 'use strict'; +// This is needed to avoid cycles in esm/resolve <-> cjs/loader +require('internal/modules/cjs/loader'); + const { FunctionPrototypeBind, ObjectSetPrototypeOf, diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index 16ca78880c7a15..7ea59f30c6894e 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -32,7 +32,6 @@ const { } = require('fs'); const { getOptionValue } = require('internal/options'); const { sep, relative } = require('path'); -const { Module: CJSModule } = require('internal/modules/cjs/loader'); const preserveSymlinks = getOptionValue('--preserve-symlinks'); const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main'); const typeFlag = getOptionValue('--input-type'); @@ -49,11 +48,13 @@ const { ERR_UNSUPPORTED_DIR_IMPORT, ERR_UNSUPPORTED_ESM_URL_SCHEME, } = require('internal/errors').codes; +const { Module: CJSModule } = require('internal/modules/cjs/loader'); const packageJsonReader = require('internal/modules/package_json_reader'); const DEFAULT_CONDITIONS = ObjectFreeze(['node', 'import']); const DEFAULT_CONDITIONS_SET = new SafeSet(DEFAULT_CONDITIONS); + function getConditionsSet(conditions) { if (conditions !== undefined && conditions !== DEFAULT_CONDITIONS) { if (!ArrayIsArray(conditions)) { diff --git a/lib/internal/net.js b/lib/internal/net.js index 4a9a156aeabf66..2df1d5d5f613d2 100644 --- a/lib/internal/net.js +++ b/lib/internal/net.js @@ -25,7 +25,7 @@ const IPv6Reg = new RegExp('^(' + `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` + `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` + `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` + -')(%[0-9a-zA-Z]{1,})?$'); +')(%[0-9a-zA-Z-.:]{1,})?$'); function isIPv4(s) { return IPv4Reg.test(s); diff --git a/lib/internal/per_context/messageport.js b/lib/internal/per_context/messageport.js index ee08a596122a51..43587319b040de 100644 --- a/lib/internal/per_context/messageport.js +++ b/lib/internal/per_context/messageport.js @@ -1,12 +1,31 @@ 'use strict'; +const { + SymbolFor, +} = primordials; + class MessageEvent { - constructor(data, target) { + constructor(data, target, type) { this.data = data; this.target = target; + this.type = type; } } -exports.emitMessage = function(data) { - if (typeof this.onmessage === 'function') - this.onmessage(new MessageEvent(data, this)); +const kHybridDispatch = SymbolFor('nodejs.internal.kHybridDispatch'); + +exports.emitMessage = function(data, type) { + if (typeof this[kHybridDispatch] === 'function') { + this[kHybridDispatch](data, type, undefined); + return; + } + + const event = new MessageEvent(data, this, type); + if (type === 'message') { + if (typeof this.onmessage === 'function') + this.onmessage(event); + } else { + // eslint-disable-next-line no-lonely-if + if (typeof this.onmessageerror === 'function') + this.onmessageerror(event); + } }; diff --git a/lib/internal/policy/sri.js b/lib/internal/policy/sri.js index c4b5e7f1ca209a..ddb06a2e1a6051 100644 --- a/lib/internal/policy/sri.js +++ b/lib/internal/policy/sri.js @@ -58,7 +58,7 @@ const parse = (str) => { options: match[4] === undefined ? null : match[4], }) }); - prevIndex = prevIndex + match[0].length; + prevIndex += match[0].length; } if (prevIndex !== str.length) { diff --git a/lib/internal/process/warning.js b/lib/internal/process/warning.js index ebf4c932fa9c57..877a58bbf53fa5 100644 --- a/lib/internal/process/warning.js +++ b/lib/internal/process/warning.js @@ -12,13 +12,21 @@ const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; let fs; let fd; let warningFile; +let options; function lazyOption() { // This will load `warningFile` only once. If the flag is not set, // `warningFile` will be set to an empty string. if (warningFile === undefined) { - warningFile = require('internal/options') - .getOptionValue('--redirect-warnings'); + options = require('internal/options'); + if (options.getOptionValue('--diagnostic-dir') !== '') { + warningFile = options.getOptionValue('--diagnostic-dir'); + } + if (options.getOptionValue('--redirect-warnings') !== '') { + warningFile = options.getOptionValue('--redirect-warnings'); + } else { + warningFile = ''; + } } return warningFile; } diff --git a/lib/internal/streams/end-of-stream.js b/lib/internal/streams/end-of-stream.js index bc2d0ccfcaf142..29c0171a4f2b1f 100644 --- a/lib/internal/streams/end-of-stream.js +++ b/lib/internal/streams/end-of-stream.js @@ -41,14 +41,14 @@ function isReadableEnded(stream) { return rState.endEmitted || (rState.ended && rState.length === 0); } -function eos(stream, opts, callback) { +function eos(stream, options, callback) { if (arguments.length === 2) { - callback = opts; - opts = {}; - } else if (opts == null) { - opts = {}; - } else if (typeof opts !== 'object') { - throw new ERR_INVALID_ARG_TYPE('opts', 'object', opts); + callback = options; + options = {}; + } else if (options == null) { + options = {}; + } else if (typeof options !== 'object') { + throw new ERR_INVALID_ARG_TYPE('options', 'object', options); } if (typeof callback !== 'function') { throw new ERR_INVALID_ARG_TYPE('callback', 'function', callback); @@ -56,10 +56,10 @@ function eos(stream, opts, callback) { callback = once(callback); - const readable = opts.readable || - (opts.readable !== false && isReadable(stream)); - const writable = opts.writable || - (opts.writable !== false && isWritable(stream)); + const readable = options.readable || + (options.readable !== false && isReadable(stream)); + const writable = options.writable || + (options.writable !== false && isWritable(stream)); const wState = stream._writableState; const rState = stream._readableState; @@ -144,7 +144,7 @@ function eos(stream, opts, callback) { stream.on('end', onend); stream.on('finish', onfinish); - if (opts.error !== false) stream.on('error', onerror); + if (options.error !== false) stream.on('error', onerror); stream.on('close', onclose); const closed = ( diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 824c5961e9512c..495271fa62eecb 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -1995,13 +1995,6 @@ function formatWithOptionsInternal(inspectOptions, ...args) { return str; } -function prepareStringForGetStringWidth(str, removeControlChars) { - str = str.normalize('NFC'); - if (removeControlChars) - str = stripVTControlCharacters(str); - return str; -} - if (internalBinding('config').hasIntl) { const icu = internalBinding('icu'); // icu.getStringWidth(string, ambiguousAsFullWidth, expandEmojiSequence) @@ -2012,13 +2005,14 @@ if (internalBinding('config').hasIntl) { getStringWidth = function getStringWidth(str, removeControlChars = true) { let width = 0; - str = prepareStringForGetStringWidth(str, removeControlChars); + if (removeControlChars) + str = stripVTControlCharacters(str); for (let i = 0; i < str.length; i++) { // Try to avoid calling into C++ by first handling the ASCII portion of // the string. If it is fully ASCII, we skip the C++ part. const code = str.charCodeAt(i); if (code >= 127) { - width += icu.getStringWidth(str.slice(i)); + width += icu.getStringWidth(str.slice(i).normalize('NFC')); break; } width += code >= 32 ? 1 : 0; @@ -2032,7 +2026,9 @@ if (internalBinding('config').hasIntl) { getStringWidth = function getStringWidth(str, removeControlChars = true) { let width = 0; - str = prepareStringForGetStringWidth(str, removeControlChars); + if (removeControlChars) + str = stripVTControlCharacters(str); + str = str.normalize('NFC'); for (const char of str) { const code = char.codePointAt(0); if (isFullWidthCodePoint(code)) { diff --git a/lib/internal/worker/io.js b/lib/internal/worker/io.js index 60dd8cd67d6186..5b5118a1d70b21 100644 --- a/lib/internal/worker/io.js +++ b/lib/internal/worker/io.js @@ -24,20 +24,23 @@ const { stopMessagePort } = internalBinding('messaging'); const { - threadId, getEnvMessagePort } = internalBinding('worker'); const { Readable, Writable } = require('stream'); -const EventEmitter = require('events'); +const { + Event, + NodeEventTarget, + defineEventHandler, + initNodeEventTarget, + kCreateEvent, + kNewListener, + kRemoveListener, +} = require('internal/event_target'); const { inspect } = require('internal/util/inspect'); -let debug = require('internal/util/debuglog').debuglog('worker', (fn) => { - debug = fn; -}); const kIncrementsPortRef = Symbol('kIncrementsPortRef'); const kName = Symbol('kName'); -const kOnMessageListener = Symbol('kOnMessageListener'); const kPort = Symbol('kPort'); const kWaitingStreams = Symbol('kWaitingStreams'); const kWritableCallbacks = Symbol('kWritableCallbacks'); @@ -54,7 +57,7 @@ const messageTypes = { }; // We have to mess with the MessagePort prototype a bit, so that a) we can make -// it inherit from EventEmitter, even though it is a C++ class, and b) we do +// it inherit from NodeEventTarget, even though it is a C++ class, and b) we do // not provide methods that are not present in the Browser and not documented // on our side (e.g. hasRef). // Save a copy of the original set of methods as a shallow clone. @@ -62,47 +65,39 @@ const MessagePortPrototype = ObjectCreate( ObjectGetPrototypeOf(MessagePort.prototype), ObjectGetOwnPropertyDescriptors(MessagePort.prototype)); // Set up the new inheritance chain. -ObjectSetPrototypeOf(MessagePort, EventEmitter); -ObjectSetPrototypeOf(MessagePort.prototype, EventEmitter.prototype); +ObjectSetPrototypeOf(MessagePort, NodeEventTarget); +ObjectSetPrototypeOf(MessagePort.prototype, NodeEventTarget.prototype); // Copy methods that are inherited from HandleWrap, because // changing the prototype of MessagePort.prototype implicitly removed them. MessagePort.prototype.ref = MessagePortPrototype.ref; MessagePort.prototype.unref = MessagePortPrototype.unref; -// A communication channel consisting of a handle (that wraps around an -// uv_async_t) which can receive information from other threads and emits -// .onmessage events, and a function used for sending data to a MessagePort -// in some other thread. -MessagePort.prototype[kOnMessageListener] = function onmessage(event) { - if (event.data && event.data.type !== messageTypes.STDIO_WANTS_MORE_DATA) - debug(`[${threadId}] received message`, event); - // Emit the deserialized object to userland. - this.emit('message', event.data); -}; - -// This is for compatibility with the Web's MessagePort API. It makes sense to -// provide it as an `EventEmitter` in Node.js, but if somebody overrides -// `onmessage`, we'll switch over to the Web API model. -ObjectDefineProperty(MessagePort.prototype, 'onmessage', { - enumerable: true, - configurable: true, - get() { - return this[kOnMessageListener]; - }, - set(value) { - this[kOnMessageListener] = value; - if (typeof value === 'function') { - this.ref(); - MessagePortPrototype.start.call(this); - } else { - this.unref(); - stopMessagePort(this); - } +class MessageEvent extends Event { + constructor(data, target, type) { + super(type); + this.data = data; } -}); +} + +ObjectDefineProperty( + MessagePort.prototype, + kCreateEvent, + { + value: function(data, type) { + return new MessageEvent(data, this, type); + }, + configurable: false, + writable: false, + enumerable: false, + }); // This is called from inside the `MessagePort` constructor. function oninit() { + initNodeEventTarget(this); + // TODO(addaleax): This should be on MessagePort.prototype, but + // defineEventHandler() does not support that. + defineEventHandler(this, 'message'); + defineEventHandler(this, 'messageerror'); setupPortReferencing(this, this, 'message'); } @@ -112,9 +107,15 @@ ObjectDefineProperty(MessagePort.prototype, onInitSymbol, { value: oninit }); +class MessagePortCloseEvent extends Event { + constructor() { + super('close'); + } +} + // This is called after the underlying `uv_async_t` has been closed. function onclose() { - this.emit('close'); + this.dispatchEvent(new MessagePortCloseEvent()); } ObjectDefineProperty(MessagePort.prototype, handleOnCloseSymbol, { @@ -156,18 +157,36 @@ function setupPortReferencing(port, eventEmitter, eventName) { // If there are none or all are removed, unref() the channel so the worker // can shutdown gracefully. port.unref(); - eventEmitter.on('newListener', (name) => { - if (name === eventName && eventEmitter.listenerCount(eventName) === 0) { + eventEmitter.on('newListener', function(name) { + if (name === eventName) newListener(eventEmitter.listenerCount(name)); + }); + eventEmitter.on('removeListener', function(name) { + if (name === eventName) removeListener(eventEmitter.listenerCount(name)); + }); + const origNewListener = eventEmitter[kNewListener]; + eventEmitter[kNewListener] = function(size, type, ...args) { + if (type === eventName) newListener(size - 1); + return origNewListener.call(this, size, type, ...args); + }; + const origRemoveListener = eventEmitter[kRemoveListener]; + eventEmitter[kRemoveListener] = function(size, type, ...args) { + if (type === eventName) removeListener(size); + return origRemoveListener.call(this, size, type, ...args); + }; + + function newListener(size) { + if (size === 0) { port.ref(); MessagePortPrototype.start.call(port); } - }); - eventEmitter.on('removeListener', (name) => { - if (name === eventName && eventEmitter.listenerCount(eventName) === 0) { + } + + function removeListener(size) { + if (size === 0) { stopMessagePort(port); port.unref(); } - }); + } } diff --git a/lib/zlib.js b/lib/zlib.js index 7cc8e2e6275041..829a472e35b6a4 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -659,18 +659,13 @@ function Zlib(opts, mode) { // to come up with a good solution that doesn't break our internal API, // and with it all supported npm versions at the time of writing. this._writeState = new Uint32Array(2); - if (!handle.init(windowBits, - level, - memLevel, - strategy, - this._writeState, - processCallback, - dictionary)) { - // TODO(addaleax): Sometimes we generate better error codes in C++ land, - // e.g. ERR_BROTLI_PARAM_SET_FAILED -- it's hard to access them with - // the current bindings setup, though. - throw new ERR_ZLIB_INITIALIZATION_FAILED(); - } + handle.init(windowBits, + level, + memLevel, + strategy, + this._writeState, + processCallback, + dictionary); ZlibBase.call(this, opts, mode, handle, zlibDefaultOpts); @@ -816,6 +811,9 @@ function Brotli(opts, mode) { new binding.BrotliDecoder(mode) : new binding.BrotliEncoder(mode); this._writeState = new Uint32Array(2); + // TODO(addaleax): Sometimes we generate better error codes in C++ land, + // e.g. ERR_BROTLI_PARAM_SET_FAILED -- it's hard to access them with + // the current bindings setup, though. if (!handle.init(brotliInitParamsArray, this._writeState, processCallback)) { diff --git a/onboarding.md b/onboarding.md index 31b8353ef41ec5..8ec268570e8a66 100644 --- a/onboarding.md +++ b/onboarding.md @@ -210,6 +210,9 @@ needs to be pointed out separately during the onboarding. * Run CI on the PR. Use the `node-test-pull-request` CI task. * After two Collaborator approvals for the change and two Collaborator approvals for fast-tracking, land the PR. +* Leave a comment in the PR: `Please 👍 this comment to approve fast-tracking`. +* If there are not enough approvals within a reasonable time, consider the + single approval of the onboarding TSC member sufficient, and land the PR. * Be sure to add the `PR-URL: ` and appropriate `Reviewed-By:` metadata. * [`node-core-utils`][] automates the generation of metadata and the landing diff --git a/src/api/environment.cc b/src/api/environment.cc index fdfd257aec12f5..a18c21fa797422 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -239,9 +239,11 @@ void SetIsolateMiscHandlers(v8::Isolate* isolate, const IsolateSettings& s) { s.allow_wasm_code_generation_callback : AllowWasmCodeGenerationCallback; isolate->SetAllowWasmCodeGenerationCallback(allow_wasm_codegen_cb); - auto* promise_reject_cb = s.promise_reject_callback ? - s.promise_reject_callback : task_queue::PromiseRejectCallback; - isolate->SetPromiseRejectCallback(promise_reject_cb); + if ((s.flags & SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK) == 0) { + auto* promise_reject_cb = s.promise_reject_callback ? + s.promise_reject_callback : task_queue::PromiseRejectCallback; + isolate->SetPromiseRejectCallback(promise_reject_cb); + } if (s.flags & DETAILED_SOURCE_POSITIONS_FOR_PROFILING) v8::CpuProfiler::UseDetailedSourcePositionsForProfiling(isolate); diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 09775db79a8d97..d206c33562470e 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -230,19 +230,18 @@ PromiseWrap* PromiseWrap::New(Environment* env, // Skip for init events if (silent) { - Local maybeAsyncId = promise + Local maybe_async_id = promise ->Get(context, env->async_id_symbol()) .ToLocalChecked(); - Local maybeTriggerAsyncId = promise + Local maybe_trigger_async_id = promise ->Get(context, env->trigger_async_id_symbol()) .ToLocalChecked(); - if (maybeAsyncId->IsNumber() && maybeTriggerAsyncId->IsNumber()) { - double asyncId = maybeAsyncId->NumberValue(context).ToChecked(); - double triggerAsyncId = maybeTriggerAsyncId->NumberValue(context) - .ToChecked(); - return new PromiseWrap(env, obj, asyncId, triggerAsyncId); + if (maybe_async_id->IsNumber() && maybe_trigger_async_id->IsNumber()) { + double async_id = maybe_async_id.As()->Value(); + double trigger_async_id = maybe_trigger_async_id.As()->Value(); + return new PromiseWrap(env, obj, async_id, trigger_async_id); } } @@ -319,6 +318,59 @@ static void FastPromiseHook(PromiseHookType type, Local promise, Environment* env = Environment::GetCurrent(context); if (env == nullptr) return; + if (type == PromiseHookType::kBefore && + env->async_hooks()->fields()[AsyncHooks::kBefore] == 0) { + Local maybe_async_id; + if (!promise->Get(context, env->async_id_symbol()) + .ToLocal(&maybe_async_id)) { + return; + } + + Local maybe_trigger_async_id; + if (!promise->Get(context, env->trigger_async_id_symbol()) + .ToLocal(&maybe_trigger_async_id)) { + return; + } + + if (maybe_async_id->IsNumber() && maybe_trigger_async_id->IsNumber()) { + double async_id = maybe_async_id.As()->Value(); + double trigger_async_id = maybe_trigger_async_id.As()->Value(); + env->async_hooks()->push_async_context( + async_id, trigger_async_id, promise); + } + + return; + } + + if (type == PromiseHookType::kAfter && + env->async_hooks()->fields()[AsyncHooks::kAfter] == 0) { + Local maybe_async_id; + if (!promise->Get(context, env->async_id_symbol()) + .ToLocal(&maybe_async_id)) { + return; + } + + if (maybe_async_id->IsNumber()) { + double async_id = maybe_async_id.As()->Value(); + if (env->execution_async_id() == async_id) { + // This condition might not be true if async_hooks was enabled during + // the promise callback execution. + env->async_hooks()->pop_async_context(async_id); + } + } + + return; + } + + if (type == PromiseHookType::kResolve && + env->async_hooks()->fields()[AsyncHooks::kPromiseResolve] == 0) { + return; + } + + // Getting up to this point means either init type or + // that there are active hooks of another type. + // In both cases fast-path JS hook should be called. + Local argv[] = { Integer::New(env->isolate(), ToAsyncHooksType(type)), promise, diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index f128a197ca9726..f8625ae866fe5f 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -917,13 +917,18 @@ void Agent::DisableAsyncHook() { void Agent::ToggleAsyncHook(Isolate* isolate, const Global& fn) { + // Guard against running this during cleanup -- no async events will be + // emitted anyway at that point anymore, and calling into JS is not possible. + // This should probably not be something we're attempting in the first place, + // Refs: https://github.com/nodejs/node/pull/34362#discussion_r456006039 + if (!parent_env_->can_call_into_js()) return; CHECK(parent_env_->has_run_bootstrapping_code()); HandleScope handle_scope(isolate); CHECK(!fn.IsEmpty()); auto context = parent_env_->context(); v8::TryCatch try_catch(isolate); USE(fn.Get(isolate)->Call(context, Undefined(isolate), 0, nullptr)); - if (try_catch.HasCaught()) { + if (try_catch.HasCaught() && !try_catch.HasTerminated()) { PrintCaughtException(isolate, context, try_catch); FatalError("\nnode::inspector::Agent::ToggleAsyncHook", "Cannot toggle Inspector's AsyncHook, please report this."); diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index daad1907349d63..e99333a6a362d1 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -267,13 +267,7 @@ class RefBase : protected Finalizer, RefTracker { protected: inline void Finalize(bool is_env_teardown = false) override { if (_finalize_callback != nullptr) { - v8::HandleScope handle_scope(_env->isolate); - _env->CallIntoModule([&](napi_env env) { - _finalize_callback( - env, - _finalize_data, - _finalize_hint); - }); + _env->CallFinalizer(_finalize_callback, _finalize_data, _finalize_hint); } // this is safe because if a request to delete the reference diff --git a/src/js_native_api_v8.h b/src/js_native_api_v8.h index 9c737f3c9cc9fc..83e6a0bd02e23c 100644 --- a/src/js_native_api_v8.h +++ b/src/js_native_api_v8.h @@ -101,6 +101,13 @@ struct napi_env__ { } } + virtual void CallFinalizer(napi_finalize cb, void* data, void* hint) { + v8::HandleScope handle_scope(isolate); + CallIntoModule([&](napi_env env) { + cb(env, data, hint); + }); + } + v8impl::Persistent last_exception; // We store references in two different lists, depending on whether they have diff --git a/src/memory_tracker-inl.h b/src/memory_tracker-inl.h index 9e6201442ab6b1..4167064847253e 100644 --- a/src/memory_tracker-inl.h +++ b/src/memory_tracker-inl.h @@ -131,7 +131,7 @@ template void MemoryTracker::TrackField(const char* edge_name, const BaseObjectPtrImpl& value, const char* node_name) { - if (value.get() == nullptr) return; + if (value.get() == nullptr || kIsWeak) return; TrackField(edge_name, value.get(), node_name); } @@ -214,6 +214,7 @@ template void MemoryTracker::TrackField(const char* edge_name, const v8::PersistentBase& value, const char* node_name) { + if (value.IsWeak()) return; TrackField(edge_name, value.Get(isolate_)); } diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 825afea7b12c8b..f778b089dc4009 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -55,9 +55,13 @@ ModuleWrap::ModuleWrap(Environment* env, Local url) : BaseObject(env, object), module_(env->isolate(), module), - url_(env->isolate(), url), id_(env->get_next_module_id()) { env->id_to_module_map.emplace(id_, this); + + Local undefined = Undefined(env->isolate()); + object->SetInternalField(kURLSlot, url); + object->SetInternalField(kSyntheticEvaluationStepsSlot, undefined); + object->SetInternalField(kContextObjectSlot, undefined); } ModuleWrap::~ModuleWrap() { @@ -73,6 +77,12 @@ ModuleWrap::~ModuleWrap() { } } +Local ModuleWrap::context() const { + Local obj = object()->GetInternalField(kContextObjectSlot); + if (obj.IsEmpty()) return {}; + return obj.As()->CreationContext(); +} + ModuleWrap* ModuleWrap::GetFromModule(Environment* env, Local module) { auto range = env->hash_to_module_map.equal_range(module->GetIdentityHash()); @@ -220,11 +230,14 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { if (synthetic) { obj->synthetic_ = true; - obj->synthetic_evaluation_steps_.Reset( - env->isolate(), args[3].As()); + obj->object()->SetInternalField(kSyntheticEvaluationStepsSlot, args[3]); } - obj->context_.Reset(isolate, context); + // Use the extras object as an object whose CreationContext() will be the + // original `context`, since the `Context` itself strictly speaking cannot + // be stored in an internal field. + obj->object()->SetInternalField(kContextObjectSlot, + context->GetExtrasBindingObject()); obj->contextify_context_ = contextify_context; env->hash_to_module_map.emplace(module->GetIdentityHash(), obj); @@ -254,7 +267,7 @@ void ModuleWrap::Link(const FunctionCallbackInfo& args) { Local resolver_arg = args[0].As(); - Local mod_context = obj->context_.Get(isolate); + Local mod_context = obj->context(); Local module = obj->module_.Get(isolate); const int module_requests_length = module->GetModuleRequestsLength(); @@ -295,7 +308,7 @@ void ModuleWrap::Instantiate(const FunctionCallbackInfo& args) { Isolate* isolate = args.GetIsolate(); ModuleWrap* obj; ASSIGN_OR_RETURN_UNWRAP(&obj, args.This()); - Local context = obj->context_.Get(isolate); + Local context = obj->context(); Local module = obj->module_.Get(isolate); TryCatchScope try_catch(env); USE(module->InstantiateModule(context, ResolveCallback)); @@ -318,7 +331,7 @@ void ModuleWrap::Evaluate(const FunctionCallbackInfo& args) { Isolate* isolate = env->isolate(); ModuleWrap* obj; ASSIGN_OR_RETURN_UNWRAP(&obj, args.This()); - Local context = obj->context_.Get(isolate); + Local context = obj->context(); Local module = obj->module_.Get(isolate); ContextifyContext* contextify_context = obj->contextify_context_; @@ -636,8 +649,10 @@ MaybeLocal ModuleWrap::SyntheticModuleEvaluationStepsCallback( TryCatchScope try_catch(env); Local synthetic_evaluation_steps = - obj->synthetic_evaluation_steps_.Get(isolate); - obj->synthetic_evaluation_steps_.Reset(); + obj->object()->GetInternalField(kSyntheticEvaluationStepsSlot) + .As(); + obj->object()->SetInternalField( + kSyntheticEvaluationStepsSlot, Undefined(isolate)); MaybeLocal ret = synthetic_evaluation_steps->Call(context, obj->object(), 0, nullptr); if (ret.IsEmpty()) { diff --git a/src/module_wrap.h b/src/module_wrap.h index 2b490fc41374b6..3d8bb57750397f 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h @@ -32,6 +32,14 @@ enum HostDefinedOptions : int { class ModuleWrap : public BaseObject { public: + enum InternalFields { + kModuleWrapBaseField = BaseObject::kInternalFieldCount, + kURLSlot, + kSyntheticEvaluationStepsSlot, + kContextObjectSlot, // Object whose creation context is the target Context + kInternalFieldCount + }; + static void Initialize(v8::Local target, v8::Local unused, v8::Local context, @@ -42,11 +50,11 @@ class ModuleWrap : public BaseObject { v8::Local meta); void MemoryInfo(MemoryTracker* tracker) const override { - tracker->TrackField("url", url_); tracker->TrackField("resolve_cache", resolve_cache_); } inline uint32_t id() { return id_; } + v8::Local context() const; static ModuleWrap* GetFromID(node::Environment*, uint32_t id); SET_MEMORY_INFO_NAME(ModuleWrap) @@ -85,11 +93,8 @@ class ModuleWrap : public BaseObject { v8::Local referrer); static ModuleWrap* GetFromModule(node::Environment*, v8::Local); - v8::Global synthetic_evaluation_steps_; v8::Global module_; - v8::Global url_; std::unordered_map> resolve_cache_; - v8::Global context_; contextify::ContextifyContext* contextify_context_ = nullptr; bool synthetic_ = false; bool linked_ = false; diff --git a/src/node.h b/src/node.h index 25f9f9b873cee3..71273d6db9c6ed 100644 --- a/src/node.h +++ b/src/node.h @@ -333,7 +333,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { enum IsolateSettingsFlags { MESSAGE_LISTENER_WITH_ERROR_LEVEL = 1 << 0, - DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1 + DETAILED_SOURCE_POSITIONS_FOR_PROFILING = 1 << 1, + SHOULD_NOT_SET_PROMISE_REJECTION_CALLBACK = 1 << 2 }; struct IsolateSettings { diff --git a/src/node_api.cc b/src/node_api.cc index 314e2c57a0493f..bb203fc03c310f 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -32,6 +32,17 @@ struct node_napi_env__ : public napi_env__ { node_env()->untransferable_object_private_symbol(), v8::True(isolate)); } + + void CallFinalizer(napi_finalize cb, void* data, void* hint) override { + napi_env env = static_cast(this); + node_env()->SetImmediate([=](node::Environment* node_env) { + v8::HandleScope handle_scope(env->isolate); + v8::Context::Scope context_scope(env->context()); + env->CallIntoModule([&](napi_env env) { + cb(env, data, hint); + }); + }); + } }; typedef node_napi_env__* node_napi_env; diff --git a/src/node_crypto.cc b/src/node_crypto.cc index dfc21ae6876105..00f24cd9aa21e2 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -572,73 +572,65 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { // are still accepted. They are OpenSSL's way of saying that all known // protocols below TLS 1.3 are supported unless explicitly disabled (which // we do below for SSLv2 and SSLv3.) - if (strcmp(*sslmethod, "SSLv2_method") == 0) { + if (sslmethod == "SSLv2_method" || + sslmethod == "SSLv2_server_method" || + sslmethod == "SSLv2_client_method") { THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv2 methods disabled"); return; - } else if (strcmp(*sslmethod, "SSLv2_server_method") == 0) { - THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv2 methods disabled"); - return; - } else if (strcmp(*sslmethod, "SSLv2_client_method") == 0) { - THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv2 methods disabled"); - return; - } else if (strcmp(*sslmethod, "SSLv3_method") == 0) { - THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv3 methods disabled"); - return; - } else if (strcmp(*sslmethod, "SSLv3_server_method") == 0) { + } else if (sslmethod == "SSLv3_method" || + sslmethod == "SSLv3_server_method" || + sslmethod == "SSLv3_client_method") { THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv3 methods disabled"); return; - } else if (strcmp(*sslmethod, "SSLv3_client_method") == 0) { - THROW_ERR_TLS_INVALID_PROTOCOL_METHOD(env, "SSLv3 methods disabled"); - return; - } else if (strcmp(*sslmethod, "SSLv23_method") == 0) { + } else if (sslmethod == "SSLv23_method") { max_version = TLS1_2_VERSION; - } else if (strcmp(*sslmethod, "SSLv23_server_method") == 0) { + } else if (sslmethod == "SSLv23_server_method") { max_version = TLS1_2_VERSION; method = TLS_server_method(); - } else if (strcmp(*sslmethod, "SSLv23_client_method") == 0) { + } else if (sslmethod == "SSLv23_client_method") { max_version = TLS1_2_VERSION; method = TLS_client_method(); - } else if (strcmp(*sslmethod, "TLS_method") == 0) { + } else if (sslmethod == "TLS_method") { min_version = 0; max_version = MAX_SUPPORTED_VERSION; - } else if (strcmp(*sslmethod, "TLS_server_method") == 0) { + } else if (sslmethod == "TLS_server_method") { min_version = 0; max_version = MAX_SUPPORTED_VERSION; method = TLS_server_method(); - } else if (strcmp(*sslmethod, "TLS_client_method") == 0) { + } else if (sslmethod == "TLS_client_method") { min_version = 0; max_version = MAX_SUPPORTED_VERSION; method = TLS_client_method(); - } else if (strcmp(*sslmethod, "TLSv1_method") == 0) { + } else if (sslmethod == "TLSv1_method") { min_version = TLS1_VERSION; max_version = TLS1_VERSION; - } else if (strcmp(*sslmethod, "TLSv1_server_method") == 0) { + } else if (sslmethod == "TLSv1_server_method") { min_version = TLS1_VERSION; max_version = TLS1_VERSION; method = TLS_server_method(); - } else if (strcmp(*sslmethod, "TLSv1_client_method") == 0) { + } else if (sslmethod == "TLSv1_client_method") { min_version = TLS1_VERSION; max_version = TLS1_VERSION; method = TLS_client_method(); - } else if (strcmp(*sslmethod, "TLSv1_1_method") == 0) { + } else if (sslmethod == "TLSv1_1_method") { min_version = TLS1_1_VERSION; max_version = TLS1_1_VERSION; - } else if (strcmp(*sslmethod, "TLSv1_1_server_method") == 0) { + } else if (sslmethod == "TLSv1_1_server_method") { min_version = TLS1_1_VERSION; max_version = TLS1_1_VERSION; method = TLS_server_method(); - } else if (strcmp(*sslmethod, "TLSv1_1_client_method") == 0) { + } else if (sslmethod == "TLSv1_1_client_method") { min_version = TLS1_1_VERSION; max_version = TLS1_1_VERSION; method = TLS_client_method(); - } else if (strcmp(*sslmethod, "TLSv1_2_method") == 0) { + } else if (sslmethod == "TLSv1_2_method") { min_version = TLS1_2_VERSION; max_version = TLS1_2_VERSION; - } else if (strcmp(*sslmethod, "TLSv1_2_server_method") == 0) { + } else if (sslmethod == "TLSv1_2_server_method") { min_version = TLS1_2_VERSION; max_version = TLS1_2_VERSION; method = TLS_server_method(); - } else if (strcmp(*sslmethod, "TLSv1_2_client_method") == 0) { + } else if (sslmethod == "TLSv1_2_client_method") { min_version = TLS1_2_VERSION; max_version = TLS1_2_VERSION; method = TLS_client_method(); @@ -1756,9 +1748,7 @@ void SSLWrap::AddMethods(Environment* env, Local t) { GetEphemeralKeyInfo); env->SetProtoMethodNoSideEffect(t, "getProtocol", GetProtocol); -#ifdef SSL_set_max_send_fragment env->SetProtoMethod(t, "setMaxSendFragment", SetMaxSendFragment); -#endif // SSL_set_max_send_fragment env->SetProtoMethodNoSideEffect(t, "getALPNNegotiatedProtocol", GetALPNNegotiatedProto); @@ -2117,8 +2107,6 @@ void SSLWrap::GetEphemeralKeyInfo( // ERR_get_error()) } - -#ifdef SSL_set_max_send_fragment template void SSLWrap::SetMaxSendFragment( const FunctionCallbackInfo& args) { @@ -2132,7 +2120,6 @@ void SSLWrap::SetMaxSendFragment( args[0]->Int32Value(w->ssl_env()->context()).FromJust()); args.GetReturnValue().Set(rv); } -#endif // SSL_set_max_send_fragment template @@ -2495,10 +2482,6 @@ void SSLWrap::CertCbDone(const FunctionCallbackInfo& args) { env->sni_context_string()).ToLocalChecked(); Local cons = env->secure_context_constructor_template(); - // Not an object, probably undefined or null - if (!ctx->IsObject()) - goto fire_cb; - if (cons->HasInstance(ctx)) { SecureContext* sc = Unwrap(ctx.As()); CHECK_NOT_NULL(sc); @@ -2511,14 +2494,13 @@ void SSLWrap::CertCbDone(const FunctionCallbackInfo& args) { unsigned long err = ERR_get_error(); // NOLINT(runtime/int) return ThrowCryptoError(env, err, "CertCbDone"); } - } else { + } else if (ctx->IsObject()) { // Failure: incorrect SNI context object Local err = Exception::TypeError(env->sni_context_err_string()); w->MakeCallback(env->onerror_string(), 1, &err); return; } - fire_cb: CertCb cb; void* arg; diff --git a/src/node_file.cc b/src/node_file.cc index 3e1cecdadc167a..4c368abb064fe1 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1645,7 +1645,7 @@ static void ReadDir(const FunctionCallbackInfo& args) { std::vector> name_v; std::vector> type_v; - for (int i = 0; ; i++) { + for (;;) { uv_dirent_t ent; r = uv_fs_scandir_next(&(req_wrap_sync.req), &ent); diff --git a/src/node_http2.cc b/src/node_http2.cc index 3227ae66a2dead..a7cdb77b8c07a8 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -1754,7 +1754,10 @@ void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf_) { statistics_.data_received += nread; - if (UNLIKELY(stream_buf_offset_ > 0)) { + if (LIKELY(stream_buf_offset_ == 0)) { + // Shrink to the actual amount of used data. + buf.Resize(nread); + } else { // This is a very unlikely case, and should only happen if the ReadStart() // call in OnStreamAfterWrite() immediately provides data. If that does // happen, we concatenate the data we received with the already-stored @@ -1775,8 +1778,6 @@ void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf_) { DecrementCurrentSessionMemory(stream_buf_.len); } - // Shrink to the actual amount of used data. - buf.Resize(nread); IncrementCurrentSessionMemory(nread); // Remember the current buffer, so that OnDataChunkReceived knows the diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 91927ebbd9ebb1..55f7b0b2cbfeca 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -747,6 +747,8 @@ void MessagePort::OnMessage() { Local payload; Local message_error; + Local argv[2]; + { // Catch any exceptions from parsing the message itself (not from // emitting it) as 'messageeror' events. @@ -765,16 +767,15 @@ void MessagePort::OnMessage() { continue; } - if (MakeCallback(emit_message, 1, &payload).IsEmpty()) { + argv[0] = payload; + argv[1] = env()->message_string(); + + if (MakeCallback(emit_message, arraysize(argv), argv).IsEmpty()) { reschedule: if (!message_error.IsEmpty()) { - // This should become a `messageerror` event in the sense of the - // EventTarget API at some point. - Local argv[] = { - env()->messageerror_string(), - message_error - }; - USE(MakeCallback(env()->emit_string(), arraysize(argv), argv)); + argv[0] = message_error; + argv[1] = env()->messageerror_string(); + USE(MakeCallback(emit_message, arraysize(argv), argv)); } // Re-schedule OnMessage() execution in case of failure. diff --git a/src/node_options.cc b/src/node_options.cc index 066f6dfdaabb5a..14689db81dc73a 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -146,6 +146,10 @@ void EnvironmentOptions::CheckOptions(std::vector* errors) { } } + if (cpu_prof && cpu_prof_dir.empty() && !diagnostic_dir.empty()) { + cpu_prof_dir = diagnostic_dir; + } + if (!heap_prof) { if (!heap_prof_name.empty()) { errors->push_back("--heap-prof-name must be used with --heap-prof"); @@ -159,6 +163,11 @@ void EnvironmentOptions::CheckOptions(std::vector* errors) { errors->push_back("--heap-prof-interval must be used with --heap-prof"); } } + + if (heap_prof && heap_prof_dir.empty() && !diagnostic_dir.empty()) { + heap_prof_dir = diagnostic_dir; + } + debug_options_.CheckOptions(errors); #endif // HAVE_INSPECTOR } @@ -272,6 +281,11 @@ DebugOptionsParser::DebugOptionsParser() { } EnvironmentOptionsParser::EnvironmentOptionsParser() { + AddOption("--diagnostic-dir", + "set dir for all output files" + " (default: current working directory)", + &EnvironmentOptions::diagnostic_dir, + kAllowedInEnvironment); AddOption("--enable-source-maps", "experimental Source Map V3 support", &EnvironmentOptions::enable_source_maps, diff --git a/src/node_options.h b/src/node_options.h index 54710e487701dd..7f8c223f755a24 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -138,6 +138,7 @@ class EnvironmentOptions : public Options { bool heap_prof = false; #endif // HAVE_INSPECTOR std::string redirect_warnings; + std::string diagnostic_dir; bool test_udp_no_try_send = false; bool throw_deprecation = false; bool trace_atomics_wait = false; diff --git a/src/node_version.h b/src/node_version.h index 0a5843f8ca4bdd..9a54a88c985850 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -23,13 +23,13 @@ #define SRC_NODE_VERSION_H_ #define NODE_MAJOR_VERSION 14 -#define NODE_MINOR_VERSION 6 -#define NODE_PATCH_VERSION 1 +#define NODE_MINOR_VERSION 7 +#define NODE_PATCH_VERSION 0 #define NODE_VERSION_IS_LTS 0 #define NODE_VERSION_LTS_CODENAME "" -#define NODE_VERSION_IS_RELEASE 0 +#define NODE_VERSION_IS_RELEASE 1 #ifndef NODE_STRINGIFY #define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n) diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 85e87327c07797..efb11debf8f40d 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -139,8 +139,8 @@ class ZlibContext : public MemoryRetainer { CompressionError ResetStream(); // Zlib-specific: - CompressionError Init(int level, int window_bits, int mem_level, int strategy, - std::vector&& dictionary); + void Init(int level, int window_bits, int mem_level, int strategy, + std::vector&& dictionary); void SetAllocationFunctions(alloc_func alloc, free_func free, void* opaque); CompressionError SetParams(int level, int strategy); @@ -157,7 +157,10 @@ class ZlibContext : public MemoryRetainer { private: CompressionError ErrorForMessage(const char* message) const; CompressionError SetDictionary(); + bool InitZlib(); + Mutex mutex_; // Protects zlib_init_done_. + bool zlib_init_done_ = false; int err_ = 0; int flush_ = 0; int level_ = 0; @@ -615,13 +618,8 @@ class ZlibStream : public CompressionStream { AllocScope alloc_scope(wrap); wrap->context()->SetAllocationFunctions( AllocForZlib, FreeForZlib, static_cast(wrap)); - const CompressionError err = - wrap->context()->Init(level, window_bits, mem_level, strategy, - std::move(dictionary)); - if (err.IsError()) - wrap->EmitError(err); - - return args.GetReturnValue().Set(!err.IsError()); + wrap->context()->Init(level, window_bits, mem_level, strategy, + std::move(dictionary)); } static void Params(const FunctionCallbackInfo& args) { @@ -724,6 +722,15 @@ using BrotliEncoderStream = BrotliCompressionStream; using BrotliDecoderStream = BrotliCompressionStream; void ZlibContext::Close() { + { + Mutex::ScopedLock lock(mutex_); + if (!zlib_init_done_) { + dictionary_.clear(); + mode_ = NONE; + return; + } + } + CHECK_LE(mode_, UNZIP); int status = Z_OK; @@ -742,6 +749,11 @@ void ZlibContext::Close() { void ZlibContext::DoThreadPoolWork() { + bool first_init_call = InitZlib(); + if (first_init_call && err_ != Z_OK) { + return; + } + const Bytef* next_expected_header_byte = nullptr; // If the avail_out is left at 0, then it means that it ran out @@ -897,6 +909,11 @@ CompressionError ZlibContext::GetErrorInfo() const { CompressionError ZlibContext::ResetStream() { + bool first_init_call = InitZlib(); + if (first_init_call && err_ != Z_OK) { + return ErrorForMessage("Failed to init stream before reset"); + } + err_ = Z_OK; switch (mode_) { @@ -930,7 +947,7 @@ void ZlibContext::SetAllocationFunctions(alloc_func alloc, } -CompressionError ZlibContext::Init( +void ZlibContext::Init( int level, int window_bits, int mem_level, int strategy, std::vector&& dictionary) { if (!((window_bits == 0) && @@ -974,6 +991,15 @@ CompressionError ZlibContext::Init( window_bits_ *= -1; } + dictionary_ = std::move(dictionary); +} + +bool ZlibContext::InitZlib() { + Mutex::ScopedLock lock(mutex_); + if (zlib_init_done_) { + return false; + } + switch (mode_) { case DEFLATE: case GZIP: @@ -995,15 +1021,15 @@ CompressionError ZlibContext::Init( UNREACHABLE(); } - dictionary_ = std::move(dictionary); - if (err_ != Z_OK) { dictionary_.clear(); mode_ = NONE; - return ErrorForMessage("zlib error"); + return true; } - return SetDictionary(); + SetDictionary(); + zlib_init_done_ = true; + return true; } @@ -1040,6 +1066,11 @@ CompressionError ZlibContext::SetDictionary() { CompressionError ZlibContext::SetParams(int level, int strategy) { + bool first_init_call = InitZlib(); + if (first_init_call && err_ != Z_OK) { + return ErrorForMessage("Failed to init stream before set parameters"); + } + err_ = Z_OK; switch (mode_) { diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index ef1b80939e91f9..fa45bd118d4724 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -337,9 +337,10 @@ Local AddressToJS(Environment* env, const sockaddr* addr, Local info) { EscapableHandleScope scope(env->isolate()); - char ip[INET6_ADDRSTRLEN]; + char ip[INET6_ADDRSTRLEN + UV_IF_NAMESIZE]; const sockaddr_in* a4; const sockaddr_in6* a6; + int port; if (info.IsEmpty()) @@ -349,6 +350,18 @@ Local AddressToJS(Environment* env, case AF_INET6: a6 = reinterpret_cast(addr); uv_inet_ntop(AF_INET6, &a6->sin6_addr, ip, sizeof ip); + // Add an interface identifier to a link local address. + if (IN6_IS_ADDR_LINKLOCAL(&a6->sin6_addr)) { + const size_t addrlen = strlen(ip); + CHECK_LT(addrlen, sizeof(ip)); + ip[addrlen] = '%'; + size_t scopeidlen = sizeof(ip) - addrlen - 1; + CHECK_GE(scopeidlen, UV_IF_NAMESIZE); + const int r = uv_if_indextoiid(a6->sin6_scope_id, + ip + addrlen + 1, + &scopeidlen); + CHECK_EQ(r, 0); + } port = ntohs(a6->sin6_port); info->Set(env->context(), env->address_string(), diff --git a/src/util.h b/src/util.h index dc0d97f1df7dd2..a50cc1cf23b8a3 100644 --- a/src/util.h +++ b/src/util.h @@ -486,6 +486,10 @@ class Utf8Value : public MaybeStackBuffer { explicit Utf8Value(v8::Isolate* isolate, v8::Local value); inline std::string ToString() const { return std::string(out(), length()); } + + inline bool operator==(const char* a) const { + return strcmp(out(), a) == 0; + } }; class TwoByteValue : public MaybeStackBuffer { diff --git a/test/benchmark/benchmark.status b/test/benchmark/benchmark.status index 6a966743aab26b..0db4181af0d760 100644 --- a/test/benchmark/benchmark.status +++ b/test/benchmark/benchmark.status @@ -19,3 +19,7 @@ prefix benchmark [$system==aix] [$arch==arm] +# https://github.com/nodejs/node/issues/34266 +test-benchmark-fs: SKIP +# https://github.com/nodejs/build/issues/2382 +test-benchmark-napi: SKIP diff --git a/test/common/index.js b/test/common/index.js index 6d191409ad4d7f..00341e320c5843 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -662,6 +662,30 @@ function skipIfDumbTerminal() { } } +function gcUntil(name, condition) { + if (typeof name === 'function') { + condition = name; + name = undefined; + } + return new Promise((resolve, reject) => { + let count = 0; + function gcAndCheck() { + setImmediate(() => { + count++; + global.gc(); + if (condition()) { + resolve(); + } else if (count < 10) { + gcAndCheck(); + } else { + reject(name === undefined ? undefined : 'Test ' + name + ' failed'); + } + }); + } + gcAndCheck(); + }); +} + const common = { allowGlobals, buildType, @@ -671,6 +695,7 @@ const common = { disableCrashOnUnhandledRejection, expectsError, expectWarning, + gcUntil, getArrayBufferViews, getBufferSources, getCallSite, @@ -773,8 +798,6 @@ const common = { return localhostIPv4; }, - get localhostIPv6() { return '::1'; }, - // opensslCli defined lazily to reduce overhead of spawnSync get opensslCli() { if (opensslCli !== null) return opensslCli; diff --git a/test/fixtures/self_ref_module/index.js b/test/fixtures/self_ref_module/index.js new file mode 100644 index 00000000000000..7faa73693b54aa --- /dev/null +++ b/test/fixtures/self_ref_module/index.js @@ -0,0 +1,4 @@ +'use strict' + +module.exports = 'Self resolution working'; + diff --git a/test/fixtures/self_ref_module/package.json b/test/fixtures/self_ref_module/package.json new file mode 100644 index 00000000000000..7280b184c71357 --- /dev/null +++ b/test/fixtures/self_ref_module/package.json @@ -0,0 +1,13 @@ +{ + "name": "self_ref", + "version": "1.0.0", + "description": "", + "main": "index.js", + "exports": "./index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/test/js-native-api/7_factory_wrap/test.js b/test/js-native-api/7_factory_wrap/test.js index 8aaf1b0ba91ee7..ff1516eaa5a092 100644 --- a/test/js-native-api/7_factory_wrap/test.js +++ b/test/js-native-api/7_factory_wrap/test.js @@ -6,20 +6,21 @@ const assert = require('assert'); const test = require(`./build/${common.buildType}/binding`); assert.strictEqual(test.finalizeCount, 0); -(() => { - const obj = test.createObject(10); - assert.strictEqual(obj.plusOne(), 11); - assert.strictEqual(obj.plusOne(), 12); - assert.strictEqual(obj.plusOne(), 13); -})(); -global.gc(); -assert.strictEqual(test.finalizeCount, 1); +async function runGCTests() { + (() => { + const obj = test.createObject(10); + assert.strictEqual(obj.plusOne(), 11); + assert.strictEqual(obj.plusOne(), 12); + assert.strictEqual(obj.plusOne(), 13); + })(); + await common.gcUntil('test 1', () => (test.finalizeCount === 1)); -(() => { - const obj2 = test.createObject(20); - assert.strictEqual(obj2.plusOne(), 21); - assert.strictEqual(obj2.plusOne(), 22); - assert.strictEqual(obj2.plusOne(), 23); -})(); -global.gc(); -assert.strictEqual(test.finalizeCount, 2); + (() => { + const obj2 = test.createObject(20); + assert.strictEqual(obj2.plusOne(), 21); + assert.strictEqual(obj2.plusOne(), 22); + assert.strictEqual(obj2.plusOne(), 23); + })(); + await common.gcUntil('test 2', () => (test.finalizeCount === 2)); +} +runGCTests(); diff --git a/test/js-native-api/8_passing_wrapped/test.js b/test/js-native-api/8_passing_wrapped/test.js index 525993c96d3bad..54c829d9c77dff 100644 --- a/test/js-native-api/8_passing_wrapped/test.js +++ b/test/js-native-api/8_passing_wrapped/test.js @@ -5,13 +5,16 @@ const common = require('../../common'); const assert = require('assert'); const addon = require(`./build/${common.buildType}/binding`); -let obj1 = addon.createObject(10); -let obj2 = addon.createObject(20); -const result = addon.add(obj1, obj2); -assert.strictEqual(result, 30); +async function runTest() { + let obj1 = addon.createObject(10); + let obj2 = addon.createObject(20); + const result = addon.add(obj1, obj2); + assert.strictEqual(result, 30); -// Make sure the native destructor gets called. -obj1 = null; -obj2 = null; -global.gc(); -assert.strictEqual(addon.finalizeCount(), 2); + // Make sure the native destructor gets called. + obj1 = null; + obj2 = null; + await common.gcUntil('8_passing_wrapped', + () => (addon.finalizeCount() === 2)); +} +runTest(); diff --git a/test/js-native-api/test_exception/test.js b/test/js-native-api/test_exception/test.js index 6ec878453f0c22..ff11b702198b88 100644 --- a/test/js-native-api/test_exception/test.js +++ b/test/js-native-api/test_exception/test.js @@ -66,14 +66,3 @@ const test_exception = (function() { 'Exception state did not remain clear as expected,' + ` .wasPending() returned ${exception_pending}`); } - -// Make sure that exceptions that occur during finalization are propagated. -function testFinalize(binding) { - let x = test_exception[binding](); - x = null; - assert.throws(() => { global.gc(); }, /Error during Finalize/); - - // To assuage the linter's concerns. - (function() {})(x); -} -testFinalize('createExternal'); diff --git a/test/js-native-api/test_exception/testFinalizerException.js b/test/js-native-api/test_exception/testFinalizerException.js new file mode 100644 index 00000000000000..1ba74ba4802a0f --- /dev/null +++ b/test/js-native-api/test_exception/testFinalizerException.js @@ -0,0 +1,32 @@ +'use strict'; +if (process.argv[2] === 'child') { + const common = require('../../common'); + // Trying, catching the exception, and finding the bindings at the `Error`'s + // `binding` property is done intentionally, because we're also testing what + // happens when the add-on entry point throws. See test.js. + try { + require(`./build/${common.buildType}/test_exception`); + } catch (anException) { + anException.binding.createExternal(); + } + + // Collect garbage 10 times. At least one of those should throw the exception + // and cause the whole process to bail with it, its text printed to stderr and + // asserted by the parent process to match expectations. + let gcCount = 10; + (function gcLoop() { + global.gc(); + if (--gcCount > 0) { + setImmediate(() => gcLoop()); + } + })(); + return; +} + +const assert = require('assert'); +const { spawnSync } = require('child_process'); +const child = spawnSync(process.execPath, [ + '--expose-gc', __filename, 'child' +]); +assert.strictEqual(child.signal, null); +assert.match(child.stderr.toString(), /Error during Finalize/m); diff --git a/test/js-native-api/test_general/test.js b/test/js-native-api/test_general/test.js index aa3a4eedc56634..de06aecb590529 100644 --- a/test/js-native-api/test_general/test.js +++ b/test/js-native-api/test_general/test.js @@ -51,24 +51,13 @@ assert.strictEqual(test_general.testGetVersion(), 6); // for null assert.strictEqual(test_general.testNapiTypeof(null), 'null'); -// Ensure that garbage collecting an object with a wrapped native item results -// in the finalize callback being called. -let w = {}; -test_general.wrap(w); -w = null; -global.gc(); -const derefItemWasCalled = test_general.derefItemWasCalled(); -assert.strictEqual(derefItemWasCalled, true, - 'deref_item() was called upon garbage collecting a ' + - 'wrapped object. test_general.derefItemWasCalled() ' + - `returned ${derefItemWasCalled}`); - - // Assert that wrapping twice fails. const x = {}; test_general.wrap(x); assert.throws(() => test_general.wrap(x), { name: 'Error', message: 'Invalid argument' }); +// Clean up here, otherwise derefItemWasCalled() will be polluted. +test_general.removeWrap(x); // Ensure that wrapping, removing the wrap, and then wrapping again works. const y = {}; @@ -76,21 +65,32 @@ test_general.wrap(y); test_general.removeWrap(y); // Wrapping twice succeeds if a remove_wrap() separates the instances test_general.wrap(y); - -// Ensure that removing a wrap and garbage collecting does not fire the -// finalize callback. -let z = {}; -test_general.testFinalizeWrap(z); -test_general.removeWrap(z); -z = null; -global.gc(); -const finalizeWasCalled = test_general.finalizeWasCalled(); -assert.strictEqual(finalizeWasCalled, false, - 'finalize callback was not called upon garbage collection.' + - ' test_general.finalizeWasCalled() ' + - `returned ${finalizeWasCalled}`); +// Clean up here, otherwise derefItemWasCalled() will be polluted. +test_general.removeWrap(y); // Test napi_adjust_external_memory const adjustedValue = test_general.testAdjustExternalMemory(); assert.strictEqual(typeof adjustedValue, 'number'); assert(adjustedValue > 0); + +async function runGCTests() { + // Ensure that garbage collecting an object with a wrapped native item results + // in the finalize callback being called. + assert.strictEqual(test_general.derefItemWasCalled(), false); + + (() => test_general.wrap({}))(); + await common.gcUntil('deref_item() was called upon garbage collecting a ' + + 'wrapped object.', + () => test_general.derefItemWasCalled()); + + // Ensure that removing a wrap and garbage collecting does not fire the + // finalize callback. + let z = {}; + test_general.testFinalizeWrap(z); + test_general.removeWrap(z); + z = null; + await common.gcUntil( + 'finalize callback was not called upon garbage collection.', + () => (!test_general.finalizeWasCalled())); +} +runGCTests(); diff --git a/test/js-native-api/test_general/testFinalizer.js b/test/js-native-api/test_general/testFinalizer.js index d72a4a44a304d8..54265d61bc37ff 100644 --- a/test/js-native-api/test_general/testFinalizer.js +++ b/test/js-native-api/test_general/testFinalizer.js @@ -24,9 +24,13 @@ global.gc(); // Add an item to an object that is already wrapped, and ensure that its // finalizer as well as the wrap finalizer gets called. -let finalizeAndWrap = {}; -test_general.wrap(finalizeAndWrap); -test_general.addFinalizerOnly(finalizeAndWrap, common.mustCall()); -finalizeAndWrap = null; -global.gc(); -assert.strictEqual(test_general.derefItemWasCalled(), true); +async function testFinalizeAndWrap() { + assert.strictEqual(test_general.derefItemWasCalled(), false); + let finalizeAndWrap = {}; + test_general.wrap(finalizeAndWrap); + test_general.addFinalizerOnly(finalizeAndWrap, common.mustCall()); + finalizeAndWrap = null; + await common.gcUntil('test finalize and wrap', + () => test_general.derefItemWasCalled()); +} +testFinalizeAndWrap(); diff --git a/test/js-native-api/test_reference/test.js b/test/js-native-api/test_reference/test.js index 389ee11d7e5f5b..0c9d13075f2aa0 100644 --- a/test/js-native-api/test_reference/test.js +++ b/test/js-native-api/test_reference/test.js @@ -1,10 +1,10 @@ 'use strict'; // Flags: --expose-gc -const common = require('../../common'); +const { gcUntil, buildType } = require('../../common'); const assert = require('assert'); -const test_reference = require(`./build/${common.buildType}/test_reference`); +const test_reference = require(`./build/${buildType}/test_reference`); // This test script uses external values with finalizer callbacks // in order to track when values get garbage-collected. Each invocation @@ -13,111 +13,80 @@ assert.strictEqual(test_reference.finalizeCount, 0); // Run each test function in sequence, // with an async delay and GC call between each. -function runTests(i, title, tests) { - if (tests[i]) { - if (typeof tests[i] === 'string') { - title = tests[i]; - runTests(i + 1, title, tests); - } else { - try { - tests[i](); - } catch (e) { - console.error(`Test failed: ${title}`); - throw e; - } - setImmediate(() => { - global.gc(); - runTests(i + 1, title, tests); - }); - } - } -} -runTests(0, undefined, [ - - 'External value without a finalizer', - () => { +async function runTests() { + (() => { const value = test_reference.createExternal(); assert.strictEqual(test_reference.finalizeCount, 0); assert.strictEqual(typeof value, 'object'); test_reference.checkExternal(value); - }, - () => { - assert.strictEqual(test_reference.finalizeCount, 0); - }, + })(); + await gcUntil('External value without a finalizer', + () => (test_reference.finalizeCount === 0)); - 'External value with a finalizer', - () => { + (() => { const value = test_reference.createExternalWithFinalize(); assert.strictEqual(test_reference.finalizeCount, 0); assert.strictEqual(typeof value, 'object'); test_reference.checkExternal(value); - }, - () => { - assert.strictEqual(test_reference.finalizeCount, 1); - }, + })(); + await gcUntil('External value with a finalizer', + () => (test_reference.finalizeCount === 1)); - 'Weak reference', - () => { + (() => { const value = test_reference.createExternalWithFinalize(); assert.strictEqual(test_reference.finalizeCount, 0); test_reference.createReference(value, 0); assert.strictEqual(test_reference.referenceValue, value); - }, - () => { - // Value should be GC'd because there is only a weak ref - assert.strictEqual(test_reference.referenceValue, undefined); - assert.strictEqual(test_reference.finalizeCount, 1); - test_reference.deleteReference(); - }, + })(); + // Value should be GC'd because there is only a weak ref + await gcUntil('Weak reference', + () => (test_reference.referenceValue === undefined && + test_reference.finalizeCount === 1)); + test_reference.deleteReference(); - 'Strong reference', - () => { + (() => { const value = test_reference.createExternalWithFinalize(); assert.strictEqual(test_reference.finalizeCount, 0); test_reference.createReference(value, 1); assert.strictEqual(test_reference.referenceValue, value); - }, - () => { - // Value should NOT be GC'd because there is a strong ref - assert.strictEqual(test_reference.finalizeCount, 0); - test_reference.deleteReference(); - }, - () => { - // Value should be GC'd because the strong ref was deleted - assert.strictEqual(test_reference.finalizeCount, 1); - }, + })(); + // Value should NOT be GC'd because there is a strong ref + await gcUntil('Strong reference', + () => (test_reference.finalizeCount === 0)); + test_reference.deleteReference(); + await gcUntil('Strong reference (cont.d)', + () => (test_reference.finalizeCount === 1)); - 'Strong reference, increment then decrement to weak reference', - () => { + (() => { const value = test_reference.createExternalWithFinalize(); assert.strictEqual(test_reference.finalizeCount, 0); test_reference.createReference(value, 1); - }, - () => { - // Value should NOT be GC'd because there is a strong ref - assert.strictEqual(test_reference.finalizeCount, 0); - assert.strictEqual(test_reference.incrementRefcount(), 2); - }, - () => { - // Value should NOT be GC'd because there is a strong ref - assert.strictEqual(test_reference.finalizeCount, 0); - assert.strictEqual(test_reference.decrementRefcount(), 1); - }, - () => { - // Value should NOT be GC'd because there is a strong ref - assert.strictEqual(test_reference.finalizeCount, 0); - assert.strictEqual(test_reference.decrementRefcount(), 0); - }, - () => { - // Value should be GC'd because the ref is now weak! - assert.strictEqual(test_reference.finalizeCount, 1); - test_reference.deleteReference(); - }, - () => { - // Value was already GC'd - assert.strictEqual(test_reference.finalizeCount, 1); - }, -]); + })(); + // Value should NOT be GC'd because there is a strong ref + await gcUntil('Strong reference, increment then decrement to weak reference', + () => (test_reference.finalizeCount === 0)); + assert.strictEqual(test_reference.incrementRefcount(), 2); + // Value should NOT be GC'd because there is a strong ref + await gcUntil( + 'Strong reference, increment then decrement to weak reference (cont.d-1)', + () => (test_reference.finalizeCount === 0)); + assert.strictEqual(test_reference.decrementRefcount(), 1); + // Value should NOT be GC'd because there is a strong ref + await gcUntil( + 'Strong reference, increment then decrement to weak reference (cont.d-2)', + () => (test_reference.finalizeCount === 0)); + assert.strictEqual(test_reference.decrementRefcount(), 0); + // Value should be GC'd because the ref is now weak! + await gcUntil( + 'Strong reference, increment then decrement to weak reference (cont.d-3)', + () => (test_reference.finalizeCount === 1)); + test_reference.deleteReference(); + // Value was already GC'd + await gcUntil( + 'Strong reference, increment then decrement to weak reference (cont.d-4)', + () => (test_reference.finalizeCount === 1)); +} +runTests(); // This test creates a napi_ref on an object that has // been wrapped by napi_wrap and for which the finalizer diff --git a/test/known_issues/test-vm-function-declaration-uses-define.js b/test/known_issues/test-vm-function-declaration-uses-define.js new file mode 100644 index 00000000000000..1cfdd9c368e570 --- /dev/null +++ b/test/known_issues/test-vm-function-declaration-uses-define.js @@ -0,0 +1,21 @@ +'use strict'; + +// https://github.com/nodejs/node/issues/31808 +// function declarations currently call [[Set]] instead of [[DefineOwnProperty]] +// in VM contexts, which violates the ECMA-262 specification: +// https://tc39.es/ecma262/#sec-createglobalfunctionbinding + +const common = require('../common'); +const vm = require('vm'); +const assert = require('assert'); + +const ctx = vm.createContext(); +Object.defineProperty(ctx, 'x', { + enumerable: true, + configurable: true, + get: common.mustNotCall('ctx.x getter must not be called'), + set: common.mustNotCall('ctx.x setter must not be called'), +}); + +vm.runInContext('function x() {}', ctx); +assert.strictEqual(typeof ctx.x, 'function'); diff --git a/test/parallel/test-async-wrap-missing-method.js b/test/parallel/test-async-wrap-missing-method.js deleted file mode 100644 index 038a77fba65964..00000000000000 --- a/test/parallel/test-async-wrap-missing-method.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; -const common = require('../common'); -const assert = require('assert'); - -const { MessageChannel } = require('worker_threads'); - -{ - const { port1, port2 } = new MessageChannel(); - - // Returning a non-function in the getter should not crash. - Object.defineProperty(port1, 'onmessage', { - get() { - port1.unref(); - return 42; - } - }); - - port2.postMessage({ foo: 'bar' }); - - // We need to start the port manually because .onmessage assignment tracking - // has been overridden. - port1.start(); - port1.ref(); -} - -{ - const err = new Error('eyecatcher'); - process.on('uncaughtException', common.mustCall((exception) => { - port1.unref(); - assert.strictEqual(exception, err); - })); - - const { port1, port2 } = new MessageChannel(); - - // Throwing in the getter should not crash. - Object.defineProperty(port1, 'onmessage', { - get() { - throw err; - } - }); - - port2.postMessage({ foo: 'bar' }); - - // We need to start the port manually because .onmessage assignment tracking - // has been overridden. - port1.start(); - port1.ref(); -} diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js index 33c421c2f13fb6..f7f1d2583d928c 100644 --- a/test/parallel/test-bootstrap-modules.js +++ b/test/parallel/test-bootstrap-modules.js @@ -99,6 +99,7 @@ if (!common.isMainThread) { 'NativeModule _stream_transform', 'NativeModule _stream_writable', 'NativeModule internal/error_serdes', + 'NativeModule internal/event_target', 'NativeModule internal/process/worker_thread_only', 'NativeModule internal/streams/buffer_list', 'NativeModule internal/streams/destroy', @@ -109,6 +110,7 @@ if (!common.isMainThread) { 'NativeModule internal/worker', 'NativeModule internal/worker/io', 'NativeModule stream', + 'NativeModule util', 'NativeModule worker_threads', ].forEach(expectedModules.add.bind(expectedModules)); } diff --git a/test/parallel/test-crypto-key-objects-messageport.js b/test/parallel/test-crypto-key-objects-messageport.js index 1b910b571f77fc..f38e20da420aae 100644 --- a/test/parallel/test-crypto-key-objects-messageport.js +++ b/test/parallel/test-crypto-key-objects-messageport.js @@ -75,9 +75,9 @@ for (const [key, repr] of keys) { // TODO(addaleax): Switch this to a 'messageerror' event once MessagePort // implements EventTarget fully and in a cross-context manner. - port2moved.emit = common.mustCall((name, err) => { - assert.strictEqual(name, 'messageerror'); - assert.strictEqual(err.code, 'ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE'); + port2moved.onmessageerror = common.mustCall((event) => { + assert.strictEqual(event.data.code, + 'ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE'); }); port2moved.start(); diff --git a/test/parallel/test-dgram-udp6-link-local-address.js b/test/parallel/test-dgram-udp6-link-local-address.js new file mode 100644 index 00000000000000..bb7307de2430db --- /dev/null +++ b/test/parallel/test-dgram-udp6-link-local-address.js @@ -0,0 +1,51 @@ +'use strict'; +const common = require('../common'); +if (!common.hasIPv6) + common.skip('no IPv6 support'); + +const assert = require('assert'); +const dgram = require('dgram'); +const os = require('os'); + +function linklocal() { + for (const [ifname, entries] of Object.entries(os.networkInterfaces())) { + for (const { address, family, scopeid } of entries) { + if (family === 'IPv6' && address.startsWith('fe80:')) { + return { address, ifname, scopeid }; + } + } + } +} +const iface = linklocal(); + +if (!iface) + common.skip('cannot find any IPv6 interfaces with a link local address'); + +const address = `${iface.address}%${iface.ifname}`; +const message = 'Hello, local world!'; + +// Create a client socket for sending to the link-local address. +const client = dgram.createSocket('udp6'); + +// Create the server socket listening on the link-local address. +const server = dgram.createSocket('udp6'); + +server.on('listening', common.mustCall(() => { + const port = server.address().port; + client.send(message, 0, message.length, port, address); +})); + +server.on('message', common.mustCall((buf, info) => { + const received = buf.toString(); + assert.strictEqual(received, message); + // Check that the sender address is the one bound, + // including the link local scope identifier. + assert.strictEqual( + info.address, + common.isWindows ? `${iface.address}%${iface.scopeid}` : address + ); + server.close(); + client.close(); +}, 1)); + +server.bind({ address }); diff --git a/test/parallel/test-http-header-badrequest.js b/test/parallel/test-http-header-badrequest.js new file mode 100644 index 00000000000000..8294ca9fe208ec --- /dev/null +++ b/test/parallel/test-http-header-badrequest.js @@ -0,0 +1,31 @@ +'use strict'; +const { mustCall } = require('../common'); +const assert = require('assert'); +const { createServer } = require('http'); +const { createConnection } = require('net'); + +const server = createServer(); + +server.on('request', mustCall((req, res) => { + res.write('asd', () => { + res.socket.emit('error', new Error('kaboom')); + }); +})); + +server.listen(0, mustCall(() => { + const c = createConnection(server.address().port); + let received = ''; + + c.on('connect', mustCall(() => { + c.write('GET /blah HTTP/1.1\r\n\r\n'); + })); + c.on('data', mustCall((data) => { + received += data.toString(); + })); + c.on('end', mustCall(() => { + // Should not include anything else after asd. + assert.strictEqual(received.indexOf('asd\r\n'), received.length - 5); + c.end(); + })); + c.on('close', mustCall(() => server.close())); +})); diff --git a/test/parallel/test-macos-app-sandbox.js b/test/parallel/test-macos-app-sandbox.js index f7fcf5e5728815..53484834a36758 100644 --- a/test/parallel/test-macos-app-sandbox.js +++ b/test/parallel/test-macos-app-sandbox.js @@ -42,7 +42,7 @@ assert.strictEqual( child_process.spawnSync('/usr/bin/codesign', [ '--entitlements', fixtures.path( 'macos-app-sandbox', 'node_sandboxed.entitlements'), - '-s', '-', + '--force', '-s', '-', appBundlePath ]).status, 0); diff --git a/test/parallel/test-net-isip.js b/test/parallel/test-net-isip.js index e9a8749aaee412..840ffe76af9a30 100644 --- a/test/parallel/test-net-isip.js +++ b/test/parallel/test-net-isip.js @@ -46,6 +46,9 @@ assert.strictEqual(net.isIP('::2001:252:1:2008:6'), 6); assert.strictEqual(net.isIP('::2001:252:1:1.1.1.1'), 6); assert.strictEqual(net.isIP('::2001:252:1:255.255.255.255'), 6); assert.strictEqual(net.isIP('::2001:252:1:255.255.255.255.76'), 0); +assert.strictEqual(net.isIP('fe80::2008%eth0'), 6); +assert.strictEqual(net.isIP('fe80::2008%eth0.0'), 6); +assert.strictEqual(net.isIP('fe80::2008%eth0@1'), 0); assert.strictEqual(net.isIP('::anything'), 0); assert.strictEqual(net.isIP('::1'), 6); assert.strictEqual(net.isIP('::'), 6); diff --git a/test/parallel/test-preload-self-referential.js b/test/parallel/test-preload-self-referential.js new file mode 100644 index 00000000000000..2624527deb3984 --- /dev/null +++ b/test/parallel/test-preload-self-referential.js @@ -0,0 +1,20 @@ +'use strict'; + +const common = require('../common'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const { exec } = require('child_process'); + +const nodeBinary = process.argv[0]; + +if (!common.isMainThread) + common.skip('process.chdir is not available in Workers'); + +const selfRefModule = fixtures.path('self_ref_module'); +const fixtureA = fixtures.path('printA.js'); + +exec(`"${nodeBinary}" -r self_ref "${fixtureA}"`, { cwd: selfRefModule }, + (err, stdout, stderr) => { + assert.ifError(err); + assert.strictEqual(stdout, 'A\n'); + }); diff --git a/test/parallel/test-repl-require-self-referential.js b/test/parallel/test-repl-require-self-referential.js new file mode 100644 index 00000000000000..7ced6dbf11721e --- /dev/null +++ b/test/parallel/test-repl-require-self-referential.js @@ -0,0 +1,25 @@ +'use strict'; + +const common = require('../common'); +const fixtures = require('../common/fixtures'); +const assert = require('assert'); +const { spawn } = require('child_process'); + +if (!common.isMainThread) + common.skip('process.chdir is not available in Workers'); + +const selfRefModule = fixtures.path('self_ref_module'); +const child = spawn(process.execPath, + ['--interactive'], + { cwd: selfRefModule } +); +let output = ''; +child.stdout.on('data', (chunk) => output += chunk); +child.on('exit', common.mustCall(() => { + const results = output.replace(/^> /mg, '').split('\n').slice(2); + assert.deepStrictEqual(results, [ "'Self resolution working'", '' ]); +})); + +child.stdin.write('require("self_ref");\n'); +child.stdin.write('.exit'); +child.stdin.end(); diff --git a/test/parallel/test-stream-finished.js b/test/parallel/test-stream-finished.js index 4622d2c695e1fa..758f9540479534 100644 --- a/test/parallel/test-stream-finished.js +++ b/test/parallel/test-stream-finished.js @@ -145,7 +145,7 @@ const { promisify } = require('util'); () => finished(rs, 'foo', () => {}), { code: 'ERR_INVALID_ARG_TYPE', - message: /opts/ + message: /options/ } ); assert.throws( diff --git a/test/parallel/test-worker-message-port-inspect-during-init-hook.js b/test/parallel/test-worker-message-port-inspect-during-init-hook.js index 30b90710a604f1..8f9678de1e970e 100644 --- a/test/parallel/test-worker-message-port-inspect-during-init-hook.js +++ b/test/parallel/test-worker-message-port-inspect-during-init-hook.js @@ -10,8 +10,9 @@ const { MessageChannel } = require('worker_threads'); async_hooks.createHook({ init: common.mustCall((id, type, triggerId, resource) => { - assert.strictEqual(util.inspect(resource), - 'MessagePort { active: true, refed: false }'); + assert.strictEqual( + util.inspect(resource), + 'MessagePort [EventTarget] { active: true, refed: false }'); }, 2) }).enable(); diff --git a/test/parallel/test-worker-message-port-transfer-filehandle.js b/test/parallel/test-worker-message-port-transfer-filehandle.js index 157acb22e8ad55..c42d2e8b4042cf 100644 --- a/test/parallel/test-worker-message-port-transfer-filehandle.js +++ b/test/parallel/test-worker-message-port-transfer-filehandle.js @@ -57,9 +57,9 @@ const { once } = require('events'); }); // TODO(addaleax): Switch this to a 'messageerror' event once MessagePort // implements EventTarget fully and in a cross-context manner. - port2moved.emit = common.mustCall((name, err) => { - assert.strictEqual(name, 'messageerror'); - assert.strictEqual(err.code, 'ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE'); + port2moved.onmessageerror = common.mustCall((event) => { + assert.strictEqual(event.data.code, + 'ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE'); }); port2moved.start(); diff --git a/test/parallel/test-worker-message-port.js b/test/parallel/test-worker-message-port.js index d128dc7edb25fd..4f4863c45ed516 100644 --- a/test/parallel/test-worker-message-port.js +++ b/test/parallel/test-worker-message-port.js @@ -154,7 +154,9 @@ const { MessageChannel, MessagePort } = require('worker_threads'); assert.deepStrictEqual( Object.getOwnPropertyNames(MessagePort.prototype).sort(), [ - 'close', 'constructor', 'onmessage', 'postMessage', 'ref', 'start', + // TODO(addaleax): This should include onmessage (and eventually + // onmessageerror). + 'close', 'constructor', 'postMessage', 'ref', 'start', 'unref' ]); } diff --git a/test/parallel/test-worker-terminate-source-map.js b/test/parallel/test-worker-terminate-source-map.js index d88a4c68366865..8cd40a6607422c 100644 --- a/test/parallel/test-worker-terminate-source-map.js +++ b/test/parallel/test-worker-terminate-source-map.js @@ -32,9 +32,11 @@ Map.prototype.entries = increaseCallCount; Object.keys = increaseCallCount; Object.create = increaseCallCount; Object.hasOwnProperty = increaseCallCount; -Object.defineProperty(Object.prototype, 'value', { - get: increaseCallCount, - set: increaseCallCount -}); +for (const property of ['_cache', 'lineLengths', 'url']) { + Object.defineProperty(Object.prototype, property, { + get: increaseCallCount, + set: increaseCallCount + }); +} parentPort.postMessage('done'); diff --git a/test/parallel/test-zlib-reset-before-write.js b/test/parallel/test-zlib-reset-before-write.js new file mode 100644 index 00000000000000..6b2b107d25d313 --- /dev/null +++ b/test/parallel/test-zlib-reset-before-write.js @@ -0,0 +1,37 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); + +// Tests that zlib streams support .reset() and .params() +// before the first write. That is important to ensure that +// lazy init of zlib native library handles these cases. + +for (const fn of [ + (z, cb) => { + z.reset(); + cb(); + }, + (z, cb) => z.params(0, zlib.constants.Z_DEFAULT_STRATEGY, cb) +]) { + const deflate = zlib.createDeflate(); + const inflate = zlib.createInflate(); + + deflate.pipe(inflate); + + const output = []; + inflate + .on('error', (err) => { + assert.ifError(err); + }) + .on('data', (chunk) => output.push(chunk)) + .on('end', common.mustCall( + () => assert.deepStrictEqual(Buffer.concat(output).toString(), 'abc'))); + + fn(deflate, () => { + fn(inflate, () => { + deflate.write('abc'); + deflate.end(); + }); + }); +} diff --git a/test/pummel/test-heapdump-http2.js b/test/pummel/test-heapdump-http2.js index b3d819edaef91a..fe11dcfb2f44bb 100644 --- a/test/pummel/test-heapdump-http2.js +++ b/test/pummel/test-heapdump-http2.js @@ -14,7 +14,7 @@ const http2 = require('http2'); const server = http2.createServer(); server.on('stream', (stream) => { - stream.respondWithFile(__filename); + stream.respondWithFile(process.execPath); }); server.listen(0, () => { const client = http2.connect(`http://localhost:${server.address().port}`); diff --git a/test/pummel/test-heapdump-zlib.js b/test/pummel/test-heapdump-zlib.js index 0f86576bd1f2fa..ef906c9935274e 100644 --- a/test/pummel/test-heapdump-zlib.js +++ b/test/pummel/test-heapdump-zlib.js @@ -1,17 +1,28 @@ // Flags: --expose-internals 'use strict'; -require('../common'); +const common = require('../common'); const { validateSnapshotNodes } = require('../common/heap'); const zlib = require('zlib'); validateSnapshotNodes('Node / ZlibStream', []); -// eslint-disable-next-line no-unused-vars -const gunzip = zlib.createGunzip(); + +const gzip = zlib.createGzip(); validateSnapshotNodes('Node / ZlibStream', [ { children: [ - { node_name: 'Zlib', edge_name: 'wrapped' }, - { node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' } + { node_name: 'Zlib', edge_name: 'wrapped' } + // No entry for memory because zlib memory is initialized lazily. ] } ]); + +gzip.write('hello world', common.mustCall(() => { + validateSnapshotNodes('Node / ZlibStream', [ + { + children: [ + { node_name: 'Zlib', edge_name: 'wrapped' }, + { node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' } + ] + } + ]); +})); diff --git a/test/pummel/test-net-connect-econnrefused.js b/test/pummel/test-net-connect-econnrefused.js index 38a71b6cfd4944..4fd4f8b6943e3c 100644 --- a/test/pummel/test-net-connect-econnrefused.js +++ b/test/pummel/test-net-connect-econnrefused.js @@ -31,12 +31,17 @@ const ATTEMPTS_PER_ROUND = 50; let rounds = 1; let reqs = 0; -pummel(); +let port; +const server = net.createServer().listen(0, common.mustCall(() => { + port = server.address().port; + server.close(common.mustCall(pummel)); +})); function pummel() { let pending; for (pending = 0; pending < ATTEMPTS_PER_ROUND; pending++) { - net.createConnection(common.PORT).on('error', function(err) { + net.createConnection(port).on('error', function(err) { + console.log('pending', pending, 'rounds', rounds); assert.strictEqual(err.code, 'ECONNREFUSED'); if (--pending > 0) return; if (rounds === ROUNDS) return check(); diff --git a/test/pummel/test-net-pingpong.js b/test/pummel/test-net-pingpong.js index f21160a1fa2a4d..0b2947ade41a1c 100644 --- a/test/pummel/test-net-pingpong.js +++ b/test/pummel/test-net-pingpong.js @@ -113,9 +113,8 @@ function pingPongTest(host, on_complete) { pingPongTest('localhost'); pingPongTest(null); -// This IPv6 isn't working on Solaris. -if (!common.isSunOS) pingPongTest('::1'); +if (common.hasIPv6) pingPongTest('::1'); process.on('exit', function() { - assert.strictEqual(tests_run, common.isSunOS ? 2 : 3); + assert.strictEqual(tests_run, common.hasIPv6 ? 3 : 2); }); diff --git a/test/pummel/test-regress-GH-814.js b/test/pummel/test-regress-GH-814.js index 3ae6dd061c91df..323163225738b4 100644 --- a/test/pummel/test-regress-GH-814.js +++ b/test/pummel/test-regress-GH-814.js @@ -19,6 +19,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +// Refs: https://github.com/nodejs/node-v0.x-archive/issues/814 + 'use strict'; // Flags: --expose_gc diff --git a/test/pummel/test-regress-GH-814_2.js b/test/pummel/test-regress-GH-814_2.js index 10de38a50c13fd..6806a7fc45143c 100644 --- a/test/pummel/test-regress-GH-814_2.js +++ b/test/pummel/test-regress-GH-814_2.js @@ -19,6 +19,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +// Refs: https://github.com/nodejs/node-v0.x-archive/issues/814 + 'use strict'; // Flags: --expose_gc diff --git a/test/pummel/test-timers.js b/test/pummel/test-timers.js index 60d6a7e6922836..7500ca79395ab0 100644 --- a/test/pummel/test-timers.js +++ b/test/pummel/test-timers.js @@ -23,15 +23,10 @@ const common = require('../common'); const assert = require('assert'); -const WINDOW = 200; // Why is does this need to be so big? +const WINDOW = 200; // Why does this need to be so big? let interval_count = 0; -// Check that these don't blow up. -clearTimeout(null); -clearInterval(null); - -assert.strictEqual(setTimeout instanceof Function, true); const starttime = new Date(); setTimeout(common.mustCall(function() { const endtime = new Date(); diff --git a/test/pummel/test-watch-file.js b/test/pummel/test-watch-file.js index 4a7282052065d6..bbbbf396d72227 100644 --- a/test/pummel/test-watch-file.js +++ b/test/pummel/test-watch-file.js @@ -24,15 +24,21 @@ require('../common'); const assert = require('assert'); const fs = require('fs'); -const fixtures = require('../common/fixtures'); +const path = require('path'); +const tmpdir = require('../common/tmpdir'); -const f = fixtures.path('x.txt'); +tmpdir.refresh(); +const f = path.join(tmpdir.path, 'x.txt'); +fs.closeSync(fs.openSync(f, 'w')); let changes = 0; function watchFile() { fs.watchFile(f, (curr, prev) => { + // Make sure there is at least one watch event that shows a changed mtime. + if (curr.mtime <= prev.mtime) { + return; + } changes++; - assert.notDeepStrictEqual(curr.mtime, prev.mtime); fs.unwatchFile(f); watchFile(); fs.unwatchFile(f); @@ -41,10 +47,17 @@ function watchFile() { watchFile(); +function changeFile() { + const fd = fs.openSync(f, 'w+'); + fs.writeSync(fd, 'xyz\n'); + fs.closeSync(fd); +} -const fd = fs.openSync(f, 'w+'); -fs.writeSync(fd, 'xyz\n'); -fs.closeSync(fd); +changeFile(); +const interval = setInterval(changeFile, 1000); +// Use unref() here so fs.watchFile() watcher is the only thing keeping the +// event loop open. +interval.unref(); process.on('exit', function() { assert.ok(changes > 0); diff --git a/test/sequential/test-diagnostic-dir-cpu-prof.js b/test/sequential/test-diagnostic-dir-cpu-prof.js new file mode 100644 index 00000000000000..396a6ca7de0595 --- /dev/null +++ b/test/sequential/test-diagnostic-dir-cpu-prof.js @@ -0,0 +1,76 @@ +'use strict'; + +// This test is to ensure that --diagnostic-dir does not change the directory +// for --cpu-prof when --cpu-prof-dir is specified + +const common = require('../common'); +const fixtures = require('../common/fixtures'); +common.skipIfInspectorDisabled(); + +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const { spawnSync } = require('child_process'); + +const tmpdir = require('../common/tmpdir'); +const { + getCpuProfiles, + kCpuProfInterval, + env, + verifyFrames +} = require('../common/cpu-prof'); + +// Test --diagnostic-dir changes the default for --cpu-prof + +{ + tmpdir.refresh(); + const dir = path.join(tmpdir.path, 'prof'); + const output = spawnSync(process.execPath, [ + '--cpu-prof', + '--cpu-prof-interval', + kCpuProfInterval, + '--diagnostic-dir', + dir, + fixtures.path('workload', 'fibonacci.js'), + ], { + cwd: tmpdir.path, + env + }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert(fs.existsSync(dir)); + const profiles = getCpuProfiles(dir); + assert.strictEqual(profiles.length, 1); + verifyFrames(output, profiles[0], 'fibonacci.js'); +} + +// Test --cpu-prof-dir overwrites --diagnostic-dir + +{ + tmpdir.refresh(); + const dir = path.join(tmpdir.path, 'diag'); + const dir2 = path.join(tmpdir.path, 'prof'); + const output = spawnSync(process.execPath, [ + '--cpu-prof', + '--cpu-prof-interval', + kCpuProfInterval, + '--diagnostic-dir', + dir, + '--cpu-prof-dir', + dir2, + fixtures.path('workload', 'fibonacci.js'), + ], { + cwd: tmpdir.path, + env + }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert(fs.existsSync(dir2)); + const profiles = getCpuProfiles(dir2); + assert.strictEqual(profiles.length, 1); + verifyFrames(output, profiles[0], 'fibonacci.js'); +} diff --git a/test/sequential/test-diagnostic-dir-heap-prof.js b/test/sequential/test-diagnostic-dir-heap-prof.js new file mode 100644 index 00000000000000..10ce58f72b1d4b --- /dev/null +++ b/test/sequential/test-diagnostic-dir-heap-prof.js @@ -0,0 +1,117 @@ +'use strict'; + +// This test is to ensure that --diagnostic-dir does not change the directory +// for --cpu-prof when --cpu-prof-dir is specified + +const common = require('../common'); +const fixtures = require('../common/fixtures'); +common.skipIfInspectorDisabled(); + +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const { spawnSync } = require('child_process'); + +const tmpdir = require('../common/tmpdir'); + +function findFirstFrameInNode(root, func) { + const first = root.children.find( + (child) => child.callFrame.functionName === func + ); + if (first) { + return first; + } + for (const child of root.children) { + const first = findFirstFrameInNode(child, func); + if (first) { + return first; + } + } + return undefined; +} + +function findFirstFrame(file, func) { + const data = fs.readFileSync(file, 'utf8'); + const profile = JSON.parse(data); + const first = findFirstFrameInNode(profile.head, func); + return { frame: first, roots: profile.head.children }; +} + +function verifyFrames(output, file, func) { + const { frame, roots } = findFirstFrame(file, func); + if (!frame) { + // Show native debug output and the profile for debugging. + console.log(output.stderr.toString()); + console.log(roots); + } + assert.notDeepStrictEqual(frame, undefined); +} + +const kHeapProfInterval = 128; +const TEST_ALLOCATION = kHeapProfInterval * 2; + +const env = { + ...process.env, + TEST_ALLOCATION, + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' +}; + +function getHeapProfiles(dir) { + const list = fs.readdirSync(dir); + return list + .filter((file) => file.endsWith('.heapprofile')) + .map((file) => path.join(dir, file)); +} + +// Test --diagnostic-dir changes the default for --cpu-prof +{ + tmpdir.refresh(); + const dir = path.join(tmpdir.path, 'prof'); + const output = spawnSync(process.execPath, [ + '--heap-prof', + '--diagnostic-dir', + dir, + '--heap-prof-interval', + kHeapProfInterval, + fixtures.path('workload', 'allocation.js'), + ], { + cwd: tmpdir.path, + env + }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert(fs.existsSync(dir)); + const profiles = getHeapProfiles(dir); + assert.strictEqual(profiles.length, 1); + verifyFrames(output, profiles[0], 'runAllocation'); +} + +// Test --heap-prof-dir overwrites --diagnostic-dir +{ + tmpdir.refresh(); + const dir = path.join(tmpdir.path, 'diag'); + const dir2 = path.join(tmpdir.path, 'prof'); + const output = spawnSync(process.execPath, [ + '--heap-prof', + '--heap-prof-interval', + kHeapProfInterval, + '--diagnostic-dir', + dir, + '--heap-prof-dir', + dir2, + fixtures.path('workload', 'allocation.js'), + ], { + cwd: tmpdir.path, + env + }); + if (output.status !== 0) { + console.log(output.stderr.toString()); + } + assert.strictEqual(output.status, 0); + assert(fs.existsSync(dir2)); + const profiles = getHeapProfiles(dir2); + assert.strictEqual(profiles.length, 1); + verifyFrames(output, profiles[0], 'runAllocation'); +} diff --git a/test/sequential/test-net-connect-local-error.js b/test/sequential/test-net-connect-local-error.js index 6f5139aefb226d..030c4de750cb4d 100644 --- a/test/sequential/test-net-connect-local-error.js +++ b/test/sequential/test-net-connect-local-error.js @@ -14,10 +14,10 @@ const optionsIPv4 = { }; const optionsIPv6 = { - host: common.localhostIPv6, + host: '::1', port: common.PORT + 2, localPort: common.PORT + 3, - localAddress: common.localhostIPv6 + localAddress: '::1', }; function onError(err, options) { diff --git a/tools/doc/allhtml.js b/tools/doc/allhtml.js index 3de538e42404a5..6d18d1be3f8f1f 100644 --- a/tools/doc/allhtml.js +++ b/tools/doc/allhtml.js @@ -37,7 +37,7 @@ for (const link of toc.match(//g)) { .replace(/[\s\S]*?
\s*

.*?<\/h2>\s*(