From 9ecfc32fdebd8f2aa4068b38aa2dece2fd8b0bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 22 Sep 2016 07:59:37 -0700 Subject: [PATCH 001/216] deps: upgrade npm to 3.10.8 PR-URL: https://github.com/nodejs/node/pull/8706 Reviewed-By: Jeremiah Senkpiel --- deps/npm/.github/issue_template.md | 69 + deps/npm/.mailmap | 2 + deps/npm/.travis.yml | 42 +- deps/npm/AUTHORS | 22 + deps/npm/CHANGELOG.md | 596 +++- deps/npm/README.md | 2 +- deps/npm/doc/cli/npm-install.md | 3 +- deps/npm/doc/cli/npm-link.md | 3 +- deps/npm/doc/cli/npm-run-script.md | 4 +- deps/npm/doc/cli/npm-shrinkwrap.md | 10 +- deps/npm/doc/cli/npm-tag.md | 2 +- deps/npm/doc/files/npmrc.md | 10 + deps/npm/doc/files/package.json.md | 5 + deps/npm/doc/misc/npm-config.md | 10 +- deps/npm/doc/misc/npm-orgs.md | 4 +- deps/npm/doc/misc/npm-registry.md | 2 +- deps/npm/doc/misc/npm-scope.md | 19 +- deps/npm/doc/misc/npm-scripts.md | 8 +- deps/npm/doc/misc/semver.md | 39 +- deps/npm/html/doc/README.html | 6 +- deps/npm/html/doc/cli/npm-access.html | 4 +- deps/npm/html/doc/cli/npm-adduser.html | 4 +- deps/npm/html/doc/cli/npm-bin.html | 4 +- deps/npm/html/doc/cli/npm-bugs.html | 4 +- deps/npm/html/doc/cli/npm-build.html | 4 +- deps/npm/html/doc/cli/npm-bundle.html | 4 +- deps/npm/html/doc/cli/npm-cache.html | 4 +- deps/npm/html/doc/cli/npm-completion.html | 4 +- deps/npm/html/doc/cli/npm-config.html | 4 +- deps/npm/html/doc/cli/npm-dedupe.html | 4 +- deps/npm/html/doc/cli/npm-deprecate.html | 4 +- deps/npm/html/doc/cli/npm-dist-tag.html | 4 +- deps/npm/html/doc/cli/npm-docs.html | 4 +- deps/npm/html/doc/cli/npm-edit.html | 4 +- deps/npm/html/doc/cli/npm-explore.html | 4 +- deps/npm/html/doc/cli/npm-help-search.html | 4 +- deps/npm/html/doc/cli/npm-help.html | 4 +- deps/npm/html/doc/cli/npm-init.html | 4 +- deps/npm/html/doc/cli/npm-install-test.html | 5 +- deps/npm/html/doc/cli/npm-install.html | 7 +- deps/npm/html/doc/cli/npm-link.html | 7 +- deps/npm/html/doc/cli/npm-logout.html | 4 +- deps/npm/html/doc/cli/npm-ls.html | 6 +- deps/npm/html/doc/cli/npm-outdated.html | 4 +- deps/npm/html/doc/cli/npm-owner.html | 4 +- deps/npm/html/doc/cli/npm-pack.html | 4 +- deps/npm/html/doc/cli/npm-ping.html | 5 +- deps/npm/html/doc/cli/npm-prefix.html | 4 +- deps/npm/html/doc/cli/npm-prune.html | 4 +- deps/npm/html/doc/cli/npm-publish.html | 4 +- deps/npm/html/doc/cli/npm-rebuild.html | 4 +- deps/npm/html/doc/cli/npm-repo.html | 4 +- deps/npm/html/doc/cli/npm-restart.html | 4 +- deps/npm/html/doc/cli/npm-root.html | 4 +- deps/npm/html/doc/cli/npm-run-script.html | 8 +- deps/npm/html/doc/cli/npm-search.html | 4 +- deps/npm/html/doc/cli/npm-shrinkwrap.html | 14 +- deps/npm/html/doc/cli/npm-star.html | 4 +- deps/npm/html/doc/cli/npm-stars.html | 4 +- deps/npm/html/doc/cli/npm-start.html | 4 +- deps/npm/html/doc/cli/npm-stop.html | 4 +- deps/npm/html/doc/cli/npm-tag.html | 6 +- deps/npm/html/doc/cli/npm-team.html | 5 +- deps/npm/html/doc/cli/npm-test.html | 4 +- deps/npm/html/doc/cli/npm-uninstall.html | 4 +- deps/npm/html/doc/cli/npm-unpublish.html | 4 +- deps/npm/html/doc/cli/npm-update.html | 4 +- deps/npm/html/doc/cli/npm-version.html | 4 +- deps/npm/html/doc/cli/npm-view.html | 4 +- deps/npm/html/doc/cli/npm-whoami.html | 4 +- deps/npm/html/doc/cli/npm.html | 8 +- deps/npm/html/doc/files/npm-folders.html | 4 +- deps/npm/html/doc/files/npm-global.html | 4 +- deps/npm/html/doc/files/npm-json.html | 10 +- deps/npm/html/doc/files/npmrc.html | 12 +- deps/npm/html/doc/files/package.json.html | 10 +- deps/npm/html/doc/index.html | 4 +- deps/npm/html/doc/misc/npm-coding-style.html | 4 +- deps/npm/html/doc/misc/npm-config.html | 14 +- deps/npm/html/doc/misc/npm-developers.html | 4 +- deps/npm/html/doc/misc/npm-disputes.html | 10 +- deps/npm/html/doc/misc/npm-index.html | 5 +- deps/npm/html/doc/misc/npm-orgs.html | 5 +- deps/npm/html/doc/misc/npm-registry.html | 4 +- deps/npm/html/doc/misc/npm-scope.html | 23 +- deps/npm/html/doc/misc/npm-scripts.html | 12 +- deps/npm/html/doc/misc/removing-npm.html | 4 +- deps/npm/html/doc/misc/semver.html | 43 +- deps/npm/html/dochead.html | 2 +- deps/npm/lib/cache/add-local.js | 15 +- deps/npm/lib/cache/add-remote-git.js | 1 + deps/npm/lib/config.js | 3 +- deps/npm/lib/config/cmd-list.js | 1 + deps/npm/lib/edit.js | 5 +- deps/npm/lib/fetch-package-metadata.js | 11 +- deps/npm/lib/init.js | 6 +- deps/npm/lib/install.js | 55 +- deps/npm/lib/install/action/update-linked.js | 6 +- deps/npm/lib/install/actions.js | 26 +- deps/npm/lib/install/deps.js | 165 +- deps/npm/lib/install/flatten-tree.js | 16 +- deps/npm/lib/install/inflate-shrinkwrap.js | 117 +- deps/npm/lib/install/is-dev-dep.js | 8 + deps/npm/lib/install/is-dev.js | 26 - deps/npm/lib/install/is-opt-dep.js | 8 + deps/npm/lib/install/is-prod-dep.js | 9 + deps/npm/lib/install/is-registry-specifier.js | 6 + .../install/realize-shrinkwrap-specifier.js | 25 + .../lib/install/report-optional-failure.js | 31 + deps/npm/lib/install/save.js | 27 +- deps/npm/lib/shrinkwrap.js | 92 +- deps/npm/lib/utils/correct-mkdir.js | 10 +- deps/npm/lib/utils/error-message.js | 22 +- deps/npm/lib/utils/lifecycle.js | 19 +- deps/npm/lib/utils/tar.js | 15 +- deps/npm/man/man1/npm-README.1 | 4 +- deps/npm/man/man1/npm-access.1 | 2 +- deps/npm/man/man1/npm-adduser.1 | 2 +- deps/npm/man/man1/npm-bin.1 | 2 +- deps/npm/man/man1/npm-bugs.1 | 2 +- deps/npm/man/man1/npm-build.1 | 2 +- deps/npm/man/man1/npm-bundle.1 | 2 +- deps/npm/man/man1/npm-cache.1 | 2 +- deps/npm/man/man1/npm-completion.1 | 2 +- deps/npm/man/man1/npm-config.1 | 2 +- deps/npm/man/man1/npm-dedupe.1 | 2 +- deps/npm/man/man1/npm-deprecate.1 | 2 +- deps/npm/man/man1/npm-dist-tag.1 | 2 +- deps/npm/man/man1/npm-docs.1 | 2 +- deps/npm/man/man1/npm-edit.1 | 2 +- deps/npm/man/man1/npm-explore.1 | 2 +- deps/npm/man/man1/npm-help-search.1 | 2 +- deps/npm/man/man1/npm-help.1 | 2 +- deps/npm/man/man1/npm-init.1 | 2 +- deps/npm/man/man1/npm-install-test.1 | 3 +- deps/npm/man/man1/npm-install.1 | 6 +- deps/npm/man/man1/npm-link.1 | 5 +- deps/npm/man/man1/npm-logout.1 | 2 +- deps/npm/man/man1/npm-ls.1 | 4 +- deps/npm/man/man1/npm-outdated.1 | 2 +- deps/npm/man/man1/npm-owner.1 | 2 +- deps/npm/man/man1/npm-pack.1 | 2 +- deps/npm/man/man1/npm-ping.1 | 3 +- deps/npm/man/man1/npm-prefix.1 | 2 +- deps/npm/man/man1/npm-prune.1 | 2 +- deps/npm/man/man1/npm-publish.1 | 2 +- deps/npm/man/man1/npm-rebuild.1 | 2 +- deps/npm/man/man1/npm-repo.1 | 2 +- deps/npm/man/man1/npm-restart.1 | 2 +- deps/npm/man/man1/npm-root.1 | 2 +- deps/npm/man/man1/npm-run-script.1 | 6 +- deps/npm/man/man1/npm-search.1 | 2 +- deps/npm/man/man1/npm-shrinkwrap.1 | 12 +- deps/npm/man/man1/npm-star.1 | 2 +- deps/npm/man/man1/npm-stars.1 | 2 +- deps/npm/man/man1/npm-start.1 | 2 +- deps/npm/man/man1/npm-stop.1 | 2 +- deps/npm/man/man1/npm-tag.1 | 4 +- deps/npm/man/man1/npm-team.1 | 3 +- deps/npm/man/man1/npm-test.1 | 2 +- deps/npm/man/man1/npm-uninstall.1 | 2 +- deps/npm/man/man1/npm-unpublish.1 | 2 +- deps/npm/man/man1/npm-update.1 | 2 +- deps/npm/man/man1/npm-version.1 | 2 +- deps/npm/man/man1/npm-view.1 | 2 +- deps/npm/man/man1/npm-whoami.1 | 2 +- deps/npm/man/man1/npm.1 | 4 +- deps/npm/man/man5/npm-folders.5 | 2 +- deps/npm/man/man5/npm-global.5 | 2 +- deps/npm/man/man5/npm-json.5 | 8 +- deps/npm/man/man5/npmrc.5 | 15 +- deps/npm/man/man5/package.json.5 | 8 +- deps/npm/man/man7/npm-coding-style.7 | 2 +- deps/npm/man/man7/npm-config.7 | 12 +- deps/npm/man/man7/npm-developers.7 | 2 +- deps/npm/man/man7/npm-disputes.7 | 2 +- deps/npm/man/man7/npm-index.7 | 2 +- deps/npm/man/man7/npm-orgs.7 | 7 +- deps/npm/man/man7/npm-registry.7 | 4 +- deps/npm/man/man7/npm-scope.7 | 21 +- deps/npm/man/man7/npm-scripts.7 | 11 +- deps/npm/man/man7/removing-npm.7 | 2 +- deps/npm/man/man7/semver.7 | 43 +- deps/npm/node_modules/aproba/LICENSE | 1 + deps/npm/node_modules/aproba/README.md | 3 +- .../columnify/node_modules/wcwidth/LICENSE | 1 + .../node_modules/wcwidth/docs/index.md | 3 + .../wcwidth/node_modules/defaults/test.js | 1 + .../node_modules/fstream-npm/fstream-npm.js | 36 +- .../node_modules/minimatch/README.md | 11 +- .../node_modules/minimatch/minimatch.js | 57 +- .../node_modules/brace-expansion/.npmignore | 3 - .../node_modules/brace-expansion/README.md | 2 +- .../node_modules/brace-expansion/example.js | 7 - .../node_modules/brace-expansion/index.js | 11 + .../node_modules/balanced-match/README.md | 4 +- .../node_modules/balanced-match/index.js | 2 +- .../node_modules/balanced-match/package.json | 48 +- .../node_modules/brace-expansion/package.json | 52 +- .../node_modules/minimatch/package.json | 111 +- .../npm/node_modules/fstream-npm/package.json | 57 +- .../node_modules/fstream-npm/test/scoped.js | 94 + .../node_modules => }/glob/README.md | 80 +- deps/npm/node_modules/glob/glob.js | 4 + .../glob/node_modules/minimatch/README.md | 11 +- .../glob/node_modules/minimatch/minimatch.js | 57 +- .../node_modules/brace-expansion/README.md | 2 +- .../node_modules/brace-expansion/index.js | 11 + .../node_modules/balanced-match/README.md | 4 +- .../node_modules/balanced-match/index.js | 2 +- .../node_modules/balanced-match/package.json | 30 +- .../node_modules/brace-expansion/package.json | 28 +- .../glob/node_modules/minimatch/package.json | 111 +- deps/npm/node_modules/glob/package.json | 56 +- deps/npm/node_modules/graceful-fs/README.md | 2 +- .../npm/node_modules/graceful-fs/package.json | 62 +- .../npm/node_modules/graceful-fs/polyfills.js | 57 +- deps/npm/node_modules/has-unicode/LICENSE | 1 + deps/npm/node_modules/has-unicode/README.md | 3 +- .../node_modules/imurmurhash/imurmurhash.js | 2 +- deps/npm/node_modules/inherits/inherits.js | 8 +- deps/npm/node_modules/inherits/package.json | 110 +- deps/npm/node_modules/inherits/test.js | 25 - .../glob/node_modules/minimatch/README.md | 11 +- .../glob/node_modules/minimatch/minimatch.js | 57 +- .../node_modules/brace-expansion/README.md | 2 +- .../node_modules/brace-expansion/example.js | 7 - .../node_modules/brace-expansion/index.js | 11 + .../node_modules/balanced-match/README.md | 4 +- .../node_modules/balanced-match/index.js | 2 +- .../node_modules/balanced-match/package.json | 56 +- .../node_modules/brace-expansion/package.json | 60 +- .../glob/node_modules/minimatch/package.json | 56 +- .../promzard/example/substack-input.js | 2 +- .../node_modules/promzard/promzard.js | 1 + .../node_modules/promzard/test/simple.js | 6 +- .../npm/node_modules/lodash.clonedeep/LICENSE | 64 +- .../node_modules/lodash.clonedeep/README.md | 4 +- .../node_modules/lodash.clonedeep/index.js | 1727 +++++++++++- .../node_modules/lodash._baseclone/README.md | 18 - .../node_modules/lodash._baseclone/index.js | 1644 ----------- .../lodash._baseclone/package.json | 101 - .../lodash.clonedeep/package.json | 71 +- deps/npm/node_modules/lodash.union/README.md | 4 +- deps/npm/node_modules/lodash.union/index.js | 997 ++++++- .../node_modules/lodash._baseflatten/LICENSE | 47 - .../lodash._baseflatten/README.md | 18 - .../node_modules/lodash._baseflatten/index.js | 349 --- .../lodash._baseflatten/package.json | 101 - .../node_modules/lodash.rest/LICENSE | 47 - .../node_modules/lodash.rest/README.md | 18 - .../node_modules/lodash.rest/index.js | 345 --- .../node_modules/lodash.rest/package.json | 105 - .../node_modules/lodash.union/package.json | 81 +- deps/npm/node_modules/lodash.uniq/README.md | 4 +- deps/npm/node_modules/lodash.uniq/index.js | 866 +++++- .../npm/node_modules/lodash.uniq/package.json | 77 +- .../npm/node_modules/lodash.without/README.md | 4 +- deps/npm/node_modules/lodash.without/index.js | 856 +++++- .../lodash._basedifference/LICENSE | 47 - .../lodash._basedifference/README.md | 18 - .../lodash._basedifference/index.js | 811 ------ .../node_modules/lodash._root/README.md | 18 - .../node_modules/lodash._root/index.js | 59 - .../node_modules/lodash._root/package.json | 101 - .../lodash._basedifference/package.json | 103 - .../node_modules/lodash.rest/LICENSE | 47 - .../node_modules/lodash.rest/README.md | 18 - .../node_modules/lodash.rest/index.js | 345 --- .../node_modules/lodash.rest/package.json | 105 - .../node_modules/lodash.without/package.json | 78 +- .../mkdirp/node_modules/minimist/index.js | 38 +- .../node_modules/minimist/test/parse.js | 28 +- .../minimist/test/parse_modified.js | 2 +- .../node_modules/minimist/test/short.js | 4 +- deps/npm/node_modules/node-gyp/CHANGELOG.md | 26 +- deps/npm/node_modules/node-gyp/README.md | 73 +- deps/npm/node_modules/node-gyp/addon.gypi | 12 +- .../gyp/pylib/gyp/generator/android.py | 3 +- .../node-gyp/gyp/pylib/gyp/generator/make.py | 8 +- deps/npm/node_modules/node-gyp/lib/build.js | 12 +- .../node_modules/node-gyp/lib/configure.js | 74 +- .../npm/node_modules/node-gyp/lib/node-gyp.js | 1 + .../node-gyp/lib/process-release.js | 2 +- .../node-gyp/node_modules/glob/common.js | 237 -- .../node-gyp/node_modules/glob/glob.js | 740 ----- .../glob/node_modules/minimatch/README.md | 216 -- .../glob/node_modules/minimatch/browser.js | 1159 -------- .../glob/node_modules/minimatch/minimatch.js | 912 ------ .../node_modules/brace-expansion/.npmignore | 3 - .../node_modules/brace-expansion/example.js | 7 - .../node_modules/balanced-match/.npmignore | 2 - .../node_modules/balanced-match/.travis.yml | 3 - .../node_modules/balanced-match/Makefile | 5 - .../node_modules/balanced-match/example.js | 4 - .../node_modules/balanced-match/package.json | 98 - .../balanced-match/test/balanced.js | 84 - .../glob/node_modules/minimatch/package.json | 63 - .../node-gyp/node_modules/glob/package.json | 72 - .../node-gyp/node_modules/glob/sync.js | 457 --- .../node_modules/minimatch/.npmignore | 1 - .../node_modules/minimatch/.travis.yml | 4 - .../node-gyp/node_modules/minimatch/LICENSE | 32 +- .../node-gyp/node_modules/minimatch/README.md | 13 +- .../node_modules/minimatch/minimatch.js | 736 ++--- .../node_modules/brace-expansion/README.md | 2 +- .../node_modules/brace-expansion/index.js | 11 + .../node_modules/balanced-match}/.npmignore | 2 + .../node_modules/balanced-match/LICENSE.md | 0 .../node_modules/balanced-match/README.md | 8 +- .../node_modules/balanced-match/index.js | 10 +- .../node_modules/balanced-match/package.json | 111 + .../node_modules/concat-map/.travis.yml | 0 .../node_modules/concat-map/LICENSE | 0 .../node_modules/concat-map/README.markdown | 0 .../node_modules/concat-map/example/map.js | 0 .../node_modules/concat-map/index.js | 0 .../node_modules/concat-map/package.json | 61 +- .../node_modules/concat-map/test/map.js | 0 .../node_modules/brace-expansion/package.json | 67 +- .../node_modules/lru-cache/.npmignore | 1 - .../node_modules/lru-cache/.travis.yml | 8 - .../node_modules/lru-cache/CONTRIBUTORS | 14 - .../node_modules/lru-cache/README.md | 137 - .../node_modules/lru-cache/lib/lru-cache.js | 334 --- .../node_modules/lru-cache/package.json | 84 - .../node_modules/lru-cache/test/basic.js | 396 --- .../node_modules/lru-cache/test/foreach.js | 120 - .../lru-cache/test/memory-leak.js | 51 - .../node_modules/lru-cache/test/serialize.js | 215 -- .../minimatch/node_modules/sigmund/README.md | 53 - .../minimatch/node_modules/sigmund/bench.js | 283 -- .../node_modules/sigmund/package.json | 85 - .../minimatch/node_modules/sigmund/sigmund.js | 39 - .../node_modules/sigmund/test/basic.js | 23 - .../node_modules/minimatch/package.json | 76 +- .../node_modules/minimatch/test/basic.js | 399 --- .../minimatch/test/brace-expand.js | 38 - .../node_modules/minimatch/test/caching.js | 14 - .../node_modules/minimatch/test/defaults.js | 274 -- .../test/extglob-ending-with-state-char.js | 8 - .../node-gyp/node_modules/npmlog/CHANGELOG.md | 36 + .../node-gyp/node_modules/npmlog/README.md | 17 +- .../node-gyp/node_modules/npmlog/log.js | 147 +- .../npmlog/node_modules/ansi/.npmignore | 1 - .../npmlog/node_modules/ansi/History.md | 23 - .../npmlog/node_modules/ansi/LICENSE | 24 - .../npmlog/node_modules/ansi/README.md | 98 - .../node_modules/ansi/examples/beep/index.js | 16 - .../node_modules/ansi/examples/clear/index.js | 15 - .../ansi/examples/cursorPosition.js | 32 - .../ansi/examples/progress/index.js | 87 - .../npmlog/node_modules/ansi/lib/ansi.js | 405 --- .../npmlog/node_modules/ansi/lib/newlines.js | 71 - .../npmlog/node_modules/ansi/package.json | 104 - .../node_modules/are-we-there-yet/README.md | 2 +- .../node_modules/delegates/package.json | 34 +- .../are-we-there-yet/package.json | 30 +- .../console-control-strings}/LICENSE | 8 +- .../console-control-strings/README.md | 145 + .../console-control-strings/index.js | 125 + .../console-control-strings/package.json | 108 + .../npmlog/node_modules/gauge/.npmignore | 32 - .../npmlog/node_modules/gauge/CHANGELOG.md | 131 + .../npmlog/node_modules/gauge/README.md | 405 ++- .../npmlog/node_modules/gauge/base-theme.js | 14 + .../npmlog/node_modules/gauge/error.js | 24 + .../npmlog/node_modules/gauge/example.png | Bin 19689 -> 0 bytes .../npmlog/node_modules/gauge/has-color.js | 12 + .../npmlog/node_modules/gauge/index.js | 226 ++ .../gauge/node_modules/has-color/index.js | 32 + .../gauge/node_modules/has-color/package.json | 117 + .../gauge/node_modules/has-color/readme.md | 30 + .../gauge/node_modules/lodash.pad/LICENSE | 47 - .../gauge/node_modules/lodash.pad/README.md | 18 - .../gauge/node_modules/lodash.pad/index.js | 434 --- .../node_modules/lodash._baseslice/README.md | 18 - .../node_modules/lodash._baseslice/index.js | 40 - .../lodash._baseslice/package.json | 104 - .../node_modules/lodash._basetostring/LICENSE | 47 - .../lodash._basetostring/README.md | 18 - .../lodash._basetostring/index.js | 153 - .../lodash._basetostring/package.json | 108 - .../node_modules/lodash.tostring/LICENSE | 47 - .../node_modules/lodash.tostring/README.md | 18 - .../node_modules/lodash.tostring/index.js | 178 -- .../node_modules/lodash.tostring/package.json | 112 - .../node_modules/lodash.pad/package.json | 116 - .../gauge/node_modules/lodash.padend/LICENSE | 47 - .../node_modules/lodash.padend/README.md | 18 - .../gauge/node_modules/lodash.padend/index.js | 428 --- .../node_modules/lodash._baseslice/LICENSE | 22 - .../node_modules/lodash._baseslice/README.md | 18 - .../node_modules/lodash._baseslice/index.js | 40 - .../lodash._baseslice/package.json | 115 - .../node_modules/lodash._basetostring/LICENSE | 47 - .../lodash._basetostring/README.md | 18 - .../lodash._basetostring/index.js | 153 - .../lodash._basetostring/package.json | 119 - .../node_modules/lodash.tostring/LICENSE | 47 - .../node_modules/lodash.tostring/README.md | 18 - .../node_modules/lodash.tostring/index.js | 178 -- .../node_modules/lodash.tostring/package.json | 123 - .../node_modules/lodash.padend/package.json | 116 - .../node_modules/lodash.padstart/LICENSE | 47 - .../node_modules/lodash.padstart/README.md | 18 - .../node_modules/lodash.padstart/index.js | 428 --- .../node_modules/lodash._baseslice/LICENSE | 22 - .../node_modules/lodash._baseslice/README.md | 18 - .../node_modules/lodash._baseslice/index.js | 40 - .../lodash._baseslice/package.json | 115 - .../node_modules/lodash._basetostring/LICENSE | 47 - .../lodash._basetostring/README.md | 18 - .../lodash._basetostring/index.js | 153 - .../lodash._basetostring/package.json | 119 - .../node_modules/lodash.tostring/LICENSE | 47 - .../node_modules/lodash.tostring/README.md | 18 - .../node_modules/lodash.tostring/index.js | 178 -- .../node_modules/lodash.tostring/package.json | 123 - .../node_modules/lodash.padstart/package.json | 116 - .../gauge/node_modules/object-assign/index.js | 83 + .../gauge/node_modules/object-assign/license} | 12 +- .../node_modules/object-assign/package.json | 126 + .../node_modules/object-assign/readme.md | 56 + .../node_modules/signal-exit/CHANGELOG.md | 17 + .../node_modules/signal-exit/LICENSE.txt | 14 + .../gauge/node_modules/signal-exit/README.md | 40 + .../gauge/node_modules/signal-exit/index.js | 148 + .../node_modules/signal-exit/package.json | 118 + .../gauge/node_modules/signal-exit/signals.js | 52 + .../gauge/node_modules/string-width/index.js | 37 + .../gauge/node_modules/string-width/license} | 12 +- .../node_modules/code-point-at/index.js | 33 + .../node_modules/code-point-at/license | 21 + .../node_modules/number-is-nan/index.js | 4 + .../node_modules/number-is-nan/license | 21 + .../node_modules/number-is-nan/package.json | 113 + .../node_modules/number-is-nan/readme.md | 30 + .../node_modules/code-point-at/package.json | 116 + .../node_modules/code-point-at/readme.md | 34 + .../is-fullwidth-code-point/index.js | 46 + .../is-fullwidth-code-point/license | 21 + .../node_modules/number-is-nan/index.js | 4 + .../node_modules/number-is-nan/license | 21 + .../node_modules/number-is-nan/package.json | 113 + .../node_modules/number-is-nan/readme.md | 30 + .../is-fullwidth-code-point/package.json | 120 + .../is-fullwidth-code-point/readme.md | 39 + .../node_modules/string-width/package.json | 136 + .../gauge/node_modules/string-width/readme.md | 42 + .../gauge/node_modules/wide-align/.npmignore | 5 + .../gauge/node_modules/wide-align}/LICENSE | 9 +- .../gauge/node_modules/wide-align/README.md | 47 + .../gauge/node_modules/wide-align/align.js | 65 + .../node_modules/wide-align/package.json | 105 + .../node_modules/wide-align/test/align.js | 37 + .../npmlog/node_modules/gauge/package.json | 118 +- .../npmlog/node_modules/gauge/plumbing.js | 47 + .../npmlog/node_modules/gauge/process.js | 3 + .../npmlog/node_modules/gauge/progress-bar.js | 248 +- .../node_modules/gauge/render-template.js | 181 ++ .../node_modules/gauge/set-immediate.js | 7 + .../npmlog/node_modules/gauge/set-interval.js | 3 + .../npmlog/node_modules/gauge/spin.js | 5 + .../node_modules/gauge/template-item.js | 73 + .../node_modules/gauge/test/progress-bar.js | 176 -- .../npmlog/node_modules/gauge/theme-set.js | 115 + .../npmlog/node_modules/gauge/themes.js | 54 + .../node_modules/gauge/wide-truncate.js | 25 + .../node_modules/set-blocking/CHANGELOG.md | 26 + .../node_modules/set-blocking/LICENSE.txt | 14 + .../node_modules/set-blocking/README.md | 31 + .../npmlog/node_modules/set-blocking/index.js | 7 + .../node_modules/set-blocking/package.json | 118 + .../node-gyp/node_modules/npmlog/package.json | 83 +- .../debug/node_modules/ms/package.json | 25 +- .../node_modules/debug/package.json | 45 +- .../node_modules/es6-symbol/.travis.yml | 1 + .../node_modules/es6-symbol/CHANGES | 6 + .../node_modules/es6-symbol/is-implemented.js | 13 +- .../es6-symbol/is-native-implemented.js | 2 +- .../node_modules/es6-symbol/is-symbol.js | 6 +- .../es6-symbol/node_modules/d/package.json | 33 +- .../node_modules/es5-ext/.travis.yml | 1 + .../es6-symbol/node_modules/es5-ext/CHANGES | 5 + .../es6-symbol/node_modules/es5-ext/README.md | 130 +- .../node_modules/es5-ext/array/#/flatten.js | 9 +- .../node_modules/es5-ext/date/valid-date.js | 2 +- .../node_modules/es6-iterator/README.md | 4 +- .../node_modules/es6-iterator/package.json | 29 +- .../node_modules/es5-ext/object/mixin.js | 14 +- .../node_modules/es5-ext/package.json | 69 +- .../es5-ext/test/string/#/camel-to-hyphen.js | 2 + .../es5-ext/test/string/#/hyphen-to-camel.js | 2 + .../node_modules/es6-symbol/package.json | 57 +- .../node_modules/es6-symbol/polyfill.js | 21 +- .../node_modules/es6-symbol/test/polyfill.js | 6 +- .../node_modules/array-index/package.json | 29 +- .../node_modules/path-array/package.json | 27 +- deps/npm/node_modules/node-gyp/package.json | 95 +- ...lay_load_hook.c => win_delay_load_hook.cc} | 2 +- .../node_modules/node-gyp/test/test-addon.js | 28 + .../test/test-find-accessible-sync.js | 86 + .../node_modules/npm-package-arg/.travis.yml | 1 + .../npm-registry-client/.travis.yml | 6 +- .../npm-registry-client/README.md | 2 + .../npm-registry-client/lib/publish.js | 3 +- .../npm-registry-client/lib/request.js | 44 +- .../node_modules/concat-stream/LICENSE | 30 +- .../node_modules/concat-stream/index.js | 19 +- .../node_modules/readable-stream/README.md | 2 +- .../doc/wg-meetings/2015-01-30.md | 2 + .../node_modules/isarray/Makefile | 1 + .../node_modules/isarray/test.js | 1 + .../typedarray/test/server/undef_globals.js | 2 +- .../node_modules/concat-stream/package.json | 135 +- .../node_modules/concat-stream/readme.md | 4 +- .../node_modules/npmlog/CHANGELOG.md | 36 + .../node_modules/npmlog}/LICENSE | 0 .../node_modules/npmlog/README.md | 210 ++ .../node_modules/npmlog/log.js | 298 ++ .../node_modules/are-we-there-yet/.npmignore | 5 + .../node_modules/are-we-there-yet/CHANGES.md | 19 + .../node_modules/are-we-there-yet/LICENSE | 5 + .../node_modules/are-we-there-yet/README.md | 194 ++ .../node_modules/are-we-there-yet/index.js | 4 + .../node_modules/delegates/.npmignore | 1 + .../node_modules/delegates/History.md | 22 + .../node_modules/delegates/License} | 4 +- .../node_modules/delegates/Makefile | 8 + .../node_modules/delegates/Readme.md | 94 + .../node_modules/delegates/index.js | 121 + .../node_modules/delegates/package.json | 96 + .../node_modules/delegates/test/index.js | 94 + .../are-we-there-yet/package.json | 102 + .../are-we-there-yet/test/lib/test-event.js | 29 + .../are-we-there-yet/test/tracker.js | 57 + .../are-we-there-yet/test/trackergroup.js | 96 + .../are-we-there-yet/test/trackerstream.js | 51 + .../are-we-there-yet/tracker-base.js | 11 + .../are-we-there-yet/tracker-group.js | 107 + .../are-we-there-yet/tracker-stream.js | 35 + .../node_modules/are-we-there-yet/tracker.js | 30 + .../console-control-strings}/LICENSE | 8 +- .../console-control-strings/README.md | 145 + .../console-control-strings/index.js | 125 + .../console-control-strings/package.json | 108 + .../npmlog/node_modules/gauge/CHANGELOG.md | 131 + .../npmlog/node_modules/gauge/LICENSE | 13 + .../npmlog/node_modules/gauge/README.md | 395 +++ .../npmlog/node_modules/gauge/base-theme.js | 14 + .../npmlog/node_modules/gauge/error.js | 24 + .../npmlog/node_modules/gauge/has-color.js | 12 + .../npmlog/node_modules/gauge/index.js | 226 ++ .../gauge/node_modules/has-color/index.js | 32 + .../gauge/node_modules/has-color/package.json | 117 + .../gauge/node_modules/has-color/readme.md | 30 + .../gauge/node_modules/object-assign/index.js | 83 + .../gauge/node_modules/object-assign/license | 21 + .../node_modules/object-assign/package.json | 126 + .../node_modules/object-assign/readme.md | 56 + .../node_modules/signal-exit/CHANGELOG.md | 17 + .../node_modules/signal-exit/LICENSE.txt | 14 + .../gauge/node_modules/signal-exit/README.md | 40 + .../gauge/node_modules/signal-exit/index.js | 148 + .../node_modules/signal-exit/package.json | 118 + .../gauge/node_modules/signal-exit/signals.js | 52 + .../gauge/node_modules/string-width/index.js | 37 + .../gauge/node_modules/string-width/license | 21 + .../node_modules/code-point-at/index.js | 33 + .../node_modules/code-point-at/license | 21 + .../node_modules/number-is-nan/index.js | 4 + .../node_modules/number-is-nan/license | 21 + .../node_modules/number-is-nan/package.json | 113 + .../node_modules/number-is-nan/readme.md | 30 + .../node_modules/code-point-at/package.json | 116 + .../node_modules/code-point-at/readme.md | 34 + .../is-fullwidth-code-point/index.js | 46 + .../is-fullwidth-code-point/license | 21 + .../node_modules/number-is-nan/index.js | 4 + .../node_modules/number-is-nan/license | 21 + .../node_modules/number-is-nan/package.json | 113 + .../node_modules/number-is-nan/readme.md | 30 + .../is-fullwidth-code-point/package.json | 120 + .../is-fullwidth-code-point/readme.md | 39 + .../node_modules/string-width/package.json | 136 + .../gauge/node_modules/string-width/readme.md | 42 + .../gauge/node_modules/wide-align/.npmignore | 5 + .../gauge/node_modules/wide-align}/LICENSE | 9 +- .../gauge/node_modules/wide-align/README.md | 47 + .../gauge/node_modules/wide-align/align.js | 65 + .../node_modules/wide-align/package.json | 105 + .../node_modules/wide-align/test/align.js | 37 + .../npmlog/node_modules/gauge/package.json | 140 + .../npmlog/node_modules/gauge/plumbing.js | 47 + .../npmlog/node_modules/gauge/process.js | 3 + .../npmlog/node_modules/gauge/progress-bar.js | 35 + .../node_modules/gauge/render-template.js | 181 ++ .../node_modules/gauge/set-immediate.js | 7 + .../npmlog/node_modules/gauge/set-interval.js | 3 + .../npmlog/node_modules/gauge/spin.js | 5 + .../node_modules/gauge/template-item.js | 73 + .../npmlog/node_modules/gauge/theme-set.js | 115 + .../npmlog/node_modules/gauge/themes.js | 54 + .../node_modules/gauge/wide-truncate.js | 25 + .../node_modules/set-blocking/CHANGELOG.md | 26 + .../node_modules/set-blocking/LICENSE.txt | 14 + .../node_modules/set-blocking/README.md | 31 + .../npmlog/node_modules/set-blocking/index.js | 7 + .../node_modules/set-blocking/package.json | 118 + .../node_modules/npmlog/package.json | 113 + .../node_modules/retry/Makefile | 1 + .../node_modules/retry/README.md | 46 +- .../node_modules/retry/example/dns.js | 2 +- .../node_modules/retry/example/stop.js | 40 + .../node_modules/retry/lib/retry.js | 11 +- .../node_modules/retry/lib/retry_operation.js | 29 +- .../node_modules/retry/package.json | 54 +- .../retry/test/integration/test-forever.js | 24 + .../test/integration/test-retry-operation.js | 70 + .../npm-registry-client/package.json | 100 +- .../npm-registry-client/test/00-setup.js | 5 +- .../test/config-defaults.js | 2 +- .../test/fetch-streaming.js | 58 + .../npm-registry-client/test/initialize.js | 4 +- .../npm-registry-client/test/lib/common.js | 8 + .../npm-registry-client/test/zz-cleanup.js | 5 +- .../npm-user-validate/npm-user-validate.js | 4 +- .../npm-user-validate/package.json | 40 +- .../npm-user-validate/test/username.test.js | 10 +- deps/npm/node_modules/npmlog/log.js | 7 +- .../node_modules/are-we-there-yet/README.md | 2 +- .../gauge/node_modules/string-width/index.js | 5 + .../node_modules/string-width/package.json | 59 +- .../gauge/node_modules/string-width/readme.md | 7 +- deps/npm/node_modules/npmlog/package.json | 83 +- deps/npm/node_modules/once/README.md | 28 + deps/npm/node_modules/once/once.js | 21 + deps/npm/node_modules/once/package.json | 72 +- .../glob/node_modules/minimatch/README.md | 11 +- .../glob/node_modules/minimatch/minimatch.js | 57 +- .../node_modules/brace-expansion/.npmignore | 3 - .../node_modules/brace-expansion/README.md | 2 +- .../node_modules/brace-expansion/example.js | 7 - .../node_modules/brace-expansion/index.js | 11 + .../node_modules/balanced-match/.npmignore | 7 +- .../node_modules/balanced-match/.travis.yml | 3 - .../node_modules/balanced-match/Makefile | 5 - .../node_modules/balanced-match/README.md | 8 +- .../node_modules/balanced-match/example.js | 4 - .../node_modules/balanced-match/index.js | 10 +- .../node_modules/balanced-match/package.json | 67 +- .../balanced-match/test/balanced.js | 84 - .../node_modules/brace-expansion/package.json | 65 +- .../glob/node_modules/minimatch/package.json | 56 +- .../json-parse-helpfulerror/LICENSE | 1 + .../node_modules/jju/LICENSE | 1 + .../node_modules/jju/README.md | 1 + .../node_modules/jju/lib/analyze.js | 1 + .../node_modules/jju/lib/document.js | 1 + .../node_modules/jju/lib/parse.js | 1 + .../node_modules/jju/lib/stringify.js | 1 + .../node_modules/jju/lib/utils.js | 1 + .../node_modules/jju/package.yaml | 1 + .../node_modules/readable-stream/.travis.yml | 9 +- .../node_modules/readable-stream/README.md | 4 +- .../readable-stream/doc/stream.md | 2511 +++++++++-------- .../doc/wg-meetings/2015-01-30.md | 2 + .../readable-stream/lib/_stream_readable.js | 248 +- .../lib/internal/streams/BufferList.js | 64 + .../node_modules/isarray/Makefile | 1 + .../node_modules/isarray/test.js | 1 + .../node_modules/readable-stream/package.json | 56 +- deps/npm/node_modules/request/.travis.yml | 4 +- deps/npm/node_modules/request/CHANGELOG.md | 38 +- deps/npm/node_modules/request/README.md | 5 +- deps/npm/node_modules/request/codecov.yml | 2 + .../request/node_modules/aws-sign2/index.js | 18 +- .../node_modules/aws-sign2/package.json | 87 +- .../request/node_modules/aws4/README.md | 1 + .../request/node_modules/aws4/aws4.js | 2 +- .../request/node_modules/aws4/lru.js | 96 + .../aws4/node_modules/lru-cache/README.md | 142 - .../node_modules/lru-cache/lib/lru-cache.js | 469 --- .../lru-cache/node_modules/pseudomap/LICENSE | 15 - .../node_modules/pseudomap/README.md | 60 - .../lru-cache/node_modules/pseudomap/map.js | 9 - .../node_modules/pseudomap/package.json | 77 - .../node_modules/pseudomap/pseudomap.js | 113 - .../node_modules/pseudomap/test/basic.js | 86 - .../lru-cache/node_modules/yallist/.npmignore | 4 - .../node_modules/yallist/.travis.yml | 7 - .../node_modules/yallist/CONTRIBUTING.md | 4 - .../lru-cache/node_modules/yallist/LICENSE | 15 - .../lru-cache/node_modules/yallist/README.md | 204 -- .../node_modules/yallist/package.json | 77 - .../node_modules/yallist/test/basic.js | 188 -- .../lru-cache/node_modules/yallist/yallist.js | 360 --- .../aws4/node_modules/lru-cache/package.json | 95 - .../request/node_modules/aws4/package.json | 49 +- .../bl/node_modules/readable-stream/README.md | 2 +- .../doc/wg-meetings/2015-01-30.md | 2 + .../node_modules/core-util-is/package.json | 33 +- .../node_modules/isarray/Makefile | 1 + .../node_modules/isarray/package.json | 37 +- .../node_modules/isarray/test.js | 1 + .../process-nextick-args/index.js | 39 +- .../process-nextick-args/package.json | 47 +- .../node_modules/string_decoder/package.json | 35 +- .../node_modules/util-deprecate/package.json | 33 +- .../node_modules/readable-stream/package.json | 35 +- .../request/node_modules/bl/package.json | 27 +- .../node_modules/caseless/package.json | 95 +- .../node_modules/delayed-stream/Makefile | 1 + .../node_modules/delayed-stream/package.json | 100 +- .../node_modules/combined-stream/package.json | 99 +- .../request/node_modules/extend/.jscs.json | 1 + .../request/node_modules/extend/CHANGELOG.md | 1 + .../request/node_modules/extend/LICENSE | 1 + .../request/node_modules/extend/README.md | 1 + .../node_modules/extend/component.json | 1 + .../request/node_modules/extend/index.js | 1 + .../request/node_modules/extend/package.json | 116 +- .../node_modules/forever-agent/index.js | 12 +- .../node_modules/forever-agent/package.json | 92 +- .../form-data/node_modules/async/CHANGELOG.md | 4 +- .../form-data/node_modules/async/README.md | 8 +- .../node_modules/async/dist/async.js | 2 +- .../form-data/node_modules/async/lib/async.js | 2 +- .../form-data/node_modules/async/package.json | 55 +- .../node_modules/form-data/package.json | 53 +- .../node_modules/ansi-styles/package.json | 25 +- .../escape-string-regexp/package.json | 31 +- .../chalk/node_modules/has-ansi/package.json | 115 +- .../node_modules/supports-color/package.json | 112 +- .../node_modules/chalk/package.json | 31 +- .../node_modules/commander/Readme.md | 9 +- .../node_modules/commander/index.js | 1 + .../node_modules/graceful-readlink/LICENSE | 1 + .../node_modules/graceful-readlink/index.js | 2 + .../graceful-readlink/package.json | 87 +- .../node_modules/commander/package.json | 106 +- .../generate-function/package.json | 95 +- .../node_modules/is-property/README.md | 2 +- .../node_modules/is-property/package.json | 97 +- .../generate-object-property/package.json | 95 +- .../node_modules/jsonpointer/package.json | 104 +- .../node_modules/xtend/package.json | 55 +- .../is-my-json-valid/package.json | 37 +- .../test/json-schema-draft4/not.json | 2 +- .../node_modules/pinkie/package.json | 27 +- .../node_modules/pinkie/readme.md | 2 +- .../node_modules/pinkie-promise/package.json | 25 +- .../node_modules/har-validator/package.json | 35 +- .../request/node_modules/hawk/.npmignore | 1 + .../request/node_modules/hawk/.travis.yml | 1 + .../request/node_modules/hawk/README.md | 10 +- .../node_modules/hawk/example/usage.js | 1 + .../request/node_modules/hawk/lib/client.js | 3 + .../request/node_modules/hawk/lib/index.js | 1 + .../request/node_modules/hawk/lib/utils.js | 1 + .../hawk/node_modules/boom/.npmignore | 1 + .../hawk/node_modules/boom/.travis.yml | 1 + .../hawk/node_modules/boom/package.json | 25 +- .../hawk/node_modules/cryptiles/.npmignore | 1 + .../hawk/node_modules/cryptiles/.travis.yml | 1 + .../hawk/node_modules/cryptiles/lib/index.js | 2 + .../hawk/node_modules/cryptiles/package.json | 106 +- .../hawk/node_modules/hoek/package.json | 105 +- .../hawk/node_modules/sntp/.npmignore | 1 + .../hawk/node_modules/sntp/.travis.yml | 1 + .../hawk/node_modules/sntp/Makefile | 3 +- .../hawk/node_modules/sntp/README.md | 1 + .../hawk/node_modules/sntp/examples/offset.js | 1 + .../hawk/node_modules/sntp/examples/time.js | 1 + .../hawk/node_modules/sntp/package.json | 104 +- .../hawk/node_modules/sntp/test/index.js | 1 + .../request/node_modules/hawk/package.json | 37 +- .../request/node_modules/hawk/test/readme.js | 1 + .../request/node_modules/hawk/test/server.js | 1 + .../request/node_modules/hawk/test/uri.js | 1 + .../node_modules/http-signature/CHANGES.md | 2 +- .../node_modules/assert-plus/package.json | 29 +- .../node_modules/jsprim/CHANGES.md | 5 + .../node_modules/jsprim/README.md | 17 +- .../node_modules/jsprim/lib/jsprim.js | 14 +- .../node_modules/extsprintf/jsl.node.conf | 3 +- .../node_modules/extsprintf/package.json | 25 +- .../jsprim/node_modules/json-schema/README.md | 2 +- .../json-schema/draft-00/hyper-schema | 20 +- .../json-schema/draft-00/json-ref | 10 +- .../node_modules/json-schema/draft-00/links | 10 +- .../node_modules/json-schema/draft-00/schema | 50 +- .../json-schema/draft-01/hyper-schema | 20 +- .../json-schema/draft-01/json-ref | 10 +- .../node_modules/json-schema/draft-01/links | 10 +- .../node_modules/json-schema/draft-01/schema | 50 +- .../json-schema/draft-02/hyper-schema | 20 +- .../json-schema/draft-02/json-ref | 10 +- .../node_modules/json-schema/draft-02/links | 12 +- .../node_modules/json-schema/draft-02/schema | 52 +- .../json-schema/draft-03/examples/calendar | 12 +- .../json-schema/draft-03/examples/interfaces | 24 +- .../json-schema/draft-03/json-ref | 10 +- .../node_modules/json-schema/draft-03/links | 12 +- .../node_modules/json-schema/draft-03/schema | 62 +- .../node_modules/json-schema/draft-04/links | 14 +- .../node_modules/json-schema/draft-04/schema | 66 +- .../json-schema/draft-zyp-json-schema-03.xml | 400 +-- .../json-schema/draft-zyp-json-schema-04.xml | 390 +-- .../node_modules/json-schema/lib/links.js | 8 +- .../node_modules/json-schema/lib/validate.js | 4 +- .../node_modules/json-schema/package.json | 25 +- .../jsprim/node_modules/verror/README.md | 18 +- .../jsprim/node_modules/verror/jsl.node.conf | 3 +- .../jsprim/node_modules/verror/package.json | 25 +- .../node_modules/jsprim/package.json | 47 +- .../node_modules/sshpk/.travis.yml | 6 +- .../node_modules/sshpk/README.md | 252 +- .../node_modules/sshpk/bin/sshpk-conv | 16 +- .../node_modules/sshpk/bin/sshpk-sign | 17 +- .../node_modules/sshpk/lib/certificate.js | 291 ++ .../node_modules/sshpk/lib/errors.js | 28 +- .../node_modules/sshpk/lib/fingerprint.js | 35 +- .../node_modules/sshpk/lib/formats/auto.js | 16 +- .../sshpk/lib/formats/openssh-cert.js | 289 ++ .../node_modules/sshpk/lib/formats/pem.js | 44 +- .../node_modules/sshpk/lib/formats/pkcs1.js | 8 +- .../node_modules/sshpk/lib/formats/pkcs8.js | 17 +- .../node_modules/sshpk/lib/formats/rfc4253.js | 4 +- .../sshpk/lib/formats/ssh-private.js | 6 +- .../node_modules/sshpk/lib/formats/ssh.js | 4 +- .../sshpk/lib/formats/x509-pem.js | 77 + .../node_modules/sshpk/lib/formats/x509.js | 484 ++++ .../node_modules/sshpk/lib/identity.js | 255 ++ .../node_modules/sshpk/lib/index.js | 15 +- .../node_modules/sshpk/lib/key.js | 38 +- .../node_modules/sshpk/lib/private-key.js | 31 +- .../node_modules/sshpk/lib/signature.js | 20 +- .../node_modules/sshpk/lib/ssh-buffer.js | 24 + .../node_modules/sshpk/lib/utils.js | 41 +- .../node_modules/sshpk/man/man1/sshpk-conv.1 | 6 +- .../sshpk/node_modules/asn1/package.json | 33 +- .../node_modules => }/assert-plus/AUTHORS | 0 .../node_modules => }/assert-plus/CHANGES.md | 0 .../node_modules => }/assert-plus/README.md | 0 .../node_modules => }/assert-plus/assert.js | 0 .../assert-plus/package.json | 67 +- .../node_modules/dashdash/lib/dashdash.js | 35 +- .../sshpk/node_modules/dashdash/package.json | 53 +- .../sshpk/node_modules/ecc-jsbn/index.js | 7 +- .../node_modules/ecc-jsbn/lib/LICENSE-jsbn | 6 +- .../sshpk/node_modules/ecc-jsbn/lib/ec.js | 6 +- .../sshpk/node_modules/ecc-jsbn/package.json | 39 +- .../sshpk/node_modules/getpass/.npmignore | 8 + .../sshpk/node_modules/getpass/.travis.yml | 9 + .../sshpk/node_modules/getpass/LICENSE | 18 + .../sshpk/node_modules/getpass/README.md | 32 + .../sshpk/node_modules/getpass/lib/index.js | 123 + .../sshpk/node_modules/getpass/package.json | 91 + .../sshpk/node_modules/jodid25519/index.js | 8 +- .../node_modules/jodid25519/package.json | 37 +- .../sshpk/node_modules/jsbn/LICENSE | 6 +- .../sshpk/node_modules/jsbn/README.md | 4 +- .../sshpk/node_modules/jsbn/example.html | 4 +- .../sshpk/node_modules/jsbn/package.json | 31 +- .../sshpk/node_modules/tweetnacl/CHANGELOG.md | 59 +- .../sshpk/node_modules/tweetnacl/COPYING.txt | 9 - .../sshpk/node_modules/tweetnacl/README.md | 66 +- .../sshpk/node_modules/tweetnacl/nacl-fast.js | 74 +- .../node_modules/tweetnacl/nacl-fast.min.js | 4 +- .../sshpk/node_modules/tweetnacl/nacl.js | 72 +- .../sshpk/node_modules/tweetnacl/nacl.min.js | 2 +- .../sshpk/node_modules/tweetnacl/package.json | 94 +- .../node_modules/sshpk/package.json | 96 +- .../node_modules/http-signature/package.json | 21 +- .../node_modules/is-typedarray/package.json | 29 +- .../node_modules/isstream/package.json | 108 +- .../request/node_modules/isstream/test.js | 3 + .../json-stringify-safe/CHANGELOG.md | 4 +- .../json-stringify-safe/package.json | 102 +- .../node_modules/mime-types/HISTORY.md | 6 + .../node_modules/mime-db/HISTORY.md | 21 + .../mime-types/node_modules/mime-db/db.json | 54 +- .../node_modules/mime-db/package.json | 75 +- .../node_modules/mime-types/package.json | 65 +- .../request/node_modules/node-uuid/LICENSE.md | 2 +- .../node-uuid/benchmark/bench.gnu | 36 +- .../node_modules/node-uuid/package.json | 29 +- .../request/node_modules/oauth-sign/README.md | 2 +- .../request/node_modules/oauth-sign/index.js | 3 +- .../node_modules/oauth-sign/package.json | 66 +- .../request/node_modules/oauth-sign/test.js | 89 - .../request/node_modules/qs/.npmignore | 18 - .../request/node_modules/qs/.travis.yml | 69 - .../request/node_modules/qs/CHANGELOG.md | 17 +- .../request/node_modules/qs/README.md | 41 + .../request/node_modules/qs/bower.json | 21 - .../request/node_modules/qs/component.json | 15 - .../request/node_modules/qs/dist/qs.js | 158 +- .../request/node_modules/qs/lib/parse.js | 82 +- .../request/node_modules/qs/lib/stringify.js | 66 +- .../request/node_modules/qs/lib/utils.js | 10 +- .../request/node_modules/qs/package.json | 78 +- .../request/node_modules/qs/test/parse.js | 68 +- .../request/node_modules/qs/test/stringify.js | 46 + .../node_modules/stringstream/package.json | 33 +- .../node_modules/tough-cookie/README.md | 20 +- .../node_modules/tough-cookie/lib/cookie.js | 18 +- .../node_modules/tough-cookie/package.json | 64 +- .../node_modules/tunnel-agent/index.js | 6 +- .../node_modules/tunnel-agent/package.json | 50 +- deps/npm/node_modules/request/package.json | 96 +- deps/npm/node_modules/request/request.js | 28 +- deps/npm/node_modules/retry/Readme.md | 18 +- deps/npm/node_modules/retry/example/dns.js | 2 +- deps/npm/node_modules/retry/example/stop.js | 40 + deps/npm/node_modules/retry/lib/retry.js | 4 + .../node_modules/retry/lib/retry_operation.js | 9 + deps/npm/node_modules/retry/package.json | 55 +- .../retry/test/integration/test-forever.js | 24 + .../test/integration/test-retry-operation.js | 70 + deps/npm/node_modules/rimraf/package.json | 68 +- deps/npm/node_modules/rimraf/rimraf.js | 16 +- deps/npm/node_modules/semver/.npmignore | 4 - deps/npm/node_modules/semver/.travis.yml | 5 - deps/npm/node_modules/semver/README.md | 39 +- deps/npm/node_modules/semver/package.json | 62 +- deps/npm/node_modules/semver/range.bnf | 2 +- deps/npm/node_modules/semver/semver.js | 27 +- .../node_modules/semver/test/big-numbers.js | 31 - deps/npm/node_modules/semver/test/clean.js | 29 - deps/npm/node_modules/semver/test/gtr.js | 173 -- deps/npm/node_modules/semver/test/index.js | 698 ----- deps/npm/node_modules/semver/test/ltr.js | 181 -- .../semver/test/major-minor-patch.js | 72 - deps/npm/node_modules/tar/lib/entry.js | 2 +- .../block-stream/test/two-stream.js | 4 +- .../node_modules/tar/test/parse-discard.js | 4 +- .../node_modules/unique-slug/README.md | 1 + .../validate-npm-package-license/LICENSE | 234 +- .../node_modules/builtins/History.md | 10 +- deps/npm/node_modules/which/CHANGELOG.md | 4 + deps/npm/node_modules/which/changelog.sh | 9 - deps/npm/node_modules/which/package.json | 47 +- .../node_modules/write-file-atomic/.npmignore | 4 - .../write-file-atomic/.travis.yml | 11 - .../node_modules/write-file-atomic/LICENSE | 1 + .../node_modules/write-file-atomic/README.md | 2 +- .../node_modules/write-file-atomic/index.js | 60 +- .../write-file-atomic/package.json | 68 +- .../write-file-atomic/test/basic.js | 97 - deps/npm/package.json | 52 +- deps/npm/scripts/changelog.js | 44 +- deps/npm/scripts/maketest | 94 + deps/npm/test/common-tap.js | 1 + .../{tap => network}/bearer-token-check.js | 0 .../{tap => network}/git-cache-locking.js | 0 .../{tap => network}/git-cache-no-hooks.js | 0 deps/npm/test/{tap => network}/it.js | 0 .../{tap => network}/legacy-bundled-git.js | 0 .../{tap => network}/legacy-optional-deps.js | 0 .../{tap => network}/legacy-shrinkwrap.js | 0 .../test/{tap => network}/legacy-url-dep.js | 0 .../test/{tap => network}/outdated-symlink.js | 0 deps/npm/test/{tap => network}/registry.js | 0 .../test/tap/404-private-registry-scoped.js | 25 +- deps/npm/test/tap/404-private-registry.js | 22 +- deps/npm/test/tap/add-local.js | 137 + deps/npm/test/tap/bundled-dependencies.js | 112 + deps/npm/test/tap/correct-mkdir.js | 105 + deps/npm/test/tap/files-and-ignores.js | 7 +- deps/npm/test/tap/full-warning-messages.js | 4 +- .../test/tap/install-cli-only-shrinkwrap.js | 139 + deps/npm/test/tap/install-parse-error.js | 1 + .../test/tap/install-property-conflicts.js | 74 + .../npm/test/tap/install-shrinkwrapped-git.js | 159 ++ .../test/tap/invalid-dep-version-filtering.js | 135 + deps/npm/test/tap/lifecycle-order.js | 57 + deps/npm/test/tap/lifecycle-path.js | 39 +- .../test/tap/local-args-relative-to-cwd.js | 65 + deps/npm/test/tap/node-modules-path-munge.js | 39 + .../optional-metadep-rollback-collision.js | 6 +- .../test/tap/shrinkwrap-default-arg-ver.js | 104 + deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js | 93 + .../test/tap/shrinkwrap-local-dependency.js | 188 +- .../test/tap/shrinkwrap-optional-platform.js | 96 + .../test/tap/shrinkwrap-optional-property.js | 100 + .../tap/shrinkwrap-prod-dependency-also.js | 1 + .../test/tap/shrinkwrap-prod-dependency.js | 1 + .../shrinkwrap-save-dev-with-existing-deps.js | 102 + ...wrap-save-dev-without-existing-dev-deps.js | 87 + .../npm/test/tap/shrinkwrap-transitive-dev.js | 83 + deps/npm/test/tap/update-symlink.js | 118 +- 994 files changed, 30299 insertions(+), 27685 deletions(-) create mode 100644 deps/npm/.github/issue_template.md create mode 100644 deps/npm/lib/install/is-dev-dep.js delete mode 100644 deps/npm/lib/install/is-dev.js create mode 100644 deps/npm/lib/install/is-opt-dep.js create mode 100644 deps/npm/lib/install/is-prod-dep.js create mode 100644 deps/npm/lib/install/is-registry-specifier.js create mode 100644 deps/npm/lib/install/realize-shrinkwrap-specifier.js create mode 100644 deps/npm/lib/install/report-optional-failure.js delete mode 100644 deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore delete mode 100644 deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js create mode 100644 deps/npm/node_modules/fstream-npm/test/scoped.js rename deps/npm/node_modules/{node-gyp/node_modules => }/glob/README.md (85%) delete mode 100644 deps/npm/node_modules/inherits/test.js delete mode 100644 deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js delete mode 100644 deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md delete mode 100644 deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js delete mode 100644 deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js delete mode 100644 deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/README.md delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/index.js delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/package.json delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js delete mode 100644 deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/common.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/glob.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/glob/sync.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/README.md (99%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/index.js (90%) rename deps/npm/node_modules/{init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion => node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.npmignore (58%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md (100%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md (90%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js (80%) create mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml (100%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE (100%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown (100%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js (100%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js (100%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json (69%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js (100%) rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules => }/minimatch/node_modules/brace-expansion/package.json (61%) delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/CHANGELOG.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/.npmignore delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/History.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/README.md delete mode 100755 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js delete mode 100755 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/clear/index.js delete mode 100755 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/progress/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/ansi.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/newlines.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/package.json rename deps/npm/node_modules/node-gyp/node_modules/{minimatch/node_modules/sigmund => npmlog/node_modules/console-control-strings}/LICENSE (81%) create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/README.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/.npmignore create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/CHANGELOG.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/base-theme.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/error.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/example.png create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/has-color.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js rename deps/npm/node_modules/{lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/LICENSE => node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license} (76%) create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js rename deps/npm/node_modules/{lodash.clonedeep/node_modules/lodash._baseclone/LICENSE => node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license} (76%) create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore rename deps/npm/node_modules/node-gyp/node_modules/{glob/node_modules/minimatch => npmlog/node_modules/gauge/node_modules/wide-align}/LICENSE (82%) create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/plumbing.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/process.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/render-template.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-immediate.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-interval.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/spin.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/template-item.js delete mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/test/progress-bar.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/theme-set.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/themes.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/wide-truncate.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/README.md create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/index.js create mode 100644 deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/package.json rename deps/npm/node_modules/node-gyp/src/{win_delay_load_hook.c => win_delay_load_hook.cc} (92%) create mode 100644 deps/npm/node_modules/node-gyp/test/test-addon.js create mode 100644 deps/npm/node_modules/node-gyp/test/test-find-accessible-sync.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/CHANGELOG.md rename deps/npm/node_modules/{node-gyp/node_modules/glob => npm-registry-client/node_modules/npmlog}/LICENSE (100%) create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/README.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/log.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/README.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md rename deps/npm/node_modules/{node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/LICENSE => npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License} (83%) create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js rename deps/npm/node_modules/{request/node_modules/aws4/node_modules/lru-cache => npm-registry-client/node_modules/npmlog/node_modules/console-control-strings}/LICENSE (81%) create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/README.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/CHANGELOG.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/LICENSE create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/README.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/base-theme.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/error.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/has-color.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore rename deps/npm/node_modules/{node-gyp/node_modules/minimatch/node_modules/lru-cache => npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align}/LICENSE (82%) create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/plumbing.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/process.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/progress-bar.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/render-template.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-immediate.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-interval.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/spin.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/template-item.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/theme-set.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/themes.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/wide-truncate.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/README.md create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/index.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/npmlog/package.json create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js create mode 100644 deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js create mode 100644 deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js delete mode 100644 deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js create mode 100644 deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js create mode 100644 deps/npm/node_modules/request/codecov.yml create mode 100644 deps/npm/node_modules/request/node_modules/aws4/lru.js delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js delete mode 100644 deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/certificate.js create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/openssh-cert.js create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509-pem.js create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509.js create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/identity.js rename deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/{dashdash/node_modules => }/assert-plus/AUTHORS (100%) rename deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/{dashdash/node_modules => }/assert-plus/CHANGES.md (100%) rename deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/{dashdash/node_modules => }/assert-plus/README.md (100%) rename deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/{dashdash/node_modules => }/assert-plus/assert.js (100%) rename deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/{dashdash/node_modules => }/assert-plus/package.json (58%) create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.npmignore create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.travis.yml create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/LICENSE create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/README.md create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/lib/index.js create mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/package.json delete mode 100644 deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt delete mode 100644 deps/npm/node_modules/request/node_modules/oauth-sign/test.js delete mode 100644 deps/npm/node_modules/request/node_modules/qs/.npmignore delete mode 100644 deps/npm/node_modules/request/node_modules/qs/.travis.yml delete mode 100644 deps/npm/node_modules/request/node_modules/qs/bower.json delete mode 100644 deps/npm/node_modules/request/node_modules/qs/component.json create mode 100644 deps/npm/node_modules/retry/example/stop.js create mode 100644 deps/npm/node_modules/retry/test/integration/test-forever.js delete mode 100644 deps/npm/node_modules/semver/.npmignore delete mode 100644 deps/npm/node_modules/semver/.travis.yml delete mode 100644 deps/npm/node_modules/semver/test/big-numbers.js delete mode 100644 deps/npm/node_modules/semver/test/clean.js delete mode 100644 deps/npm/node_modules/semver/test/gtr.js delete mode 100644 deps/npm/node_modules/semver/test/index.js delete mode 100644 deps/npm/node_modules/semver/test/ltr.js delete mode 100644 deps/npm/node_modules/semver/test/major-minor-patch.js delete mode 100644 deps/npm/node_modules/which/changelog.sh delete mode 100644 deps/npm/node_modules/write-file-atomic/.npmignore delete mode 100644 deps/npm/node_modules/write-file-atomic/.travis.yml delete mode 100644 deps/npm/node_modules/write-file-atomic/test/basic.js create mode 100755 deps/npm/scripts/maketest rename deps/npm/test/{tap => network}/bearer-token-check.js (100%) rename deps/npm/test/{tap => network}/git-cache-locking.js (100%) rename deps/npm/test/{tap => network}/git-cache-no-hooks.js (100%) rename deps/npm/test/{tap => network}/it.js (100%) rename deps/npm/test/{tap => network}/legacy-bundled-git.js (100%) rename deps/npm/test/{tap => network}/legacy-optional-deps.js (100%) rename deps/npm/test/{tap => network}/legacy-shrinkwrap.js (100%) rename deps/npm/test/{tap => network}/legacy-url-dep.js (100%) rename deps/npm/test/{tap => network}/outdated-symlink.js (100%) rename deps/npm/test/{tap => network}/registry.js (100%) create mode 100644 deps/npm/test/tap/add-local.js create mode 100644 deps/npm/test/tap/bundled-dependencies.js create mode 100644 deps/npm/test/tap/install-cli-only-shrinkwrap.js create mode 100644 deps/npm/test/tap/install-property-conflicts.js create mode 100644 deps/npm/test/tap/install-shrinkwrapped-git.js create mode 100644 deps/npm/test/tap/invalid-dep-version-filtering.js create mode 100644 deps/npm/test/tap/lifecycle-order.js create mode 100644 deps/npm/test/tap/local-args-relative-to-cwd.js create mode 100644 deps/npm/test/tap/node-modules-path-munge.js create mode 100644 deps/npm/test/tap/shrinkwrap-default-arg-ver.js create mode 100644 deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js create mode 100644 deps/npm/test/tap/shrinkwrap-optional-platform.js create mode 100644 deps/npm/test/tap/shrinkwrap-optional-property.js create mode 100644 deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js create mode 100644 deps/npm/test/tap/shrinkwrap-save-dev-without-existing-dev-deps.js create mode 100644 deps/npm/test/tap/shrinkwrap-transitive-dev.js diff --git a/deps/npm/.github/issue_template.md b/deps/npm/.github/issue_template.md new file mode 100644 index 00000000000000..a40c57fa3d25e5 --- /dev/null +++ b/deps/npm/.github/issue_template.md @@ -0,0 +1,69 @@ +#### I'm opening this issue because: + + - [ ] npm is crashing. + - [ ] npm is producing an incorrect install. + - [ ] npm is doing something I don't understand. + - [ ] Other (_see below for feature requests_): + +#### What's going wrong? + +#### How can the CLI team reproduce the problem? + + + +### supporting information: + + - `npm -v` prints: + - `node -v` prints: + - `npm config get registry` prints: + - Windows, OS X, or Linux?: + - Network issues: + - Geographic location where npm was run: + - [ ] I use a proxy to connect to the npm registry. + - [ ] I use a proxy to connect to the web. + - [ ] I use a proxy when downloading Git repos. + - [ ] I access the npm registry via a VPN + - [ ] I don't use a proxy, but have limited or unreliable internet access. + - Container: + - [ ] I develop using Vagrant on Windows. + - [ ] I develop using Vagrant on OS X or Linux. + - [ ] I develop / deploy using Docker. + - [ ] I deploy to a PaaS (Triton, Heroku). + + + + diff --git a/deps/npm/.mailmap b/deps/npm/.mailmap index 06eb16cff3ee50..abd5c5d4a24c70 100644 --- a/deps/npm/.mailmap +++ b/deps/npm/.mailmap @@ -15,6 +15,7 @@ Dave Galbraith David Beitey Domenic Denicola Einar Otto Stangvik +Emma Ramirez Erik Wienhold Evan Lucas Evan Lucas @@ -23,6 +24,7 @@ Forbes Lindesay Forrest L Norvell Gabriel Barros Geoff Flarity +Gregers Gram Rygg Ifeanyi Oraelosi Isaac Z. Schlueter Isaac Z. Schlueter isaacs diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index d4cef3e3d15175..988ee7e30a770f 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -1,23 +1,31 @@ +sudo: false +# need to declare the language as well as the matrix below language: node_js -node_js: - # LTS is our most important target - - "4" - # next LTS and master is next most important - - "6" - # still in LTS maintenance until fall 2016 - # (also still in wide use) - - "0.10" - # will be unsupported as soon as 6 becomes LTS and 7 released - - "5" - # technically in LTS / distros, unbeloved - - "0.12" -env: - - DEPLOY_VERSION=testing +# having top-level `env:` adds a phantom build +# https://github.com/travis-ci/travis-ci/issues/4681 +#env: DEPLOY_VERSION=testing +matrix: + include: + # LTS is our most important target + - node_js: "4" + # DEPLOY_VERSION is used to set the couchapp setup mode for test/tap/registry.js + # only gather coverage info for LTS + env: DEPLOY_VERSION=testing COVERALLS_REPO_TOKEN="$COVERALLS_OPTIONAL_TOKEN" + # next LTS and master is next most important + - node_js: "6" + env: DEPLOY_VERSION=testing + # still in LTS maintenance until fall 2016 (also still in wide use) + - node_js: "0.10" + env: DEPLOY_VERSION=testing + # will be unsupported as soon as 6 becomes LTS and 7 released + - node_js: "5" + env: DEPLOY_VERSION=testing + # technically in LTS / distros, unbeloved + - node_js: "0.12" + env: DEPLOY_VERSION=testing before_install: - - "npm config set spin false" - "node . install -g ." + # required by test/tap/registry.js - "mkdir -p /var/run/couchdb" -sudo: false -script: "npm test" notifications: slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 9e9000de638ccb..d3c64f53cc64f6 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -408,3 +408,25 @@ Aaron Tribou Tapani Moilanen Han Seoul-Oh Aleksey Shvayka +Emma Ramirez +Julian Duque +Simon MacDonald +Adam Stankiewicz +Gregers Gram Rygg +Peter Dave Hello +Jordan Klassen +Jason Palmer +Michael Hart +Sasha Koss +David Emmerson +Christophe Hurpeau +Daniel Paz-Soldan +Sakthipriyan Vairamani +Zach Renner +Christopher Hiller +legodude17 +Andrew Meyer +Michael Jasper +Max +Szymon Nowak +Jason Karns diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 4f94100434f573..eae0e4aed2c391 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,593 @@ +### v3.10.8 (2016-09-08) + +Monthly releases are so big! Just look at all this stuff! + +Our quarter of monthly releases is almost over. The next one, in October, might +very well be our last one as we move to trying something different and learning +lessons from our little experiment. + +You may also want to keep an eye our for `npm@4` next month, since we're +planning on finally releasing it then and including a (small) number of breaking +changes we've been meaning to do for a long time. Don't worry, though: `npm@3` +will still be around for a bit and will keep getting better and better, and is +most likely going to be the version that `node@6` uses once it goes to LTS. + +As some of us have mentioned before, npm is likely to start doing more regular +semver-major bumps, while keeping those bumps significantly smaller than the +huge effort that was `npm@3` -- we're not very likely to do a world-shaking +thing like that for a while, if ever. + +All that said, let's move on to the patches included in v3.10.8! + +#### SHRINKWRAP LEVEL UP + +The most notable part of this release is a series of commits meant to make `npm +shrinkwrap` more consistent. By itself, shrinkwrap seems like a fairly +straightforward thing to implement, but things get complicated when it starts +interacting with `devDependencies`, `optionalDependencies`, and +`bundledDependencies`. These commits address some corner cases related to these. + +* [`a7eca32`](https://github.com/npm/npm/commit/a7eca3246fbbcbb05434cb6677f65d14c945d74f) + [#10073](https://github.com/npm/npm/pull/10073) + Record if a dependency is only used as a devDependency and exclude it from the + shrinkwrap file. + ([@bengl](https://github.com/bengl)) +* [`1eabcd1`](https://github.com/npm/npm/commit/1eabcd16bf2590364ca20831096350073539bf3a) + [#10073](https://github.com/npm/npm/pull/10073) + Record if a dependency is optional to shrinkwrap. + ([@bengl](https://github.com/bengl)) +* [`03efc89`](https://github.com/npm/npm/commit/03efc89522c99ee0fa37d8f4a99bc3b44255ef98) + [#13692](https://github.com/npm/npm/pull/13692/) + We were doing a weird thing where we used a `package.json` field `installable` + to check to see if we'd checked for platform compatibility, and if not did + so. But this was the only place that was ever done so there was no reason to + implement it in such an obfuscated manner. + Instead it now just directly checks and then records that its done so on the + node object with `knownInstallable`. This is useful to know because modules + expanded via shrinkwrap don't go through this– `inflateShrinkwrap` does not + currently have any rollback semantics and so checking this sort of thing there + is unhelpful. + ([@iarna](https://github.com/iarna)) +* [`ff87938`](https://github.com/npm/npm/commit/ff879382fda21dac7216a5f666287b3a7e74a947) + [#11735](https://github.com/npm/npm/issues/11735) + Running `npm install --save-dev` will now update shrinkwrap file, but only + if there already are devDependencies in it. + ([@szimek](https://github.com/szimek)) +* [`c00ca3a`](https://github.com/npm/npm/commit/c00ca3aef836709eeaeade91c5305bc2fbda2e8a) + [#13394](https://github.com/npm/npm/issues/13394) + Check installability of modules from shrinkwrap, since modules that came into + the tree vie shrinkwrap won't already have this information recorded in + advance. + ([@iarna](https://github.com/iarna)) + +#### INSTALLER ERROR REPORTING LEVEL UP + +As part of the shrinkwrap push, there were also a lot of error-reporting +improvements. Some to add more detail to error objects, others to fix bugs and +inconsistencies. + +* [`2cdd713`](https://github.com/npm/npm/commit/2cdd7132abddcc7f826a355c14348ce9a5897ffe) + Consistently set code on `ETARGET` when fetching package metadata if no + compatible version is found. + ([@iarna](https://github.com/iarna)) +* [`cabcd17`](https://github.com/npm/npm/commit/cabcd173f2923cb5b77e7be0e42eea2339a24727) + [#13692](https://github.com/npm/npm/pull/13692/) + Include installer warning details at the `verbose` log level. + ([@iarna](https://github.com/iarna)) +* [`95a4044`](https://github.com/npm/npm/commit/95a4044cbae93d19d0da0f3cd04ea8fa620295d9) + [`dbb14c2`](https://github.com/npm/npm/commit/dbb14c241d982596f1cdaee251658f5716989fd2) + [`9994383`](https://github.com/npm/npm/commit/9994383959798f80749093301ec43a8403566bb6) + [`7417000`](https://github.com/npm/npm/commit/74170003db0c53def9b798cb6fe3fe7fc3e06482) + [`f45f85d`](https://github.com/npm/npm/commit/f45f85dac800372d63dfa8653afccbf5bcae7295) + [`e79cc1b`](https://github.com/npm/npm/commit/e79cc1b11440f0d122c4744d5eff98def9553f4a) + [`146ee39`](https://github.com/npm/npm/commit/146ee394b1f7a33cf409a30b835a85d939acb438) + [#13692](https://github.com/npm/npm/pull/13692/) + Improve various bits of error reporting, adding more error information and + some related refactoring. + ([@iarna](https://github.com/iarna)) + +#### MISCELLANEOUS BUGS LEVEL UP + +* [`116b6c6`](https://github.com/npm/npm/commit/116b6c60a174ea0cc49e4d62717e4e26175b6534) + [#13456](https://github.com/npm/npm/issues/13456) + In lifecycle scripts, any `node_modules/.bin` existing in the hierarchy + should be turned into an entry in the PATH environment variable. + However, prior to this commit, it was splitting based on the string + `node_modules`, rather than restricting it to only path portions like + `/node_modules/` or `\node_modules\`. So, a path containing an entry + like `my_node_modules` would be improperly split. + ([@isaacs](https://github.com/isaacs)) +* [`0a28dd0`](https://github.com/npm/npm/commit/0a28dd0104e5b4a8cc0cb038bd213e6a50827fe8) + [npm/fstream-npm#23](https://github.com/npm/fstream-npm/pull/23) + `fstream-npm@1.2.0`: + Always ignore `*.orig` files, which are generated by git when using `git + mergetool`, by default. + ([@zkat](https://github.com/zkat)) +* [`a3a2fb9`](https://github.com/npm/npm/commit/a3a2fb97adc87c2aa9b2b8957861b30efafc7ad0) + [#13708](https://github.com/npm/npm/pull/13708) + Always ignore `*.orig` files, which are generated by git when using `git + mergetool`, by default. + ([@boneskull](https://github.com/boneskull)) + +#### TOOLING LEVEL UP + +* [`e1d7e6c`](https://github.com/npm/npm/commit/e1d7e6ce551cbc42026cdcadcb37ea515059c972) + Add helper for generating test skeletons. + ([@iarna](https://github.com/iarna)) +* [`4400b35`](https://github.com/npm/npm/commit/4400b356bca9175935edad1469c608c909bc01bf) + Fix fixture creation and cleanup in `maketest`. + ([@iarna](https://github.com/iarna)) + +#### DOCUMENTATION LEVEL UP + +* [`8eb9460`](https://github.com/npm/npm/commit/8eb94601fe895b97cbcf8c6134e6b371c5371a1e) + [#13717](https://github.com/npm/npm/pull/13717) + Document that `npm link` will link the files specified in the `bin` field of + `package.json` to `{prefix}/bin/{name}`. + ([@legodude17](https://github.com/legodude17)) +* [`a66e5e9`](https://github.com/npm/npm/commit/a66e5e9c388878fe03fb29014c3b95d28bedd3c1) + [#13682](https://github.com/npm/npm/pull/13682) + Minor grammar fix in documentation for `npm scripts`. + ([@Ajedi32](https://github.com/Ajedi32)) +* [`74b8043`](https://github.com/npm/npm/commit/74b80437ffdfcf8172f6ed4f39bfb021608dd9dd) + [#13655](https://github.com/npm/npm/pull/13655) + Document line comment syntax for `.npmrc`. + ([@mdjasper](https://github.com/mdjasper)) +* [`b352a84`](https://github.com/npm/npm/commit/b352a84c2c7ad15e9c669af75f65cdaa964f86c0) + [#12438](https://github.com/npm/npm/issues/12438) + Remind folks to use `#!/usr/bin/env node` in their `bin` scripts to make files + executable directly. + ([@mxstbr](https://github.com/mxstbr)) +* [`b82fd83`](https://github.com/npm/npm/commit/b82fd838edbfff5d2833a62f6d8ae8ea2df5a1f2) + [#13493](https://github.com/npm/npm/pull/13493) + Document that the user config file can itself be configured either through the + `$NPM_CONFIG_USERCONFIG` environment variable, or `--userconfig` command line + flag. + ([@jasonkarns](https://github.com/jasonkarns)) +* [`8a02699`](https://github.com/npm/npm/commit/8a026992a03d90e563a97c70e90926862120693b) + [#13911](https://github.com/npm/npm/pull/13911) + Minor documentation reword and cleanup. + ([@othiym23](https://github.com/othiym23)) + +#### DEPENDENCY LEVEL UP + +* [`2818fb0`](https://github.com/npm/npm/commit/2818fb0f6081d68a91f0905945ad102f26c6cf85) + `glob@7.0.6` + ([@isaacs](https://github.com/isaacs)) +* [`d88ec81`](https://github.com/npm/npm/commit/d88ec81ad33eb2268fcd517d35346a561bc59aff) + `graceful-fs@4.1.6` + ([@francescoinfante](https://github.com/francescoinfante)) +* [`4727f86`](https://github.com/npm/npm/commit/4727f8646daca7b3e3c1c95860e02acf583b9dae) + `lodash.clonedeep@4.5.0` + ([@jdalton](https://github.com/jdalton)) +* [`c347678`](https://github.com/npm/npm/commit/c3476780ef4483425e4ae1d095a5884b46b8db86) + `lodash.union@4.6.0` + ([@jdalton](https://github.com/jdalton)) +* [`530bd4d`](https://github.com/npm/npm/commit/530bd4d2ae6f704f624e4f7bf64f911f37e2b7f8) + `lodash.uniq@4.5.0` + ([@jdalton](https://github.com/jdalton)) +* [`483d56a`](https://github.com/npm/npm/commit/483d56ae8137eca0c0f7acd5d1c88ca6d5118a6a) + `lodash.without@4.4.0` + ([@jdalton](https://github.com/jdalton)) +* [`6c934df`](https://github.com/npm/npm/commit/6c934df6e74bacd0ed40767b319936837a43b586) + `inherits@2.0.3` + ([@isaacs](https://github.com/isaacs)) +* [`a65ed7c`](https://github.com/npm/npm/commit/a65ed7cbd3c950383a14461a4b2c87b67ef773b9) + `npm-registry-client@7.2.1`: + * [npm/npm-registry-client#142](https://github.com/npm/npm-registry-client/pull/142) Fix `EventEmitter` warning spam from error handlers on socket. ([@addaleax](https://github.com/addaleax)) + * [npm/npm-registry-client#131](https://github.com/npm/npm-registry-client/pull/131) Adds support for streaming request bodies. ([@aredridel](https://github.com/aredridel)) + * Fixes [#13656](https://github.com/npm/npm/issues/13656). + * Dependency updates. + * Documentation improvements. + ([@othiym23](https://github.com/othiym23)) +* [`2b88d62`](https://github.com/npm/npm/commit/2b88d62e6a730716b27052c0911c094d01830a60) + [npm/npmlog#34](https://github.com/npm/npmlog/pull/34) + `npmlog@4.0.0`: + Allows creating log levels that are empty strings or 0 + ([@rwaldron](https://github.com/rwaldron)) +* [`242babb`](https://github.com/npm/npm/commit/242babbd02274ee2d212ae143992c20f47ef0066) + `once@1.4.0` + ([@zkochan](https://github.com/zkochan)) +* [`6d8ba2b`](https://github.com/npm/npm/commit/6d8ba2b4918e2295211130af68ee8a67099139e0) + `readable-stream@2.1.5` + ([@calvinmetcalf](https://github.com/calvinmetcalf)) +* [`855c099`](https://github.com/npm/npm/commit/855c099482a8d93b7f0646bd7bcf8a31f81868e0) + `retry@0.10.0` + ([@tim-kos](https://github.com/tim-kos)) +* [`80540c5`](https://github.com/npm/npm/commit/80540c52b252615ae8a6271b3df870eabfea935e) + `semver@5.3.0`: + * Add `minSatisfying` + * Add `prerelease(v)` + ([@isaacs](https://github.com/isaacs)) +* [`8aaac52`](https://github.com/npm/npm/commit/8aaac52ffae8e689fae265712913b1e2a36b1aa6) + `which@1.2.1` + ([@isaacs](https://github.com/isaacs)) +* [`85108a2`](https://github.com/npm/npm/commit/85108a29108ab0a57997572dc14f87eb706890ba) + `write-file-atomic@1.2.0`: + Preserve chmod and chown from the overwritten file + ([@iarna](https://github.com/iarna)) +* [`291a377`](https://github.com/npm/npm/commit/291a377f32f5073102a8ede61a27e6a9b37154c2) + Update npm documentation to reflect documentation for `semver@5.3.0`. + ([@zkat](https://github.com/zkat)) + +### v3.10.7 (2016-08-11) + +Hi all, today's our first release coming out of the new monthly release +cadence. See below for details. We're all recovered from conferences now +and raring to go! We've got some pretty keen bug fixes and a bunch of +documentation and dependency updates. It's hard to narrow it down to just a +few, but of note are scoped packages in bundled dependencies, the +`preinstall` lifecycle fix, the shrinkwrap and Git dependencies fix and the +fix to a crasher involving cycles in development dependencies. + +#### NEW RELEASE CADENCE + +Releasing npm has been, for the most part, a very prominent part of our +weekly process process. As part of our efforts to find the most effective +ways to allocate our team's resources, we decided last month that we would +try and slow our releases down to a monthly cadence, and see if we found +ourselves with as much extra time and attention as we expected to have. +Process experiments are useful for finding more effective ways to do our +work, and we're at least going to keep doing this for a whole quarter, and +then measure how well it worked out. It's entirely likely that we'll switch +back to a more frequent cadence, specially if we find that the value that +weekly cadence was providing the community is not worth sacrificing for a +bit of extra time. Does this affect you significantly? Let us know! + +#### SCOPED PACKAGES IN BUNDLED DEPENDENCIES + +Prior to this release and +[v2.15.10](https://github.com/npm/npm/releases/v2.15.10), npm had ignored +scoped modules found in `bundleDependencies`. + +* [`29cf56d`](https://github.com/npm/npm/commit/29cf56dbae8e3dd16c24876f998051623842116a) + [#8614](https://github.com/npm/npm/issues/8614) + Include scoped packages in bundled dependencies. + ([@forivall](https://github.com/forivall)) + +#### `preinstall` LIFECYCLE IN CURRENT PROJECT + +* [`b7f13bc`](https://github.com/npm/npm/commit/b7f13bc80b89b025be0c53d81b90ec8f2cebfab7) + [#13259](https://github.com/npm/npm/pull/13259) + Run top level preinstall before installing dependencies + ([@palmerj3](https://github.com/palmerj3)) + +#### BETTER SHRINKWRAP WITH GIT DEPENDENCIES + +* [`0f7e319`](https://github.com/npm/npm/commit/0f7e3197bcec7a328b603efdffd3681bbc40f585) + [#12718](https://github.com/npm/npm/issues/12718.) + Update outdated git dependencies found in shrinkwraps. Previously, if the + module version was the same then no update would be completed even if the + committish had changed. + ([@kossnocorp](https://github.com/kossnocorp)) + + +#### CYCLES IN DEVELOPMENT DEPENDENCIES NO LONGER CRASH + +* [`1691de6`](https://github.com/npm/npm/commit/1691de668d34cd92ab3de08bf3a06085388f2f07) + [#13327](https://github.com/npm/npm/issues/13327) + Fix bug where cycles found in development dependencies could result in + infinite recursion that resulted in crashes. + ([@iarna](https://github.com/iarna)) + +#### IMPROVE "NOT UPDATING LINKED MODULE" WARNINGS + +* [`1619871`](https://github.com/npm/npm/commit/1619871ac0cc8839dc9962c78e736095976c1eb4) + [#12893](https://github.com/npm/npm/pull/12893) + Only warn about symlink update if version number differs + The update-linked action outputs a warning that it needs to update the + linked package, but can't, There is no need for the package to be updated if + it is already at the correct version. This change does a check before + logging the warning. + ([@DaveEmmerson](https://github.com/DaveEmmerson)) + +#### MORE BUG FIXES + +* [`8f8d1b3`](https://github.com/npm/npm/commit/8f8d1b33a78c79aff9de73df362abaa7f05751d2) + [#11398](https://github.com/npm/npm/issues/11398) + Fix bug where `package.json` files that contained a `type` property could + cause crashes. `type` is not a `package.json` property that npm makes use + of and having it should be (and now is) harmless. + ([@zkat](https://github.com/zkat)) +* [`e7fa6c6`](https://github.com/npm/npm/commit/e7fa6c6a2c1de2a214479daa8c6901eebb350381) + [#13353](https://github.com/npm/npm/issues/13353) + Add GIT_EXEC_PATH to Git environment whitelist. + ([@mhart](https://github.com/mhart)) +* [`c23af21`](https://github.com/npm/npm/commit/c23af21d4cedd7fedcb4168672044db76ad054a8) + [#13626](https://github.com/npm/npm/pull/13626) + Use HTTPS issues URL in the error message for type validation errors. + ([@watilde](https://github.com/watilde)) + +#### INCLUDE `npm login` IN COMMAND SUMMARY + +* [`ab0c4b1`](https://github.com/npm/npm/commit/ab0c4b137b05762e75e0913038b606f087b58aa0) + [#13581](https://github.com/npm/npm/issues/13581) + The `login` command has long been an alias for `adduser`. + At the same time, there is an expectation not just of that + particular word being something to look for, but of there being + clear symmetry with `logout`. + So it was a bit confusing when `login` didn't show up in + `npm help` on a technicality. This seems like an acceptable + exception to the rule that says "no aliases in `npm help`". + ([@zkat](https://github.com/zkat)) + +#### DOCUMENTATION + +* [`e2d7e78`](https://github.com/npm/npm/commit/e2d7e7820a7875ed96e0382dc1e91b8df4e83746) + [#13319](https://github.com/npm/npm/pull/13319) + As Node.js 0.8 is no longer supported, remove mention of it from the README. + ([@watilde](https://github.com/watilde)) +* [`c565d89`](https://github.com/npm/npm/commit/c565d893a38efb6006e841450503329c9e58f100) + [#13349](https://github.com/npm/npm/pull/13349) + Updated the scripts documentation to explain the different between `version` and `preversion`. + ([@christophehurpeau](https://github.com/christophehurpeau)) +* [`fa8f87f`](https://github.com/npm/npm/commit/fa8f87f1ec92e543dd975156c4b184eb3e0b80cb) + [#10167](https://github.com/npm/npm/pull/10167) + Clarify in scope documentation that npm@2 is required for scoped packages. + ([@danpaz](https://github.com/danpaz)) + +#### DEPENDENCIES + +* [`124427e`](https://github.com/npm/npm/commit/124427eabbfd200aa145114e389e19692559ff1e) + [#8614](https://github.com/npm/npm/issues/8614) + `fstream-npm@1.1.1`: + Fixes bug with inclusion of scoped bundled dependencies. + ([@forivall](https://github.com/forivall)) +* [`7e0cdff`](https://github.com/npm/npm/commit/7e0cdff04714709f6dc056b19422d3f937502f1c) + [#13497](https://github.com/npm/npm/pull/13497) + `graceful-fs@4.1.5`: + `graceful-fs` had a [bug fix](https://github.com/isaacs/node-graceful-fs/pull/71) which + fixes a problem ([nodejs/node#7846](https://github.com/nodejs/node/pull/7846)) exposed + by recent changes to Node.js. + ([@thefourtheye](https://github.com/thefourtheye)) +* [`9b88cb8`](https://github.com/npm/npm/commit/9b88cb89f138443f324094685f4de073f33ecef0) + [#9984](https://github.com/npm/npm/issues/9984) + `request@2.74.0`: + Update request library to at least 2.73 to fix a bug where `npm install` would crash with + _Cannot read property 'emit' of null._ + + Update `request` dependency `tough-cookie` to `2.3.0` to + to address [https://nodesecurity.io/advisories/130](https://nodesecurity.io/advisories/130). + Versions 0.9.7 through 2.2.2 contain a vulnerable regular expression that, + under certain conditions involving long strings of semicolons in the + "Set-Cookie" header, causes the event loop to block for excessive amounts of + time. + ([@zarenner](https://github.com/zarenner)) + ([@stash-sfdc](https://github.com/stash-sfdc)) +* [`bf78ce5`](https://github.com/npm/npm/commit/bf78ce5ef5d2d6e95177193cca5362dd27bff968) + [#13387](https://github.com/npm/npm/issues/13387) + `minimatch@3.0.3`: + Handle extremely long and terrible patterns more gracefully. + There were some magic numbers that assumed that every extglob pattern starts + and ends with a specific number of characters in the regular expression. + Since !(||) patterns are a little bit more complicated, this led to creating + an invalid regular expression and throwing. + ([@isaacs](https://github.com/isaacs)) +* [`803e538`](https://github.com/npm/npm/commit/803e538efaae4b56a764029742adcf6761e8398b) + [isaacs/rimraf#111](https://github.com/isaacs/rimraf/issues/111) + `rimraf@2.5.4`: Clarify assertions: cb is required, options are not. + ([@isaacs](https://github.com/isaacs)) +* [`a9f84ef`](https://github.com/npm/npm/commit/a9f84ef61b4c719b646bf9cda00577ef16e3a113) + `lodash.without@4.2.0` + ([@jdalton](https://github.com/jdalton)) +* [`f59ff1c`](https://github.com/npm/npm/commit/f59ff1c2701f1bfd21bfdb97b4571823b614f694) + `lodash.uniq@4.4.0` + ([@jdalton](https://github.com/jdalton)) +* [`8cc027e`](https://github.com/npm/npm/commit/8cc027e5e81623260a49b31fe406ce483258b203) + `lodash.union@4.5.0` + ([@jdalton](https://github.com/jdalton)) +* [`0a6c1e4`](https://github.com/npm/npm/commit/0a6c1e4302a153fb055f495043ed33afd8324193) + `lodash.without@4.3.0` + ([@jdalton](https://github.com/jdalton)) +* [`4ab0181`](https://github.com/npm/npm/commit/4ab0181fca2eda18888b865ef691b83d30fb0c33) + `lodash.clonedeep@4.4.1` + ([@jdalton](https://github.com/jdalton)) + +### v3.10.6 (2016-07-07) + +This week we have a bunch of bug fixes for ya! A shrinkwrap regression +introduced in 3.10.0, better lifecycle `PATH` behavior, improvements when +working with registries other than `registry.npmjs.org` and a fix for +hopefully the last _don't print a progress bar over my interactive thingy_ +bug. + +#### SHRINKWRAP AND DEV DEPENDENCIES + +The rewrite in 3.10.0 triggered a bug where dependencies of devDependencies +would be included in your shrinkwrap even if you didn't request +devDependencies. + +* [`2484529`](https://github.com/npm/npm/commit/2484529ab56a42e5d6f13c48006f39a596d9e327) + [#13308](https://github.com/npm/npm/pull/13308) + Fix bug where deps of devDependencies would be incorrectly included in + shrinkwraps. + ([@iarna](https://github.com/iarna)) + +#### BETTER PATH LIFECYCLE BEHAVIOR + +We've been around the details on this one a few times in recent months and +hopefully this will bring is to where we want to be. + +* [`81051a9`](https://github.com/npm/npm/commit/81051a90eee66a843f76eb8cccedbb1d0a5c1f47) + [#12968](https://github.com/npm/npm/pull/12968) + When running lifecycle scripts, only prepend directory containing the node + binary to PATH if not already in PATH. + ([@segrey](https://github.com/segrey)) + +#### BETTER INTERACTIONS WITH THIRD PARTY REGISTRIES + +* [`071193c`](https://github.com/npm/npm/commit/071193c8e193767dd1656cb27556cb3751d77a3b) + [#10869](https://github.com/npm/npm/pull/10869) + If the registry returns a list of versions some of which are invalid, skip + those when picking a version to install. This can't happen with + registry.npmjs.org as it will normalize versions published with it, but it + can happen with other registries. + ([@gregersrygg](https://github.com/gregersrygg)) + +#### ONE LAST TOO-MUCH-PROGRESS CORNER + +* [`1244cc1`](https://github.com/npm/npm/commit/1244cc16dc5a0536acf26816a1deeb8e221d67eb) + [#13305](https://github.com/npm/npm/pull/13305) + Disable progress bar in `npm edit` and `npm config edit`. + ([@watilde](https://github.com/watilde)) + +#### HTML DOCS IMPROVEMENTS + +* [`58da923`](https://github.com/npm/npm/commit/58da9234ae72a5474b997f890a1155ee9785e6f1) + [#13225](https://github.com/npm/npm/issues/13225) + Fix HTML character set declaration in generated HTML documentation. + ([@KenanY](https://github.com/KenanY)) +* [`d1f0bf4`](https://github.com/npm/npm/commit/d1f0bf4303566f8690502034f82bbb449850958d) + [#13250](https://github.com/npm/npm/pull/13250) + Optimize png images using zopflipng. + ([@PeterDaveHello](https://github.com/PeterDaveHello)) + +#### DEPENDENCY UPDATES (THAT MATTER) + +* [`c7567e5`](https://github.com/npm/npm/commit/c7567e58618b63f97884afa104d2f560c9272dd5) + [npm/npm-user-validate#9](https://github.com/npm/npm-user-validate/pull/9) + `npm-user-validate@0.1.5`: + Lower the username length limits to 214 from 576 to match `registry.npmjs.org`'s limits. + ([@aredridel](https://github.com/aredridel)) +* [`22802c9`](https://github.com/npm/npm/commit/22802c9db3cf990c905e8f61304db9b5571d7964) + [#isaacs/rimraf](https://github.com/npm/npm/issues/isaacs/rimraf) + `rimraf@2.5.3`: + Fixes EPERM errors when running `lstat` on read-only directories. + ([@isaacs](https://github.com/isaacs)) +* [`ce6406f`](https://github.com/npm/npm/commit/ce6406f4b6c4dffbb5cd8a3c049f6663a5665522) + `glob@7.0.5`: + Forces the use of `minimatch` to 3.0.2, which improved handling of long and + complicated patterns. + ([@isaacs](https://github.com/isaacs)) + + +### v3.10.5 (2016-07-05) + +This is a fix to this week's testing release to correct the update of +`node-gyp` which somehow got mangled. + +* [`ca97ce2`](https://github.com/npm/npm/commit/ca97ce2e8d8ba44c445b39ffa40daf397d5601b3) + [#13256](https://github.com/npm/npm/issues/13256) + Fresh reinstall of `node-gyp@3.4.0`. + ([@zkat](https://github.com/zkat)) + +### v3.10.4 (2016-06-30) + +Hey y'all! This release includes a bunch of fixes we've been working on as we +continue on our `big-bug` push. There's still [a lot of it left to +do](https://github.com/npm/npm/labels/big-bug), but once this is done, things +should just generally be more stable, installs should be more reliable and +correct, and we'll be able to move on to more future work. We'll keep doing our +best! 🙌 + +#### RACES AS WACKY AS [REDLINE](https://en.wikipedia.org/wiki/Redline_\(2009_film\)) + +Races are notoriously hard to squash, and tend to be some of the more common +recurring bugs we see on the CLI. [@julianduque](https://github.com/julianduque) +did some pretty awesome [sleuthing +work](https://github.com/npm/npm/issues/12669) to track down a cache race and +helpfully submitted a patch. There were some related races in the same area that +also got fixed at around the same time, mostly affecting Windows users. + +* [`2a37c97`](https://github.com/npm/npm/commit/2a37c97121483db2b6f817fe85c2a5a77b76080e) + [#12669](https://github.com/npm/npm/issues/12669) + [#13023](https://github.com/npm/npm/pull/13023) + The CLI is pretty aggressive about correcting permissions across the cache + whenever it writes to it. This aggressiveness caused a couple of races where + temporary cache files would get picked up by `fs.readdir`, and removed before + `chownr` was called on them, causing `ENOENT` errors. While the solution might + seem a bit hamfisted, it's actually perfectly safe and appropriate in this + case to just ignore those resulting `ENOENT` errors. + ([@julianduque](https://github.com/julianduque)) +* [`ea018b9`](https://github.com/npm/npm/commit/ea018b9e3856d1798d199ae3ebce4ed07eea511b) + [#13023](https://github.com/npm/npm/pull/13023) + If a user were to have SUDO_UID and SUDO_GID, they'd be able to get into a + pretty weird state. This fixes that corner case. + ([@zkat](https://github.com/zkat)) +* [`703ca3a`](https://github.com/npm/npm/commit/703ca3abbf4f1cb4dff08be32acd2142d5493482) + [#13023](https://github.com/npm/npm/pull/13023) + A missing `return` was causing `chownr` to be called on Windows, even though + that's literally pointless, and causing crashes in the process, instead of + short-circuiting. This was entirely dependent on which callback happened to be + called first, and in some cases, the failing one would win the race. This + should prevent this from happening in the future. + ([@zkat](https://github.com/zkat)) +* [`69267f4`](https://github.com/npm/npm/commit/69267f4fbd1467ce576f173909ced361f8fe2a9d) + [#13023](https://github.com/npm/npm/pull/13023) + Added tests to verify `correct-mkdir` race patch. + ([@zkat](https://github.com/zkat)) +* [`e5f50ea`](https://github.com/npm/npm/commit/e5f50ea9f84fe8cac6978d18f7efdf43834928e7) + [#13023](https://github.com/npm/npm/pull/13023) + Added tests to verify `addLocal` race patch. + ([@zkat](https://github.com/zkat)) + +#### SHRINKWRAP IS COMPLICATED BUT IT'S BETTER NOW + +[@iarna](https://github.com/iarna) did some heroic hacking to refactor a bunch +of `shrinkwrap`-related bits and fixed some resolution and pathing issues that +were biting users. The code around that stuff got more readable/maintainable in +the process, too! + +* [`346bba1`](https://github.com/npm/npm/commit/346bba1e1fee9cc814b07c56f598a73be5c21686) + [#13214](https://github.com/npm/npm/pull/13214) + Resolve local dependencies in `npm-shrinkwrap.json` relative to the top of the + tree. + ([@iarna](https://github.com/iarna)) +* [`4a67fdb`](https://github.com/npm/npm/commit/4a67fdbd0f160deb6644a9c4c5b587357db04d2d) + [#13213](https://github.com/npm/npm/pull/13213) + If you run `npm install modulename` it should, if a `npm-shrinkwrap.json` is + present, use the version found there. If not, it'll use the version found in + your `package.json`, and failing *that*, use `latest`. + This fixes a case where the first check was being bypassed because version + resolution was being done prior to loading the shrinkwrap, and so checks to + match the shrinkwrap version couldn't succeed. + ([@iarna](https://github.com/iarna)) +* [`afa2133`](https://github.com/npm/npm/commit/afa2133a5d8ac4f6f44cdc6083d89ad7f946f5bb) + [#13214](https://github.com/npm/npm/pull/13214) + Refactor shrinkwrap specifier lookup into shared function. + ([@iarna](https://github.com/iarna)) +* [`2820b56`](https://github.com/npm/npm/commit/2820b56a43e1cc1e12079a4c886f6c14fe8c4f10) + [#13214](https://github.com/npm/npm/pull/13214) + Refactor operations in `inflate-shrinkwrap.js` into separate functions for + added clarity. + ([@iarna](https://github.com/iarna)) +* [`ee5bfb3`](https://github.com/npm/npm/commit/ee5bfb3e56ee7ae582bec9f741f32b224c279947) + Fix Windows path issue in a shrinkwrap test. + ([@zkat](https://github.com/zkat)) + +#### OTHER BUGFIXES + +* [`a11a7b2`](https://github.com/npm/npm/commit/a11a7b2e7df9478ac9101b06eead4a74c41a648d) + [#13212](https://github.com/npm/npm/pull/13212) + Resolve local paths passed in through the command line relative to current + directory, instead of relative to the `package.json`. + ([@iarna](https://github.com/iarna)) + +#### DEPENDENCY UPDATES + +* [`900a5b7`](https://github.com/npm/npm/commit/900a5b7f18b277786397faac05853c030263feb8) + [#13199](https://github.com/npm/npm/pull/13199) + [`node-gyp@3.4.0`](https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md): + AIX, Visual Studio 2015, and logging improvements. Oh my~! + ([@rvagg](https://github.com/rvagg)) + +#### DOCUMENTATION FIXES + +* [`c6942a7`](https://github.com/npm/npm/commit/c6942a7d6acb2b8c73206353bbec03380a056af4) + [#13134](https://github.com/npm/npm/pull/13134) + Fixed a few typos in `CHANGELOG.md`. + ([@watilde](https://github.com/watilde)) +* [`e63d913`](https://github.com/npm/npm/commit/e63d913127731ece56dcd69c7c0182af21be58f8) + [#13156](https://github.com/npm/npm/pull/13156) + Fix old reference to `doc/install` in a source comment. + ([@sheerun](https://github.com/sheerun)) +* [`099d23c`](https://github.com/npm/npm/commit/099d23cc8f38b524dc19a25857b2ebeca13c49d6) + [#13113](https://github.com/npm/npm/issues/13113) + [#13189](https://github.com/npm/npm/pull/13189) + Fixes a link to `npm-tag(3)` that was breaking to instead point to + `npm-dist-tag(1)`, as reported by [@SimenB](https://github.com/SimenB) + ([@macdonst](https://github.com/macdonst)) + ### v3.10.3 (2016-06-23) Given that we had not one, but two updates to our RC this past week, it @@ -88,12 +678,12 @@ unrecoverable errors then npm would crash instead of printing the error. * [`6a33b2c`](https://github.com/npm/npm/commit/6a33b2c13f637a41e25cd0339925bc430b50358a) [#13115](https://github.com/npm/npm/issues/13115) Ensure that errors reading the package tree for `outdated` does not result - in crashs. + in crashes. ([@iarna](https://github.com/iarna)) ### v3.10.1 (2016-06-17): -There are two very important bug fixes and one long-awaited (and signifcant!) +There are two very important bug fixes and one long-awaited (and significant!) deprecation in this hotfix release. [Hold on.](http://butt.holdings/) #### *WHOA* @@ -225,7 +815,7 @@ Node.js 0.10 and 0.12, it's unlikely that patches that rely on ES 2015 functionality will land anytime soon. Looking forward, the team's current plan is to drop support for Node.js 0.10 -when its LTS maintenace window expires in October, 2016, and 0.12 when its +when its LTS maintenance window expires in October, 2016, and 0.12 when its maintenance / LTS window ends at the end of 2016. We will also drop support for Node.js 5.x when Node.js 6 becomes LTS and Node.js 7 is released, also in the October-December 2016 timeframe. diff --git a/deps/npm/README.md b/deps/npm/README.md index a2e2481dd793d2..671dd387403bad 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -9,7 +9,7 @@ Much more info available via `npm help` once it's installed. ## IMPORTANT -**You need node v0.8 or higher to run this program.** +**You need node v0.10 or higher to run this program.** To install an old **and unsupported** version of npm that works on node 0.3 and prior, clone the git repo and dig through the old tags and branches. diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md index 177bf41ec2b300..874ce1c2872e1f 100644 --- a/deps/npm/doc/cli/npm-install.md +++ b/deps/npm/doc/cli/npm-install.md @@ -183,6 +183,7 @@ after packing it up into a tarball (b). to the environment when running git: * `GIT_ASKPASS` + * `GIT_EXEC_PATH` * `GIT_PROXY_COMMAND` * `GIT_SSH` * `GIT_SSH_COMMAND` @@ -271,7 +272,7 @@ global `node_modules` folder. Only your direct dependencies will show in `node_modules` and everything they depend on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. -The `--ignore-scripts` argument will cause npm to not execute any +The `--ignore-scripts` argument will cause npm to not execute any scripts defined in the package.json. See `npm-scripts(7)`. The `--legacy-bundling` argument will cause npm to install the package such diff --git a/deps/npm/doc/cli/npm-link.md b/deps/npm/doc/cli/npm-link.md index 3970ffdf80b992..7ba22852502560 100644 --- a/deps/npm/doc/cli/npm-link.md +++ b/deps/npm/doc/cli/npm-link.md @@ -14,7 +14,8 @@ Package linking is a two-step process. First, `npm link` in a package folder will create a symlink in the global folder `{prefix}/lib/node_modules/` that links to the package where the `npm -link` command was executed. (see `npm-config(7)` for the value of `prefix`). +link` command was executed. (see `npm-config(7)` for the value of `prefix`). It +will also link any bins in the package to `{prefix}/bin/{name}`. Next, in some other location, `npm link package-name` will create a symbolic link from globally-installed `package-name` to `node_modules/` diff --git a/deps/npm/doc/cli/npm-run-script.md b/deps/npm/doc/cli/npm-run-script.md index 43fa58e5d8d37d..fc6b42a4785edc 100644 --- a/deps/npm/doc/cli/npm-run-script.md +++ b/deps/npm/doc/cli/npm-run-script.md @@ -41,8 +41,8 @@ you should write: instead of `"scripts": {"test": "node_modules/.bin/tap test/\*.js"}` to run your tests. `npm run` sets the `NODE` environment variable to the `node` executable with -which `npm` is executed, and adds the directory within which it resides to the -`PATH`, too. +which `npm` is executed. Also, the directory within which it resides is added to the +`PATH`, if the `node` executable is not in the `PATH`. If you try to run a script without having a `node_modules` directory and it fails, you will be given a warning to run `npm install`, just in case you've forgotten. diff --git a/deps/npm/doc/cli/npm-shrinkwrap.md b/deps/npm/doc/cli/npm-shrinkwrap.md index 6fc7d96f7c2253..f89c3b8375e690 100644 --- a/deps/npm/doc/cli/npm-shrinkwrap.md +++ b/deps/npm/doc/cli/npm-shrinkwrap.md @@ -137,11 +137,11 @@ To add or update a dependency in a shrinkwrapped package: 1. Run `npm install` in the package root to install the current versions of all dependencies. -2. Add or update dependencies. `npm install --save` each new or updated - package individually to update the `package.json` and the shrinkwrap. - Note that they must be explicitly named in order to be installed: running - `npm install` with no arguments will merely reproduce the existing - shrinkwrap. +2. Add or update dependencies. `npm install --save` or `npm install --save-dev` + each new or updated package individually to update the `package.json` and + the shrinkwrap. Note that they must be explicitly named in order to be + installed: running `npm install` with no arguments will merely reproduce + the existing shrinkwrap. 3. Validate that the package works as expected with the new dependencies. 4. Commit the new `npm-shrinkwrap.json`, and publish your package. diff --git a/deps/npm/doc/cli/npm-tag.md b/deps/npm/doc/cli/npm-tag.md index 357c0862f267e3..88689d59d38b03 100644 --- a/deps/npm/doc/cli/npm-tag.md +++ b/deps/npm/doc/cli/npm-tag.md @@ -57,5 +57,5 @@ that do not begin with a number or the letter `v`. * npm-registry(7) * npm-config(1) * npm-config(7) -* npm-tag(3) +* npm-dist-tag(1) * npmrc(5) diff --git a/deps/npm/doc/files/npmrc.md b/deps/npm/doc/files/npmrc.md index 8aab60aff643a3..011c703be3bd3d 100644 --- a/deps/npm/doc/files/npmrc.md +++ b/deps/npm/doc/files/npmrc.md @@ -41,6 +41,16 @@ sensitive credentials, they must be readable and writable _only_ by your user account (i.e. must have a mode of `0600`), otherwise they _will be ignored by npm!_ +#### Comments + +Lines in `.npmrc` files are interpreted as comments when they begin with a `;` or `#` character. `.npmrc` files are parsed by [npm/ini](https://github.com/npm/ini), which specifies this comment syntax. + +For example: + + # last modified: 01 Jan 2016 + ; Set a new registry for a scoped package + @myscope:registry=https://mycustomregistry.example.org + ### Per-project config file When working locally in a project, a `.npmrc` file in the root of the diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index 98b77af3e534d4..f583436045e99c 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -203,6 +203,7 @@ Conversely, some files are always ignored: * `.npmrc` * `node_modules` * `config.gypi` +* `*.orig` ## main @@ -247,6 +248,10 @@ would be the same as this: , "version": "1.2.5" , "bin" : { "my-program" : "./path/to/program" } } +Please make sure that your file(s) referenced in `bin` starts with +`#!/usr/bin/env node`, otherwise the scripts are started without the node +executable! + ## man Specify either a single file or an array of filenames to put in place for the diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 764555ea4a060a..76d1ee489caff5 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -26,10 +26,12 @@ same. The four relevant files are: -* per-project config file (/path/to/my/project/.npmrc) -* per-user config file (~/.npmrc) -* global config file ($PREFIX/etc/npmrc) -* npm builtin config file (/path/to/npm/npmrc) +* per-project configuration file (`/path/to/my/project/.npmrc`) +* per-user configuration file (defaults to `$HOME/.npmrc`; configurable via CLI + option `--userconfig` or environment variable `$NPM_CONF_USERCONFIG`) +* global configuration file (defaults to `$PREFIX/etc/npmrc`; configurable via + CLI option `--globalconfig` or environment variable `$NPM_CONF_GLOBALCONFIG`) +* npm's built-in configuration file (`/path/to/npm/npmrc`) See npmrc(5) for more details. diff --git a/deps/npm/doc/misc/npm-orgs.md b/deps/npm/doc/misc/npm-orgs.md index e28b6c17640fd6..3db22f8c7eab49 100644 --- a/deps/npm/doc/misc/npm-orgs.md +++ b/deps/npm/doc/misc/npm-orgs.md @@ -7,7 +7,7 @@ There are three levels of org users: 1. Super admin, controls billing & adding people to the org. 2. Team admin, manages team membership & package access. -3. Developer, works on packages they are given access to. +3. Developer, works on packages they are given access to. The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a `developers` team that all users are automatically added to. @@ -51,7 +51,7 @@ npm init --scope= ``` to scope it for your org & publish as usual -* Grant access: +* Grant access: ``` npm access grant [] diff --git a/deps/npm/doc/misc/npm-registry.md b/deps/npm/doc/misc/npm-registry.md index cc1a1b299c25e0..becffa2f6ebda4 100644 --- a/deps/npm/doc/misc/npm-registry.md +++ b/deps/npm/doc/misc/npm-registry.md @@ -31,7 +31,7 @@ similar) design doc to implement the APIs. If you set up continuous replication from the official CouchDB, and then set your internal CouchDB as the registry config, then you'll be able to read any published packages, in addition to your private ones, and by -default will only publish internally. +default will only publish internally. If you then want to publish a package for the whole world to see, you can simply override the `--registry` option for that `publish` command. diff --git a/deps/npm/doc/misc/npm-scope.md b/deps/npm/doc/misc/npm-scope.md index 7431e62129343b..e9d4d025c2449f 100644 --- a/deps/npm/doc/misc/npm-scope.md +++ b/deps/npm/doc/misc/npm-scope.md @@ -13,9 +13,10 @@ followed by a slash, e.g. Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package. -Scoped packages are supported by the public npm registry. The npm -client is backwards-compatible with un-scoped registries, so it can be -used to work with scoped and un-scoped registries at the same time. +Scoped packages can be published and installed as of `npm@2` and are supported +by the primary npm registry. The npm client is backwards-compatible with +un-scoped registries, so it can be used to work with scoped and un-scoped +registries at the same time. ## Installing scoped packages @@ -51,14 +52,16 @@ just specifying to require the module `mypackage` in the folder called `@myorg`. ## Publishing scoped packages -Scoped packages can be published to any registry that supports them, including -the public npm registry. +Scoped packages can be published from the CLI as of `npm@2` and can be +published to any registry that supports them, including the primary npm +registry. -(As of 2015-04-19, and with npm 2.0 or better, the public npm registry **does** support scoped packages) +(As of 2015-04-19, and with npm 2.0 or better, the primary npm registry +**does** support scoped packages) If you wish, you may associate a scope with a registry; see below. -### Publishing public scoped packages to the public npm registry +### Publishing public scoped packages to the primary npm registry To publish a public scoped package, you must specify `--access public` with the initial publication. This will publish the package and set access @@ -78,7 +81,7 @@ desired, with `npm access` or on the npmjs.com website. ## Associating a scope with a registry Scopes can be associated with a separate registry. This allows you to -seamlessly use a mix of packages from the public npm registry and one or more +seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as npm Enterprise. You can associate a scope with a registry at login, e.g. diff --git a/deps/npm/doc/misc/npm-scripts.md b/deps/npm/doc/misc/npm-scripts.md index 9ec75cc5ddf3dd..241815fcd41838 100644 --- a/deps/npm/doc/misc/npm-scripts.md +++ b/deps/npm/doc/misc/npm-scripts.md @@ -19,10 +19,12 @@ following scripts: Run BEFORE the package is uninstalled. * postuninstall: Run AFTER the package is uninstalled. -* preversion, version: - Run BEFORE bump the package version. +* preversion: + Run BEFORE bumping the package version. +* version: + Run AFTER bumping the package version, but BEFORE commit. * postversion: - Run AFTER bump the package version. + Run AFTER bumping the package version, and AFTER commit. * pretest, test, posttest: Run by the `npm test` command. * prestop, stop, poststop: diff --git a/deps/npm/doc/misc/semver.md b/deps/npm/doc/misc/semver.md index 97a50cdf0c500d..508d54403d0d15 100644 --- a/deps/npm/doc/misc/semver.md +++ b/deps/npm/doc/misc/semver.md @@ -4,6 +4,8 @@ semver(7) -- The semantic versioner for npm ## Usage $ npm install semver + $ node + var semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null @@ -16,18 +18,35 @@ As a command-line utility: $ semver -h - Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] - Test if version(s) satisfy the supplied range(s), and sort them. + SemVer 5.1.0 - Multiple versions or ranges may be supplied, unless increment - option is specified. In that case, only a single version may - be used, and it is incremented by the specified level + A JavaScript implementation of the http://semver.org/ specification + Copyright Isaac Z. Schlueter + + Usage: semver [options] [ [...]] + Prints valid versions sorted by SemVer precedence + + Options: + -r --range + Print versions that match the specified range. + + -i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + + --preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + + -l --loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. - If no versions are valid, or ranges are not satisfied, - then exits failure. + If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. @@ -242,7 +261,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? @@ -272,6 +291,8 @@ strings that they parse. same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. @@ -306,6 +327,8 @@ strings that they parse. range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index f29b1d371e9f6d..d45cf66a81be90 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -1,7 +1,7 @@ README - + @@ -15,7 +15,7 @@

SYNOPSIS

This is just enough info to get you up and running.

Much more info available via npm help once it's installed.

IMPORTANT

-

You need node v0.8 or higher to run this program.

+

You need node v0.10 or higher to run this program.

To install an old and unsupported version of npm that works on node 0.3 and prior, clone the git repo and dig through the old tags and branches.

npm is configured to use npm, Inc.'s public package registry at @@ -126,5 +126,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index db12b9db8c4d23..387e5d80a1d4ca 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -1,7 +1,7 @@ npm-access - + @@ -84,5 +84,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index cf63d917cf7c59..51a420c9e1545d 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -1,7 +1,7 @@ npm-adduser - + @@ -72,5 +72,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index edfad8410b3ded..da6760127ef53b 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -1,7 +1,7 @@ npm-bin - + @@ -35,5 +35,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 6b0ba4da0eb7bb..7f0cf04c2a8a27 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -1,7 +1,7 @@ npm-bugs - + @@ -55,5 +55,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index ff4d8c41b0c6a2..32ad0f728741a3 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -1,7 +1,7 @@ npm-build - + @@ -40,5 +40,5 @@

DESCRIPTION

       - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 4ac20ba250ed42..c0e5cd7fe14e64 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -1,7 +1,7 @@ npm-bundle - + @@ -31,5 +31,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index 4970a1e72b26c1..9b09bc13d9251e 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -1,7 +1,7 @@ npm-cache - + @@ -81,5 +81,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index 0cc67c6b8023b1..db07154f63ab09 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -1,7 +1,7 @@ npm-completion - + @@ -43,5 +43,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index c4338e24db3a9d..05525fce50a148 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -1,7 +1,7 @@ npm-config - + @@ -67,5 +67,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index 53ac72d3d646a8..4a3c71e0f92f2d 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -1,7 +1,7 @@ npm-dedupe - + @@ -61,5 +61,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index e7f08317ad3c4c..19e2a0aad1ffaa 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -1,7 +1,7 @@ npm-deprecate - + @@ -38,5 +38,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html index 73d81b75a701ac..905a1e255e5c3f 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -1,7 +1,7 @@ npm-dist-tag - + @@ -87,5 +87,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index ff63edf7976d41..4d89d2234a3e46 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -1,7 +1,7 @@ npm-docs - + @@ -56,5 +56,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 4ad12b97531fc5..3d2e9b1ae8ea2c 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -1,7 +1,7 @@ npm-edit - + @@ -49,5 +49,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 4c3db7f749a284..31351c3320b747 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -1,7 +1,7 @@ npm-explore - + @@ -49,5 +49,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index e1c8633bb2ae2e..f356e594e5cf54 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -1,7 +1,7 @@ npm-help-search - + @@ -45,5 +45,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 7997896bb2487c..42b466f34cbb4a 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -1,7 +1,7 @@ npm-help - + @@ -50,5 +50,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index 32b0326ae868aa..7378a258a8c5b1 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -1,7 +1,7 @@ npm-init - + @@ -48,5 +48,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-install-test.html b/deps/npm/html/doc/cli/npm-install-test.html index e236e425a3c630..bb1fa931c39392 100644 --- a/deps/npm/html/doc/cli/npm-install-test.html +++ b/deps/npm/html/doc/cli/npm-install-test.html @@ -1,7 +1,7 @@ npm-install-test - + @@ -42,4 +42,5 @@

SEE ALSO

       - + + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 7866afcdb2f563..c7b573e79aacc2 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -1,7 +1,7 @@ npm-install - + @@ -152,6 +152,7 @@

SYNOPSIS

to the environment when running git:

  • GIT_ASKPASS
  • +
  • GIT_EXEC_PATH
  • GIT_PROXY_COMMAND
  • GIT_SSH
  • GIT_SSH_COMMAND
  • @@ -217,7 +218,7 @@

    SYNOPSIS

    global node_modules folder. Only your direct dependencies will show in node_modules and everything they depend on will be flattened in their node_modules folders. This obviously will eliminate some deduping.

    -

    The --ignore-scripts argument will cause npm to not execute any +

    The --ignore-scripts argument will cause npm to not execute any scripts defined in the package.json. See npm-scripts(7).

    The --legacy-bundling argument will cause npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, @@ -312,5 +313,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index b3ee5da28c9878..d629b5f7657bbd 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -1,7 +1,7 @@ npm-link - + @@ -19,7 +19,8 @@

    SYNOPSIS

    Package linking is a two-step process.

    First, npm link in a package folder will create a symlink in the global folder {prefix}/lib/node_modules/<package> that links to the package where the npm -link command was executed. (see npm-config(7) for the value of prefix).

    +link command was executed. (see npm-config(7) for the value of prefix). It +will also link any bins in the package to {prefix}/bin/{name}.

    Next, in some other location, npm link package-name will create a symbolic link from globally-installed package-name to node_modules/ of the current folder.

    @@ -73,5 +74,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index 7b054c5fef1fcf..0e66b22d30ecba 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -1,7 +1,7 @@ npm-logout - + @@ -51,5 +51,5 @@

    scope

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index ff0ce5947edb62..bb26788e29d2f9 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -1,7 +1,7 @@ npm-ls - + @@ -21,7 +21,7 @@

    SYNOPSIS

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

    -
    npm@3.10.3 /path/to/npm
    +
    npm@3.10.8 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     

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

    @@ -104,5 +104,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index 414468a4959f91..0153d0e71227fc 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -1,7 +1,7 @@ npm-outdated - + @@ -116,5 +116,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 15a5902a6ab019..3918d686af5570 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -1,7 +1,7 @@ npm-owner - + @@ -51,5 +51,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index b28706242df1b3..1b0fa7bc10afd0 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -1,7 +1,7 @@ npm-pack - + @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index f6b275cfd1e141..4e1a2131161acc 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -1,7 +1,7 @@ npm-ping - + @@ -32,4 +32,5 @@

    SEE ALSO

           - + + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 5e85f6567f6840..a9760dbfa87aed 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -1,7 +1,7 @@ npm-prefix - + @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index 85540d1ffbc74b..e3a0e264bf168a 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -1,7 +1,7 @@ npm-prune - + @@ -40,5 +40,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index 4a7f7242636900..89e4c783725a24 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -1,7 +1,7 @@ npm-publish - + @@ -76,5 +76,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index aa3b2766c730ff..815e2219f02eb4 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -1,7 +1,7 @@ npm-rebuild - + @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index 36b34ac815c8d5..ff71c0029d80fa 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -1,7 +1,7 @@ npm-repo - + @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 512d4ef41cb3b7..69426118d46bc6 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -1,7 +1,7 @@ npm-restart - + @@ -53,5 +53,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index 76dcf86db12b59..fe14f23ea35533 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -1,7 +1,7 @@ npm-root - + @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index 91f5d69b8dd261..0b0b1f8d740606 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -1,7 +1,7 @@ npm-run-script - + @@ -39,8 +39,8 @@

    SYNOPSIS

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

    instead of "scripts": {"test": "node_modules/.bin/tap test/\*.js"} to run your tests.

    npm run sets the NODE environment variable to the node executable with -which npm is executed, and adds the directory within which it resides to the -PATH, too.

    +which npm is executed. Also, the directory within which it resides is added to the +PATH, if the node executable is not in the PATH.

    If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you've forgotten.

    SEE ALSO

    @@ -63,5 +63,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 339239957b0f1c..86721abb524e5d 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -1,7 +1,7 @@ npm-search - + @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 633cc0a545b9ad..ccbe2e53b3e195 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -1,7 +1,7 @@ npm-shrinkwrap - + @@ -121,11 +121,11 @@

    Building shrinkwrapped packages

    1. Run npm install in the package root to install the current versions of all dependencies.
    2. -
    3. Add or update dependencies. npm install --save each new or updated -package individually to update the package.json and the shrinkwrap. -Note that they must be explicitly named in order to be installed: running -npm install with no arguments will merely reproduce the existing -shrinkwrap.
    4. +
    5. Add or update dependencies. npm install --save or npm install --save-dev +each new or updated package individually to update the package.json and +the shrinkwrap. Note that they must be explicitly named in order to be +installed: running npm install with no arguments will merely reproduce +the existing shrinkwrap.
    6. Validate that the package works as expected with the new dependencies.
    7. Commit the new npm-shrinkwrap.json, and publish your package.
    8. @@ -176,5 +176,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index aceae49107f9f8..4ed9d8034f5b19 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -1,7 +1,7 @@ npm-star - + @@ -36,5 +36,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 9b1e2375fc843d..e7b474f1d68d41 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -1,7 +1,7 @@ npm-stars - + @@ -36,5 +36,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index fabb59c82916b9..0b4e7d701cf686 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -1,7 +1,7 @@ npm-start - + @@ -39,5 +39,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 99c73800514167..f0ef8065d22568 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -1,7 +1,7 @@ npm-stop - + @@ -34,5 +34,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index e1c88fd82f5369..74c0a34593c58f 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -1,7 +1,7 @@ npm-tag - + @@ -48,7 +48,7 @@

      SEE ALSO

    9. npm-registry(7)
    10. npm-config(1)
    11. npm-config(7)
    12. -
    13. npm-tag(3)
    14. +
    15. npm-dist-tag(1)
    16. npmrc(5)
@@ -63,5 +63,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index 6da75633556818..90655239f2b79e 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -1,7 +1,7 @@ npm-team - + @@ -67,4 +67,5 @@

SEE ALSO

       - + + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index a23c21e87be4b8..7ca65fa4a2e2dd 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -1,7 +1,7 @@ npm-test - + @@ -38,5 +38,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index f6576a57cce3bb..02f8971db3657f 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -1,7 +1,7 @@ npm-uninstall - + @@ -60,5 +60,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 637db014068ec5..2d9aa063b8557c 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -1,7 +1,7 @@ npm-unpublish - + @@ -47,5 +47,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index 2c665efdbe1ab5..d0a375ec1b9e42 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -1,7 +1,7 @@ npm-update - + @@ -118,5 +118,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index c4ad92100fd3a8..881c02f27f68e8 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -1,7 +1,7 @@ npm-version - + @@ -100,5 +100,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index b5b4c6d4100465..047845427d67a9 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -1,7 +1,7 @@ npm-view - + @@ -86,5 +86,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index a4672dfc3fc7db..8ae3b976d09668 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -1,7 +1,7 @@ npm-whoami - + @@ -33,5 +33,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index 9b8fdfc9ebbbd2..705d4b2557e0d4 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -1,7 +1,7 @@ npm - + @@ -13,7 +13,7 @@

npm

javascript package manager

SYNOPSIS

npm <command> [args]
 

VERSION

-

3.10.3

+

3.10.8

DESCRIPTION

npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency @@ -126,7 +126,7 @@

AUTHOR

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

+i@izs.me

SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index bcfd0279138d5c..29cc77204c650b 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -1,7 +1,7 @@ npm-folders - + @@ -182,5 +182,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index bcfd0279138d5c..29cc77204c650b 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -1,7 +1,7 @@ npm-folders - + @@ -182,5 +182,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index 56fc6594dcb983..46c77ec1c04397 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -1,7 +1,7 @@ package.json - + @@ -161,6 +161,7 @@

    files

  • .npmrc
  • node_modules
  • config.gypi
  • +
  • *.orig

main

The main field is a module ID that is the primary entry point to your program. @@ -190,7 +191,10 @@

bin

{ "name": "my-program"
 , "version": "1.2.5"
 , "bin" : { "my-program" : "./path/to/program" } }
-

man

+

Please make sure that your file(s) referenced in bin starts with +#!/usr/bin/env node, otherwise the scripts are started without the node +executable!

+

man

Specify either a single file or an array of filenames to put in place for the man program to find.

If only a single file is provided, then it's installed such that it is the @@ -581,5 +585,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index c78bea864c03e6..62ba82f66b39b6 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -1,7 +1,7 @@ npmrc - + @@ -39,7 +39,13 @@

FILES

sensitive credentials, they must be readable and writable only by your user account (i.e. must have a mode of 0600), otherwise they will be ignored by npm!

-

Per-project config file

+

Comments

+

Lines in .npmrc files are interpreted as comments when they begin with a ; or # character. .npmrc files are parsed by npm/ini, which specifies this comment syntax.

+

For example:

+
# last modified: 01 Jan 2016
+; Set a new registry for a scoped package
+@myscope:registry=https://mycustomregistry.example.org
+

Per-project config file

When working locally in a project, a .npmrc file in the root of the project (ie, a sibling of node_modules and package.json) will set config values specific to this project.

@@ -83,5 +89,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 56fc6594dcb983..46c77ec1c04397 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -1,7 +1,7 @@ package.json - + @@ -161,6 +161,7 @@

files

  • .npmrc
  • node_modules
  • config.gypi
  • +
  • *.orig
  • main

    The main field is a module ID that is the primary entry point to your program. @@ -190,7 +191,10 @@

    bin

    { "name": "my-program"
     , "version": "1.2.5"
     , "bin" : { "my-program" : "./path/to/program" } }
    -

    man

    +

    Please make sure that your file(s) referenced in bin starts with +#!/usr/bin/env node, otherwise the scripts are started without the node +executable!

    +

    man

    Specify either a single file or an array of filenames to put in place for the man program to find.

    If only a single file is provided, then it's installed such that it is the @@ -581,5 +585,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index d12a7e132e65c9..81cd3a1dbdb2f3 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -1,7 +1,7 @@ npm-index - + @@ -162,5 +162,5 @@

    semver(7)

           - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index 1f923462fba90d..f2bb954f73edd1 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -1,7 +1,7 @@ npm-coding-style - + @@ -153,5 +153,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index 7541b826d2d573..26adf609b6fdaa 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -1,7 +1,7 @@ npm-config - + @@ -28,10 +28,12 @@

    Environment Variables

    npmrc Files

    The four relevant files are:

      -
    • per-project config file (/path/to/my/project/.npmrc)
    • -
    • per-user config file (~/.npmrc)
    • -
    • global config file ($PREFIX/etc/npmrc)
    • -
    • npm builtin config file (/path/to/npm/npmrc)
    • +
    • per-project configuration file (/path/to/my/project/.npmrc)
    • +
    • per-user configuration file (defaults to $HOME/.npmrc; configurable via CLI +option --userconfig or environment variable $NPM_CONF_USERCONFIG)
    • +
    • global configuration file (defaults to $PREFIX/etc/npmrc; configurable via +CLI option --globalconfig or environment variable $NPM_CONF_GLOBALCONFIG)
    • +
    • npm's built-in configuration file (/path/to/npm/npmrc)

    See npmrc(5) for more details.

    Default Configs

    @@ -862,5 +864,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 8b932609710b75..0864d558e59b4e 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -1,7 +1,7 @@ npm-developers - + @@ -194,5 +194,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index c28db606dbaab3..bb6afe880ccfee 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -1,7 +1,7 @@ npm-disputes - + @@ -13,7 +13,7 @@

    npm-disputes

    Handling Module

    SYNOPSIS

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

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

    @@ -51,12 +51,12 @@

    DESCRIPTION

    owner (Bob).
  • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com to the CC list of +adds the npm support staff support@npmjs.com to the CC list of the email. Mention in the email that Bob can run npm owner add joe foo to add Joe as an owner of the foo package.
  • After a reasonable amount of time, if Bob has not responded, or if Bob and Joe can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
  • @@ -112,5 +112,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 1d5a6eb8cd5fcf..2c4aaab7a32575 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -1,7 +1,7 @@ npm-index - + @@ -162,4 +162,5 @@

    semver(7)

           - + + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index 5ba1b7cb592ddd..247c86684dfcca 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -1,7 +1,7 @@ npm-orgs - + @@ -86,4 +86,5 @@

    Team Admins create teams

           - + + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index c0a7fa512ec1a3..ed89e342565ede 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -1,7 +1,7 @@ npm-registry - + @@ -70,5 +70,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index 21b22d926c219a..632ea3e24eb815 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -1,7 +1,7 @@ npm-scope - + @@ -18,9 +18,10 @@

    DESCRIPTION

    @somescope/somepackagename
     

    Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.

    -

    Scoped packages are supported by the public npm registry. The npm -client is backwards-compatible with un-scoped registries, so it can be -used to work with scoped and un-scoped registries at the same time.

    +

    Scoped packages can be published and installed as of npm@2 and are supported +by the primary npm registry. The npm client is backwards-compatible with +un-scoped registries, so it can be used to work with scoped and un-scoped +registries at the same time.

    Installing scoped packages

    Scoped packages are installed to a sub-folder of the regular installation folder, e.g. if your other packages are installed in node_modules/packagename, @@ -43,11 +44,13 @@

    Requiring scoped packages

    There is nothing special about the way Node treats scope folders, this is just specifying to require the module mypackage in the folder called @myorg.

    Publishing scoped packages

    -

    Scoped packages can be published to any registry that supports them, including -the public npm registry.

    -

    (As of 2015-04-19, and with npm 2.0 or better, the public npm registry does support scoped packages)

    +

    Scoped packages can be published from the CLI as of npm@2 and can be +published to any registry that supports them, including the primary npm +registry.

    +

    (As of 2015-04-19, and with npm 2.0 or better, the primary npm registry +does support scoped packages)

    If you wish, you may associate a scope with a registry; see below.

    -

    Publishing public scoped packages to the public npm registry

    +

    Publishing public scoped packages to the primary npm registry

    To publish a public scoped package, you must specify --access public with the initial publication. This will publish the package and set access to public as if you had run npm access public after publishing.

    @@ -61,7 +64,7 @@

    Publishing priva desired, with npm access or on the npmjs.com website.

    Associating a scope with a registry

    Scopes can be associated with a separate registry. This allows you to -seamlessly use a mix of packages from the public npm registry and one or more +seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as npm Enterprise.

    You can associate a scope with a registry at login, e.g.

    npm login --registry=http://reg.example.com --scope=@myco
    @@ -91,5 +94,5 @@ 

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 53cbe9223f7149..9fc0e32ec2212f 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -1,7 +1,7 @@ npm-scripts - + @@ -27,10 +27,12 @@

    DESCRIPTION

    Run BEFORE the package is uninstalled.
  • postuninstall: Run AFTER the package is uninstalled.
  • -
  • preversion, version: -Run BEFORE bump the package version.
  • +
  • preversion: +Run BEFORE bumping the package version.
  • +
  • version: +Run AFTER bumping the package version, but BEFORE commit.
  • postversion: -Run AFTER bump the package version.
  • +Run AFTER bumping the package version, and AFTER commit.
  • pretest, test, posttest: Run by the npm test command.
  • prestop, stop, poststop: @@ -211,5 +213,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index 67c84990727f8d..a74838cb9a7341 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -1,7 +1,7 @@ removing-npm - + @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index 0d2f0919dd5b07..493872d6506054 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -1,7 +1,7 @@ semver - + @@ -12,6 +12,8 @@

    semver

    The semantic versioner for npm

    Usage

    $ npm install semver
    +$ node
    +var semver = require('semver')
     
     semver.valid('1.2.3') // '1.2.3'
     semver.valid('a.b.c') // null
    @@ -22,18 +24,35 @@ 

    Usage

    As a command-line utility:

    $ semver -h
     
    -Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
    -Test if version(s) satisfy the supplied range(s), and sort them.
    +SemVer 5.1.0
     
    -Multiple versions or ranges may be supplied, unless increment
    -option is specified.  In that case, only a single version may
    -be used, and it is incremented by the specified level
    +A JavaScript implementation of the http://semver.org/ specification
    +Copyright Isaac Z. Schlueter
    +
    +Usage: semver [options] <version> [<version> [...]]
    +Prints valid versions sorted by SemVer precedence
    +
    +Options:
    +-r --range <range>
    +        Print versions that match the specified range.
    +
    +-i --increment [<level>]
    +        Increment a version by the specified level.  Level can
    +        be one of: major, minor, patch, premajor, preminor,
    +        prepatch, or prerelease.  Default level is 'patch'.
    +        Only one version may be specified.
    +
    +--preid <identifier>
    +        Identifier to be used to prefix premajor, preminor,
    +        prepatch or prerelease version increments.
    +
    +-l --loose
    +        Interpret versions and ranges loosely
     
     Program exits successfully if any valid version satisfies
     all supplied ranges, and prints all satisfying versions.
     
    -If no versions are valid, or ranges are not satisfied,
    -then exits failure.
    +If no satisfying versions are found, then exits failure.
     
     Versions are printed in ascending order, so supplying
     multiple versions to the utility will just sort them.
    @@ -210,7 +229,7 @@ 

    Range Grammar

    primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? @@ -239,6 +258,8 @@

    Functions

    increments it.
  • +
  • prerelease(v): Returns an array of prerelease components, or null +if none exist. Example: prerelease('1.2.3-alpha.1') -> ['alpha', 1]
  • major(v): Return the major version number.
  • minor(v): Return the minor version number.
  • patch(v): Return the patch version number.
  • @@ -272,6 +293,8 @@

    Ranges

    range.
  • maxSatisfying(versions, range): Return the highest version in the list that satisfies the range, or null if none of them do.
  • +
  • minSatisfying(versions, range): Return the lowest version in the list +that satisfies the range, or null if none of them do.
  • gtr(version, range): Return true if version is greater than all the versions possible in the range.
  • ltr(version, range): Return true if version is less than all the @@ -302,5 +325,5 @@

    Ranges

           - + diff --git a/deps/npm/html/dochead.html b/deps/npm/html/dochead.html index e2f0e83d78ee49..26602b2b8af684 100644 --- a/deps/npm/html/dochead.html +++ b/deps/npm/html/dochead.html @@ -1,7 +1,7 @@ @NAME@ - + diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js index 075ca5fc61d8de..0794b9214489c1 100644 --- a/deps/npm/lib/cache/add-local.js +++ b/deps/npm/lib/cache/add-local.js @@ -20,7 +20,7 @@ module.exports = addLocal function addLocal (p, pkgData, cb_) { assert(typeof p === 'object', 'must have spec info') - assert(typeof cb === 'function', 'must have callback') + assert(typeof cb_ === 'function', 'must have callback') pkgData = pkgData || {} @@ -91,10 +91,10 @@ function addLocalDirectory (p, pkgData, shasum, cb) { getCacheStat(function (er, cs) { mkdir(path.dirname(pj), function (er, made) { - if (er) return cb(er) + if (er) return wrapped(er) var doPrePublish = !pathIsInside(p, npm.tmp) if (doPrePublish) { - lifecycle(data, 'prepublish', p, iferr(cb, thenPack)) + lifecycle(data, 'prepublish', p, iferr(wrapped, thenPack)) } else { thenPack() } @@ -102,12 +102,15 @@ function addLocalDirectory (p, pkgData, shasum, cb) { tar.pack(tgz, p, data, function (er) { if (er) { log.error('addLocalDirectory', 'Could not pack', p, 'to', tgz) - return cb(er) + return wrapped(er) } - if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() + if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) return wrapped() - chownr(made || tgz, cs.uid, cs.gid, wrapped) + chownr(made || tgz, cs.uid, cs.gid, function (er) { + if (er && er.code === 'ENOENT') return wrapped() + wrapped(er) + }) }) } }) diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js index d8f64a85be45de..0da1554f80a5a4 100644 --- a/deps/npm/lib/cache/add-remote-git.js +++ b/deps/npm/lib/cache/add-remote-git.js @@ -26,6 +26,7 @@ var templates = path.join(remotes, '_templates') var VALID_VARIABLES = [ 'GIT_ASKPASS', + 'GIT_EXEC_PATH', 'GIT_PROXY_COMMAND', 'GIT_SSH', 'GIT_SSH_COMMAND', diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index 7112e88c5f7d6e..0426546274e950 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -12,6 +12,7 @@ var os = require('os') var umask = require('./utils/umask') var usage = require('./utils/usage') var output = require('./utils/output') +var noProgressTillDone = require('./utils/no-progress-while-running').tillDone config.usage = usage( 'config', @@ -106,7 +107,7 @@ function edit (cb) { data, function (er) { if (er) return cb(er) - editor(f, { editor: e }, cb) + editor(f, { editor: e }, noProgressTillDone(cb)) } ) }) diff --git a/deps/npm/lib/config/cmd-list.js b/deps/npm/lib/config/cmd-list.js index 34ebeed4486cd1..d66a5722dbdc89 100644 --- a/deps/npm/lib/config/cmd-list.js +++ b/deps/npm/lib/config/cmd-list.js @@ -66,6 +66,7 @@ var cmdList = [ 'stars', 'tag', 'adduser', + 'login', // This is an alias for `adduser` but it can be confusing 'logout', 'unpublish', 'owner', diff --git a/deps/npm/lib/edit.js b/deps/npm/lib/edit.js index 155db6fd97828c..8e9bbd179709e5 100644 --- a/deps/npm/lib/edit.js +++ b/deps/npm/lib/edit.js @@ -10,6 +10,7 @@ var npm = require('./npm.js') var path = require('path') var fs = require('graceful-fs') var editor = require('editor') +var noProgressTillDone = require('./utils/no-progress-while-running').tillDone function edit (args, cb) { var p = args[0] @@ -26,9 +27,9 @@ function edit (args, cb) { var f = path.resolve(npm.dir, p) fs.lstat(f, function (er) { if (er) return cb(er) - editor(f, { editor: e }, function (er) { + editor(f, { editor: e }, noProgressTillDone(function (er) { if (er) return cb(er) npm.commands.rebuild(args, cb) - }) + })) }) } diff --git a/deps/npm/lib/fetch-package-metadata.js b/deps/npm/lib/fetch-package-metadata.js index d4f02bb2784083..85322304d5f15c 100644 --- a/deps/npm/lib/fetch-package-metadata.js +++ b/deps/npm/lib/fetch-package-metadata.js @@ -122,7 +122,15 @@ function fetchNamedPackageData (dep, next) { } function pickVersionFromRegistryDocument (pkg) { if (!regCache[url]) regCache[url] = pkg - var versions = Object.keys(pkg.versions).sort(semver.rcompare) + var versions = Object.keys(pkg.versions) + + var invalidVersions = versions.filter(function (v) { return !semver.valid(v) }) + if (invalidVersions.length > 0) { + log.warn('pickVersion', 'The package %s has invalid semver-version(s): %s. This usually only happens for unofficial private registries. ' + + 'You should delete or re-publish the invalid versions.', pkg.name, invalidVersions.join(', ')) + } + + versions = versions.filter(function (v) { return semver.valid(v) }).sort(semver.rcompare) if (dep.type === 'tag') { var tagVersion = pkg['dist-tags'][dep.spec] @@ -169,6 +177,7 @@ function fetchNamedPackageData (dep, next) { : 'No valid targets found.' var er = new Error('No compatible version found: ' + dep.raw + '\n' + targets) + er.code = 'ETARGET' return next(er) } })) diff --git a/deps/npm/lib/init.js b/deps/npm/lib/init.js index a5d102c1f314f7..df5615e47632fd 100644 --- a/deps/npm/lib/init.js +++ b/deps/npm/lib/init.js @@ -6,13 +6,13 @@ var log = require('npmlog') var npm = require('./npm.js') var initJson = require('init-package-json') var output = require('./utils/output.js') +var noProgressTillDone = require('./utils/no-progress-while-running').tillDone init.usage = 'npm init [--force|-f|--yes|-y]' function init (args, cb) { var dir = process.cwd() log.pause() - log.disableProgress() var initFile = npm.config.get('init-module') if (!initJson.yes(npm.config)) { output([ @@ -28,7 +28,7 @@ function init (args, cb) { 'Press ^C at any time to quit.' ].join('\n')) } - initJson(dir, initFile, npm.config, function (er, data) { + initJson(dir, initFile, npm.config, noProgressTillDone(function (er, data) { log.resume() log.silly('package data', data) if (er && er.message === 'canceled') { @@ -37,5 +37,5 @@ function init (args, cb) { } log.info('init', 'written successfully') cb(er, data) - }) + })) } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 1fb5a4f4e6d0ab..4c3d0def78a7c1 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -1,8 +1,8 @@ 'use strict' // npm install // -// See doc/install.md for more description - +// See doc/cli/npm-install.md for more description +// // Managing contexts... // there's a lot of state associated with an "install" operation, including // packages that are already installed, parent packages, current shrinkwrap, and @@ -259,6 +259,9 @@ Installer.prototype.run = function (cb) { [this, this.debugActions, 'decomposeActions', 'todo']) if (!this.dryrun) { installSteps.push( + [this.newTracker(log, 'runTopLevelLifecycles', 2)], + [this, this.runPreinstallTopLevelLifecycles], + [this.newTracker(log, 'executeActions', 8)], [this, this.executeActions], [this, this.finishTracker, 'executeActions']) @@ -269,10 +272,9 @@ Installer.prototype.run = function (cb) { [this, this.rollbackFailedOptional, staging, this.todo], [this, this.finishTracker, 'rollbackFailedOptional'], [this, this.commit, staging, this.todo], - [this.newTracker(log, 'runTopLevelLifecycles', 2)], - [this, this.runTopLevelLifecycles], - [this, this.finishTracker, 'runTopLevelLifecycles']) + [this, this.runPostinstallTopLevelLifecycles], + [this, this.finishTracker, 'runTopLevelLifecycles']) if (getSaveType(this.args)) { postInstallSteps.push( [this, this.saveToDependencies]) @@ -289,9 +291,13 @@ Installer.prototype.run = function (cb) { self.idealTree.warnings.forEach(function (warning) { if (warning.code === 'EPACKAGEJSON' && self.global) return if (warning.code === 'ENOTDIR') return - errorMessage(warning).summary.forEach(function (logline) { + var output = errorMessage(warning) + output.summary.forEach(function (logline) { log.warn.apply(log, logline) }) + output.detail.forEach(function (logline) { + log.verbose.apply(log, logline) + }) }) } if (installEr && postInstallEr) { @@ -310,7 +316,7 @@ Installer.prototype.run = function (cb) { Installer.prototype.loadArgMetadata = function (next) { var self = this - getAllMetadata(this.args, this.currentTree, iferr(next, function (args) { + getAllMetadata(this.args, this.currentTree, process.cwd(), iferr(next, function (args) { self.args = args next() })) @@ -520,19 +526,29 @@ Installer.prototype.commit = function (staging, actionsToRun, cb) { }, cb) } -Installer.prototype.runTopLevelLifecycles = function (cb) { +Installer.prototype.runPreinstallTopLevelLifecycles = function (cb) { validate('F', arguments) if (this.failing) return cb() - log.silly('install', 'runTopLevelLifecycles') + if (!this.topLevelLifecycles) return cb() + log.silly('install', 'runPreinstallTopLevelLifecycles') + var steps = [] + var trackLifecycle = this.progress.runTopLevelLifecycles + + steps.push( + [doOneAction, 'preinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('preinstall:.')] + ) + chain(steps, cb) +} + +Installer.prototype.runPostinstallTopLevelLifecycles = function (cb) { + validate('F', arguments) + if (this.failing) return cb() + if (!this.topLevelLifecycles) return cb() + log.silly('install', 'runPostinstallTopLevelLifecycles') var steps = [] var trackLifecycle = this.progress.runTopLevelLifecycles - if (!this.topLevelLifecycles) { - trackLifecycle.finish() - return cb() - } steps.push( - [doOneAction, 'preinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('preinstall:.')], [doOneAction, 'build', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('build:.')], [doOneAction, 'install', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('install:.')], [doOneAction, 'postinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('postinstall:.')]) @@ -591,18 +607,19 @@ Installer.prototype.readLocalPackageData = function (cb) { return cb(er) } if (!currentTree.package) currentTree.package = {} - self.loadArgMetadata(iferr(cb, function () { - if (currentTree.package._shrinkwrap) return cb() + if (currentTree.package._shrinkwrap) { + self.loadArgMetadata(cb) + } else { fs.readFile(path.join(self.where, 'npm-shrinkwrap.json'), function (er, data) { - if (er) return cb() + if (er) return self.loadArgMetadata(cb) try { currentTree.package._shrinkwrap = parseJSON(data) } catch (ex) { return cb(ex) } - return cb() + return self.loadArgMetadata(cb) }) - })) + } })) })) } diff --git a/deps/npm/lib/install/action/update-linked.js b/deps/npm/lib/install/action/update-linked.js index 46c4cdfadd1509..b37f477e17af2a 100644 --- a/deps/npm/lib/install/action/update-linked.js +++ b/deps/npm/lib/install/action/update-linked.js @@ -2,7 +2,9 @@ var path = require('path') module.exports = function (top, buildpath, pkg, log, next) { - log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, - 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") + if (pkg.package.version !== pkg.oldPkg.package.version) { + log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, + 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") + } next() } diff --git a/deps/npm/lib/install/actions.js b/deps/npm/lib/install/actions.js index 1c7462030c2a5a..7c3f97cefc82bc 100644 --- a/deps/npm/lib/install/actions.js +++ b/deps/npm/lib/install/actions.js @@ -3,13 +3,14 @@ var path = require('path') var validate = require('aproba') var chain = require('slide').chain var asyncMap = require('slide').asyncMap -var log = require('npmlog') +var iferr = require('iferr') var andFinishTracker = require('./and-finish-tracker.js') var andAddParentToErrors = require('./and-add-parent-to-errors.js') var failedDependency = require('./deps.js').failedDependency -var packageId = require('../utils/package-id.js') var moduleName = require('../utils/module-name.js') var buildPath = require('./build-path.js') +var reportOptionalFailure = require('./report-optional-failure.js') +var isInstallable = require('./validate-args.js').isInstallable var actions = {} @@ -45,7 +46,23 @@ Object.keys(actions).forEach(function (actionName) { if (!pkg.commit) pkg.commit = [] pkg.commit.push(action.commit) } - return action(top, buildpath, pkg, log, andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, next)))) + if (pkg.knownInstallable) { + return thenRunAction() + } else { + return isInstallable(pkg.package, iferr(andDone(next), andMarkInstallable(thenRunAction))) + } + function andMarkInstallable (cb) { + return function () { + pkg.knownInstallable = true + cb() + } + } + function thenRunAction () { + action(top, buildpath, pkg, log, andDone(next)) + } + function andDone (cb) { + return andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, cb))) + } } }) @@ -70,8 +87,7 @@ function andHandleOptionalDepErrors (pkg, next) { if (isFatal) anyFatal = true } if (anyFatal) return next.apply(null, arguments) - log.warn('install:' + packageId(pkg), er.message) - log.verbose('install:' + packageId(pkg), er.stack) + reportOptionalFailure(pkg, null, er) next() } } diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js index 886e8419135767..762f3967524349 100644 --- a/deps/npm/lib/install/deps.js +++ b/deps/npm/lib/install/deps.js @@ -1,7 +1,6 @@ 'use strict' var assert = require('assert') var path = require('path') -var url = require('url') var semver = require('semver') var asyncMap = require('slide').asyncMap var chain = require('slide').chain @@ -10,6 +9,7 @@ var iferr = require('iferr') var npa = require('npm-package-arg') var validate = require('aproba') var realizePackageSpecifier = require('realize-package-specifier') +var realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier') var asap = require('asap') var dezalgo = require('dezalgo') var fetchPackageMetadata = require('../fetch-package-metadata.js') @@ -21,13 +21,16 @@ var inflateShrinkwrap = require('./inflate-shrinkwrap.js') var inflateBundled = require('./inflate-bundled.js') var andFinishTracker = require('./and-finish-tracker.js') var npm = require('../npm.js') -var flatName = require('./flatten-tree.js').flatName +var flatNameFromTree = require('./flatten-tree.js').flatNameFromTree var createChild = require('./node.js').create var resetMetadata = require('./node.js').reset var andIgnoreErrors = require('./and-ignore-errors.js') var isInstallable = require('./validate-args.js').isInstallable var packageId = require('../utils/package-id.js') var moduleName = require('../utils/module-name.js') +var isDevDep = require('./is-dev-dep.js') +var isProdDep = require('./is-prod-dep.js') +var reportOptionalFailure = require('./report-optional-failure.js') // The export functions in this module mutate a dependency tree, adding // items to them. @@ -50,16 +53,6 @@ function isDep (tree, child, cb) { }) } -function isDevDep (tree, name, cb) { - var devDeps = tree.package.devDependencies || {} - return devDeps[name] -} - -function isProdDep (tree, name, cb) { - var deps = tree.package.dependencies || {} - return deps[name] -} - var registryTypes = { range: true, version: true } function doesChildVersionMatch (child, requested, requestor) { @@ -212,26 +205,29 @@ function getShrinkwrap (tree, name) { return tree.package._shrinkwrap && tree.package._shrinkwrap.dependencies && tree.package._shrinkwrap.dependencies[name] } -exports.getAllMetadata = function (args, tree, next) { - asyncMap(args, function (spec, done) { - if (tree && spec.lastIndexOf('@') <= 0) { - var sw = getShrinkwrap(tree, spec) +exports.getAllMetadata = function (args, tree, where, next) { + asyncMap(args, function (arg, done) { + function fetchMetadataWithVersion () { + var version = matchingDep(tree, arg) + var spec = version == null ? arg : arg + '@' + version + return fetchPackageMetadata(spec, where, done) + } + if (tree && arg.lastIndexOf('@') <= 0) { + var sw = getShrinkwrap(tree, arg) if (sw) { - // FIXME: This is duplicated in inflate-shrinkwrap and should be factoed - // into a shared function - spec = sw.resolved - ? spec + '@' + sw.resolved - : (sw.from && url.parse(sw.from).protocol) - ? spec + '@' + sw.from - : spec + '@' + sw.version + return realizeShrinkwrapSpecifier(arg, sw, where, function (err, spec) { + if (err) { + return fetchMetadataWithVersion() + } else { + return fetchPackageMetadata(spec, where, done) + } + }) } else { - var version = matchingDep(tree, spec) - if (version != null) { - spec += '@' + version - } + return fetchMetadataWithVersion() } + } else { + return fetchPackageMetadata(arg, where, done) } - fetchPackageMetadata(spec, packageRelativePath(tree), done) }, next) } @@ -354,18 +350,6 @@ var failedDependency = exports.failedDependency = function (tree, name_pkg) { return false } -function top (tree) { - if (tree.parent) return top(tree.parent) - return tree -} - -function treeWarn (tree, what, error) { - var topTree = top(tree) - if (!topTree.warnings) topTree.warnings = [] - error.optional = flatNameFromTree(tree) + '/' + what - topTree.warnings.push(error) -} - function andHandleOptionalErrors (log, tree, name, done) { validate('OOSF', arguments) return function (er, child, childLog) { @@ -374,7 +358,7 @@ function andHandleOptionalErrors (log, tree, name, done) { var isFatal = failedDependency(tree, name) if (er && !isFatal) { tree.children = tree.children.filter(noModuleNameMatches(name)) - treeWarn(tree, name, er) + reportOptionalFailure(tree, name, er) return done() } else { return done(er, child, childLog) @@ -449,7 +433,9 @@ function addDependency (name, versionSpec, tree, log, done) { } })) } else { - resolveWithNewModule(req, tree, log, next) + fetchPackageMetadata(req, packageRelativePath(tree), log.newItem('fetchMetadata'), iferr(next, function (pkg) { + resolveWithNewModule(pkg, tree, log, next) + })) } })) } @@ -471,14 +457,6 @@ var updatePhantomChildren = exports.updatePhantomChildren = function (current, c } } -function flatNameFromTree (tree) { - validate('O', arguments) - if (tree.isTop) return '/' - var path = flatNameFromTree(tree.parent) - if (path !== '/') path += '/' - return flatName(path, tree) -} - exports._replaceModuleByPath = replaceModuleByPath function replaceModuleByPath (obj, key, child) { return replaceModule(obj, key, child, function (replacing, child) { @@ -511,56 +489,47 @@ function replaceModule (obj, key, child, matchBy) { function resolveWithNewModule (pkg, tree, log, next) { validate('OOOF', arguments) - if (pkg.type) { - return fetchPackageMetadata(pkg, packageRelativePath(tree), log.newItem('fetchMetadata'), iferr(next, function (pkg) { - resolveWithNewModule(pkg, tree, log, next) - })) - } - - if (!pkg._installable) { - log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') - return isInstallable(pkg, iferr(next, function () { - pkg._installable = true - resolveWithNewModule(pkg, tree, log, next) - })) - } - - if (!pkg._from) { - pkg._from = pkg._requested.name + '@' + pkg._requested.spec - } - addShrinkwrap(pkg, iferr(next, function () { - addBundled(pkg, iferr(next, function () { - var parent = earliestInstallable(tree, tree, pkg) || tree - var child = createChild({ - package: pkg, - parent: parent, - path: path.join(parent.path, 'node_modules', pkg.name), - realpath: path.resolve(parent.realpath, 'node_modules', pkg.name), - children: pkg._bundled || [], - isLink: tree.isLink - }) - delete pkg._bundled - var hasBundled = child.children.length - - var replaced = replaceModuleByName(parent, 'children', child) - if (replaced) removeObsoleteDep(replaced) - addRequiredDep(tree, child, function () { - child.location = flatNameFromTree(child) - if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) - - if (hasBundled) { - inflateBundled(child, child.children) - } - - if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { - return inflateShrinkwrap(child, pkg._shrinkwrap.dependencies, function (er) { - next(er, child, log) - }) - } + log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') + return isInstallable(pkg, iferr(next, function () { + if (!pkg._from) { + pkg._from = pkg._requested.name + '@' + pkg._requested.spec + } + addShrinkwrap(pkg, iferr(next, function () { + addBundled(pkg, iferr(next, function () { + var parent = earliestInstallable(tree, tree, pkg) || tree + var child = createChild({ + package: pkg, + parent: parent, + path: path.join(parent.path, 'node_modules', pkg.name), + realpath: path.resolve(parent.realpath, 'node_modules', pkg.name), + children: pkg._bundled || [], + isLink: tree.isLink, + knownInstallable: true + }) + delete pkg._bundled + var hasBundled = child.children.length + + var replaced = replaceModuleByName(parent, 'children', child) + if (replaced) removeObsoleteDep(replaced) + addRequiredDep(tree, child, function () { + child.location = flatNameFromTree(child) + + if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) + + if (hasBundled) { + inflateBundled(child, child.children) + } + + if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { + return inflateShrinkwrap(child, pkg._shrinkwrap.dependencies, function (er) { + next(er, child, log) + }) + } - next(null, child, log) - }) + next(null, child, log) + }) + })) })) })) } diff --git a/deps/npm/lib/install/flatten-tree.js b/deps/npm/lib/install/flatten-tree.js index 869685a4e8450c..b6ceb30f2fd916 100644 --- a/deps/npm/lib/install/flatten-tree.js +++ b/deps/npm/lib/install/flatten-tree.js @@ -2,7 +2,11 @@ var validate = require('aproba') var moduleName = require('../utils/module-name.js') -module.exports = function (tree) { +module.exports = flattenTree +module.exports.flatName = flatName +module.exports.flatNameFromTree = flatNameFromTree + +function flattenTree (tree) { validate('O', arguments) var seen = {} var flat = {} @@ -24,7 +28,15 @@ module.exports = function (tree) { return flat } -var flatName = module.exports.flatName = function (path, child) { +function flatName (path, child) { validate('SO', arguments) return path + (moduleName(child) || 'TOP') } + +function flatNameFromTree (tree) { + validate('O', arguments) + if (tree.isTop) return '/' + var path = flatNameFromTree(tree.parent) + if (path !== '/') path += '/' + return flatName(path, tree) +} diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js index 1853f2c068cb93..ab1bdd1f1912f0 100644 --- a/deps/npm/lib/install/inflate-shrinkwrap.js +++ b/deps/npm/lib/install/inflate-shrinkwrap.js @@ -1,9 +1,9 @@ 'use strict' -var url = require('url') var asyncMap = require('slide').asyncMap var validate = require('aproba') var iferr = require('iferr') -var realizePackageSpecifier = require('realize-package-specifier') +var realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier.js') +var isRegistrySpecifier = require('./is-registry-specifier.js') var fetchPackageMetadata = require('../fetch-package-metadata.js') var annotateMetadata = require('../fetch-package-metadata.js').annotateMetadata var addShrinkwrap = require('../fetch-package-metadata.js').addShrinkwrap @@ -14,53 +14,80 @@ var createChild = require('./node.js').create var moduleName = require('../utils/module-name.js') var childPath = require('../utils/child-path.js') -var inflateShrinkwrap = module.exports = function (tree, swdeps, finishInflating) { - validate('OOF', arguments) +module.exports = function (tree, swdeps, finishInflating) { if (!npm.config.get('shrinkwrap')) return finishInflating() + return inflateShrinkwrap(tree.path, tree, swdeps, finishInflating) +} + +function inflateShrinkwrap (topPath, tree, swdeps, finishInflating) { + validate('SOOF', arguments) var onDisk = {} tree.children.forEach(function (child) { onDisk[moduleName(child)] = child }) tree.children = [] - asyncMap(Object.keys(swdeps), function (name, next) { - var sw = swdeps[name] - var spec = sw.resolved - ? name + '@' + sw.resolved - : (sw.from && url.parse(sw.from).protocol) - ? name + '@' + sw.from - : name + '@' + sw.version - var child = onDisk[name] - if (child && (child.fromShrinkwrap || - (sw.resolved && child.package._resolved === sw.resolved) || - (sw.from && url.parse(sw.from).protocol && child.package._from === sw.from) || - child.package.version === sw.version)) { - if (!child.fromShrinkwrap) child.fromShrinkwrap = spec - tree.children.push(child) + var dev = npm.config.get('dev') || (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || /^dev(elopment)?$/.test(npm.config.get('only')) + var prod = !/^dev(elopment)?$/.test(npm.config.get('only')) + return asyncMap(Object.keys(swdeps), doRealizeAndInflate, finishInflating) + + function doRealizeAndInflate (name, next) { + return realizeShrinkwrapSpecifier(name, swdeps[name], topPath, iferr(next, andInflate(name, next))) + } - return realizePackageSpecifier(spec, tree.path, iferr(next, function (requested) { - annotateMetadata(child.package, requested, spec, tree.path) - return inflateShrinkwrap(child, sw.dependencies || {}, next) - })) + function andInflate (name, next) { + return function (requested) { + var sw = swdeps[name] + var dependencies = sw.dependencies || {} + if ((!prod && !sw.dev) || (!dev && sw.dev)) return next() + var child = onDisk[name] + if (childIsEquivalent(sw, requested, child)) { + if (!child.fromShrinkwrap) child.fromShrinkwrap = requested.raw + tree.children.push(child) + annotateMetadata(child.package, requested, requested.raw, topPath) + return inflateShrinkwrap(topPath, child, dependencies || {}, next) + } else { + var from = sw.from || requested.raw + return fetchPackageMetadata(requested, topPath, iferr(next, andAddShrinkwrap(from, dependencies, next))) + } } - fetchPackageMetadata(spec, tree.path, iferr(next, function (pkg) { - pkg._from = sw.from || spec - addShrinkwrap(pkg, iferr(next, function () { - addBundled(pkg, iferr(next, function () { - var child = createChild({ - package: pkg, - loaded: false, - parent: tree, - fromShrinkwrap: spec, - path: childPath(tree.path, pkg), - realpath: childPath(tree.realpath, pkg), - children: pkg._bundled || [] - }) - tree.children.push(child) - if (pkg._bundled) { - delete pkg._bundled - inflateBundled(child, child.children) - } - inflateShrinkwrap(child, sw.dependencies || {}, next) - })) - })) - })) - }, finishInflating) + } + + function andAddShrinkwrap (from, dependencies, next) { + return function (pkg) { + pkg._from = from + addShrinkwrap(pkg, iferr(next, andAddBundled(pkg, dependencies, next))) + } + } + + function andAddBundled (pkg, dependencies, next) { + return function () { + return addBundled(pkg, iferr(next, andAddChild(pkg, dependencies, next))) + } + } + + function andAddChild (pkg, dependencies, next) { + return function () { + var child = createChild({ + package: pkg, + loaded: false, + parent: tree, + fromShrinkwrap: pkg._from, + path: childPath(tree.path, pkg), + realpath: childPath(tree.realpath, pkg), + children: pkg._bundled || [] + }) + tree.children.push(child) + if (pkg._bundled) { + delete pkg._bundled + inflateBundled(child, child.children) + } + inflateShrinkwrap(topPath, child, dependencies || {}, next) + } + } +} + +function childIsEquivalent (sw, requested, child) { + if (!child) return false + if (child.fromShrinkwrap) return true + if (sw.resolved) return child.package._resolved === sw.resolved + if (!isRegistrySpecifier(requested) && sw.from) return child.package._from === sw.from + return child.package.version === sw.version } diff --git a/deps/npm/lib/install/is-dev-dep.js b/deps/npm/lib/install/is-dev-dep.js new file mode 100644 index 00000000000000..c7a7982c5e670e --- /dev/null +++ b/deps/npm/lib/install/is-dev-dep.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = isDevDep + +function isDevDep (node, name) { + return node.package && + node.package.devDependencies && + node.package.devDependencies[name] +} diff --git a/deps/npm/lib/install/is-dev.js b/deps/npm/lib/install/is-dev.js deleted file mode 100644 index e0fae4eb82dc41..00000000000000 --- a/deps/npm/lib/install/is-dev.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' -var moduleName = require('../utils/module-name.js') - -function andIsDev (name) { - return function (req) { - return req.package && - req.package.devDependencies && - req.package.devDependencies[name] - } -} - -exports.isDev = function (node) { - return node.requiredBy.some(andIsDev(moduleName(node))) -} - -function andIsOnlyDev (name) { - var isThisDev = andIsDev(name) - return function (req) { - return isThisDev(req) && - (!req.package.dependencies || !req.package.dependencies[name]) - } -} - -exports.isOnlyDev = function (node) { - return node.requiredBy.every(andIsOnlyDev(moduleName(node))) -} diff --git a/deps/npm/lib/install/is-opt-dep.js b/deps/npm/lib/install/is-opt-dep.js new file mode 100644 index 00000000000000..807b8ab998bf20 --- /dev/null +++ b/deps/npm/lib/install/is-opt-dep.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = isOptDep + +function isOptDep (node, name) { + return node.package && + node.package.optionalDependencies && + node.package.optionalDependencies[name] +} diff --git a/deps/npm/lib/install/is-prod-dep.js b/deps/npm/lib/install/is-prod-dep.js new file mode 100644 index 00000000000000..1e2a0b4e4904cf --- /dev/null +++ b/deps/npm/lib/install/is-prod-dep.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = isProdDep + +function isProdDep (node, name) { + return node.package && + node.package.dependencies && + node.package.dependencies[name] +} diff --git a/deps/npm/lib/install/is-registry-specifier.js b/deps/npm/lib/install/is-registry-specifier.js new file mode 100644 index 00000000000000..606be2bd1319d1 --- /dev/null +++ b/deps/npm/lib/install/is-registry-specifier.js @@ -0,0 +1,6 @@ +'use strict' +module.exports = isRegistrySpecifier + +function isRegistrySpecifier (spec) { + return spec.type === 'range' || spec.type === 'version' || spec.type === 'tag' +} diff --git a/deps/npm/lib/install/realize-shrinkwrap-specifier.js b/deps/npm/lib/install/realize-shrinkwrap-specifier.js new file mode 100644 index 00000000000000..0c491a60289b4b --- /dev/null +++ b/deps/npm/lib/install/realize-shrinkwrap-specifier.js @@ -0,0 +1,25 @@ +'use strict' +var realizePackageSpecifier = require('realize-package-specifier') +var isRegistrySpecifier = require('./is-registry-specifier.js') + +module.exports = function (name, sw, where, cb) { + function lookup (ver, cb) { + realizePackageSpecifier(name + '@' + ver, where, cb) + } + if (sw.resolved) { + return lookup(sw.resolved, cb) + } else if (sw.from) { + return lookup(sw.from, function (err, spec) { + if (err || isRegistrySpecifier(spec)) { + return thenUseVersion() + } else { + return cb(null, spec) + } + }) + } else { + return thenUseVersion() + } + function thenUseVersion () { + lookup(sw.version, cb) + } +} diff --git a/deps/npm/lib/install/report-optional-failure.js b/deps/npm/lib/install/report-optional-failure.js new file mode 100644 index 00000000000000..41c7c535bdd63b --- /dev/null +++ b/deps/npm/lib/install/report-optional-failure.js @@ -0,0 +1,31 @@ +'use strict' +var path = require('path') +var moduleName = require('../utils/module-name.js') + +module.exports = reportOptionalFailure + +function top (tree) { + if (tree.parent) return top(tree.parent) + return tree +} + +function reportOptionalFailure (tree, what, error) { + var topTree = top(tree) + if (!topTree.warnings) topTree.warnings = [] + var id + if (what) { + var depVer = tree.package.dependencies && tree.package.dependencies[what] + var optDepVer = tree.package.optionalDependencies && tree.package.optionalDependencies[what] + var devDepVer = tree.package.devDependencies && tree.package.devDependencies[what] + var version = depVer || optDepVer || devDepVer + id = what + (version ? '@' + version : '') + } else { + id = tree._id || moduleName(tree) + (tree.package.version ? '@' + tree.package.version : '') + } + var location = path.relative(topTree.path, tree.path) + if (what) location = path.join(location, 'node_modules', what) + + error.optional = id + error.location = location + topTree.warnings.push(error) +} diff --git a/deps/npm/lib/install/save.js b/deps/npm/lib/install/save.js index 708da61c8a9488..d5c97bfaa26f4e 100644 --- a/deps/npm/lib/install/save.js +++ b/deps/npm/lib/install/save.js @@ -12,7 +12,8 @@ var npm = require('../npm.js') var deepSortObject = require('../utils/deep-sort-object.js') var parseJSON = require('../utils/parse-json.js') var moduleName = require('../utils/module-name.js') -var isOnlyDev = require('./is-dev.js').isOnlyDev +var isDevDep = require('./is-dev-dep.js') +var createShrinkwrap = require('../shrinkwrap.js').createShrinkwrap // if the -S|--save option is specified, then write installed packages // as dependencies to a package.json file. @@ -49,25 +50,17 @@ function saveShrinkwrap (tree, next) { var saveOptional = npm.config.get('save-optional') var shrinkwrap = tree.package._shrinkwrap || {dependencies: {}} - var hasDevOnlyDeps = tree.requires.filter(function (dep) { - return isOnlyDev(dep) - }).some(function (dep) { - return shrinkwrap.dependencies[dep.package.name] != null + var shrinkwrapHasAnyDevOnlyDeps = tree.requires.some(function (dep) { + var name = moduleName(dep) + return isDevDep(tree, name) && + shrinkwrap.dependencies[name] != null }) - if (!saveOptional && saveDev && !hasDevOnlyDeps) return next() - if (saveOptional || !save) return next() + if (!saveOptional && saveDev && !shrinkwrapHasAnyDevOnlyDeps) return next() + if (saveOptional || !(save || saveDev)) return next() - if (hasDevOnlyDeps) { - var dev = npm.config.get('dev') - npm.config.set('dev', true) - npm.commands.shrinkwrap([], true, function () { - npm.config.set('dev', dev) - next.apply(this, arguments) - }) - } else { - npm.commands.shrinkwrap([], true, next) - } + var silent = false + createShrinkwrap(tree.path, tree.package, shrinkwrapHasAnyDevOnlyDeps, silent, next) }) } diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index c6a41842fcc4b2..02481a235e64c3 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -15,11 +15,13 @@ var npm = require('./npm.js') var recalculateMetadata = require('./install/deps.js').recalculateMetadata var validatePeerDeps = require('./install/deps.js').validatePeerDeps var isExtraneous = require('./install/is-extraneous.js') -var isOnlyDev = require('./install/is-dev.js').isOnlyDev var packageId = require('./utils/package-id.js') var moduleName = require('./utils/module-name.js') var output = require('./utils/output.js') var lifecycle = require('./utils/lifecycle.js') +var isDevDep = require('./install/is-dev-dep.js') +var isProdDep = require('./install/is-prod-dep.js') +var isOptDep = require('./install/is-opt-dep.js') shrinkwrap.usage = 'npm shrinkwrap' @@ -35,25 +37,31 @@ function shrinkwrap (args, silent, cb) { var dir = path.resolve(npm.dir, '..') var packagePath = path.join(npm.localPrefix, 'package.json') - npm.config.set('production', true) - - readPackageJson(packagePath, iferr(cb, function (data) { - lifecycle(data, 'preshrinkwrap', function () { - readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (tree) { - var pkginfo = treeToShrinkwrap(tree, !!npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also'))) - - chain([ - [lifecycle, tree.package, 'shrinkwrap'], - [shrinkwrap_, pkginfo, silent], - [lifecycle, tree.package, 'postshrinkwrap'] - ], iferr(cb, function (data) { - cb(null, data[0]) - })) - }))) - }) + var dev = !!npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also')) + + readPackageJson(packagePath, iferr(cb, function (pkg) { + createShrinkwrap(dir, pkg, dev, silent, cb) })) } +module.exports.createShrinkwrap = createShrinkwrap + +function createShrinkwrap (dir, pkg, dev, silent, cb) { + lifecycle(pkg, 'preshrinkwrap', function () { + readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (tree) { + var pkginfo = treeToShrinkwrap(tree, dev) + + chain([ + [lifecycle, tree.package, 'shrinkwrap'], + [shrinkwrap_, pkginfo, silent], + [lifecycle, tree.package, 'postshrinkwrap'] + ], iferr(cb, function (data) { + cb(null, data[0]) + })) + }))) + }) +} + function andRecalculateMetadata (next) { validate('F', arguments) return function (er, tree) { @@ -92,14 +100,17 @@ function shrinkwrapDeps (dev, problems, deps, tree, seen) { } }) tree.children.sort(function (aa, bb) { return moduleName(aa).localeCompare(moduleName(bb)) }).forEach(function (child) { - if (!dev && isOnlyDev(child)) { - log.warn('shrinkwrap', 'Excluding devDependency: %s', packageId(child), child.parent.package.dependencies) + var childIsOnlyDev = isOnlyDev(child) + if (!dev && childIsOnlyDev) { + log.warn('shrinkwrap', 'Excluding devDependency: %s', child.location) return } var pkginfo = deps[moduleName(child)] = {} pkginfo.version = child.package.version pkginfo.from = child.package._from pkginfo.resolved = child.package._resolved + if (dev && childIsOnlyDev) pkginfo.dev = true + if (isOptional(child)) pkginfo.optional = true if (isExtraneous(child)) { problems.push('extraneous: ' + child.package._id + ' ' + child.path) } @@ -143,3 +154,46 @@ function save (pkginfo, silent, cb) { cb(null, pkginfo) }) } + +// Returns true if the module `node` is only required direcctly as a dev +// dependency of the top level or transitively _from_ top level dev +// dependencies. +// Dual mode modules (that are both dev AND prod) should return false. +function isOnlyDev (node, seen) { + if (!seen) seen = {} + return node.requiredBy.length && node.requiredBy.every(andIsOnlyDev(moduleName(node), seen)) +} + +// There is a known limitation with this implementation: If a dependency is +// ONLY required by cycles that are detached from the top level then it will +// ultimately return ture. +// +// This is ok though: We don't allow shrinkwraps with extraneous deps and +// these situation is caught by the extraneous checker before we get here. +function andIsOnlyDev (name, seen) { + return function (req) { + var isDev = isDevDep(req, name) + var isProd = isProdDep(req, name) + if (req.isTop) { + return isDev && !isProd + } else { + if (seen[req.path]) return true + seen[req.path] = true + return isOnlyDev(req, seen) + } + } +} + +function isOptional (node, seen) { + if (!seen) seen = {} + // If a node is not required by anything, then we've reached + // the top level package. + if (seen[node.path] || node.requiredBy.length === 0) { + return false + } + seen[node.path] = true + + return node.requiredBy.every(function (req) { + return isOptDep(req, node.package.name) || isOptional(req, seen) + }) +} diff --git a/deps/npm/lib/utils/correct-mkdir.js b/deps/npm/lib/utils/correct-mkdir.js index c0a31bdc58a10a..68c4a4ad79ae2e 100644 --- a/deps/npm/lib/utils/correct-mkdir.js +++ b/deps/npm/lib/utils/correct-mkdir.js @@ -43,8 +43,13 @@ function calculateOwner () { if (!effectiveOwner) { effectiveOwner = { uid: 0, gid: 0 } - if (process.getuid) effectiveOwner.uid = +process.getuid() - if (process.getgid) effectiveOwner.gid = +process.getgid() + // Pretty much only on windows + if (!process.getuid) { + return effectiveOwner + } + + effectiveOwner.uid = +process.getuid() + effectiveOwner.gid = +process.getgid() if (effectiveOwner.uid === 0) { if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID @@ -112,6 +117,7 @@ function makeDirectory (path, cb) { function setPermissions (path, st, cb) { chownr(path, st.uid, st.gid, function (er) { + if (er && er.code === 'ENOENT') return cb(null, st) return cb(er, st) }) } diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index fca92ee4cb5358..5c7ce15bf1b578 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -8,9 +8,6 @@ module.exports = errorMessage function errorMessage (er) { var short = [] var detail = [] - if (er.optional) { - short.push(['optional', 'Skipping failed optional dependency ' + er.optional + ':']) - } switch (er.code) { case 'ECONNREFUSED': short.push(['', er]) @@ -150,17 +147,21 @@ function errorMessage (er) { break case 'EBADPLATFORM': + var validOs = er.os.join ? er.os.join(',') : er.os + var validArch = er.cpu.join ? er.cpu.join(',') : er.cpu + var expected = {os: validOs, arch: validArch} + var actual = {os: process.platform, arch: process.arch} short.push([ 'notsup', [ - 'Not compatible with your operating system or architecture: ' + er.pkgid + util.format('Unsupported platform for %s: wanted %j (current: %j)', er.pkgid, expected, actual) ].join('\n') ]) detail.push([ 'notsup', [ - 'Valid OS: ' + (er.os.join ? er.os.join(',') : util.inspect(er.os)), - 'Valid Arch: ' + (er.cpu.join ? er.cpu.join(',') : util.inspect(er.cpu)), + 'Valid OS: ' + validOs, + 'Valid Arch: ' + validArch, 'Actual OS: ' + process.platform, 'Actual Arch: ' + process.arch ].join('\n') @@ -284,7 +285,7 @@ function errorMessage (er) { 'typeerror', [ 'This is an error with npm itself. Please report this error at:', - ' ' + ' ' ].join('\n') ]) break @@ -313,5 +314,12 @@ function errorMessage (er) { ]) break } + if (er.optional) { + short.unshift(['optional', er.optional + ' (' + er.location + '):']) + short.concat(detail).forEach(function (msg) { + if (!msg[0]) msg[0] = 'optional' + if (msg[1]) msg[1] = msg[1].toString().replace(/(^|\n)/g, '$1SKIPPING OPTIONAL DEPENDENCY: ') + }) + } return {summary: short, detail: detail} } diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index 6a862366f28374..adf534d8824256 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -15,6 +15,7 @@ var uidNumber = require('uid-number') var umask = require('./umask') var usage = require('./usage') var output = require('./output.js') +var which = require('which') // windows calls it's path 'Path' usually, but this is not guaranteed. if (process.platform === 'win32') { @@ -88,7 +89,7 @@ function _incorrectWorkingDirectory (wd, pkg) { function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { var pathArr = [] - var p = wd.split('node_modules') + var p = wd.split(/[\\\/]node_modules[\\\/]/) var acc = path.resolve(p.shift()) p.forEach(function (pp) { @@ -101,8 +102,10 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { // the bundled one will be used for installing things. pathArr.unshift(path.join(__dirname, '..', '..', 'bin', 'node-gyp-bin')) - // prefer current node interpreter in child scripts - pathArr.push(path.dirname(process.execPath)) + if (shouldPrependCurrentNodeDirToPATH()) { + // prefer current node interpreter in child scripts + pathArr.push(path.dirname(process.execPath)) + } if (env[PATH]) pathArr.push(env[PATH]) env[PATH] = pathArr.join(process.platform === 'win32' ? ';' : ':') @@ -138,6 +141,16 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { ) } +function shouldPrependCurrentNodeDirToPATH () { + var isWindows = process.platform === 'win32' + try { + var foundExecPath = which.sync(path.basename(process.execPath), {pathExt: isWindows ? ';' : ':'}) + return process.execPath.toUpperCase() !== foundExecPath.toUpperCase() + } catch (e) { + return true + } +} + function validWd (d, cb) { fs.stat(d, function (er, st) { if (er || !st.isDirectory()) { diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index 1e00040dbb12e2..f580c8e05dee2f 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -102,7 +102,8 @@ BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) { entry === '.npmrc' || entry.match(/^\..*\.swp$/) || entry === '.DS_Store' || - entry.match(/^\._/) + entry.match(/^\._/) || + entry.match(/^.*\.orig$/) ) { return false } @@ -117,7 +118,17 @@ BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) { // if they're not already present at a higher level. if (this.bundleMagic) { // bubbling up. stop here and allow anything the bundled pkg allows - if (entry.indexOf('/') !== -1) return true + if (entry.charAt(0) === '@') { + var firstSlash = entry.indexOf('/') + // continue to list the packages in this scope + if (firstSlash === -1) return true + + // bubbling up. stop here and allow anything the bundled pkg allows + if (entry.indexOf('/', firstSlash + 1) !== -1) return true + // bubbling up. stop here and allow anything the bundled pkg allows + } else if (entry.indexOf('/') !== -1) { + return true + } // never include the .bin. It's typically full of platform-specific // stuff like symlinks and .cmd files anyway. diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index ee683f3faa33e3..cc29b0d5dbfa31 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "July 2016" "" "" +.TH "NPM" "1" "September 2016" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P @@ -10,7 +10,7 @@ This is just enough info to get you up and running\. Much more info available via \fBnpm help\fP once it's installed\. .SH IMPORTANT .P -\fBYou need node v0\.8 or higher to run this program\.\fR +\fBYou need node v0\.10 or higher to run this program\.\fR .P To install an old \fBand unsupported\fR version of npm that works on node 0\.3 and prior, clone the git repo and dig through the old tags and branches\. diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index b286750f75738a..bbe984114b9889 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "July 2016" "" "" +.TH "NPM\-ACCESS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index d5ab3388dbade7..f4d1791135d12b 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "July 2016" "" "" +.TH "NPM\-ADDUSER" "1" "September 2016" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 79c96247b3c36e..1677875ccac8cf 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "July 2016" "" "" +.TH "NPM\-BIN" "1" "September 2016" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 6ff470e37d230d..b7fa194c5ab686 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "July 2016" "" "" +.TH "NPM\-BUGS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index 7ff15443520619..b19ccdcb1536b5 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUILD" "1" "July 2016" "" "" +.TH "NPM\-BUILD" "1" "September 2016" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index a5a155afef5a86..a7e5074c9f3729 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUNDLE" "1" "July 2016" "" "" +.TH "NPM\-BUNDLE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-bundle\fR \- REMOVED .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index d398aec675d311..dde845e55c1459 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "July 2016" "" "" +.TH "NPM\-CACHE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 921bdffa3d2548..8deed99426fa4c 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "July 2016" "" "" +.TH "NPM\-COMPLETION" "1" "September 2016" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 42ac398922f68e..656e5c9edcba96 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "July 2016" "" "" +.TH "NPM\-CONFIG" "1" "September 2016" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index ff30caa4f06f99..d87889b98a303f 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "July 2016" "" "" +.TH "NPM\-DEDUPE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 14804f667f2a1f..aba4ad4264fa66 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "July 2016" "" "" +.TH "NPM\-DEPRECATE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 1e76f9ddb90afb..d74a64cf7f11e3 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "July 2016" "" "" +.TH "NPM\-DIST\-TAG" "1" "September 2016" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index f48035491d9a71..4a3656347ba3bc 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "July 2016" "" "" +.TH "NPM\-DOCS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 7d021c379bc2ab..7088e2740a9ee0 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "July 2016" "" "" +.TH "NPM\-EDIT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index c903dbc6c10ec8..bdfb4799d2422e 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "July 2016" "" "" +.TH "NPM\-EXPLORE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 5051b9f15f7e38..23e3b82fe97dd8 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "July 2016" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 4f7c51b05552c8..32d40841d1c1f8 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "July 2016" "" "" +.TH "NPM\-HELP" "1" "September 2016" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 5bf262a91cd1d8..5c6c86a6b225bb 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "July 2016" "" "" +.TH "NPM\-INIT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-init\fR \- Interactively create a package\.json file .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index 00edb05ef5241b..c4d388164eb9fd 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM" "" "July 2016" "" "" +.TH "NPM" "" "September 2016" "" "" .SH "NAME" \fBnpm\fR .SH SYNOPSIS @@ -30,3 +30,4 @@ npm help install npm help test .RE + diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index abb1cee2cb6cc2..bd1060976db464 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "July 2016" "" "" +.TH "NPM\-INSTALL" "1" "September 2016" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS @@ -209,6 +209,8 @@ fetch the package by name if it is not valid\. .IP \(bu 2 \fBGIT_ASKPASS\fP .IP \(bu 2 +\fBGIT_EXEC_PATH\fP +.IP \(bu 2 \fBGIT_PROXY_COMMAND\fP .IP \(bu 2 \fBGIT_SSH\fP @@ -320,7 +322,7 @@ global \fBnode_modules\fP folder\. Only your direct dependencies will show in \fBnode_modules\fP and everything they depend on will be flattened in their \fBnode_modules\fP folders\. This obviously will eliminate some deduping\. .P -The \fB\-\-ignore\-scripts\fP argument will cause npm to not execute any +The \fB\-\-ignore\-scripts\fP argument will cause npm to not execute any scripts defined in the package\.json\. See npm help 7 \fBnpm\-scripts\fP\|\. .P The \fB\-\-legacy\-bundling\fP argument will cause npm to install the package such diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 39ef63626b3337..987972f594caa0 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "July 2016" "" "" +.TH "NPM\-LINK" "1" "September 2016" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS @@ -17,7 +17,8 @@ Package linking is a two\-step process\. .P First, \fBnpm link\fP in a package folder will create a symlink in the global folder \fB{prefix}/lib/node_modules/\fP that links to the package where the \fBnpm -link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. +link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. It +will also link any bins in the package to \fB{prefix}/bin/{name}\fP\|\. .P Next, in some other location, \fBnpm link package\-name\fP will create a symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 58bafbe8a8e93c..e8ab7c817f80e9 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "July 2016" "" "" +.TH "NPM\-LOGOUT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index b3c4b9ea0ed57c..31ce8100fec718 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "July 2016" "" "" +.TH "NPM\-LS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS @@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@3.10.3 /path/to/npm +npm@3.10.8 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 4f1a781707fdfc..f56632ca929fef 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "July 2016" "" "" +.TH "NPM\-OUTDATED" "1" "September 2016" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index fe78681ef0b19d..f64765ca0552c3 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "July 2016" "" "" +.TH "NPM\-OWNER" "1" "September 2016" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 7926b837be1bfc..b29aec3507bbb1 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "July 2016" "" "" +.TH "NPM\-PACK" "1" "September 2016" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 737d3589ff5975..23e50b97cbc17d 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "July 2016" "" "" +.TH "NPM\-PING" "1" "September 2016" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SH SYNOPSIS @@ -21,3 +21,4 @@ npm help 7 config npm help 5 npmrc .RE + diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index fb11988956d9f4..2fd5b3b278bc84 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "July 2016" "" "" +.TH "NPM\-PREFIX" "1" "September 2016" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index b6e3c5afd53cfb..da997ea619e8c9 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "July 2016" "" "" +.TH "NPM\-PRUNE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index b103bb726e8c75..71fb371c2c6c03 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "July 2016" "" "" +.TH "NPM\-PUBLISH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 93ae08be090cf7..e0331cffc1f8b2 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "July 2016" "" "" +.TH "NPM\-REBUILD" "1" "September 2016" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 406e0973290793..cad707c716fa39 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "July 2016" "" "" +.TH "NPM\-REPO" "1" "September 2016" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index d47e17f6474f31..921a9773e4b91e 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "July 2016" "" "" +.TH "NPM\-RESTART" "1" "September 2016" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 27f85d634b2599..3ec8c8304e899c 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "July 2016" "" "" +.TH "NPM\-ROOT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 01381138a8e2bd..b76c7a15d46475 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "July 2016" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS @@ -52,8 +52,8 @@ you should write: instead of \fB"scripts": {"test": "node_modules/\.bin/tap test/\\*\.js"}\fP to run your tests\. .P \fBnpm run\fP sets the \fBNODE\fP environment variable to the \fBnode\fP executable with -which \fBnpm\fP is executed, and adds the directory within which it resides to the -\fBPATH\fP, too\. +which \fBnpm\fP is executed\. Also, the directory within which it resides is added to the +\fBPATH\fP, if the \fBnode\fP executable is not in the \fBPATH\fP\|\. .P If you try to run a script without having a \fBnode_modules\fP directory and it fails, you will be given a warning to run \fBnpm install\fP, just in case you've forgotten\. diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index ee9b07cfe014ab..250cdc78c95daf 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "July 2016" "" "" +.TH "NPM\-SEARCH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 3242ee6aff2892..9d8b2b36cc7fd0 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "July 2016" "" "" +.TH "NPM\-SHRINKWRAP" "1" "September 2016" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions .SH SYNOPSIS @@ -179,11 +179,11 @@ To add or update a dependency in a shrinkwrapped package: Run \fBnpm install\fP in the package root to install the current versions of all dependencies\. .IP 2. 3 -Add or update dependencies\. \fBnpm install \-\-save\fP each new or updated -package individually to update the \fBpackage\.json\fP and the shrinkwrap\. -Note that they must be explicitly named in order to be installed: running -\fBnpm install\fP with no arguments will merely reproduce the existing -shrinkwrap\. +Add or update dependencies\. \fBnpm install \-\-save\fP or \fBnpm install \-\-save\-dev\fP +each new or updated package individually to update the \fBpackage\.json\fP and +the shrinkwrap\. Note that they must be explicitly named in order to be +installed: running \fBnpm install\fP with no arguments will merely reproduce +the existing shrinkwrap\. .IP 3. 3 Validate that the package works as expected with the new dependencies\. diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index ded49f816ca109..47f8072de3e89f 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "July 2016" "" "" +.TH "NPM\-STAR" "1" "September 2016" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 86bcc451c45614..fbc77313989a93 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "July 2016" "" "" +.TH "NPM\-STARS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 096c072065f3bb..59b1a8c8046b9a 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "July 2016" "" "" +.TH "NPM\-START" "1" "September 2016" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index b00d2033ce9fc2..3d99a839b95411 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "July 2016" "" "" +.TH "NPM\-STOP" "1" "September 2016" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1 index bb94a873fe50fb..7f5135db7ad9b4 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TAG" "1" "July 2016" "" "" +.TH "NPM\-TAG" "1" "September 2016" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS @@ -72,7 +72,7 @@ npm help config .IP \(bu 2 npm help 7 config .IP \(bu 2 -npm apihelp tag +npm help dist\-tag .IP \(bu 2 npm help 5 npmrc diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index b3344ffc59765c..f90a4fbba367b1 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "July 2016" "" "" +.TH "NPM\-TEAM" "1" "September 2016" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SH SYNOPSIS @@ -61,3 +61,4 @@ npm help access npm help 7 registry .RE + diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 2635d70ebe7773..52062560844785 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "July 2016" "" "" +.TH "NPM\-TEST" "1" "September 2016" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 0bb84146302271..c5fabeeccb34b3 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "July 2016" "" "" +.TH "NPM\-UNINSTALL" "1" "September 2016" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 159ab628a78d4b..91dcc58ca3d7a2 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "July 2016" "" "" +.TH "NPM\-UNPUBLISH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 9f8a77b3ec495f..01d9f96074a8fe 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "July 2016" "" "" +.TH "NPM\-UPDATE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 7e942b16ea348b..93a97e650088f8 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "July 2016" "" "" +.TH "NPM\-VERSION" "1" "September 2016" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index cc25f085a3e97d..43dd0a7dac9df0 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "July 2016" "" "" +.TH "NPM\-VIEW" "1" "September 2016" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index e0cf8bb9a0ed22..4b6a1eb042886d 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "July 2016" "" "" +.TH "NPM\-WHOAMI" "1" "September 2016" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index a48effc9ba8a62..de1e602bb695d8 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "July 2016" "" "" +.TH "NPM" "1" "September 2016" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -3.10.3 +3.10.8 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index 6a5c69676f89e0..d92cbc2d58b693 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "July 2016" "" "" +.TH "NPM\-FOLDERS" "5" "September 2016" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index 6a5c69676f89e0..d92cbc2d58b693 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "July 2016" "" "" +.TH "NPM\-FOLDERS" "5" "September 2016" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 6f9dc9dc467a59..fab44f3b50bec4 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "July 2016" "" "" +.TH "PACKAGE\.JSON" "5" "September 2016" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -263,6 +263,8 @@ Conversely, some files are always ignored: \fBnode_modules\fP .IP \(bu 2 \fBconfig\.gypi\fP +.IP \(bu 2 +\fB*\.orig\fP .RE .SH main @@ -317,6 +319,10 @@ would be the same as this: , "bin" : { "my\-program" : "\./path/to/program" } } .fi .RE +.P +Please make sure that your file(s) referenced in \fBbin\fP starts with +\fB#!/usr/bin/env node\fP, otherwise the scripts are started without the node +executable! .SH man .P Specify either a single file or an array of filenames to put in place for the diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 3bcab8e76b1f14..2d1e9daa224e84 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "July 2016" "" "" +.TH "NPMRC" "5" "September 2016" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION @@ -53,6 +53,19 @@ key[] = "second value" sensitive credentials, they must be readable and writable \fIonly\fR by your user account (i\.e\. must have a mode of \fB0600\fP), otherwise they \fIwill be ignored by npm!\fR +.SS Comments +.P +Lines in \fB\|\.npmrc\fP files are interpreted as comments when they begin with a \fB;\fP or \fB#\fP character\. \fB\|\.npmrc\fP files are parsed by npm/ini \fIhttps://github\.com/npm/ini\fR, which specifies this comment syntax\. +.P +For example: +.P +.RS 2 +.nf +# last modified: 01 Jan 2016 +; Set a new registry for a scoped package +@myscope:registry=https://mycustomregistry\.example\.org +.fi +.RE .SS Per\-project config file .P When working locally in a project, a \fB\|\.npmrc\fP file in the root of the diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index 6f9dc9dc467a59..fab44f3b50bec4 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "July 2016" "" "" +.TH "PACKAGE\.JSON" "5" "September 2016" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -263,6 +263,8 @@ Conversely, some files are always ignored: \fBnode_modules\fP .IP \(bu 2 \fBconfig\.gypi\fP +.IP \(bu 2 +\fB*\.orig\fP .RE .SH main @@ -317,6 +319,10 @@ would be the same as this: , "bin" : { "my\-program" : "\./path/to/program" } } .fi .RE +.P +Please make sure that your file(s) referenced in \fBbin\fP starts with +\fB#!/usr/bin/env node\fP, otherwise the scripts are started without the node +executable! .SH man .P Specify either a single file or an array of filenames to put in place for the diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 14cb636613aa0a..fca57b636be35f 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CODING\-STYLE" "7" "July 2016" "" "" +.TH "NPM\-CODING\-STYLE" "7" "September 2016" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 3c6246659bef55..aa56118f30348e 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "7" "July 2016" "" "" +.TH "NPM\-CONFIG" "7" "September 2016" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -24,13 +24,15 @@ same\. The four relevant files are: .RS 0 .IP \(bu 2 -per\-project config file (/path/to/my/project/\.npmrc) +per\-project configuration file (\fB/path/to/my/project/\.npmrc\fP) .IP \(bu 2 -per\-user config file (~/\.npmrc) +per\-user configuration file (defaults to \fB$HOME/\.npmrc\fP; configurable via CLI +option \fB\-\-userconfig\fP or environment variable \fB$NPM_CONF_USERCONFIG\fP) .IP \(bu 2 -global config file ($PREFIX/etc/npmrc) +global configuration file (defaults to \fB$PREFIX/etc/npmrc\fP; configurable via +CLI option \fB\-\-globalconfig\fP or environment variable \fB$NPM_CONF_GLOBALCONFIG\fP) .IP \(bu 2 -npm builtin config file (/path/to/npm/npmrc) +npm's built\-in configuration file (\fB/path/to/npm/npmrc\fP) .RE .P diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 8d95928286de5e..9a935711434bf7 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DEVELOPERS" "7" "July 2016" "" "" +.TH "NPM\-DEVELOPERS" "7" "September 2016" "" "" .SH "NAME" \fBnpm-developers\fR \- Developer Guide .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index b8d8f854759141..89b706c9c94e14 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DISPUTES" "7" "July 2016" "" "" +.TH "NPM\-DISPUTES" "7" "September 2016" "" "" .SH "NAME" \fBnpm-disputes\fR \- Handling Module Name Disputes .SH SYNOPSIS diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index b6790ccb32486a..79e721b913f0ce 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,4 +1,4 @@ -.TH "NPM\-INDEX" "7" "July 2016" "" "" +.TH "NPM\-INDEX" "7" "September 2016" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7 index bbea89569d1cf3..454c6af6b63c66 100644 --- a/deps/npm/man/man7/npm-orgs.7 +++ b/deps/npm/man/man7/npm-orgs.7 @@ -1,4 +1,4 @@ -.TH "NPM\-ORGS" "7" "July 2016" "" "" +.TH "NPM\-ORGS" "7" "September 2016" "" "" .SH "NAME" \fBnpm-orgs\fR \- Working with Teams & Orgs .SH DESCRIPTION @@ -10,7 +10,7 @@ Super admin, controls billing & adding people to the org\. .IP 2. 3 Team admin, manages team membership & package access\. .IP 3. 3 -Developer, works on packages they are given access to\. +Developer, works on packages they are given access to\. .RE .P @@ -80,7 +80,7 @@ npm init \-\-scope= to scope it for your org & publish as usual .RS 0 .IP \(bu 2 -Grant access: +Grant access: .RE .P @@ -144,3 +144,4 @@ npm help access npm help 7 scope .RE + diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index 62b7d770098148..d404e6e2fcd192 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REGISTRY" "7" "July 2016" "" "" +.TH "NPM\-REGISTRY" "7" "September 2016" "" "" .SH "NAME" \fBnpm-registry\fR \- The JavaScript Package Registry .SH DESCRIPTION @@ -30,7 +30,7 @@ similar) design doc to implement the APIs\. If you set up continuous replication from the official CouchDB, and then set your internal CouchDB as the registry config, then you'll be able to read any published packages, in addition to your private ones, and by -default will only publish internally\. +default will only publish internally\. .P If you then want to publish a package for the whole world to see, you can simply override the \fB\-\-registry\fP option for that \fBpublish\fP command\. diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7 index 9533637b5254c4..b868d1867f4c2b 100644 --- a/deps/npm/man/man7/npm-scope.7 +++ b/deps/npm/man/man7/npm-scope.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCOPE" "7" "July 2016" "" "" +.TH "NPM\-SCOPE" "7" "September 2016" "" "" .SH "NAME" \fBnpm-scope\fR \- Scoped packages .SH DESCRIPTION @@ -17,9 +17,10 @@ followed by a slash, e\.g\. Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package\. .P -Scoped packages are supported by the public npm registry\. The npm -client is backwards\-compatible with un\-scoped registries, so it can be -used to work with scoped and un\-scoped registries at the same time\. +Scoped packages can be published and installed as of \fBnpm@2\fP and are supported +by the primary npm registry\. The npm client is backwards\-compatible with +un\-scoped registries, so it can be used to work with scoped and un\-scoped +registries at the same time\. .SH Installing scoped packages .P Scoped packages are installed to a sub\-folder of the regular installation @@ -64,13 +65,15 @@ There is nothing special about the way Node treats scope folders, this is just specifying to require the module \fBmypackage\fP in the folder called \fB@myorg\fP\|\. .SH Publishing scoped packages .P -Scoped packages can be published to any registry that supports them, including -the public npm registry\. +Scoped packages can be published from the CLI as of \fBnpm@2\fP and can be +published to any registry that supports them, including the primary npm +registry\. .P -(As of 2015\-04\-19, and with npm 2\.0 or better, the public npm registry \fBdoes\fR support scoped packages) +(As of 2015\-04\-19, and with npm 2\.0 or better, the primary npm registry +\fBdoes\fR support scoped packages) .P If you wish, you may associate a scope with a registry; see below\. -.SS Publishing public scoped packages to the public npm registry +.SS Publishing public scoped packages to the primary npm registry .P To publish a public scoped package, you must specify \fB\-\-access public\fP with the initial publication\. This will publish the package and set access @@ -88,7 +91,7 @@ desired, with \fBnpm access\fP or on the npmjs\.com website\. .SH Associating a scope with a registry .P Scopes can be associated with a separate registry\. This allows you to -seamlessly use a mix of packages from the public npm registry and one or more +seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as npm Enterprise\. .P You can associate a scope with a registry at login, e\.g\. diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index 4190fc08b3c225..6bf3400824219b 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCRIPTS" "7" "July 2016" "" "" +.TH "NPM\-SCRIPTS" "7" "September 2016" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION @@ -26,11 +26,14 @@ Run BEFORE the package is uninstalled\. postuninstall: Run AFTER the package is uninstalled\. .IP \(bu 2 -preversion, version: -Run BEFORE bump the package version\. +preversion: +Run BEFORE bumping the package version\. +.IP \(bu 2 +version: +Run AFTER bumping the package version, but BEFORE commit\. .IP \(bu 2 postversion: -Run AFTER bump the package version\. +Run AFTER bumping the package version, and AFTER commit\. .IP \(bu 2 pretest, test, posttest: Run by the \fBnpm test\fP command\. diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index 9cfaae2aac45fa..3799c20517fdf5 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REMOVAL" "1" "July 2016" "" "" +.TH "NPM\-REMOVAL" "1" "September 2016" "" "" .SH "NAME" \fBnpm-removal\fR \- Cleaning the Slate .SH SYNOPSIS diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index dd46a2e314750d..24116a603a9fa8 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "July 2016" "" "" +.TH "SEMVER" "7" "September 2016" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Usage @@ -6,6 +6,8 @@ .RS 2 .nf $ npm install semver +$ node +var semver = require('semver') semver\.valid('1\.2\.3') // '1\.2\.3' semver\.valid('a\.b\.c') // null @@ -22,18 +24,35 @@ As a command\-line utility: .nf $ semver \-h -Usage: semver [ [\.\.\.]] [\-r | \-i | \-\-preid | \-l | \-rv] -Test if version(s) satisfy the supplied range(s), and sort them\. +SemVer 5\.1\.0 -Multiple versions or ranges may be supplied, unless increment -option is specified\. In that case, only a single version may -be used, and it is incremented by the specified level +A JavaScript implementation of the http://semver\.org/ specification +Copyright Isaac Z\. Schlueter + +Usage: semver [options] [ [\.\.\.]] +Prints valid versions sorted by SemVer precedence + +Options: +\-r \-\-range + Print versions that match the specified range\. + +\-i \-\-increment [] + Increment a version by the specified level\. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease\. Default level is 'patch'\. + Only one version may be specified\. + +\-\-preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments\. + +\-l \-\-loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions\. -If no versions are valid, or ranges are not satisfied, -then exits failure\. +If no satisfying versions are found, then exits failure\. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them\. @@ -299,7 +318,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '\.' xr ( '\.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'\-'9']['0'\-'9']+ +nr ::= '0' | ['1'\-'9'] ( ['0'\-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '\-' pre )? ( '+' build )? @@ -337,6 +356,9 @@ increments it\. .RE .IP \(bu 2 +\fBprerelease(v)\fP: Returns an array of prerelease components, or null +if none exist\. Example: \fBprerelease('1\.2\.3\-alpha\.1') \-> ['alpha', 1]\fP +.IP \(bu 2 \fBmajor(v)\fP: Return the major version number\. .IP \(bu 2 \fBminor(v)\fP: Return the minor version number\. @@ -388,6 +410,9 @@ range\. \fBmaxSatisfying(versions, range)\fP: Return the highest version in the list that satisfies the range, or \fBnull\fP if none of them do\. .IP \(bu 2 +\fBminSatisfying(versions, range)\fP: Return the lowest version in the list +that satisfies the range, or \fBnull\fP if none of them do\. +.IP \(bu 2 \fBgtr(version, range)\fP: Return \fBtrue\fP if version is greater than all the versions possible in the range\. .IP \(bu 2 diff --git a/deps/npm/node_modules/aproba/LICENSE b/deps/npm/node_modules/aproba/LICENSE index 2a4982dc40cb69..f4be44d881b2d9 100644 --- a/deps/npm/node_modules/aproba/LICENSE +++ b/deps/npm/node_modules/aproba/LICENSE @@ -11,3 +11,4 @@ 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/aproba/README.md b/deps/npm/node_modules/aproba/README.md index 69e356eb6ab9fb..8246a9cc6e1a4d 100644 --- a/deps/npm/node_modules/aproba/README.md +++ b/deps/npm/node_modules/aproba/README.md @@ -49,10 +49,11 @@ I wanted a very simple argument validator. It needed to do two things: 2. Not encourage an infinite bikeshed of DSLs This is why types are specified by a single character and there's no such -thing as an optional argument. +thing as an optional argument. This is not intended to validate user data. This is specifically about asserting the interface of your functions. If you need greater validation, I encourage you to write them by hand or look elsewhere. + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE index 14deaf94b8162d..313ef1e888e41b 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE @@ -27,3 +27,4 @@ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md index 64c1f3f7cd8a8a..5c5126d03287b4 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md @@ -60,3 +60,6 @@ for any purpose and without fee is hereby granted. The author disclaims all warranties with regard to this software. Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + + + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js index eab79ff71f1498..60e0ffba8b4aab 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js @@ -31,3 +31,4 @@ test("ensure defaults clone nested objects", function(t) { t.ok(result.b !== d.b, 'objects should be clones'); t.end(); }); + diff --git a/deps/npm/node_modules/fstream-npm/fstream-npm.js b/deps/npm/node_modules/fstream-npm/fstream-npm.js index c3b93214dcd678..62146664273fa1 100644 --- a/deps/npm/node_modules/fstream-npm/fstream-npm.js +++ b/deps/npm/node_modules/fstream-npm/fstream-npm.js @@ -78,6 +78,29 @@ Packer.prototype.readBundledLinks = function () { list.forEach(function (pkg) { if (pkg.charAt(0) === '.') return then() var pd = this.path + '/node_modules/' + pkg + + // scoped packages + if (pkg.charAt(0) === '@') { + fs.readdir(pd, function (er, slist) { + var sl = slist && slist.length + if (er || sl === 0) return then(er) + + l += sl + slist.forEach(function (spkg) { + if (spkg.charAt(0) === '.') return then() + var spd = pd + '/' + spkg + fs.realpath(spd, function (er, rp) { + if (er) return then() + this.bundleLinks = this.bundleLinks || {} + this.bundleLinks[pkg + '/' + spkg] = rp + then() + }.bind(this)) + }, this) + then() + }.bind(this)) + return + } + fs.realpath(pd, function (er, rp) { if (er) return then() this.bundleLinks = this.bundleLinks || {} @@ -127,7 +150,8 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) { entry === '.npmrc' || entry.match(/^\..*\.swp$/) || entry === '.DS_Store' || - entry.match(/^\._/) + entry.match(/^\._/) || + entry.match(/^.*\.orig$/) ) { return false } @@ -141,8 +165,16 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) { // linked with npm link, even in a bundle, deps are only bundled // if they're not already present at a higher level. if (this.bundleMagic) { + if (entry.charAt(0) === '@') { + var firstSlash = entry.indexOf('/') + // continue to list the packages in this scope + if (firstSlash === -1) return true + + // bubbling up. stop here and allow anything the bundled pkg allows + if (entry.indexOf('/', firstSlash + 1) !== -1) return true + } // bubbling up. stop here and allow anything the bundled pkg allows - if (entry.indexOf('/') !== -1) return true + else if (entry.indexOf('/') !== -1) return true // never include the .bin. It's typically full of platform-specific // stuff like symlinks and .cmd files anyway. diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index d6880b2f36e72b..08e918c0db9a62 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -56,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 4670f7f79f4d2a..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -30,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 9322bb20fe8e85..fa5e604e0a4975 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -2,10 +2,11 @@ "_args": [ [ { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, @@ -13,40 +14,41 @@ ] ], "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.1", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "6.0.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.1.tgz_1462129663650_0.39764496590942144" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ "/fstream-npm/fstream-ignore/minimatch/brace-expansion" ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz", - "_shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, "_spec": "balanced-match@^0.4.1", "_where": "/Users/zkat/Documents/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -55,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.5.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "7004b289baaaab6a832f4901735e29d37cc2a863", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -75,8 +77,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "balanced-match", @@ -90,6 +92,7 @@ "test": "make test" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -102,8 +105,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "0.4.1" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json index 0a28e3def37f3b..2b603477a4b52a 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -2,10 +2,11 @@ "_args": [ [ { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -13,40 +14,41 @@ ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.4", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion", - "_nodeVersion": "6.0.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.4.tgz_1462130058897_0.14984136167913675" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/fstream-npm/fstream-ignore/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz", - "_shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -58,26 +60,26 @@ }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.5.1" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "1660b75d0bf03b022e7888b576cd5a4080692c1d", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" } ], "name": "brace-expansion", @@ -92,6 +94,7 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -104,8 +107,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "1.1.4" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json index 51abf989189a64..4c704eeb860b6c 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json @@ -1,60 +1,99 @@ { + "_args": [ + [ + { + "raw": "minimatch@^3.0.0", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore" + ] + ], + "_from": "minimatch@>=3.0.0 <4.0.0", + "_id": "minimatch@3.0.3", + "_inCache": true, + "_installable": true, + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.6", + "_phantomChildren": {}, + "_requested": { + "raw": "minimatch@^3.0.0", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "_shrinkwrap": null, + "_spec": "minimatch@^3.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me" }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js" - }, - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" }, "dependencies": { "brace-expansion": "^1.0.0" }, + "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" + }, + "directories": {}, + "dist": { + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + }, + "engines": { + "node": "*" }, - "license": "ISC", "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@3.0.0", - "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "_from": "minimatch@>=3.0.0 <4.0.0", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" - }, + "license": "ISC", + "main": "minimatch.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "version": "3.0.3" } diff --git a/deps/npm/node_modules/fstream-npm/package.json b/deps/npm/node_modules/fstream-npm/package.json index 0eddd8be095f3f..ea4c6b98b7f023 100644 --- a/deps/npm/node_modules/fstream-npm/package.json +++ b/deps/npm/node_modules/fstream-npm/package.json @@ -2,10 +2,11 @@ "_args": [ [ { - "name": "fstream-npm", "raw": "fstream-npm@latest", - "rawSpec": "latest", "scope": null, + "escapedName": "fstream-npm", + "name": "fstream-npm", + "rawSpec": "latest", "spec": "latest", "type": "tag" }, @@ -13,43 +14,45 @@ ] ], "_from": "fstream-npm@latest", - "_id": "fstream-npm@1.1.0", + "_id": "fstream-npm@1.2.0", "_inCache": true, "_installable": true, "_location": "/fstream-npm", - "_nodeVersion": "5.10.1", + "_nodeVersion": "4.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/fstream-npm-1.1.0.tgz_1463528747313_0.84859543829225" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/fstream-npm-1.2.0.tgz_1473287973531_0.21196374762803316" }, "_npmUser": { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.9.1", + "_npmVersion": "3.10.7", "_phantomChildren": { - "fstream": "1.0.9", + "fstream": "1.0.10", "inherits": "2.0.1" }, "_requested": { - "name": "fstream-npm", "raw": "fstream-npm@latest", - "rawSpec": "latest", "scope": null, + "escapedName": "fstream-npm", + "name": "fstream-npm", + "rawSpec": "latest", "spec": "latest", "type": "tag" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.1.0.tgz", - "_shasum": "80e09743485eaa70d57e89d1ff8fafa366cdefea", + "_resolved": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.2.0.tgz", + "_shasum": "d2c3c89101346982d64e57091c38487bda916fce", "_shrinkwrap": null, "_spec": "fstream-npm@latest", "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -69,29 +72,29 @@ }, "directories": {}, "dist": { - "shasum": "80e09743485eaa70d57e89d1ff8fafa366cdefea", - "tarball": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.1.0.tgz" + "shasum": "d2c3c89101346982d64e57091c38487bda916fce", + "tarball": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.2.0.tgz" }, - "gitHead": "7df2e946714506f287b0a8125dc05566b840d4b0", + "gitHead": "b839e060768000d634b43e44274df68e383d5791", "homepage": "https://github.com/npm/fstream-npm#readme", "license": "ISC", "main": "./fstream-npm.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "fstream-npm", @@ -104,5 +107,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "1.1.0" + "version": "1.2.0" } diff --git a/deps/npm/node_modules/fstream-npm/test/scoped.js b/deps/npm/node_modules/fstream-npm/test/scoped.js new file mode 100644 index 00000000000000..c001c1b333d6ec --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/test/scoped.js @@ -0,0 +1,94 @@ +var fs = require('graceful-fs') +var join = require('path').join + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var Packer = require('..') + +var pkg = join(__dirname, 'test-package-scoped') + +var elfJS = function () {/* +module.exports = function () { + console.log("i'm a elf") +} +*/}.toString().split('\n').slice(1, -1).join() + +var json = { + 'name': 'test-package-scoped', + 'version': '3.1.4', + 'main': 'elf.js', + 'bundledDependencies': [ + '@npmwombat/scoped' + ] +} + +test('setup', function (t) { + setup() + t.end() +}) + +var included = [ + 'package.json', + 'elf.js', + join('node_modules', '@npmwombat', 'scoped', 'index.js') +] + +test('includes bundledDependencies', function (t) { + var subject = new Packer({ path: pkg, type: 'Directory', isDirectory: true }) + var filenames = [] + subject.on('entry', function (entry) { + t.equal(entry.type, 'File', 'only files in this package') + + // include relative path in filename + var filename = entry._path.slice(entry.root._path.length + 1) + + filenames.push(filename) + }) + // need to do this so fstream doesn't explode when files are removed from + // under it + subject.on('end', function () { + // ensure we get *exactly* the results we expect by comparing in both + // directions + filenames.forEach(function (filename) { + t.ok( + included.indexOf(filename) > -1, + filename + ' is included' + ) + }) + included.forEach(function (filename) { + t.ok( + filenames.indexOf(filename) > -1, + filename + ' is not included' + ) + }) + t.end() + }) +}) + +test('cleanup', function (t) { + // rimraf.sync chokes here for some reason + rimraf(pkg, function () { t.end() }) +}) + +function setup () { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync( + join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + fs.writeFileSync( + join(pkg, 'elf.js'), + elfJS + ) + + var scopedDir = join(pkg, 'node_modules', '@npmwombat', 'scoped') + mkdirp.sync(scopedDir) + fs.writeFileSync( + join(scopedDir, 'index.js'), + "console.log('hello wombat')" + ) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/README.md b/deps/npm/node_modules/glob/README.md similarity index 85% rename from deps/npm/node_modules/node-gyp/node_modules/glob/README.md rename to deps/npm/node_modules/glob/README.md index 258257ecb1901f..9dd9384fa143c3 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/README.md +++ b/deps/npm/node_modules/glob/README.md @@ -1,9 +1,9 @@ -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) - # Glob Match files using the patterns the shell uses, like stars and stuff. +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + This is a glob implementation in JavaScript. It uses the `minimatch` library to do its matching. @@ -11,6 +11,12 @@ library to do its matching. ## Usage +Install with npm + +``` +npm i glob +``` + ```javascript var glob = require("glob") @@ -74,13 +80,6 @@ slashes in it, then it will seek for any file anywhere in the tree with a matching basename. For example, `*.js` would match `test/simple/basic.js`. -### Negation - -The intent for negation would be for a pattern starting with `!` to -match everything that *doesn't* match the supplied pattern. However, -the implementation is weird, and for the time being, this should be -avoided. The behavior will change or be deprecated in version 5. - ### Empty Sets If no matching files are found, then an empty array is returned. This @@ -113,19 +112,19 @@ options. ## glob(pattern, [options], cb) -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern Perform an asynchronous glob search. ## glob.sync(pattern, [options]) -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern Perform a synchronous glob search. @@ -143,11 +142,11 @@ immediately. ### new glob.Glob(pattern, [options], [cb]) -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern Note that if the `sync` flag is set in the options, then matches will be immediately available on the `g.found` member. @@ -159,14 +158,12 @@ be immediately available on the `g.found` member. * `aborted` Boolean which is set to true when calling `abort()`. There is no way at this time to continue a glob search after aborting, but you can re-use the statCache to avoid having to duplicate syscalls. -* `statCache` Collection of all the stat results the glob search - performed. * `cache` Convenience object. Each field has the following possible values: * `false` - Path does not exist * `true` - Path exists - * `'DIR'` - Path exists, and is not a directory - * `'FILE'` - Path exists, and is a directory + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory * `[file, entries, ...]` - Path exists, is a directory, and the array value is the results of `fs.readdir` * `statCache` Cache of `fs.stat` results, to prevent statting the same @@ -183,7 +180,8 @@ be immediately available on the `g.found` member. matches found. If the `nonull` option is set, and no match was found, then the `matches` list contains the original pattern. The matches are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. * `error` Emitted when an unexpected error is encountered, or whenever any fs error occurs if `options.strict` is set. * `abort` When `abort()` is called, this event is raised. @@ -263,12 +261,11 @@ the filesystem. * `matchBase` Perform a basename-only match if the pattern does not contain any slash characters. That is, `*.js` would be treated as equivalent to `**/*.js`, matching all js files in all directories. -* `nonegate` Suppress `negate` behavior. (See below.) -* `nocomment` Suppress `comment` behavior. (See below.) -* `nonull` Return the pattern when no matches are found. * `nodir` Do not match directories, only files. (Note: to match *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of patterns to exclude matches. +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. * `follow` Follow symlinked directories when expanding `**` patterns. Note that this can result in a lot of duplicate references in the presence of cyclic links. @@ -283,17 +280,6 @@ While strict compliance with the existing standards is a worthwhile goal, some discrepancies exist between node-glob and other implementations, and are intentional. -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - The double-star character `**` is supported by default, unless the `noglobstar` flag is set. This is supported in the manner of bsdglob and bash 4.3, where `**` only has special significance if it is the only @@ -317,6 +303,16 @@ other interpretation of the glob pattern. Thus, a pattern like **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are checked for validity. Since those two are valid, matching proceeds. +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + ## Windows **Please only use forward-slashes in glob expressions.** diff --git a/deps/npm/node_modules/glob/glob.js b/deps/npm/node_modules/glob/glob.js index 02d15b755dd84e..9eca910bb05ec6 100644 --- a/deps/npm/node_modules/glob/glob.js +++ b/deps/npm/node_modules/glob/glob.js @@ -100,6 +100,10 @@ glob.hasMagic = function (pattern, options_) { var g = new Glob(pattern, options) var set = g.minimatch.set + + if (!pattern) + return false + if (set.length > 1) return true diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/glob/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index d6880b2f36e72b..08e918c0db9a62 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -56,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 4670f7f79f4d2a..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -30,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 208e61972bfc94..737524518e7bb7 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -4,6 +4,7 @@ { "raw": "balanced-match@^0.4.1", "scope": null, + "escapedName": "balanced-match", "name": "balanced-match", "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", @@ -13,34 +14,35 @@ ] ], "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.1", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, - "_location": "/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "6.0.0", + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.1.tgz_1462129663650_0.39764496590942144" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" }, "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { "raw": "balanced-match@^0.4.1", "scope": null, + "escapedName": "balanced-match", "name": "balanced-match", "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ - "/glob/minimatch/brace-expansion" + "/minimatch/brace-expansion" ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz", - "_shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, "_spec": "balanced-match@^0.4.1", "_where": "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", @@ -55,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.5.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "7004b289baaaab6a832f4901735e29d37cc2a863", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -105,5 +107,5 @@ "android-browser/4.2..latest" ] }, - "version": "0.4.1" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 3ffc8da5c03baa..6621b37b072ece 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -4,6 +4,7 @@ { "raw": "brace-expansion@^1.0.0", "scope": null, + "escapedName": "brace-expansion", "name": "brace-expansion", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", @@ -13,34 +14,35 @@ ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.5", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, - "_location": "/glob/minimatch/brace-expansion", - "_nodeVersion": "4.4.5", + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.5.tgz_1465989660138_0.34528115345165133" + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { "raw": "brace-expansion@^1.0.0", "scope": null, + "escapedName": "brace-expansion", "name": "brace-expansion", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/glob/minimatch" + "/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz", - "_shasum": "f5b4ad574e2cb7ccc1eb83e6fe79b8ecadf7a526", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch", @@ -58,14 +60,14 @@ }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.5.1" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "f5b4ad574e2cb7ccc1eb83e6fe79b8ecadf7a526", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "ff31acab078f1bb696ac4c55ca56ea24e6495fb6", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", @@ -107,5 +109,5 @@ "android-browser/4.2..latest" ] }, - "version": "1.1.5" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/package.json index 4944eb0bccfada..eddb36b48e01f4 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/glob/node_modules/minimatch/package.json @@ -1,60 +1,99 @@ { + "_args": [ + [ + { + "raw": "minimatch@^3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/glob" + ] + ], + "_from": "minimatch@>=3.0.2 <4.0.0", + "_id": "minimatch@3.0.3", + "_inCache": true, + "_installable": true, + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.6", + "_phantomChildren": {}, + "_requested": { + "raw": "minimatch@^3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "_shrinkwrap": null, + "_spec": "minimatch@^3.0.2", + "_where": "/Users/rebecca/code/npm/node_modules/glob", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me" }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js" - }, - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" }, "dependencies": { "brace-expansion": "^1.0.0" }, + "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" + }, + "directories": {}, + "dist": { + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + }, + "engines": { + "node": "*" }, - "license": "ISC", "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@3.0.0", - "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" - }, + "license": "ISC", + "main": "minimatch.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "version": "3.0.3" } diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 253686f9b4b37c..66ce2c9246af5b 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -2,51 +2,55 @@ "_args": [ [ { - "raw": "glob@~7.0.3", + "raw": "glob@7.0.6", "scope": null, + "escapedName": "glob", "name": "glob", - "rawSpec": "~7.0.3", - "spec": ">=7.0.3 <7.1.0", - "type": "range" + "rawSpec": "7.0.6", + "spec": "7.0.6", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "glob@>=7.0.3 <7.1.0", - "_id": "glob@7.0.4", + "_from": "glob@7.0.6", + "_id": "glob@7.0.6", "_inCache": true, - "_installable": true, "_location": "/glob", - "_nodeVersion": "6.2.1", + "_nodeVersion": "4.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/glob-7.0.4.tgz_1466098181857_0.6043217403348535" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/glob-7.0.6.tgz_1472074762911_0.47247025789693" }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "3.9.3", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "raw": "glob@~7.0.3", + "raw": "glob@7.0.6", "scope": null, + "escapedName": "glob", "name": "glob", - "rawSpec": "~7.0.3", - "spec": ">=7.0.3 <7.1.0", - "type": "range" + "rawSpec": "7.0.6", + "spec": "7.0.6", + "type": "version" }, "_requiredBy": [ "#USER", "/", + "/node-gyp", "/rimraf", - "/tap" + "/standard/standard-engine/deglob", + "/tap", + "/tap/tap-mocha-reporter" ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.4.tgz", - "_shasum": "3b44afa0943bdc31b2037b934791e2e084bcb7f6", + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "_shasum": "211bafaf49e525b8cd93260d14ab136152b3f57a", "_shrinkwrap": null, - "_spec": "glob@~7.0.3", - "_where": "/Users/rebecca/code/npm", + "_spec": "glob@7.0.6", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -59,7 +63,7 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "2 || 3", + "minimatch": "^3.0.2", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -72,8 +76,8 @@ }, "directories": {}, "dist": { - "shasum": "3b44afa0943bdc31b2037b934791e2e084bcb7f6", - "tarball": "https://registry.npmjs.org/glob/-/glob-7.0.4.tgz" + "shasum": "211bafaf49e525b8cd93260d14ab136152b3f57a", + "tarball": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz" }, "engines": { "node": "*" @@ -83,7 +87,7 @@ "sync.js", "common.js" ], - "gitHead": "3f883c43fec4f8046cbea9497add3b8ba4ef0a37", + "gitHead": "98327d8def195b1ba200217952df8ea829426038", "homepage": "https://github.com/isaacs/node-glob#readme", "license": "ISC", "main": "glob.js", @@ -109,5 +113,5 @@ "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" }, - "version": "7.0.4" + "version": "7.0.6" } diff --git a/deps/npm/node_modules/graceful-fs/README.md b/deps/npm/node_modules/graceful-fs/README.md index d0dcd492549537..5273a50ad6a52c 100644 --- a/deps/npm/node_modules/graceful-fs/README.md +++ b/deps/npm/node_modules/graceful-fs/README.md @@ -7,7 +7,7 @@ The improvements are meant to normalize behavior across different platforms and environments, and to make filesystem access more resilient to errors. -## Improvements over [fs module](http://api.nodejs.org/fs.html) +## Improvements over [fs module](https://nodejs.org/api/fs.html) * Queues up `open` and `readdir` calls, and retries them once something closes if there is an EMFILE error from too many file diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index cca5d89f6ad185..df0cd9a110507d 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,35 +1,44 @@ { "_args": [ [ - "graceful-fs@~4.1.3", - "/Users/rebecca/code/npm" + { + "raw": "graceful-fs@4.1.6", + "scope": null, + "escapedName": "graceful-fs", + "name": "graceful-fs", + "rawSpec": "4.1.6", + "spec": "4.1.6", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "graceful-fs@>=4.1.3 <4.2.0", - "_id": "graceful-fs@4.1.4", + "_from": "graceful-fs@4.1.6", + "_id": "graceful-fs@4.1.6", "_inCache": true, - "_installable": true, "_location": "/graceful-fs", - "_nodeVersion": "5.6.0", + "_nodeVersion": "4.4.4", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/graceful-fs-4.1.4.tgz_1462474854900_0.9423982477746904" + "tmp": "tmp/graceful-fs-4.1.6.tgz_1471616320359_0.39477095939219" }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.8.9", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "name": "graceful-fs", - "raw": "graceful-fs@~4.1.3", - "rawSpec": "~4.1.3", + "raw": "graceful-fs@4.1.6", "scope": null, - "spec": ">=4.1.3 <4.2.0", - "type": "range" + "escapedName": "graceful-fs", + "name": "graceful-fs", + "rawSpec": "4.1.6", + "spec": "4.1.6", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/cmd-shim", "/fs-vacuum", @@ -43,17 +52,14 @@ "/readdir-scoped-modules", "/sha", "/standard/eslint/file-entry-cache/flat-cache", - "/standard/eslint/file-entry-cache/flat-cache/read-json-sync", "/tacks", - "/tap/nyc/read-pkg/load-json-file", - "/tap/nyc/read-pkg/path-type", "/write-file-atomic" ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", - "_shasum": "ef089d2880f033b011823ce5c8fae798da775dbd", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz", + "_shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", "_shrinkwrap": null, - "_spec": "graceful-fs@~4.1.3", - "_where": "/Users/rebecca/code/npm", + "_spec": "graceful-fs@4.1.6", + "_where": "/Users/zkat/Documents/code/npm", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -68,8 +74,8 @@ "test": "test" }, "dist": { - "shasum": "ef089d2880f033b011823ce5c8fae798da775dbd", - "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz" + "shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", + "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz" }, "engines": { "node": ">=0.4.0" @@ -80,7 +86,7 @@ "legacy-streams.js", "polyfills.js" ], - "gitHead": "fe8f05ccc2779d1dfa6db6173f3ed64f1e9aa72c", + "gitHead": "cfe3ba80e37af542f02e445c89aa59482aa32a63", "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ "fs", @@ -102,8 +108,8 @@ "main": "graceful-fs.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "graceful-fs", @@ -116,5 +122,5 @@ "scripts": { "test": "node test.js | tap -" }, - "version": "4.1.4" + "version": "4.1.6" } diff --git a/deps/npm/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/graceful-fs/polyfills.js index 5e4f4804618d17..2798050604be2f 100644 --- a/deps/npm/node_modules/graceful-fs/polyfills.js +++ b/deps/npm/node_modules/graceful-fs/polyfills.js @@ -44,28 +44,28 @@ function patch (fs) { fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) - fs.chmod = chownFix(fs.chmod) - fs.fchmod = chownFix(fs.fchmod) - fs.lchmod = chownFix(fs.lchmod) + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) - fs.chmodSync = chownFix(fs.chmodSync) - fs.fchmodSync = chownFix(fs.fchmodSync) - fs.lchmodSync = chownFix(fs.lchmodSync) + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) // if lchmod/lchown do not exist, then make them no-ops if (!fs.lchmod) { fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) + if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (!fs.lchown) { fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) + if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } @@ -121,20 +121,19 @@ function patch (fs) { function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { - callback = callback || noop fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { - callback(err) + if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { - callback(err || err2) + if (callback) callback(err || err2) }) }) }) @@ -167,11 +166,13 @@ function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK")) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) + if (er) { + if (cb) cb(er) + return + } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { - return cb(er || er2) + if (cb) cb(er || er2) }) }) }) @@ -197,17 +198,39 @@ function patchLutimes (fs) { } } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } +function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { + return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null - cb(er, res) + if (cb) cb.apply(this, arguments) }) } } diff --git a/deps/npm/node_modules/has-unicode/LICENSE b/deps/npm/node_modules/has-unicode/LICENSE index e756052969b780..d42e25e95655bb 100644 --- a/deps/npm/node_modules/has-unicode/LICENSE +++ b/deps/npm/node_modules/has-unicode/LICENSE @@ -11,3 +11,4 @@ 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/has-unicode/README.md b/deps/npm/node_modules/has-unicode/README.md index ebe3c2a7f4f9fa..5a03e5991c539e 100644 --- a/deps/npm/node_modules/has-unicode/README.md +++ b/deps/npm/node_modules/has-unicode/README.md @@ -36,7 +36,8 @@ that you encourage your users to override this via config. ### Unix Like Operating Systems We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in -that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient for most POSIX systems. While locale data can be put in `/etc/locale.conf` as well, AFAIK it's always copied into the environment. + diff --git a/deps/npm/node_modules/imurmurhash/imurmurhash.js b/deps/npm/node_modules/imurmurhash/imurmurhash.js index 05347a2536fce2..e63146a2b7e70b 100644 --- a/deps/npm/node_modules/imurmurhash/imurmurhash.js +++ b/deps/npm/node_modules/imurmurhash/imurmurhash.js @@ -95,7 +95,7 @@ // @return {number} The 32-bit hash MurmurHash3.prototype.result = function() { var k1, h1; - + k1 = this.k1; h1 = this.h1; diff --git a/deps/npm/node_modules/inherits/inherits.js b/deps/npm/node_modules/inherits/inherits.js index 29f5e24f57b5aa..3b94763a76eef0 100644 --- a/deps/npm/node_modules/inherits/inherits.js +++ b/deps/npm/node_modules/inherits/inherits.js @@ -1 +1,7 @@ -module.exports = require('util').inherits +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/deps/npm/node_modules/inherits/package.json b/deps/npm/node_modules/inherits/package.json index 933382a7f44bac..c68e2f3a35d726 100644 --- a/deps/npm/node_modules/inherits/package.json +++ b/deps/npm/node_modules/inherits/package.json @@ -1,7 +1,90 @@ { - "name": "inherits", + "_args": [ + [ + { + "raw": "inherits@2.0.3", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "2.0.3", + "spec": "2.0.3", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "inherits@2.0.3", + "_id": "inherits@2.0.3", + "_inCache": true, + "_location": "/inherits", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "inherits@2.0.3", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "2.0.3", + "spec": "2.0.3", + "type": "version" + }, + "_requiredBy": [ + "#USER", + "/", + "/fstream", + "/fstream-npm", + "/fstream-npm/fstream-ignore", + "/glob", + "/init-package-json/glob", + "/npm-registry-client/concat-stream", + "/npm-registry-client/concat-stream/readable-stream", + "/npm-registry-couchapp/couchapp/nano/follow/request/bl/readable-stream", + "/read-package-json/glob", + "/readable-stream", + "/request/bl/readable-stream", + "/standard/eslint/concat-stream", + "/standard/eslint/concat-stream/readable-stream", + "/standard/eslint/file-entry-cache/flat-cache/del/globby/glob", + "/standard/eslint/glob", + "/tap/tap-mocha-reporter/readable-stream", + "/tap/tap-parser", + "/tar", + "/tar/block-stream" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_shrinkwrap": null, + "_spec": "inherits@2.0.3", + "_where": "/Users/zkat/Documents/code/npm", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "dependencies": {}, "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.1", + "devDependencies": { + "tap": "^7.1.0" + }, + "directories": {}, + "dist": { + "shasum": "633c2c83e3da42a502f52466022480f4208261de", + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f", + "homepage": "https://github.com/isaacs/inherits#readme", "keywords": [ "inheritance", "class", @@ -12,24 +95,23 @@ "browser", "browserify" ], + "license": "ISC", "main": "./inherits.js", - "browser": "./inherits_browser.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "inherits", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/isaacs/inherits.git" }, - "license": "ISC", "scripts": { "test": "node test" }, - "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "homepage": "https://github.com/isaacs/inherits#readme", - "_id": "inherits@2.0.1", - "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "_from": "inherits@>=2.0.1 <2.1.0" + "version": "2.0.3" } diff --git a/deps/npm/node_modules/inherits/test.js b/deps/npm/node_modules/inherits/test.js deleted file mode 100644 index fc53012d31c0cd..00000000000000 --- a/deps/npm/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var inherits = require('./inherits.js') -var assert = require('assert') - -function test(c) { - assert(c.constructor === Child) - assert(c.constructor.super_ === Parent) - assert(Object.getPrototypeOf(c) === Child.prototype) - assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) - assert(c instanceof Child) - assert(c instanceof Parent) -} - -function Child() { - Parent.call(this) - test(this) -} - -function Parent() {} - -inherits(Child, Parent) - -var c = new Child -test(c) - -console.log('ok') diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index d6880b2f36e72b..08e918c0db9a62 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -56,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 4670f7f79f4d2a..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -30,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 306b73b34311e9..7933a525fc3ac5 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -2,51 +2,53 @@ "_args": [ [ { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" ] ], "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.1", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, - "_location": "/init-package-json/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "6.0.0", + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.1.tgz_1462129663650_0.39764496590942144" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ - "/init-package-json/glob/minimatch/brace-expansion" + "/minimatch/brace-expansion" ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz", - "_shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, "_spec": "balanced-match@^0.4.1", - "_where": "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -55,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.5.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "7004b289baaaab6a832f4901735e29d37cc2a863", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -75,8 +77,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "balanced-match", @@ -90,6 +92,7 @@ "test": "make test" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -102,8 +105,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "0.4.1" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index ad188114f925ce..479c7879db59ca 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -2,51 +2,53 @@ "_args": [ [ { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch" + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch" ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.4", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, - "_location": "/init-package-json/glob/minimatch/brace-expansion", - "_nodeVersion": "6.0.0", + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.4.tgz_1462130058897_0.14984136167913675" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/init-package-json/glob/minimatch" + "/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz", - "_shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -58,26 +60,26 @@ }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.5.1" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "1660b75d0bf03b022e7888b576cd5a4080692c1d", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" } ], "name": "brace-expansion", @@ -92,6 +94,7 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -104,8 +107,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "1.1.4" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json index ded42917e5f997..22bfd82a8e2718 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json @@ -1,43 +1,55 @@ { "_args": [ [ - "minimatch@2 || 3", - "/Users/rebecca/code/npm/node_modules/glob" - ], - [ - "minimatch@2 || 3", + { + "raw": "minimatch@2 || 3", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", + "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob" ] ], "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "minimatch@3.0.0", + "_id": "minimatch@3.0.3", "_inCache": true, "_installable": true, - "_location": "/init-package-json/glob/minimatch", - "_nodeVersion": "4.0.0", + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "minimatch", "raw": "minimatch@2 || 3", - "rawSpec": "2 || 3", "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, "_requiredBy": [ - "/init-package-json/glob" + "#USER", + "/" ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", "_shrinkwrap": null, "_spec": "minimatch@2 || 3", "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me" }, "bugs": { @@ -49,12 +61,12 @@ "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" }, "directories": {}, "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, "engines": { "node": "*" @@ -62,14 +74,14 @@ "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", "license": "ISC", "main": "minimatch.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "minimatch", @@ -83,5 +95,5 @@ "posttest": "standard minimatch.js test/*.js", "test": "tap test/*.js" }, - "version": "3.0.0" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js index c049c20f9a2736..bf7aedb82d41fd 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js @@ -17,7 +17,7 @@ module.exports = { ; } catch (e) {} - + return prompt('description', value); })(), "main" : prompt('entry point', 'index.js'), diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js index 424152a802eb02..da1abca9535e4f 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js @@ -235,3 +235,4 @@ PromZard.prototype.prompt = function (pdt, cb) { read({ prompt: prompt + ':' , default: def }, cb) } + diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js index bcf8791113ead7..034a86475afbd5 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js @@ -3,7 +3,7 @@ var promzard = require('../'); test('simple', function (t) { t.plan(1); - + var ctx = { tmpdir : '/tmp' } var file = __dirname + '/simple.input'; promzard(file, ctx, function (err, output) { @@ -19,11 +19,11 @@ test('simple', function (t) { output ); }); - + setTimeout(function () { process.stdin.emit('data', '\n'); }, 100); - + setTimeout(function () { process.stdin.emit('data', '55\n'); }, 200); diff --git a/deps/npm/node_modules/lodash.clonedeep/LICENSE b/deps/npm/node_modules/lodash.clonedeep/LICENSE index bcbe13d67a9621..e0c69d56032d15 100644 --- a/deps/npm/node_modules/lodash.clonedeep/LICENSE +++ b/deps/npm/node_modules/lodash.clonedeep/LICENSE @@ -1,23 +1,47 @@ -The MIT License (MIT) +Copyright jQuery Foundation and other contributors -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/deps/npm/node_modules/lodash.clonedeep/README.md b/deps/npm/node_modules/lodash.clonedeep/README.md index 1287ee1c00732a..fee48e4706a972 100644 --- a/deps/npm/node_modules/lodash.clonedeep/README.md +++ b/deps/npm/node_modules/lodash.clonedeep/README.md @@ -1,4 +1,4 @@ -# lodash.clonedeep v4.3.2 +# lodash.clonedeep v4.5.0 The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var cloneDeep = require('lodash.clonedeep'); ``` -See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.3.2-npm-packages/lodash.clonedeep) for more details. +See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/index.js b/deps/npm/node_modules/lodash.clonedeep/index.js index 88794c2c4a3bfe..1b0e50298222d6 100644 --- a/deps/npm/node_modules/lodash.clonedeep/index.js +++ b/deps/npm/node_modules/lodash.clonedeep/index.js @@ -1,21 +1,1392 @@ /** - * lodash 4.3.2 (Custom Build) + * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation + * Copyright jQuery Foundation and other contributors + * Released under MIT license * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseClone = require('lodash._baseclone'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ + * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. + * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; @@ -28,4 +1399,350 @@ function cloneDeep(value) { return baseClone(value, true, true); } +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + module.exports = cloneDeep; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md deleted file mode 100644 index 7c997274efee06..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseclone v4.5.3 - -The internal [lodash](https://lodash.com/) function `baseClone` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseclone -``` - -In Node.js: -```js -var baseClone = require('lodash._baseclone'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.5.3-npm-packages/lodash._baseclone) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js deleted file mode 100644 index 4781750782800a..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js +++ /dev/null @@ -1,1644 +0,0 @@ -/** - * lodash 4.5.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = -cloneableTags[dateTag] = cloneableTags[float32Tag] = -cloneableTags[float64Tag] = cloneableTags[int8Tag] = -cloneableTags[int16Tag] = cloneableTags[int32Tag] = -cloneableTags[mapTag] = cloneableTags[numberTag] = -cloneableTags[objectTag] = cloneableTags[regexpTag] = -cloneableTags[setTag] = cloneableTags[stringTag] = -cloneableTags[symbolTag] = cloneableTags[uint8Tag] = -cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = -cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = (freeModule && freeModule.exports === freeExports) - ? freeExports - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `Map#set` because it doesn't return the map instance in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - set.add(value); - return set; -} - -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -/** - * Converts `map` to an array. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -/** - * Converts `set` to an array. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototypeOf = Object.getPrototypeOf, - getOwnPropertySymbols = Object.getOwnPropertySymbols, - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = Object.keys; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - -/** Used to detect maps, sets, and weakmaps. */ -var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : '', - weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * Creates an hash object. - * - * @private - * @constructor - * @returns {Object} Returns the new hash object. - */ -function Hash() {} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(hash, key) { - if (nativeCreate) { - var result = hash[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ -function hashSet(hash, key, value) { - hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; -} - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function MapCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapClear() { - this.__data__ = { - 'hash': new Hash, - 'map': Map ? new Map : [], - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. - */ -function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } - return this; -} - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function Stack(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = { 'array': [], 'map': null }; -} - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - var data = this.__data__, - array = data.array; - - return array ? assocDelete(array, key) : data.map['delete'](key); -} - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - var data = this.__data__, - array = data.array; - - return array ? assocGet(array, key) : data.map.get(key); -} - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); -} - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. - */ -function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); - } - return this; -} - -/** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; -} - -/** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; -} - -/** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function assocHas(array, key) { - return assocIndexOf(array, key) > -1; -} - -/** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ -function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } -} - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } -} - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - result = baseAssign(result, value); - return isFull ? copySymbols(value, result) : result; - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return (isFull && !isArr) ? copySymbols(value, result) : result; -} - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; -} - -/** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -/** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototypeOf(object) === null); -} - -/** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - return nativeKeys(Object(object)); -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var result = new buffer.constructor(buffer.length); - buffer.copy(result); - return result; -} - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map) { - return arrayReduce(mapToArray(map), addMapEntry, new map.constructor); -} - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set) { - return arrayReduce(setToArray(set), addSetEntry, new set.constructor); -} - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object) { - return copyObjectWith(source, props, object); -} - -/** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : source[key]; - - assignValue(object, key, newValue); - } - return object; -} - -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -/** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Creates an array of the own symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = getOwnPropertySymbols || function() { - return []; -}; - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function getTag(value) { - return objectToString.call(value); -} - -// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. -if ((Map && getTag(new Map) != mapTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case mapCtorString: return mapTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototypeOf(object)) - : {}; -} - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object); - - case symbolTag: - return cloneSymbol(object); - } -} - -/** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ -function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || - (type == 'string' && value != '__proto__') || value == null; -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = !Buffer ? constant(false) : function(value) { - return value instanceof Buffer; -}; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); -} - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; -} - -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. - * @example - * - * var object = { 'user': 'fred' }; - * var getter = _.constant(object); - * - * getter() === object; - * // => true - */ -function constant(value) { - return function() { - return value; - }; -} - -// Avoid inheriting from `Object.prototype` when possible. -Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; - -// Add functions to the `MapCache`. -MapCache.prototype.clear = mapClear; -MapCache.prototype['delete'] = mapDelete; -MapCache.prototype.get = mapGet; -MapCache.prototype.has = mapHas; -MapCache.prototype.set = mapSet; - -// Add functions to the `Stack` cache. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -module.exports = baseClone; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json deleted file mode 100644 index 64c0ac7a1411d5..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_args": [ - [ - "lodash._baseclone@^4.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.clonedeep" - ] - ], - "_from": "lodash._baseclone@>=4.0.0 <5.0.0", - "_id": "lodash._baseclone@4.5.3", - "_inCache": true, - "_installable": true, - "_location": "/lodash.clonedeep/lodash._baseclone", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash._baseclone-4.5.3.tgz_1456902628287_0.513930449495092" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.17", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseclone", - "raw": "lodash._baseclone@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.clonedeep" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.3.tgz", - "_shasum": "c3f6df594c44c16012f9ecd59e58d5f70d3d72e2", - "_shrinkwrap": null, - "_spec": "lodash._baseclone@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.clonedeep", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseClone` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "c3f6df594c44c16012f9ecd59e58d5f70d3d72e2", - "tarball": "http://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseclone", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.3" -} diff --git a/deps/npm/node_modules/lodash.clonedeep/package.json b/deps/npm/node_modules/lodash.clonedeep/package.json index 9da20a9494d7fc..daac794ccd2fcc 100644 --- a/deps/npm/node_modules/lodash.clonedeep/package.json +++ b/deps/npm/node_modules/lodash.clonedeep/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.clonedeep@4.3.2", + { + "raw": "lodash.clonedeep@4.5.0", + "scope": null, + "escapedName": "lodash.clonedeep", + "name": "lodash.clonedeep", + "rawSpec": "4.5.0", + "spec": "4.5.0", + "type": "version" + }, "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.clonedeep@4.3.2", - "_id": "lodash.clonedeep@4.3.2", + "_from": "lodash.clonedeep@4.5.0", + "_id": "lodash.clonedeep@4.5.0", "_inCache": true, - "_installable": true, "_location": "/lodash.clonedeep", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.clonedeep-4.3.2.tgz_1459310662712_0.4621682942379266" + "tmp": "tmp/lodash.clonedeep-4.5.0.tgz_1471109839710_0.7944763591513038" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.1", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.clonedeep", - "raw": "lodash.clonedeep@4.3.2", - "rawSpec": "4.3.2", + "raw": "lodash.clonedeep@4.5.0", "scope": null, - "spec": "4.3.2", + "escapedName": "lodash.clonedeep", + "name": "lodash.clonedeep", + "rawSpec": "4.5.0", + "spec": "4.5.0", "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz", - "_shasum": "d0112c02c76b5223833aebc6a4b6e334f0d057de", + "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "_shasum": "e23f3f9c4f8fbdde872529c1071857a086e5ccef", "_shrinkwrap": null, - "_spec": "lodash.clonedeep@4.3.2", + "_spec": "lodash.clonedeep@4.5.0", "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,30 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._baseclone": "~4.5.0" - }, + "dependencies": {}, "description": "The lodash method `_.cloneDeep` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "d0112c02c76b5223833aebc6a4b6e334f0d057de", - "tarball": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz" + "shasum": "e23f3f9c4f8fbdde872529c1071857a086e5ccef", + "tarball": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -81,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.clonedeep", @@ -103,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.3.2" + "version": "4.5.0" } diff --git a/deps/npm/node_modules/lodash.union/README.md b/deps/npm/node_modules/lodash.union/README.md index 5a4fb54a9e9201..001092dde8d569 100644 --- a/deps/npm/node_modules/lodash.union/README.md +++ b/deps/npm/node_modules/lodash.union/README.md @@ -1,4 +1,4 @@ -# lodash.union v4.4.0 +# lodash.union v4.6.0 The [lodash](https://lodash.com/) method `_.union` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var union = require('lodash.union'); ``` -See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.union) for more details. +See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.union) for more details. diff --git a/deps/npm/node_modules/lodash.union/index.js b/deps/npm/node_modules/lodash.union/index.js index 5aa425b775b8ae..d1eb0305d57626 100644 --- a/deps/npm/node_modules/lodash.union/index.js +++ b/deps/npm/node_modules/lodash.union/index.js @@ -6,56 +6,889 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseFlatten = require('lodash._baseflatten'), - baseUniq = require('lodash._baseuniq'), - rest = require('lodash.rest'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ -var funcTag = '[object Function]', +var argsTag = '[object Arguments]', + funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array ? array.length : 0; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + /** Used for built-in method references. */ -var objectProto = Object.prototype; +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + Set = getNative(root, 'Set'), + nativeCreate = getNative(Object, 'create'); + /** - * The base implementation of `_.property` without support for deep paths. + * Creates a hash object. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); }; } /** - * Gets the "length" property value of `object`. + * The base implementation of `_.uniqBy` without support for iteratee shorthands. * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -var getLength = baseProperty('length'); +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -66,13 +899,98 @@ var getLength = baseProperty('length'); * @returns {Array} Returns the new array of combined values. * @example * - * _.union([2, 1], [4, 2], [1, 2]); - * // => [2, 1, 4] + * _.union([2], [1, 2]); + * // => [2, 1] */ -var union = rest(function(arrays) { +var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or @@ -99,7 +1017,7 @@ var union = rest(function(arrays) { * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** @@ -139,8 +1057,7 @@ function isArrayLikeObject(value) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -151,8 +1068,7 @@ function isArrayLikeObject(value) { */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -160,16 +1076,15 @@ function isFunction(value) { /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -191,7 +1106,7 @@ function isLength(value) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static @@ -247,4 +1162,20 @@ function isObjectLike(value) { return !!value && typeof value == 'object'; } +/** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ +function noop() { + // No operation performed. +} + module.exports = union; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md deleted file mode 100644 index 2c839ab728df3a..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseflatten v4.2.1 - -The internal [lodash](https://lodash.com/) function `baseFlatten` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseflatten -``` - -In Node.js: -```js -var baseFlatten = require('lodash._baseflatten'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.2.1-npm-packages/lodash._baseflatten) for more details. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js deleted file mode 100644 index de0df103f480f4..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js +++ /dev/null @@ -1,349 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = baseFlatten; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json deleted file mode 100644 index cd710c8b3ab51b..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_args": [ - [ - "lodash._baseflatten@~4.2.0", - "/Users/rebecca/code/npm/node_modules/lodash.union" - ] - ], - "_from": "lodash._baseflatten@>=4.2.0 <4.3.0", - "_id": "lodash._baseflatten@4.2.1", - "_inCache": true, - "_installable": true, - "_location": "/lodash.union/lodash._baseflatten", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash._baseflatten-4.2.1.tgz_1463062009548_0.7446099303197116" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseflatten", - "raw": "lodash._baseflatten@~4.2.0", - "rawSpec": "~4.2.0", - "scope": null, - "spec": ">=4.2.0 <4.3.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.union" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-4.2.1.tgz", - "_shasum": "54acad5e6ef53532a5b8269c0ad725470cfd9208", - "_shrinkwrap": null, - "_spec": "lodash._baseflatten@~4.2.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.union", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseFlatten` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "54acad5e6ef53532a5b8269c0ad725470cfd9208", - "tarball": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-4.2.1.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseflatten", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.2.1" -} diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md deleted file mode 100644 index 5342ca4452531e..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.rest v4.0.3 - -The [lodash](https://lodash.com/) method `_.rest` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.rest -``` - -In Node.js: -```js -var rest = require('lodash.rest'); -``` - -See the [documentation](https://lodash.com/docs#rest) or [package source](https://github.com/lodash/lodash/blob/4.0.3-npm-packages/lodash.rest) for more details. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js deleted file mode 100644 index 23157864103d27..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = rest; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json deleted file mode 100644 index 416db6c858d551..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - "lodash.rest@^4.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.union" - ] - ], - "_from": "lodash.rest@>=4.0.0 <5.0.0", - "_id": "lodash.rest@4.0.3", - "_inCache": true, - "_installable": true, - "_location": "/lodash.union/lodash.rest", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.rest-4.0.3.tgz_1463062507321_0.6458017621189356" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.rest", - "raw": "lodash.rest@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.union" - ], - "_resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz", - "_shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "_shrinkwrap": null, - "_spec": "lodash.rest@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.union", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.rest` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "tarball": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "rest" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash.rest", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.3" -} diff --git a/deps/npm/node_modules/lodash.union/package.json b/deps/npm/node_modules/lodash.union/package.json index 4e89c1da97139a..1bbb3cc10e757e 100644 --- a/deps/npm/node_modules/lodash.union/package.json +++ b/deps/npm/node_modules/lodash.union/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.union@latest", - "/Users/rebecca/code/npm" + { + "raw": "lodash.union@4.6.0", + "scope": null, + "escapedName": "lodash.union", + "name": "lodash.union", + "rawSpec": "4.6.0", + "spec": "4.6.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.union@latest", - "_id": "lodash.union@4.4.0", + "_from": "lodash.union@4.6.0", + "_id": "lodash.union@4.6.0", "_inCache": true, - "_installable": true, "_location": "/lodash.union", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.union-4.4.0.tgz_1463062655004_0.2674572637770325" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/lodash.union-4.6.0.tgz_1471110390292_0.8560791339259595" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.union", - "raw": "lodash.union@latest", - "rawSpec": "latest", + "raw": "lodash.union@4.6.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "lodash.union", + "name": "lodash.union", + "rawSpec": "4.6.0", + "spec": "4.6.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.4.0.tgz", - "_shasum": "22be23b4c84b49d0436e573949ad1d4a48c7fa38", + "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", + "_shasum": "48bb5088409f16f1821666641c44dd1aaae3cd88", "_shrinkwrap": null, - "_spec": "lodash.union@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "lodash.union@4.6.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,32 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._baseflatten": "~4.2.0", - "lodash._baseuniq": "~4.6.0", - "lodash.rest": "^4.0.0" - }, + "dependencies": {}, "description": "The lodash method `_.union` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "22be23b4c84b49d0436e573949ad1d4a48c7fa38", - "tarball": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.4.0.tgz" + "shasum": "48bb5088409f16f1821666641c44dd1aaae3cd88", + "tarball": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -83,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.union", @@ -105,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.4.0" + "version": "4.6.0" } diff --git a/deps/npm/node_modules/lodash.uniq/README.md b/deps/npm/node_modules/lodash.uniq/README.md index f1d83df5e52d6d..a662a5e3823153 100644 --- a/deps/npm/node_modules/lodash.uniq/README.md +++ b/deps/npm/node_modules/lodash.uniq/README.md @@ -1,4 +1,4 @@ -# lodash.uniq v4.3.0 +# lodash.uniq v4.5.0 The [lodash](https://lodash.com/) method `_.uniq` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var uniq = require('lodash.uniq'); ``` -See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.uniq) for more details. +See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.uniq) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/index.js b/deps/npm/node_modules/lodash.uniq/index.js index d1a25d8091dc20..83fce2bc44fcc4 100644 --- a/deps/npm/node_modules/lodash.uniq/index.js +++ b/deps/npm/node_modules/lodash.uniq/index.js @@ -6,11 +6,767 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseUniq = require('lodash._baseuniq'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array ? array.length : 0; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + Set = getNative(root, 'Set'), + nativeCreate = getNative(Object, 'create'); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each * element is kept. * @@ -31,4 +787,110 @@ function uniq(array) { : []; } +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ +function noop() { + // No operation performed. +} + module.exports = uniq; diff --git a/deps/npm/node_modules/lodash.uniq/package.json b/deps/npm/node_modules/lodash.uniq/package.json index 4ee8486f495af1..44593d7df55611 100644 --- a/deps/npm/node_modules/lodash.uniq/package.json +++ b/deps/npm/node_modules/lodash.uniq/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.uniq@latest", - "/Users/rebecca/code/npm" + { + "raw": "lodash.uniq@4.5.0", + "scope": null, + "escapedName": "lodash.uniq", + "name": "lodash.uniq", + "rawSpec": "4.5.0", + "spec": "4.5.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.uniq@latest", - "_id": "lodash.uniq@4.3.0", + "_from": "lodash.uniq@4.5.0", + "_id": "lodash.uniq@4.5.0", "_inCache": true, - "_installable": true, "_location": "/lodash.uniq", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.uniq-4.3.0.tgz_1463062659727_0.9107886834535748" + "tmp": "tmp/lodash.uniq-4.5.0.tgz_1471110399118_0.6918453241232783" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.uniq", - "raw": "lodash.uniq@latest", - "rawSpec": "latest", + "raw": "lodash.uniq@4.5.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "lodash.uniq", + "name": "lodash.uniq", + "rawSpec": "4.5.0", + "spec": "4.5.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.3.0.tgz", - "_shasum": "dcad810876841447d8f3ec662323c86a6d938227", + "_resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "_shasum": "d0225373aeb652adc1bc82e4945339a842754773", "_shrinkwrap": null, - "_spec": "lodash.uniq@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "lodash.uniq@4.5.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,30 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._baseuniq": "~4.6.0" - }, + "dependencies": {}, "description": "The lodash method `_.uniq` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "dcad810876841447d8f3ec662323c86a6d938227", - "tarball": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.3.0.tgz" + "shasum": "d0225373aeb652adc1bc82e4945339a842754773", + "tarball": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -81,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.uniq", @@ -103,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.3.0" + "version": "4.5.0" } diff --git a/deps/npm/node_modules/lodash.without/README.md b/deps/npm/node_modules/lodash.without/README.md index dd02c51c7c1ba7..8c00f8a4a03e62 100644 --- a/deps/npm/node_modules/lodash.without/README.md +++ b/deps/npm/node_modules/lodash.without/README.md @@ -1,4 +1,4 @@ -# lodash.without v4.2.0 +# lodash.without v4.4.0 The [lodash](https://lodash.com/) method `_.without` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var without = require('lodash.without'); ``` -See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.without) for more details. +See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.without) for more details. diff --git a/deps/npm/node_modules/lodash.without/index.js b/deps/npm/node_modules/lodash.without/index.js index 7c6954106b6af8..b75daee5fd82d8 100644 --- a/deps/npm/node_modules/lodash.without/index.js +++ b/deps/npm/node_modules/lodash.without/index.js @@ -6,8 +6,12 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseDifference = require('lodash._basedifference'), - rest = require('lodash.rest'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; @@ -16,47 +20,808 @@ var MAX_SAFE_INTEGER = 9007199254740991; var funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array ? array.length : 0; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + /** Used for built-in method references. */ -var objectProto = Object.prototype; +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + /** - * The base implementation of `_.property` without support for deep paths. + * Creates a hash object. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); }; } /** - * Gets the "length" property value of `object`. + * Gets the data for `map`. * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -var getLength = baseProperty('length'); +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * + * **Note:** Unlike `_.pull`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 @@ -67,15 +832,51 @@ var getLength = baseProperty('length'); * @see _.difference, _.xor * @example * - * _.without([1, 2, 1, 3], 1, 2); + * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ -var without = rest(function(array, values) { +var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or @@ -102,7 +903,7 @@ var without = rest(function(array, values) { * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** @@ -142,8 +943,7 @@ function isArrayLikeObject(value) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -154,8 +954,7 @@ function isArrayLikeObject(value) { */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -163,16 +962,15 @@ function isFunction(value) { /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -194,7 +992,7 @@ function isLength(value) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md deleted file mode 100644 index 7426607e9735fa..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basedifference v4.5.0 - -The internal [lodash](https://lodash.com/) function `baseDifference` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basedifference -``` - -In Node.js: -```js -var baseDifference = require('lodash._basedifference'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash._basedifference) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js deleted file mode 100644 index 39b916c9befadc..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js +++ /dev/null @@ -1,811 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var root = require('lodash._root'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - return !!array.length && baseIndexOf(array, value, 0) > -1; -} - -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.unary` without support for storing wrapper metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -/** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ -function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (!isObject(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -module.exports = baseDifference; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/README.md deleted file mode 100644 index 0329abf23d6735..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._root v3.0.1 - -The internal [lodash](https://lodash.com/) function `root` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._root -``` - -In Node.js: -```js -var root = require('lodash._root'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._root) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/index.js deleted file mode 100644 index 2d8ba0affc4d12..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -module.exports = root; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/package.json deleted file mode 100644 index 5d911a87e3c833..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_args": [ - [ - "lodash._root@~3.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.without/node_modules/lodash._basedifference" - ] - ], - "_from": "lodash._root@>=3.0.0 <3.1.0", - "_id": "lodash._root@3.0.1", - "_inCache": true, - "_installable": true, - "_location": "/lodash.without/lodash._basedifference/lodash._root", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/lodash._root-3.0.1.tgz_1455615057559_0.24128212919458747" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.18", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._root", - "raw": "lodash._root@~3.0.0", - "rawSpec": "~3.0.0", - "scope": null, - "spec": ">=3.0.0 <3.1.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.without/lodash._basedifference" - ], - "_resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "_shasum": "fba1c4524c19ee9a5f8136b4609f017cf4ded692", - "_shrinkwrap": null, - "_spec": "lodash._root@~3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.without/node_modules/lodash._basedifference", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `root` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "fba1c4524c19ee9a5f8136b4609f017cf4ded692", - "tarball": "http://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash._root", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.0.1" -} diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json deleted file mode 100644 index 59b01900207106..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "_args": [ - [ - "lodash._basedifference@~4.5.0", - "/Users/rebecca/code/npm/node_modules/lodash.without" - ] - ], - "_from": "lodash._basedifference@>=4.5.0 <4.6.0", - "_id": "lodash._basedifference@4.5.0", - "_inCache": true, - "_installable": true, - "_location": "/lodash.without/lodash._basedifference", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash._basedifference-4.5.0.tgz_1463061998825_0.9310404139105231" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basedifference", - "raw": "lodash._basedifference@~4.5.0", - "rawSpec": "~4.5.0", - "scope": null, - "spec": ">=4.5.0 <4.6.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.without" - ], - "_resolved": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-4.5.0.tgz", - "_shasum": "56ea7d601367bfa46cd7de115dc3daeb18837938", - "_shrinkwrap": null, - "_spec": "lodash._basedifference@~4.5.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.without", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._root": "~3.0.0" - }, - "description": "The internal lodash function `baseDifference` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "56ea7d601367bfa46cd7de115dc3daeb18837938", - "tarball": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-4.5.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basedifference", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" -} diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md deleted file mode 100644 index 5342ca4452531e..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.rest v4.0.3 - -The [lodash](https://lodash.com/) method `_.rest` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.rest -``` - -In Node.js: -```js -var rest = require('lodash.rest'); -``` - -See the [documentation](https://lodash.com/docs#rest) or [package source](https://github.com/lodash/lodash/blob/4.0.3-npm-packages/lodash.rest) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js deleted file mode 100644 index 23157864103d27..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = rest; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json deleted file mode 100644 index 3564a655cb4044..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - "lodash.rest@^4.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.without" - ] - ], - "_from": "lodash.rest@>=4.0.0 <5.0.0", - "_id": "lodash.rest@4.0.3", - "_inCache": true, - "_installable": true, - "_location": "/lodash.without/lodash.rest", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.rest-4.0.3.tgz_1463062507321_0.6458017621189356" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.rest", - "raw": "lodash.rest@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.without" - ], - "_resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz", - "_shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "_shrinkwrap": null, - "_spec": "lodash.rest@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.without", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.rest` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "tarball": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "rest" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash.rest", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.3" -} diff --git a/deps/npm/node_modules/lodash.without/package.json b/deps/npm/node_modules/lodash.without/package.json index 0aac3a5cb65acf..603342edad496e 100644 --- a/deps/npm/node_modules/lodash.without/package.json +++ b/deps/npm/node_modules/lodash.without/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.without@latest", - "/Users/rebecca/code/npm" + { + "raw": "lodash.without@4.4.0", + "scope": null, + "escapedName": "lodash.without", + "name": "lodash.without", + "rawSpec": "4.4.0", + "spec": "4.4.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.without@latest", - "_id": "lodash.without@4.2.0", + "_from": "lodash.without@4.4.0", + "_id": "lodash.without@4.4.0", "_inCache": true, - "_installable": true, "_location": "/lodash.without", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.without-4.2.0.tgz_1463062688060_0.9002856267616153" + "tmp": "tmp/lodash.without-4.4.0.tgz_1471110432266_0.7884129623416811" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.without", - "raw": "lodash.without@latest", - "rawSpec": "latest", + "raw": "lodash.without@4.4.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "lodash.without", + "name": "lodash.without", + "rawSpec": "4.4.0", + "spec": "4.4.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.2.0.tgz", - "_shasum": "f89ec9a8ee2d7ec14f8a9cad72a3f5ee12c5a4a6", + "_resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.4.0.tgz", + "_shasum": "3cd4574a00b67bae373a94b748772640507b7aac", "_shrinkwrap": null, - "_spec": "lodash.without@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "lodash.without@4.4.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,31 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._basedifference": "~4.5.0", - "lodash.rest": "^4.0.0" - }, + "dependencies": {}, "description": "The lodash method `_.without` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "f89ec9a8ee2d7ec14f8a9cad72a3f5ee12c5a4a6", - "tarball": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.2.0.tgz" + "shasum": "3cd4574a00b67bae373a94b748772640507b7aac", + "tarball": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.4.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -82,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.without", @@ -104,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.2.0" + "version": "4.4.0" } diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js index a5793ceccec488..584f551a6da734 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js @@ -1,16 +1,16 @@ module.exports = function (args, opts) { if (!opts) opts = {}; - + var flags = { bools : {}, strings : {} }; - + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); - + [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; }); - + var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); @@ -20,14 +20,14 @@ module.exports = function (args, opts) { })); }); }); - + var defaults = opts['default'] || {}; - + var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); - + var notFlags = []; if (args.indexOf('--') !== -1) { @@ -40,15 +40,15 @@ module.exports = function (args, opts) { ? Number(val) : val ; setKey(argv, key.split('.'), value); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } - + for (var i = 0; i < args.length; i++) { var arg = args[i]; - + if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: @@ -79,23 +79,23 @@ module.exports = function (args, opts) { } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); - + var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); - + if (next === '-') { setArg(letters[j], next) continue; } - + if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next); broken = true; break; } - + if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2)); broken = true; @@ -105,7 +105,7 @@ module.exports = function (args, opts) { setArg(letters[j], flags.strings[letters[j]] ? '' : true); } } - + var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) @@ -129,17 +129,17 @@ module.exports = function (args, opts) { ); } } - + Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); - + notFlags.forEach(function(key) { argv._.push(key); }); @@ -163,7 +163,7 @@ function setKey (obj, keys, value) { if (o[key] === undefined) o[key] = {}; o = o[key]; }); - + var key = keys[keys.length - 1]; if (o[key] === undefined || typeof o[key] === 'boolean') { o[key] = value; diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js index 47e92237fb0bbc..8a90646696628e 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js @@ -14,7 +14,7 @@ test('parse args', function (t) { ); t.end(); }); - + test('comprehensive', function (t) { t.deepEqual( parse([ @@ -80,13 +80,13 @@ test('flag boolean value', function (t) { boolean: [ 't', 'verbose' ], default: { verbose: true } }); - + t.deepEqual(argv, { verbose: false, t: true, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -97,13 +97,13 @@ test('flag boolean default false', function (t) { boolean: ['t', 'verbose'], default: { verbose: false, t: false } }); - + t.deepEqual(argv, { verbose: false, t: false, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -114,14 +114,14 @@ test('boolean groups', function (t) { var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { boolean: ['x','y','z'] }); - + t.deepEqual(argv, { x : true, y : false, z : true, _ : [ 'one', 'two', 'three' ] }); - + t.deepEqual(typeof argv.x, 'boolean'); t.deepEqual(typeof argv.y, 'boolean'); t.deepEqual(typeof argv.z, 'boolean'); @@ -131,7 +131,7 @@ test('boolean groups', function (t) { test('newlines in params' , function (t) { var args = parse([ '-s', "X\nX" ]) t.deepEqual(args, { _ : [], s : "X\nX" }); - + // reproduce in bash: // VALUE="new // line" @@ -145,7 +145,7 @@ test('strings' , function (t) { var s = parse([ '-s', '0001234' ], { string: 's' }).s; t.equal(s, '0001234'); t.equal(typeof s, 'string'); - + var x = parse([ '-x', '56' ], { string: 'x' }).x; t.equal(x, '56'); t.equal(typeof x, 'string'); @@ -222,7 +222,7 @@ test('nested dotted objects', function (t) { '--foo.quux.quibble', '5', '--foo.quux.o_O', '--beep.boop' ]); - + t.same(argv.foo, { bar : 3, baz : 4, @@ -254,9 +254,9 @@ test('boolean and alias with chainable api', function (t) { h: true, '_': [ 'derp' ] }; - + t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -295,7 +295,7 @@ test('boolean and alias using explicit true', function (t) { }; t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -311,7 +311,7 @@ test('boolean and --x=true', function(t) { parsed = parse(['--boool', '--other=false'], { boolean: 'boool' }); - + t.same(parsed.boool, true); t.same(parsed.other, 'false'); t.end(); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js index 7c4c2abe397797..21851b036ee6d9 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js @@ -3,7 +3,7 @@ var test = require('tape'); test('parse with modifier functions' , function (t) { t.plan(1); - + var argv = parse([ '-b', '123' ], { boolean: 'b' }); t.deepEqual(argv, { b: true, _: ['123'] }); }); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js index ac18880f1eb50c..d513a1c2529095 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js @@ -43,7 +43,7 @@ test('short', function (t) { ); t.end(); }); - + test('mixed short bool and capture', function (t) { t.same( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), @@ -54,7 +54,7 @@ test('mixed short bool and capture', function (t) { ); t.end(); }); - + test('short and long', function (t) { t.deepEqual( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), diff --git a/deps/npm/node_modules/node-gyp/CHANGELOG.md b/deps/npm/node_modules/node-gyp/CHANGELOG.md index 089ee84a4d7dbc..cb63589e24317f 100644 --- a/deps/npm/node_modules/node-gyp/CHANGELOG.md +++ b/deps/npm/node_modules/node-gyp/CHANGELOG.md @@ -1,3 +1,27 @@ +v3.4.0 2016-06-28 + +* [[`ce5fd04e94`](https://github.com/nodejs/node-gyp/commit/ce5fd04e94)] - **deps**: update minimatch version (delphiactual) [#961](https://github.com/nodejs/node-gyp/pull/961) +* [[`77383ddd85`](https://github.com/nodejs/node-gyp/commit/77383ddd85)] - Replace fs.accessSync call to fs.statSync (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`0dba4bda57`](https://github.com/nodejs/node-gyp/commit/0dba4bda57)] - **test**: add simple addon test (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`c4344b3889`](https://github.com/nodejs/node-gyp/commit/c4344b3889)] - **doc**: add --target option to README (Gibson Fahnestock) [#958](https://github.com/nodejs/node-gyp/pull/958) +* [[`cc778e9215`](https://github.com/nodejs/node-gyp/commit/cc778e9215)] - Override BUILDING_UV_SHARED, BUILDING_V8_SHARED. (Ben Noordhuis) [#915](https://github.com/nodejs/node-gyp/pull/915) +* [[`af35b2ad32`](https://github.com/nodejs/node-gyp/commit/af35b2ad32)] - Move VC++ Build Tools to Build Tools landing page. (Andrew Pardoe) [#953](https://github.com/nodejs/node-gyp/pull/953) +* [[`f31482e226`](https://github.com/nodejs/node-gyp/commit/f31482e226)] - **win**: work around __pfnDliNotifyHook2 type change (Alexis Campailla) [#952](https://github.com/nodejs/node-gyp/pull/952) +* [[`3df8222fa5`](https://github.com/nodejs/node-gyp/commit/3df8222fa5)] - Allow for npmlog@3.x (Rebecca Turner) [#950](https://github.com/nodejs/node-gyp/pull/950) +* [[`a4fa07b390`](https://github.com/nodejs/node-gyp/commit/a4fa07b390)] - More verbose error on locating msbuild.exe failure. (Mateusz Jaworski) [#930](https://github.com/nodejs/node-gyp/pull/930) +* [[`4ee31329e0`](https://github.com/nodejs/node-gyp/commit/4ee31329e0)] - **doc**: add command options to README.md (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`c8c7ca86b9`](https://github.com/nodejs/node-gyp/commit/c8c7ca86b9)] - Add --silent option for zero output. (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`ac29d23a7c`](https://github.com/nodejs/node-gyp/commit/ac29d23a7c)] - Upgrade to glob@7.0.3. (Ben Noordhuis) [#943](https://github.com/nodejs/node-gyp/pull/943) +* [[`15fd56be3d`](https://github.com/nodejs/node-gyp/commit/15fd56be3d)] - Enable V8 deprecation warnings for native modules (Matt Loring) [#920](https://github.com/nodejs/node-gyp/pull/920) +* [[`7f1c1b960c`](https://github.com/nodejs/node-gyp/commit/7f1c1b960c)] - **gyp**: improvements for android generator (Robert Chiras) [#935](https://github.com/nodejs/node-gyp/pull/935) +* [[`088082766c`](https://github.com/nodejs/node-gyp/commit/088082766c)] - Update Windows install instructions (Sara Itani) [#867](https://github.com/nodejs/node-gyp/pull/867) +* [[`625c1515f9`](https://github.com/nodejs/node-gyp/commit/625c1515f9)] - **gyp**: inherit CC/CXX for CC/CXX.host (Johan Bergström) [#908](https://github.com/nodejs/node-gyp/pull/908) +* [[`3bcb1720e4`](https://github.com/nodejs/node-gyp/commit/3bcb1720e4)] - Add support for the Python launcher on Windows (Patrick Westerhoff) [#894](https://github.com/nodejs/node-gyp/pull/894 + +v3.3.1 2016-03-04 + +* [[`a981ef847a`](https://github.com/nodejs/node-gyp/commit/a981ef847a)] - **gyp**: fix android generator (Robert Chiras) [#889](https://github.com/nodejs/node-gyp/pull/889) + v3.3.0 2016-02-16 * [[`818d854a4d`](https://github.com/nodejs/node-gyp/commit/818d854a4d)] - Introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR (Rod Vagg) [#878](https://github.com/nodejs/node-gyp/pull/878) @@ -19,7 +43,7 @@ v3.2.0 2015-11-25 * [[`0e2dfda1f3`](https://github.com/nodejs/node-gyp/commit/0e2dfda1f3)] - Fix test/test-options when run through `npm test`. (Ben Noordhuis) [#755](https://github.com/nodejs/node-gyp/pull/755) * [[`9bfa0876b4`](https://github.com/nodejs/node-gyp/commit/9bfa0876b4)] - Add support for AIX (Michael Dawson) [#753](https://github.com/nodejs/node-gyp/pull/753) * [[`a8d441a0a2`](https://github.com/nodejs/node-gyp/commit/a8d441a0a2)] - Update README for Windows 10 support. (Jason Williams) [#766](https://github.com/nodejs/node-gyp/pull/766) -* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) +* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) v3.1.0 2015-11-14 diff --git a/deps/npm/node_modules/node-gyp/README.md b/deps/npm/node_modules/node-gyp/README.md index dec739f16fde99..5212b124f98628 100644 --- a/deps/npm/node_modules/node-gyp/README.md +++ b/deps/npm/node_modules/node-gyp/README.md @@ -10,9 +10,9 @@ program which is removed for node `v0.8`. If you have a native addon for node th still has a `wscript` file, then you should definitely add a `binding.gyp` file to support the latest versions of node. -Multiple target versions of node are supported (i.e. `0.8`, `0.9`, `0.10`, ..., `1.0`, +Multiple target versions of node are supported (i.e. `0.8`, ..., `4`, `5`, `6`, etc.), regardless of what version of node is actually installed on your system -(`node-gyp` downloads the necessary development files for the target version). +(`node-gyp` downloads the necessary development files or headers for the target version). #### Features: @@ -42,30 +42,17 @@ You will also need to install: * You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads` * This step will install `gcc` and the related toolchain containing `make` * On Windows: - * Python ([`v2.7.10`][python-v2.7.10] recommended, `v3.x.x` is __*not*__ supported) - * Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folder - * Windows XP/Vista/7: - * Microsoft Visual Studio C++ 2013 ([Express][msvc2013] version works well) - * If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first - * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1] - * Windows 7/8: - * Microsoft Visual Studio C++ 2013 for Windows Desktop ([Express][msvc2013] version works well) - * Windows 10: - * Install the latest version of npm (3.3.6 at the time of writing) - * Install Python 2.7 from https://www.python.org/download/releases/2.7/ and make sure its on the System Path - * Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation) - * Set the environment variable GYP_MSVS_VERSION=2015 - * Run the command prompt as Administrator - * $ npm install (--msvs_version=2015) <-- Shouldn't be needed if you have set GYP_MSVS_VERSION env - * If the above steps have not worked or you are unsure please visit http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64 for a full walkthrough - * All Windows Versions - * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk] - * You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK: + * Visual C++ Build Environment: + * Option 1: Install [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) using the **Default Install** option. -``` -call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x86 -call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64 -``` + * Option 2: Install [Visual Studio 2015](https://www.visualstudio.com/products/visual-studio-community-vs) (or modify an existing installation) and select *Common Tools for Visual C++* during setup. This also works with the free Community and Express for Desktop editions. + + > :bulb: [Windows Vista / 7 only] requires [.NET Framework 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40773) + + * Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.) + * Launch cmd, `npm config set msvs_version 2015` + + If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips. If you have multiple Python versions installed, you can identify which Python version `node-gyp` uses by setting the '--python' variable: @@ -157,13 +144,43 @@ Commands | **Command** | **Description** |:--------------|:--------------------------------------------------------------- +| `help` | Shows the help dialog | `build` | Invokes `make`/`msbuild.exe` and builds the native addon | `clean` | Removes the `build` directory if it exists | `configure` | Generates project build files for the current platform | `rebuild` | Runs `clean`, `configure` and `build` all in a row -| `install` | Installs node development header files for the given version -| `list` | Lists the currently installed node development file versions -| `remove` | Removes the node development header files for the given version +| `install` | Installs node header files for the given version +| `list` | Lists the currently installed node header versions +| `remove` | Removes the node header files for the given version + + +Command Options +-------- + +`node-gyp` accepts the following command options: + +| **Command** | **Description** +|:----------------------------------|:------------------------------------------ +| `-j n`, `--jobs n` | Run make in parallel +| `--target=v6.2.1` | Node version to build for (default=process.version) +| `--silly`, `--loglevel=silly` | Log all progress to console +| `--verbose`, `--loglevel=verbose` | Log most progress to console +| `--silent`, `--loglevel=silent` | Don't log anything to console +| `debug`, `--debug` | Make Debug build (default=Release) +| `--release`, `--no-debug` | Make Release build +| `-C $dir`, `--directory=$dir` | Run command in different directory +| `--make=$make` | Override make command (e.g. gmake) +| `--thin=yes` | Enable thin static libraries +| `--arch=$arch` | Set target architecture (e.g. ia32) +| `--tarball=$path` | Get headers from a local tarball +| `--ensure` | Don't reinstall headers if already present +| `--dist-url=$url` | Download header tarball from custom URL +| `--proxy=$url` | Set HTTP proxy for downloading header tarball +| `--cafile=$cafile` | Override default CA chain (to download tarball) +| `--nodedir=$path` | Set the path to the node binary +| `--python=$path` | Set path to the python (2) binary +| `--msvs_version=$version` | Set Visual Studio version (win) +| `--solution=$solution` | Set Visual Studio Solution version (win) License diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 552e4748d3b7e7..3be0f591bda9e3 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -10,8 +10,16 @@ '<(node_root_dir)/deps/uv/include', '<(node_root_dir)/deps/v8/include' ], + 'defines!': [ + 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. + 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. + ], 'defines': [ - 'NODE_GYP_MODULE_NAME=>(_target_name)' + 'NODE_GYP_MODULE_NAME=>(_target_name)', + 'USING_UV_SHARED=1', + 'USING_V8_SHARED=1', + # Warn when using deprecated V8 APIs. + 'V8_DEPRECATION_WARNINGS=1' ], 'target_conditions': [ @@ -41,7 +49,7 @@ 'conditions': [ [ 'OS=="win"', { 'sources': [ - '<(node_gyp_dir)/src/win_delay_load_hook.c', + '<(node_gyp_dir)/src/win_delay_load_hook.cc', ], 'msvs_settings': { 'VCLinkerTool': { diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py index bb9eb5f4b96775..5b26cc785a80e8 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py @@ -875,6 +875,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, part_of_all, self.WriteLn('LOCAL_PRELINK_MODULE := false') self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier) elif self.type == 'executable': + self.WriteLn('LOCAL_CXX_STL := libc++_static') # Executables are for build and test purposes only, so they're installed # to a directory that doesn't get included in the system image. self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)') @@ -1080,7 +1081,7 @@ def CalculateMakefilePath(build_file, base_name): root_makefile.write('GYP_CONFIGURATION ?= %s\n' % default_configuration) root_makefile.write('GYP_VAR_PREFIX ?=\n') root_makefile.write('GYP_HOST_VAR_PREFIX ?=\n') - root_makefile.write('GYP_HOST_MULTILIB ?=\n') + root_makefile.write('GYP_HOST_MULTILIB ?= first\n') # Write out the sorted list of includes. root_makefile.write('\n') diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py index aefdac787c2408..64b9dd267b7492 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py @@ -2065,10 +2065,10 @@ def CalculateMakefilePath(build_file, base_name): 'AR.target': GetEnvironFallback(('AR_target', 'AR'), '$(AR)'), 'CXX.target': GetEnvironFallback(('CXX_target', 'CXX'), '$(CXX)'), 'LINK.target': GetEnvironFallback(('LINK_target', 'LINK'), '$(LINK)'), - 'CC.host': GetEnvironFallback(('CC_host',), 'gcc'), - 'AR.host': GetEnvironFallback(('AR_host',), 'ar'), - 'CXX.host': GetEnvironFallback(('CXX_host',), 'g++'), - 'LINK.host': GetEnvironFallback(('LINK_host',), '$(CXX.host)'), + 'CC.host': GetEnvironFallback(('CC_host', 'CC'), 'gcc'), + 'AR.host': GetEnvironFallback(('AR_host', 'AR'), 'ar'), + 'CXX.host': GetEnvironFallback(('CXX_host', 'CXX'), 'g++'), + 'LINK.host': GetEnvironFallback(('LINK_host', 'LINK'), '$(CXX.host)'), }) build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js index 3a3edccf872b92..22f2583694c70f 100644 --- a/deps/npm/node_modules/node-gyp/lib/build.js +++ b/deps/npm/node_modules/node-gyp/lib/build.js @@ -125,19 +125,19 @@ function build (gyp, argv, callback) { function findMsbuild () { log.verbose('could not find "msbuild.exe" in PATH - finding location in registry') - var notfoundErr = new Error('Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?') + var notfoundErr = 'Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?' var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s' if (process.arch !== 'ia32') cmd += ' /reg:32' exec(cmd, function (err, stdout, stderr) { + if (err) { + return callback(new Error(err.message + '\n' + notfoundErr)) + } var reVers = /ToolsVersions\\([^\\]+)$/i , rePath = /\r\n[ \t]+MSBuildToolsPath[ \t]+REG_SZ[ \t]+([^\r]+)/i , msbuilds = [] , r , msbuildPath - if (err) { - return callback(notfoundErr) - } stdout.split('\r\n\r\n').forEach(function(l) { if (!l) return l = l.trim() @@ -157,7 +157,7 @@ function build (gyp, argv, callback) { return (x.version < y.version ? -1 : 1) }) ;(function verifyMsbuild () { - if (!msbuilds.length) return callback(notfoundErr) + if (!msbuilds.length) return callback(new Error(notfoundErr)) msbuildPath = path.resolve(msbuilds.pop().path, 'msbuild.exe') fs.stat(msbuildPath, function (err, stat) { if (err) { @@ -165,7 +165,7 @@ function build (gyp, argv, callback) { if (msbuilds.length) { return verifyMsbuild() } else { - callback(notfoundErr) + callback(new Error(notfoundErr)) } } else { callback(err) diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 4e0652961ea902..4543bce7d71ba0 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -1,5 +1,6 @@ module.exports = exports = configure -module.exports.test = { findPython: findPython } +module.exports.test = { findAccessibleSync: findAccessibleSync, + findPython: findPython } /** * Module dependencies. @@ -7,7 +8,6 @@ module.exports.test = { findPython: findPython } var fs = require('graceful-fs') , path = require('path') - , glob = require('glob') , log = require('npmlog') , osenv = require('osenv') , which = require('which') @@ -21,6 +21,7 @@ var fs = require('graceful-fs') , execFile = cp.execFile , win = process.platform == 'win32' , findNodeDirectory = require('./find-node-directory') + , msgFormat = require('util').format exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' @@ -227,22 +228,21 @@ function configure (gyp, argv, callback) { // - the out/Release directory // - the out/Debug directory // - the root directory - var node_exp_file = '' + var node_exp_file = undefined if (process.platform === 'aix') { var node_root_dir = findNodeDirectory() var candidates = ['include/node/node.exp', 'out/Release/node.exp', 'out/Debug/node.exp', 'node.exp'] - for (var next = 0; next < candidates.length; next++) { - node_exp_file = path.resolve(node_root_dir, candidates[next]) - try { - fs.accessSync(node_exp_file, fs.R_OK) - // exp file found, stop looking - break - } catch (exception) { - // this candidate was not found or not readable, do nothing - } + var logprefix = 'find exports file' + node_exp_file = findAccessibleSync(logprefix, node_root_dir, candidates) + if (node_exp_file !== undefined) { + log.verbose(logprefix, 'Found exports file: %s', node_exp_file) + } else { + var msg = msgFormat('Could not find node.exp file in %s', node_root_dir) + log.error(logprefix, 'Could not find exports file') + return callback(new Error(msg)) } } @@ -311,6 +311,29 @@ function configure (gyp, argv, callback) { } +/** + * Returns the first file or directory from an array of candidates that is + * readable by the current user, or undefined if none of the candidates are + * readable. + */ +function findAccessibleSync (logprefix, dir, candidates) { + for (var next = 0; next < candidates.length; next++) { + var candidate = path.resolve(dir, candidates[next]) + try { + var fd = fs.openSync(candidate, 'r') + } catch (e) { + // this candidate was not found or not readable, do nothing + log.silly(logprefix, 'Could not open %s: %s', candidate, e.message) + continue + } + fs.closeSync(fd) + log.silly(logprefix, 'Found readable %s', candidate) + return candidate + } + + return undefined +} + function findPython (python, callback) { checkPython() @@ -325,7 +348,7 @@ function findPython (python, callback) { return checkPython() } if (win) { - guessPython() + checkPythonLauncher() } else { failNoPython() } @@ -340,6 +363,31 @@ function findPython (python, callback) { }) } + // Distributions of Python on Windows by default install with the "py.exe" + // Python launcher which is more likely to exist than the Python executable + // being in the $PATH. + // Because the Python launcher supports all versions of Python, we have to + // explicitly request a Python 2 version. This is done by supplying "-2" as + // the first command line argument. Since "py.exe -2" would be an invalid + // executable for "execFile", we have to use the launcher to figure out + // where the actual "python.exe" executable is located. + function checkPythonLauncher () { + log.verbose('could not find "' + python + '". checking python launcher') + var env = extend({}, process.env) + env.TERM = 'dumb' + + var launcherArgs = ['-2', '-c', 'import sys; print sys.executable'] + execFile('py.exe', launcherArgs, { env: env }, function (err, stdout) { + if (err) { + guessPython() + return + } + python = stdout.trim() + log.verbose('check python launcher', 'python executable found: %j', python) + checkPythonVersion() + }) + } + // Called on Windows when "python" isn't available in the current $PATH. // We're gonna check if "%SystemDrive%\python27\python.exe" exists. function guessPython () { diff --git a/deps/npm/node_modules/node-gyp/lib/node-gyp.js b/deps/npm/node_modules/node-gyp/lib/node-gyp.js index a5a332885597bf..3b8f5b0a1c2e04 100644 --- a/deps/npm/node_modules/node-gyp/lib/node-gyp.js +++ b/deps/npm/node_modules/node-gyp/lib/node-gyp.js @@ -112,6 +112,7 @@ proto.shorthands = { , j: '--jobs' , silly: '--loglevel=silly' , verbose: '--loglevel=verbose' + , silent: '--loglevel=silent' } /** diff --git a/deps/npm/node_modules/node-gyp/lib/process-release.js b/deps/npm/node_modules/node-gyp/lib/process-release.js index f5a3cca6357b6d..89eaf9be361290 100644 --- a/deps/npm/node_modules/node-gyp/lib/process-release.js +++ b/deps/npm/node_modules/node-gyp/lib/process-release.js @@ -9,7 +9,7 @@ var semver = require('semver') , bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should // have been "x86" -// Captures all the logic required to determine download URLs, local directory and +// Captures all the logic required to determine download URLs, local directory and // file names. Inputs come from command-line switches (--target, --dist-url), // `process.version` and `process.release` where it exists. function processRelease (argv, gyp, defaultVersion, defaultRelease) { diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/common.js b/deps/npm/node_modules/node-gyp/node_modules/glob/common.js deleted file mode 100644 index cd7c82448126f1..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/common.js +++ /dev/null @@ -1,237 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.isAbsolute = process.platform === "win32" ? absWin : absUnix -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var Minimatch = minimatch.Minimatch - -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - var result = splitDeviceRe.exec(p) - var device = result[1] || '' - var isUnc = device && device.charAt(1) !== ':' - var isAbsolute = !!result[2] || isUnc // UNC paths are always absolute - - return isAbsolute -} - -function absUnix (p) { - return p.charAt(0) === "/" || p === "" -} - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { nonegate: true }) - } - - return { - matcher: new Minimatch(pattern, { nonegate: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - self.nomount = !!options.nomount - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - return !(/\/$/.test(e)) - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (exports.isAbsolute(f)) { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else if (self.realpath) { - abs = path.resolve(f) - } - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/glob.js b/deps/npm/node_modules/node-gyp/node_modules/glob/glob.js deleted file mode 100644 index eac0693cc6cd33..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/glob.js +++ /dev/null @@ -1,740 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var isAbsolute = common.isAbsolute -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -glob.hasMagic = function (pattern, options_) { - var options = util._extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - var n = this.minimatch.set.length - this._processing = 0 - this.matches = new Array(n) - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - - function done () { - --self._processing - if (self._processing <= 0) - self._finish() - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - fs.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (this.matches[index][e]) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = this._makeAbs(e) - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - if (this.mark) - e = this._mark(e) - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er) - return cb() - - var isSym = lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) return this.emit('error', er) - if (!this.silent) console.error('glob error', er) - break - } - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && !stat.isDirectory()) - return cb(null, false, stat) - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return cb() - - return cb(null, c, stat) -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index d458bc2e0a6b03..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js deleted file mode 100644 index 7d0515920e5cb3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js +++ /dev/null @@ -1,1159 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.minimatch = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ - type: plType, - start: i - 1, - reStart: re.length - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - var pl = patternListStack.pop() - plType = pl.type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - -},{"brace-expansion":2,"path":undefined}],2:[function(require,module,exports){ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - var expansions = expand(escapeBraces(str)); - return expansions.filter(identity).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0]).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - expansions.push([pre, N[j], post[k]].join('')) - } - } - - return expansions; -} - - -},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){ -module.exports = balanced; -function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; - } - } - } - - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; - } - return m; - } -} - -},{}],4:[function(require,module,exports){ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (Array.isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -},{}]},{},[1])(1) -}); \ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index ec4c05c570c52e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,912 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ - type: plType, - start: i - 1, - reStart: re.length - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - var pl = patternListStack.pop() - plType = pl.type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore deleted file mode 100644 index fd4f2b066b339e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.DS_Store diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile deleted file mode 100644 index dd2730cfde0cab..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @node_modules/.bin/tape test/*.js - -.PHONY: test diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js deleted file mode 100644 index 9ce76f480a4321..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ /dev/null @@ -1,4 +0,0 @@ -var balanced = require('./'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index ac0c6aaca5848e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - "balanced-match@^0.3.0", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ] - ], - "_from": "balanced-match@>=0.3.0 <0.4.0", - "_id": "balanced-match@0.3.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "4.2.1", - "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" - }, - "_npmVersion": "2.14.7", - "_phantomChildren": {}, - "_requested": { - "name": "balanced-match", - "raw": "balanced-match@^0.3.0", - "rawSpec": "^0.3.0", - "scope": null, - "spec": ">=0.3.0 <0.4.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/glob/minimatch/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", - "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "_shrinkwrap": null, - "_spec": "balanced-match@^0.3.0", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", - "author": { - "email": "mail@juliangruber.com", - "name": "Julian Gruber", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "dependencies": {}, - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "devDependencies": { - "tape": "~4.2.2" - }, - "directories": {}, - "dist": { - "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" - }, - "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", - "homepage": "https://github.com/juliangruber/balanced-match", - "keywords": [ - "balanced", - "match", - "parse", - "regexp", - "test" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "balanced-match", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "test": "make test" - }, - "testling": { - "browsers": [ - "android-browser/4.2..latest", - "chrome/25..latest", - "chrome/canary", - "firefox/20..latest", - "firefox/nightly", - "ie/8..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "opera/12..latest", - "opera/next", - "safari/5.1..latest" - ], - "files": "test/*.js" - }, - "version": "0.3.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index f5e98e3f2a3240..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,84 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 9, - pre: 'pre', - body: '{in}', - post: 'post' - }); - t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'in', - post: '}post' - }); - t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { - start: 4, - end: 10, - pre: 'pre{', - body: 'first', - post: 'in{second}post' - }); - t.deepEqual(balanced('', 'prepost'), { - start: 3, - end: 4, - pre: 'pre', - body: '', - post: 'post' - }); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index 3dc6beb49f684a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "2.0.10", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js", - "prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "devDependencies": { - "browserify": "^9.0.3", - "standard": "^3.7.2", - "tap": "^1.2.0" - }, - "license": "ISC", - "files": [ - "minimatch.js", - "browser.js" - ], - "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@2.0.10", - "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "_from": "minimatch@>=2.0.1 <3.0.0", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json deleted file mode 100644 index 434e4696f8fb15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "4.5.3", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "engines": { - "node": "*" - }, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^2.0.1", - "once": "^1.3.0" - }, - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^0.5.0", - "tick": "0.0.6" - }, - "scripts": { - "prepublish": "npm run benchclean", - "profclean": "rm -f v8.log profile.txt", - "test": "npm run profclean && tap test/*.js", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "bash benchclean.sh" - }, - "license": "ISC", - "gitHead": "a4e461ab59a837eee80a4d8dbdbf5ae1054a646f", - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "homepage": "https://github.com/isaacs/node-glob", - "_id": "glob@4.5.3", - "_shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f", - "_from": "glob@>=3.0.0 <4.0.0||>=4.0.0 <5.0.0", - "_npmVersion": "2.7.1", - "_nodeVersion": "1.4.2", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f", - "tarball": "http://registry.npmjs.org/glob/-/glob-4.5.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/sync.js b/deps/npm/node_modules/node-gyp/node_modules/glob/sync.js deleted file mode 100644 index f4f5e36d4beae3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/sync.js +++ /dev/null @@ -1,457 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var isAbsolute = common.isAbsolute -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = fs.realpathSync(p, this.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this.matches[index][e] = true - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - var abs = this._makeAbs(e) - if (this.mark) - e = this._mark(e) - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[this._makeAbs(e)] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - // lstat failed, doesn't exist - return null - } - - var isSym = lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) throw er - if (!this.silent) console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this.matches[index][prefix] = true -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - return false - } - - if (lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml deleted file mode 100644 index fca8ef019405d5..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.10 - - 0.11 diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE index 05a4010949cac3..19129e315fe593 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +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", 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" 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/node-gyp/node_modules/minimatch/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md index 5b3967ea998b01..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md @@ -2,13 +2,11 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. -Eventually, it will replace the C binding in node-glob. - It works by converting glob expressions into JavaScript `RegExp` objects. @@ -39,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -84,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js index 47617868b99902..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js @@ -1,65 +1,44 @@ -;(function (require, exports, module, platform) { +module.exports = minimatch +minimatch.Minimatch = Minimatch -if (module) module.exports = minimatch -else exports.minimatch = minimatch +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } - } - } - } -} +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') -minimatch.Minimatch = Minimatch - -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} -var path = require("path") - // any single thing other than / - // don't need to escape / when using new RegExp() - , qmark = "[^/]" +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' - // * => any number of characters - , star = qmark + "*?" +// * => any number of characters +var star = qmark + '*?' - // ** when dots are allowed. Anything goes, except .. and . - // not (^ or / followed by one or two dots followed by $ or /), - // followed by anything, any number of times. - , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - // not a ^ or / followed by a dot, - // followed by anything, any number of times. - , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - // characters that need to be escaped in RegExp. - , reSpecials = charSet("().*{}+?[]^$\\!") +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') // "abc" -> { a:true, b:true, c:true } function charSet (s) { - return s.split("").reduce(function (set, c) { + return s.split('').reduce(function (set, c) { set[c] = true return set }, {}) @@ -110,51 +89,41 @@ Minimatch.defaults = function (def) { return minimatch.defaults(def).Minimatch } - function minimatch (p, pattern, options) { - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') } if (!options) options = {} // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { + if (!options.nocomment && pattern.charAt(0) === '#') { return false } // "" only matches "" - if (pattern.trim() === "") return p === "" + if (pattern.trim() === '') return p === '' return new Minimatch(pattern, options).match(p) } function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) + return new Minimatch(pattern, options) } - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') } if (!options) options = {} pattern = pattern.trim() - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - pattern = pattern.split("\\").join("/") + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') } - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) - this.options = options this.set = [] this.pattern = pattern @@ -167,7 +136,7 @@ function Minimatch (pattern, options) { this.make() } -Minimatch.prototype.debug = function() {} +Minimatch.prototype.debug = function () {} Minimatch.prototype.make = make function make () { @@ -178,7 +147,7 @@ function make () { var options = this.options // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { + if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true return } @@ -217,7 +186,7 @@ function make () { // filter out everything that didn't compile properly. set = set.filter(function (s) { - return -1 === s.indexOf(false) + return s.indexOf(false) === -1 }) this.debug(this.pattern, set) @@ -228,17 +197,17 @@ function make () { Minimatch.prototype.parseNegate = parseNegate function parseNegate () { var pattern = this.pattern - , negate = false - , options = this.options - , negateOffset = 0 + var negate = false + var options = this.options + var negateOffset = 0 if (options.nonegate) return - for ( var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === "!" - ; i ++) { + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { negate = !negate - negateOffset ++ + negateOffset++ } if (negateOffset) this.pattern = pattern.substr(negateOffset) @@ -256,213 +225,34 @@ function parseNegate () { // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() + return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand -function pad(n, width, z) { - z = z || '0'; - n = n + ''; - return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; -} - function braceExpand (pattern, options) { - options = options || this.options - pattern = typeof pattern === "undefined" + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' ? this.pattern : pattern - if (typeof pattern === "undefined") { - throw new Error("undefined pattern") + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') } if (options.nobrace || - !pattern.match(/\{.*\}/)) { + !pattern.match(/\{.*\}/)) { // shortcut. no need to expand. return [pattern] } - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - this.debug(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break - } - } - - // actually no sets, all { were escaped. - if (prefix === null) { - this.debug("no sets") - return [pattern] - } - - var tail = braceExpand.call(this, pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } - - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - this.debug("numset", numset[1], numset[2]) - var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) - , start = +numset[1] - , needPadding = numset[1][0] === '0' - , startWidth = numset[1].length - , padded - , end = +numset[2] - , inc = start > end ? -1 : 1 - , set = [] - - for (var i = start; i != (end + inc); i += inc) { - padded = needPadding ? pad(i, startWidth) : i + '' - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(padded + suf[ii]) - } - } - return set - } - - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } - - this.debug("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug("", i, c) - - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } - - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - this.debug("didn't close", pattern) - return braceExpand.call(this, "\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - this.debug("set", set) - this.debug("suffix", pattern.substr(i)) - var suf = braceExpand.call(this, pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - this.debug("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand.call(this, p, options) - }, this) - this.debug("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" - }) - } - - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) - } - } - return ret + return expand(pattern) } // parse a component of the expanded set. @@ -479,90 +269,93 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts - if (!options.noglobstar && pattern === "**") return GLOBSTAR - if (pattern === "") return "" - - var re = "" - , hasMagic = !!options.nocase - , escaping = false - // ? => one single character - , patternListStack = [] - , plType - , stateChar - , inClass = false - , reClassStart = -1 - , classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - , patternStart = pattern.charAt(0) === "." ? "" // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" - : "(?!\\.)" - , self = this + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this function clearStateChar () { if (stateChar) { // we had some state-tracking character // that wasn't consumed by this pass. switch (stateChar) { - case "*": + case '*': re += star hasMagic = true - break - case "?": + break + case '?': re += qmark hasMagic = true - break + break default: - re += "\\"+stateChar - break + re += '\\' + stateChar + break } self.debug('clearStateChar %j %j', stateChar, re) stateChar = false } } - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - this.debug("%s\t%s %s %j", pattern, i, re, c) + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) // skip over any that are escaped. if (escaping && reSpecials[c]) { - re += "\\" + c + re += '\\' + c escaping = false continue } - SWITCH: switch (c) { - case "/": + switch (c) { + case '/': // completely not allowed, even escaped. // Should already be path-split by now. return false - case "\\": + case '\\': clearStateChar() escaping = true - continue + continue // the various stateChar values // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) // all of those are literals inside a class, except that // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class') - if (c === "!" && i === classStart + 1) c = "^" + if (c === '!' && i === classStart + 1) c = '^' re += c continue } @@ -577,70 +370,68 @@ function parse (pattern, isSub) { // just clear the statechar *now*, rather than even diving into // the patternList stuff. if (options.noext) clearStateChar() - continue + continue - case "(": + case '(': if (inClass) { - re += "(" + re += '(' continue } if (!stateChar) { - re += "\\(" + re += '\\(' continue } - plType = stateChar - patternListStack.push({ type: plType - , start: i - 1 - , reStart: re.length }) + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) // negation is (?:(?!js)[^/]*) - re += stateChar === "!" ? "(?:(?!" : "(?:" + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false - continue + continue - case ")": + case ')': if (inClass || !patternListStack.length) { - re += "\\)" + re += '\\)' continue } clearStateChar() hasMagic = true - re += ")" - plType = patternListStack.pop().type + var pl = patternListStack.pop() // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case "!": - re += "[^/]*?)" - break - case "?": - case "+": - case "*": re += plType - case "@": break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } - continue + pl.reEnd = re.length + continue - case "|": + case '|': if (inClass || !patternListStack.length || escaping) { - re += "\\|" + re += '\\|' escaping = false continue } clearStateChar() - re += "|" - continue + re += '|' + continue // these are mostly the same in regexp and glob - case "[": + case '[': // swallow any state-tracking char before the [ clearStateChar() if (inClass) { - re += "\\" + c + re += '\\' + c continue } @@ -648,24 +439,47 @@ function parse (pattern, isSub) { classStart = i reClassStart = re.length re += c - continue + continue - case "]": + case ']': // a right bracket shall lose its special // meaning and represent itself in // a bracket expression if it occurs // first in the list. -- POSIX.2 2.8.3.2 if (i === classStart + 1 || !inClass) { - re += "\\" + c + re += '\\' + c escaping = false continue } + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + // finish up the class. hasMagic = true inClass = false re += c - continue + continue default: // swallow any state char that wasn't consumed @@ -675,8 +489,8 @@ function parse (pattern, isSub) { // no need escaping = false } else if (reSpecials[c] - && !(c === "^" && inClass)) { - re += "\\" + && !(c === '^' && inClass)) { + re += '\\' } re += c @@ -684,7 +498,6 @@ function parse (pattern, isSub) { } // switch } // for - // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" if (inClass) { @@ -692,9 +505,9 @@ function parse (pattern, isSub) { // this is a huge pita. We now have to re-walk // the contents of the would-be class to re-translate // any characters that were passed through as-is - var cs = pattern.substr(classStart + 1) - , sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + "\\[" + sp[0] + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] hasMagic = hasMagic || sp[1] } @@ -704,14 +517,14 @@ function parse (pattern, isSub) { // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. - var pl - while (pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. - $2 = "\\" + $2 = '\\' } // need to escape all those slashes *again*, without escaping the @@ -720,46 +533,81 @@ function parse (pattern, isSub) { // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. - return $1 + $1 + $2 + "|" + return $1 + $1 + $2 + '|' }) - this.debug("tail=%j\n %s", tail, tail) - var t = pl.type === "*" ? star - : pl.type === "?" ? qmark - : "\\" + pl.type + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type hasMagic = true - re = re.slice(0, pl.reStart) - + t + "\\(" - + tail + re = re.slice(0, pl.reStart) + t + '\\(' + tail } // handle trailing things that only matter at the very end. clearStateChar() if (escaping) { // trailing \\ - re += "\\\\" + re += '\\\\' } // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot var addPatternStart = false switch (re.charAt(0)) { - case ".": - case "[": - case "(": addPatternStart = true + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe } // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. - if (re !== "" && hasMagic) re = "(?=.)" + re + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } - if (addPatternStart) re = patternStart + re + if (addPatternStart) { + re = patternStart + re + } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { - return [ re, hasMagic ] + return [re, hasMagic] } // skip the regexp for non-magical patterns @@ -769,8 +617,16 @@ function parse (pattern, isSub) { return globUnescape(pattern) } - var flags = options.nocase ? "i" : "" - , regExp = new RegExp("^" + re + "$", flags) + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re @@ -794,34 +650,38 @@ function makeRe () { // when you just want to work with a regex. var set = this.set - if (!set.length) return this.regexp = false + if (!set.length) { + this.regexp = false + return this.regexp + } var options = this.options var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - , flags = options.nocase ? "i" : "" + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' var re = set.map(function (pattern) { return pattern.map(function (p) { return (p === GLOBSTAR) ? twoStar - : (typeof p === "string") ? regExpEscape(p) - : p._src - }).join("\\\/") - }).join("|") + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') // must match entire pattern // ending in a * or ** will make it less strict. - re = "^(?:" + re + ")$" + re = '^(?:' + re + ')$' // can match anything, as long as it's not this. - if (this.negate) re = "^(?!" + re + ").*$" + if (this.negate) re = '^(?!' + re + ').*$' try { - return this.regexp = new RegExp(re, flags) + this.regexp = new RegExp(re, flags) } catch (ex) { - return this.regexp = false + this.regexp = false } + return this.regexp } minimatch.match = function (list, pattern, options) { @@ -838,25 +698,24 @@ minimatch.match = function (list, pattern, options) { Minimatch.prototype.match = match function match (f, partial) { - this.debug("match", f, this.pattern) + this.debug('match', f, this.pattern) // short-circuit in the case of busted things. // comments, etc. if (this.comment) return false - if (this.empty) return f === "" + if (this.empty) return f === '' - if (f === "/" && partial) return true + if (f === '/' && partial) return true var options = this.options // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - f = f.split("\\").join("/") + if (path.sep !== '/') { + f = f.split(path.sep).join('/') } // treat the test path as a set of pathparts. f = f.split(slashSplit) - this.debug(this.pattern, "split", f) + this.debug(this.pattern, 'split', f) // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one @@ -864,17 +723,19 @@ function match (f, partial) { // Either way, return on the first hit. var set = this.set - this.debug(this.pattern, "set", set) + this.debug(this.pattern, 'set', set) // Find the basename of the path by looking for the last non-empty segment - var filename; - for (var i = f.length - 1; i >= 0; i--) { + var filename + var i + for (i = f.length - 1; i >= 0; i--) { filename = f[i] if (filename) break } - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i], file = f + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f if (options.matchBase && pattern.length === 1) { file = [filename] } @@ -899,23 +760,20 @@ function match (f, partial) { Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options - this.debug("matchOne", - { "this": this - , file: file - , pattern: pattern }) + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) - this.debug("matchOne", file.length, pattern.length) + this.debug('matchOne', file.length, pattern.length) - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - this.debug("matchOne loop") + ; fi++, pi++) { + this.debug('matchOne loop') var p = pattern[pi] - , f = file[fi] + var f = file[fi] this.debug(pattern, p, f) @@ -949,7 +807,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit var fr = fi - , pr = pi + 1 + var pr = pi + 1 if (pr === pl) { this.debug('** at the end') // a ** at the end will just swallow the rest. @@ -958,19 +816,18 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. - for ( ; fi < fl; fi ++) { - if (file[fi] === "." || file[fi] === ".." || - (!options.dot && file[fi].charAt(0) === ".")) return false + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false } return true } // ok, let's see if we can swallow whatever we can. - WHILE: while (fr < fl) { + while (fr < fl) { var swallowee = file[fr] - this.debug('\nglobstar while', - file, fr, pattern, pr, swallowee) + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { @@ -980,23 +837,24 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { } else { // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. - if (swallowee === "." || swallowee === ".." || - (!options.dot && swallowee.charAt(0) === ".")) { - this.debug("dot detected!", file, fr, pattern, pr) - break WHILE + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break } // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue') - fr ++ + fr++ } } + // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then if (partial) { // ran out of file - this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) if (fr === fl) return true } return false @@ -1006,16 +864,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. var hit - if (typeof p === "string") { + if (typeof p === 'string') { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase() } else { hit = f === p } - this.debug("string match", p, f, hit) + this.debug('string match', p, f, hit) } else { hit = f.match(p) - this.debug("pattern match", p, f, hit) + this.debug('pattern match', p, f, hit) } if (!hit) return false @@ -1047,27 +905,19 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') return emptyFileEnd } // should be unreachable. - throw new Error("wtf?") + throw new Error('wtf?') } - // replace stuff like \* with * function globUnescape (s) { - return s.replace(/\\(.)/g, "$1") + return s.replace(/\\(.)/g, '$1') } - function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } - -})( typeof require === "function" ? require : null, - this, - typeof module === "object" ? module : null, - typeof process === "object" ? process.platform : "win32" - ) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/README.md similarity index 99% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/index.js similarity index 90% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore similarity index 58% rename from deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore index 353546af2368e1..ae5d8c36ac6522 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -1,3 +1,5 @@ test .gitignore .travis.yml +Makefile +example.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md similarity index 90% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index 421f3aa5f951a2..08e918c0db9a62 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -1,6 +1,6 @@ # balanced-match -Match balanced string pairs, like `{` and `}` or `` and ``. +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! [![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) [![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) @@ -16,6 +16,7 @@ var balanced = require('balanced-match'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); ``` The matches are: @@ -28,6 +29,7 @@ $ node example.js pre: 'pre', body: 'first', post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } ``` ## API @@ -45,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -54,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js similarity index 80% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 75f3d71cba90bc..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -1,5 +1,8 @@ module.exports = balanced; function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + var r = range(a, b, str); return r && { @@ -11,6 +14,11 @@ function balanced(a, b, str) { }; } +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; @@ -22,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..d70555d007145d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.4.1 <0.5.0", + "_id": "balanced-match@0.4.2", + "_inCache": true, + "_installable": true, + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" + }, + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/minimatch/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "_shrinkwrap": null, + "_spec": "balanced-match@^0.4.1", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" + }, + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "0.4.2" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json similarity index 69% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json index 15acbe5c07ae55..5b79dacca0bb2e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -1,40 +1,49 @@ { "_args": [ [ - "concat-map@0.0.1", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + { + "raw": "concat-map@0.0.1", + "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion" ] ], "_from": "concat-map@0.0.1", "_id": "concat-map@0.0.1", "_inCache": true, "_installable": true, - "_location": "/node-gyp/glob/minimatch/brace-expansion/concat-map", + "_location": "/node-gyp/minimatch/brace-expansion/concat-map", "_npmUser": { - "email": "mail@substack.net", - "name": "substack" + "name": "substack", + "email": "mail@substack.net" }, "_npmVersion": "1.3.21", "_phantomChildren": {}, "_requested": { - "name": "concat-map", "raw": "concat-map@0.0.1", - "rawSpec": "0.0.1", "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", "spec": "0.0.1", "type": "version" }, "_requiredBy": [ - "/node-gyp/glob/minimatch/brace-expansion" + "/node-gyp/minimatch/brace-expansion" ], "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", "_shrinkwrap": null, "_spec": "concat-map@0.0.1", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion", "author": { - "email": "mail@substack.net", "name": "James Halliday", + "email": "mail@substack.net", "url": "http://substack.net" }, "bugs": { @@ -51,15 +60,15 @@ }, "dist": { "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" }, "homepage": "https://github.com/substack/node-concat-map", "keywords": [ "concat", "concatMap", + "map", "functional", - "higher-order", - "map" + "higher-order" ], "license": "MIT", "main": "index.js", @@ -80,30 +89,30 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": { - "chrome": [ - 10, - 22 - ], - "ff": [ - 10, - 15, - 3.5 - ], "ie": [ 6, 7, 8, 9 ], - "opera": [ - 12 + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 ], "safari": [ 5.1 + ], + "opera": [ + 12 ] - }, - "files": "test/*.js" + } }, "version": "0.0.1" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/package.json similarity index 61% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/package.json index fffa04e2966692..a936f86896c081 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,76 +1,85 @@ { "_args": [ [ - "brace-expansion@^1.0.0", - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch" + { + "raw": "brace-expansion@^1.0.0", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch" ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.3", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, - "_location": "/node-gyp/glob/minimatch/brace-expansion", - "_nodeVersion": "5.5.0", + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/node-gyp/glob/minimatch" + "/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", - "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, "dependencies": { - "balanced-match": "^0.3.0", + "balanced-match": "^0.4.1", "concat-map": "0.0.1" }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.4.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" } ], "name": "brace-expansion", @@ -85,6 +94,7 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -97,8 +107,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "1.1.3" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e472cc75fa..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml deleted file mode 100644 index 4af02b3d17e64c..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - '0.8' - - '0.10' - - '0.12' - - 'iojs' -before_install: - - npm install -g npm@latest diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS deleted file mode 100644 index 4a0bc5033a06e7..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +++ /dev/null @@ -1,14 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Brian Cottingham -Carlos Brito Lage -Jesse Dailey -Kevin O'Hara -Marco Rogers -Mark Cavage -Marko Mikulicic -Nathan Rajlich -Satheesh Natesan -Trent Mick -ashleybrener -n4kz diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index c06814e0414d56..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,137 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n) { return n * 2 } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Keys should always be Strings or Numbers - -Note: this module will print warnings to `console.error` if you use a -key that is not a String or Number. Because items are stored in an -object, which coerces keys to a string, it won't go well for you if -you try to use a key that is not a unique string, it'll cause surprise -collisions. For example: - -```JavaScript -// Bad Example! Dont' do this! -var cache = LRU() -var a = {} -var b = {} -cache.set(a, 'this is a') -cache.set(b, 'this is b') -console.log(cache.get(a)) // prints: 'this is b' -``` - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n){return n.length}`. The default is - `function(n){return 1}`, which is fine if you want to store `max` - like-sized things. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value, maxAge)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. `max` is optional and overrides the - cache `max` option if provided. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. - -* `length()` - - Return total length of objects in cache taking into account - `length` options function. - -* `itemCount` - - Return total quantity of objects currently in cache. Note, that - `stale` (see options) items are returned as part of this item - count. - -* `dump()` - - Return an array of the cache entries ready for serialization and usage - with 'destinationCache.load(arr)`. - -* `load(cacheEntriesArray)` - - Loads another cache entries array, obtained with `sourceCache.dump()`, - into the cache. The destination cache is reset before loading new entries diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 2bbe653be8ad08..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,334 +0,0 @@ -;(function () { // closure for web browsers - -if (typeof module === 'object' && module.exports) { - module.exports = LRUCache -} else { - // just set the global for non-node platforms. - this.LRUCache = LRUCache -} - -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function naiveLength () { return 1 } - -var didTypeWarning = false -function typeCheckKey(key) { - if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') { - didTypeWarning = true - console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack) - } -} - -function LRUCache (options) { - if (!(this instanceof LRUCache)) - return new LRUCache(options) - - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - this._max = options.max - // Kind of weird to have a default max of Infinity, but oh well. - if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) - this._max = Infinity - - this._lengthCalculator = options.length || naiveLength - if (typeof this._lengthCalculator !== "function") - this._lengthCalculator = naiveLength - - this._allowStale = options.stale || false - this._maxAge = options.maxAge || null - this._dispose = options.dispose - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - this._max = mL - if (this._length > this._max) trim(this) - } - , get : function () { return this._max } - , enumerable : true - }) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - this._lengthCalculator = naiveLength - this._length = this._itemCount - for (var key in this._cache) { - this._cache[key].length = 1 - } - } else { - this._lengthCalculator = lC - this._length = 0 - for (var key in this._cache) { - this._cache[key].length = this._lengthCalculator(this._cache[key].value) - this._length += this._cache[key].length - } - } - - if (this._length > this._max) trim(this) - } - , get : function () { return this._lengthCalculator } - , enumerable : true - }) - -Object.defineProperty(LRUCache.prototype, "length", - { get : function () { return this._length } - , enumerable : true - }) - - -Object.defineProperty(LRUCache.prototype, "itemCount", - { get : function () { return this._itemCount } - , enumerable : true - }) - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0 - var itemCount = this._itemCount - - for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) { - i++ - var hit = this._lruList[k] - if (isStale(this, hit)) { - del(this, hit) - if (!this._allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } -} - -LRUCache.prototype.keys = function () { - var keys = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - keys[i++] = hit.key - } - return keys -} - -LRUCache.prototype.values = function () { - var values = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - values[i++] = hit.value - } - return values -} - -LRUCache.prototype.reset = function () { - if (this._dispose && this._cache) { - for (var k in this._cache) { - this._dispose(k, this._cache[k].value) - } - } - - this._cache = Object.create(null) // hash of items by key - this._lruList = Object.create(null) // list of items in order of use recency - this._mru = 0 // most recently used - this._lru = 0 // least recently used - this._length = 0 // number of items in the list - this._itemCount = 0 -} - -LRUCache.prototype.dump = function () { - var arr = [] - var i = 0 - - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - if (!isStale(this, hit)) { - //Do not store staled hits - ++i - arr.push({ - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }); - } - } - //arr has the most read first - return arr -} - -LRUCache.prototype.dumpLru = function () { - return this._lruList -} - -LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || this._maxAge - typeCheckKey(key) - - var now = maxAge ? Date.now() : 0 - var len = this._lengthCalculator(value) - - if (hOP(this._cache, key)) { - if (len > this._max) { - del(this, this._cache[key]) - return false - } - // dispose of the old one before overwriting - if (this._dispose) - this._dispose(key, this._cache[key].value) - - this._cache[key].now = now - this._cache[key].maxAge = maxAge - this._cache[key].value = value - this._length += (len - this._cache[key].length) - this._cache[key].length = len - this.get(key) - - if (this._length > this._max) - trim(this) - - return true - } - - var hit = new Entry(key, value, this._mru++, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this._max) { - if (this._dispose) this._dispose(key, value) - return false - } - - this._length += hit.length - this._lruList[hit.lu] = this._cache[key] = hit - this._itemCount ++ - - if (this._length > this._max) - trim(this) - - return true -} - -LRUCache.prototype.has = function (key) { - typeCheckKey(key) - if (!hOP(this._cache, key)) return false - var hit = this._cache[key] - if (isStale(this, hit)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - typeCheckKey(key) - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - typeCheckKey(key) - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var hit = this._lruList[this._lru] - del(this, hit) - return hit || null -} - -LRUCache.prototype.del = function (key) { - typeCheckKey(key) - del(this, this._cache[key]) -} - -LRUCache.prototype.load = function (arr) { - //reset the cache - this.reset(); - - var now = Date.now() - //A previous serialized cache has the most recent items first - for (var l = arr.length - 1; l >= 0; l-- ) { - var hit = arr[l] - typeCheckKey(hit.k) - var expiresAt = hit.e || 0 - if (expiresAt === 0) { - //the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - } else { - var maxAge = expiresAt - now - //dont add already expired items - if (maxAge > 0) this.set(hit.k, hit.v, maxAge) - } - } -} - -function get (self, key, doUse) { - typeCheckKey(key) - var hit = self._cache[key] - if (hit) { - if (isStale(self, hit)) { - del(self, hit) - if (!self._allowStale) hit = undefined - } else { - if (doUse) use(self, hit) - } - if (hit) hit = hit.value - } - return hit -} - -function isStale(self, hit) { - if (!hit || (!hit.maxAge && !self._maxAge)) return false - var stale = false; - var diff = Date.now() - hit.now - if (hit.maxAge) { - stale = diff > hit.maxAge - } else { - stale = self._maxAge && (diff > self._maxAge) - } - return stale; -} - -function use (self, hit) { - shiftLU(self, hit) - hit.lu = self._mru ++ - self._lruList[hit.lu] = hit -} - -function trim (self) { - while (self._lru < self._mru && self._length > self._max) - del(self, self._lruList[self._lru]) -} - -function shiftLU (self, hit) { - delete self._lruList[ hit.lu ] - while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ -} - -function del (self, hit) { - if (hit) { - if (self._dispose) self._dispose(hit.key, hit.value) - self._length -= hit.length - self._itemCount -- - delete self._cache[ hit.key ] - shiftLU(self, hit) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, lu, length, now, maxAge) { - this.key = key - this.value = value - this.lu = lu - this.length = length - this.now = now - if (maxAge) this.maxAge = maxAge -} - -})() diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411b59ea1b1f4f..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_args": [ - [ - "lru-cache@2", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch" - ] - ], - "_from": "lru-cache@>=2.0.0 <3.0.0", - "_id": "lru-cache@2.7.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/minimatch/lru-cache", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "name": "lru-cache", - "raw": "lru-cache@2", - "rawSpec": "2", - "scope": null, - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/minimatch" - ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", - "_shrinkwrap": null, - "_spec": "lru-cache@2", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "dependencies": {}, - "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "tap": "^1.2.0", - "weak": "" - }, - "directories": {}, - "dist": { - "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" - }, - "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714", - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "keywords": [ - "cache", - "lru", - "mru" - ], - "license": "ISC", - "main": "lib/lru-cache.js", - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "name": "lru-cache", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "scripts": { - "test": "tap test --gc" - }, - "version": "2.7.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index b47225f109891f..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,396 +0,0 @@ -var test = require("tap").test - , LRU = require("../") - -test("basic", function (t) { - var cache = new LRU({max: 10}) - cache.set("key", "value") - t.equal(cache.get("key"), "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.length, 1) - t.equal(cache.max, 10) - t.end() -}) - -test("least recently set", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.get("a") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), "A") - t.end() -}) - -test("del", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.del("a") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("max", function (t) { - var cache = new LRU(3) - - // test changing the max, verify that the LRU items get dropped. - cache.max = 100 - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - - // now remove the max restriction, and try again. - cache.max = "hello" - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - // should trigger an immediate resize - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - t.end() -}) - -test("reset", function (t) { - var cache = new LRU(10) - cache.set("a", "A") - cache.set("b", "B") - cache.reset() - t.equal(cache.length, 0) - t.equal(cache.max, 10) - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.end() -}) - - -test("basic with weighed length", function (t) { - var cache = new LRU({ - max: 100, - length: function (item) { return item.size } - }) - cache.set("key", {val: "value", size: 50}) - t.equal(cache.get("key").val, "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.lengthCalculator(cache.get("key")), 50) - t.equal(cache.length, 50) - t.equal(cache.max, 100) - t.end() -}) - - -test("weighed length item too large", function (t) { - var cache = new LRU({ - max: 10, - length: function (item) { return item.size } - }) - t.equal(cache.max, 10) - - // should fall out immediately - cache.set("key", {val: "value", size: 50}) - - t.equal(cache.length, 0) - t.equal(cache.get("key"), undefined) - t.end() -}) - -test("least recently set with weighed length", function (t) { - var cache = new LRU({ - max:8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.set("d", "DDDD") - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("c"), "CCC") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.get("a") - cache.get("b") - cache.set("d", "DDDD") - t.equal(cache.get("c"), undefined) - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("b"), "BB") - t.equal(cache.get("a"), "A") - t.end() -}) - -test("lru recently updated with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - t.equal(cache.length, 6) //CCC BB A - cache.set("a", "+A") - t.equal(cache.length, 7) //+A CCC BB - cache.set("b", "++BB") - t.equal(cache.length, 6) //++BB +A - t.equal(cache.get("c"), undefined) - - cache.set("c", "oversized") - t.equal(cache.length, 6) //++BB +A - t.equal(cache.get("c"), undefined) - - cache.set("a", "oversized") - t.equal(cache.length, 4) //++BB - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), "++BB") - t.end() -}) - -test("set returns proper booleans", function(t) { - var cache = new LRU({ - max: 5, - length: function (item) { return item.length } - }) - - t.equal(cache.set("a", "A"), true) - - // should return false for max exceeded - t.equal(cache.set("b", "donuts"), false) - - t.equal(cache.set("b", "B"), true) - t.equal(cache.set("c", "CCCC"), true) - t.end() -}) - -test("drop the old items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A") - - setTimeout(function () { - cache.set("b", "b") - t.equal(cache.get("a"), "A") - }, 25) - - setTimeout(function () { - cache.set("c", "C") - // timed out - t.notOk(cache.get("a")) - }, 60 + 25) - - setTimeout(function () { - t.notOk(cache.get("b")) - t.equal(cache.get("c"), "C") - }, 90) - - setTimeout(function () { - t.notOk(cache.get("c")) - t.end() - }, 155) -}) - -test("individual item can have it's own maxAge", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A", 20) - setTimeout(function () { - t.notOk(cache.get("a")) - t.end() - }, 25) -}) - -test("individual item can have it's own maxAge > cache's", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 20 - }) - - cache.set("a", "A", 50) - setTimeout(function () { - t.equal(cache.get("a"), "A") - t.end() - }, 25) -}) - -test("disposal function", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - dispose: function (k, n) { - disposed = n - } - }) - - cache.set(1, 1) - cache.set(2, 2) - t.equal(disposed, 1) - cache.set(3, 3) - t.equal(disposed, 2) - cache.reset() - t.equal(disposed, 3) - t.end() -}) - -test("disposal function on too big of item", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - length: function (k) { - return k.length - }, - dispose: function (k, n) { - disposed = n - } - }) - var obj = [ 1, 2 ] - - t.equal(disposed, false) - cache.set("obj", obj) - t.equal(disposed, obj) - t.end() -}) - -test("has()", function(t) { - var cache = new LRU({ - max: 1, - maxAge: 10 - }) - - cache.set('foo', 'bar') - t.equal(cache.has('foo'), true) - cache.set('blu', 'baz') - t.equal(cache.has('foo'), false) - t.equal(cache.has('blu'), true) - setTimeout(function() { - t.equal(cache.has('blu'), false) - t.end() - }, 15) -}) - -test("stale", function(t) { - var cache = new LRU({ - maxAge: 10, - stale: true - }) - - cache.set('foo', 'bar') - t.equal(cache.get('foo'), 'bar') - t.equal(cache.has('foo'), true) - setTimeout(function() { - t.equal(cache.has('foo'), false) - t.equal(cache.get('foo'), 'bar') - t.equal(cache.get('foo'), undefined) - t.end() - }, 15) -}) - -test("lru update via set", function(t) { - var cache = LRU({ max: 2 }); - - cache.set('foo', 1); - cache.set('bar', 2); - cache.del('bar'); - cache.set('baz', 3); - cache.set('qux', 4); - - t.equal(cache.get('foo'), undefined) - t.equal(cache.get('bar'), undefined) - t.equal(cache.get('baz'), 3) - t.equal(cache.get('qux'), 4) - t.end() -}) - -test("least recently set w/ peek", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - t.equal(cache.peek("a"), "A") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("pop the least used item", function (t) { - var cache = new LRU(3) - , last - - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - - t.equal(cache.length, 3) - t.equal(cache.max, 3) - - // Ensure we pop a, c, b - cache.get("b", "B") - - last = cache.pop() - t.equal(last.key, "a") - t.equal(last.value, "A") - t.equal(cache.length, 2) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "c") - t.equal(last.value, "C") - t.equal(cache.length, 1) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "b") - t.equal(last.value, "B") - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last, null) - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index 4190417cbc61d8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,120 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('forEach', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 9 - l.forEach(function (val, key, cache) { - t.equal(cache, l) - t.equal(key, i.toString()) - t.equal(val, i.toString(2)) - i -= 1 - }) - - // get in order of most recently used - l.get(6) - l.get(8) - - var order = [ 8, 6, 9, 7, 5 ] - var i = 0 - - l.forEach(function (val, key, cache) { - var j = order[i ++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - t.equal(i, order.length); - - t.end() -}) - -test('keys() and values()', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - t.similar(l.keys(), ['9', '8', '7', '6', '5']) - t.similar(l.values(), ['1001', '1000', '111', '110', '101']) - - // get in order of most recently used - l.get(6) - l.get(8) - - t.similar(l.keys(), ['8', '6', '9', '7', '5']) - t.similar(l.values(), ['1000', '110', '1001', '111', '101']) - - t.end() -}) - -test('all entries are iterated over', function(t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 0 - l.forEach(function (val, key, cache) { - if (i > 0) { - cache.del(key) - } - i += 1 - }) - - t.equal(i, 5) - t.equal(l.keys().length, 1) - - t.end() -}) - -test('all stale entries are removed', function(t) { - var l = new LRU({ max: 5, maxAge: -5, stale: true }) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 0 - l.forEach(function () { - i += 1 - }) - - t.equal(i, 5) - t.equal(l.keys().length, 0) - - t.end() -}) - -test('expires', function (t) { - var l = new LRU({ - max: 10, - maxAge: 50 - }) - for (var i = 0; i < 10; i++) { - l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined)) - } - - var i = 0 - var order = [ 8, 6, 4, 2, 0 ] - setTimeout(function () { - l.forEach(function (val, key, cache) { - var j = order[i++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - t.equal(i, order.length); - - setTimeout(function () { - var count = 0; - l.forEach(function (val, key, cache) { count++; }) - t.equal(0, count); - t.end() - }, 25) - - }, 26) -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index b5912f6f168e5e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node --expose_gc - - -var weak = require('weak'); -var test = require('tap').test -var LRU = require('../') -var l = new LRU({ max: 10 }) -var refs = 0 -function X() { - refs ++ - weak(this, deref) -} - -function deref() { - refs -- -} - -test('no leaks', function (t) { - // fill up the cache - for (var i = 0; i < 100; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var start = process.memoryUsage() - - // capture the memory - var startRefs = refs - - // do it again, but more - for (var i = 0; i < 10000; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var end = process.memoryUsage() - t.equal(refs, startRefs, 'no leaky refs') - - console.error('start: %j\n' + - 'end: %j', start, end); - t.pass(); - t.end(); -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js deleted file mode 100644 index 5fe5dc3d371f1e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js +++ /dev/null @@ -1,215 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('dump', function (t) { - var cache = new LRU() - - t.equal(cache.dump().length, 0, "nothing in dump for empty cache") - - cache.set("a", "A") - cache.set("b", "B") - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 }, - { k: "a", v: "A", e: 0 } - ]) - - cache.set("a", "A"); - t.deepEqual(cache.dump(), [ - { k: "a", v: "A", e: 0 }, - { k: "b", v: "B", e: 0 } - ]) - - cache.get("b"); - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 }, - { k: "a", v: "A", e: 0 } - ]) - - cache.del("a"); - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 } - ]) - - t.end() -}) - -test("do not dump stale items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - //expires at 50 - cache.set("a", "A") - - setTimeout(function () { - //expires at 75 - cache.set("b", "B") - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "b") - t.equal(s[1].k, "a") - }, 25) - - setTimeout(function () { - //expires at 110 - cache.set("c", "C") - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "c") - t.equal(s[1].k, "b") - }, 60) - - setTimeout(function () { - //expires at 130 - cache.set("d", "D", 40) - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "d") - t.equal(s[1].k, "c") - }, 90) - - setTimeout(function () { - var s = cache.dump() - t.equal(s.length, 1) - t.equal(s[0].k, "d") - }, 120) - - setTimeout(function () { - var s = cache.dump() - t.deepEqual(s, []) - t.end() - }, 155) -}) - -test("load basic cache", function(t) { - var cache = new LRU(), - copy = new LRU() - - cache.set("a", "A") - cache.set("b", "B") - - copy.load(cache.dump()) - t.deepEquals(cache.dump(), copy.dump()) - - t.end() -}) - - -test("load staled cache", function(t) { - var cache = new LRU({maxAge: 50}), - copy = new LRU({maxAge: 50}), - arr - - //expires at 50 - cache.set("a", "A") - setTimeout(function () { - //expires at 80 - cache.set("b", "B") - arr = cache.dump() - t.equal(arr.length, 2) - }, 30) - - setTimeout(function () { - copy.load(arr) - t.equal(copy.get("a"), undefined) - t.equal(copy.get("b"), "B") - }, 60) - - setTimeout(function () { - t.equal(copy.get("b"), undefined) - t.end() - }, 90) -}) - -test("load to other size cache", function(t) { - var cache = new LRU({max: 2}), - copy = new LRU({max: 1}) - - cache.set("a", "A") - cache.set("b", "B") - - copy.load(cache.dump()) - t.equal(copy.get("a"), undefined) - t.equal(copy.get("b"), "B") - - //update the last read from original cache - cache.get("a") - copy.load(cache.dump()) - t.equal(copy.get("a"), "A") - t.equal(copy.get("b"), undefined) - - t.end() -}) - - -test("load to other age cache", function(t) { - var cache = new LRU({maxAge: 50}), - aged = new LRU({maxAge: 100}), - simple = new LRU(), - arr, - expired - - //created at 0 - //a would be valid till 0 + 50 - cache.set("a", "A") - setTimeout(function () { - //created at 20 - //b would be valid till 20 + 50 - cache.set("b", "B") - //b would be valid till 20 + 70 - cache.set("c", "C", 70) - arr = cache.dump() - t.equal(arr.length, 3) - }, 20) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), "B") - t.equal(cache.get("c"), "C") - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), "B") - t.equal(aged.get("c"), "C") - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), "B") - t.equal(simple.get("c"), "C") - }, 60) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.equal(cache.get("c"), "C") - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), undefined) - t.equal(aged.get("c"), "C") - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), undefined) - t.equal(simple.get("c"), "C") - }, 80) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.equal(cache.get("c"), undefined) - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), undefined) - t.equal(aged.get("c"), undefined) - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), undefined) - t.equal(simple.get("c"), undefined) - t.end() - }, 100) - -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 25a38a53fe2fea..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# sigmund - -Quick and dirty signatures for Objects. - -This is like a much faster `deepEquals` comparison, which returns a -string key suitable for caches and the like. - -## Usage - -```javascript -function doSomething (someObj) { - var key = sigmund(someObj, maxDepth) // max depth defaults to 10 - var cached = cache.get(key) - if (cached) return cached - - var result = expensiveCalculation(someObj) - cache.set(key, result) - return result -} -``` - -The resulting key will be as unique and reproducible as calling -`JSON.stringify` or `util.inspect` on the object, but is much faster. -In order to achieve this speed, some differences are glossed over. -For example, the object `{0:'foo'}` will be treated identically to the -array `['foo']`. - -Also, just as there is no way to summon the soul from the scribblings -of a cocaine-addled psychoanalyst, there is no way to revive the object -from the signature string that sigmund gives you. In fact, it's -barely even readable. - -As with `util.inspect` and `JSON.stringify`, larger objects will -produce larger signature strings. - -Because sigmund is a bit less strict than the more thorough -alternatives, the strings will be shorter, and also there is a -slightly higher chance for collisions. For example, these objects -have the same signature: - - var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} - var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -Like a good Freudian, sigmund is most effective when you already have -some understanding of what you're looking for. It can help you help -yourself, but you must be willing to do some work as well. - -Cycles are handled, and cyclical objects are silently omitted (though -the key is included in the signature output.) - -The second argument is the maximum depth, which defaults to 10, -because that is the maximum object traversal depth covered by most -insurance carriers. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d90de377..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// different ways to id objects -// use a req/res pair, since it's crazy deep and cyclical - -// sparseFE10 and sigmund are usually pretty close, which is to be expected, -// since they are essentially the same algorithm, except that sigmund handles -// regular expression objects properly. - - -var http = require('http') -var util = require('util') -var sigmund = require('./sigmund.js') -var sreq, sres, creq, cres, test - -http.createServer(function (q, s) { - sreq = q - sres = s - sres.end('ok') - this.close(function () { setTimeout(function () { - start() - }, 200) }) -}).listen(1337, function () { - creq = http.get({ port: 1337 }) - creq.on('response', function (s) { cres = s }) -}) - -function start () { - test = [sreq, sres, creq, cres] - // test = sreq - // sreq.sres = sres - // sreq.creq = creq - // sreq.cres = cres - - for (var i in exports.compare) { - console.log(i) - var hash = exports.compare[i]() - console.log(hash) - console.log(hash.length) - console.log('') - } - - require('bench').runMain() -} - -function customWs (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return customWs(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + customWs(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function custom (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return '' + obj - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return custom(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + custom(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function sparseFE2 (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k + ':' - ch(v[k], depth + 1) - }) - soFar += '}' - } - ch(obj, 0) - return soFar -} - -function sparseFE (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k - ch(v[k], depth + 1) - }) - } - ch(obj, 0) - return soFar -} - -function sparse (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k - ch(v[k], depth + 1) - } - } - ch(obj, 0) - return soFar -} - -function noCommas (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - - -function flatten (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - soFar += ',' - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - -exports.compare = -{ - // 'custom 2': function () { - // return custom(test, 2, 0) - // }, - // 'customWs 2': function () { - // return customWs(test, 2, 0) - // }, - 'JSON.stringify (guarded)': function () { - var seen = [] - return JSON.stringify(test, function (k, v) { - if (typeof v !== 'object' || !v) return v - if (seen.indexOf(v) !== -1) return undefined - seen.push(v) - return v - }) - }, - - 'flatten 10': function () { - return flatten(test, 10) - }, - - // 'flattenFE 10': function () { - // return flattenFE(test, 10) - // }, - - 'noCommas 10': function () { - return noCommas(test, 10) - }, - - 'sparse 10': function () { - return sparse(test, 10) - }, - - 'sparseFE 10': function () { - return sparseFE(test, 10) - }, - - 'sparseFE2 10': function () { - return sparseFE2(test, 10) - }, - - sigmund: function() { - return sigmund(test, 10) - }, - - - // 'util.inspect 1': function () { - // return util.inspect(test, false, 1, false) - // }, - // 'util.inspect undefined': function () { - // util.inspect(test) - // }, - // 'util.inspect 2': function () { - // util.inspect(test, false, 2, false) - // }, - // 'util.inspect 3': function () { - // util.inspect(test, false, 3, false) - // }, - // 'util.inspect 4': function () { - // util.inspect(test, false, 4, false) - // }, - // 'util.inspect Infinity': function () { - // util.inspect(test, false, Infinity, false) - // } -} - -/** results -**/ diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index b1dbae0a802671..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_args": [ - [ - "sigmund@~1.0.0", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch" - ] - ], - "_from": "sigmund@>=1.0.0 <1.1.0", - "_id": "sigmund@1.0.1", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/minimatch/sigmund", - "_nodeVersion": "2.0.1", - "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - "_npmVersion": "2.10.0", - "_phantomChildren": {}, - "_requested": { - "name": "sigmund", - "raw": "sigmund@~1.0.0", - "rawSpec": "~1.0.0", - "scope": null, - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/minimatch" - ], - "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", - "_shrinkwrap": null, - "_spec": "sigmund@~1.0.0", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/sigmund/issues" - }, - "dependencies": {}, - "description": "Quick and dirty signatures for Objects.", - "devDependencies": { - "tap": "~0.3.0" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", - "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" - }, - "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6", - "homepage": "https://github.com/isaacs/sigmund#readme", - "keywords": [ - "data", - "key", - "object", - "psychoanalysis", - "signature" - ], - "license": "ISC", - "main": "sigmund.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "sigmund", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund.git" - }, - "scripts": { - "bench": "node bench.js", - "test": "tap test/*.js" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8ce995b5..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = sigmund -function sigmund (subject, maxSessions) { - maxSessions = maxSessions || 10; - var notes = []; - var analysis = ''; - var RE = RegExp; - - function psychoAnalyze (subject, session) { - if (session > maxSessions) return; - - if (typeof subject === 'function' || - typeof subject === 'undefined') { - return; - } - - if (typeof subject !== 'object' || !subject || - (subject instanceof RE)) { - analysis += subject; - return; - } - - if (notes.indexOf(subject) !== -1 || session === maxSessions) return; - - notes.push(subject); - analysis += '{'; - Object.keys(subject).forEach(function (issue, _, __) { - // pseudo-private values. skip those. - if (issue.charAt(0) === '_') return; - var to = typeof subject[issue]; - if (to === 'function' || to === 'undefined') return; - analysis += issue; - psychoAnalyze(subject[issue], session + 1); - }); - } - psychoAnalyze(subject, 0); - return analysis; -} - -// vim: set softtabstop=4 shiftwidth=4: diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 6149a80239f059..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tap').test -var sigmund = require('../sigmund.js') - - -// occasionally there are duplicates -// that's an acceptable edge-case. JSON.stringify and util.inspect -// have some collision potential as well, though less, and collision -// detection is expensive. -var hash = '{abc/def/g{0h1i2{jkl' -var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} -var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -var obj3 = JSON.parse(JSON.stringify(obj1)) -obj3.c = /def/ -obj3.g[2].cycle = obj3 -var cycleHash = '{abc/def/g{0h1i2{jklcycle' - -test('basic', function (t) { - t.equal(sigmund(obj1), hash) - t.equal(sigmund(obj2), hash) - t.equal(sigmund(obj3), cycleHash) - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json index 2f0d2de57e663e..16b975354b41fc 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json @@ -1,67 +1,82 @@ { "_args": [ [ - "minimatch@1", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp" + { + "raw": "minimatch@^3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp" ] ], - "_from": "minimatch@>=1.0.0 <2.0.0", - "_id": "minimatch@1.0.0", + "_from": "minimatch@>=3.0.2 <4.0.0", + "_id": "minimatch@3.0.3", "_inCache": true, "_installable": true, - "_location": "/node-gyp/minimatch", + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "1.4.21", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "minimatch", - "raw": "minimatch@1", - "rawSpec": "1", + "raw": "minimatch@^3.0.2", "scope": null, - "spec": ">=1.0.0 <2.0.0", + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", "type": "range" }, "_requiredBy": [ - "/node-gyp" + "#USER", + "/" ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", - "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", "_shrinkwrap": null, - "_spec": "minimatch@1", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp", + "_spec": "minimatch@^3.0.2", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me" }, "bugs": { "url": "https://github.com/isaacs/minimatch/issues" }, "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" + "brace-expansion": "^1.0.0" }, "description": "a glob matcher in javascript", "devDependencies": { - "tap": "" + "standard": "^3.7.2", + "tap": "^5.6.0" }, "directories": {}, "dist": { - "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, "engines": { "node": "*" }, - "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", - "homepage": "https://github.com/isaacs/minimatch", - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - }, + "files": [ + "minimatch.js" + ], + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", "main": "minimatch.js", "maintainers": [ { @@ -77,7 +92,8 @@ "url": "git://github.com/isaacs/minimatch.git" }, "scripts": { + "posttest": "standard minimatch.js test/*.js", "test": "tap test/*.js" }, - "version": "1.0.0" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73c775edb..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - - -var patterns = - [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - // https://github.com/isaacs/minimatch/issues/5 - , function () { - files = [ 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' - , 'a/b/.x' - , 'a/b/.x/' - , 'a/.x/b' - , '.x' - , '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b/.x/c' - , '.x/.x' ] - } - , ["**/.x/**", [ '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b' - , 'a/b/.x/' - , 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' ] ] - - ] - -var regexps = - [ '/^(?:(?=.)a[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:\\*)$/', - '/^(?:(?=.)\\*[^/]*?)$/', - '/^(?:\\*\\*)$/', - '/^(?:(?=.)b[^/]*?\\/)$/', - '/^(?:(?=.)c[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', - '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', - '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', - '/^(?:(?=.)a[^/]*?[^c])$/', - '/^(?:(?=.)a[X-]b)$/', - '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', - '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[^/]c)$/', - '/^(?:a\\*c)$/', - 'false', - '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', - '/^(?:man\\/man1\\/bash\\.1)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[-abc])$/', - '/^(?:(?!\\.)(?=.)[abc-])$/', - '/^(?:\\\\)$/', - '/^(?:(?!\\.)(?=.)[\\\\])$/', - '/^(?:(?!\\.)(?=.)[\\[])$/', - '/^(?:\\[)$/', - '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[\\]])$/', - '/^(?:(?!\\.)(?=.)[\\]-])$/', - '/^(?:(?!\\.)(?=.)[a-z])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:\\[\\])$/', - '/^(?:\\[abc)$/', - '/^(?:(?=.)XYZ)$/i', - '/^(?:(?=.)ab[^/]*?)$/i', - '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', - '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', - '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', - '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', - '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', - '/^(?:(?=.)a[^/]b)$/', - '/^(?:(?=.)#[^/]*?)$/', - '/^(?!^(?:(?=.)a[^/]*?)$).*$/', - '/^(?:(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)a[^/]*?)$/', - '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] -var re = 0; - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - patterns.forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var m = new mm.Minimatch(pattern, options) - var r = m.makeRe() - var expectRe = regexps[re++] - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - - t.equal(tapOpts.re, expectRe, tapOpts) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index c3e19d9baf571b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,38 +0,0 @@ -var tap = require("tap") - , minimatch = require("../") - -tap.test("brace expansion", function (t) { - // [ pattern, [expanded] ] - ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" - , [ "abxy" - , "abxz" - , "acdxy" - , "acdxz" - , "acexy" - , "acexz" - , "afhxy" - , "afhxz" - , "aghxy" - , "aghxz" ] ] - , [ "a{1..5}b" - , [ "a1b" - , "a2b" - , "a3b" - , "a4b" - , "a5b" ] ] - , [ "a{b}c", ["a{b}c"] ] - , [ "a{00..05}b" - , ["a00b" - ,"a01b" - ,"a02b" - ,"a03b" - ,"a04b" - ,"a05b" ] ] - ].forEach(function (tc) { - var p = tc[0] - , expect = tc[1] - t.equivalent(minimatch.braceExpand(p), expect, p) - }) - console.error("ending") - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0fad0bf8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -var Minimatch = require("../minimatch.js").Minimatch -var tap = require("tap") -tap.test("cache test", function (t) { - var mm1 = new Minimatch("a?b") - var mm2 = new Minimatch("a?b") - t.equal(mm1, mm2, "should get the same object") - // the lru should drop it after 100 entries - for (var i = 0; i < 100; i ++) { - new Minimatch("a"+i) - } - mm2 = new Minimatch("a?b") - t.notEqual(mm1, mm2, "cache should have dropped") - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 75e05712d4c841..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - ; [ "http://www.bashcookbook.com/bashinfo" + - "/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - ].forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var Class = mm.defaults(options).Minimatch - var m = new Class(pattern, {}) - var r = m.makeRe() - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js deleted file mode 100644 index 6676e2629a7e99..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js +++ /dev/null @@ -1,8 +0,0 @@ -var test = require('tap').test -var minimatch = require('../') - -test('extglob ending with statechar', function(t) { - t.notOk(minimatch('ax', 'a?(b*)')) - t.ok(minimatch('ax', '?(a*|b)')) - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/CHANGELOG.md new file mode 100644 index 00000000000000..f549a1f3de81e3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/CHANGELOG.md @@ -0,0 +1,36 @@ +### v3.1.2 + +* Update to `gauge@1.6.0` adding support for default values for template + items. + +### v3.1.1 + +* Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to + when a progress bar is enabled. In `1.x` if you didn't have a TTY the + progress bar was never shown. In `2.x` it merely defaults to disabled, + but you can enable it explicitly if you still want progress updates. + +### v3.1.0 + +* Update to `gauge@2.5.2`: + * Updates the `signal-exit` dependency which fixes an incompatibility with + the node profiler. + * Uses externalizes its ansi code generation in `console-control-strings` +* Make the default progress bar include the last line printed, colored as it + would be when printing to a tty. + +### v3.0.0 + +* Switch to `gauge@2.0.0`, for better performance, better look. +* Set stderr/stdout blocking if they're tty's, so that we can hide a + progress bar going to stderr and then safely print to stdout. Without + this the two can end up overlapping producing confusing and sometimes + corrupted output. + +### v2.0.0 + +* Make the `error` event non-fatal so that folks can use it as a prefix. + +### v1.0.0 + +* Add progress bar with `gauge@1.1.0` diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md index a57cf429d4a6fa..dba35501614e91 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md @@ -98,7 +98,13 @@ Disable the use of unicode in the progress bar. ## log.setGaugeTemplate(template) -Overrides the default gauge template. +Set a template for outputting the progress bar. See the [gauge documentation] for details. + +[gauge documentation]: https://npmjs.com/package/gauge + +## log.setGaugeThemeset(themes) + +Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details. ## log.pause() @@ -193,3 +199,12 @@ following fields: * `prefix` {String} * `message` {String} Result of `util.format()` * `messageRaw` {Array} Arguments to `util.format()` + +# Blocking TTYs + +We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set +stderr and stdout blocking if they are tty's and have the setBlocking call. +This is a work around for an issue in early versions of Node.js 6.x, which +made stderr and stdout non-blocking on OSX. (They are always blocking +Windows and were never blocking on Linux.) `npmlog` needs them to be blocking +so that it can allow output to stdout and stderr to be interlaced. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js index 8d781f17319084..e5b70f1f80b743 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js @@ -2,49 +2,76 @@ var Progress = require('are-we-there-yet') var Gauge = require('gauge') var EE = require('events').EventEmitter -var log = exports = module.exports = new EE +var log = exports = module.exports = new EE() var util = require('util') -var ansi = require('ansi') -log.cursor = ansi(process.stderr) -log.stream = process.stderr +var setBlocking = require('set-blocking') +var consoleControl = require('console-control-strings') + +setBlocking(true) +var stream = process.stderr +Object.defineProperty(log, 'stream', { + set: function (newStream) { + stream = newStream + if (this.gauge) this.gauge.setWriteTo(stream, stream) + }, + get: function () { + return stream + } +}) + +// by default, decide based on tty-ness. +var colorEnabled +log.useColor = function () { + return colorEnabled != null ? colorEnabled : stream.isTTY +} -// by default, let ansi decide based on tty-ness. -var colorEnabled = undefined log.enableColor = function () { colorEnabled = true - this.cursor.enabled = true + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) } log.disableColor = function () { colorEnabled = false - this.cursor.enabled = false + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) } // default level log.level = 'info' -log.gauge = new Gauge(log.cursor) +log.gauge = new Gauge(stream, { + theme: {hasColor: log.useColor()}, + template: [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', default: ''}, + ':', + {type: 'logline', kerning: 1, default: ''} + ] +}) + log.tracker = new Progress.TrackerGroup() // no progress bars unless asked log.progressEnabled = false -var gaugeTheme = undefined +var unicodeEnabled log.enableUnicode = function () { - gaugeTheme = Gauge.unicode - log.gauge.setTheme(gaugeTheme) + unicodeEnabled = true + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) } log.disableUnicode = function () { - gaugeTheme = Gauge.ascii - log.gauge.setTheme(gaugeTheme) + unicodeEnabled = false + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.setGaugeThemeset = function (themes) { + this.gauge.setThemeset(themes) } -var gaugeTemplate = undefined log.setGaugeTemplate = function (template) { - gaugeTemplate = template - log.gauge.setTemplate(gaugeTemplate) + this.gauge.setTemplate(template) } log.enableProgress = function () { @@ -95,15 +122,26 @@ trackerConstructors.forEach(function (C) { log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) } }) -log.clearProgress = function () { - if (!this.progressEnabled) return - this.gauge.hide() +log.clearProgress = function (cb) { + if (!this.progressEnabled) return cb && process.nextTick(cb) + this.gauge.hide(cb) } log.showProgress = function (name, completed) { if (!this.progressEnabled) return - if (completed == null) completed = this.tracker.completed() - this.gauge.show(name, completed) + var values = {} + if (name) values.section = name + var last = log.record[log.record.length - 1] + if (last) { + values.subsection = last.prefix + var disp = log.disp[last.level] || last.level + var logline = this._format(disp, log.style[last.level]) + if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle) + logline += ' ' + last.message.split(/\r?\n/)[0] + values.logline = logline + } + values.completed = completed || this.tracker.completed() + this.gauge.show(values) }.bind(log) // bind for use in tracker's on-change listener // temporarily stop emitting, but don't drop @@ -137,8 +175,8 @@ log.log = function (lvl, prefix, message) { var a = new Array(arguments.length - 2) var stack = null - for (var i = 2; i < arguments.length; i ++) { - var arg = a[i-2] = arguments[i] + for (var i = 2; i < arguments.length; i++) { + var arg = a[i - 2] = arguments[i] // resolve stack traces to a plain string. if (typeof arg === 'object' && arg && @@ -181,7 +219,6 @@ log.emitLog = function (m) { if (l < this.levels[this.level]) return if (l > 0 && !isFinite(l)) return - var style = log.style[m.level] var disp = log.disp[m.level] || m.level this.clearProgress() m.message.split(/\r?\n/).forEach(function (line) { @@ -198,38 +235,48 @@ log.emitLog = function (m) { this.showProgress() } -log.write = function (msg, style) { - if (!this.cursor) return - if (this.stream !== this.cursor.stream) { - this.cursor = ansi(this.stream, { enabled: colorEnabled }) - var options = {} - if (gaugeTheme != null) options.theme = gaugeTheme - if (gaugeTemplate != null) options.template = gaugeTemplate - this.gauge = new Gauge(options, this.cursor) +log._format = function (msg, style) { + if (!stream) return + + var output = '' + if (this.useColor()) { + style = style || {} + var settings = [] + if (style.fg) settings.push(style.fg) + if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) + if (style.bold) settings.push('bold') + if (style.underline) settings.push('underline') + if (style.inverse) settings.push('inverse') + if (settings.length) output += consoleControl.color(settings) + if (style.beep) output += consoleControl.beep() } + output += msg + if (this.useColor()) { + output += consoleControl.color('reset') + } + return output +} - style = style || {} - if (style.fg) this.cursor.fg[style.fg]() - if (style.bg) this.cursor.bg[style.bg]() - if (style.bold) this.cursor.bold() - if (style.underline) this.cursor.underline() - if (style.inverse) this.cursor.inverse() - if (style.beep) this.cursor.beep() - this.cursor.write(msg).reset() +log.write = function (msg, style) { + if (!stream) return + + stream.write(this._format(msg, style)) } log.addLevel = function (lvl, n, style, disp) { if (!disp) disp = lvl this.levels[lvl] = n this.style[lvl] = style - if (!this[lvl]) this[lvl] = function () { - var a = new Array(arguments.length + 1) - a[0] = lvl - for (var i = 0; i < arguments.length; i ++) { - a[i + 1] = arguments[i] - } - return this.log.apply(this, a) - }.bind(this) + if (!this[lvl]) { + this[lvl] = function () { + var a = new Array(arguments.length + 1) + a[0] = lvl + for (var i = 0; i < arguments.length; i++) { + a[i + 1] = arguments[i] + } + return this.log.apply(this, a) + }.bind(this) + } this.disp[lvl] = disp } @@ -248,4 +295,4 @@ log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') log.addLevel('silent', Infinity) // allow 'error' prefix -log.on('error', function(){}) +log.on('error', function () {}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/History.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/History.md deleted file mode 100644 index aea8aaf0991e70..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/History.md +++ /dev/null @@ -1,23 +0,0 @@ - -0.3.1 / 2016-01-14 -================== - - * add MIT LICENSE file (#23, @kasicka) - * preserve chaining after redundant style-method calls (#19, @drewblaisdell) - * package: add "license" field (#16, @BenjaminTsai) - -0.3.0 / 2014-05-09 -================== - - * package: remove "test" script and "devDependencies" - * package: remove "engines" section - * pacakge: remove "bin" section - * package: beautify - * examples: remove `starwars` example (#15) - * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch) - * add `.jshintrc` file - -< 0.3.0 -======= - - * Prehistoric diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/LICENSE deleted file mode 100644 index 2ea4dc5efb8729..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/README.md deleted file mode 100644 index 6ce19403c4c466..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/README.md +++ /dev/null @@ -1,98 +0,0 @@ -ansi.js -========= -### Advanced ANSI formatting tool for Node.js - -`ansi.js` is a module for Node.js that provides an easy-to-use API for -writing ANSI escape codes to `Stream` instances. ANSI escape codes are used to do -fancy things in a terminal window, like render text in colors, delete characters, -lines, the entire window, or hide and show the cursor, and lots more! - -#### Features: - - * 256 color support for the terminal! - * Make a beep sound from your terminal! - * Works with *any* writable `Stream` instance. - * Allows you to move the cursor anywhere on the terminal window. - * Allows you to delete existing contents from the terminal window. - * Allows you to hide and show the cursor. - * Converts CSS color codes and RGB values into ANSI escape codes. - * Low-level; you are in control of when escape codes are used, it's not abstracted. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install ansi -``` - - -Example -------- - -``` js -var ansi = require('ansi') - , cursor = ansi(process.stdout) - -// You can chain your calls forever: -cursor - .red() // Set font color to red - .bg.grey() // Set background color to grey - .write('Hello World!') // Write 'Hello World!' to stdout - .bg.reset() // Reset the bgcolor before writing the trailing \n, - // to avoid Terminal glitches - .write('\n') // And a final \n to wrap things up - -// Rendering modes are persistent: -cursor.hex('#660000').bold().underline() - -// You can use the regular logging functions, text will be green: -console.log('This is blood red, bold text') - -// To reset just the foreground color: -cursor.fg.reset() - -console.log('This will still be bold') - -// to go to a location (x,y) on the console -// note: 1-indexed, not 0-indexed: -cursor.goto(10, 5).write('Five down, ten over') - -// to clear the current line: -cursor.horizontalAbsolute(0).eraseLine().write('Starting again') - -// to go to a different column on the current line: -cursor.horizontalAbsolute(5).write('column five') - -// Clean up after yourself! -cursor.reset() -``` - - -License -------- - -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> - -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/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js deleted file mode 100755 index c1ec929d0bf8a6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -/** - * Invokes the terminal "beep" sound once per second on every exact second. - */ - -process.title = 'beep' - -var cursor = require('../../')(process.stdout) - -function beep () { - cursor.beep() - setTimeout(beep, 1000 - (new Date()).getMilliseconds()) -} - -setTimeout(beep, 1000 - (new Date()).getMilliseconds()) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/clear/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/clear/index.js deleted file mode 100755 index 6ac21ffa99f87a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/clear/index.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node - -/** - * Like GNU ncurses "clear" command. - * https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c - */ - -process.title = 'clear' - -function lf () { return '\n' } - -require('../../')(process.stdout) - .write(Array.apply(null, Array(process.stdout.getWindowSize()[1])).map(lf).join('')) - .eraseData(2) - .goto(1, 1) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js deleted file mode 100755 index 50f964490ea1ea..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node - -var tty = require('tty') -var cursor = require('../')(process.stdout) - -// listen for the queryPosition report on stdin -process.stdin.resume() -raw(true) - -process.stdin.once('data', function (b) { - var match = /\[(\d+)\;(\d+)R$/.exec(b.toString()) - if (match) { - var xy = match.slice(1, 3).reverse().map(Number) - console.error(xy) - } - - // cleanup and close stdin - raw(false) - process.stdin.pause() -}) - - -// send the query position request code to stdout -cursor.queryPosition() - -function raw (mode) { - if (process.stdin.setRawMode) { - process.stdin.setRawMode(mode) - } else { - tty.setRawMode(mode) - } -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/progress/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/progress/index.js deleted file mode 100644 index d28dbda27f93d2..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/progress/index.js +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env node - -var assert = require('assert') - , ansi = require('../../') - -function Progress (stream, width) { - this.cursor = ansi(stream) - this.delta = this.cursor.newlines - this.width = width | 0 || 10 - this.open = '[' - this.close = ']' - this.complete = '█' - this.incomplete = '_' - - // initial render - this.progress = 0 -} - -Object.defineProperty(Progress.prototype, 'progress', { - get: get - , set: set - , configurable: true - , enumerable: true -}) - -function get () { - return this._progress -} - -function set (v) { - this._progress = Math.max(0, Math.min(v, 100)) - - var w = this.width - this.complete.length - this.incomplete.length - , n = w * (this._progress / 100) | 0 - , i = w - n - , com = c(this.complete, n) - , inc = c(this.incomplete, i) - , delta = this.cursor.newlines - this.delta - - assert.equal(com.length + inc.length, w) - - if (delta > 0) { - this.cursor.up(delta) - this.delta = this.cursor.newlines - } - - this.cursor - .horizontalAbsolute(0) - .eraseLine(2) - .fg.white() - .write(this.open) - .fg.grey() - .bold() - .write(com) - .resetBold() - .write(inc) - .fg.white() - .write(this.close) - .fg.reset() - .write('\n') -} - -function c (char, length) { - return Array.apply(null, Array(length)).map(function () { - return char - }).join('') -} - - - - -// Usage -var width = parseInt(process.argv[2], 10) || process.stdout.getWindowSize()[0] / 2 - , p = new Progress(process.stdout, width) - -;(function tick () { - p.progress += Math.random() * 5 - p.cursor - .eraseLine(2) - .write('Progress: ') - .bold().write(p.progress.toFixed(2)) - .write('%') - .resetBold() - .write('\n') - if (p.progress < 100) - setTimeout(tick, 100) -})() diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/ansi.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/ansi.js deleted file mode 100644 index b1714e328995c1..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/ansi.js +++ /dev/null @@ -1,405 +0,0 @@ - -/** - * References: - * - * - http://en.wikipedia.org/wiki/ANSI_escape_code - * - http://www.termsys.demon.co.uk/vtansi.htm - * - */ - -/** - * Module dependencies. - */ - -var emitNewlineEvents = require('./newlines') - , prefix = '\x1b[' // For all escape codes - , suffix = 'm' // Only for color codes - -/** - * The ANSI escape sequences. - */ - -var codes = { - up: 'A' - , down: 'B' - , forward: 'C' - , back: 'D' - , nextLine: 'E' - , previousLine: 'F' - , horizontalAbsolute: 'G' - , eraseData: 'J' - , eraseLine: 'K' - , scrollUp: 'S' - , scrollDown: 'T' - , savePosition: 's' - , restorePosition: 'u' - , queryPosition: '6n' - , hide: '?25l' - , show: '?25h' -} - -/** - * Rendering ANSI codes. - */ - -var styles = { - bold: 1 - , italic: 3 - , underline: 4 - , inverse: 7 -} - -/** - * The negating ANSI code for the rendering modes. - */ - -var reset = { - bold: 22 - , italic: 23 - , underline: 24 - , inverse: 27 -} - -/** - * The standard, styleable ANSI colors. - */ - -var colors = { - white: 37 - , black: 30 - , blue: 34 - , cyan: 36 - , green: 32 - , magenta: 35 - , red: 31 - , yellow: 33 - , grey: 90 - , brightBlack: 90 - , brightRed: 91 - , brightGreen: 92 - , brightYellow: 93 - , brightBlue: 94 - , brightMagenta: 95 - , brightCyan: 96 - , brightWhite: 97 -} - - -/** - * Creates a Cursor instance based off the given `writable stream` instance. - */ - -function ansi (stream, options) { - if (stream._ansicursor) { - return stream._ansicursor - } else { - return stream._ansicursor = new Cursor(stream, options) - } -} -module.exports = exports = ansi - -/** - * The `Cursor` class. - */ - -function Cursor (stream, options) { - if (!(this instanceof Cursor)) { - return new Cursor(stream, options) - } - if (typeof stream != 'object' || typeof stream.write != 'function') { - throw new Error('a valid Stream instance must be passed in') - } - - // the stream to use - this.stream = stream - - // when 'enabled' is false then all the functions are no-ops except for write() - this.enabled = options && options.enabled - if (typeof this.enabled === 'undefined') { - this.enabled = stream.isTTY - } - this.enabled = !!this.enabled - - // then `buffering` is true, then `write()` calls are buffered in - // memory until `flush()` is invoked - this.buffering = !!(options && options.buffering) - this._buffer = [] - - // controls the foreground and background colors - this.fg = this.foreground = new Colorer(this, 0) - this.bg = this.background = new Colorer(this, 10) - - // defaults - this.Bold = false - this.Italic = false - this.Underline = false - this.Inverse = false - - // keep track of the number of "newlines" that get encountered - this.newlines = 0 - emitNewlineEvents(stream) - stream.on('newline', function () { - this.newlines++ - }.bind(this)) -} -exports.Cursor = Cursor - -/** - * Helper function that calls `write()` on the underlying Stream. - * Returns `this` instead of the write() return value to keep - * the chaining going. - */ - -Cursor.prototype.write = function (data) { - if (this.buffering) { - this._buffer.push(arguments) - } else { - this.stream.write.apply(this.stream, arguments) - } - return this -} - -/** - * Buffer `write()` calls into memory. - * - * @api public - */ - -Cursor.prototype.buffer = function () { - this.buffering = true - return this -} - -/** - * Write out the in-memory buffer. - * - * @api public - */ - -Cursor.prototype.flush = function () { - this.buffering = false - var str = this._buffer.map(function (args) { - if (args.length != 1) throw new Error('unexpected args length! ' + args.length); - return args[0]; - }).join(''); - this._buffer.splice(0); // empty - this.write(str); - return this -} - - -/** - * The `Colorer` class manages both the background and foreground colors. - */ - -function Colorer (cursor, base) { - this.current = null - this.cursor = cursor - this.base = base -} -exports.Colorer = Colorer - -/** - * Write an ANSI color code, ensuring that the same code doesn't get rewritten. - */ - -Colorer.prototype._setColorCode = function setColorCode (code) { - var c = String(code) - if (this.current === c) return - this.cursor.enabled && this.cursor.write(prefix + c + suffix) - this.current = c - return this -} - - -/** - * Set up the positional ANSI codes. - */ - -Object.keys(codes).forEach(function (name) { - var code = String(codes[name]) - Cursor.prototype[name] = function () { - var c = code - if (arguments.length > 0) { - c = toArray(arguments).map(Math.round).join(';') + code - } - this.enabled && this.write(prefix + c) - return this - } -}) - -/** - * Set up the functions for the rendering ANSI codes. - */ - -Object.keys(styles).forEach(function (style) { - var name = style[0].toUpperCase() + style.substring(1) - , c = styles[style] - , r = reset[style] - - Cursor.prototype[style] = function () { - if (this[name]) return this - this.enabled && this.write(prefix + c + suffix) - this[name] = true - return this - } - - Cursor.prototype['reset' + name] = function () { - if (!this[name]) return this - this.enabled && this.write(prefix + r + suffix) - this[name] = false - return this - } -}) - -/** - * Setup the functions for the standard colors. - */ - -Object.keys(colors).forEach(function (color) { - var code = colors[color] - - Colorer.prototype[color] = function () { - this._setColorCode(this.base + code) - return this.cursor - } - - Cursor.prototype[color] = function () { - return this.foreground[color]() - } -}) - -/** - * Makes a beep sound! - */ - -Cursor.prototype.beep = function () { - this.enabled && this.write('\x07') - return this -} - -/** - * Moves cursor to specific position - */ - -Cursor.prototype.goto = function (x, y) { - x = x | 0 - y = y | 0 - this.enabled && this.write(prefix + y + ';' + x + 'H') - return this -} - -/** - * Resets the color. - */ - -Colorer.prototype.reset = function () { - this._setColorCode(this.base + 39) - return this.cursor -} - -/** - * Resets all ANSI formatting on the stream. - */ - -Cursor.prototype.reset = function () { - this.enabled && this.write(prefix + '0' + suffix) - this.Bold = false - this.Italic = false - this.Underline = false - this.Inverse = false - this.foreground.current = null - this.background.current = null - return this -} - -/** - * Sets the foreground color with the given RGB values. - * The closest match out of the 216 colors is picked. - */ - -Colorer.prototype.rgb = function (r, g, b) { - var base = this.base + 38 - , code = rgb(r, g, b) - this._setColorCode(base + ';5;' + code) - return this.cursor -} - -/** - * Same as `cursor.fg.rgb(r, g, b)`. - */ - -Cursor.prototype.rgb = function (r, g, b) { - return this.foreground.rgb(r, g, b) -} - -/** - * Accepts CSS color codes for use with ANSI escape codes. - * For example: `#FF000` would be bright red. - */ - -Colorer.prototype.hex = function (color) { - return this.rgb.apply(this, hex(color)) -} - -/** - * Same as `cursor.fg.hex(color)`. - */ - -Cursor.prototype.hex = function (color) { - return this.foreground.hex(color) -} - - -// UTIL FUNCTIONS // - -/** - * Translates a 255 RGB value to a 0-5 ANSI RGV value, - * then returns the single ANSI color code to use. - */ - -function rgb (r, g, b) { - var red = r / 255 * 5 - , green = g / 255 * 5 - , blue = b / 255 * 5 - return rgb5(red, green, blue) -} - -/** - * Turns rgb 0-5 values into a single ANSI color code to use. - */ - -function rgb5 (r, g, b) { - var red = Math.round(r) - , green = Math.round(g) - , blue = Math.round(b) - return 16 + (red*36) + (green*6) + blue -} - -/** - * Accepts a hex CSS color code string (# is optional) and - * translates it into an Array of 3 RGB 0-255 values, which - * can then be used with rgb(). - */ - -function hex (color) { - var c = color[0] === '#' ? color.substring(1) : color - , r = c.substring(0, 2) - , g = c.substring(2, 4) - , b = c.substring(4, 6) - return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)] -} - -/** - * Turns an array-like object into a real array. - */ - -function toArray (a) { - var i = 0 - , l = a.length - , rtn = [] - for (; i 0) { - var len = data.length - , i = 0 - // now try to calculate any deltas - if (typeof data == 'string') { - for (; i=0.3.1 <0.4.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/npmlog" - ], - [ - { - "name": "ansi", - "raw": "ansi@~0.3.1", - "rawSpec": "~0.3.1", - "scope": null, - "spec": ">=0.3.1 <0.4.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog" - ] - ], - "_from": "ansi@~0.3.1", - "_id": "ansi@0.3.1", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/ansi", - "_nodeVersion": "5.3.0", - "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "name": "ansi", - "raw": "ansi@~0.3.1", - "rawSpec": "~0.3.1", - "scope": null, - "spec": ">=0.3.1 <0.4.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog", - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", - "_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", - "_shrinkwrap": null, - "_spec": "ansi@~0.3.1", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog", - "author": { - "email": "nathan@tootallnate.net", - "name": "Nathan Rajlich", - "url": "http://tootallnate.net" - }, - "bugs": { - "url": "https://github.com/TooTallNate/ansi.js/issues" - }, - "dependencies": {}, - "description": "Advanced ANSI formatting tool for Node.js", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", - "tarball": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz" - }, - "gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246", - "homepage": "https://github.com/TooTallNate/ansi.js#readme", - "keywords": [ - "ansi", - "formatting", - "cursor", - "color", - "terminal", - "rgb", - "256", - "stream" - ], - "license": "MIT", - "main": "./lib/ansi.js", - "maintainers": [ - { - "email": "nathan@tootallnate.net", - "name": "TooTallNate" - }, - { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - } - ], - "name": "ansi", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/ansi.js.git" - }, - "scripts": {}, - "version": "0.3.1" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md index f8789800aa784c..c41d39229244d2 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -25,7 +25,7 @@ single.completeWork(20) console.log(top.completed()) // 0.2 fs.stat("file", function(er, stat) { - if (er) throw er + if (er) throw er var stream = top.newStream("file", stat.size) console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete // and 50% * 20% == 10% diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json index 502a040eda0f2e..6a5ea8189c5f6f 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json @@ -2,44 +2,46 @@ "_args": [ [ { - "name": "delegates", "raw": "delegates@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/are-we-there-yet" + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/are-we-there-yet" ], [ { - "name": "delegates", "raw": "delegates@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet" ] ], "_from": "delegates@^1.0.0", "_id": "delegates@1.0.0", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog/are-we-there-yet/delegates", "_nodeVersion": "4.2.1", "_npmUser": { - "email": "tj@vision-media.ca", - "name": "tjholowaychuk" + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "delegates", "raw": "delegates@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -50,7 +52,7 @@ "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", "_shrinkwrap": null, "_spec": "delegates@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet", "bugs": { "url": "https://github.com/visionmedia/node-delegates/issues" }, @@ -74,12 +76,12 @@ "license": "MIT", "maintainers": [ { - "email": "tj@vision-media.ca", - "name": "tjholowaychuk" + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" }, { - "email": "dominic@dbarnes.info", - "name": "dominicbarnes" + "name": "dominicbarnes", + "email": "dominic@dbarnes.info" } ], "name": "delegates", diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json index bab98d6812a80a..66ca32888b025e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json @@ -2,31 +2,32 @@ "_args": [ [ { - "name": "are-we-there-yet", "raw": "are-we-there-yet@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/npmlog" + "/Users/zkat/Documents/code/npm/node_modules/npmlog" ], [ { - "name": "are-we-there-yet", "raw": "are-we-there-yet@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" ] ], "_from": "are-we-there-yet@~1.1.2", "_id": "are-we-there-yet@1.1.2", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog/are-we-there-yet", "_nodeVersion": "4.2.2", "_npmOperationalInternal": { @@ -34,16 +35,17 @@ "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, "_npmVersion": "3.8.1", "_phantomChildren": {}, "_requested": { - "name": "are-we-there-yet", "raw": "are-we-there-yet@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, @@ -54,7 +56,7 @@ "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", "_shrinkwrap": null, "_spec": "are-we-there-yet@~1.1.2", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", "author": { "name": "Rebecca Turner", "url": "http://re-becca.org" @@ -82,8 +84,8 @@ "main": "index.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" } ], "name": "are-we-there-yet", diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/LICENSE similarity index 81% rename from deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/LICENSE index 19129e315fe593..e756052969b780 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/LICENSE @@ -1,6 +1,4 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2014, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -11,5 +9,5 @@ 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. +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/node-gyp/node_modules/npmlog/node_modules/console-control-strings/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/README.md new file mode 100644 index 00000000000000..f58cc8d8925060 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/index.js new file mode 100644 index 00000000000000..bf890348ec6e35 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/package.json new file mode 100644 index 00000000000000..581b0eb4d48f94 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" + ] + ], + "_from": "console-control-strings@~1.1.0", + "_id": "console-control-strings@1.1.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/console-control-strings", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/console-control-strings-1.1.0.tgz_1466033396831_0.9470485949423164" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": {}, + "_requested": { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog", + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "_shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "_shrinkwrap": null, + "_spec": "console-control-strings@~1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/console-control-strings/issues" + }, + "dependencies": {}, + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "tarball": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + }, + "files": [ + "LICENSE", + "index.js" + ], + "gitHead": "722439b4998d2964ac3d3f9ec175c008aa9b7b4b", + "homepage": "https://github.com/iarna/console-control-strings#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "console-control-strings", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/console-control-strings.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/.npmignore deleted file mode 100644 index df22a16c635a02..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/.npmignore +++ /dev/null @@ -1,32 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules - -# Users Environment Variables -.lock-wscript - -# Editor cruft -*~ -.#* diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/CHANGELOG.md new file mode 100644 index 00000000000000..efd08fc7c19dd7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/CHANGELOG.md @@ -0,0 +1,131 @@ +### v2.6.0 + +* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge + is already enabled or disabled respectively. This prevents leaking event + listeners, amongst other weirdness. +* New feature: Template items can have default values that will be used if no + value was otherwise passed in. + +### v2.5.3 + +* Default to `enabled` only if we have a tty. Users can always override + this by passing in the `enabled` option explicitly or by calling calling + `gauge.enable()`. + +### v2.5.2 + +* Externalized `./console-strings.js` into `console-control-strings`. + +### v2.5.1 + +* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the + node profiler. +* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add + a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012)) + +### v2.5.0 + +* Add way to programmatically fetch a list of theme names in a themeset + (`Themeset.getThemeNames`). + +### v2.4.0 + +* Add support for setting themesets on existing gauge objects. +* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when + your terminal is interleaving output from multiple filehandles (ie, stdout + & stderr). + +### v2.3.1 + +* Fix a refactor bug in setTheme where it wasn't accepting the various types + of args it should. + +### v2.3.0 + +#### FEATURES + +* Add setTemplate & setTheme back in. +* Add support for named themes, you can now ask for things like 'colorASCII' + and 'brailleSpinner'. Of course, you can still pass in theme objects. + Additionally you can now pass in an object with `hasUnicode`, `hasColor` and + `platform` keys in order to override our guesses as to those values when + selecting a default theme from the themeset. +* Make the output stream optional (it defaults to `process.stderr` now). +* Add `setWriteTo(stream[, tty])` to change the output stream and, + optionally, tty. + +#### BUG FIXES & REFACTORING + +* Abort the display phase early if we're supposed to be hidden and we are. +* Stop printing a bunch of spaces at the end of lines, since we're already + using an erase-to-end-of-line code anyway. +* The unicode themes were missing the subsection separator. + +### v2.2.1 + +* Fix image in readme + +### v2.2.0 + +* All new themes API– reference themes by name and pass in custom themes and + themesets (themesets get platform support autodetection done on them to + select the best theme). Theme mixins let you add features to all existing + themes. +* Much, much improved test coverage. + +### v2.1.0 + +* Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks + to @yongtw123 for pointing out this had snuck in. +* Fiddled with the demo output to make it easier to see the spinner spin. Also + added prints before each platforms test output. +* I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for + finding this. Then I was lazy and made a new commit instead of using his + PR. Again, thank you for your patience @KenenY. +* Drastically speed up travis testing. +* Add a small javascript demo (demo.js) for showing off the various themes + (and testing them on diff platforms). +* Change: The subsection separator from ⁄ and / (different chars) to >. +* Fix crasher: A show or pulse without a label would cause the template renderer + to complain about a missing value. +* New feature: Add the ability to disable the clean-up-on-exit behavior. + Not something I expect to be widely desirable, but important if you have + multiple distinct gauge instances in your app. +* Use our own color support detection. + The `has-color` module proved too magic for my needs, making assumptions + as to which stream we write to and reading command line arguments. + +### v2.0.0 + +This is a major rewrite of the internals. Externally there are fewer +changes: + +* On node>0.8 gauge object now prints updates at a fixed rate. This means + that when you call `show` it may wate up to `updateInterval` ms before it + actually prints an update. You override this behavior with the + `fixedFramerate` option. +* The gauge object now keeps the cursor hidden as long as it's enabled and + shown. +* The constructor's arguments have changed, now it takes a mandatory output + stream and an optional options object. The stream no longer needs to be + an `ansi`ified stream, although it can be if you want (but we won't make + use of its special features). +* Previously the gauge was disabled by default if `process.stdout` wasn't a + tty. Now it always defaults to enabled. If you want the previous + behavior set the `enabled` option to `process.stdout.isTTY`. +* The constructor's options have changed– see the docs for details. +* Themes are entirely different. If you were using a custom theme, or + referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then + you'll need to change your code. You can get the equivalent of the latter + with: + ``` + var themes = require('gauge/themes') + var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform + ``` + The default themes no longer use any ambiguous width characters, so even + if you choose to display those as wide your progress bar should still + display correctly. +* Templates are entirely different and if you were using a custom one, you + should consult the documentation to learn how to recreate it. If you were + using the default, be aware that it has changed and the result looks quite + a bit different. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md index 337dc9d8d45e14..bf87d189f1b5c1 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md @@ -15,138 +15,330 @@ gauge.pulse("this") gauge.hide() ``` -![](example.png) +![](gauge-demo.gif) -### `var gauge = new Gauge([options], [ansiStream])` +### CHANGES FROM 1.x -* **options** – *(optional)* An option object. (See [below] for details.) -* **ansiStream** – *(optional)* A stream that's been blessed by the [ansi] - module to include various commands for controlling the cursor in a terminal. +Gauge 2.x is breaking release, please see the [changelog] for details on +what's changed if you were previously a user of this module. -[ansi]: https://www.npmjs.com/package/ansi -[below]: #theme-objects +[changelog]: CHANGELOG.md + +### THE GAUGE CLASS + +This is the typical interface to the module– it provides a pretty +fire-and-forget interface to displaying your status information. + +``` +var Gauge = require("gauge") + +var gauge = new Gauge([stream], [options]) +``` + +* **stream** – *(optional, default STDERR)* A stream that progress bar + updates are to be written to. Gauge honors backpressure and will pause + most writing if it is indicated. +* **options** – *(optional)* An option object. Constructs a new gauge. Gauges are drawn on a single line, and are not drawn -if the current terminal isn't a tty. +if **stream** isn't a tty and a tty isn't explicitly provided. + +If **stream** is a terminal or if you pass in **tty** to **options** then we +will detect terminal resizes and redraw to fit. We do this by watching for +`resize` events on the tty. (To work around a bug in verisons of Node prior +to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to +larger window sizes will be clean, but shrinking the window will always +result in some cruft. -If you resize your terminal in a way that can be detected then the gauge -will be drawn at the new size. As a general rule, growing your terminal will -be clean, but shrinking your terminal will result in cruft as we don't have -enough information to know where what we wrote previously is now located. +**IMPORTANT:** If you prevously were passing in a non-tty stream but you still +want output (for example, a stream wrapped by the `ansi` module) then you +need to pass in the **tty** option below, as `gauge` needs access to +the underlying tty in order to do things like terminal resizes and terminal +width detection. The **options** object can have the following properties, all of which are optional: -* maxUpdateFrequency: defaults to 50 msec, the gauge will not be drawn more - than once in this period of time. This applies to `show` and `pulse` - calls, but if you `hide` and then `show` the gauge it will draw it - regardless of time since last draw. -* theme: defaults to Gauge.unicode` if the terminal supports - unicode according to [has-unicode], otherwise it defaults to `Gauge.ascii`. - Details on the [theme object](#theme-objects) are documented elsewhere. -* template: see [documentation elsewhere](#template-objects) for - defaults and details. +* **updateInterval**: How often gauge updates should be drawn, in miliseconds. +* **fixedFramerate**: Defaults to false on node 0.8, true on everything + else. When this is true a timer is created to trigger once every + `updateInterval` ms, when false, updates are printed as soon as they come + in but updates more often than `updateInterval` are ignored. The reason + 0.8 doesn't have this set to true is that it can't `unref` its timer and + so it would stop your program from exiting– if you want to use this + feature with 0.8 just make sure you call `gauge.disable()` before you + expect your program to exit. +* **themes**: A themeset to use when selecting the theme to use. Defaults + to `gauge/themes`, see the [themes] documentation for details. +* **theme**: Select a theme for use, it can be a: + * Theme object, in which case the **themes** is not used. + * The name of a theme, which will be looked up in the current *themes* + object. + * A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + + If no theme is selected then a default is picked using a combination of our + best guesses at your OS, color support and unicode support. +* **template**: Describes what you want your gauge to look like. The + default is what npm uses. Detailed [documentation] is later in this + document. +* **hideCursor**: Defaults to true. If true, then the cursor will be hidden + while the gauge is displayed. +* **tty**: The tty that you're ultimately writing to. Defaults to the same + as **stream**. This is used for detecting the width of the terminal and + resizes. The width used is `tty.columns - 1`. If no tty is available then + a width of `79` is assumed. +* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true + the gauge starts enabled. If disabled then all update commands are + ignored and no gauge will be printed until you call `.enable()`. +* **Plumbing**: The class to use to actually generate the gauge for + printing. This defaults to `require('gauge/plumbing')` and ordinarly you + shouldn't need to override this. +* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit + handler to make sure your cursor is turned back on and the progress bar + erased when your process exits, even if you Ctrl-C out or otherwise exit + unexpectedly. You can disable this and it won't register the exit handler. [has-unicode]: https://www.npmjs.com/package/has-unicode +[themes]: #themes +[documentation]: #templates -If **ansiStream** isn't passed in, then one will be constructed from stderr -with `ansi(process.stderr)`. +#### `gauge.show(section | status, [completed])` -### `gauge.show([name, [completed]])` +The first argument is either the section, the name of the current thing +contributing to progress, or an object with keys like **section**, +**subsection** & **completed** (or any others you have types for in a custom +template). If you don't want to update or set any of these you can pass +`null` and it will be ignored. -* **name** – *(optional)* The name of the current thing contributing to progress. Defaults to the last value used, or "". -* **completed** – *(optional)* The portion completed as a value between 0 and 1. Defaults to the last value used, or 0. +The second argument is the percent completed as a value between 0 and 1. +Without it, completion is just not updated. You'll also note that completion +can be passed in as part of a status object as the first argument. If both +it and the completed argument are passed in, the completed argument wins. -If `process.stdout.isTTY` is false then this does nothing. If completed is 0 -and `gauge.pulse` has never been called, then similarly nothing will be printed. +#### `gauge.hide([cb])` -If `maxUpdateFrequency` msec haven't passed since the last call to `show` or -`pulse` then similarly, nothing will be printed. (Actually, the update is -deferred until `maxUpdateFrequency` msec have passed and if nothing else has -happened, the gauge update will happen.) +Removes the gauge from the terminal. Optionally, callback `cb` after IO has +had an opportunity to happen (currently this just means after `setImmediate` +has called back.) -### `gauge.hide()` +It turns out this is important when you're pausing the progress bar on one +filehandle and printing to another– otherwise (with a big enough print) node +can end up printing the "end progress bar" bits to the progress bar filehandle +while other stuff is printing to another filehandle. These getting interleaved +can cause corruption in some terminals. -Removes the gauge from the terminal. +#### `gauge.pulse([subsection])` -### `gauge.pulse([name])` +* **subsection** – *(optional)* The specific thing that triggered this pulse -* **name** – *(optional)* The specific thing that triggered this pulse +Spins the spinner in the gauge to show output. If **subsection** is +included then it will be combined with the last name passed to `gauge.show`. -Spins the spinner in the gauge to show output. If **name** is included then -it will be combined with the last name passed to `gauge.show` using the -subsection property of the theme (typically a right facing arrow). - -### `gauge.disable()` +#### `gauge.disable()` Hides the gauge and ignores further calls to `show` or `pulse`. -### `gauge.enable()` +#### `gauge.enable()` Shows the gauge and resumes updating when `show` or `pulse` is called. -### `gauge.setTheme(theme)` +#### `gauge.setThemeset(themes)` + +Change the themeset to select a theme from. The same as the `themes` option +used in the constructor. The theme will be reselected from this themeset. -Change the active theme, will be displayed with the next show or pulse +#### `gauge.setTheme(theme)` -### `gauge.setTemplate(template)` +Change the active theme, will be displayed with the next show or pulse. This can be: + +* Theme object, in which case the **themes** is not used. +* The name of a theme, which will be looked up in the current *themes* + object. +* A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + +If no theme is selected then a default is picked using a combination of our +best guesses at your OS, color support and unicode support. + +#### `gauge.setTemplate(template)` Change the active template, will be displayed with the next show or pulse -### Theme Objects +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet + +### THEMES + +``` +var themes = require('gauge/themes') + +// fetch the default color unicode theme for this platform +var ourTheme = themes({hasUnicode: true, hasColor: true}) + +// fetch the default non-color unicode theme for osx +var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'}) + +// create a new theme based on the color ascii theme for this platform +// that brackets the progress bar with arrows +var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), { + preProgressbar: '→', + postProgressbar: '←' +}) +``` + +The object returned by `gauge/themes` is an instance of the `ThemeSet` class. + +``` +var ThemeSet = require('gauge/theme-set') +var themes = new ThemeSet() +// or +var themes = require('gauge/themes') +var mythemes = themes.newThemeset() // creates a new themeset based on the default themes +``` + +#### themes(opts) +#### themes.getDefault(opts) + +Theme objects are a function that fetches the default theme based on +platform, unicode and color support. + +Options is an object with the following properties: + +* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is + available then a non-unicode theme will be used. +* **hasColor** - If true, fetch a color theme, if no color theme is + available a non-color theme will be used. +* **platform** (optional) - Defaults to `process.platform`. If no + platform match is available then `fallback` is used instead. + +If no compatible theme can be found then an error will be thrown with a +`code` of `EMISSINGTHEME`. + +#### themes.addTheme(themeName, themeObj) +#### themes.addTheme(themeName, [parentTheme], newTheme) + +Adds a named theme to the themeset. You can pass in either a theme object, +as returned by `themes.newTheme` or the arguments you'd pass to +`themes.newTheme`. + +#### themes.getThemeNames() -There are two theme objects available as a part of the module, `Gauge.unicode` and `Gauge.ascii`. -Theme objects have the follow properties: +Return a list of all of the names of the themes in this themeset. Suitable +for use in `themes.getTheme(…)`. -| Property | Unicode | ASCII | -| ---------- | ------- | ----- | -| startgroup | ╢ | \| | -| endgroup | ╟ | \| | -| complete | █ | # | -| incomplete | ░ | - | -| spinner | ▀▐▄▌ | -\\\|/ | -| subsection | → | -> | +#### themes.getTheme(name) -*startgroup*, *endgroup* and *subsection* can be as many characters as you want. +Returns the theme object from this theme set named `name`. -*complete* and *incomplete* should be a single character width each. +If `name` does not exist in this themeset an error will be thrown with +a `code` of `EMISSINGTHEME`. -*spinner* is a list of characters to use in turn when displaying an activity -spinner. The Gauge will spin as many characters as you give here. +#### themes.setDefault([opts], themeName) -### Template Objects +`opts` is an object with the following properties. + +* **platform** - Defaults to `'fallback'`. If your theme is platform + specific, specify that here with the platform from `process.platform`, eg, + `win32`, `darwin`, etc. +* **hasUnicode** - Defaults to `false`. If your theme uses unicode you + should set this to true. +* **hasColor** - Defaults to `false`. If your theme uses color you should + set this to true. + +`themeName` is the name of the theme (as given to `addTheme`) to use for +this set of `opts`. + +#### themes.newTheme([parentTheme,] newTheme) + +Create a new theme object based on `parentTheme`. If no `parentTheme` is +provided then a minimal parentTheme that defines functions for rendering the +activity indicator (spinner) and progress bar will be defined. (This +fallback parent is defined in `gauge/base-theme`.) + +newTheme should be a bare object– we'll start by discussing the properties +defined by the default themes: + +* **preProgressbar** - displayed prior to the progress bar, if the progress + bar is displayed. +* **postProgressbar** - displayed after the progress bar, if the progress bar + is displayed. +* **progressBarTheme** - The subtheme passed through to the progress bar + renderer, it's an object with `complete` and `remaining` properties + that are the strings you want repeated for those sections of the progress + bar. +* **activityIndicatorTheme** - The theme for the activity indicator (spinner), + this can either be a string, in which each character is a different step, or + an array of strings. +* **preSubsection** - Displayed as a separator between the `section` and + `subsection` when the latter is printed. + +More generally, themes can have any value that would be a valid value when rendering +templates. The properties in the theme are used when their name matches a type in +the template. Their values can be: + +* **strings & numbers** - They'll be included as is +* **function (values, theme, width)** - Should return what you want in your output. + *values* is an object with values provided via `gauge.show`, + *theme* is the theme specific to this item (see below) or this theme object, + and *width* is the number of characters wide your result should be. + +There are a couple of special prefixes: + +* **pre** - Is shown prior to the property, if its displayed. +* **post** - Is shown after the property, if its displayed. + +And one special suffix: + +* **Theme** - Its value is passed to a function-type item as the theme. + +#### themes.addToAllThemes(theme) + +This *mixes-in* `theme` into all themes currently defined. It also adds it +to the default parent theme for this themeset, so future themes added to +this themeset will get the values from `theme` by default. + +#### themes.newThemeset() + +Copy the current themeset into a new one. This allows you to easily inherit +one themeset from another. + +### TEMPLATES A template is an array of objects and strings that, after being evaluated, will be turned into the gauge line. The default template is: ```javascript [ - {type: "name", separated: true, maxLength: 25, minLength: 25, align: "left"}, - {type: "spinner", separated: true}, - {type: "startgroup"}, - {type: "completionbar"}, - {type: "endgroup"} + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} ] ``` The various template elements can either be **plain strings**, in which case they will -be be included verbatum in the output. - -If the template element is an object, it can have the following keys: - -* *type* can be: - * `name` – The most recent name passed to `show`; if this is in response to a - `pulse` then the name passed to `pulse` will be appended along with the - subsection property from the theme. - * `spinner` – If you've ever called `pulse` this will be one of the characters - from the spinner property of the theme. - * `startgroup` – The `startgroup` property from the theme. - * `completionbar` – This progress bar itself - * `endgroup` – The `endgroup` property from the theme. -* *separated* – If true, the element will be separated with spaces from things on - either side (and margins count as space, so it won't be indented), but only - if its included. +be be included verbatum in the output, or objects with the following properties: + +* *type* can be any of the following plus any keys you pass into `gauge.show` plus + any keys you have on a custom theme. + * `section` – What big thing you're working on now. + * `subsection` – What component of that thing is currently working. + * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme` + from your active theme. + * `progressbar` – A progress bar representing your current `completed` + using the `progressbarTheme` from your active theme. +* *kerning* – Number of spaces that must be between this item and other + items, if this item is displayed at all. * *maxLength* – The maximum length for this element. If its value is longer it will be truncated. * *minLength* – The minimum length for this element. If its value is shorter it @@ -155,12 +347,49 @@ If the template element is an object, it can have the following keys: as you'd expect from word processors. * *length* – Provides a single value for both *minLength* and *maxLength*. If both *length* and *minLength or *maxLength* are specifed then the latter take precedence. +* *value* – A literal value to use for this template item. +* *default* – A default value to use for this template item if a value + wasn't otherwise passed in. -### Tracking Completion +### PLUMBING -If you have more than one thing going on that you want to track completion -of, you may find the related [are-we-there-yet] helpful. It's `change` -event can be wired up to the `show` method to get a more traditional -progress bar interface. +This is the super simple, assume nothing, do no magic internals used by gauge to +implement its ordinary interface. -[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet +``` +var Plumbing = require('gauge/plumbing') +var gauge = new Plumbing(theme, template, width) +``` + +* **theme**: The theme to use. +* **template**: The template to use. +* **width**: How wide your gauge should be + +#### `gauge.setTheme(theme)` + +Change the active theme. + +#### `gauge.setTemplate(template)` + +Change the active template. + +#### `gauge.setWidth(width)` + +Change the width to render at. + +#### `gauge.hide()` + +Return the string necessary to hide the progress bar + +#### `gauge.hideCursor()` + +Return a string to hide the cursor. + +#### `gauge.showCursor()` + +Return a string to show the cursor. + +#### `gauge.show(status)` + +Using `status` for values, render the provided template with the theme and return +a string that is suitable for printing to update the gauge. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/base-theme.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/base-theme.js new file mode 100644 index 00000000000000..0b67638e0211d0 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/base-theme.js @@ -0,0 +1,14 @@ +'use strict' +var spin = require('./spin.js') +var progressBar = require('./progress-bar.js') + +module.exports = { + activityIndicator: function (values, theme, width) { + if (values.spun == null) return + return spin(theme, values.spun) + }, + progressbar: function (values, theme, width) { + if (values.completed == null) return + return progressBar(theme, width, values.completed) + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/error.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/error.js new file mode 100644 index 00000000000000..d9914ba5335d25 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/error.js @@ -0,0 +1,24 @@ +'use strict' +var util = require('util') + +var User = exports.User = function User (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, User) + err.code = 'EGAUGE' + return err +} + +exports.MissingTemplateValue = function MissingTemplateValue (item, values) { + var err = new User(util.format('Missing template value "%s"', item.type)) + Error.captureStackTrace(err, MissingTemplateValue) + err.template = item + err.values = values + return err +} + +exports.Internal = function Internal (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, Internal) + err.code = 'EGAUGEINTERNAL' + return err +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/example.png b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/example.png deleted file mode 100644 index 2667cac459e177fb25252516d08c61f978e7b432..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19689 zcmeFYRa9I}-!IsN5FiA%V8Mes1ZdoYyL+(U*0=^paCZ-l6WpEPE{#KQZ7jG$I8C1S zdB3yHnl)=K=3*}9cJEzPyK4Wt>SrCQq#%X*n(#FM06>-gD6RqkyaWLNaP~;>uq(v( zHeLY08(d2WRcz|X8J}~Wf5fvE{4S1ivb-BWyTPrV-yPdp=PbhoU`}H-^Z`7yjJ;Exv&3R zkMLUjasEBx%>kfYta%y0sD|us<6F*3KM|Z7lhQ-=h>Rf&I1?sd)wYTK$;Zx)^N`!x zfl!vC*O1V2XVLORKSW#}f(pPwc6=?>GxqI<7SQ-!muv*Ve**6ERgE(O)&trnb#f{s zKrCaYC3`7#Cmp*DQ(b82+1Gh=0DEFDRsr01ve5Anlfq7(*DpfKZi(NKZe(J3RZeLW zhqRDo#bgSge3GE=DWDVTk-l$8p)+CAF0Ex_9G0Lr70UV;)0=khm$d08>zd>adgC)+ zwAb~WR(h<`PCd0ol7bTg-mzx*Sly%8#UV9tg=P~bn>j&^>->?FN;exmE zU$B)@4`EpJc}5%QCMoTs96=lm>>Ngr6fnoa2t%WH93}oha(Oa|h=Ewn2to|rILU=) zF9OKFai9vMWxvB_*$l1UI^F0Z*YIx?OCTU&|MWyFw9M^2ElC>{=kOuuM!$rWOvXI0 z*dko=ysLDckq*%%q|Ir{B*3&?>xE_l25=~{`|>>5@h6X-?;(=Kn=$6>BFt4$5sj@7 z0gbWI*Aa0u1bkFO;qNZnl2B+;O3~&w-^^}(B=9?IBjaY5>_hDrp*=zH^+)ch%=gzO zgFjikKe%5{E~Nof`eWq5F;@~pB0PI!y>3njP|rFIF&w{q9vPQf97ga^dUBCt@X`rT zv$W5ero`s|%0o2QBjCWzk0aP-RMVU3n5-;RumLR+_XCr%g}fE!B--r!R$60({bI#$ zzugNf3k!%Gjm(X#AJjtj^2*704C~uN)yT$AY|Dh$xv_(WN$zs9saS0D&O5! zi%{*}X!ETJHu7zuH*LPr!`9lkV#T&!!rs{d)CsZUL|5Gy3}^SppWL(cW3~k}1#}~Y zC$Rl#H_;H1I(^KMB)&nrUBJ@)Lei;I#W62&_)-HsW!|zB&bnJc=44*Zogx!CH&;Ts z$*hZ~Rhj63@Idf@<%tbw9rQ)%u0w>`O`+UWXm*!J7Dcb6#zZ%IC!)2bGr`DKc2*`_yCM}9fjBl8TQ5Dd=gkKH z2K|QXhR7%Es`z;^Vyf7Wgj6VTd~^Xl6x(sHrFEt6r3^?>u{VQoPC^fx>l70RZf))jf|X>3N5g^_-VxaGq83NPW6WW7)qgH;%sBtNyYK$r|X$X8@EC+rs0Gn6f6@HK^lRL`O!G||_%Mn1J z9l;gR9ibaBzFFJv5xp6u%UkZcROd)K-T%X@*m)*=8ogvy?WweL`ebfkTB}gG;#3KH zj&m*p%&S|Ycb;MX2q zG_ihJ8ZnF9F}h4a{pRvuW<|H$-=g)xgpUr zEE7USPZR#1)@)*|Dk0w&jD9N3v5q*j8%M4SQ1Vh*6C7|C#4a*ncpJ?%k_JyMh{LDJ9v5s~8s8e%%CYJd6Q5PdUh``C zFY>vgM7qwp^|q-;sC;Sq{>v0CuUh7=@UHako$mS2K*6lR+i0U`h9sH9U!&@xd=$PZ z3@ZG}u;cpylmb>bwXcafoH}Z6IdyHv|H!p2KQNx_SY}*iU%qM*$TnpU<+B{md*|lk zmUPd2&5T|kRo$-;&8#S(m}K#F*MtS0C2G!~!eYgIg<$2r&G1(19?2)_*89ZeQh)8& zR`4yt9qw)2{g0deyW~5e*AwU;QHqe?B7u-H@aJ*FkzOO~;Dh+I_)je!P^*KnP169;agA^MjwpnkNYI;XEh66dZc+ReyeQLrnENeUh9e z`c>3;{b<{6*sb)Z=7~maMXhd=%XR~W0wn*_!A9H$%a8dV%#T**2T6v(nuXD*st2N{{V#|^{ec;IB52H(cC&M^<_&}#(Wm{bxsv$izJJDVQ$_lgTFj1G}p?TUvGxRE%z*Yv}FGd z{WW!$er`YG#dVE${HQZnaaa;oVpZ%~Qod4HXD^ScLs`D}OUTx*AFcx)wJxcy1&tjI zkMu=wPq4v5*28^SH+gV+G!JR9fE5Vzi|wuo49v5$TNd{5^wAXiB({4x*q=_cOc?!W zd?~e!+=gvNGow(>E5TcLIDNABFcl~tQ1FMt(!w*%;=`&?y2F*^a6;0RGx;ua20D*l z{Y=Z{1;RB74Rf;rzwh9!%A;BTu!}94ZGSnB9`Ee$c>}kZJu9(bSt*m`^%A?r7b4@Q^(?xm+=`ve4HFvu z!#}@0?^6A%qUFf(V)I_$Fe_P6T(SLv*-OSt=S=Qe`_lQ>F3sJGJD`D_59D6u#Hpy` zgk`&O-14;ga=q`Y2@+jNV-7d|@dTMP+NIkGXUDmuXv zyW!z~&>#Y+Py!6Uc6W>Y3J&i0{l)b7#Y6&S%e8b6()bNu{%!`ttKrV^GZs#6tAl{A z_vHY9CT!O%;Fdf?m&7RQ3eKT4q;waVR)dQ0X-f8k1iIkh0}W+d3GXNATK_z z2PIJ1h5?_O_k$1*y)Y0*00@MW2vp!@!V`CYEAGc2E^o+>i!JRzE2&2-@!63VTUnS< zT%3tlTv1d^L_vf@L6lirnAV*aPeYViTvAOzLY7-zPh8H*Qi|123|~h^7*{j$i#Ud& zf~35HoSqz)vVs!5rk|Aplc>6pzKXcGO0=wohN}XDx`vp7hJK(ty|KEmhNe2Vz89@= zw4^>LQU&+3wy1@sfsMMAwU?m>cC=9RH5ZLA0~*@-t2l|Qp3ObfrGTm17s{COQS+ua=x0oL>AWu z$p=S7dBrA0M1_Y%7G*{F1;!Oxr8G1~XnQ0VRK?iT#Tq6g#h1nfJyyP z*pz1HR@CWH*q{A9DqNNjO)N?~(#Zc0OLY-g@(V?k(DNmA(#aDS0Y zcS%rjd1YknV0Wo+Voi5mW!rGsm%$3J?E03L%DjQffU26x(YkM44at>F-92@cd99@=c>aFP;Y^oiFKn5$uhf7)^6BA=K<0Fvn3CPemWODrH#CYE*Kn z3j)*#FTOFrcSV>D@gI)p#GLrrNn|i_81oVjPw9&T%{e;~oN?nTvoA(&X?LwId_D@9 zvV|>{F~9%#Jbl04Q@xz#m7il#6i{~=TeSoL9B^;>yb%C^kg>XPQ7rEVtGby##M+Ve z#KIu(Prmb`$=hqHpUJ12*mbg$3=26?#I{2#wafa>c`ZBIhN|asOA6ilQ>qdH=<9{A z$$*$O{K9Vy|JNDo+_@}th|P5>6dv+4bz;z*AiObZ^P zegtkWDfkE9yKMc~dC!f>%b& zwS0k!qGHa(VheOwslzwMOuo&N`LnDfNHZ@Zd_Vt@x9zKb{cN2}P65%0=yqz1Z9&l% zxo@i8^Kh3|Oo9X`$R6-Q8Zq9nXxU~?$Zi@kr=L}%nCp#~_vXJ*hhIU?6!!yZMgQnD zQ5xZ9#t+$4=tR#hzPFy5>#L2Q>9~J)-Xmz%=Fr`GNtGZ_l~HIKzv<5mVh+PknnLp} zZTMbaZaJ>5@mr~+YWG*jLm5QaXomFjFGP%Mrl=PZsI~T_P4S( ze61CxXJ=o1ETZIn`kDlGMsyw&d*>{WPsFb7HSkutGInBJNBLr=sC>Yixg@!65?3Jo zqj-O>>|02co)~cj9vD7O8&n%`L@{M`FkF~cBM3%B!SZqMMKrt`qxhzo>avQF6{@jM zw>;scS5V@?ZR0)38RW^N1AEinjeI=?IG0l?Dj>5#*PDuI>yX`2+%G3}EU^M;!>R5CRh&p%n8FX%R8ztBJ2Z5+n^xXzhGV1S#t)F# z$C`{w_PTedfmh%9&}=$0A*g#Nx$QrO=@>${GGV=rzWtrj21Sl%zM9Q^o_$KASlhQ7 zJzMB-e**7ELC9W>*hs3MQ?$t-n#-2`_^|Y*(}%(zr@SdA;M_Lp0XQ+xwC4r-1HyY_ z)k{GtytkG|Nuuprqh47-f2bBQQk){l{bkjz z#2ncBG41X5fy0mSo2X$5pNYg%F-V*R7ExJTaEC2=sLpOb@RPv=LC(vBnccSccE}9C z68y#Gj^-~?us3#LTUh#zFTe0A2W%kbU7plgFH+kXjZ2jSeJQj@Qa~HcD(;&2$48Lw zpasF=V<4E4+dIl&Omm^+QtOEic=P3`%gQP0UB-Pzdu3GA@V>=z+I^{Qo3U65tk#?! z=W5$lj_Ud9%FS-Qd&dz6Acl9|CS9JfcMq|uzhI?zY*n?64J$nNY$U^4HI)a`xw+nKST5LD(z|uBP>~iLw5HX z?Z~yV_FWZzmb#lkifPkxY2Z!{0Km@FCl}MfCN&i{V!V!8D+f*{R|6H~VL$Sf@!5f} z+XyKlS0g0amDwTr!kRJ6ns$mJTXPOG<#>RQD55)X$6CB*V-5o?FxIeJy+sE=2DIa^ zk5+^dANu4I4P69Fdl{BlH(F_;0K{qDG(-;_q(WCeZ_UNL(L@mr2uA||z%c0=g9IQv z6r%7$8vEFh-$DO(URNk~u=Igs!zbn2mjGdq4({n=jO!@Dx=DoPcP%wRI9Q9aUL1=r zP;p!fQv(CPHZ4xz#tt?B0CB_(Vay)q7ndQ*aw8Q-1YjUS9FdJ*-Fh#75(vh7YXBFM z2Hqq{9Ph?f6!f}`NSp6Cr}|)J)f2tKlh&U7Kq){!XcioHKkWHcLeS9I*Oy$8YBh7b zQSnZ#E#+Xr`vpKn7IYDks~&4l+(5ONY5;njS}M1QWXZ~8xqhA+ZMl{c8+jc!g_*ZBkXGP09N zu}FHub)H)TAhCDs5j0^meu_QsO>XqmPctdhjI*s63soQB5jF8xtORCgV5`^dl7~$S zQij~55(6V4)Z!`27u?)UAyNCiYKoW00Dq{QHC3sx&f-ftdhKTD&1)K!uspjUY?AJO zhhbw>C*#MCn69!H76Y5OD<6n}03Tf-kOs=e5QT;qVb%kYM@KgjN_>*KtbN$50>G3A z;KW=g&eH@VP-cVhyqR!pAyN5%8-;U-bP3!kBL<$yy%$QbF2@t^LUz}?g4-cs#c#t~B`nX#ilMT~we zU_qnbK~km^zBDFVsKW5!;o%a+>doxJ0tu7Bv}cJTta?JxP{bo_k#lOR-AVFnT%ep1 z4ToTku9Td#rGX8JvckKUfV>PS5-#mKEz>B_#l;y}yRy|9PE{+5ZLLyx*B{T(jr0+P zi$@KOe^!=kTRa#&lCTL!{vdJrM`|%GS53OaD)^r-YxSR^1;7dnR`D*UTgIJz_LX^YsL8sdl zEK`aEa&dcSap9gSTmOMG5dlyc z0z+WKFa-8{*f4$#VDeC_fz)46r^gNwgPskvs8xkq#r6W)aG@l&T0 zf0N!CXgxX`ku!h^lfwN4FIVD+zC+o^ob!7x--IK<0U&HHbufsPSM@K%y2xoT-xIK@ zS(#xG5L>;t&&}UQ3DP@c2E*$L)N%Zv4u17fz?o-uTwK98O4`{5d-71Oeqzpv`9)YV zy@1xH$vc-@IrGdr>BC*^P70A4aZwPA5|GHOaurH6a?GnRKcd8@7qK&mLTb|^e}6P^ zy)a~^%zK@G9O`Lhp&`4E=f&|Wj%rbd;M2i@E5taC41a*u;IsRAT$0E86HFpG?dld@ zQI5s396_O$Bd4*NjJi)r975uV{;XgzIwNG``_@y@cR)~4yx+uq8LzUgE)iMI@6VA^ zZ^}Fe_=i~MRDm`5RJaXmf6*0fdGKBHgkGy%wR;Y*Hnf+nFinNLQv9O|$XzldTXJL< z83IQJgG{frL`{>$>;-2sE^9}fmdGJ6p(_p8RLJ)A?bJtz@;+UrHq*jQo+Z+y4hZZ_ zwxxPGxkW5cn-p_bu9{d{W$B)%eT}+ahhlp9@qiMGD+%7e9m=J`V^l#e7RYx-gqr%ROoM@E z4ZGVt4!p%3*=_B@gcu}A8*4u0as~RMm!DI9p0lW4CX^Oak>s~-I1Q;%;*o?WR|OHj z_q(OR;%EA1WWGXm#=#6scFcldE8!k+H)V(bOEcc~kF_4MJiUv&_x(gTB#XA=4eOl& z(8?XpS`Nc~`g$F^nxq6gB6$I`OOJ|B-L9~x{d@rz`9ITJ8QqJdCeK(bGi7|rm`I%H zVFciSnYl*O){V1``E3Ays^iSU!lz;FjinMu3tx!unzt!Ip{(EY6w--qgP)`m7wPs7 zobqWi)>4BgwyJw$Sp`xLnx7VNOqVNLv!r7o%Wq_)%a%PM z$fDm;M&ijNBQc`2cuNr$} zXMqad=>uIAcBbz9ydKy>6B@j?{T93^+QFXzG~aw+Zp zLL|*E1827*VtKXe9@nr_9pH#Tl8j*-_o4Ixe7?4w$8U%g=whRiimx6#B@g z_$jwQ@&Ou|yLUe*G?^Qx=UUX*QL3r6b&k8Ui+?75wtO3LpQktz-jp>;10bstmx|`m z!M*Kslx5G_lPHWC9LkG~c{LS>CzySkVm?Nv+e&-M2zwVg8X)@yM#Y6;2@bqAqbQ=n zJHqcctLeH_2mzM;-EH%1gun8(cTfuvzoCy4jZvnI-Fn=TLzG*K{{7UavvfaCJRqbeLI@;~lN@<7=BJ509vCUu)*bAs(V#m}>%1*(wg@P;XzqK|@e^CELGNK~Iu8QGBQ( z#<@Euc@Y2Yo(3pq+vm2Wi`~alwn(s0dj8TeBHtwJzQJz60~Cvc84s-;85GV)?dks*dMCL06LAgjZL;w zk!rUppF=@o8}20*T?rWpEzTR2eLKpl@UnuJH=)#(URo^kj{Ig6E<`~z4DD!zv}vF> z;v*Q>dXQGUFd*hm`>8QAM)sO7VDy=#=AQ9ZBWn(ngqd0IsYZC44n*MIR^;oU?FG}+T0l<{0@0NJT$;q58J(;4OSK>>6xA6=Q2 z{UN#k1(k67LtVjgUETWxAxPX;zC%Rr~u^shAo%+;tXo1Wiz- ze4s?Sfiww;1NOkzpzT6pnR59?I&MJucW7l$PclpMWp0kIfPPi7>q^CFQ#juX3WSVJ znid#rvQOl!pBLcfrHQu1+aO;TsC^``^yztclBi(+@DtH^O8PV7tVEuFv~$yEVj!F7 zA5-h)rL6qC4QfWSARDmg0DB+)uf_!J!C{^Ry|<3-$o^^}pqr6!*~Y09*Zw=VRgE+}U`^50b4VFsyd)jMYSW-_||7;vUnjinhkX&!jxBN6CJt!_sJs8SeeA z@SRv7)`GPrVP^6xfy-;_mB*k~(X!seAJ7(oAM^}De$%tflUX_{msn9w8dUmnvQ2XS zg;VB+E{wc^;_;0y$QGQRHMAR2-$I97guA)smXJ?c6&}_}fAD>3)Irm6V(@uckZ0YfRcv@vzDs`FFh-`I`K^(!xdOssHa2;> zsx*xEpsDU4FqT!zJ~B?*=Rr%~P#c$ZGt`-G#!EKOu5=z_HEpi>S%fSij-19J$+R-c ze1-`%V0N`tml90Lw%JOkmagVv%Nxi7;rHYtmr&5W_bp_HnVPNj#ZTBVdShj&1xX!a z7dmF9_X*bJ{SEFe2oz+-WhAh%Zd*k&X&(Z9#I|;8<8&b0D5k)F$}0Qqb1Ppg!O%VO zf`HyT2L}#VH5?5+I!>^SG&N25^l=dFjzl1d1Ak2#=e2 z5hiIw-AjF3MM@bNnF4|Wi;E2o1!tqXn@|a4bmhq6C&j0QCu-diQy@^Uhn12O-pqb^ zI!lH9_0T*wr|#DG#rg6OdA-x=1XXDmF#H~(kWKPw>>=JO+P^m?3yLpOAZ#aTDF;a zYo+xfdUa2K4z7{%psQdj>*$A`1%YvQ`5E~4=eSi1_2Jhoi9H*_0Gn|5!7TjD;Wn~Y zsGLP?W_oGFa}v8MnvnH+ZP|7VLK{;7Tter8vNRp$4sHY@h6QnpW<90r_s5k-2lH5h z?e)jGN?Y5m$w&gcc?&w4i>k7VMyg6t@|B~g6=BBH_w@|)G^-g$`#N#3Yi0T_Qv zGB~~yb;{F}3Ecs?hJ}s){(Nj0Ia+=GHD3upJ?BfTWp^PeA#rSEd+K?Mwyx$cRau~P z^6()}I(+(N^nutf9(m2$IBzjD4fc9wXWCHIYyj;u1l8-Tg7YE#T!;iu^=pf#t1=-@ zCmXozgpoPXhd3G+H9IF&V-S_j0vQPgMNM`l89-%c+m@vIq zhEH;wG7lQ8{!u87fBA4*o6%)Q--Twtr`jI&J|tx&YiRDZiU4p%ElVM_`;%Cx1@Es} zIxNV}?95duH4`J}*i=|6*PLu$DwH}h@#ThBRRS@g1L+uycvd-kT`~1Bo(ILChCJ%``|yfh=4x6B;P>_^6uZZd~LDijI3$#dahl!GJiFqN;`sN*1o zGAVA36-1S{TM7qQ4TC}(o=^n|I$+mK9#@G6evZTY+be_K{pv4_N4tvpo`;dCd3y9B z#wzca=0|!4ayt$>%t8>PudtxnZtWlZ;&;|xS%wUVS({ktIN)3NdP;0$Yq_Rccp!o8 zA}~~hdhPoxqx^*sJ+n3h(ywlO!{vllD-B+u;4$Jee1L@R@vi*_t7hSVb5|u2eWJH3 zjXIsGK4E93WWi@$fV*8wRxsD*TF~$qwU{+*z}QpHKjZa4JxqxehUd2xd&ADULSGP2 zl5%m=p*ED5C;Ts>9jo59!!a&DMmBT9r$sv=THsyZ$t7&C6eONNICr_|j62*bT$uI{)8uwe{9lMUfsDi0q{{DdH!T9rmk+R4dN zp^v<4((i$n!&-T}KGwLp6esf~LS3+SkmkdMAM>#8qUfBpDpkCO9=21&Y3g_V@e`7g z{z&ONg^pjuq!mFjy{Mk-20gS!r{Bv&5#+f~I%;UDMn&_qa&*zt54@IjI zQmZkBgr4%Q;SSOO@ex0}2{{%f-8)F$6&ZR99Tz@Np_csiU&i0i1O5c^I zKU=UB>+i>ja6^mehb`NgFOYY`tJEL%Rl;$Tel)0FT~o}b+v^nxLn+|P6)>W8rDt@jSO%Hm1uJxnF^ z=Lw0DMdBFPJ-|EQt^IlO+J72{WW31xU6%XV!Vin-o|8IzrFi>CJXm_^~PapcZ?1=SBkhS%zLwunqd3_tU6$7HYxcr z&{7&Dd)!-&V>f}xAi)za8{nUSO+w%pqIt)n9`=P1F9)6m9aSmpc$6vbMQ82iy20Vw zNZU!L^KVn|-NC!4yO?sj53LU|P+AySfVGCrWIEZHUzz{bi{b-8_ijnpF;33wdo>f@ z%neeW#%h>m{7h^xNXjWQZ@!0z^^I>$SVl0DcO4dVG!06C)L06hHClkUg$|`L>eS@> zkII9S68)Myu_{z9lo`;s{~gA-_{DmvQC^e}JR#PzLX8fF7cL2pYA5NG05yMo8K8~6 z!m#(Y30m~b=lpSSNa!%ih$RYdg3TeylYPn|QN@4NW>2t~y8o_W5K>VflYj~T$ML;4 zAtE5gzm3#zNbo}RxVuC^cX!^K#j%1PUS%=>03@EzS%6SdllWzVR)yhrQDCvad`C2J z?q6yNBS0yO5yt}!?;{*_>Nu*kcab;V%J$=2+b>t2Ln-Je-a{-?Gcz-Fw}@7Od@Z>! z4gXnu|Hun5{t{BfM4q65R}q*{hL%|XP0|NRzU5GhC(?$o&gWUcK26SxUik2l*r+Un zcRk!Ps2LPV*ZGlnR?72+724kM3!&|+L;L@guupQ7DU-pLZPi{}9Ju-Bt~F3ywSDbp zV?rKA@&8W-_CF;}g@+=2a>}sV_Q+dJ*nta((*+g8FD@<$=jpeJk?<}iv{|;a?0j?^ zt!XdVA!q>+m(<*PLSiK0G=wZK1=;59$e>NiUt^D2I^Db zW?nqzB!tT|7hs)LZ;Vd?DdUouz*Fr}869v!_<#+1;8Y+HVi4WJE(ZD5Gn?vAhz#Jm zZ_n9DR;;0%J1)PCX{%q>ubI|RnZnB`Fn35@rex}{xkdIobfIA>fx5$}Rjc>=-%_7X zQ}<{P*@?Hh&PC+8nA}U7o72pK_Nriv%lTgIO)uWW_>Tr=m(QKdz{N!dpuj6(nJ_fj zW#3z{?pxMrMJg{##77-&jdUzZ7;$}8wl$&FspEVSJuY z_3PMK9@n=DXV8SWd1L)FO+!N@C66yL;mZ;@-FGXxH5V)G3-tI_gE??2<0^F~k6WLJ5FrZ`tr=E?1|a&awE`BR zhk0*}6bdW`D}~?&O*^FTu|G6)9E^Z4Nu@Cy?ZC-eA>6^DGN1UU=y>>#?YLd zX`1QEyj~ylnZHx&LnryVMB!3~a@B2K1xu6ucc54A)8u|cH)`4jj4!9Ch3`Ww?`ui3un~ZPS#4XHdMXX5-im8dRIaQkK$uXGx zgt5V5S#MZ?ZlS~uCmnk~$A5Dyoyg#3!sB)H={lpp%tePwaVb(mCR7ICl=jZu^gA3z;=1g?=r*EdjY(~^)nXrSagHob0Q9~p`3-Vm08ur;i0Ai_4hR*Awy z>-VWl9UP%!I!%HN@W(Z&E)-H-Qe;-r!1&`tYq0Ty6#?wM0ND!Nrr<;lDGtwxx7-Fzk=>ol~arlONjS_ryiw;kJ> zQsPv~*~s;bHEEV*&l|+usELye7%j9U3W`+P7*GbWi*+VU29VUFf>C{$0X^EFfb0ub zhJL)mtbZ6qZpy!mg66-Bg5kf6;uIA-6XhE;#*AS6{D<`Uye~# zbIWOaQw#YLwko+ga=UB;j^94V6(S{*@*B*uDy=s{Boc%R>39wSXgb&kXR|I^uKfJj za;(;?B4g#V4;t16@$iQzwVl9a)1JIaCP>|xA@)wQvt8$8j#DTt-goIEp8vX&gjZVG z;=VqM_dEqcfBQuKGX;Nip?4-CXvI&Dylg;^cwIjpO7mP8Eor#~bC6>H;;@XNn(8k- zC*4Xt$ZfE6Wzo~WSx@F1&sH2pwq--AzTsT%85Uug&r)fR34SH8p{;q=ZNwdye~uMMo4(tF8jhH`nVU1H-rp^6E2WLvFL_g_cq1^ft>?y-p^mxqT!VWJrf54Dx19& zndVt%j7-LvyXp@jl+f zh&QqVS4f1u-4%*o9T>l7Yue9{`kGj=%!mgYbSbdmm^Ju*Ltt=(v5>;kxjytK#Zp(8 z+*YX+w0x)K*PK;nny0l-(7=E@?u2oTo~Zc1)sXB2qa+c0h8R!9l}6MNxJM^ej@u=V zL5JGv+PAm4gnoo53#`%0Z!ahXxg`ULcFX4b)kjs>KTUh;aYv2(Di^Zef8O?Uh^QEj z@>8IB_W0Lt?rqnee8HBm{-Rtwcr%}O`91}c-l<~xt+Ly@sBp%@O}dr~rEXr5>aU6| zU$eFyYW5a3th|aTpUKYBU$Ud~57|j1n>8CZNDL2FIpwYqi*62czbX+Uaa1F5x!V8a zMsDwAi>bf_^`FKmSu*%Aq8yEV z1~V21jqXG`NOn@+YeKXwh-f(*c_wZbHj=I=urk9;F*3v9Yg@7#Rfm0eD1D|`+Ow}! zwJNcChG2HnR$ti#%SRv0;Q>pSj&vs%Uz{f+M5lJ1JO!2|3D&F-rvm=%W$gAAUC4o% zV0P~iYc)|15$?I{V3Xlt6?($Q95*QY0Dgt2UOWk(Sd7ZQ)N<-5HOe+;{SlOKrDEf_ z_ThGwC&&;3R{Edz9*-jjum?TUzE)gfM!%h_EiHr!HEk>;Gq_-~CW7!XAEVMt%6G|t zslGmJ-|N~EurezWakKxHO?QGvFi`Zvo%z^tA4B||b^|Q;Nh#cKzVfe11LasKh#Pay zc1o9-JJ1%V8Qx{^6%>y8Gr3D-V$YKJ9|o9w_RIkFNf@<4O`Zv0-A3?uK(3%mfp;Z0 zXR6Cj19tidPu>z}X-xzx<5B)t8PlIW=HhPNGpy(fqfQwdhWg$wX)tBPoQ}U%mj&2a zWp;5cl%1qHFHa&P8K@lnO2FGkp}<|=64at9e{_^T{|IvGdD2Dr`^%>V(ra_b$`tHH zj}9||B~_0~Fx%Ux@L+uMsju$uEb$>t-=sf5ZWHKie=R?hlcS(@2PD$siPL5k0O4SFl*?PX51W z?DeTq{*!UyaL-Hl7<|Kywg9@PG@&0{YQW+qeuyCzBY2OtH9^1qh3 zU@}_PB^THD{OdX)HS5dk=kPkol6ISW$;T7&2OYpiD@dx?+g}un`jP`Sf8O_xZ*_Xb z#mx1@x-zW%X<`(QKB}E|z8QcFKRb7ZC;(|DppWcs2YwZl^EnB%d)%zl^!8H{3cZ2- zfXYS6%qj_-6r{={Cr9BC<3SJb(fm2K9IXZ_s`lQZz~>M>&UlWlZ*#0olp-@Q944fA5b;r`{@?Jr0U+cDR1V#a7^C2GwpdV1V26(CBarL$ z?BV^lG(*ABD7}uB9kHuLSGQ3WU1@n;hqSa#GuP#S!yGB zPOn8lHt~Q%49YVws9k$D;gT>5`acMCjUB17;phqrRjf2m=ODB|KU+(mI6nLxymI;o zX25-g6MGb|PIjHBa51T)V~hLW+&BK+px1U)Udj@MgS^^KH9Kq0&9M)A6e>UaoAfx* zGT)Q?ZS+%#f@i-fOfCj&NK{S?puzz*aQ0qmWjiCg5l*3LJ^l9bWy=+p*!>%pQa+Ft zBkuX3qhfMbX}sczHPlQS_?8eevC^bMt4&M1Fd}ol756@fS=*OFq`ZlMsNt)u=7%v zP43wxla>;N!4NR?hbyG%r)snH0!7Lz3KIIDj`;DGs@n)X*n2VN*kF_7Bfy}rrZTAZ zMbgE5zVD8}SOBINNaGt;?d*D@PW7oYWui6F3&c~~JPH8u5=sK6f_QiH@Q`Y?R7#GFw{iE(JJ#Z7DcvPC1U={GibTmz6C6VDeq zXTSzC(8o1|_gwL}Bdr$my z>Jft|xjrQ6Gwj`B6fKHV8^T1Yk&h^-p;3?k_~(QZY+lC)E9YQm5qg&0Unk!skx-7m z$VVN3or@V(ap($1P6;} zsH2D_XgF}>=$Ph>e~~S&UB3{{kofCL1=w`{UT7L0r1s+s#?TCo4KwRNZ>G6Ss_hEA!yo3r>)r)>B?;b(0~kmmF7I|OROc82^LSNWBq{dnrjCL08&EhF+Qtb7ll^9rze9`}GXW99>B^=+* z77jLrLbw}^LCWKoHz%8Hcv~@dtJ&DO@!U<9!5p7H$j}wn!7$P}Ta`fkD`|G05#WGNk3Y635iEL?F)zLoeQ;D~M;#pCltw}3^MrpaP9>~A8rom~_D zHE-bn7;`-v3{6Ng};xYWaU~$##TA(vmtm=9_0B)3F809+z^0dYT~grsh4LZHWcm)y6{-$+>_~(GL{^xa#6h#c2R9yi zn$=n0iRM*tVS!Ru4_zW_N4^p$`wvUCc!jJ9tdA?dB>v~jDP{(4(DBSw+&;`*Y&Vr< z{|rbZgY{(MiDVBiZZKJwg+T&4c^DD~=oP0SiT{u2q@AaThnpabPNI4L51m|M@J;Si z>=j`BD@g8#nyPxiVmTLBu3c`gJ%h~`%)k58Tvv%x*(!D0)~yd+o;RfK?fZD`R-DU;=g%>Fl5(xU#WuKm zl7S^_-nLe3zINu}|MY8HsnDNvT2t!L@S^10`T8G?#V0rTrBDB{?uiu#s84#y_4(n( zpFj6^RD8?YDrjo4!fUGBiWy#3>rYy~TVeUE3Ro;(it8w9zdP~dc8h}9fAVDxfyOmh zHh%f{-R((ditX7$*MCj;ocm)pq+i*%o9upNy8&vyQtx%@Jd!$=`ZEm^4+hS+3chzl zde#}M1bsq4_vV$aTDf=c6+zi~(&q*L=Zk{7jf-Eb zNI9#cIdhr)YUAx4QodVPw|Q5e)VF%>`@c6k@t~K4w%(#*-AR8Iebx-VwQcv$SZ6UA z;4lvG3?)CN`;dvsr8eM+%GeH2FPD4K;$f%US6-b>?>r-QWNN=j#hQxoXEh^(D}ZVgtbj9w$ug$tE&Ybe8lgLCwulAKVO=B~I%i^K<=?MK z7hiPD2F=hN4^`MyWA|A=Gq>ViEofJcjLUJ=7Re`{OS`|SL?r-MWM_5trH9z@``i3{ zbJaL2>HoROH&(0^w6A)c@vH7r|Cbdi(`B{Z>Aw~g`&rZa^JlBg#F}!u$9BN2uSx6D zKLe-4bT3|1?hA9>S9oVqPkPlw&6G_>naWEJZduZLKHYBF%;HmG`d+r(;2j-(Jr+l_ z|4!FB>LAvAp>c9Mo5s=a&%`_%6K;Jh&@bybW|q0L^6<;XhlfA6edbtJTo+g8Q6d7| zy#dq>TwwL;w81=$d4FsLXZJiT4n11l70_C{YU3Q>T1}JP+R!c)!^MYImpb`(t;qP} z!#DTX3n8U5dB0}Qj&X7SnzRbEWyGOmnW@k<1Kr#vk*PYdB{i+Wnyx|ShdTQnx~@(C z2wILSF-=Qg9;e%@8|DiX!7E9D5ds`Wd~sVa#$|c5hr*1n5B5 _L~%m_MOoXB+X zRA5P0eTJBQmjMbwvbb1>PIV&o3AcpcIDl4 zO>Z%DHr+W9F_$T*6=1XBgv`qqFP}QrEWUC;GpREER>nfH*1un89W|dh_r>qEYv9XE z`Q)Wci!^6n)7~9!92}UHX5PKebLqUJz{RmwkvGj8Ir5)k*4>9=gRfU}njp00i_ I>zopr0Q(ie!T=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "has-color@^0.1.7", + "_id": "has-color@0.1.7", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/has-color", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "_shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "_shrinkwrap": null, + "_spec": "has-color@^0.1.7", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "tarball": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-color", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "capability", + "detect" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "has-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/has-color.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.7" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md new file mode 100644 index 00000000000000..37bbd8991a6423 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md @@ -0,0 +1,30 @@ +# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color) + +> Detect whether a terminal supports color. + +Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). + + +## Install + +```bash +$ npm install --save has-color +``` + + +## Usage + +```js +var hasColor = require('has-color'); + +if (hasColor) { + console.log('Terminal supports color.'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + + +## License + +[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md deleted file mode 100644 index 57fb585913f433..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.pad v4.4.0 - -The [lodash](https://lodash.com/) method `_.pad` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.pad -``` - -In Node.js: -```js -var pad = require('lodash.pad'); -``` - -See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.pad) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js deleted file mode 100644 index 876fbb967490ae..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js +++ /dev/null @@ -1,434 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var baseSlice = require('lodash._baseslice'), - baseToString = require('lodash._basetostring'), - toString = require('lodash.tostring'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return string.match(reComplexSymbol); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeFloor = Math.floor; - -/** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ -function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ -function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); -} - -module.exports = pad; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/README.md deleted file mode 100644 index 8cd4181ccdc00d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseslice v4.0.0 - -The internal [lodash](https://lodash.com/) function `baseSlice` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseslice -``` - -In Node.js: -```js -var baseSlice = require('lodash._baseslice'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash._baseslice) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/index.js deleted file mode 100644 index 59293c3d0037a8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/package.json deleted file mode 100644 index 3be3e7b990dce3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ] - ], - "_from": "lodash._baseslice@>=4.0.0 <4.1.0", - "_id": "lodash._baseslice@4.0.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad/lodash._baseslice", - "_nodeVersion": "5.4.0", - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.pad" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", - "_shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "_shrinkwrap": null, - "_spec": "lodash._baseslice@~4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseSlice` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "tarball": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseslice", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md deleted file mode 100644 index ba060c94dadea0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basetostring v4.12.0 - -The internal [lodash](https://lodash.com/) function `baseToString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basetostring -``` - -In Node.js: -```js -var baseToString = require('lodash._basetostring'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.12.0-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js deleted file mode 100644 index d5848107499c34..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -module.exports = baseToString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json deleted file mode 100644 index afe25bfc79986b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ] - ], - "_from": "lodash._basetostring@>=4.12.0 <4.13.0", - "_id": "lodash._basetostring@4.12.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad/lodash._basetostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash._basetostring-4.12.0.tgz_1463062033665_0.6722894972190261" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.pad" - ], - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", - "_shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "_shrinkwrap": null, - "_spec": "lodash._basetostring@~4.12.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseToString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "tarball": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basetostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.12.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md deleted file mode 100644 index 75aa6b0699b4df..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.tostring v4.1.3 - -The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.tostring -``` - -In Node.js: -```js -var toString = require('lodash.tostring'); -``` - -See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.3-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js deleted file mode 100644 index 8a2cde39290e82..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js +++ /dev/null @@ -1,178 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -module.exports = toString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json deleted file mode 100644 index 9b829d126b64f8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ] - ], - "_from": "lodash.tostring@>=4.0.0 <5.0.0", - "_id": "lodash.tostring@4.1.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad/lodash.tostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.tostring-4.1.3.tgz_1463062634002_0.7874096168670803" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.pad" - ], - "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz", - "_shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "_shrinkwrap": null, - "_spec": "lodash.tostring@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.toString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "tarball": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "tostring" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.tostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.1.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json deleted file mode 100644 index 077525ba2a9737..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.pad", - "raw": "lodash.pad@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" - ] - ], - "_from": "lodash.pad@>=4.1.0 <5.0.0", - "_id": "lodash.pad@4.4.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.pad-4.4.0.tgz_1463062450475_0.3613762252498418" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.pad", - "raw": "lodash.pad@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.4.0.tgz", - "_shasum": "faa38df26c0a69ec5086a82246c958e150dcb1ab", - "_shrinkwrap": null, - "_spec": "lodash.pad@^4.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._baseslice": "~4.0.0", - "lodash._basetostring": "~4.12.0", - "lodash.tostring": "^4.0.0" - }, - "description": "The lodash method `_.pad` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "faa38df26c0a69ec5086a82246c958e150dcb1ab", - "tarball": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.4.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "pad" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash.pad", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.4.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md deleted file mode 100644 index 909eef8f2215ef..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.padend v4.5.0 - -The [lodash](https://lodash.com/) method `_.padEnd` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.padend -``` - -In Node.js: -```js -var padEnd = require('lodash.padend'); -``` - -See the [documentation](https://lodash.com/docs#padEnd) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.padend) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js deleted file mode 100644 index 5af50372e338dd..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var baseSlice = require('lodash._baseslice'), - baseToString = require('lodash._basetostring'), - toString = require('lodash.tostring'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return string.match(reComplexSymbol); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeFloor = Math.floor; - -/** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ -function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ -function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; -} - -module.exports = padEnd; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/LICENSE deleted file mode 100644 index b054ca5a3ac7d6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/README.md deleted file mode 100644 index 8cd4181ccdc00d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseslice v4.0.0 - -The internal [lodash](https://lodash.com/) function `baseSlice` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseslice -``` - -In Node.js: -```js -var baseSlice = require('lodash._baseslice'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash._baseslice) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/index.js deleted file mode 100644 index 59293c3d0037a8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/package.json deleted file mode 100644 index 69dbad217da375..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" - ] - ], - "_from": "lodash._baseslice@~4.0.0", - "_id": "lodash._baseslice@4.0.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend/lodash._baseslice", - "_nodeVersion": "5.4.0", - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padend" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", - "_shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "_shrinkwrap": null, - "_spec": "lodash._baseslice@~4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseSlice` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "tarball": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseslice", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/README.md deleted file mode 100644 index ba060c94dadea0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basetostring v4.12.0 - -The internal [lodash](https://lodash.com/) function `baseToString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basetostring -``` - -In Node.js: -```js -var baseToString = require('lodash._basetostring'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.12.0-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/index.js deleted file mode 100644 index d5848107499c34..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/index.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -module.exports = baseToString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/package.json deleted file mode 100644 index 11810e229268cb..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" - ] - ], - "_from": "lodash._basetostring@~4.12.0", - "_id": "lodash._basetostring@4.12.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend/lodash._basetostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash._basetostring-4.12.0.tgz_1463062033665_0.6722894972190261" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padend" - ], - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", - "_shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "_shrinkwrap": null, - "_spec": "lodash._basetostring@~4.12.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseToString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "tarball": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basetostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.12.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md deleted file mode 100644 index 75aa6b0699b4df..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.tostring v4.1.3 - -The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.tostring -``` - -In Node.js: -```js -var toString = require('lodash.tostring'); -``` - -See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.3-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js deleted file mode 100644 index 8a2cde39290e82..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js +++ /dev/null @@ -1,178 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -module.exports = toString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json deleted file mode 100644 index 176ced6107ecca..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" - ] - ], - "_from": "lodash.tostring@^4.0.0", - "_id": "lodash.tostring@4.1.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend/lodash.tostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.tostring-4.1.3.tgz_1463062634002_0.7874096168670803" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padend" - ], - "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz", - "_shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "_shrinkwrap": null, - "_spec": "lodash.tostring@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.toString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "tarball": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "tostring" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.tostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.1.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json deleted file mode 100644 index e00e08add68262..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.padend", - "raw": "lodash.padend@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" - ] - ], - "_from": "lodash.padend@>=4.1.0 <5.0.0", - "_id": "lodash.padend@4.5.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.padend-4.5.0.tgz_1463062451966_0.5034168094862252" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.padend", - "raw": "lodash.padend@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.5.0.tgz", - "_shasum": "a289e9377ee2e6de8ba7f11f3a8eb326070b7619", - "_shrinkwrap": null, - "_spec": "lodash.padend@^4.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._baseslice": "~4.0.0", - "lodash._basetostring": "~4.12.0", - "lodash.tostring": "^4.0.0" - }, - "description": "The lodash method `_.padEnd` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "a289e9377ee2e6de8ba7f11f3a8eb326070b7619", - "tarball": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.5.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "padend" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.padend", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md deleted file mode 100644 index bcc1c5aa6710e0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.padstart v4.5.0 - -The [lodash](https://lodash.com/) method `_.padStart` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.padstart -``` - -In Node.js: -```js -var padStart = require('lodash.padstart'); -``` - -See the [documentation](https://lodash.com/docs#padStart) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.padstart) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js deleted file mode 100644 index 456889536633cb..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var baseSlice = require('lodash._baseslice'), - baseToString = require('lodash._basetostring'), - toString = require('lodash.tostring'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return string.match(reComplexSymbol); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeFloor = Math.floor; - -/** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ -function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ -function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; -} - -module.exports = padStart; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/LICENSE deleted file mode 100644 index b054ca5a3ac7d6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/README.md deleted file mode 100644 index 8cd4181ccdc00d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseslice v4.0.0 - -The internal [lodash](https://lodash.com/) function `baseSlice` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseslice -``` - -In Node.js: -```js -var baseSlice = require('lodash._baseslice'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash._baseslice) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/index.js deleted file mode 100644 index 59293c3d0037a8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/package.json deleted file mode 100644 index bf0bf651135204..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" - ] - ], - "_from": "lodash._baseslice@~4.0.0", - "_id": "lodash._baseslice@4.0.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart/lodash._baseslice", - "_nodeVersion": "5.4.0", - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padstart" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", - "_shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "_shrinkwrap": null, - "_spec": "lodash._baseslice@~4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseSlice` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "tarball": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseslice", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/README.md deleted file mode 100644 index ba060c94dadea0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basetostring v4.12.0 - -The internal [lodash](https://lodash.com/) function `baseToString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basetostring -``` - -In Node.js: -```js -var baseToString = require('lodash._basetostring'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.12.0-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/index.js deleted file mode 100644 index d5848107499c34..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/index.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -module.exports = baseToString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/package.json deleted file mode 100644 index 1c42ea67ec4288..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" - ] - ], - "_from": "lodash._basetostring@~4.12.0", - "_id": "lodash._basetostring@4.12.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart/lodash._basetostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash._basetostring-4.12.0.tgz_1463062033665_0.6722894972190261" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padstart" - ], - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", - "_shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "_shrinkwrap": null, - "_spec": "lodash._basetostring@~4.12.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseToString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "tarball": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basetostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.12.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md deleted file mode 100644 index 75aa6b0699b4df..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.tostring v4.1.3 - -The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.tostring -``` - -In Node.js: -```js -var toString = require('lodash.tostring'); -``` - -See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.3-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js deleted file mode 100644 index 8a2cde39290e82..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js +++ /dev/null @@ -1,178 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -module.exports = toString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json deleted file mode 100644 index 32c5752c9d3706..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" - ] - ], - "_from": "lodash.tostring@^4.0.0", - "_id": "lodash.tostring@4.1.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart/lodash.tostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.tostring-4.1.3.tgz_1463062634002_0.7874096168670803" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padstart" - ], - "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz", - "_shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "_shrinkwrap": null, - "_spec": "lodash.tostring@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.toString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "tarball": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "tostring" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.tostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.1.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json deleted file mode 100644 index 57fc4ead9a08bf..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.padstart", - "raw": "lodash.padstart@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" - ] - ], - "_from": "lodash.padstart@>=4.1.0 <5.0.0", - "_id": "lodash.padstart@4.5.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.padstart-4.5.0.tgz_1463062453524_0.18468116875737906" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.padstart", - "raw": "lodash.padstart@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.5.0.tgz", - "_shasum": "3ea190f6734841c3364d279d11e056726b60a79a", - "_shrinkwrap": null, - "_spec": "lodash.padstart@^4.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._baseslice": "~4.0.0", - "lodash._basetostring": "~4.12.0", - "lodash.tostring": "^4.0.0" - }, - "description": "The lodash method `_.padStart` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "3ea190f6734841c3364d279d11e056726b60a79a", - "tarball": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.5.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "padstart" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.padstart", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js new file mode 100644 index 00000000000000..508504840dc61d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js @@ -0,0 +1,83 @@ +'use strict'; +/* eslint-disable no-unused-vars */ +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (e) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (Object.getOwnPropertySymbols) { + symbols = Object.getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license similarity index 76% rename from deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license index bcbe13d67a9621..654d0bfe943437 100644 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/LICENSE +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors +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 @@ -11,13 +9,13 @@ 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json new file mode 100644 index 00000000000000..ed10c835989889 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "object-assign@^4.1.0", + "_id": "object-assign@4.1.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/object-assign", + "_nodeVersion": "4.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/object-assign-4.1.0.tgz_1462212593641_0.3332549517508596" + }, + "_npmUser": { + "name": "spicyj", + "email": "ben@benalpert.com" + }, + "_npmVersion": "2.14.19", + "_phantomChildren": {}, + "_requested": { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "_shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "_shrinkwrap": null, + "_spec": "object-assign@^4.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/object-assign/issues" + }, + "dependencies": {}, + "description": "ES2015 Object.assign() ponyfill", + "devDependencies": { + "lodash": "^4.8.2", + "matcha": "^0.7.0", + "mocha": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "72fe21c86911758f3342fdf41c2a57860d5829bc", + "homepage": "https://github.com/sindresorhus/object-assign#readme", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "spicyj", + "email": "ben@benalpert.com" + } + ], + "name": "object-assign", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/object-assign.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && mocha" + }, + "version": "4.1.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md new file mode 100644 index 00000000000000..13c097734cfd18 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md @@ -0,0 +1,56 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, source, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md new file mode 100644 index 00000000000000..c12f8340c8d6c6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md @@ -0,0 +1,17 @@ +# 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. + + +# [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13) + + +### Bug Fixes + +* get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8)) +* hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c)) + + +### BREAKING CHANGES + +* signal-exit no longer wires into SIGPROF diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 00000000000000..c7e27478a3eff8 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,14 @@ +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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md new file mode 100644 index 00000000000000..8ebccabecaea4c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md @@ -0,0 +1,40 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the proces to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js new file mode 100644 index 00000000000000..7dd8d917dc507b --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js @@ -0,0 +1,148 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +var assert = require('assert') +var signals = require('./signals.js') + +var EE = require('events') +/* istanbul ignore if */ +if (typeof EE !== 'function') { + EE = EE.EventEmitter +} + +var emitter +if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ +} else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} +} + +module.exports = function (cb, opts) { + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove +} + +module.exports.unload = unload +function unload () { + if (!loaded) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 +} + +function emit (event, code, signal) { + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) +} + +// { : , ... } +var sigListeners = {} +signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } +}) + +module.exports.signals = function () { + return signals +} + +module.exports.load = load + +var loaded = false + +function load () { + if (loaded) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit +} + +var originalProcessReallyExit = process.reallyExit +function processReallyExit (code) { + process.exitCode = code || 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) +} + +var originalProcessEmit = process.emit +function processEmit (ev, arg) { + if (ev === 'exit') { + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json new file mode 100644 index 00000000000000..d43a28af458026 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "signal-exit@^3.0.0", + "_id": "signal-exit@3.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/signal-exit", + "_nodeVersion": "5.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/signal-exit-3.0.0.tgz_1465857346813_0.7961636525578797" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", + "_shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "_shrinkwrap": null, + "_spec": "signal-exit@^3.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "dependencies": {}, + "description": "when you want to fire an event no matter how a process exits.", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.2", + "nyc": "^6.4.4", + "standard": "^7.1.2", + "standard-version": "^2.3.0", + "tap": "^5.7.2" + }, + "directories": {}, + "dist": { + "shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "tarball": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz" + }, + "files": [ + "index.js", + "signals.js" + ], + "gitHead": "2bbec4e5d9f9cf1f7529b1c923d1b058e69ccf7f", + "homepage": "https://github.com/tapjs/signal-exit", + "keywords": [ + "signal", + "exit" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "signal-exit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/signal-exit.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "release": "standard-version", + "test": "tap --timeout=240 ./test/*.js --cov" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js new file mode 100644 index 00000000000000..bc6f97ee606954 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js @@ -0,0 +1,52 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGBUS', + 'SIGFPE', + 'SIGHUP', + 'SIGILL', + 'SIGINT', + 'SIGSEGV', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js new file mode 100644 index 00000000000000..b9bec62440a468 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js @@ -0,0 +1,37 @@ +'use strict'; +var stripAnsi = require('strip-ansi'); +var codePointAt = require('code-point-at'); +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 +module.exports = function (str) { + if (typeof str !== 'string' || str.length === 0) { + return 0; + } + + var width = 0; + + str = stripAnsi(str); + + for (var i = 0; i < str.length; i++) { + var code = codePointAt(str, i); + + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + + // surrogates + if (code >= 0x10000) { + i++; + } + + if (isFullwidthCodePoint(code)) { + width += 2; + } else { + width++; + } + } + + return width; +}; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license similarity index 76% rename from deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license index bcbe13d67a9621..654d0bfe943437 100644 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license @@ -1,8 +1,6 @@ The MIT License (MIT) -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors +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 @@ -11,13 +9,13 @@ 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js new file mode 100644 index 00000000000000..0335117977237f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js @@ -0,0 +1,33 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (str, pos) { + if (str === null || str === undefined) { + throw TypeError(); + } + + str = String(str); + + var size = str.length; + var i = pos ? Number(pos) : 0; + + if (numberIsNan(i)) { + i = 0; + } + + if (i < 0 || i >= size) { + return undefined; + } + + var first = str.charCodeAt(i); + + if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { + var second = str.charCodeAt(i + 1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + + return first; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license @@ -0,0 +1,21 @@ +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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..44730ebd4101fc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/code-point-at/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width/code-point-at" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json new file mode 100644 index 00000000000000..2f4b7334796213 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "code-point-at@^1.0.0", + "_id": "code-point-at@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/code-point-at", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", + "_shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "_shrinkwrap": null, + "_spec": "code-point-at@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/code-point-at/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "ES2015 String#codePointAt() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "tarball": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "c2ffa4064718b37c84c73a633abeeed5b486a469", + "homepage": "https://github.com/sindresorhus/code-point-at", + "keywords": [ + "es2015", + "es6", + "ponyfill", + "polyfill", + "shim", + "string", + "str", + "code", + "point", + "at", + "codepoint", + "unicode" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "code-point-at", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/code-point-at.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md new file mode 100644 index 00000000000000..71e7d0931b8b0c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md @@ -0,0 +1,34 @@ +# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) + +> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save code-point-at +``` + + +## Usage + +```js +var codePointAt = require('code-point-at'); + +codePointAt('🐴'); +//=> 128052 + +codePointAt('abc', 2); +//=> 99 +``` + +## API + +### codePointAt(input, [position]) + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..a7d3e3855f1c24 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // 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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..a0eb06f0150602 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/is-fullwidth-code-point/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width/is-fullwidth-code-point" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..7b83e53a972fa4 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "is-fullwidth-code-point@^1.0.0", + "_id": "is-fullwidth-code-point@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/is-fullwidth-code-point", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "_shrinkwrap": null, + "_spec": "is-fullwidth-code-point@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/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" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "tarball": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f2152d357f41f82785436d428e4f8ede143b7548", + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-fullwidth-code-point", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..4936464b1b4155 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/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 +var 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](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json new file mode 100644 index 00000000000000..624a60c613c5b0 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json @@ -0,0 +1,136 @@ +{ + "_args": [ + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "string-width@^1.0.1", + "_id": "string-width@1.0.2", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.5", + "_phantomChildren": {}, + "_requested": { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge", + "/node-gyp/npmlog/gauge/wide-align" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "_shrinkwrap": null, + "_spec": "string-width@^1.0.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b", + "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", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "string-width", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md new file mode 100644 index 00000000000000..1ab42c93580ecb --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md @@ -0,0 +1,42 @@ +# 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](http://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 --save string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 +``` + + +## 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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore new file mode 100644 index 00000000000000..d1a6b0054bc8f3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore @@ -0,0 +1,5 @@ +*~ +/node_modules +.#* +/.nyc_output +/coverage diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE similarity index 82% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE index 19129e315fe593..f4be44d881b2d9 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/LICENSE +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE @@ -1,6 +1,4 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -11,5 +9,6 @@ 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. +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/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md new file mode 100644 index 00000000000000..32f1be04f09776 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md @@ -0,0 +1,47 @@ +wide-align +---------- + +A wide-character aware text alignment function for use in terminals / on the +console. + +### Usage + +``` +var align = require('wide-align') + +// Note that if you view this on a unicode console, all of the slashes are +// aligned. This is because on a console, all narrow characters are +// an en wide and all wide characters are an em. In browsers, this isn't +// held to and wide characters like "古" can be less than two narrow +// characters even with a fixed width font. + +console.log(align.center('abc', 10)) // ' abc ' +console.log(align.center('古古古', 10)) // ' 古古古 ' +console.log(align.left('abc', 10)) // 'abc ' +console.log(align.left('古古古', 10)) // '古古古 ' +console.log(align.right('abc', 10)) // ' abc' +console.log(align.right('古古古', 10)) // ' 古古古' +``` + +### Functions + +#### `align.center(str, length)` → `str` + +Returns *str* with spaces added to both sides such that that it is *length* +chars long and centered in the spaces. + +#### `align.left(str, length)` → `str` + +Returns *str* with spaces to the right such that it is *length* chars long. + +### `align.right(str, length)` → `str` + +Returns *str* with spaces to the left such that it is *length* chars long. + +### Origins + +These functions were originally taken from +[cliui](https://npmjs.com/package/cliui). Changes include switching to the +MUCH faster pad generation function from +[lodash](https://npmjs.com/package/lodash), making center alignment pad +both sides and adding left alignment. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js new file mode 100644 index 00000000000000..4f94ca4cde19b5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js @@ -0,0 +1,65 @@ +'use strict' +var stringWidth = require('string-width') + +exports.center = alignCenter +exports.left = alignLeft +exports.right = alignRight + +// lodash's way of generating pad characters. + +function createPadding (width) { + var result = '' + var string = ' ' + var n = width + do { + if (n % 2) { + result += string; + } + n = Math.floor(n / 2); + string += string; + } while (n); + + return result; +} + +function alignLeft (str, width) { + var trimmed = str.trimRight() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return trimmed + padding +} + +function alignRight (str, width) { + var trimmed = str.trimLeft() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return padding + trimmed +} + +function alignCenter (str, width) { + var trimmed = str.trim() + if (trimmed.length === 0 && str.length >= width) return str + var padLeft = '' + var padRight = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + var padLeftBy = parseInt((width - strWidth) / 2, 10) + padLeft = createPadding(padLeftBy) + padRight = createPadding(width - (strWidth + padLeftBy)) + } + + return padLeft + trimmed + padRight +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json new file mode 100644 index 00000000000000..6729516f83b95c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "wide-align@^1.1.0", + "_id": "wide-align@1.1.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/wide-align", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.5.3", + "_phantomChildren": {}, + "_requested": { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz", + "_shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "_shrinkwrap": null, + "_spec": "wide-align@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/wide-align/issues" + }, + "dependencies": { + "string-width": "^1.0.1" + }, + "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", + "devDependencies": { + "tap": "^2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "tarball": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz" + }, + "gitHead": "fe3f7f210650913d5bee702d7e19938f6977bc8a", + "homepage": "https://github.com/iarna/wide-align#readme", + "keywords": [ + "wide", + "double", + "unicode", + "cjkv", + "pad", + "align" + ], + "license": "ISC", + "main": "align.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "wide-align", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/wide-align.git" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js new file mode 100644 index 00000000000000..64e9f9dbda4697 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js @@ -0,0 +1,37 @@ +'use strict' +var test = require('tap').test +var align = require('..') + +test('align', function (t) { + t.is(align.center('abc', 10), ' abc ', 'center narrow') + t.is(align.center('古古古', 10), ' 古古古 ', 'center wide') + t.is(align.left('abc', 10), 'abc ', 'left narrow') + t.is(align.left('古古古', 10), '古古古 ', 'left wide') + t.is(align.right('abc', 10), ' abc', 'right narrow') + t.is(align.right('古古古', 10), ' 古古古', 'right wide') + + t.is(align.center('abc', 2), 'abc', 'center narrow overflow') + t.is(align.center('古古古', 4), '古古古', 'center wide overflow') + t.is(align.left('abc', 2), 'abc', 'left narrow overflow') + t.is(align.left('古古古', 4), '古古古', 'left wide overflow') + t.is(align.right('abc', 2), 'abc', 'right narrow overflow') + t.is(align.right('古古古', 4), '古古古', 'right wide overflow') + + t.is(align.left('', 5), ' ', 'left align nothing') + t.is(align.center('', 5), ' ', 'center align nothing') + t.is(align.right('', 5), ' ', 'right align nothing') + + t.is(align.left(' ', 5), ' ', 'left align whitespace') + t.is(align.center(' ', 5), ' ', 'center align whitespace') + t.is(align.right(' ', 5), ' ', 'right align whitespace') + + t.is(align.left(' ', 2), ' ', 'left align whitespace overflow') + t.is(align.center(' ', 2), ' ', 'center align whitespace overflow') + t.is(align.right(' ', 2), ' ', 'right align whitespace overflow') + + t.is(align.left('x ', 10), 'x ', 'left align whitespace mix') + t.is(align.center('x ', 10), ' x ', 'center align whitespace mix') + t.is(align.right('x ', 10), ' x', 'right align whitespace mix') + + t.end() +}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json index 6d3424f0acbdbb..86fcce6f26980e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json @@ -2,72 +2,116 @@ "_args": [ [ { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", "name": "gauge", - "raw": "gauge@~1.2.5", - "rawSpec": "~1.2.5", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "gauge@~2.6.0", "scope": null, - "spec": ">=1.2.5 <1.3.0", + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" ] ], - "_from": "gauge@>=1.2.5 <1.3.0", - "_id": "gauge@1.2.7", + "_from": "gauge@~2.6.0", + "_id": "gauge@2.6.0", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog/gauge", - "_nodeVersion": "4.2.2", + "_nodeVersion": "4.4.0", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/gauge-1.2.7.tgz_1455835409513_0.6293477965518832" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/gauge-2.6.0.tgz_1466067371972_0.20705468393862247" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": { + "strip-ansi": "3.0.1" }, - "_npmVersion": "3.7.2", - "_phantomChildren": {}, "_requested": { - "name": "gauge", - "raw": "gauge@~1.2.5", - "rawSpec": "~1.2.5", + "raw": "gauge@~2.6.0", "scope": null, - "spec": ">=1.2.5 <1.3.0", + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", "type": "range" }, "_requiredBy": [ "/node-gyp/npmlog" ], - "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", - "_shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz", + "_shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", "_shrinkwrap": null, - "_spec": "gauge@~1.2.5", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog", + "_spec": "gauge@~2.6.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", "author": { - "email": "me@re-becca.org", - "name": "Rebecca Turner" + "name": "Rebecca Turner", + "email": "me@re-becca.org" }, "bugs": { "url": "https://github.com/iarna/gauge/issues" }, "dependencies": { - "ansi": "^0.3.0", + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-color": "^0.1.7", "has-unicode": "^2.0.0", - "lodash.pad": "^4.1.0", - "lodash.padend": "^4.1.0", - "lodash.padstart": "^4.1.0" + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" }, "description": "A terminal based horizontal guage", "devDependencies": { - "tap": "^5.6.0" + "readable-stream": "^2.0.6", + "require-inject": "^1.4.0", + "standard": "^7.1.2", + "tap": "^5.7.2", + "through2": "^2.0.0" }, "directories": {}, "dist": { - "shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", - "tarball": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz" + "shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", + "tarball": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz" }, - "gitHead": "75a7d0a4ed67489ac992ed3d211bed60376ca7c1", + "files": [ + "base-theme.js", + "CHANGELOG.md", + "error.js", + "has-color.js", + "index.js", + "LICENSE", + "package.json", + "plumbing.js", + "process.js", + "progress-bar.js", + "README.md", + "render-template.js", + "set-immediate.js", + "set-interval.js", + "spin.js", + "template-item.js", + "theme-set.js", + "themes.js", + "wide-truncate.js" + ], + "gitHead": "d51040a71c269432c16cc542143f403a831630e6", "homepage": "https://github.com/iarna/gauge", "keywords": [ "progressbar", @@ -75,11 +119,11 @@ "gauge" ], "license": "ISC", - "main": "progress-bar.js", + "main": "index.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" } ], "name": "gauge", @@ -90,7 +134,7 @@ "url": "git+https://github.com/iarna/gauge.git" }, "scripts": { - "test": "tap test/*.js" + "test": "standard && tap test/*.js --coverage" }, - "version": "1.2.7" + "version": "2.6.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/plumbing.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/plumbing.js new file mode 100644 index 00000000000000..589a9c92878ebf --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/plumbing.js @@ -0,0 +1,47 @@ +'use strict' +var consoleControl = require('console-control-strings') +var renderTemplate = require('./render-template.js') +var validate = require('aproba') + +var Plumbing = module.exports = function (theme, template, width) { + if (!width) width = 80 + validate('OAN', [theme, template, width]) + this.showing = false + this.theme = theme + this.width = width + this.template = template +} +Plumbing.prototype = {} + +Plumbing.prototype.setTheme = function (theme) { + validate('O', [theme]) + this.theme = theme +} + +Plumbing.prototype.setTemplate = function (template) { + validate('A', [template]) + this.template = template +} + +Plumbing.prototype.setWidth = function (width) { + validate('N', [width]) + this.width = width +} + +Plumbing.prototype.hide = function () { + return consoleControl.gotoSOL() + consoleControl.eraseLine() +} + +Plumbing.prototype.hideCursor = consoleControl.hideCursor + +Plumbing.prototype.showCursor = consoleControl.showCursor + +Plumbing.prototype.show = function (status) { + var values = Object.create(this.theme) + for (var key in status) { + values[key] = status[key] + } + + return renderTemplate(this.width, this.template, values).trim() + + consoleControl.eraseLine() + consoleControl.gotoSOL() +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/process.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/process.js new file mode 100644 index 00000000000000..05e85694d755b6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/process.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = process diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js index ddfc4a44be4ded..7f8dd68be24cf0 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js @@ -1,225 +1,35 @@ -"use strict" -var hasUnicode = require("has-unicode") -var ansi = require("ansi") -var align = { - center: require("lodash.pad"), - left: require("lodash.padend"), - right: require("lodash.padstart") -} -var defaultStream = process.stderr -function isTTY() { - return process.stderr.isTTY -} -function getWritableTTYColumns() { - // Writing to the final column wraps the line - // We have to use stdout here, because Node's magic SIGWINCH handler only - // updates process.stdout, not process.stderr - return process.stdout.columns - 1 -} - -var ProgressBar = module.exports = function (options, cursor) { - if (! options) options = {} - if (! cursor && options.write) { - cursor = options - options = {} - } - if (! cursor) { - cursor = ansi(defaultStream) - } - this.cursor = cursor - this.showing = false - this.theme = options.theme || (hasUnicode() ? ProgressBar.unicode : ProgressBar.ascii) - this.template = options.template || [ - {type: "name", separated: true, length: 25}, - {type: "spinner", separated: true}, - {type: "startgroup"}, - {type: "completionbar"}, - {type: "endgroup"} +'use strict' +var validate = require('aproba') +var renderTemplate = require('./render-template.js') +var wideTruncate = require('./wide-truncate') +var stringWidth = require('string-width') + +module.exports = function (theme, width, completed) { + validate('ONN', [theme, width, completed]) + if (completed < 0) completed = 0 + if (completed > 1) completed = 1 + if (width <= 0) return '' + var sofar = Math.round(width * completed) + var rest = width - sofar + var template = [ + {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, + {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} ] - this.updatefreq = options.maxUpdateFrequency == null ? 50 : options.maxUpdateFrequency - this.lastName = "" - this.lastCompleted = 0 - this.spun = 0 - this.last = new Date(0) - - var self = this - this._handleSizeChange = function () { - if (!self.showing) return - self.hide() - self.show() - } -} -ProgressBar.prototype = {} - -ProgressBar.unicode = { - startgroup: "╢", - endgroup: "╟", - complete: "█", - incomplete: "░", - spinner: "▀▐▄▌", - subsection: "→" -} - -ProgressBar.ascii = { - startgroup: "|", - endgroup: "|", - complete: "#", - incomplete: "-", - spinner: "-\\|/", - subsection: "->" -} - -ProgressBar.prototype.setTheme = function(theme) { - this.theme = theme -} - -ProgressBar.prototype.setTemplate = function(template) { - this.template = template -} - -ProgressBar.prototype._enableResizeEvents = function() { - process.stdout.on('resize', this._handleSizeChange) -} - -ProgressBar.prototype._disableResizeEvents = function() { - process.stdout.removeListener('resize', this._handleSizeChange) -} - -ProgressBar.prototype.disable = function() { - this.hide() - this.disabled = true -} - -ProgressBar.prototype.enable = function() { - this.disabled = false - this.show() -} - -ProgressBar.prototype.hide = function() { - if (!isTTY()) return - if (this.disabled) return - this.cursor.show() - if (this.showing) this.cursor.up(1) - this.cursor.horizontalAbsolute(0).eraseLine() - this.showing = false + return renderTemplate(width, template, theme) } -var repeat = function (str, count) { - var out = "" - for (var ii=0; ii remainingSpace) length = remainingSpace + outputLength += length + remainingSpace -= length + } + + function finishSizing (item, length) { + if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') + if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') + if (length != null) item.length = length + item.minLength = null + item.maxLength = null + --variableCount + item.finished = true + if (item.length == null) item.length = item.getBaseLength() + if (item.length == null) throw new error.Internal('Finished template items must have a length') + consumeSpace(item.getLength()) + } + + output.forEach(function (item) { + if (!item.kerning) return + var prevPadRight = item.first ? 0 : output[item.index - 1].padRight + if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight + if (!item.last) item.padRight = item.kerning + }) + + // Finish any that have a fixed (literal or intuited) length + output.forEach(function (item) { + if (item.getBaseLength() == null) return + finishSizing(item) + }) + + var resized = 0 + var resizing + var hunkSize + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.maxLength) return + if (item.getMaxLength() < hunkSize) { + finishSizing(item, item.maxLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + + resized = 0 + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.minLength) return + if (item.getMinLength() >= hunkSize) { + finishSizing(item, item.minLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + finishSizing(item, hunkSize) + }) + + return output +} + +function renderFunction (item, values, length) { + validate('OON', arguments) + if (item.type) { + return item.value(values, values[item.type + 'Theme'] || {}, length) + } else { + return item.value(values, {}, length) + } +} + +function renderValue (item, values) { + var length = item.getBaseLength() + var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value + if (value == null || value === '') return '' + var alignWith = align[item.align] || align.left + var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' + var rightPadding = item.padRight ? align.right('', item.padRight) : '' + var truncated = wideTruncate(String(value), length) + var aligned = alignWith(truncated, length) + return leftPadding + aligned + rightPadding +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-immediate.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-immediate.js new file mode 100644 index 00000000000000..6650a485c49933 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-immediate.js @@ -0,0 +1,7 @@ +'use strict' +var process = require('./process') +try { + module.exports = setImmediate +} catch (ex) { + module.exports = process.nextTick +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-interval.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-interval.js new file mode 100644 index 00000000000000..576198793c5504 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-interval.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = setInterval diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/spin.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/spin.js new file mode 100644 index 00000000000000..34142ee31acc7c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/spin.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = function spin (spinstr, spun) { + return spinstr[spun % spinstr.length] +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/template-item.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/template-item.js new file mode 100644 index 00000000000000..e46f447c941d38 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/template-item.js @@ -0,0 +1,73 @@ +'use strict' +var stringWidth = require('string-width') + +module.exports = TemplateItem + +function isPercent (num) { + if (typeof num !== 'string') return false + return num.slice(-1) === '%' +} + +function percent (num) { + return Number(num.slice(0, -1)) / 100 +} + +function TemplateItem (values, outputLength) { + this.overallOutputLength = outputLength + this.finished = false + this.type = null + this.value = null + this.length = null + this.maxLength = null + this.minLength = null + this.kerning = null + this.align = 'left' + this.padLeft = 0 + this.padRight = 0 + this.index = null + this.first = null + this.last = null + if (typeof values === 'string') { + this.value = values + } else { + for (var prop in values) this[prop] = values[prop] + } + // Realize percents + if (isPercent(this.length)) { + this.length = Math.round(this.overallOutputLength * percent(this.length)) + } + if (isPercent(this.minLength)) { + this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) + } + if (isPercent(this.maxLength)) { + this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) + } + return this +} + +TemplateItem.prototype = {} + +TemplateItem.prototype.getBaseLength = function () { + var length = this.length + if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + length = stringWidth(this.value) + } + return length +} + +TemplateItem.prototype.getLength = function () { + var length = this.getBaseLength() + if (length == null) return null + return length + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMaxLength = function () { + if (this.maxLength == null) return null + return this.maxLength + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMinLength = function () { + if (this.minLength == null) return null + return this.minLength + this.padLeft + this.padRight +} + diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/test/progress-bar.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/test/progress-bar.js deleted file mode 100644 index 5d3e7e78fe000e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/test/progress-bar.js +++ /dev/null @@ -1,176 +0,0 @@ -"use strict" -var test = require("tap").test -var ProgressBar = require("../progress-bar.js") - -var cursor = [] -var C -var bar = new ProgressBar({theme: ProgressBar.ascii, maxUpdateFrequency: 0}, C = { - show: function () { - cursor.push(["show"]) - return C - }, - hide: function () { - cursor.push(["hide"]) - return C - }, - up: function (lines) { - cursor.push(["up",lines]) - return C - }, - horizontalAbsolute: function (col) { - cursor.push(["horizontalAbsolute", col]) - return C - }, - eraseLine: function () { - cursor.push(["eraseLine"]) - return C - }, - write: function (line) { - cursor.push(["write", line]) - return C - } -}) - - -function isOutput(t, msg, output) { - var tests = [] - for (var ii = 0; ii P | |----|\n' ], - [ 'show' ] ]) -}) - -test("window resizing", function (t) { - t.plan(16) - process.stderr.isTTY = true - process.stdout.columns = 32 - bar.show("NAME", 0.1) - cursor = [] - bar.last = new Date(0) - bar.pulse() - isOutput(t, "32 columns", - [ [ 'up', 1 ], - [ 'hide' ], - [ 'horizontalAbsolute', 0 ], - [ 'write', 'NAME / |##------------------|\n' ], - [ 'show' ] ]) - - process.stdout.columns = 16 - bar.show("NAME", 0.5) - cursor = [] - bar.last = new Date(0) - bar.pulse() - isOutput(t, "16 columns", - [ [ 'up', 1 ], - [ 'hide' ], - [ 'horizontalAbsolute', 0 ], - [ 'write', 'NAME - |##--|\n' ], - [ 'show' ] ]); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/theme-set.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/theme-set.js new file mode 100644 index 00000000000000..68971d5d231b07 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/theme-set.js @@ -0,0 +1,115 @@ +'use strict' +var objectAssign = require('object-assign') + +module.exports = function () { + return ThemeSetProto.newThemeSet() +} + +var ThemeSetProto = {} + +ThemeSetProto.baseTheme = require('./base-theme.js') + +ThemeSetProto.newTheme = function (parent, theme) { + if (!theme) { + theme = parent + parent = this.baseTheme + } + return objectAssign({}, parent, theme) +} + +ThemeSetProto.getThemeNames = function () { + return Object.keys(this.themes) +} + +ThemeSetProto.addTheme = function (name, parent, theme) { + this.themes[name] = this.newTheme(parent, theme) +} + +ThemeSetProto.addToAllThemes = function (theme) { + var themes = this.themes + Object.keys(themes).forEach(function (name) { + objectAssign(themes[name], theme) + }) + objectAssign(this.baseTheme, theme) +} + +ThemeSetProto.getTheme = function (name) { + if (!this.themes[name]) throw this.newMissingThemeError(name) + return this.themes[name] +} + +ThemeSetProto.setDefault = function (opts, name) { + if (name == null) { + name = opts + opts = {} + } + var platform = opts.platform == null ? 'fallback' : opts.platform + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + this.defaults[platform][hasUnicode][hasColor] = name +} + +ThemeSetProto.getDefault = function (opts) { + if (!opts) opts = {} + var platformName = opts.platform || process.platform + var platform = this.defaults[platformName] || this.defaults.fallback + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform[hasUnicode][hasColor]) { + if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { + hasUnicode = false + hasColor = false + } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (platform === this.defaults.fallback) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } + } + if (platform[hasUnicode][hasColor]) { + return this.getTheme(platform[hasUnicode][hasColor]) + } else { + return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + } +} + +ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { + var err = new Error('Could not find a gauge theme named "' + name + '"') + Error.captureStackTrace.call(err, newMissingThemeError) + err.theme = name + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + + ' platform = ' + platformName + '\n' + + ' hasUnicode = ' + hasUnicode + '\n' + + ' hasColor = ' + hasColor) + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newThemeSet = function () { + var themeset = function (opts) { + return themeset.getDefault(opts) + } + return objectAssign(themeset, ThemeSetProto, { + themes: objectAssign({}, this.themes), + baseTheme: objectAssign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})) + }) +} + diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/themes.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/themes.js new file mode 100644 index 00000000000000..eb5a4f5b5e1034 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/themes.js @@ -0,0 +1,54 @@ +'use strict' +var consoleControl = require('console-control-strings') +var ThemeSet = require('./theme-set.js') + +var themes = module.exports = new ThemeSet() + +themes.addTheme('ASCII', { + preProgressbar: '[', + postProgressbar: ']', + progressbarTheme: { + complete: '#', + remaining: '.' + }, + activityIndicatorTheme: '-\\|/', + preSubsection: '>' +}) + +themes.addTheme('colorASCII', themes.getTheme('ASCII'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '.', + postRemaining: consoleControl.color('reset') + } +}) + +themes.addTheme('brailleSpinner', { + preProgressbar: '⸨', + postProgressbar: '⸩', + progressbarTheme: { + complete: '░', + remaining: '⠂' + }, + activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', + preSubsection: '>' +}) + +themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '░', + postRemaining: consoleControl.color('reset') + } +}) + +themes.setDefault({}, 'ASCII') +themes.setDefault({hasColor: true}, 'colorASCII') +themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/wide-truncate.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/wide-truncate.js new file mode 100644 index 00000000000000..c531bc491fbb58 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/wide-truncate.js @@ -0,0 +1,25 @@ +'use strict' +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') + +module.exports = wideTruncate + +function wideTruncate (str, target) { + if (stringWidth(str) === 0) return str + if (target <= 0) return '' + if (stringWidth(str) <= target) return str + + // We compute the number of bytes of ansi sequences here and add + // that to our initial truncation to ensure that we don't slice one + // that we want to keep in half. + var noAnsi = stripAnsi(str) + var ansiSize = str.length + noAnsi.length + var truncated = str.slice(0, target + ansiSize) + + // we have to shrink the result to account for our ansi sequence buffer + // (if an ansi sequence was truncated) and double width characters. + while (stringWidth(truncated) > target) { + truncated = truncated.slice(0, -1) + } + return truncated +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md new file mode 100644 index 00000000000000..03bf591923d782 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/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/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17) + + +### Features + +* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277)) + + +### BREAKING CHANGES + +* stdio/stderr will not be set to blocking if isTTY === false + + + + +# 1.0.0 (2016-05-14) + + +### Features + +* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0)) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt new file mode 100644 index 00000000000000..836440bef7cf14 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, 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/node-gyp/node_modules/npmlog/node_modules/set-blocking/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/README.md new file mode 100644 index 00000000000000..e93b4202b59d65 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/README.md @@ -0,0 +1,31 @@ +# set-blocking + +[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) +[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) +[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. + +```js +const setBlocking = require('set-blocking') +setBlocking(true) +console.log(someLargeStringToOutput) +``` + +## Historical Context/Word of Warning + +This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on +newer versions of Node.js (`0.12+`), truncating terminal output. + +You should be mindful of the side-effects caused by using `set-blocking`: + +* if your module sets blocking to `true`, it will effect other modules + consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call + `setBlocking(true)` once we already know we are about to call `process.exit(code)`. +* this patch will not apply to subprocesses spawned with `isTTY = true`, this is + the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). + +## License + +ISC diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/index.js new file mode 100644 index 00000000000000..6f78774bb63ee6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/index.js @@ -0,0 +1,7 @@ +module.exports = function (blocking) { + [process.stdout, process.stderr].forEach(function (stream) { + if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(blocking) + } + }) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/package.json new file mode 100644 index 00000000000000..1db092f9c4ee05 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" + ] + ], + "_from": "set-blocking@~2.0.0", + "_id": "set-blocking@2.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/set-blocking", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/set-blocking-2.0.0.tgz_1463525966987_0.5456729622092098" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog" + ], + "_resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "_shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "_shrinkwrap": null, + "_spec": "set-blocking@~2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/set-blocking/issues" + }, + "dependencies": {}, + "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.9", + "mocha": "^2.4.5", + "nyc": "^6.4.4", + "standard": "^7.0.1", + "standard-version": "^2.2.1" + }, + "directories": {}, + "dist": { + "shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "tarball": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + }, + "files": [ + "index.js", + "LICENSE.txt" + ], + "gitHead": "7eec10577b5fff264de477ba3b9d07f404946eff", + "homepage": "https://github.com/yargs/set-blocking#readme", + "keywords": [ + "flush", + "terminal", + "blocking", + "shim", + "stdio", + "stderr" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + } + ], + "name": "set-blocking", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/yargs/set-blocking.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "test": "nyc mocha ./test/*.js", + "version": "standard-version" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json index 7bfb84713ac3d5..83078bd19721c7 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json @@ -2,96 +2,101 @@ "_args": [ [ { - "name": "npmlog", - "raw": "npmlog@0 || 1 || 2", - "rawSpec": "0 || 1 || 2", + "raw": "npmlog@0 || 1 || 2 || 3", "scope": null, - "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0", + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "0 || 1 || 2 || 3", + "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp" ] ], - "_from": "npmlog@>=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0", - "_id": "npmlog@2.0.4", + "_from": "npmlog@>=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "_id": "npmlog@3.1.2", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog", - "_nodeVersion": "5.10.1", + "_nodeVersion": "4.4.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/npmlog-2.0.4.tgz_1463616637725_0.461703865788877" + "tmp": "tmp/npmlog-3.1.2.tgz_1466073052641_0.36111341998912394" }, "_npmUser": { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "iarna", + "email": "me@re-becca.org" }, - "_npmVersion": "3.9.1", + "_npmVersion": "3.9.6", "_phantomChildren": { - "has-unicode": "2.0.0", - "readable-stream": "2.1.3" + "aproba": "1.0.4", + "has-unicode": "2.0.1", + "readable-stream": "2.1.4", + "strip-ansi": "3.0.1" }, "_requested": { - "name": "npmlog", - "raw": "npmlog@0 || 1 || 2", - "rawSpec": "0 || 1 || 2", + "raw": "npmlog@0 || 1 || 2 || 3", "scope": null, - "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0", + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "0 || 1 || 2 || 3", + "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, "_requiredBy": [ "/node-gyp" ], - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", - "_shasum": "98b52530f2514ca90d09ec5b22c8846722375692", + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz", + "_shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", "_shrinkwrap": null, - "_spec": "npmlog@0 || 1 || 2", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp", + "_spec": "npmlog@0 || 1 || 2 || 3", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { "url": "https://github.com/npm/npmlog/issues" }, "dependencies": { - "ansi": "~0.3.1", "are-we-there-yet": "~1.1.2", - "gauge": "~1.2.5" + "console-control-strings": "~1.1.0", + "gauge": "~2.6.0", + "set-blocking": "~2.0.0" }, "description": "logger for npm", "devDependencies": { + "standard": "~7.1.2", "tap": "~5.7.0" }, "directories": {}, "dist": { - "shasum": "98b52530f2514ca90d09ec5b22c8846722375692", - "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz" + "shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz" }, "files": [ "log.js" ], - "gitHead": "3732fd4ba1ca2d47c6102343e6c3fb7e66df7fe5", + "gitHead": "444e237743fa1339cb91bea2d3f16f710be56984", "homepage": "https://github.com/npm/npmlog#readme", "license": "ISC", "main": "log.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "npmlog", @@ -102,7 +107,7 @@ "url": "git+https://github.com/npm/npmlog.git" }, "scripts": { - "test": "tap test/*.js" + "test": "standard && tap test/*.js" }, - "version": "2.0.4" + "version": "3.1.2" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json index a60580a9d183e5..f037c9bfd85416 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "ms@0.7.1", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug" + { + "raw": "ms@0.7.1", + "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.7.1", + "spec": "0.7.1", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug" ] ], "_from": "ms@0.7.1", @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array/array-index/debug/ms", "_nodeVersion": "0.12.2", "_npmUser": { - "email": "rauchg@gmail.com", - "name": "rauchg" + "name": "rauchg", + "email": "rauchg@gmail.com" }, "_npmVersion": "2.7.5", "_phantomChildren": {}, "_requested": { - "name": "ms", "raw": "ms@0.7.1", - "rawSpec": "0.7.1", "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.7.1", "spec": "0.7.1", "type": "version" }, @@ -32,7 +41,7 @@ "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", "_shrinkwrap": null, "_spec": "ms@0.7.1", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug", "bugs": { "url": "https://github.com/guille/ms.js/issues" }, @@ -51,7 +60,7 @@ "directories": {}, "dist": { "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + "tarball": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" }, "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", "homepage": "https://github.com/guille/ms.js", diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json index 758deaf8c330e0..08cc48fc547aa2 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "debug@*", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" + { + "raw": "debug@^2.2.0", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" ] ], - "_from": "debug@*", + "_from": "debug@>=2.2.0 <3.0.0", "_id": "debug@2.2.0", "_inCache": true, "_installable": true, "_location": "/node-gyp/path-array/array-index/debug", "_nodeVersion": "0.12.2", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "2.7.4", "_phantomChildren": {}, "_requested": { - "name": "debug", - "raw": "debug@*", - "rawSpec": "*", + "raw": "debug@^2.2.0", "scope": null, - "spec": "*", + "escapedName": "debug", + "name": "debug", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", "type": "range" }, "_requiredBy": [ @@ -31,11 +40,11 @@ "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", "_shrinkwrap": null, - "_spec": "debug@*", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", + "_spec": "debug@^2.2.0", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", "author": { - "email": "tj@vision-media.ca", - "name": "TJ Holowaychuk" + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" }, "browser": "./browser.js", "bugs": { @@ -43,8 +52,8 @@ }, "component": { "scripts": { - "debug/debug.js": "debug.js", - "debug/index.js": "browser.js" + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" } }, "contributors": [ @@ -65,14 +74,14 @@ "directories": {}, "dist": { "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + "tarball": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" }, "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", "homepage": "https://github.com/visionmedia/debug", "keywords": [ "debug", - "debugger", - "log" + "log", + "debugger" ], "license": "MIT", "main": "./node.js", diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml index 6830765b567773..0b1f5e4ae340b6 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml @@ -4,6 +4,7 @@ node_js: - 0.12 - v4 - v5 + - v6 notifications: email: diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES index cbedd4244bc8b6..6aebe74ada9f65 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES @@ -1,3 +1,9 @@ +v3.1.0 -- 2016.05.17 +* Fix internals of symbol detection +* Ensure Symbol.prototype[Symbol.toPrimitive] in all cases returns primitive value + (fixes Node v6 support) +* Create native symbols whenver possible + v3.0.2 -- 2015.12.12 * Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of polyfill. See #13 diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js index 53759f32124b1c..93629d2f84768a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js @@ -1,18 +1,17 @@ 'use strict'; +var validTypes = { object: true, symbol: true }; + module.exports = function () { var symbol; if (typeof Symbol !== 'function') return false; symbol = Symbol('test symbol'); try { String(symbol); } catch (e) { return false; } - if (typeof Symbol.iterator === 'symbol') return true; - // Return 'true' for polyfills - if (typeof Symbol.isConcatSpreadable !== 'object') return false; - if (typeof Symbol.iterator !== 'object') return false; - if (typeof Symbol.toPrimitive !== 'object') return false; - if (typeof Symbol.toStringTag !== 'object') return false; - if (typeof Symbol.unscopables !== 'object') return false; + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) return false; + if (!validTypes[typeof Symbol.toPrimitive]) return false; + if (!validTypes[typeof Symbol.toStringTag]) return false; return true; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js index a8cb8b8681ee69..5f073a19cab7c8 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js @@ -4,5 +4,5 @@ module.exports = (function () { if (typeof Symbol !== 'function') return false; - return (typeof Symbol.iterator === 'symbol'); + return (typeof Symbol() === 'symbol'); }()); diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js index beeba2cb4fa23f..074cb07fb575c2 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js @@ -1,5 +1,9 @@ 'use strict'; module.exports = function (x) { - return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false; + if (!x) return false; + if (typeof x === 'symbol') return true; + if (!x.constructor) return false; + if (x.constructor.name !== 'Symbol') return false; + return (x[x.constructor.toStringTag] === 'Symbol'); }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json index b7c327850c5f13..0c7a110a4d164d 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "d@~0.1.1", + { + "raw": "d@~0.1.1", + "scope": null, + "escapedName": "d", + "name": "d", + "rawSpec": "~0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" ] ], @@ -11,16 +19,17 @@ "_installable": true, "_location": "/node-gyp/path-array/array-index/es6-symbol/d", "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, "_npmVersion": "1.4.3", "_phantomChildren": {}, "_requested": { - "name": "d", "raw": "d@~0.1.1", - "rawSpec": "~0.1.1", "scope": null, + "escapedName": "d", + "name": "d", + "rawSpec": "~0.1.1", "spec": ">=0.1.1 <0.2.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "d@~0.1.1", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -51,18 +60,18 @@ "directories": {}, "dist": { "shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", - "tarball": "http://registry.npmjs.org/d/-/d-0.1.1.tgz" + "tarball": "https://registry.npmjs.org/d/-/d-0.1.1.tgz" }, "homepage": "https://github.com/medikoo/d", "keywords": [ "descriptor", - "descriptors", - "ecma", - "ecmascript", "es", + "ecmascript", + "ecma", + "property", + "descriptors", "meta", - "properties", - "property" + "properties" ], "license": "MIT", "maintainers": [ diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml index e8e18ee77d88ed..39fd70e64ed706 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml @@ -4,6 +4,7 @@ node_js: - 0.12 - 4 - 5 + - 6 before_install: - mkdir node_modules; ln -s ../ node_modules/es5-ext diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES index 92ee5f6ef64ca9..4ecc2db0753863 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES @@ -1,3 +1,8 @@ +v0.10.12 -- 2016.07.01 +* Ensure symbols are copied in Object.mixin +* Prevent RangeError errors in array#flatten +* Do not validate invalidate dates in validDate + v0.10.11 -- 2015.12.18 * Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens) diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md index ad09fe2317bfa7..11d8a343d57f1f 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md @@ -11,7 +11,7 @@ When used in ECMAScript 6 environment, native implementation (if valid) takes pr ### Installation $ npm install es5-ext - + To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) ### Usage @@ -114,7 +114,7 @@ Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/ configurable: true, enumerable: false, writable: true }); ``` -See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. __Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of. @@ -162,7 +162,7 @@ Object that represents global scope #### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned. #### generate([length[, …fill]]) _(es5-ext/array/generate)_ @@ -175,7 +175,7 @@ Returns true if object is plain array (not instance of one of the Array's extens #### of([…items]) _(es5-ext/array/of)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). Create an array from given arguments. #### toArray(obj) _(es5-ext/array/to-array)_ @@ -190,7 +190,7 @@ Returns `obj` if it's an array, otherwise throws `TypeError` #### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_ -In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_. +In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_. It's variant of binary search algorithm #### arr.clear() _(es5-ext/array/#/clear)_ @@ -203,7 +203,7 @@ Returns a copy of the context with all non-values (`null` or `undefined`) remove #### arr.concat() _(es5-ext/array/#/concat)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context. #### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_ @@ -212,7 +212,7 @@ Whether list contains the given value. #### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). #### arr.diff(other) _(es5-ext/array/#/diff)_ @@ -228,7 +228,7 @@ _egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla. #### arr.entries() _(es5-ext/array/#/entries)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value. #### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_ @@ -237,21 +237,21 @@ Returns the array of elements that are found only in one of the lists (either co #### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). #### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). ES6's version of `filter`, returns array of same type as the context. #### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). Return first element for which given function returns true #### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). Return first index for which given function returns true #### arr.first() _(es5-ext/array/#/first)_ @@ -292,7 +292,7 @@ Returns true if all values in array are unique #### arr.keys() _(es5-ext/array/#/keys)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). Returns iterator object, which traverses all array indexes. #### arr.last() _(es5-ext/array/#/last)_ @@ -305,7 +305,7 @@ Returns last defined index of the array #### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). ES6's version of `map`, returns array of same type as the context. #### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_ @@ -318,7 +318,7 @@ Returns array with items separated with `sep` value #### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). ES6's version of `slice`, returns array of same type as the context. #### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_ @@ -327,7 +327,7 @@ ES6's version of `slice`, returns array of same type as the context. #### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). ES6's version of `splice`, returns array of same type as the context. #### arr.uniq() _(es5-ext/array/#/uniq)_ @@ -336,12 +336,12 @@ Returns duplicate-free version of the array #### arr.values() _(es5-ext/array/#/values)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). Returns iterator object which traverses all array values. #### arr[@@iterator] _(es5-ext/array/#/@@iterator)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). Returns iterator object which traverses all array values. ### Boolean Constructor extensions @@ -399,11 +399,11 @@ Formats date up to given string. Supported patterns: #### custom(message/*, code, ext*/) _(es5-ext/error/custom)_ -Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) +Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) #### isError(x) _(es5-ext/error/is-error)_ -Whether value is an error (instance of `Error`). +Whether value is an error (instance of `Error`). #### validError(x) _(es5-ext/error/valid-error)_ @@ -434,7 +434,7 @@ _i(x) =def x_ #### invoke(name[, …args]) _(es5-ext/function/invoke)_ Returns a function that takes an object as an argument, and applies object's -_name_ method to arguments. +_name_ method to arguments. _name_ can be name of the method or method itself. _invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_ @@ -478,7 +478,7 @@ Produces copy of given function #### fn.curry([n]) _(es5-ext/function/#/curry)_ -Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. +Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. If _n_ is not provided then it defaults to context function length _f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_ @@ -517,93 +517,93 @@ Serializes function into two (arguments and body) string tokens. Result is plain #### acosh(x) _(es5-ext/math/acosh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). #### asinh(x) _(es5-ext/math/asinh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). #### atanh(x) _(es5-ext/math/atanh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). #### cbrt(x) _(es5-ext/math/cbrt)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). #### clz32(x) _(es5-ext/math/clz32)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). #### cosh(x) _(es5-ext/math/cosh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). #### expm1(x) _(es5-ext/math/expm1)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). #### fround(x) _(es5-ext/math/fround)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). #### hypot([…values]) _(es5-ext/math/hypot)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). #### imul(x, y) _(es5-ext/math/imul)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). #### log1p(x) _(es5-ext/math/log1p)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). #### log2(x) _(es5-ext/math/log2)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). #### log10(x) _(es5-ext/math/log10)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). #### sign(x) _(es5-ext/math/sign)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). #### sinh(x) _(es5-ext/math/sinh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). #### tanh(x) _(es5-ext/math/tanh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). #### trunc(x) _(es5-ext/math/trunc)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). ### Number Constructor extensions #### EPSILON _(es5-ext/number/epsilon)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16. #### isFinite(x) _(es5-ext/number/is-finite)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). Whether value is finite. Differs from global isNaN that it doesn't do type coercion. #### isInteger(x) _(es5-ext/number/is-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). Whether value is integer. #### isNaN(x) _(es5-ext/number/is-nan)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). Whether value is NaN. Differs from global isNaN that it doesn't do type coercion. #### isNumber(x) _(es5-ext/number/is-number)_ @@ -612,16 +612,16 @@ Whether given value is number #### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). #### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). The value of Number.MAX_SAFE_INTEGER is 9007199254740991. #### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1). #### toInteger(x) _(es5-ext/number/to-integer)_ @@ -647,7 +647,7 @@ Pad given number with zeros. Returns string #### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten. #### clear(obj) _(es5-ext/object/clear)_ @@ -690,7 +690,7 @@ Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/ #### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_ -Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. +Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). #### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_ @@ -750,7 +750,7 @@ Search object for value #### keys(obj) _(es5-ext/object/keys)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). ES6's version of `keys`, doesn't throw on primitive input #### map(obj, cb[, thisArg]) _(es5-ext/object/map)_ @@ -773,7 +773,7 @@ Useful as an alternative for `setPrototypeOf` in environments in which it cannot #### normalizeOptions(options) _(es5-ext/object/normalize-options)_ -Normalizes options object into flat plain object. +Normalizes options object into flat plain object. Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use. @@ -795,18 +795,18 @@ Serialize value into string. Differs from [JSON.stringify](https://developer.moz #### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed. #### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_ Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided -testing function. +testing function. Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). #### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_ -Creates an array of results of calling a provided function on every key-value pair in this object. +Creates an array of results of calling a provided function on every key-value pair in this object. Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). #### unserialize(str) _(es5-ext/object/unserialize)_ @@ -855,28 +855,28 @@ It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jo #### re.match(string) _(es5-ext/reg-exp/#/match)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). #### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). #### re.search(string) _(es5-ext/reg-exp/#/search)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). #### re.split(string) _(es5-ext/reg-exp/#/search)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). #### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). It's a getter, so only `implement` and `is-implemented` modules are provided. #### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). It's a getter, so only `implement` and `is-implemented` modules are provided. ### String Constructor extensions @@ -937,7 +937,7 @@ Whether string contains given string. #### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). Whether strings ends with given string #### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_ @@ -955,8 +955,8 @@ Return last character #### str.normalize([form]) _(es5-ext/string/#/normalize)_ -[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). -Returns the Unicode Normalization Form of a given string. +[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). +Returns the Unicode Normalization Form of a given string. Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js) #### str.pad(fill[, length]) _(es5-ext/string/#/pad)_ @@ -967,7 +967,7 @@ If _length_ is negative then pad is applied from right. #### str.repeat(n) _(es5-ext/string/#/repeat)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). Repeat given string _n_ times #### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_ @@ -980,12 +980,12 @@ Simple `replace` version. Doesn't support regular expressions. Replaces all occu #### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). Whether strings starts with given string #### str[@@iterator] _(es5-ext/string/#/@@iterator)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). Returns iterator object which traverses all string characters (with respect to unicode symbols) ### Tests [![Build Status](https://travis-ci.org/medikoo/es5-ext.png)](https://travis-ci.org/medikoo/es5-ext) diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js index c95407d317fd3b..4bf267f2bad8d9 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js @@ -1,12 +1,15 @@ 'use strict'; -var isArray = Array.isArray, forEach = Array.prototype.forEach - , push = Array.prototype.push; +var isArray = Array.isArray, forEach = Array.prototype.forEach; module.exports = function flatten() { var r = []; forEach.call(this, function (x) { - push.apply(r, isArray(x) ? flatten.call(x) : [x]); + if (isArray(x)) { + r = r.concat(flatten.call(x)); + } else { + r.push(x); + } }); return r; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js index 7d1a9b60d4748a..d0f1b6ce2b83a6 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js @@ -3,6 +3,6 @@ var isDate = require('./is-date'); module.exports = function (x) { - if (!isDate(x)) throw new TypeError(x + " is not a Date object"); + if (!isDate(x) || isNaN(x)) throw new TypeError(x + " is not valid Date object"); return x; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md index 30faa82bbaefaa..288373da7ab506 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md @@ -4,7 +4,7 @@ ### Installation $ npm install es6-iterator - + To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) ## API @@ -63,7 +63,7 @@ May also be used for _arguments_ objects: #### StringIterator(str) _(es6-iterator/string)_ -Assures proper iteration over unicode symbols. +Assures proper iteration over unicode symbols. See: http://mathiasbynens.be/notes/javascript-unicode ```javascript diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json index e4e603f6b2edf0..92a871dcfd6116 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "es6-iterator@2", + { + "raw": "es6-iterator@2", + "scope": null, + "escapedName": "es6-iterator", + "name": "es6-iterator", + "rawSpec": "2", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext" ] ], @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator", "_nodeVersion": "0.12.7", "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, "_npmVersion": "2.11.3", "_phantomChildren": {}, "_requested": { - "name": "es6-iterator", "raw": "es6-iterator@2", - "rawSpec": "2", "scope": null, + "escapedName": "es6-iterator", + "name": "es6-iterator", + "rawSpec": "2", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "es6-iterator@2", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -56,17 +65,17 @@ "directories": {}, "dist": { "shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", - "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" + "tarball": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" }, "gitHead": "4d9445834e87780ab373b14d6791e860899e2d31", "homepage": "https://github.com/medikoo/es6-iterator#readme", "keywords": [ - "array", - "generator", "iterator", + "array", "list", + "set", "map", - "set" + "generator" ], "license": "MIT", "maintainers": [ diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js index 80b5df5e04b9b3..488523eea1d4ff 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js @@ -4,16 +4,24 @@ var value = require('./valid-value') , defineProperty = Object.defineProperty , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor - , getOwnPropertyNames = Object.getOwnPropertyNames; + , getOwnPropertyNames = Object.getOwnPropertyNames + , getOwnPropertySymbols = Object.getOwnPropertySymbols; module.exports = function (target, source) { - var error; + var error, sourceObject = Object(value(source)); target = Object(value(target)); - getOwnPropertyNames(Object(value(source))).forEach(function (name) { + getOwnPropertyNames(sourceObject).forEach(function (name) { try { defineProperty(target, name, getOwnPropertyDescriptor(source, name)); } catch (e) { error = e; } }); + if (typeof getOwnPropertySymbols === 'function') { + getOwnPropertySymbols(sourceObject).forEach(function (symbol) { + try { + defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol)); + } catch (e) { error = e; } + }); + } if (error !== undefined) throw error; return target; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json index 597a347e96bc9f..39321320a42d50 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json @@ -1,32 +1,45 @@ { "_args": [ [ - "es5-ext@~0.10.10", - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" + { + "raw": "es5-ext@~0.10.11", + "scope": null, + "escapedName": "es5-ext", + "name": "es5-ext", + "rawSpec": "~0.10.11", + "spec": ">=0.10.11 <0.11.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" ] ], - "_from": "es5-ext@>=0.10.10 <0.11.0", - "_id": "es5-ext@0.10.11", + "_from": "es5-ext@>=0.10.11 <0.11.0", + "_id": "es5-ext@0.10.12", "_inCache": true, "_installable": true, "_location": "/node-gyp/path-array/array-index/es6-symbol/es5-ext", - "_nodeVersion": "4.2.3", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/es5-ext-0.10.12.tgz_1467387765797_0.7073166444897652" + }, "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.5", "_phantomChildren": { "d": "0.1.1", - "es5-ext": "0.10.11", - "es6-symbol": "3.0.2" + "es5-ext": "0.10.12", + "es6-symbol": "3.1.0" }, "_requested": { - "name": "es5-ext", - "raw": "es5-ext@~0.10.10", - "rawSpec": "~0.10.10", + "raw": "es5-ext@~0.10.11", "scope": null, - "spec": ">=0.10.10 <0.11.0", + "escapedName": "es5-ext", + "name": "es5-ext", + "rawSpec": "~0.10.11", + "spec": ">=0.10.11 <0.11.0", "type": "range" }, "_requiredBy": [ @@ -34,14 +47,14 @@ "/node-gyp/path-array/array-index/es6-symbol/d", "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator" ], - "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz", - "_shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", + "_shasum": "aa84641d4db76b62abba5e45fd805ecbab140047", "_shrinkwrap": null, - "_spec": "es5-ext@~0.10.10", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", + "_spec": "es5-ext@~0.10.11", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -49,7 +62,7 @@ }, "dependencies": { "es6-iterator": "2", - "es6-symbol": "~3.0.2" + "es6-symbol": "~3.1" }, "description": "ECMAScript extensions and shims", "devDependencies": { @@ -59,28 +72,28 @@ }, "directories": {}, "dist": { - "shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", - "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz" + "shasum": "aa84641d4db76b62abba5e45fd805ecbab140047", + "tarball": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz" }, - "gitHead": "aba94140a6bf79ce1a448a2db8834e8c1842b527", + "gitHead": "96fddc3a327b3a28b1653af9490e3b905f127fa8", "homepage": "https://github.com/medikoo/es5-ext#readme", "keywords": [ - "addons", "ecmascript", "ecmascript5", "ecmascript6", "es5", "es6", - "ext", "extensions", + "ext", + "addons", "extras", "harmony", "javascript", "polyfill", "shim", "util", - "utilities", - "utils" + "utils", + "utilities" ], "license": "MIT", "maintainers": [ @@ -101,5 +114,5 @@ "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "version": "0.10.11" + "version": "0.10.12" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js index 8b47a8158a29d3..64e35c03da0e9d 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js @@ -2,4 +2,6 @@ module.exports = function (t, a) { a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-t-rzy4y-foo45-my'); + a(t.call('razDwaTRzy4yFoo45My-'), 'raz-dwa-t-rzy4y-foo45-my-'); + a(t.call('razDwaTRzy4yFoo45My--'), 'raz-dwa-t-rzy4y-foo45-my--'); }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js index bd7ded4befbc7d..0118dd817319b7 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js @@ -2,4 +2,6 @@ module.exports = function (t, a) { a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa'), 'razDwaTRzy4yRtr4Tiu45Pa'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa-'), 'razDwaTRzy4yRtr4Tiu45Pa-'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa--'), 'razDwaTRzy4yRtr4Tiu45Pa--'); }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json index f98280ca28c400..2e12775fc72035 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json @@ -1,29 +1,42 @@ { "_args": [ [ - "es6-symbol@^3.0.2", + { + "raw": "es6-symbol@^3.0.2", + "scope": null, + "escapedName": "es6-symbol", + "name": "es6-symbol", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" ] ], "_from": "es6-symbol@>=3.0.2 <4.0.0", - "_id": "es6-symbol@3.0.2", + "_id": "es6-symbol@3.1.0", "_inCache": true, "_installable": true, "_location": "/node-gyp/path-array/array-index/es6-symbol", - "_nodeVersion": "5.2.0", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/es6-symbol-3.1.0.tgz_1464960261964_0.3645231726113707" + }, "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "2.15.5", "_phantomChildren": { - "es6-symbol": "3.0.2" + "es6-symbol": "3.1.0" }, "_requested": { - "name": "es6-symbol", "raw": "es6-symbol@^3.0.2", - "rawSpec": "^3.0.2", "scope": null, + "escapedName": "es6-symbol", + "name": "es6-symbol", + "rawSpec": "^3.0.2", "spec": ">=3.0.2 <4.0.0", "type": "range" }, @@ -32,14 +45,14 @@ "/node-gyp/path-array/array-index/es6-symbol/es5-ext", "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator" ], - "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz", - "_shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz", + "_shasum": "94481c655e7a7cad82eba832d97d5433496d7ffa", "_shrinkwrap": null, "_spec": "es6-symbol@^3.0.2", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -47,7 +60,7 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.10" + "es5-ext": "~0.10.11" }, "description": "ECMAScript 6 Symbol polyfill", "devDependencies": { @@ -57,20 +70,20 @@ }, "directories": {}, "dist": { - "shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", - "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz" + "shasum": "94481c655e7a7cad82eba832d97d5433496d7ffa", + "tarball": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" }, - "gitHead": "b7da6b926c44e3745de69b17c98c00a5c84b4ebe", + "gitHead": "f84175053e9cad6a1230f3b7cc13e078c3fcc12f", "homepage": "https://github.com/medikoo/es6-symbol#readme", "keywords": [ - "ecmascript", + "symbol", + "private", + "property", "es6", + "ecmascript", "harmony", - "polyfill", "ponyfill", - "private", - "property", - "symbol" + "polyfill" ], "license": "MIT", "maintainers": [ @@ -91,5 +104,5 @@ "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "version": "3.0.2" + "version": "3.1.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js index 7c3c8fe90025ca..48832a5f36f59e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js @@ -1,4 +1,4 @@ -// ES2015 Symbol polyfill for environments that do not support it (or partially support it_ +// ES2015 Symbol polyfill for environments that do not support it (or partially support it) 'use strict'; @@ -7,9 +7,16 @@ var d = require('d') , create = Object.create, defineProperties = Object.defineProperties , defineProperty = Object.defineProperty, objPrototype = Object.prototype - , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null); + , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) + , isNativeSafe; -if (typeof Symbol === 'function') NativeSymbol = Symbol; +if (typeof Symbol === 'function') { + NativeSymbol = Symbol; + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} var generateName = (function () { var created = create(null); @@ -45,6 +52,7 @@ HiddenSymbol = function Symbol(description) { module.exports = SymbolPolyfill = function Symbol(description) { var symbol; if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + if (isNativeSafe) return NativeSymbol(description); symbol = create(HiddenSymbol.prototype); description = (description === undefined ? '' : String(description)); return defineProperties(symbol, { @@ -91,8 +99,11 @@ defineProperties(SymbolPolyfill.prototype, { toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), valueOf: d(function () { return validateSymbol(this); }) }); -defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', - function () { return validateSymbol(this); })); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { + var symbol = validateSymbol(this); + if (typeof symbol === 'symbol') return symbol; + return symbol.toString(); +})); defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); // Proper implementaton of toPrimitive and toStringTag for returned symbol instances diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js index 83fb5e9253677b..8b657905de57d7 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js @@ -18,8 +18,10 @@ module.exports = function (T, a) { x = {}; x[symbol] = 'foo'; - a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, - value: 'foo', writable: true }); + if (typeof symbol !== 'symbol') { + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + } symbol = T.for('marko'); a(isSymbol(symbol), true); a(T.for('marko'), symbol); diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json index dd33e385601890..a4e27587fa7aa1 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "array-index@^1.0.0", + { + "raw": "array-index@^1.0.0", + "scope": null, + "escapedName": "array-index", + "name": "array-index", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array" ] ], @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array/array-index", "_nodeVersion": "5.3.0", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "array-index", "raw": "array-index@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "array-index", + "name": "array-index", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "array-index@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://tootallnate.net" }, "bugs": { @@ -50,7 +59,7 @@ "directories": {}, "dist": { "shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", - "tarball": "http://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" }, "engines": { "node": "*" @@ -58,11 +67,11 @@ "gitHead": "4b3cc059c70eefd8ef2a0d4213d681b671eb3d11", "homepage": "https://github.com/TooTallNate/array-index#readme", "keywords": [ + "index", "array", "getter", - "index", - "proxy", - "setter" + "setter", + "proxy" ], "license": "MIT", "main": "index.js", diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json index e69958df330685..df328efaf55c3a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "path-array@^1.0.0", + { + "raw": "path-array@^1.0.0", + "scope": null, + "escapedName": "path-array", + "name": "path-array", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp" ] ], @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array", "_nodeVersion": "5.3.0", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "path-array", "raw": "path-array@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "path-array", + "name": "path-array", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "path-array@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, "bugs": { @@ -51,14 +60,14 @@ "directories": {}, "dist": { "shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", - "tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" + "tarball": "https://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" }, "gitHead": "d249bd897661ca60720218edabbfeaa73c67778a", "homepage": "https://github.com/TooTallNate/node-path-array", "keywords": [ "PATH", - "array", - "env" + "env", + "array" ], "license": "MIT", "main": "index.js", diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index bbbc22ce91b18a..8b68bc3213db9c 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -1,49 +1,55 @@ { "_args": [ [ - "node-gyp@3.3.1", - "/Users/rebecca/code/npm" + { + "raw": "node-gyp@latest", + "scope": null, + "escapedName": "node-gyp", + "name": "node-gyp", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "node-gyp@3.3.1", - "_id": "node-gyp@3.3.1", + "_from": "node-gyp@latest", + "_id": "node-gyp@3.4.0", "_inCache": true, "_installable": true, "_location": "/node-gyp", - "_nodeVersion": "6.0.0-pre", + "_nodeVersion": "6.2.1", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/node-gyp-3.3.1.tgz_1457115144174_0.4018901875242591" + "tmp": "tmp/node-gyp-3.4.0.tgz_1467079381888_0.1804589256644249" }, "_npmUser": { - "email": "info@bnoordhuis.nl", - "name": "bnoordhuis" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": { - "inflight": "1.0.4", - "inherits": "2.0.1", - "once": "1.3.3" + "name": "rvagg", + "email": "rod@vagg.org" }, + "_npmVersion": "3.9.3", + "_phantomChildren": {}, "_requested": { - "name": "node-gyp", - "raw": "node-gyp@3.3.1", - "rawSpec": "3.3.1", + "raw": "node-gyp@latest", "scope": null, - "spec": "3.3.1", - "type": "version" + "escapedName": "node-gyp", + "name": "node-gyp", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.3.1.tgz", - "_shasum": "80f7b6d7c2f9c0495ba42c518a670c99bdf6e4a0", + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.4.0.tgz", + "_shasum": "dda558393b3ecbbe24c9e6b8703c71194c63fa36", "_shrinkwrap": null, - "_spec": "node-gyp@3.3.1", - "_where": "/Users/rebecca/code/npm", + "_spec": "node-gyp@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://tootallnate.net" }, "bin": { @@ -54,12 +60,12 @@ }, "dependencies": { "fstream": "^1.0.0", - "glob": "3 || 4", + "glob": "^7.0.3", "graceful-fs": "^4.1.2", - "minimatch": "1", + "minimatch": "^3.0.2", "mkdirp": "^0.5.0", "nopt": "2 || 3", - "npmlog": "0 || 1 || 2", + "npmlog": "0 || 1 || 2 || 3", "osenv": "0", "path-array": "^1.0.0", "request": "2", @@ -70,17 +76,20 @@ }, "description": "Node.js native addon build tool", "devDependencies": { + "bindings": "~1.2.1", + "nan": "^2.0.0", + "require-inject": "~1.3.0", "tape": "~4.2.0" }, "directories": {}, "dist": { - "shasum": "80f7b6d7c2f9c0495ba42c518a670c99bdf6e4a0", - "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-3.3.1.tgz" + "shasum": "dda558393b3ecbbe24c9e6b8703c71194c63fa36", + "tarball": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.4.0.tgz" }, "engines": { "node": ">= 0.8.0" }, - "gitHead": "1dcf356ca7b658789447108b29a985c00ffcf0f5", + "gitHead": "d460084b241c427655497a1de4ed351a13ffb47f", "homepage": "https://github.com/nodejs/node-gyp#readme", "installVersion": 9, "keywords": [ @@ -96,28 +105,28 @@ "main": "./lib/node-gyp.js", "maintainers": [ { - "email": "nathan@tootallnate.net", - "name": "TooTallNate" + "name": "TooTallNate", + "email": "nathan@tootallnate.net" }, { - "email": "info@bnoordhuis.nl", - "name": "bnoordhuis" + "name": "bnoordhuis", + "email": "info@bnoordhuis.nl" }, { - "email": "fishrock123@rocketmail.com", - "name": "fishrock123" + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" } ], "name": "node-gyp", @@ -131,5 +140,5 @@ "scripts": { "test": "tape test/test-*" }, - "version": "3.3.1" + "version": "3.4.0" } diff --git a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.cc similarity index 92% rename from deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c rename to deps/npm/node_modules/node-gyp/src/win_delay_load_hook.cc index b1e170aa13bd95..e75954b605101a 100644 --- a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c +++ b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.cc @@ -31,6 +31,6 @@ static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { return (FARPROC) m; } -PfnDliHook __pfnDliNotifyHook2 = load_exe_hook; +decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; #endif diff --git a/deps/npm/node_modules/node-gyp/test/test-addon.js b/deps/npm/node_modules/node-gyp/test/test-addon.js new file mode 100644 index 00000000000000..c2a71f44985fda --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-addon.js @@ -0,0 +1,28 @@ +'use strict' + +var test = require('tape') +var execFile = require('child_process').execFile +var path = require('path') +var addonPath = path.resolve(__dirname, 'node_modules', 'hello_world') +var nodeGyp = path.resolve(__dirname, '..', 'bin', 'node-gyp.js') + +test('build simple addon', function (t) { + t.plan(3) + + // Set the loglevel otherwise the output disappears when run via 'npm test' + var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] + var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { + var logLines = stderr.toString().trim().split(/\r?\n/) + var lastLine = logLines[logLines.length-1] + t.strictEqual(err, null) + t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') + try { + var binding = require('hello_world') + t.strictEqual(binding.hello(), 'world') + } catch (error) { + t.error(error, 'load module') + } + }) + proc.stdout.setEncoding('utf-8') + proc.stderr.setEncoding('utf-8') +}) diff --git a/deps/npm/node_modules/node-gyp/test/test-find-accessible-sync.js b/deps/npm/node_modules/node-gyp/test/test-find-accessible-sync.js new file mode 100644 index 00000000000000..d336243dd0d7b7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-find-accessible-sync.js @@ -0,0 +1,86 @@ +'use strict' + +var test = require('tape') +var path = require('path') +var requireInject = require('require-inject') +var configure = requireInject('../lib/configure', { + 'graceful-fs': { + 'closeSync': function (fd) { return undefined }, + 'openSync': function (path) { + if (readableFiles.some(function (f) { return f === path} )) { + return 0 + } else { + var error = new Error('ENOENT - not found') + throw error + } + } + } +}) + +var dir = path.sep + 'testdir' +var readableFile = 'readable_file' +var anotherReadableFile = 'another_readable_file' +var readableFileInDir = 'somedir' + path.sep + readableFile +var readableFiles = [ + path.resolve(dir, readableFile), + path.resolve(dir, anotherReadableFile), + path.resolve(dir, readableFileInDir) +] + +test('find accessible - empty array', function (t) { + t.plan(1) + + var candidates = [] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + +test('find accessible - single item array, readable', function (t) { + t.plan(1) + + var candidates = [ readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFile)) +}) + +test('find accessible - single item array, readable in subdir', function (t) { + t.plan(1) + + var candidates = [ readableFileInDir ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFileInDir)) +}) + +test('find accessible - single item array, unreadable', function (t) { + t.plan(1) + + var candidates = [ 'unreadable_file' ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + + +test('find accessible - multi item array, no matches', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', 'unreadable_file' ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + + +test('find accessible - multi item array, single match', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFile)) +}) + +test('find accessible - multi item array, return first match', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', anotherReadableFile, readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, anotherReadableFile)) +}) diff --git a/deps/npm/node_modules/npm-package-arg/.travis.yml b/deps/npm/node_modules/npm-package-arg/.travis.yml index e5a5a8b9ec5683..d8ce5e1a74d48f 100644 --- a/deps/npm/node_modules/npm-package-arg/.travis.yml +++ b/deps/npm/node_modules/npm-package-arg/.travis.yml @@ -7,3 +7,4 @@ node_js: - "0.10" sudo: false script: "npm test" + diff --git a/deps/npm/node_modules/npm-registry-client/.travis.yml b/deps/npm/node_modules/npm-registry-client/.travis.yml index 3669bc76e06c05..2993ae58c9afbe 100644 --- a/deps/npm/node_modules/npm-registry-client/.travis.yml +++ b/deps/npm/node_modules/npm-registry-client/.travis.yml @@ -1,9 +1,9 @@ language: node_js node_js: - - "0.12" + - "4" + - "6" - "0.10" - - "0.8" - - iojs + - "0.12" script: "npm test" sudo: false before_install: diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md index 2caa3643708f80..9d81f4df39e0dd 100644 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ b/deps/npm/node_modules/npm-registry-client/README.md @@ -259,6 +259,8 @@ caching logic directly. * `etag` {String} The cached ETag. Optional. * `lastModified` {String} The cached Last-Modified timestamp. Optional. * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). + * `streaming` {Boolean} Stream the request body as it comes, handling error + responses in a non-streaming way. * `auth` {Credentials} Optional. * `cb` {Function} * `error` {Error | null} diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js index 13e61debfd4acb..9bf1c3066d1463 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js @@ -153,8 +153,9 @@ function putNext (registry, newVersion, root, current, auth, cb) { case 'dist-tags': case 'versions': case '_attachments': - for (var j in root[i]) + for (var j in root[i]) { current[i][j] = root[i][j] + } break // ignore these diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 567fc8dbe42b16..04be044d6a0e27 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -92,7 +92,16 @@ function regRequest (uri, params, cb_) { } function makeRequest (uri, params, cb_) { - var cb = once(cb_) + var socket + var cb = once(function (er, parsed, raw, response) { + if (socket) { + // The socket might be returned to a pool for re-use, so don’t keep + // the 'error' listener from here attached. + socket.removeListener('error', cb) + } + + return cb_(er, parsed, raw, response) + }) var parsed = url.parse(uri) var headers = {} @@ -146,13 +155,42 @@ function makeRequest (uri, params, cb_) { this.log.http('request', params.method, parsed.href || '/') var done = requestDone.call(this, params.method, uri, cb) - var req = request(opts, decodeResponseBody(done)) + var req = request(opts, params.streaming ? undefined : decodeResponseBody(done)) req.on('error', cb) + + // This should not be necessary, as the HTTP implementation in Node + // passes errors occurring on the socket to the request itself. Being overly + // cautious comes at a low cost, though. req.on('socket', function (s) { - s.on('error', cb) + socket = s + socket.on('error', cb) }) + if (params.streaming) { + req.on('response', function (response) { + if (response.statusCode >= 400) { + var parts = [] + response.on('data', function (data) { + parts.push(data) + }) + response.on('end', function () { + decodeResponseBody(done)(null, response, Buffer.concat(parts)) + }) + } else { + response.on('end', function () { + // don't ever re-use connections that had server errors. + // those sockets connect to the Bad Place! + if (response.socket && response.statusCode > 500) { + response.socket.destroy() + } + }) + + return cb(null, response) + } + }) + } + if (params.body && (params.body instanceof Stream)) { params.body.pipe(req) } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE index 1e836b4760025f..99c130e1de3427 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE @@ -2,23 +2,23 @@ The MIT License Copyright (c) 2013 Max Ogden -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, +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 +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 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js index b55ae7e03dbd38..b16ad1343f560d 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js @@ -73,6 +73,10 @@ function isArrayish (arr) { return /Array\]$/.test(Object.prototype.toString.call(arr)) } +function isBufferish (p) { + return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function') +} + function stringConcat (parts) { var strings = [] var needsToString = false @@ -82,8 +86,10 @@ function stringConcat (parts) { strings.push(p) } else if (Buffer.isBuffer(p)) { strings.push(p) + } else if (isBufferish(p)) { + strings.push(new Buffer(p)) } else { - strings.push(Buffer(p)) + strings.push(new Buffer(String(p))) } } if (Buffer.isBuffer(parts[0])) { @@ -101,10 +107,11 @@ function bufferConcat (parts) { var p = parts[i] if (Buffer.isBuffer(p)) { bufs.push(p) - } else if (typeof p === 'string' || isArrayish(p) - || (p && typeof p.subarray === 'function')) { - bufs.push(Buffer(p)) - } else bufs.push(Buffer(String(p))) + } else if (isBufferish(p)) { + bufs.push(new Buffer(p)) + } else { + bufs.push(new Buffer(String(p))) + } } return Buffer.concat(bufs) } @@ -121,7 +128,7 @@ function u8Concat (parts) { var len = 0 for (var i = 0; i < parts.length; i++) { if (typeof parts[i] === 'string') { - parts[i] = Buffer(parts[i]) + parts[i] = new Buffer(parts[i]) } len += parts[i].length } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md index 1a67c48cd031b5..86b95a3bf6df4e 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md @@ -21,7 +21,7 @@ Node-core, including [documentation](doc/stream.markdown). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -As of version 2.0.0 **readable-stream** uses semantic versioning. +As of version 2.0.0 **readable-stream** uses semantic versioning. # Streams WG Team Members diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index c141a99c26c638..83275f192e4077 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,3 +56,5 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section + + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile index 0ecc29c402c243..787d56e1e982e4 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile @@ -3,3 +3,4 @@ test: @node_modules/.bin/tape test.js .PHONY: test + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js index f7f7bcd19fec56..e0c3444d85d5c7 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js @@ -17,3 +17,4 @@ test('is array', function(t){ t.end(); }); + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js index e57dabdcebc9c1..425950f9fc9ed7 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js @@ -11,7 +11,7 @@ test('u8a without globals', function (t) { vm.runInNewContext(src, c); var TA = c.module.exports; var ua = new(TA.Uint8Array)(5); - + t.equal(ua.length, 5); ua[1] = 256 + 55; t.equal(ua[1], 55); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json index 5a3f8b401e4449..7c8b5de3b43c93 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json @@ -1,43 +1,109 @@ { - "name": "concat-stream", - "version": "1.5.1", - "description": "writable stream that concatenates strings or binary data and calls a callback with the result", - "tags": [ - "stream", - "simple", - "util", - "utility" + "_args": [ + [ + { + "raw": "concat-stream@^1.5.2", + "scope": null, + "escapedName": "concat-stream", + "name": "concat-stream", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client" + ] + ], + "_from": "concat-stream@>=1.5.2 <2.0.0", + "_id": "concat-stream@1.5.2", + "_inCache": true, + "_location": "/npm-registry-client/concat-stream", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/concat-stream-1.5.2.tgz_1472715196934_0.010375389130786061" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": { + "inherits": "2.0.3" + }, + "_requested": { + "raw": "concat-stream@^1.5.2", + "scope": null, + "escapedName": "concat-stream", + "name": "concat-stream", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client" ], + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "_shasum": "708978624d856af41a5a741defdd261da752c266", + "_shrinkwrap": null, + "_spec": "concat-stream@^1.5.2", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", "author": { "name": "Max Ogden", "email": "max@maxogden.com" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/maxogden/concat-stream.git" - }, "bugs": { "url": "http://github.com/maxogden/concat-stream/issues" }, + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" + }, + "description": "writable stream that concatenates strings or binary data and calls a callback with the result", + "devDependencies": { + "tape": "~2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "708978624d856af41a5a741defdd261da752c266", + "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz" + }, "engines": [ "node >= 0.8" ], - "main": "index.js", "files": [ "index.js" ], - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, + "gitHead": "731fedd137eae89d066c249fdca070f8f16afbb8", + "homepage": "https://github.com/maxogden/concat-stream#readme", "license": "MIT", - "dependencies": { - "inherits": "~2.0.1", - "typedarray": "~0.0.5", - "readable-stream": "~2.0.0" + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + { + "name": "maxogden", + "email": "max@maxogden.com" + } + ], + "name": "concat-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/maxogden/concat-stream.git" }, - "devDependencies": { - "tape": "~2.3.2" + "scripts": { + "test": "tape test/*.js test/server/*.js" }, + "tags": [ + "stream", + "simple", + "util", + "utility" + ], "testling": { "files": "test/*.js", "browsers": [ @@ -54,28 +120,5 @@ "android-browser/4.2..latest" ] }, - "gitHead": "522adc12d82f57c691a5f946fbc8ba08718dcdcb", - "homepage": "https://github.com/maxogden/concat-stream#readme", - "_id": "concat-stream@1.5.1", - "_shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", - "_from": "concat-stream@>=1.4.6 <2.0.0", - "_npmVersion": "2.14.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "maxogden", - "email": "max@maxogden.com" - }, - "dist": { - "shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", - "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz" - }, - "maintainers": [ - { - "name": "maxogden", - "email": "max@maxogden.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz", - "readme": "ERROR: No README data found!" + "version": "1.5.2" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md index fdfbc40b47e256..8ad4197c9ed9a6 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md @@ -77,7 +77,7 @@ var concat = require('concat-stream') Return a `writable` stream that will fire `cb(data)` with all of the data that was written to the stream. Data can be written to `writable` as strings, -Buffers, arrays of byte integers, and Uint8Arrays. +Buffers, arrays of byte integers, and Uint8Arrays. By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. @@ -89,6 +89,8 @@ By default `concat-stream` will give you back the same data type as the type of If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`. +If nothing is written to `writable` then `data` will be an empty array `[]`. + # error handling `concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/CHANGELOG.md new file mode 100644 index 00000000000000..f549a1f3de81e3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/CHANGELOG.md @@ -0,0 +1,36 @@ +### v3.1.2 + +* Update to `gauge@1.6.0` adding support for default values for template + items. + +### v3.1.1 + +* Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to + when a progress bar is enabled. In `1.x` if you didn't have a TTY the + progress bar was never shown. In `2.x` it merely defaults to disabled, + but you can enable it explicitly if you still want progress updates. + +### v3.1.0 + +* Update to `gauge@2.5.2`: + * Updates the `signal-exit` dependency which fixes an incompatibility with + the node profiler. + * Uses externalizes its ansi code generation in `console-control-strings` +* Make the default progress bar include the last line printed, colored as it + would be when printing to a tty. + +### v3.0.0 + +* Switch to `gauge@2.0.0`, for better performance, better look. +* Set stderr/stdout blocking if they're tty's, so that we can hide a + progress bar going to stderr and then safely print to stdout. Without + this the two can end up overlapping producing confusing and sometimes + corrupted output. + +### v2.0.0 + +* Make the `error` event non-fatal so that folks can use it as a prefix. + +### v1.0.0 + +* Add progress bar with `gauge@1.1.0` diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/LICENSE similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/LICENSE rename to deps/npm/node_modules/npm-registry-client/node_modules/npmlog/LICENSE diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/README.md new file mode 100644 index 00000000000000..dba35501614e91 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/README.md @@ -0,0 +1,210 @@ +# npmlog + +The logger util that npm uses. + +This logger is very basic. It does the logging for npm. It supports +custom levels and colored output. + +By default, logs are written to stderr. If you want to send log messages +to outputs other than streams, then you can change the `log.stream` +member, or you can just listen to the events that it emits, and do +whatever you want with them. + +# Basic Usage + +``` +var log = require('npmlog') + +// additional stuff ---------------------------+ +// message ----------+ | +// prefix ----+ | | +// level -+ | | | +// v v v v + log.info('fyi', 'I have a kitty cat: %j', myKittyCat) +``` + +## log.level + +* {String} + +The level to display logs at. Any logs at or above this level will be +displayed. The special level `silent` will prevent anything from being +displayed ever. + +## log.record + +* {Array} + +An array of all the log messages that have been entered. + +## log.maxRecordSize + +* {Number} + +The maximum number of records to keep. If log.record gets bigger than +10% over this value, then it is sliced down to 90% of this value. + +The reason for the 10% window is so that it doesn't have to resize a +large array on every log entry. + +## log.prefixStyle + +* {Object} + +A style object that specifies how prefixes are styled. (See below) + +## log.headingStyle + +* {Object} + +A style object that specifies how the heading is styled. (See below) + +## log.heading + +* {String} Default: "" + +If set, a heading that is printed at the start of every line. + +## log.stream + +* {Stream} Default: `process.stderr` + +The stream where output is written. + +## log.enableColor() + +Force colors to be used on all messages, regardless of the output +stream. + +## log.disableColor() + +Disable colors on all messages. + +## log.enableProgress() + +Enable the display of log activity spinner and progress bar + +## log.disableProgress() + +Disable the display of a progress bar + +## log.enableUnicode() + +Force the unicode theme to be used for the progress bar. + +## log.disableUnicode() + +Disable the use of unicode in the progress bar. + +## log.setGaugeTemplate(template) + +Set a template for outputting the progress bar. See the [gauge documentation] for details. + +[gauge documentation]: https://npmjs.com/package/gauge + +## log.setGaugeThemeset(themes) + +Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details. + +## log.pause() + +Stop emitting messages to the stream, but do not drop them. + +## log.resume() + +Emit all buffered messages that were written while paused. + +## log.log(level, prefix, message, ...) + +* `level` {String} The level to emit the message at +* `prefix` {String} A string prefix. Set to "" to skip. +* `message...` Arguments to `util.format` + +Emit a log message at the specified level. + +## log\[level](prefix, message, ...) + +For example, + +* log.silly(prefix, message, ...) +* log.verbose(prefix, message, ...) +* log.info(prefix, message, ...) +* log.http(prefix, message, ...) +* log.warn(prefix, message, ...) +* log.error(prefix, message, ...) + +Like `log.log(level, prefix, message, ...)`. In this way, each level is +given a shorthand, so you can do `log.info(prefix, message)`. + +## log.addLevel(level, n, style, disp) + +* `level` {String} Level indicator +* `n` {Number} The numeric level +* `style` {Object} Object with fg, bg, inverse, etc. +* `disp` {String} Optional replacement for `level` in the output. + +Sets up a new level with a shorthand function and so forth. + +Note that if the number is `Infinity`, then setting the level to that +will cause all log messages to be suppressed. If the number is +`-Infinity`, then the only way to show it is to enable all log messages. + +## log.newItem(name, todo, weight) + +* `name` {String} Optional; progress item name. +* `todo` {Number} Optional; total amount of work to be done. Default 0. +* `weight` {Number} Optional; the weight of this item relative to others. Default 1. + +This adds a new `are-we-there-yet` item tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `Tracker` object. + +## log.newStream(name, todo, weight) + +This adds a new `are-we-there-yet` stream tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerStream` object. + +## log.newGroup(name, weight) + +This adds a new `are-we-there-yet` tracker group to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerGroup` object. + +# Events + +Events are all emitted with the message object. + +* `log` Emitted for all messages +* `log.` Emitted for all messages with the `` level. +* `` Messages with prefixes also emit their prefix as an event. + +# Style Objects + +Style objects can have the following fields: + +* `fg` {String} Color for the foreground text +* `bg` {String} Color for the background +* `bold`, `inverse`, `underline` {Boolean} Set the associated property +* `bell` {Boolean} Make a noise (This is pretty annoying, probably.) + +# Message Objects + +Every log event is emitted with a message object, and the `log.record` +list contains all of them that have been created. They have the +following fields: + +* `id` {Number} +* `level` {String} +* `prefix` {String} +* `message` {String} Result of `util.format()` +* `messageRaw` {Array} Arguments to `util.format()` + +# Blocking TTYs + +We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set +stderr and stdout blocking if they are tty's and have the setBlocking call. +This is a work around for an issue in early versions of Node.js 6.x, which +made stderr and stdout non-blocking on OSX. (They are always blocking +Windows and were never blocking on Linux.) `npmlog` needs them to be blocking +so that it can allow output to stdout and stderr to be interlaced. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/log.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/log.js new file mode 100644 index 00000000000000..e5b70f1f80b743 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/log.js @@ -0,0 +1,298 @@ +'use strict' +var Progress = require('are-we-there-yet') +var Gauge = require('gauge') +var EE = require('events').EventEmitter +var log = exports = module.exports = new EE() +var util = require('util') + +var setBlocking = require('set-blocking') +var consoleControl = require('console-control-strings') + +setBlocking(true) +var stream = process.stderr +Object.defineProperty(log, 'stream', { + set: function (newStream) { + stream = newStream + if (this.gauge) this.gauge.setWriteTo(stream, stream) + }, + get: function () { + return stream + } +}) + +// by default, decide based on tty-ness. +var colorEnabled +log.useColor = function () { + return colorEnabled != null ? colorEnabled : stream.isTTY +} + +log.enableColor = function () { + colorEnabled = true + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} +log.disableColor = function () { + colorEnabled = false + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} + +// default level +log.level = 'info' + +log.gauge = new Gauge(stream, { + theme: {hasColor: log.useColor()}, + template: [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', default: ''}, + ':', + {type: 'logline', kerning: 1, default: ''} + ] +}) + +log.tracker = new Progress.TrackerGroup() + +// no progress bars unless asked +log.progressEnabled = false + +var unicodeEnabled + +log.enableUnicode = function () { + unicodeEnabled = true + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.disableUnicode = function () { + unicodeEnabled = false + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.setGaugeThemeset = function (themes) { + this.gauge.setThemeset(themes) +} + +log.setGaugeTemplate = function (template) { + this.gauge.setTemplate(template) +} + +log.enableProgress = function () { + if (this.progressEnabled) return + this.progressEnabled = true + if (this._pause) return + this.tracker.on('change', this.showProgress) + this.gauge.enable() + this.showProgress() +} + +log.disableProgress = function () { + if (!this.progressEnabled) return + this.clearProgress() + this.progressEnabled = false + this.tracker.removeListener('change', this.showProgress) + this.gauge.disable() +} + +var trackerConstructors = ['newGroup', 'newItem', 'newStream'] + +var mixinLog = function (tracker) { + // mixin the public methods from log into the tracker + // (except: conflicts and one's we handle specially) + Object.keys(log).forEach(function (P) { + if (P[0] === '_') return + if (trackerConstructors.filter(function (C) { return C === P }).length) return + if (tracker[P]) return + if (typeof log[P] !== 'function') return + var func = log[P] + tracker[P] = function () { + return func.apply(log, arguments) + } + }) + // if the new tracker is a group, make sure any subtrackers get + // mixed in too + if (tracker instanceof Progress.TrackerGroup) { + trackerConstructors.forEach(function (C) { + var func = tracker[C] + tracker[C] = function () { return mixinLog(func.apply(tracker, arguments)) } + }) + } + return tracker +} + +// Add tracker constructors to the top level log object +trackerConstructors.forEach(function (C) { + log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) } +}) + +log.clearProgress = function (cb) { + if (!this.progressEnabled) return cb && process.nextTick(cb) + this.gauge.hide(cb) +} + +log.showProgress = function (name, completed) { + if (!this.progressEnabled) return + var values = {} + if (name) values.section = name + var last = log.record[log.record.length - 1] + if (last) { + values.subsection = last.prefix + var disp = log.disp[last.level] || last.level + var logline = this._format(disp, log.style[last.level]) + if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle) + logline += ' ' + last.message.split(/\r?\n/)[0] + values.logline = logline + } + values.completed = completed || this.tracker.completed() + this.gauge.show(values) +}.bind(log) // bind for use in tracker's on-change listener + +// temporarily stop emitting, but don't drop +log.pause = function () { + this._paused = true +} + +log.resume = function () { + if (!this._paused) return + this._paused = false + + var b = this._buffer + this._buffer = [] + b.forEach(function (m) { + this.emitLog(m) + }, this) + if (this.progressEnabled) this.enableProgress() +} + +log._buffer = [] + +var id = 0 +log.record = [] +log.maxRecordSize = 10000 +log.log = function (lvl, prefix, message) { + var l = this.levels[lvl] + if (l === undefined) { + return this.emit('error', new Error(util.format( + 'Undefined log level: %j', lvl))) + } + + var a = new Array(arguments.length - 2) + var stack = null + for (var i = 2; i < arguments.length; i++) { + var arg = a[i - 2] = arguments[i] + + // resolve stack traces to a plain string. + if (typeof arg === 'object' && arg && + (arg instanceof Error) && arg.stack) { + arg.stack = stack = arg.stack + '' + } + } + if (stack) a.unshift(stack + '\n') + message = util.format.apply(util, a) + + var m = { id: id++, + level: lvl, + prefix: String(prefix || ''), + message: message, + messageRaw: a } + + this.emit('log', m) + this.emit('log.' + lvl, m) + if (m.prefix) this.emit(m.prefix, m) + + this.record.push(m) + var mrs = this.maxRecordSize + var n = this.record.length - mrs + if (n > mrs / 10) { + var newSize = Math.floor(mrs * 0.9) + this.record = this.record.slice(-1 * newSize) + } + + this.emitLog(m) +}.bind(log) + +log.emitLog = function (m) { + if (this._paused) { + this._buffer.push(m) + return + } + if (this.progressEnabled) this.gauge.pulse(m.prefix) + var l = this.levels[m.level] + if (l === undefined) return + if (l < this.levels[this.level]) return + if (l > 0 && !isFinite(l)) return + + var disp = log.disp[m.level] || m.level + this.clearProgress() + m.message.split(/\r?\n/).forEach(function (line) { + if (this.heading) { + this.write(this.heading, this.headingStyle) + this.write(' ') + } + this.write(disp, log.style[m.level]) + var p = m.prefix || '' + if (p) this.write(' ') + this.write(p, this.prefixStyle) + this.write(' ' + line + '\n') + }, this) + this.showProgress() +} + +log._format = function (msg, style) { + if (!stream) return + + var output = '' + if (this.useColor()) { + style = style || {} + var settings = [] + if (style.fg) settings.push(style.fg) + if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) + if (style.bold) settings.push('bold') + if (style.underline) settings.push('underline') + if (style.inverse) settings.push('inverse') + if (settings.length) output += consoleControl.color(settings) + if (style.beep) output += consoleControl.beep() + } + output += msg + if (this.useColor()) { + output += consoleControl.color('reset') + } + return output +} + +log.write = function (msg, style) { + if (!stream) return + + stream.write(this._format(msg, style)) +} + +log.addLevel = function (lvl, n, style, disp) { + if (!disp) disp = lvl + this.levels[lvl] = n + this.style[lvl] = style + if (!this[lvl]) { + this[lvl] = function () { + var a = new Array(arguments.length + 1) + a[0] = lvl + for (var i = 0; i < arguments.length; i++) { + a[i + 1] = arguments[i] + } + return this.log.apply(this, a) + }.bind(this) + } + this.disp[lvl] = disp +} + +log.prefixStyle = { fg: 'magenta' } +log.headingStyle = { fg: 'white', bg: 'black' } + +log.style = {} +log.levels = {} +log.disp = {} +log.addLevel('silly', -Infinity, { inverse: true }, 'sill') +log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb') +log.addLevel('info', 2000, { fg: 'green' }) +log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) +log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') +log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') +log.addLevel('silent', Infinity) + +// allow 'error' prefix +log.on('error', function () {}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore new file mode 100644 index 00000000000000..bc818974f8633f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore @@ -0,0 +1,5 @@ +*~ +.#* +node_modules +coverage +.nyc_output diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md new file mode 100644 index 00000000000000..e990b86ddfb416 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,19 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE new file mode 100644 index 00000000000000..af4588069db82d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/README.md new file mode 100644 index 00000000000000..c41d39229244d2 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -0,0 +1,194 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +All tracker objects described below have the following methods, they, along +with the event comprise the interface for consumers of tracker objects. + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/index.js new file mode 100644 index 00000000000000..57d8743fdad177 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore new file mode 100644 index 00000000000000..c2658d7d1b3184 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md new file mode 100644 index 00000000000000..25959eab67b840 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md @@ -0,0 +1,22 @@ + +1.0.0 / 2015-12-14 +================== + + * Merge pull request #12 from kasicka/master + * Add license text + +0.1.0 / 2014-10-17 +================== + + * adds `.fluent()` to api + +0.0.3 / 2014-01-13 +================== + + * fix receiver for .method() + +0.0.2 / 2014-01-13 +================== + + * Object.defineProperty() sucks + * Initial commit diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License similarity index 83% rename from deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/LICENSE rename to deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License index b054ca5a3ac7d6..60de60addbe7e9 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/LICENSE +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License @@ -1,6 +1,4 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors +Copyright (c) 2015 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile new file mode 100644 index 00000000000000..a9dcfd50dbdb22 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md new file mode 100644 index 00000000000000..ab8cf4ace15939 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md @@ -0,0 +1,94 @@ + +# delegates + + Node method and accessor delegation utilty. + +## Installation + +``` +$ npm install delegates +``` + +## Example + +```js +var delegate = require('delegates'); + +... + +delegate(proto, 'request') + .method('acceptsLanguages') + .method('acceptsEncodings') + .method('acceptsCharsets') + .method('accepts') + .method('is') + .access('querystring') + .access('idempotent') + .access('socket') + .access('length') + .access('query') + .access('search') + .access('status') + .access('method') + .access('path') + .access('body') + .access('host') + .access('url') + .getter('subdomains') + .getter('protocol') + .getter('header') + .getter('stale') + .getter('fresh') + .getter('secure') + .getter('ips') + .getter('ip') +``` + +# API + +## Delegate(proto, prop) + +Creates a delegator instance used to configure using the `prop` on the given +`proto` object. (which is usually a prototype) + +## Delegate#method(name) + +Allows the given method `name` to be accessed on the host. + +## Delegate#getter(name) + +Creates a "getter" for the property with the given `name` on the delegated +object. + +## Delegate#setter(name) + +Creates a "setter" for the property with the given `name` on the delegated +object. + +## Delegate#access(name) + +Creates an "accessor" (ie: both getter *and* setter) for the property with the +given `name` on the delegated object. + +## Delegate#fluent(name) + +A unique type of "accessor" that works for a "fluent" API. When called as a +getter, the method returns the expected value. However, if the method is called +with a value, it will return itself so it can be chained. For example: + +```js +delegate(proto, 'request') + .fluent('query') + +// getter +var q = request.query(); + +// setter (chainable) +request + .query({ a: 1 }) + .query({ b: 2 }); +``` + +# License + + MIT diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js new file mode 100644 index 00000000000000..17c222d52935c6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js @@ -0,0 +1,121 @@ + +/** + * Expose `Delegator`. + */ + +module.exports = Delegator; + +/** + * Initialize a delegator. + * + * @param {Object} proto + * @param {String} target + * @api public + */ + +function Delegator(proto, target) { + if (!(this instanceof Delegator)) return new Delegator(proto, target); + this.proto = proto; + this.target = target; + this.methods = []; + this.getters = []; + this.setters = []; + this.fluents = []; +} + +/** + * Delegate method `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.method = function(name){ + var proto = this.proto; + var target = this.target; + this.methods.push(name); + + proto[name] = function(){ + return this[target][name].apply(this[target], arguments); + }; + + return this; +}; + +/** + * Delegator accessor `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.access = function(name){ + return this.getter(name).setter(name); +}; + +/** + * Delegator getter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.getter = function(name){ + var proto = this.proto; + var target = this.target; + this.getters.push(name); + + proto.__defineGetter__(name, function(){ + return this[target][name]; + }); + + return this; +}; + +/** + * Delegator setter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.setter = function(name){ + var proto = this.proto; + var target = this.target; + this.setters.push(name); + + proto.__defineSetter__(name, function(val){ + return this[target][name] = val; + }); + + return this; +}; + +/** + * Delegator fluent accessor + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.fluent = function (name) { + var proto = this.proto; + var target = this.target; + this.fluents.push(name); + + proto[name] = function(val){ + if ('undefined' != typeof val) { + this[target][name] = val; + return this; + } else { + return this[target][name]; + } + }; + + return this; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json new file mode 100644 index 00000000000000..8c2c0ef2c310d3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/are-we-there-yet" + ], + [ + { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet" + ] + ], + "_from": "delegates@^1.0.0", + "_id": "delegates@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/are-we-there-yet/delegates", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/are-we-there-yet" + ], + "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "_shrinkwrap": null, + "_spec": "delegates@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet", + "bugs": { + "url": "https://github.com/visionmedia/node-delegates/issues" + }, + "dependencies": {}, + "description": "delegate methods and accessors to another property", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "tarball": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" + }, + "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49", + "homepage": "https://github.com/visionmedia/node-delegates#readme", + "keywords": [ + "delegate", + "delegation" + ], + "license": "MIT", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "dominicbarnes", + "email": "dominic@dbarnes.info" + } + ], + "name": "delegates", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-delegates.git" + }, + "scripts": {}, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js new file mode 100644 index 00000000000000..7b6e3d4df19d90 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js @@ -0,0 +1,94 @@ + +var assert = require('assert'); +var delegate = require('..'); + +describe('.method(name)', function(){ + it('should delegate methods', function(){ + var obj = {}; + + obj.request = { + foo: function(bar){ + assert(this == obj.request); + return bar; + } + }; + + delegate(obj, 'request').method('foo'); + + obj.foo('something').should.equal('something'); + }) +}) + +describe('.getter(name)', function(){ + it('should delegate getters', function(){ + var obj = {}; + + obj.request = { + get type() { + return 'text/html'; + } + } + + delegate(obj, 'request').getter('type'); + + obj.type.should.equal('text/html'); + }) +}) + +describe('.setter(name)', function(){ + it('should delegate setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').setter('type'); + + obj.type = 'hey'; + obj.request.type.should.equal('HEY'); + }) +}) + +describe('.access(name)', function(){ + it('should delegate getters and setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').access('type'); + + obj.type = 'hey'; + obj.type.should.equal('HEY'); + }) +}) + +describe('.fluent(name)', function () { + it('should delegate in a fluent fashion', function () { + var obj = { + settings: { + env: 'development' + } + }; + + delegate(obj, 'settings').fluent('env'); + + obj.env().should.equal('development'); + obj.env('production').should.equal(obj); + obj.settings.env.should.equal('production'); + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/package.json new file mode 100644 index 00000000000000..f4fba2ad433a2c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "are-we-there-yet@~1.1.2", + "_id": "are-we-there-yet@1.1.2", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/are-we-there-yet", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.8.1", + "_phantomChildren": {}, + "_requested": { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog" + ], + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", + "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "_shrinkwrap": null, + "_spec": "are-we-there-yet@~1.1.2", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.0 || ^1.1.13" + }, + "description": "Keep track of the overall completion of many dispirate processes", + "devDependencies": { + "standard": "^6.0.8", + "tap": "^5.7.0" + }, + "directories": {}, + "dist": { + "shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "tarball": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz" + }, + "gitHead": "dd5706e2204cb681e78031d0ffe156ed4cc75823", + "homepage": "https://github.com/iarna/are-we-there-yet", + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "are-we-there-yet", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.2" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js new file mode 100644 index 00000000000000..2aa7c05c5864fa --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js @@ -0,0 +1,29 @@ +'use strict' +var util = require('util') + +module.exports = function (obj, event, next) { + var timeout = setTimeout(gotTimeout, 10) + obj.once(event, gotResult) + + function gotTimeout () { + obj.removeListener(event, gotResult) + next(new Error('Timeout listening for ' + event)) + } + var result = [] + function gotResult () { + result = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + timeout = setTimeout(gotNoMoreResults, 10) + obj.once(event, gotTooManyResults) + } + function gotNoMoreResults () { + obj.removeListener(event, gotTooManyResults) + var args = [null].concat(result) + next.apply(null, args) + } + function gotTooManyResults () { + var secondResult = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + next(new Error('Got too many results, first ' + util.inspect(result) + ' and then ' + util.inspect(secondResult))) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js new file mode 100644 index 00000000000000..374c7739d0c011 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js @@ -0,0 +1,57 @@ +'use strict' +var test = require('tap').test +var Tracker = require('../index.js').Tracker + +var testEvent = require('./lib/test-event.js') + +var name = 'test' + +test('initialization', function (t) { + var simple = new Tracker(name) + + t.is(simple.completed(), 0, 'Nothing todo is 0 completion') + t.done() +}) + +var track +var todo = 100 +test('completion', function (t) { + track = new Tracker(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + testEvent(track, 'change', afterCompleteWork) + + track.completeWork(todo) + t.is(track.completed(), 1, 'completeWork: 100% completed') + + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'completeWork: on change event fired') + t.is(onChangeName, name, 'completeWork: on change emits the correct name') + t.done() + } +}) + +test('add more work', function (t) { + testEvent(track, 'change', afterAddWork) + track.addWork(todo) + t.is(track.completed(), 0.5, 'addWork: 50% completed') + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(onChangeName, name, 'addWork: on change emits the correct name') + t.done() + } +}) + +test('complete more work', function (t) { + track.completeWork(200) + t.is(track.completed(), 1, 'completeWork: Over completion is still only 100% complete') + t.done() +}) + +test('finish is always 100%', function (t) { + var finishtest = new Tracker(name, todo) + finishtest.completeWork(50) + finishtest.finish() + t.is(finishtest.completed(), 1, 'finish: Explicitly finishing moves to 100%') + t.done() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js new file mode 100644 index 00000000000000..799a7670b65934 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js @@ -0,0 +1,96 @@ +'use strict' +var test = require('tap').test +var TrackerGroup = require('../index.js').TrackerGroup +var testEvent = require('./lib/test-event.js') + +test('TrackerGroup', function (t) { + var name = 'test' + + var track = new TrackerGroup(name) + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + testEvent(track, 'change', afterFinishEmpty) + track.finish() + var a, b + function afterFinishEmpty (er, onChangeName, completion) { + t.is(er, null, 'finishEmpty: on change event fired') + t.is(onChangeName, name, 'finishEmpty: on change emits the correct name') + t.is(completion, 1, 'finishEmpty: passed through completion was correct') + t.is(track.completed(), 1, 'finishEmpty: Finishing an empty group actually finishes it') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 1) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'Initially empty') + testEvent(track, 'change', afterCompleteWork) + a.completeWork(5) + } + function afterCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'on change event fired') + t.is(onChangeName, 'a', 'on change emits the correct name') + t.is(completion, 0.25, 'Complete half of one is a quarter overall') + t.is(track.completed(), 0.25, 'Complete half of one is a quarter overall') + testEvent(track, 'change', afterFinishAll) + track.finish() + } + function afterFinishAll (er, onChangeName, completion) { + t.is(er, null, 'finishAll: on change event fired') + t.is(onChangeName, name, 'finishAll: on change emits the correct name') + t.is(completion, 1, 'Finishing everything ') + t.is(track.completed(), 1, 'Finishing everything ') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 2) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'weighted: Initially empty') + testEvent(track, 'change', afterWeightedCompleteWork) + a.completeWork(5) + } + function afterWeightedCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'weighted: on change event fired') + t.is(onChangeName, 'a', 'weighted: on change emits the correct name') + t.is(Math.floor(completion * 100), 33, 'weighted: Complete half of double weighted') + t.is(Math.floor(track.completed() * 100), 33, 'weighted: Complete half of double weighted') + testEvent(track, 'change', afterWeightedFinishAll) + track.finish() + } + function afterWeightedFinishAll (er, onChangeName, completion) { + t.is(er, null, 'weightedFinishAll: on change event fired') + t.is(onChangeName, name, 'weightedFinishAll: on change emits the correct name') + t.is(completion, 1, 'weightedFinishaAll: Finishing everything ') + t.is(track.completed(), 1, 'weightedFinishaAll: Finishing everything ') + + track = new TrackerGroup(name) + a = track.newGroup('a', 10) + b = track.newGroup('b', 10) + var a1 = a.newItem('a.1', 10) + a1.completeWork(5) + t.is(track.completed(), 0.25, 'nested: Initially quarter done') + testEvent(track, 'change', afterNestedComplete) + b.finish() + } + function afterNestedComplete (er, onChangeName, completion) { + t.is(er, null, 'nestedComplete: on change event fired') + t.is(onChangeName, 'b', 'nestedComplete: on change emits the correct name') + t.is(completion, 0.75, 'nestedComplete: Finishing everything ') + t.is(track.completed(), 0.75, 'nestedComplete: Finishing everything ') + t.end() + } +}) + +test('cycles', function (t) { + var track = new TrackerGroup('top') + testCycle(track, track) + var layer1 = track.newGroup('layer1') + testCycle(layer1, track) + t.end() + + function testCycle (addTo, toAdd) { + try { + addTo.addUnit(toAdd) + t.fail(toAdd.name) + } catch (ex) { + console.log(ex) + t.pass(toAdd.name) + } + } +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js new file mode 100644 index 00000000000000..65f04b03769190 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js @@ -0,0 +1,51 @@ +'use strict' +var test = require('tap').test +var util = require('util') +var stream = require('readable-stream') +var TrackerStream = require('../index.js').TrackerStream +var testEvent = require('./lib/test-event.js') + +var Sink = function () { + stream.Writable.apply(this, arguments) +} +util.inherits(Sink, stream.Writable) +Sink.prototype._write = function (data, encoding, cb) { + cb() +} + +test('TrackerStream', function (t) { + t.plan(9) + + var name = 'test' + var track = new TrackerStream(name) + + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + + var todo = 10 + track = new TrackerStream(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + track.pipe(new Sink()) + + testEvent(track, 'change', afterCompleteWork) + track.write('0123456789') + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'write: on change event fired') + t.is(onChangeName, name, 'write: on change emits the correct name') + t.is(track.completed(), 1, 'write: 100% completed') + + testEvent(track, 'change', afterAddWork) + track.addWork(10) + } + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(track.completed(), 0.5, 'addWork: 50% completed') + + testEvent(track, 'change', afterAllWork) + track.write('ABCDEFGHIJKLMNOPQRST') + } + function afterAllWork (er) { + t.is(er, null, 'allWork: on change event fired') + t.is(track.completed(), 1, 'allWork: 100% completed') + } +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js new file mode 100644 index 00000000000000..6f436875578a7a --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js new file mode 100644 index 00000000000000..9759e1226db046 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js new file mode 100644 index 00000000000000..fb9598ed4e9c31 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,35 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js new file mode 100644 index 00000000000000..68c2339b45409a --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/LICENSE similarity index 81% rename from deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE rename to deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/LICENSE index 19129e315fe593..e756052969b780 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/LICENSE @@ -1,6 +1,4 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2014, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -11,5 +9,5 @@ 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. +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/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/README.md new file mode 100644 index 00000000000000..f58cc8d8925060 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/index.js new file mode 100644 index 00000000000000..bf890348ec6e35 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/package.json new file mode 100644 index 00000000000000..a76eecadec37e9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "console-control-strings@~1.1.0", + "_id": "console-control-strings@1.1.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/console-control-strings", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/console-control-strings-1.1.0.tgz_1466033396831_0.9470485949423164" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": {}, + "_requested": { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog", + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "_shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "_shrinkwrap": null, + "_spec": "console-control-strings@~1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/console-control-strings/issues" + }, + "dependencies": {}, + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "tarball": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + }, + "files": [ + "LICENSE", + "index.js" + ], + "gitHead": "722439b4998d2964ac3d3f9ec175c008aa9b7b4b", + "homepage": "https://github.com/iarna/console-control-strings#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "console-control-strings", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/console-control-strings.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/CHANGELOG.md new file mode 100644 index 00000000000000..efd08fc7c19dd7 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/CHANGELOG.md @@ -0,0 +1,131 @@ +### v2.6.0 + +* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge + is already enabled or disabled respectively. This prevents leaking event + listeners, amongst other weirdness. +* New feature: Template items can have default values that will be used if no + value was otherwise passed in. + +### v2.5.3 + +* Default to `enabled` only if we have a tty. Users can always override + this by passing in the `enabled` option explicitly or by calling calling + `gauge.enable()`. + +### v2.5.2 + +* Externalized `./console-strings.js` into `console-control-strings`. + +### v2.5.1 + +* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the + node profiler. +* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add + a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012)) + +### v2.5.0 + +* Add way to programmatically fetch a list of theme names in a themeset + (`Themeset.getThemeNames`). + +### v2.4.0 + +* Add support for setting themesets on existing gauge objects. +* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when + your terminal is interleaving output from multiple filehandles (ie, stdout + & stderr). + +### v2.3.1 + +* Fix a refactor bug in setTheme where it wasn't accepting the various types + of args it should. + +### v2.3.0 + +#### FEATURES + +* Add setTemplate & setTheme back in. +* Add support for named themes, you can now ask for things like 'colorASCII' + and 'brailleSpinner'. Of course, you can still pass in theme objects. + Additionally you can now pass in an object with `hasUnicode`, `hasColor` and + `platform` keys in order to override our guesses as to those values when + selecting a default theme from the themeset. +* Make the output stream optional (it defaults to `process.stderr` now). +* Add `setWriteTo(stream[, tty])` to change the output stream and, + optionally, tty. + +#### BUG FIXES & REFACTORING + +* Abort the display phase early if we're supposed to be hidden and we are. +* Stop printing a bunch of spaces at the end of lines, since we're already + using an erase-to-end-of-line code anyway. +* The unicode themes were missing the subsection separator. + +### v2.2.1 + +* Fix image in readme + +### v2.2.0 + +* All new themes API– reference themes by name and pass in custom themes and + themesets (themesets get platform support autodetection done on them to + select the best theme). Theme mixins let you add features to all existing + themes. +* Much, much improved test coverage. + +### v2.1.0 + +* Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks + to @yongtw123 for pointing out this had snuck in. +* Fiddled with the demo output to make it easier to see the spinner spin. Also + added prints before each platforms test output. +* I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for + finding this. Then I was lazy and made a new commit instead of using his + PR. Again, thank you for your patience @KenenY. +* Drastically speed up travis testing. +* Add a small javascript demo (demo.js) for showing off the various themes + (and testing them on diff platforms). +* Change: The subsection separator from ⁄ and / (different chars) to >. +* Fix crasher: A show or pulse without a label would cause the template renderer + to complain about a missing value. +* New feature: Add the ability to disable the clean-up-on-exit behavior. + Not something I expect to be widely desirable, but important if you have + multiple distinct gauge instances in your app. +* Use our own color support detection. + The `has-color` module proved too magic for my needs, making assumptions + as to which stream we write to and reading command line arguments. + +### v2.0.0 + +This is a major rewrite of the internals. Externally there are fewer +changes: + +* On node>0.8 gauge object now prints updates at a fixed rate. This means + that when you call `show` it may wate up to `updateInterval` ms before it + actually prints an update. You override this behavior with the + `fixedFramerate` option. +* The gauge object now keeps the cursor hidden as long as it's enabled and + shown. +* The constructor's arguments have changed, now it takes a mandatory output + stream and an optional options object. The stream no longer needs to be + an `ansi`ified stream, although it can be if you want (but we won't make + use of its special features). +* Previously the gauge was disabled by default if `process.stdout` wasn't a + tty. Now it always defaults to enabled. If you want the previous + behavior set the `enabled` option to `process.stdout.isTTY`. +* The constructor's options have changed– see the docs for details. +* Themes are entirely different. If you were using a custom theme, or + referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then + you'll need to change your code. You can get the equivalent of the latter + with: + ``` + var themes = require('gauge/themes') + var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform + ``` + The default themes no longer use any ambiguous width characters, so even + if you choose to display those as wide your progress bar should still + display correctly. +* Templates are entirely different and if you were using a custom one, you + should consult the documentation to learn how to recreate it. If you were + using the default, be aware that it has changed and the result looks quite + a bit different. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/LICENSE new file mode 100644 index 00000000000000..e756052969b780 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/README.md new file mode 100644 index 00000000000000..bf87d189f1b5c1 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/README.md @@ -0,0 +1,395 @@ +gauge +===== + +A nearly stateless terminal based horizontal gauge / progress bar. + +```javascript +var Gauge = require("gauge") + +var gauge = new Gauge() + +gauge.show("test", 0.20) + +gauge.pulse("this") + +gauge.hide() +``` + +![](gauge-demo.gif) + + +### CHANGES FROM 1.x + +Gauge 2.x is breaking release, please see the [changelog] for details on +what's changed if you were previously a user of this module. + +[changelog]: CHANGELOG.md + +### THE GAUGE CLASS + +This is the typical interface to the module– it provides a pretty +fire-and-forget interface to displaying your status information. + +``` +var Gauge = require("gauge") + +var gauge = new Gauge([stream], [options]) +``` + +* **stream** – *(optional, default STDERR)* A stream that progress bar + updates are to be written to. Gauge honors backpressure and will pause + most writing if it is indicated. +* **options** – *(optional)* An option object. + +Constructs a new gauge. Gauges are drawn on a single line, and are not drawn +if **stream** isn't a tty and a tty isn't explicitly provided. + +If **stream** is a terminal or if you pass in **tty** to **options** then we +will detect terminal resizes and redraw to fit. We do this by watching for +`resize` events on the tty. (To work around a bug in verisons of Node prior +to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to +larger window sizes will be clean, but shrinking the window will always +result in some cruft. + +**IMPORTANT:** If you prevously were passing in a non-tty stream but you still +want output (for example, a stream wrapped by the `ansi` module) then you +need to pass in the **tty** option below, as `gauge` needs access to +the underlying tty in order to do things like terminal resizes and terminal +width detection. + +The **options** object can have the following properties, all of which are +optional: + +* **updateInterval**: How often gauge updates should be drawn, in miliseconds. +* **fixedFramerate**: Defaults to false on node 0.8, true on everything + else. When this is true a timer is created to trigger once every + `updateInterval` ms, when false, updates are printed as soon as they come + in but updates more often than `updateInterval` are ignored. The reason + 0.8 doesn't have this set to true is that it can't `unref` its timer and + so it would stop your program from exiting– if you want to use this + feature with 0.8 just make sure you call `gauge.disable()` before you + expect your program to exit. +* **themes**: A themeset to use when selecting the theme to use. Defaults + to `gauge/themes`, see the [themes] documentation for details. +* **theme**: Select a theme for use, it can be a: + * Theme object, in which case the **themes** is not used. + * The name of a theme, which will be looked up in the current *themes* + object. + * A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + + If no theme is selected then a default is picked using a combination of our + best guesses at your OS, color support and unicode support. +* **template**: Describes what you want your gauge to look like. The + default is what npm uses. Detailed [documentation] is later in this + document. +* **hideCursor**: Defaults to true. If true, then the cursor will be hidden + while the gauge is displayed. +* **tty**: The tty that you're ultimately writing to. Defaults to the same + as **stream**. This is used for detecting the width of the terminal and + resizes. The width used is `tty.columns - 1`. If no tty is available then + a width of `79` is assumed. +* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true + the gauge starts enabled. If disabled then all update commands are + ignored and no gauge will be printed until you call `.enable()`. +* **Plumbing**: The class to use to actually generate the gauge for + printing. This defaults to `require('gauge/plumbing')` and ordinarly you + shouldn't need to override this. +* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit + handler to make sure your cursor is turned back on and the progress bar + erased when your process exits, even if you Ctrl-C out or otherwise exit + unexpectedly. You can disable this and it won't register the exit handler. + +[has-unicode]: https://www.npmjs.com/package/has-unicode +[themes]: #themes +[documentation]: #templates + +#### `gauge.show(section | status, [completed])` + +The first argument is either the section, the name of the current thing +contributing to progress, or an object with keys like **section**, +**subsection** & **completed** (or any others you have types for in a custom +template). If you don't want to update or set any of these you can pass +`null` and it will be ignored. + +The second argument is the percent completed as a value between 0 and 1. +Without it, completion is just not updated. You'll also note that completion +can be passed in as part of a status object as the first argument. If both +it and the completed argument are passed in, the completed argument wins. + +#### `gauge.hide([cb])` + +Removes the gauge from the terminal. Optionally, callback `cb` after IO has +had an opportunity to happen (currently this just means after `setImmediate` +has called back.) + +It turns out this is important when you're pausing the progress bar on one +filehandle and printing to another– otherwise (with a big enough print) node +can end up printing the "end progress bar" bits to the progress bar filehandle +while other stuff is printing to another filehandle. These getting interleaved +can cause corruption in some terminals. + +#### `gauge.pulse([subsection])` + +* **subsection** – *(optional)* The specific thing that triggered this pulse + +Spins the spinner in the gauge to show output. If **subsection** is +included then it will be combined with the last name passed to `gauge.show`. + +#### `gauge.disable()` + +Hides the gauge and ignores further calls to `show` or `pulse`. + +#### `gauge.enable()` + +Shows the gauge and resumes updating when `show` or `pulse` is called. + +#### `gauge.setThemeset(themes)` + +Change the themeset to select a theme from. The same as the `themes` option +used in the constructor. The theme will be reselected from this themeset. + +#### `gauge.setTheme(theme)` + +Change the active theme, will be displayed with the next show or pulse. This can be: + +* Theme object, in which case the **themes** is not used. +* The name of a theme, which will be looked up in the current *themes* + object. +* A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + +If no theme is selected then a default is picked using a combination of our +best guesses at your OS, color support and unicode support. + +#### `gauge.setTemplate(template)` + +Change the active template, will be displayed with the next show or pulse + +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet + +### THEMES + +``` +var themes = require('gauge/themes') + +// fetch the default color unicode theme for this platform +var ourTheme = themes({hasUnicode: true, hasColor: true}) + +// fetch the default non-color unicode theme for osx +var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'}) + +// create a new theme based on the color ascii theme for this platform +// that brackets the progress bar with arrows +var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), { + preProgressbar: '→', + postProgressbar: '←' +}) +``` + +The object returned by `gauge/themes` is an instance of the `ThemeSet` class. + +``` +var ThemeSet = require('gauge/theme-set') +var themes = new ThemeSet() +// or +var themes = require('gauge/themes') +var mythemes = themes.newThemeset() // creates a new themeset based on the default themes +``` + +#### themes(opts) +#### themes.getDefault(opts) + +Theme objects are a function that fetches the default theme based on +platform, unicode and color support. + +Options is an object with the following properties: + +* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is + available then a non-unicode theme will be used. +* **hasColor** - If true, fetch a color theme, if no color theme is + available a non-color theme will be used. +* **platform** (optional) - Defaults to `process.platform`. If no + platform match is available then `fallback` is used instead. + +If no compatible theme can be found then an error will be thrown with a +`code` of `EMISSINGTHEME`. + +#### themes.addTheme(themeName, themeObj) +#### themes.addTheme(themeName, [parentTheme], newTheme) + +Adds a named theme to the themeset. You can pass in either a theme object, +as returned by `themes.newTheme` or the arguments you'd pass to +`themes.newTheme`. + +#### themes.getThemeNames() + +Return a list of all of the names of the themes in this themeset. Suitable +for use in `themes.getTheme(…)`. + +#### themes.getTheme(name) + +Returns the theme object from this theme set named `name`. + +If `name` does not exist in this themeset an error will be thrown with +a `code` of `EMISSINGTHEME`. + +#### themes.setDefault([opts], themeName) + +`opts` is an object with the following properties. + +* **platform** - Defaults to `'fallback'`. If your theme is platform + specific, specify that here with the platform from `process.platform`, eg, + `win32`, `darwin`, etc. +* **hasUnicode** - Defaults to `false`. If your theme uses unicode you + should set this to true. +* **hasColor** - Defaults to `false`. If your theme uses color you should + set this to true. + +`themeName` is the name of the theme (as given to `addTheme`) to use for +this set of `opts`. + +#### themes.newTheme([parentTheme,] newTheme) + +Create a new theme object based on `parentTheme`. If no `parentTheme` is +provided then a minimal parentTheme that defines functions for rendering the +activity indicator (spinner) and progress bar will be defined. (This +fallback parent is defined in `gauge/base-theme`.) + +newTheme should be a bare object– we'll start by discussing the properties +defined by the default themes: + +* **preProgressbar** - displayed prior to the progress bar, if the progress + bar is displayed. +* **postProgressbar** - displayed after the progress bar, if the progress bar + is displayed. +* **progressBarTheme** - The subtheme passed through to the progress bar + renderer, it's an object with `complete` and `remaining` properties + that are the strings you want repeated for those sections of the progress + bar. +* **activityIndicatorTheme** - The theme for the activity indicator (spinner), + this can either be a string, in which each character is a different step, or + an array of strings. +* **preSubsection** - Displayed as a separator between the `section` and + `subsection` when the latter is printed. + +More generally, themes can have any value that would be a valid value when rendering +templates. The properties in the theme are used when their name matches a type in +the template. Their values can be: + +* **strings & numbers** - They'll be included as is +* **function (values, theme, width)** - Should return what you want in your output. + *values* is an object with values provided via `gauge.show`, + *theme* is the theme specific to this item (see below) or this theme object, + and *width* is the number of characters wide your result should be. + +There are a couple of special prefixes: + +* **pre** - Is shown prior to the property, if its displayed. +* **post** - Is shown after the property, if its displayed. + +And one special suffix: + +* **Theme** - Its value is passed to a function-type item as the theme. + +#### themes.addToAllThemes(theme) + +This *mixes-in* `theme` into all themes currently defined. It also adds it +to the default parent theme for this themeset, so future themes added to +this themeset will get the values from `theme` by default. + +#### themes.newThemeset() + +Copy the current themeset into a new one. This allows you to easily inherit +one themeset from another. + +### TEMPLATES + +A template is an array of objects and strings that, after being evaluated, +will be turned into the gauge line. The default template is: + +```javascript +[ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} +] +``` + +The various template elements can either be **plain strings**, in which case they will +be be included verbatum in the output, or objects with the following properties: + +* *type* can be any of the following plus any keys you pass into `gauge.show` plus + any keys you have on a custom theme. + * `section` – What big thing you're working on now. + * `subsection` – What component of that thing is currently working. + * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme` + from your active theme. + * `progressbar` – A progress bar representing your current `completed` + using the `progressbarTheme` from your active theme. +* *kerning* – Number of spaces that must be between this item and other + items, if this item is displayed at all. +* *maxLength* – The maximum length for this element. If its value is longer it + will be truncated. +* *minLength* – The minimum length for this element. If its value is shorter it + will be padded according to the *align* value. +* *align* – (Default: left) Possible values "left", "right" and "center". Works + as you'd expect from word processors. +* *length* – Provides a single value for both *minLength* and *maxLength*. If both + *length* and *minLength or *maxLength* are specifed then the latter take precedence. +* *value* – A literal value to use for this template item. +* *default* – A default value to use for this template item if a value + wasn't otherwise passed in. + +### PLUMBING + +This is the super simple, assume nothing, do no magic internals used by gauge to +implement its ordinary interface. + +``` +var Plumbing = require('gauge/plumbing') +var gauge = new Plumbing(theme, template, width) +``` + +* **theme**: The theme to use. +* **template**: The template to use. +* **width**: How wide your gauge should be + +#### `gauge.setTheme(theme)` + +Change the active theme. + +#### `gauge.setTemplate(template)` + +Change the active template. + +#### `gauge.setWidth(width)` + +Change the width to render at. + +#### `gauge.hide()` + +Return the string necessary to hide the progress bar + +#### `gauge.hideCursor()` + +Return a string to hide the cursor. + +#### `gauge.showCursor()` + +Return a string to show the cursor. + +#### `gauge.show(status)` + +Using `status` for values, render the provided template with the theme and return +a string that is suitable for printing to update the gauge. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/base-theme.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/base-theme.js new file mode 100644 index 00000000000000..0b67638e0211d0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/base-theme.js @@ -0,0 +1,14 @@ +'use strict' +var spin = require('./spin.js') +var progressBar = require('./progress-bar.js') + +module.exports = { + activityIndicator: function (values, theme, width) { + if (values.spun == null) return + return spin(theme, values.spun) + }, + progressbar: function (values, theme, width) { + if (values.completed == null) return + return progressBar(theme, width, values.completed) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/error.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/error.js new file mode 100644 index 00000000000000..d9914ba5335d25 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/error.js @@ -0,0 +1,24 @@ +'use strict' +var util = require('util') + +var User = exports.User = function User (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, User) + err.code = 'EGAUGE' + return err +} + +exports.MissingTemplateValue = function MissingTemplateValue (item, values) { + var err = new User(util.format('Missing template value "%s"', item.type)) + Error.captureStackTrace(err, MissingTemplateValue) + err.template = item + err.values = values + return err +} + +exports.Internal = function Internal (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, Internal) + err.code = 'EGAUGEINTERNAL' + return err +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/has-color.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/has-color.js new file mode 100644 index 00000000000000..e283a256f26b74 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/has-color.js @@ -0,0 +1,12 @@ +'use strict' + +module.exports = isWin32() || isColorTerm() + +function isWin32 () { + return process.platform === 'win32' +} + +function isColorTerm () { + var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i + return !!process.env.COLORTERM || termHasColor.test(process.env.TERM) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/index.js new file mode 100644 index 00000000000000..7eefb9507bb47e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/index.js @@ -0,0 +1,226 @@ +'use strict' +var Plumbing = require('./plumbing.js') +var hasUnicode = require('has-unicode') +var hasColor = require('./has-color.js') +var onExit = require('signal-exit') +var defaultThemes = require('./themes') +var setInterval = require('./set-interval.js') +var process = require('./process.js') +var setImmediate = require('./set-immediate') + +module.exports = Gauge + +function callWith (obj, method) { + return function () { + return method.call(obj) + } +} + +function Gauge (arg1, arg2) { + var options, writeTo + if (arg1 && arg1.write) { + writeTo = arg1 + options = arg2 || {} + } else if (arg2 && arg2.write) { + writeTo = arg2 + options = arg1 || {} + } else { + writeTo = process.stderr + options = arg1 || arg2 || {} + } + + this._status = { + spun: 0, + section: '', + subsection: '' + } + this._paused = false // are we paused for back pressure? + this._disabled = true // are all progress bar updates disabled? + this._showing = false // do we WANT the progress bar on screen + this._onScreen = false // IS the progress bar on screen + this._needsRedraw = false // should we print something at next tick? + this._hideCursor = options.hideCursor == null ? true : options.hideCursor + this._fixedFramerate = options.fixedFramerate == null + ? !(/^v0\.8\./.test(process.version)) + : options.fixedFramerate + this._lastUpdateAt = null + this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval + + this._themes = options.themes || defaultThemes + this._theme = options.theme + var theme = this._computeTheme(options.theme) + var template = options.template || [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} + ] + this.setWriteTo(writeTo, options.tty) + var PlumbingClass = options.Plumbing || Plumbing + this._gauge = new PlumbingClass(theme, template, this.getWidth()) + + this._$$doRedraw = callWith(this, this._doRedraw) + this._$$handleSizeChange = callWith(this, this._handleSizeChange) + + if (options.cleanupOnExit == null || options.cleanupOnExit) { + onExit(callWith(this, this.disable)) + } + + if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { + this.enable() + } else { + this.disable() + } +} +Gauge.prototype = {} + +Gauge.prototype.setTemplate = function (template) { + this._gauge.setTemplate(template) + if (this._showing) this._requestRedraw() +} + +Gauge.prototype._computeTheme = function (theme) { + if (!theme) theme = {} + if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { + var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode + var useColor = theme.hasColor == null ? hasColor : theme.hasColor + theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) + } else if (typeof theme === 'string') { + theme = this._themes.getTheme(theme) + } + return theme +} + +Gauge.prototype.setThemeset = function (themes) { + this._themes = themes + this.setTheme(this._theme) +} + +Gauge.prototype.setTheme = function (theme) { + this._gauge.setTheme(this._computeTheme(theme)) + if (this._showing) this._requestRedraw() + this._theme = theme +} + +Gauge.prototype._requestRedraw = function () { + this._needsRedraw = true + if (!this._fixedFramerate) this._doRedraw() +} + +Gauge.prototype.getWidth = function () { + return ((this._tty && this._tty.columns) || 80) - 1 +} + +Gauge.prototype.setWriteTo = function (writeTo, tty) { + var enabled = !this._disabled + if (enabled) this.disable() + this._writeTo = writeTo + this._tty = tty || + (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || + (writeTo.isTTY && writeTo) || + this._tty + if (this._gauge) this._gauge.setWidth(this.getWidth()) + if (enabled) this.enable() +} + +Gauge.prototype.enable = function () { + if (!this._disabled) return + this._disabled = false + if (this._tty) this._enableEvents() + if (this._showing) this.show() +} + +Gauge.prototype.disable = function () { + if (this._disabled) return + if (this._showing) { + this._lastUpdateAt = null + this._showing = false + this._doRedraw() + this._showing = true + } + this._disabled = true + if (this._tty) this._disableEvents() +} + +Gauge.prototype._enableEvents = function () { + this._tty.on('resize', this._$$handleSizeChange) + if (this._fixedFramerate) { + this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) + if (this.redrawTracker.unref) this.redrawTracker.unref() + } +} + +Gauge.prototype._disableEvents = function () { + this._tty.removeListener('resize', this._$$handleSizeChange) + if (this._fixedFramerate) clearInterval(this.redrawTracker) +} + +Gauge.prototype.hide = function (cb) { + if (this._disabled) return cb && process.nextTick(cb) + if (!this._showing) return cb && process.nextTick(cb) + this._showing = false + this._doRedraw() + cb && setImmediate(cb) +} + +Gauge.prototype.show = function (section, completed) { + if (this._disabled) return + this._showing = true + if (typeof section === 'string') { + this._status.section = section + } else if (typeof section === 'object') { + var sectionKeys = Object.keys(section) + for (var ii = 0; ii < sectionKeys.length; ++ii) { + var key = sectionKeys[ii] + this._status[key] = section[key] + } + } + if (completed != null) this._status.completed = completed + this._requestRedraw() +} + +Gauge.prototype.pulse = function (subsection) { + if (this._disabled) return + if (!this._showing) return + this._status.subsection = subsection || '' + this._status.spun ++ + this._requestRedraw() +} + +Gauge.prototype._handleSizeChange = function () { + this._gauge.setWidth(this._tty.columns - 1) + this._requestRedraw() +} + +Gauge.prototype._doRedraw = function () { + if (this._disabled || this._paused) return + if (!this._fixedFramerate) { + var now = Date.now() + if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return + this._lastUpdateAt = now + } + if (!this._showing && this._onScreen) { + this._onScreen = false + var result = this._gauge.hide() + if (this._hideCursor) { + result += this._gauge.showCursor() + } + return this._writeTo.write(result) + } + if (!this._showing && !this._onScreen) return + if (this._showing && !this._onScreen) { + this._onScreen = true + this._needsRedraw = true + if (this._hideCursor) { + this._writeTo.write(this._gauge.hideCursor()) + } + } + if (!this._needsRedraw) return + if (!this._writeTo.write(this._gauge.show(this._status))) { + this._paused = true + this._writeTo.on('drain', callWith(this, function () { + this._paused = false + this._doRedraw() + })) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js new file mode 100644 index 00000000000000..092d0baef6698e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js @@ -0,0 +1,32 @@ +'use strict'; +module.exports = (function () { + if (process.argv.indexOf('--no-color') !== -1) { + return false; + } + + if (process.argv.indexOf('--color') !== -1) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json new file mode 100644 index 00000000000000..8e08278c65bea0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "has-color@^0.1.7", + "_id": "has-color@0.1.7", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/has-color", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "_shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "_shrinkwrap": null, + "_spec": "has-color@^0.1.7", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "tarball": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-color", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "capability", + "detect" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "has-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/has-color.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.7" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md new file mode 100644 index 00000000000000..37bbd8991a6423 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md @@ -0,0 +1,30 @@ +# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color) + +> Detect whether a terminal supports color. + +Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). + + +## Install + +```bash +$ npm install --save has-color +``` + + +## Usage + +```js +var hasColor = require('has-color'); + +if (hasColor) { + console.log('Terminal supports color.'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + + +## License + +[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js new file mode 100644 index 00000000000000..508504840dc61d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js @@ -0,0 +1,83 @@ +'use strict'; +/* eslint-disable no-unused-vars */ +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (e) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (Object.getOwnPropertySymbols) { + symbols = Object.getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license @@ -0,0 +1,21 @@ +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json new file mode 100644 index 00000000000000..16651a0ab52da2 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "object-assign@^4.1.0", + "_id": "object-assign@4.1.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/object-assign", + "_nodeVersion": "4.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/object-assign-4.1.0.tgz_1462212593641_0.3332549517508596" + }, + "_npmUser": { + "name": "spicyj", + "email": "ben@benalpert.com" + }, + "_npmVersion": "2.14.19", + "_phantomChildren": {}, + "_requested": { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "_shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "_shrinkwrap": null, + "_spec": "object-assign@^4.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/object-assign/issues" + }, + "dependencies": {}, + "description": "ES2015 Object.assign() ponyfill", + "devDependencies": { + "lodash": "^4.8.2", + "matcha": "^0.7.0", + "mocha": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "72fe21c86911758f3342fdf41c2a57860d5829bc", + "homepage": "https://github.com/sindresorhus/object-assign#readme", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "spicyj", + "email": "ben@benalpert.com" + } + ], + "name": "object-assign", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/object-assign.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && mocha" + }, + "version": "4.1.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md new file mode 100644 index 00000000000000..13c097734cfd18 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md @@ -0,0 +1,56 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, source, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md new file mode 100644 index 00000000000000..c12f8340c8d6c6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md @@ -0,0 +1,17 @@ +# 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. + + +# [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13) + + +### Bug Fixes + +* get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8)) +* hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c)) + + +### BREAKING CHANGES + +* signal-exit no longer wires into SIGPROF diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 00000000000000..c7e27478a3eff8 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,14 @@ +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md new file mode 100644 index 00000000000000..8ebccabecaea4c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md @@ -0,0 +1,40 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the proces to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js new file mode 100644 index 00000000000000..7dd8d917dc507b --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js @@ -0,0 +1,148 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +var assert = require('assert') +var signals = require('./signals.js') + +var EE = require('events') +/* istanbul ignore if */ +if (typeof EE !== 'function') { + EE = EE.EventEmitter +} + +var emitter +if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ +} else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} +} + +module.exports = function (cb, opts) { + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove +} + +module.exports.unload = unload +function unload () { + if (!loaded) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 +} + +function emit (event, code, signal) { + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) +} + +// { : , ... } +var sigListeners = {} +signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } +}) + +module.exports.signals = function () { + return signals +} + +module.exports.load = load + +var loaded = false + +function load () { + if (loaded) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit +} + +var originalProcessReallyExit = process.reallyExit +function processReallyExit (code) { + process.exitCode = code || 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) +} + +var originalProcessEmit = process.emit +function processEmit (ev, arg) { + if (ev === 'exit') { + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json new file mode 100644 index 00000000000000..19e71fd5ff9fde --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "signal-exit@^3.0.0", + "_id": "signal-exit@3.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/signal-exit", + "_nodeVersion": "5.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/signal-exit-3.0.0.tgz_1465857346813_0.7961636525578797" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", + "_shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "_shrinkwrap": null, + "_spec": "signal-exit@^3.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "dependencies": {}, + "description": "when you want to fire an event no matter how a process exits.", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.2", + "nyc": "^6.4.4", + "standard": "^7.1.2", + "standard-version": "^2.3.0", + "tap": "^5.7.2" + }, + "directories": {}, + "dist": { + "shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "tarball": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz" + }, + "files": [ + "index.js", + "signals.js" + ], + "gitHead": "2bbec4e5d9f9cf1f7529b1c923d1b058e69ccf7f", + "homepage": "https://github.com/tapjs/signal-exit", + "keywords": [ + "signal", + "exit" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "signal-exit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/signal-exit.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "release": "standard-version", + "test": "tap --timeout=240 ./test/*.js --cov" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js new file mode 100644 index 00000000000000..bc6f97ee606954 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js @@ -0,0 +1,52 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGBUS', + 'SIGFPE', + 'SIGHUP', + 'SIGILL', + 'SIGINT', + 'SIGSEGV', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js new file mode 100644 index 00000000000000..b9bec62440a468 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js @@ -0,0 +1,37 @@ +'use strict'; +var stripAnsi = require('strip-ansi'); +var codePointAt = require('code-point-at'); +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 +module.exports = function (str) { + if (typeof str !== 'string' || str.length === 0) { + return 0; + } + + var width = 0; + + str = stripAnsi(str); + + for (var i = 0; i < str.length; i++) { + var code = codePointAt(str, i); + + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + + // surrogates + if (code >= 0x10000) { + i++; + } + + if (isFullwidthCodePoint(code)) { + width += 2; + } else { + width++; + } + } + + return width; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license @@ -0,0 +1,21 @@ +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js new file mode 100644 index 00000000000000..0335117977237f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js @@ -0,0 +1,33 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (str, pos) { + if (str === null || str === undefined) { + throw TypeError(); + } + + str = String(str); + + var size = str.length; + var i = pos ? Number(pos) : 0; + + if (numberIsNan(i)) { + i = 0; + } + + if (i < 0 || i >= size) { + return undefined; + } + + var first = str.charCodeAt(i); + + if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { + var second = str.charCodeAt(i + 1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + + return first; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license @@ -0,0 +1,21 @@ +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..362803be0df21e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/code-point-at/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width/code-point-at" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json new file mode 100644 index 00000000000000..d602d507a66c07 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "code-point-at@^1.0.0", + "_id": "code-point-at@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/code-point-at", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", + "_shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "_shrinkwrap": null, + "_spec": "code-point-at@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/code-point-at/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "ES2015 String#codePointAt() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "tarball": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "c2ffa4064718b37c84c73a633abeeed5b486a469", + "homepage": "https://github.com/sindresorhus/code-point-at", + "keywords": [ + "es2015", + "es6", + "ponyfill", + "polyfill", + "shim", + "string", + "str", + "code", + "point", + "at", + "codepoint", + "unicode" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "code-point-at", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/code-point-at.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md new file mode 100644 index 00000000000000..71e7d0931b8b0c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md @@ -0,0 +1,34 @@ +# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) + +> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save code-point-at +``` + + +## Usage + +```js +var codePointAt = require('code-point-at'); + +codePointAt('🐴'); +//=> 128052 + +codePointAt('abc', 2); +//=> 99 +``` + +## API + +### codePointAt(input, [position]) + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..a7d3e3855f1c24 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // 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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..3b853d672bca99 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..983c888760840f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "is-fullwidth-code-point@^1.0.0", + "_id": "is-fullwidth-code-point@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "_shrinkwrap": null, + "_spec": "is-fullwidth-code-point@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/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" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "tarball": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f2152d357f41f82785436d428e4f8ede143b7548", + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-fullwidth-code-point", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..4936464b1b4155 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/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 +var 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](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json new file mode 100644 index 00000000000000..3f8334f0294200 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json @@ -0,0 +1,136 @@ +{ + "_args": [ + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "string-width@^1.0.1", + "_id": "string-width@1.0.2", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.5", + "_phantomChildren": {}, + "_requested": { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge", + "/npm-registry-client/npmlog/gauge/wide-align" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "_shrinkwrap": null, + "_spec": "string-width@^1.0.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b", + "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", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "string-width", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md new file mode 100644 index 00000000000000..1ab42c93580ecb --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md @@ -0,0 +1,42 @@ +# 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](http://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 --save string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 +``` + + +## 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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore new file mode 100644 index 00000000000000..d1a6b0054bc8f3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore @@ -0,0 +1,5 @@ +*~ +/node_modules +.#* +/.nyc_output +/coverage diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE similarity index 82% rename from deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE rename to deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE index 19129e315fe593..f4be44d881b2d9 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE @@ -1,6 +1,4 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors +Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -11,5 +9,6 @@ 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. +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/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md new file mode 100644 index 00000000000000..32f1be04f09776 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md @@ -0,0 +1,47 @@ +wide-align +---------- + +A wide-character aware text alignment function for use in terminals / on the +console. + +### Usage + +``` +var align = require('wide-align') + +// Note that if you view this on a unicode console, all of the slashes are +// aligned. This is because on a console, all narrow characters are +// an en wide and all wide characters are an em. In browsers, this isn't +// held to and wide characters like "古" can be less than two narrow +// characters even with a fixed width font. + +console.log(align.center('abc', 10)) // ' abc ' +console.log(align.center('古古古', 10)) // ' 古古古 ' +console.log(align.left('abc', 10)) // 'abc ' +console.log(align.left('古古古', 10)) // '古古古 ' +console.log(align.right('abc', 10)) // ' abc' +console.log(align.right('古古古', 10)) // ' 古古古' +``` + +### Functions + +#### `align.center(str, length)` → `str` + +Returns *str* with spaces added to both sides such that that it is *length* +chars long and centered in the spaces. + +#### `align.left(str, length)` → `str` + +Returns *str* with spaces to the right such that it is *length* chars long. + +### `align.right(str, length)` → `str` + +Returns *str* with spaces to the left such that it is *length* chars long. + +### Origins + +These functions were originally taken from +[cliui](https://npmjs.com/package/cliui). Changes include switching to the +MUCH faster pad generation function from +[lodash](https://npmjs.com/package/lodash), making center alignment pad +both sides and adding left alignment. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js new file mode 100644 index 00000000000000..4f94ca4cde19b5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js @@ -0,0 +1,65 @@ +'use strict' +var stringWidth = require('string-width') + +exports.center = alignCenter +exports.left = alignLeft +exports.right = alignRight + +// lodash's way of generating pad characters. + +function createPadding (width) { + var result = '' + var string = ' ' + var n = width + do { + if (n % 2) { + result += string; + } + n = Math.floor(n / 2); + string += string; + } while (n); + + return result; +} + +function alignLeft (str, width) { + var trimmed = str.trimRight() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return trimmed + padding +} + +function alignRight (str, width) { + var trimmed = str.trimLeft() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return padding + trimmed +} + +function alignCenter (str, width) { + var trimmed = str.trim() + if (trimmed.length === 0 && str.length >= width) return str + var padLeft = '' + var padRight = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + var padLeftBy = parseInt((width - strWidth) / 2, 10) + padLeft = createPadding(padLeftBy) + padRight = createPadding(width - (strWidth + padLeftBy)) + } + + return padLeft + trimmed + padRight +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json new file mode 100644 index 00000000000000..bdc7bfa6a4b7e5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "wide-align@^1.1.0", + "_id": "wide-align@1.1.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/wide-align", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.5.3", + "_phantomChildren": {}, + "_requested": { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz", + "_shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "_shrinkwrap": null, + "_spec": "wide-align@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/wide-align/issues" + }, + "dependencies": { + "string-width": "^1.0.1" + }, + "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", + "devDependencies": { + "tap": "^2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "tarball": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz" + }, + "gitHead": "fe3f7f210650913d5bee702d7e19938f6977bc8a", + "homepage": "https://github.com/iarna/wide-align#readme", + "keywords": [ + "wide", + "double", + "unicode", + "cjkv", + "pad", + "align" + ], + "license": "ISC", + "main": "align.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "wide-align", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/wide-align.git" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js new file mode 100644 index 00000000000000..64e9f9dbda4697 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js @@ -0,0 +1,37 @@ +'use strict' +var test = require('tap').test +var align = require('..') + +test('align', function (t) { + t.is(align.center('abc', 10), ' abc ', 'center narrow') + t.is(align.center('古古古', 10), ' 古古古 ', 'center wide') + t.is(align.left('abc', 10), 'abc ', 'left narrow') + t.is(align.left('古古古', 10), '古古古 ', 'left wide') + t.is(align.right('abc', 10), ' abc', 'right narrow') + t.is(align.right('古古古', 10), ' 古古古', 'right wide') + + t.is(align.center('abc', 2), 'abc', 'center narrow overflow') + t.is(align.center('古古古', 4), '古古古', 'center wide overflow') + t.is(align.left('abc', 2), 'abc', 'left narrow overflow') + t.is(align.left('古古古', 4), '古古古', 'left wide overflow') + t.is(align.right('abc', 2), 'abc', 'right narrow overflow') + t.is(align.right('古古古', 4), '古古古', 'right wide overflow') + + t.is(align.left('', 5), ' ', 'left align nothing') + t.is(align.center('', 5), ' ', 'center align nothing') + t.is(align.right('', 5), ' ', 'right align nothing') + + t.is(align.left(' ', 5), ' ', 'left align whitespace') + t.is(align.center(' ', 5), ' ', 'center align whitespace') + t.is(align.right(' ', 5), ' ', 'right align whitespace') + + t.is(align.left(' ', 2), ' ', 'left align whitespace overflow') + t.is(align.center(' ', 2), ' ', 'center align whitespace overflow') + t.is(align.right(' ', 2), ' ', 'right align whitespace overflow') + + t.is(align.left('x ', 10), 'x ', 'left align whitespace mix') + t.is(align.center('x ', 10), ' x ', 'center align whitespace mix') + t.is(align.right('x ', 10), ' x', 'right align whitespace mix') + + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/package.json new file mode 100644 index 00000000000000..209c6b4125f198 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/package.json @@ -0,0 +1,140 @@ +{ + "_args": [ + [ + { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "gauge@~2.6.0", + "_id": "gauge@2.6.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/gauge-2.6.0.tgz_1466067371972_0.20705468393862247" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": { + "strip-ansi": "3.0.1" + }, + "_requested": { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog" + ], + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz", + "_shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", + "_shrinkwrap": null, + "_spec": "gauge@~2.6.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/gauge/issues" + }, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-color": "^0.1.7", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + }, + "description": "A terminal based horizontal guage", + "devDependencies": { + "readable-stream": "^2.0.6", + "require-inject": "^1.4.0", + "standard": "^7.1.2", + "tap": "^5.7.2", + "through2": "^2.0.0" + }, + "directories": {}, + "dist": { + "shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", + "tarball": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz" + }, + "files": [ + "base-theme.js", + "CHANGELOG.md", + "error.js", + "has-color.js", + "index.js", + "LICENSE", + "package.json", + "plumbing.js", + "process.js", + "progress-bar.js", + "README.md", + "render-template.js", + "set-immediate.js", + "set-interval.js", + "spin.js", + "template-item.js", + "theme-set.js", + "themes.js", + "wide-truncate.js" + ], + "gitHead": "d51040a71c269432c16cc542143f403a831630e6", + "homepage": "https://github.com/iarna/gauge", + "keywords": [ + "progressbar", + "progress", + "gauge" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "gauge", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/gauge.git" + }, + "scripts": { + "test": "standard && tap test/*.js --coverage" + }, + "version": "2.6.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/plumbing.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/plumbing.js new file mode 100644 index 00000000000000..589a9c92878ebf --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/plumbing.js @@ -0,0 +1,47 @@ +'use strict' +var consoleControl = require('console-control-strings') +var renderTemplate = require('./render-template.js') +var validate = require('aproba') + +var Plumbing = module.exports = function (theme, template, width) { + if (!width) width = 80 + validate('OAN', [theme, template, width]) + this.showing = false + this.theme = theme + this.width = width + this.template = template +} +Plumbing.prototype = {} + +Plumbing.prototype.setTheme = function (theme) { + validate('O', [theme]) + this.theme = theme +} + +Plumbing.prototype.setTemplate = function (template) { + validate('A', [template]) + this.template = template +} + +Plumbing.prototype.setWidth = function (width) { + validate('N', [width]) + this.width = width +} + +Plumbing.prototype.hide = function () { + return consoleControl.gotoSOL() + consoleControl.eraseLine() +} + +Plumbing.prototype.hideCursor = consoleControl.hideCursor + +Plumbing.prototype.showCursor = consoleControl.showCursor + +Plumbing.prototype.show = function (status) { + var values = Object.create(this.theme) + for (var key in status) { + values[key] = status[key] + } + + return renderTemplate(this.width, this.template, values).trim() + + consoleControl.eraseLine() + consoleControl.gotoSOL() +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/process.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/process.js new file mode 100644 index 00000000000000..05e85694d755b6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/process.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = process diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/progress-bar.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/progress-bar.js new file mode 100644 index 00000000000000..7f8dd68be24cf0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/progress-bar.js @@ -0,0 +1,35 @@ +'use strict' +var validate = require('aproba') +var renderTemplate = require('./render-template.js') +var wideTruncate = require('./wide-truncate') +var stringWidth = require('string-width') + +module.exports = function (theme, width, completed) { + validate('ONN', [theme, width, completed]) + if (completed < 0) completed = 0 + if (completed > 1) completed = 1 + if (width <= 0) return '' + var sofar = Math.round(width * completed) + var rest = width - sofar + var template = [ + {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, + {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} + ] + return renderTemplate(width, template, theme) +} + +// lodash's way of repeating +function repeat (string, width) { + var result = '' + var n = width + do { + if (n % 2) { + result += string + } + n = Math.floor(n / 2) + /*eslint no-self-assign: 0*/ + string += string + } while (n && stringWidth(result) < width) + + return wideTruncate(result, width) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/render-template.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/render-template.js new file mode 100644 index 00000000000000..3261bfbe6f4be5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/render-template.js @@ -0,0 +1,181 @@ +'use strict' +var align = require('wide-align') +var validate = require('aproba') +var objectAssign = require('object-assign') +var wideTruncate = require('./wide-truncate') +var error = require('./error') +var TemplateItem = require('./template-item') + +function renderValueWithValues (values) { + return function (item) { + return renderValue(item, values) + } +} + +var renderTemplate = module.exports = function (width, template, values) { + var items = prepareItems(width, template, values) + var rendered = items.map(renderValueWithValues(values)).join('') + return align.left(wideTruncate(rendered, width), width) +} + +function preType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'pre' + cappedTypeName +} + +function postType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'post' + cappedTypeName +} + +function hasPreOrPost (item, values) { + if (!item.type) return + return values[preType(item)] || values[postType(item)] +} + +function generatePreAndPost (baseItem, parentValues) { + var item = objectAssign({}, baseItem) + var values = Object.create(parentValues) + var template = [] + var pre = preType(item) + var post = postType(item) + if (values[pre]) { + template.push({value: values[pre]}) + values[pre] = null + } + item.minLength = null + item.length = null + item.maxLength = null + template.push(item) + values[item.type] = values[item.type] + if (values[post]) { + template.push({value: values[post]}) + values[post] = null + } + return function ($1, $2, length) { + return renderTemplate(length, template, values) + } +} + +function prepareItems (width, template, values) { + function cloneAndObjectify (item, index, arr) { + var cloned = new TemplateItem(item, width) + var type = cloned.type + if (cloned.value == null) { + if (!(type in values)) { + if (cloned.default == null) { + throw new error.MissingTemplateValue(cloned, values) + } else { + cloned.value = cloned.default + } + } else { + cloned.value = values[type] + } + } + if (cloned.value == null || cloned.value === '') return null + cloned.index = index + cloned.first = index === 0 + cloned.last = index === arr.length - 1 + if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values) + return cloned + } + + var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) + + var outputLength = 0 + var remainingSpace = width + var variableCount = output.length + + function consumeSpace (length) { + if (length > remainingSpace) length = remainingSpace + outputLength += length + remainingSpace -= length + } + + function finishSizing (item, length) { + if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') + if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') + if (length != null) item.length = length + item.minLength = null + item.maxLength = null + --variableCount + item.finished = true + if (item.length == null) item.length = item.getBaseLength() + if (item.length == null) throw new error.Internal('Finished template items must have a length') + consumeSpace(item.getLength()) + } + + output.forEach(function (item) { + if (!item.kerning) return + var prevPadRight = item.first ? 0 : output[item.index - 1].padRight + if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight + if (!item.last) item.padRight = item.kerning + }) + + // Finish any that have a fixed (literal or intuited) length + output.forEach(function (item) { + if (item.getBaseLength() == null) return + finishSizing(item) + }) + + var resized = 0 + var resizing + var hunkSize + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.maxLength) return + if (item.getMaxLength() < hunkSize) { + finishSizing(item, item.maxLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + + resized = 0 + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.minLength) return + if (item.getMinLength() >= hunkSize) { + finishSizing(item, item.minLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + finishSizing(item, hunkSize) + }) + + return output +} + +function renderFunction (item, values, length) { + validate('OON', arguments) + if (item.type) { + return item.value(values, values[item.type + 'Theme'] || {}, length) + } else { + return item.value(values, {}, length) + } +} + +function renderValue (item, values) { + var length = item.getBaseLength() + var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value + if (value == null || value === '') return '' + var alignWith = align[item.align] || align.left + var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' + var rightPadding = item.padRight ? align.right('', item.padRight) : '' + var truncated = wideTruncate(String(value), length) + var aligned = alignWith(truncated, length) + return leftPadding + aligned + rightPadding +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-immediate.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-immediate.js new file mode 100644 index 00000000000000..6650a485c49933 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-immediate.js @@ -0,0 +1,7 @@ +'use strict' +var process = require('./process') +try { + module.exports = setImmediate +} catch (ex) { + module.exports = process.nextTick +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-interval.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-interval.js new file mode 100644 index 00000000000000..576198793c5504 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-interval.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = setInterval diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/spin.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/spin.js new file mode 100644 index 00000000000000..34142ee31acc7c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/spin.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = function spin (spinstr, spun) { + return spinstr[spun % spinstr.length] +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/template-item.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/template-item.js new file mode 100644 index 00000000000000..e46f447c941d38 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/template-item.js @@ -0,0 +1,73 @@ +'use strict' +var stringWidth = require('string-width') + +module.exports = TemplateItem + +function isPercent (num) { + if (typeof num !== 'string') return false + return num.slice(-1) === '%' +} + +function percent (num) { + return Number(num.slice(0, -1)) / 100 +} + +function TemplateItem (values, outputLength) { + this.overallOutputLength = outputLength + this.finished = false + this.type = null + this.value = null + this.length = null + this.maxLength = null + this.minLength = null + this.kerning = null + this.align = 'left' + this.padLeft = 0 + this.padRight = 0 + this.index = null + this.first = null + this.last = null + if (typeof values === 'string') { + this.value = values + } else { + for (var prop in values) this[prop] = values[prop] + } + // Realize percents + if (isPercent(this.length)) { + this.length = Math.round(this.overallOutputLength * percent(this.length)) + } + if (isPercent(this.minLength)) { + this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) + } + if (isPercent(this.maxLength)) { + this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) + } + return this +} + +TemplateItem.prototype = {} + +TemplateItem.prototype.getBaseLength = function () { + var length = this.length + if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + length = stringWidth(this.value) + } + return length +} + +TemplateItem.prototype.getLength = function () { + var length = this.getBaseLength() + if (length == null) return null + return length + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMaxLength = function () { + if (this.maxLength == null) return null + return this.maxLength + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMinLength = function () { + if (this.minLength == null) return null + return this.minLength + this.padLeft + this.padRight +} + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/theme-set.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/theme-set.js new file mode 100644 index 00000000000000..68971d5d231b07 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/theme-set.js @@ -0,0 +1,115 @@ +'use strict' +var objectAssign = require('object-assign') + +module.exports = function () { + return ThemeSetProto.newThemeSet() +} + +var ThemeSetProto = {} + +ThemeSetProto.baseTheme = require('./base-theme.js') + +ThemeSetProto.newTheme = function (parent, theme) { + if (!theme) { + theme = parent + parent = this.baseTheme + } + return objectAssign({}, parent, theme) +} + +ThemeSetProto.getThemeNames = function () { + return Object.keys(this.themes) +} + +ThemeSetProto.addTheme = function (name, parent, theme) { + this.themes[name] = this.newTheme(parent, theme) +} + +ThemeSetProto.addToAllThemes = function (theme) { + var themes = this.themes + Object.keys(themes).forEach(function (name) { + objectAssign(themes[name], theme) + }) + objectAssign(this.baseTheme, theme) +} + +ThemeSetProto.getTheme = function (name) { + if (!this.themes[name]) throw this.newMissingThemeError(name) + return this.themes[name] +} + +ThemeSetProto.setDefault = function (opts, name) { + if (name == null) { + name = opts + opts = {} + } + var platform = opts.platform == null ? 'fallback' : opts.platform + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + this.defaults[platform][hasUnicode][hasColor] = name +} + +ThemeSetProto.getDefault = function (opts) { + if (!opts) opts = {} + var platformName = opts.platform || process.platform + var platform = this.defaults[platformName] || this.defaults.fallback + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform[hasUnicode][hasColor]) { + if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { + hasUnicode = false + hasColor = false + } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (platform === this.defaults.fallback) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } + } + if (platform[hasUnicode][hasColor]) { + return this.getTheme(platform[hasUnicode][hasColor]) + } else { + return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + } +} + +ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { + var err = new Error('Could not find a gauge theme named "' + name + '"') + Error.captureStackTrace.call(err, newMissingThemeError) + err.theme = name + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + + ' platform = ' + platformName + '\n' + + ' hasUnicode = ' + hasUnicode + '\n' + + ' hasColor = ' + hasColor) + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newThemeSet = function () { + var themeset = function (opts) { + return themeset.getDefault(opts) + } + return objectAssign(themeset, ThemeSetProto, { + themes: objectAssign({}, this.themes), + baseTheme: objectAssign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})) + }) +} + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/themes.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/themes.js new file mode 100644 index 00000000000000..eb5a4f5b5e1034 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/themes.js @@ -0,0 +1,54 @@ +'use strict' +var consoleControl = require('console-control-strings') +var ThemeSet = require('./theme-set.js') + +var themes = module.exports = new ThemeSet() + +themes.addTheme('ASCII', { + preProgressbar: '[', + postProgressbar: ']', + progressbarTheme: { + complete: '#', + remaining: '.' + }, + activityIndicatorTheme: '-\\|/', + preSubsection: '>' +}) + +themes.addTheme('colorASCII', themes.getTheme('ASCII'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '.', + postRemaining: consoleControl.color('reset') + } +}) + +themes.addTheme('brailleSpinner', { + preProgressbar: '⸨', + postProgressbar: '⸩', + progressbarTheme: { + complete: '░', + remaining: '⠂' + }, + activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', + preSubsection: '>' +}) + +themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '░', + postRemaining: consoleControl.color('reset') + } +}) + +themes.setDefault({}, 'ASCII') +themes.setDefault({hasColor: true}, 'colorASCII') +themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/wide-truncate.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/wide-truncate.js new file mode 100644 index 00000000000000..c531bc491fbb58 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/wide-truncate.js @@ -0,0 +1,25 @@ +'use strict' +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') + +module.exports = wideTruncate + +function wideTruncate (str, target) { + if (stringWidth(str) === 0) return str + if (target <= 0) return '' + if (stringWidth(str) <= target) return str + + // We compute the number of bytes of ansi sequences here and add + // that to our initial truncation to ensure that we don't slice one + // that we want to keep in half. + var noAnsi = stripAnsi(str) + var ansiSize = str.length + noAnsi.length + var truncated = str.slice(0, target + ansiSize) + + // we have to shrink the result to account for our ansi sequence buffer + // (if an ansi sequence was truncated) and double width characters. + while (stringWidth(truncated) > target) { + truncated = truncated.slice(0, -1) + } + return truncated +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md new file mode 100644 index 00000000000000..03bf591923d782 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/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/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17) + + +### Features + +* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277)) + + +### BREAKING CHANGES + +* stdio/stderr will not be set to blocking if isTTY === false + + + + +# 1.0.0 (2016-05-14) + + +### Features + +* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0)) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt new file mode 100644 index 00000000000000..836440bef7cf14 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, 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/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/README.md new file mode 100644 index 00000000000000..e93b4202b59d65 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/README.md @@ -0,0 +1,31 @@ +# set-blocking + +[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) +[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) +[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. + +```js +const setBlocking = require('set-blocking') +setBlocking(true) +console.log(someLargeStringToOutput) +``` + +## Historical Context/Word of Warning + +This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on +newer versions of Node.js (`0.12+`), truncating terminal output. + +You should be mindful of the side-effects caused by using `set-blocking`: + +* if your module sets blocking to `true`, it will effect other modules + consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call + `setBlocking(true)` once we already know we are about to call `process.exit(code)`. +* this patch will not apply to subprocesses spawned with `isTTY = true`, this is + the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). + +## License + +ISC diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/index.js new file mode 100644 index 00000000000000..6f78774bb63ee6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/index.js @@ -0,0 +1,7 @@ +module.exports = function (blocking) { + [process.stdout, process.stderr].forEach(function (stream) { + if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(blocking) + } + }) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/package.json new file mode 100644 index 00000000000000..bbfac3e6ca4e90 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "set-blocking@~2.0.0", + "_id": "set-blocking@2.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/set-blocking", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/set-blocking-2.0.0.tgz_1463525966987_0.5456729622092098" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog" + ], + "_resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "_shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "_shrinkwrap": null, + "_spec": "set-blocking@~2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/set-blocking/issues" + }, + "dependencies": {}, + "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.9", + "mocha": "^2.4.5", + "nyc": "^6.4.4", + "standard": "^7.0.1", + "standard-version": "^2.2.1" + }, + "directories": {}, + "dist": { + "shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "tarball": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + }, + "files": [ + "index.js", + "LICENSE.txt" + ], + "gitHead": "7eec10577b5fff264de477ba3b9d07f404946eff", + "homepage": "https://github.com/yargs/set-blocking#readme", + "keywords": [ + "flush", + "terminal", + "blocking", + "shim", + "stdio", + "stderr" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + } + ], + "name": "set-blocking", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/yargs/set-blocking.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "test": "nyc mocha ./test/*.js", + "version": "standard-version" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/package.json new file mode 100644 index 00000000000000..a66e8ce1c4685e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "npmlog@~2.0.0 || ~3.1.0", + "scope": null, + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "~2.0.0 || ~3.1.0", + "spec": ">=2.0.0 <2.1.0||>=3.1.0 <3.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client" + ] + ], + "_from": "npmlog@>=2.0.0 <2.1.0||>=3.1.0 <3.2.0", + "_id": "npmlog@3.1.2", + "_inCache": true, + "_location": "/npm-registry-client/npmlog", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/npmlog-3.1.2.tgz_1466073052641_0.36111341998912394" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.6", + "_phantomChildren": { + "aproba": "1.0.4", + "has-unicode": "2.0.1", + "readable-stream": "2.1.4", + "strip-ansi": "3.0.1" + }, + "_requested": { + "raw": "npmlog@~2.0.0 || ~3.1.0", + "scope": null, + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "~2.0.0 || ~3.1.0", + "spec": ">=2.0.0 <2.1.0||>=3.1.0 <3.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client" + ], + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz", + "_shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "_shrinkwrap": null, + "_spec": "npmlog@~2.0.0 || ~3.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/npmlog/issues" + }, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.6.0", + "set-blocking": "~2.0.0" + }, + "description": "logger for npm", + "devDependencies": { + "standard": "~7.1.2", + "tap": "~5.7.0" + }, + "directories": {}, + "dist": { + "shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz" + }, + "files": [ + "log.js" + ], + "gitHead": "444e237743fa1339cb91bea2d3f16f710be56984", + "homepage": "https://github.com/npm/npmlog#readme", + "license": "ISC", + "main": "log.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "npmlog", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npmlog.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "3.1.2" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile index 98e7167bbe359f..eee21a99dfc9ec 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile @@ -19,3 +19,4 @@ release-patch: test npm publish .PHONY: test + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md index 09d9c8a81bf121..eee05f7bb61537 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md @@ -57,8 +57,10 @@ var operation = retry.operation({ ### retry.operation([options]) -Creates a new `RetryOperation` object. See the `retry.timeouts()` function -below for available `options`. +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. ### retry.timeouts([options]) @@ -76,7 +78,7 @@ milliseconds. If `options` is an array, a copy of that array is returned. The formula used to calculate the individual timeouts is: ``` -var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout); +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) ``` Have a look at [this article][article] for a better explanation of approach. @@ -118,19 +120,27 @@ an array of method names which need to be wrapped. ``` retry.wrap(obj) -retry.wrap(obj, ['method1', 'method2']); +retry.wrap(obj, ['method1', 'method2']) -retry.wrap(obj, {retries: 3}); +retry.wrap(obj, {retries: 3}) -retry.wrap(obj, {retries: 3}, ['method1', 'method2']); +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) ``` The `options` object can take any options that the usual call to `retry.operation` can take. -### new RetryOperation(timeouts) +### new RetryOperation(timeouts, [options]) Creates a new `RetryOperation` where `timeouts` is an array where each value is a timeout given in milliseconds. +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. + #### retryOperation.errors() Returns an array of all errors that have been passed to @@ -157,11 +167,11 @@ Whenever your retry operation takes longer than `timeout` to execute, the timeou #### retryOperation.try(fn) -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. #### retryOperation.start(fn) -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. #### retryOperation.retry(error) @@ -171,6 +181,10 @@ has been reached. Otherwise it returns `true`, and retries the operation after the timeout for the current attempt number. +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + #### retryOperation.attempts() Returns an int representing the number of attempts it took to call `fn` before it was successful. @@ -180,13 +194,19 @@ Returns an int representing the number of attempts it took to call `fn` before i retry is licensed under the MIT license. -#Changelog +# Changelog + +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + +0.8.0 Implementing retry.wrap. -0.7.0 Some bugfixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. -0.5.0 Some minor refactorings. +0.5.0 Some minor refactoring. 0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js index d6351e9d05bb33..446729b6f9af6b 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js @@ -28,4 +28,4 @@ faultTolerantResolve('nodejs.org', function(err, errors, addresses) { console.warn('addresses:'); console.log(addresses); -}); +}); \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js new file mode 100644 index 00000000000000..e1ceafeebafc51 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js index 94685652c426fd..77428cfd0006fa 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js @@ -1,10 +1,11 @@ var RetryOperation = require('./retry_operation'); exports.operation = function(options) { - var retryForever = false; - if (options && options.forever === true) retryForever = true; var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, retryForever); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); }; exports.timeouts = function(options) { @@ -32,6 +33,10 @@ exports.timeouts = function(options) { timeouts.push(this.createTimeout(i, opts)); } + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + // sort the array numerically ascending timeouts.sort(function(a,b) { return a - b; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js index 52b895544e6a58..2b3db8e1776973 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js @@ -1,5 +1,11 @@ -function RetryOperation(timeouts, retryForever) { +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + this._timeouts = timeouts; + this._options = options || {}; this._fn = null; this._errors = []; this._attempts = 1; @@ -7,12 +13,21 @@ function RetryOperation(timeouts, retryForever) { this._operationTimeoutCb = null; this._timeout = null; - if (!!retryForever) { + if (this._options.forever) { this._cachedTimeouts = this._timeouts.slice(0); } } module.exports = RetryOperation; +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + RetryOperation.prototype.retry = function(err) { if (this._timeout) { clearTimeout(this._timeout); @@ -37,18 +52,26 @@ RetryOperation.prototype.retry = function(err) { } var self = this; - setTimeout(function() { + var timer = setTimeout(function() { self._attempts++; if (self._operationTimeoutCb) { self._timeout = setTimeout(function() { self._operationTimeoutCb(self._attempts); }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } } self._fn(self._attempts); }, timeout); + if (this._options.unref) { + timer.unref(); + } + return true; }; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json index c274f9d6a7047c..0ba214a6fd0a14 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json @@ -1,41 +1,53 @@ { "_args": [ [ - "retry@^0.8.0", - "/Users/rebecca/code/npm/node_modules/npm-registry-client" + { + "raw": "retry@^0.10.0", + "scope": null, + "escapedName": "retry", + "name": "retry", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client" ] ], - "_from": "retry@>=0.8.0 <0.9.0", - "_id": "retry@0.8.0", + "_from": "retry@>=0.10.0 <0.11.0", + "_id": "retry@0.10.0", "_inCache": true, - "_installable": true, "_location": "/npm-registry-client/retry", - "_nodeVersion": "0.10.33", + "_nodeVersion": "4.2.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/retry-0.10.0.tgz_1471682099847_0.5031970851123333" + }, "_npmUser": { - "email": "tim@debuggable.com", - "name": "tim-kos" + "name": "tim-kos", + "email": "tim@debuggable.com" }, "_npmVersion": "2.1.7", "_phantomChildren": {}, "_requested": { - "name": "retry", - "raw": "retry@^0.8.0", - "rawSpec": "^0.8.0", + "raw": "retry@^0.10.0", "scope": null, - "spec": ">=0.8.0 <0.9.0", + "escapedName": "retry", + "name": "retry", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", "type": "range" }, "_requiredBy": [ "/npm-registry-client" ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz", - "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", + "_shasum": "649e15ca408422d98318161935e7f7d652d435dd", "_shrinkwrap": null, - "_spec": "retry@^0.8.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client", + "_spec": "retry@^0.10.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", "author": { - "email": "tim@debuggable.com", "name": "Tim Koschützki", + "email": "tim@debuggable.com", "url": "http://debuggable.com/" }, "bugs": { @@ -51,13 +63,13 @@ "lib": "./lib" }, "dist": { - "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", - "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz" + "shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "tarball": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz" }, "engines": { "node": "*" }, - "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd", + "gitHead": "0616e6a6ebc49b5a36b619c8f7c414ced8c3813b", "homepage": "https://github.com/tim-kos/node-retry", "license": "MIT", "main": "index", @@ -75,5 +87,5 @@ "url": "git://github.com/tim-kos/node-retry.git" }, "scripts": {}, - "version": "0.8.0" + "version": "0.10.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 00000000000000..b41307cb529f12 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js index cecfa3b7310013..916936424f073b 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js @@ -104,3 +104,73 @@ var retry = require(common.dir.lib + '/retry'); fn(); })(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index 20ff75226d8a8e..51ff6bebb24ddd 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -2,106 +2,106 @@ "_args": [ [ { - "name": "npm-registry-client", - "raw": "npm-registry-client@latest", - "rawSpec": "latest", + "raw": "npm-registry-client@7.2.1", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npm-registry-client", + "name": "npm-registry-client", + "rawSpec": "7.2.1", + "spec": "7.2.1", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "npm-registry-client@latest", - "_id": "npm-registry-client@7.1.2", + "_from": "npm-registry-client@7.2.1", + "_id": "npm-registry-client@7.2.1", "_inCache": true, - "_installable": true, "_location": "/npm-registry-client", - "_nodeVersion": "4.4.0", + "_nodeVersion": "6.3.1", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/npm-registry-client-7.1.2.tgz_1466040796551_0.645394338760525" + "tmp": "tmp/npm-registry-client-7.2.1.tgz_1472871043942_0.2117650501895696" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, - "_npmVersion": "3.9.2", + "_npmVersion": "3.10.7", "_phantomChildren": { - "inherits": "2.0.1" + "inherits": "2.0.3" }, "_requested": { - "name": "npm-registry-client", - "raw": "npm-registry-client@latest", - "rawSpec": "latest", + "raw": "npm-registry-client@7.2.1", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npm-registry-client", + "name": "npm-registry-client", + "rawSpec": "7.2.1", + "spec": "7.2.1", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.1.2.tgz", - "_shasum": "ddf243a2bd149d35172fe680aff40dfa20054bc3", + "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz", + "_shasum": "c792266b088cc313f8525e7e35248626c723db75", "_shrinkwrap": null, - "_spec": "npm-registry-client@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "npm-registry-client@7.2.1", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { "url": "https://github.com/npm/npm-registry-client/issues" }, "dependencies": { - "chownr": "^1.0.1", - "concat-stream": "^1.4.6", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", + "concat-stream": "^1.5.2", + "graceful-fs": "^4.1.6", "normalize-package-data": "~1.0.1 || ^2.0.0", "npm-package-arg": "^3.0.0 || ^4.0.0", "npmlog": "~2.0.0 || ~3.1.0", - "once": "^1.3.0", - "request": "^2.47.0", - "retry": "^0.8.0", - "rimraf": "2", + "once": "^1.3.3", + "request": "^2.74.0", + "retry": "^0.10.0", "semver": "2 >=2.2.1 || 3.x || 4 || 5", "slide": "^1.1.3" }, "description": "Client for the npm registry", "devDependencies": { - "negotiator": "^0.4.9", - "nock": "^0.56.0", - "readable-stream": "^2.0.2", - "standard": "^4.0.0", - "tap": "^1.2.0" + "negotiator": "^0.6.1", + "nock": "^8.0.0", + "readable-stream": "^2.1.5", + "rimraf": "^2.5.4", + "standard": "^8.0.0", + "tap": "^7.0.0" }, "directories": {}, "dist": { - "shasum": "ddf243a2bd149d35172fe680aff40dfa20054bc3", - "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.1.2.tgz" + "shasum": "c792266b088cc313f8525e7e35248626c723db75", + "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz" }, - "gitHead": "0b595c4769f314a12661d537a328cf4e5658a00f", + "gitHead": "debec76884db8092c2c7a21ab5b4ed083f8ce2c9", "homepage": "https://github.com/npm/npm-registry-client#readme", "license": "ISC", "main": "index.js", "maintainers": [ { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "npm-registry-client", @@ -115,5 +115,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "7.1.2" + "version": "7.2.1" } diff --git a/deps/npm/node_modules/npm-registry-client/test/00-setup.js b/deps/npm/node_modules/npm-registry-client/test/00-setup.js index 747768fb85f8c4..fb9585a4285d8f 100644 --- a/deps/npm/node_modules/npm-registry-client/test/00-setup.js +++ b/deps/npm/node_modules/npm-registry-client/test/00-setup.js @@ -1,8 +1,9 @@ -var tap = require('tap') +var join = require('path').join var rimraf = require('rimraf') +var tap = require('tap') tap.test('setup', function (t) { - rimraf(__dirname + '/fixtures/cache', function (er) { + rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { if (er) throw er t.pass('cache cleaned') t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/config-defaults.js b/deps/npm/node_modules/npm-registry-client/test/config-defaults.js index a432da85811955..ca6983a1ba5a4a 100644 --- a/deps/npm/node_modules/npm-registry-client/test/config-defaults.js +++ b/deps/npm/node_modules/npm-registry-client/test/config-defaults.js @@ -33,7 +33,7 @@ test('config defaults', function (t) { }) test('missing HTTPS proxy defaults to HTTP proxy', function (t) { - var client = common.freshClient({ proxy: { http: 'http://proxy.npm:8088/' }}) + var client = common.freshClient({ proxy: { http: 'http://proxy.npm:8088/' } }) t.equal(client.config.proxy.http, 'http://proxy.npm:8088/', 'HTTP proxy set') t.equal(client.config.proxy.http, client.config.proxy.https, 'HTTP === HTTPS') diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js b/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js new file mode 100644 index 00000000000000..72aeea0beb7d55 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js @@ -0,0 +1,58 @@ +var test = require('tap').test +var concat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var testData = JSON.stringify({test: true}) +var errorData = JSON.stringify({error: 'it went bad'}) + +test('streaming fetch', function (t) { + server.expect('/test', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(200, { + 'content-type': 'application/json' + }) + + res.end(testData) + }) + + server.expect('/error', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(401, { + 'content-type': 'application/json' + }) + + res.end(errorData) + }) + + client.fetch( + 'http://localhost:1337/test', + { streaming: true }, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = concat(function (data) { + t.deepEqual(data.toString(), testData) + client.fetch( + 'http://localhost:1337/error', + { streaming: true }, + function (er, res) { + t.ok(er, 'got an error') + server.close() + t.end() + } + ) + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/initialize.js b/deps/npm/node_modules/npm-registry-client/test/initialize.js index 3856b67b45e0f8..4a97bd5fdf94c0 100644 --- a/deps/npm/node_modules/npm-registry-client/test/initialize.js +++ b/deps/npm/node_modules/npm-registry-client/test/initialize.js @@ -83,7 +83,7 @@ test('referer set on client', function (t) { }) test('initializing with proxy explicitly disabled', function (t) { - var client = new Client({ proxy: { http: false }}) + var client = new Client({ proxy: { http: false } }) var options = client.initialize( 'http://localhost:1337/', 'GET', @@ -96,7 +96,7 @@ test('initializing with proxy explicitly disabled', function (t) { }) test('initializing with proxy undefined', function (t) { - var client = new Client({ proxy: { http: undefined }}) + var client = new Client({ proxy: { http: undefined } }) var options = client.initialize( 'http://localhost:1337/', 'GET', diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js index 78e543f699a168..ea48d3014988ec 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/common.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/common.js @@ -10,6 +10,14 @@ if (!global.setImmediate || !require('timers').setImmediate) { } } +// See https://github.com/npm/npm-registry-client/pull/142 for background. +// Note: `process.on('warning')` only works with Node >= 6. +process.on('warning', function (warning) { + if (/Possible EventEmitter memory leak detected/.test(warning.message)) { + throw new Error('There should not be any EventEmitter memory leaks') + } +}) + module.exports = { port: server.port, registry: REGISTRY, diff --git a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js b/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js index 35253c7acd7226..16e4ee8a1d449c 100644 --- a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js +++ b/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js @@ -1,8 +1,9 @@ -var tap = require('tap') +var join = require('path').join var rimraf = require('rimraf') +var tap = require('tap') tap.test('teardown', function (t) { - rimraf(__dirname + '/fixtures/cache', function (er) { + rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { if (er) throw er t.pass('cache cleaned') t.end() diff --git a/deps/npm/node_modules/npm-user-validate/npm-user-validate.js b/deps/npm/node_modules/npm-user-validate/npm-user-validate.js index c9da9cd1c90f0e..3a645ec9329acd 100644 --- a/deps/npm/node_modules/npm-user-validate/npm-user-validate.js +++ b/deps/npm/node_modules/npm-user-validate/npm-user-validate.js @@ -4,7 +4,7 @@ exports.username = username var requirements = exports.requirements = { username: { - length: 'Name length must be less than or equal to 576 characters long', + length: 'Name length must be less than or equal to 214 characters long', lowerCase: 'Name must be lowercase', urlSafe: 'Name may not contain non-url-safe chars', dot: 'Name may not start with "."' @@ -28,7 +28,7 @@ function username (un) { return new Error(requirements.username.dot) } - if (un.length > 576) { + if (un.length > 214) { return new Error(requirements.username.length) } diff --git a/deps/npm/node_modules/npm-user-validate/package.json b/deps/npm/node_modules/npm-user-validate/package.json index 84204f8a4b1dd0..e6707430b7a97d 100644 --- a/deps/npm/node_modules/npm-user-validate/package.json +++ b/deps/npm/node_modules/npm-user-validate/package.json @@ -2,50 +2,50 @@ "_args": [ [ { - "raw": "npm-user-validate@latest", + "raw": "npm-user-validate@0.1.5", "scope": null, "escapedName": "npm-user-validate", "name": "npm-user-validate", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "0.1.5", + "spec": "0.1.5", + "type": "version" }, "/Users/rebecca/code/npm" ] ], - "_from": "npm-user-validate@latest", - "_id": "npm-user-validate@0.1.4", + "_from": "npm-user-validate@0.1.5", + "_id": "npm-user-validate@0.1.5", "_inCache": true, "_installable": true, "_location": "/npm-user-validate", "_nodeVersion": "5.11.0", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/npm-user-validate-0.1.4.tgz_1466105686124_0.06683815410360694" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/npm-user-validate-0.1.5.tgz_1466436459441_0.15483755711466074" }, "_npmUser": { "name": "aredridel", "email": "aria@npmjs.com" }, - "_npmVersion": "3.9.6", + "_npmVersion": "3.10.1", "_phantomChildren": {}, "_requested": { - "raw": "npm-user-validate@latest", + "raw": "npm-user-validate@0.1.5", "scope": null, "escapedName": "npm-user-validate", "name": "npm-user-validate", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "0.1.5", + "spec": "0.1.5", + "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.4.tgz", - "_shasum": "18fcbe53cf921eb8e6339314665b187955b1a837", + "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz", + "_shasum": "52465d50c2d20294a57125b996baedbf56c5004b", "_shrinkwrap": null, - "_spec": "npm-user-validate@latest", + "_spec": "npm-user-validate@0.1.5", "_where": "/Users/rebecca/code/npm", "author": { "name": "Robert Kowalski", @@ -61,10 +61,10 @@ }, "directories": {}, "dist": { - "shasum": "18fcbe53cf921eb8e6339314665b187955b1a837", - "tarball": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.4.tgz" + "shasum": "52465d50c2d20294a57125b996baedbf56c5004b", + "tarball": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz" }, - "gitHead": "ab804940b6846f8cc63f87692cea85b1906c967a", + "gitHead": "688552a47e6c22cd07206894dcd21b9d7a37ee56", "homepage": "https://github.com/npm/npm-user-validate#readme", "keywords": [ "npm", @@ -97,5 +97,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "0.1.4" + "version": "0.1.5" } diff --git a/deps/npm/node_modules/npm-user-validate/test/username.test.js b/deps/npm/node_modules/npm-user-validate/test/username.test.js index 83528eec82a76d..aa0e6b33def686 100644 --- a/deps/npm/node_modules/npm-user-validate/test/username.test.js +++ b/deps/npm/node_modules/npm-user-validate/test/username.test.js @@ -22,15 +22,15 @@ test('username may not start with "."', function (t) { t.end() }) -test('username may not be longer than 576 characters', function (t) { - var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-venison-capicola--brisket-leberkas-pork-beef-ribs-kevin-short-ribs-tail-bresaola-ham--rump-fatback-short-ribs-frankfurter-boudin--turkey-cupim-tri-tip-pork-chop-landjaeger-frankfurter-ham-hock---kielbasa-sausage-sirloin-short-loin-bacon-tenderloin-biltong-spare-ribs-cow-beef-ribs-tongue-cupim-filet-mignon-drumstick--pork-chop-tenderloin-brisket-pork-belly-leberkas-and-a-pickle') +test('username may not be longer than 214 characters', function (t) { + var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-and-pickle') t.type(err, 'object') - t.match(err.message, /less than or equal to 576/) + t.match(err.message, /less than or equal to 214/) t.end() }); -test('username may be as long as 576 characters', function (t) { - var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-venison-capicola--brisket-leberkas-pork-beef-ribs-kevin-short-ribs-tail-bresaola-ham--rump-fatback-short-ribs-frankfurter-boudin--turkey-cupim-tri-tip-pork-chop-landjaeger-frankfurter-ham-hock---kielbasa-sausage-sirloin-short-loin-bacon-tenderloin-biltong-spare-ribs-cow-beef-ribs-tongue-cupim-filet-mignon-drumstick--pork-chop-tenderloin-brisket-pork-belly-leberkas-beef') +test('username may be as long as 214 characters', function (t) { + var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-porchetta') t.type(err, 'null') t.end() }); diff --git a/deps/npm/node_modules/npmlog/log.js b/deps/npm/node_modules/npmlog/log.js index e5b70f1f80b743..bf894fb7a63423 100644 --- a/deps/npm/node_modules/npmlog/log.js +++ b/deps/npm/node_modules/npmlog/log.js @@ -219,7 +219,9 @@ log.emitLog = function (m) { if (l < this.levels[this.level]) return if (l > 0 && !isFinite(l)) return - var disp = log.disp[m.level] || m.level + // If 'disp' is null or undefined, use the lvl as a default + // Allows: '', 0 as valid disp + var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level this.clearProgress() m.message.split(/\r?\n/).forEach(function (line) { if (this.heading) { @@ -264,7 +266,8 @@ log.write = function (msg, style) { } log.addLevel = function (lvl, n, style, disp) { - if (!disp) disp = lvl + // If 'disp' is null or undefined, use the lvl as a default + if (disp == null) disp = lvl this.levels[lvl] = n this.style[lvl] = style if (!this[lvl]) { diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md index f8789800aa784c..c41d39229244d2 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -25,7 +25,7 @@ single.completeWork(20) console.log(top.completed()) // 0.2 fs.stat("file", function(er, stat) { - if (er) throw er + if (er) throw er var stream = top.newStream("file", stat.size) console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete // and 50% * 20% == 10% diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js index aa2f839b6dd2ce..b9bec62440a468 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js @@ -16,6 +16,11 @@ module.exports = function (str) { for (var i = 0; i < str.length; i++) { var code = codePointAt(str, i); + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + // surrogates if (code >= 0x10000) { i++; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json index 662efc0b1e6e8b..ee7bc6c9f340de 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json @@ -1,27 +1,39 @@ { "_args": [ [ - "string-width@^1.0.1", - "/Users/rebecca/code/npm-with-new-gauge/node_modules/npmlog/node_modules/gauge" + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" ] ], "_from": "string-width@>=1.0.1 <2.0.0", - "_id": "string-width@1.0.1", + "_id": "string-width@1.0.2", "_inCache": true, - "_installable": true, "_location": "/npmlog/gauge/string-width", - "_nodeVersion": "0.12.5", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994" + }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.11.2", + "_npmVersion": "2.15.5", "_phantomChildren": {}, "_requested": { - "name": "string-width", "raw": "string-width@^1.0.1", - "rawSpec": "^1.0.1", "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", "spec": ">=1.0.1 <2.0.0", "type": "range" }, @@ -29,14 +41,14 @@ "/npmlog/gauge", "/npmlog/gauge/wide-align" ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", - "_shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", "_shrinkwrap": null, "_spec": "string-width@^1.0.1", - "_where": "/Users/rebecca/code/npm-with-new-gauge/node_modules/npmlog/node_modules/gauge", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge", "author": { - "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { @@ -49,12 +61,13 @@ }, "description": "Get the visual width of a string - the number of columns required to display it", "devDependencies": { - "ava": "0.0.4" + "ava": "*", + "xo": "*" }, "directories": {}, "dist": { - "shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", - "tarball": "http://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz" + "shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" }, "engines": { "node": ">=0.10.0" @@ -62,8 +75,8 @@ "files": [ "index.js" ], - "gitHead": "f279cfd14835f0a3c8df69ba18e9a3960156e135", - "homepage": "https://github.com/sindresorhus/string-width", + "gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b", + "homepage": "https://github.com/sindresorhus/string-width#readme", "keywords": [ "string", "str", @@ -93,8 +106,8 @@ "license": "MIT", "maintainers": [ { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" } ], "name": "string-width", @@ -105,7 +118,7 @@ "url": "git+https://github.com/sindresorhus/string-width.git" }, "scripts": { - "test": "node test.js" + "test": "xo && ava" }, - "version": "1.0.1" + "version": "1.0.2" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md index a7737a986c5736..1ab42c93580ecb 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/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. +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. Useful to be able to measure the actual width of command-line output. @@ -17,7 +17,7 @@ $ npm install --save string-width ## Usage ```js -var stringWidth = require('string-width'); +const stringWidth = require('string-width'); stringWidth('古'); //=> 2 @@ -34,8 +34,9 @@ stringWidth('a'); - [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](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/npmlog/package.json b/deps/npm/node_modules/npmlog/package.json index 85211951f6951b..3f314d7916cf57 100644 --- a/deps/npm/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/npmlog/package.json @@ -2,57 +2,58 @@ "_args": [ [ { - "name": "npmlog", - "raw": "npmlog@latest", - "rawSpec": "latest", + "raw": "npmlog@4.0.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "4.0.0", + "spec": "4.0.0", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "npmlog@latest", - "_id": "npmlog@3.1.2", + "_from": "npmlog@4.0.0", + "_id": "npmlog@4.0.0", "_inCache": true, - "_installable": true, "_location": "/npmlog", - "_nodeVersion": "4.4.0", + "_nodeVersion": "5.10.1", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/npmlog-3.1.2.tgz_1466073052641_0.36111341998912394" + "tmp": "tmp/npmlog-4.0.0.tgz_1468888150556_0.3835553650278598" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.9.6", + "_npmVersion": "3.10.4", "_phantomChildren": { - "aproba": "1.0.3", - "has-unicode": "2.0.0", - "readable-stream": "2.1.3", + "aproba": "1.0.4", + "has-unicode": "2.0.1", + "readable-stream": "2.1.4", "strip-ansi": "3.0.1" }, "_requested": { - "name": "npmlog", - "raw": "npmlog@latest", - "rawSpec": "latest", + "raw": "npmlog@4.0.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "4.0.0", + "spec": "4.0.0", + "type": "version" }, "_requiredBy": [ - "/", - "/npm-registry-client" + "#USER", + "/" ], - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz", - "_shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.0.tgz", + "_shasum": "e094503961c70c1774eb76692080e8d578a9f88f", "_shrinkwrap": null, - "_spec": "npmlog@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "npmlog@4.0.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -71,32 +72,32 @@ }, "directories": {}, "dist": { - "shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", - "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz" + "shasum": "e094503961c70c1774eb76692080e8d578a9f88f", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.0.tgz" }, "files": [ "log.js" ], - "gitHead": "444e237743fa1339cb91bea2d3f16f710be56984", + "gitHead": "3ca8823fdfa66f54c72adde3fd2c4e0237e6302b", "homepage": "https://github.com/npm/npmlog#readme", "license": "ISC", "main": "log.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "npmlog", @@ -109,5 +110,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "3.1.2" + "version": "4.0.0" } diff --git a/deps/npm/node_modules/once/README.md b/deps/npm/node_modules/once/README.md index a2981ea0705196..1f1ffca9330e3c 100644 --- a/deps/npm/node_modules/once/README.md +++ b/deps/npm/node_modules/once/README.md @@ -49,3 +49,31 @@ function load (cb) { }) } ``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/deps/npm/node_modules/once/once.js b/deps/npm/node_modules/once/once.js index 2e1e721bfecec3..235406736d9d94 100644 --- a/deps/npm/node_modules/once/once.js +++ b/deps/npm/node_modules/once/once.js @@ -1,5 +1,6 @@ var wrappy = require('wrappy') module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { @@ -8,6 +9,13 @@ once.proto = once(function () { }, configurable: true }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) }) function once (fn) { @@ -19,3 +27,16 @@ function once (fn) { f.called = false return f } + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/deps/npm/node_modules/once/package.json b/deps/npm/node_modules/once/package.json index f5fd8173cb19c3..1be563b51bf3ca 100644 --- a/deps/npm/node_modules/once/package.json +++ b/deps/npm/node_modules/once/package.json @@ -1,50 +1,64 @@ { "_args": [ [ - "once@~1.3.3", - "/Users/ogd/Documents/projects/npm/npm" + { + "raw": "once@1.4.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "1.4.0", + "spec": "1.4.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "once@>=1.3.3 <1.4.0", - "_id": "once@1.3.3", + "_from": "once@1.4.0", + "_id": "once@1.4.0", "_inCache": true, - "_installable": true, "_location": "/once", - "_nodeVersion": "4.0.0", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661" + }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "name": "once", - "raw": "once@~1.3.3", - "rawSpec": "~1.3.3", + "raw": "once@1.4.0", "scope": null, - "spec": ">=1.3.3 <1.4.0", - "type": "range" + "escapedName": "once", + "name": "once", + "rawSpec": "1.4.0", + "spec": "1.4.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/glob", "/inflight", - "/node-gyp/glob", + "/init-package-json/glob", "/npm-registry-client", + "/read-package-json/glob", "/read-package-tree", "/readdir-scoped-modules", - "/standard/standard-engine/eslint/file-entry-cache/flat-cache/del/globby/glob", - "/standard/standard-engine/eslint/inquirer/run-async", - "/tap/nyc/istanbul" + "/standard/eslint/file-entry-cache/flat-cache/del/globby/glob", + "/standard/eslint/glob", + "/standard/eslint/inquirer/run-async" ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", "_shrinkwrap": null, - "_spec": "once@~1.3.3", - "_where": "/Users/ogd/Documents/projects/npm/npm", + "_spec": "once@1.4.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -55,23 +69,23 @@ }, "description": "Run a function exactly one time", "devDependencies": { - "tap": "^1.2.0" + "tap": "^7.0.1" }, "directories": { "test": "test" }, "dist": { - "shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", - "tarball": "http://registry.npmjs.org/once/-/once-1.3.3.tgz" + "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" }, "files": [ "once.js" ], - "gitHead": "2ad558657e17fafd24803217ba854762842e4178", + "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6", "homepage": "https://github.com/isaacs/once#readme", "keywords": [ - "function", "once", + "function", "one", "single" ], @@ -93,5 +107,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "1.3.3" + "version": "1.4.0" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore index fd4f2b066b339e..ae5d8c36ac6522 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -1,2 +1,5 @@ -node_modules -.DS_Store +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile deleted file mode 100644 index dd2730cfde0cab..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @node_modules/.bin/tape test/*.js - -.PHONY: test diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index 421f3aa5f951a2..08e918c0db9a62 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -1,6 +1,6 @@ # balanced-match -Match balanced string pairs, like `{` and `}` or `` and ``. +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! [![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) [![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) @@ -16,6 +16,7 @@ var balanced = require('balanced-match'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); ``` The matches are: @@ -28,6 +29,7 @@ $ node example.js pre: 'pre', body: 'first', post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } ``` ## API @@ -45,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -54,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js deleted file mode 100644 index 9ce76f480a4321..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ /dev/null @@ -1,4 +0,0 @@ -var balanced = require('./'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 75f3d71cba90bc..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -1,5 +1,8 @@ module.exports = balanced; function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + var r = range(a, b, str); return r && { @@ -11,6 +14,11 @@ function balanced(a, b, str) { }; } +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; @@ -22,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 24523f3bb16b79..743afb08f4aced 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -1,43 +1,54 @@ { "_args": [ [ - "balanced-match@^0.3.0", - "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ], - [ - "balanced-match@^0.3.0", + { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" ] ], - "_from": "balanced-match@>=0.3.0 <0.4.0", - "_id": "balanced-match@0.3.0", + "_from": "balanced-match@>=0.4.1 <0.5.0", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, - "_location": "/read-package-json/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "4.2.1", + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" + }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "balanced-match", - "raw": "balanced-match@^0.3.0", - "rawSpec": "^0.3.0", + "raw": "balanced-match@^0.4.1", "scope": null, - "spec": ">=0.3.0 <0.4.0", + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ - "/read-package-json/glob/minimatch/brace-expansion" + "/minimatch/brace-expansion" ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, - "_spec": "balanced-match@^0.3.0", + "_spec": "balanced-match@^0.4.1", "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -46,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.2.2" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -66,8 +77,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "balanced-match", @@ -81,6 +92,7 @@ "test": "make test" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -93,8 +105,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "0.3.0" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index f5e98e3f2a3240..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,84 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 9, - pre: 'pre', - body: '{in}', - post: 'post' - }); - t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'in', - post: '}post' - }); - t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { - start: 4, - end: 10, - pre: 'pre{', - body: 'first', - post: 'in{second}post' - }); - t.deepEqual(balanced('', 'prepost'), { - start: 3, - end: 4, - pre: 'pre', - body: '', - post: 'post' - }); - t.end(); -}); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 94b5f9c010285d..e1ab2e2c7095db 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,78 +1,85 @@ { "_args": [ [ - "brace-expansion@^1.0.0", - "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch" - ], - [ - "brace-expansion@^1.0.0", + { + "raw": "brace-expansion@^1.0.0", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch" ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.3", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, - "_location": "/read-package-json/glob/minimatch/brace-expansion", - "_nodeVersion": "5.5.0", + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/read-package-json/glob/minimatch" + "/minimatch" ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, "dependencies": { - "balanced-match": "^0.3.0", + "balanced-match": "^0.4.1", "concat-map": "0.0.1" }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.4.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" } ], "name": "brace-expansion", @@ -87,6 +94,7 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -99,8 +107,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "1.1.3" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json index c2f6fff778e6df..46bf2540ca4cc1 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json @@ -1,43 +1,55 @@ { "_args": [ [ - "minimatch@2 || 3", - "/Users/rebecca/code/npm/node_modules/glob" - ], - [ - "minimatch@2 || 3", + { + "raw": "minimatch@2 || 3", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", + "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob" ] ], "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "minimatch@3.0.0", + "_id": "minimatch@3.0.3", "_inCache": true, "_installable": true, - "_location": "/read-package-json/glob/minimatch", - "_nodeVersion": "4.0.0", + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "minimatch", "raw": "minimatch@2 || 3", - "rawSpec": "2 || 3", "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, "_requiredBy": [ - "/read-package-json/glob" + "#USER", + "/" ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", "_shrinkwrap": null, "_spec": "minimatch@2 || 3", "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me" }, "bugs": { @@ -49,12 +61,12 @@ "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" }, "directories": {}, "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, "engines": { "node": "*" @@ -62,14 +74,14 @@ "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", "license": "ISC", "main": "minimatch.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "minimatch", @@ -83,5 +95,5 @@ "posttest": "standard minimatch.js test/*.js", "test": "tap test/*.js" }, - "version": "3.0.0" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE index c3d2eb3550079b..e637724b3bc595 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE index 5c93f456546877..5a8e332545f667 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE @@ -11,3 +11,4 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md index 3d61083fb04dd0..85d52a2dcea030 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md @@ -240,3 +240,4 @@ JSON.stringify will split this into 15 lines, and it's hard to read. Yet again, this feature comes with a performance hit, so if user experience matters to you more than performance, use this module. If your JSON will be consumed by machines, use JSON.stringify instead. As a rule of thumb, if you use "space" argument to indent your JSON, you'd better use this module instead. + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js index 39303b0969081c..9b0f9af01cd9e8 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js @@ -89,3 +89,4 @@ module.exports.analyze = function analyzeJSON(input, options) { return result } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js index af1a01a03d062b..cfab8691fc9aba 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js @@ -482,3 +482,4 @@ module.exports.Document = Document module.exports.update = function updateJSON(source, new_value, options) { return Document(source, options).update(new_value).toString() } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js index 025007f63b7060..0c9fbe68809cd0 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js @@ -762,3 +762,4 @@ module.exports.tokenize = function tokenizeJSON(input, options) { tokens.data = module.exports.parse(input, options) return tokens } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js index e76af2efe8e06a..232229ecc8af20 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js @@ -380,3 +380,4 @@ module.exports.stringify = function stringifyJSON(object, options, _space) { return _stringify(object, options, 0, '') } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js index dd4752c73a4078..a8476b6c4630e1 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js @@ -43,3 +43,4 @@ module.exports.middleware = function() { throw Error('this function is removed, use express-json5 instead') } } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml index 828163ddc4524c..fdbb5372d4bcde 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml @@ -43,3 +43,4 @@ publishConfig: license: type: WTFPL url: http://www.wtfpl.net/txt/copying/ + diff --git a/deps/npm/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/readable-stream/.travis.yml index ae0156a9bbb156..84504c98f55d05 100644 --- a/deps/npm/node_modules/readable-stream/.travis.yml +++ b/deps/npm/node_modules/readable-stream/.travis.yml @@ -7,9 +7,6 @@ notifications: email: false matrix: fast_finish: true - allow_failures: - - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" include: - node_js: '0.8' env: TASK=test @@ -29,6 +26,8 @@ matrix: env: TASK=test - node_js: 5 env: TASK=test + - node_js: 6 + env: TASK=test - node_js: 5 env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" - node_js: 5 @@ -39,10 +38,6 @@ matrix: env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" - node_js: 5 env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - node_js: 5 env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" - node_js: 5 diff --git a/deps/npm/node_modules/readable-stream/README.md b/deps/npm/node_modules/readable-stream/README.md index ae9e3363c8e8a3..9fb4feaaa12419 100644 --- a/deps/npm/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/readable-stream/README.md @@ -1,6 +1,6 @@ # readable-stream -***Node-core v6.1.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) +***Node-core v6.3.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) [![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) @@ -21,7 +21,7 @@ Node-core, including [documentation](doc/stream.md). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -As of version 2.0.0 **readable-stream** uses semantic versioning. +As of version 2.0.0 **readable-stream** uses semantic versioning. # Streams WG Team Members diff --git a/deps/npm/node_modules/readable-stream/doc/stream.md b/deps/npm/node_modules/readable-stream/doc/stream.md index c907ca0e7b726a..fc269c8e38f829 100644 --- a/deps/npm/node_modules/readable-stream/doc/stream.md +++ b/deps/npm/node_modules/readable-stream/doc/stream.md @@ -2,61 +2,123 @@ Stability: 2 - Stable -A stream is an abstract interface implemented by various objects in -Node.js. For example a [request to an HTTP server][http-incoming-message] is a -stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All -streams are instances of [`EventEmitter`][]. +A stream is an abstract interface for working with streaming data in Node.js. +The `stream` module provides a base API that makes it easy to build objects +that implement the stream interface. -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. +There are many stream objects provided by Node.js. For instance, a +[request to an HTTP server][http-incoming-message] and [`process.stdout`][] +are both stream instances. -This document is split up into 3 sections: +Streams can be readable, writable, or both. All streams are instances of +[`EventEmitter`][]. -1. The first section explains the parts of the API that you need to be - aware of to use streams in your programs. -2. The second section explains the parts of the API that you need to - use if you implement your own custom streams yourself. The API is designed to - make this easy for you to do. -3. The third section goes into more depth about how streams work, - including some of the internal mechanisms and functions that you - should probably not modify unless you definitely know what you are - doing. +The `stream` module can be accessed using: +```js +const stream = require('stream'); +``` -## API for Stream Consumers +While it is important for all Node.js users to understand how streams works, +the `stream` module itself is most useful for developer's that are creating new +types of stream instances. Developer's who are primarily *consuming* stream +objects will rarely (if ever) have need to use the `stream` module directly. + +## Organization of this document + +This document is divided into two primary sections and third section for +additional notes. The first section explains the elements of the stream API that +are required to *use* streams within an application. The second section explains +the elements of the API that are required to *implement* new types of streams. + +## Types of Streams + +There are four fundamental stream types within Node.js: + +* [Readable][] - streams from which data can be read (for example + [`fs.createReadStream()`][]). +* [Writable][] - streams to which data can be written (for example + [`fs.createWriteStream()`][]). +* [Duplex][] - streams that are both Readable and Writable (for example + [`net.Socket`][]). +* [Transform][] - Duplex streams that can modify or transform the data as it + is written and read (for example [`zlib.createDeflate()`][]). + +### Object Mode + +All streams created by Node.js APIs operate exclusively on strings and `Buffer` +objects. It is possible, however, for stream implementations to work with other +types of JavaScript values (with the exception of `null` which serves a special +purpose within streams). Such streams are considered to operate in "object +mode". + +Stream instances are switched into object mode using the `objectMode` option +when the stream is created. Attempting to switch an existing stream into +object mode is not safe. + +### Buffering -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). +Both [Writable][] and [Readable][] streams will store data in an internal +buffer that can be retrieved using `writable._writableState.getBuffer()` or +`readable._readableState.buffer`, respectively. + +The amount of data potentially buffered depends on the `highWaterMark` option +passed into the streams constructor. For normal streams, the `highWaterMark` +option specifies a total number of bytes. For streams operating in object mode, +the `highWaterMark` specifies a total number of objects. + +Data is buffered in Readable streams when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], the data will sit in the internal +queue until it is consumed. -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. +Once the total size of the internal read buffer reaches the threshold specified +by `highWaterMark`, the stream will temporarily stop reading data from the +underlying resource until the data currently buffered can be consumed (that is, +the stream will stop calling the internal `readable._read()` method that is +used to fill the read buffer). + +Data is buffered in Writable streams when the +[`writable.write(chunk)`][stream-write] method is called repeatedly. While the +total size of the internal write buffer is below the threshold set by +`highWaterMark`, calls to `writable.write()` will return `true`. Once the +the size of the internal buffer reaches or exceeds the `highWaterMark`, `false` +will be returned. + +A key goal of the `stream` API, and in particular the [`stream.pipe()`] method, +is to limit the buffering of data to acceptable levels such that sources and +destinations of differing speeds will not overwhelm the available memory. + +Because [Duplex][] and [Transform][] streams are both Readable and Writable, +each maintain *two* separate internal buffers used for reading and writing, +allowing each side to operate independently of the other while maintaining an +appropriate and efficient flow of data. For example, [`net.Socket`][] instances +are [Duplex][] streams whose Readable side allows consumption of data received +*from* the socket and whose Writable side allows writing data *to* the socket. +Because data may be written to the socket at a faster or slower rate than data +is received, it is important each side operate (and buffer) independently of +the other. -If a stream is both Readable and Writable, then it implements all of -the methods and events. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. +## API for Stream Consumers -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][]. + -Almost all Node.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an Node.js program: +Almost all Node.js applications, no matter how simple, use streams in some +manner. The following is an example of using streams in a Node.js application +that implements an HTTP server: ```js const http = require('http'); -var server = http.createServer( (req, res) => { +const server = http.createServer( (req, res) => { // req is an http.IncomingMessage, which is a Readable Stream // res is an http.ServerResponse, which is a Writable Stream - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects + let body = ''; + // Get the data as utf8 strings. + // If an encoding is not set, Buffer objects will be received. req.setEncoding('utf8'); // Readable streams emit 'data' events once a listener is added @@ -64,10 +126,10 @@ var server = http.createServer( (req, res) => { body += chunk; }); - // the end event tells you that you have entire body + // the end event indicates that the entire body has been received req.on('end', () => { try { - var data = JSON.parse(body); + const data = JSON.parse(body); } catch (er) { // uh oh! bad json! res.statusCode = 400; @@ -90,60 +152,308 @@ server.listen(1337); // error: Unexpected token o ``` -### Class: stream.Duplex +[Writable][] streams (such as `res` in the example) expose methods such as +`write()` and `end()` that are used to write data onto the stream. -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. +[Readable][] streams use the [`EventEmitter`][] API for notifying application +code when data is available to be read off the stream. That available data can +be read from the stream in multiple ways. -Examples of Duplex streams include: +Both [Writable][] and [Readable][] streams use the [`EventEmitter`][] API in +various ways to communicate the current state of the stream. -* [TCP sockets][] +[Duplex][] and [Transform][] streams are both [Writable][] and [Readable][]. + +Applications that are either writing data to or consuming data from a stream +are not required to implement the stream interfaces directly and will generally +have no reason to call `require('stream')`. + +Developers wishing to implement new types of streams should refer to the +section [API for Stream Implementers][]. + +### Writable Streams + +Writable streams are an abstraction for a *destination* to which data is +written. + +Examples of [Writable][] streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] * [zlib streams][zlib] * [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +*Note*: Some of these examples are actually [Duplex][] streams that implement +the [Writable][] interface. + +All [Writable][] streams implement the interface defined by the +`stream.Writable` class. + +While specific instances of [Writable][] streams may differ in various ways, +all Writable streams follow the same fundamental usage pattern as illustrated +in the example below: + +```js +const myStream = getWritableStreamSomehow(); +myStream.write('some data'); +myStream.write('some more data'); +myStream.end('done writing data'); +``` -### Class: stream.Readable +#### Class: stream.Writable + -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. +##### Event: 'close' + -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. +The `'close'` event is emitted when the stream and any of its underlying +resources (a file descriptor, for example) have been closed. The event indicates +that no more events will be emitted, and no further computation will occur. -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call [`stream.read()`][stream-read] to get chunks of data out. -Streams start out in paused mode. +Not all Writable streams will emit the `'close'` event. -**Note**: If no data event handlers are attached, and there are no -[`stream.pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. +##### Event: 'drain' + -You can switch to flowing mode by doing any of the following: +If a call to [`stream.write(chunk)`][stream-write] returns `false`, the +`'drain'` event will be emitted when it is appropriate to resume writing data +to the stream. -* Adding a [`'data'`][] event handler to listen for data. -* Calling the [`stream.resume()`][stream-resume] method to explicitly open the - flow. -* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + let i = 1000000; + write(); + function write() { + var ok = true; + do { + i--; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` -You can switch back to paused mode by doing either of the following: +##### Event: 'error' + -* If there are no pipe destinations, by calling the - [`stream.pause()`][stream-pause] method. -* If there are pipe destinations, by removing any [`'data'`][] event - handlers, and removing all pipe destinations by calling the - [`stream.unpipe()`][] method. +* {Error} + +The `'error'` event is emitted if an error occurred while writing or piping +data. The listener callback is passed a single `Error` argument when called. + +*Note*: The stream is not closed when the `'error'` event is emitted. + +##### Event: 'finish' + + +The `'finish'` event is emitted after the [`stream.end()`][stream-end] method +has been called, and all data has been flushed to the underlying system. + +```js +const writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('This is the end\n'); +writer.on('finish', () => { + console.error('All writes are now complete.'); +}); +``` + +##### Event: 'pipe' + + +* `src` {stream.Readable} source stream that is piping to this writable + +The `'pipe'` event is emitted when the [`stream.pipe()`][] method is called on +a readable stream, adding this writable to its set of destinations. + +```js +const writer = getWritableStreamSomehow(); +const reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +##### Event: 'unpipe' + + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +The `'unpipe'` event is emitted when the [`stream.unpipe()`][] method is called +on a [Readable][] stream, removing this [Writable][] from its set of +destinations. + +```js +const writer = getWritableStreamSomehow(); +const reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('Something has stopped piping into the writer.'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +##### writable.cork() + + +The `writable.cork()` method forces all written data to be buffered in memory. +The buffered data will be flushed when either the [`stream.uncork()`][] or +[`stream.end()`][stream-end] methods are called. + +The primary intent of `writable.cork()` is to avoid a situation where writing +many small chunks of data to a stream do not cause an backup in the internal +buffer that would have an adverse impact on performance. In such situations, +implementations that implement the `writable._writev()` method can perform +buffered writes in a more optimized manner. + +##### writable.end([chunk][, encoding][, callback]) + + +* `chunk` {String|Buffer|any} Optional data to write. For streams not operating + in object mode, `chunk` must be a string or a `Buffer`. For object mode + streams, `chunk` may be any JavaScript value other than `null`. +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Calling the `writable.end()` method signals that no more data will be written +to the [Writable][]. The optional `chunk` and `encoding` arguments allow one +final additional chunk of data to be written immediately before closing the +stream. If provided, the optional `callback` function is attached as a listener +for the [`'finish'`][] event. + +Calling the [`stream.write()`][stream-write] method after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +const file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +##### writable.setDefaultEncoding(encoding) + + +* `encoding` {String} The new default encoding +* Return: `this` + +The `writable.setDefaultEncoding()` method sets the default `encoding` for a +[Writable][] stream. + +##### writable.uncork() + + +The `writable.uncork()` method flushes all data buffered since +[`stream.cork()`][] was called. + +When using `writable.cork()` and `writable.uncork()` to manage the buffering +of writes to a stream, it is recommended that calls to `writable.uncork()` be +deferred using `process.nextTick()`. Doing so allows batching of all +`writable.write()` calls that occur within a given Node.js event loop phase. + +```js +stream.cork(); +stream.write('some '); +stream.write('data '); +process.nextTick(() => stream.uncork()); +``` + +If the `writable.cork()` method is called multiple times on a stream, the same +number of calls to `writable.uncork()` must be called to flush the buffered +data. + +``` +stream.cork(); +stream.write('some '); +stream.cork(); +stream.write('data '); +process.nextTick(() => { + stream.uncork(); + // The data will not be flushed until uncork() is called a second time. + stream.uncork(); +}); +``` + +##### writable.write(chunk[, encoding][, callback]) + + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `false` if the stream wishes for the calling code to + wait for the `'drain'` event to be emitted before continuing to write + additional data; otherwise `true`. + +The `writable.write()` method writes some data to the stream, and calls the +supplied `callback` once the data has been fully handled. If an error +occurs, the `callback` *may or may not* be called with the error as its +first argument. To reliably detect write errors, add a listener for the +`'error'` event. + +The return value indicates whether the written `chunk` was buffered internally +and the buffer has exceeded the `highWaterMark` configured when the stream was +created. If `false` is returned, further attempts to write data to the stream +should be paused until the `'drain'` event is emitted. -Note that, for backwards compatibility reasons, removing [`'data'`][] -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling [`stream.pause()`][stream-pause] will -not guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. +A Writable stream in object mode will always ignore the `encoding` argument. -Examples of readable streams include: +### Readable Streams + +Readable streams are an abstraction for a *source* from which data is +consumed. + +Examples of Readable streams include: * [HTTP responses, on the client][http-incoming-message] * [HTTP requests, on the server][http-incoming-message] @@ -154,89 +464,208 @@ Examples of readable streams include: * [child process stdout and stderr][] * [`process.stdin`][] -#### Event: 'close' +All [Readable][] streams implement the interface defined by the +`stream.Readable` class. + +#### Two Modes + +Readable streams effectively operate in one of two modes: flowing and paused. + +When in flowing mode, data is read from the underlying system automatically +and provided to an application as quickly as possible using events via the +[`EventEmitter`][] interface. + +In paused mode, the [`stream.read()`][stream-read] method must be called +explicitly to read chunks of data from the stream. + +All [Readable][] streams begin in paused mode but can be switched to flowing +mode in one of the following ways: + +* Adding a [`'data'`][] event handler. +* Calling the [`stream.resume()`][stream-resume] method. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +The Readable can switch back to paused mode using one of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +The important concept to remember is that a Readable will not generate data +until a mechanism for either consuming or ignoring that data is provided. If +the consuming mechanism is disabled or taken away, the Readable will *attempt* +to stop generating the data. + +*Note*: For backwards compatibility reasons, removing [`'data'`][] event +handlers will **not** automatically pause the stream. Also, if there are piped +destinations, then calling [`stream.pause()`][stream-pause] will not guarantee +that the stream will *remain* paused once those destinations drain and ask for +more data. + +*Note*: If a [Readable][] is switched into flowing mode and there are no +consumers available handle the data, that data will be lost. This can occur, +for instance, when the `readable.resume()` method is called without a listener +attached to the `'data'` event, or when a `'data'` event handler is removed +from the stream. + +#### Three States + +The "two modes" of operation for a Readable stream are a simplified abstraction +for the more complicated internal state management that is happening within the +Readable stream implementation. + +Specifically, at any given point in time, every Readable is in one of three +possible states: + +* `readable._readableState.flowing = null` +* `readable._readableState.flowing = false` +* `readable._readableState.flowing = true` + +When `readable._readableState.flowing` is `null`, no mechanism for consuming the +streams data is provided so the stream will not generate its data. + +Attaching a listener for the `'data'` event, calling the `readable.pipe()` +method, or calling the `readable.resume()` method will switch +`readable._readableState.flowing` to `true`, causing the Readable to begin +actively emitting events as data is generated. + +Calling `readable.pause()`, `readable.unpipe()`, or receiving "back pressure" +will cause the `readable._readableState.flowing` to be set as `false`, +temporarily halting the flowing of events but *not* halting the generation of +data. + +While `readable._readableState.flowing` is `false`, data may be accumulating +within the streams internal buffer. + +#### Choose One -Emitted when the stream and any of its underlying resources (a file -descriptor, for example) have been closed. The event indicates that -no more events will be emitted, and no further computation will occur. +The Readable stream API evolved across multiple Node.js versions and provides +multiple methods of consuming stream data. In general, developers should choose +*one* of the methods of consuming data and *should never* use multiple methods +to consume data from a single stream. -Not all streams will emit the `'close'` event as the `'close'` event is -optional. +Use of the `readable.pipe()` method is recommended for most users as it has been +implemented to provide the easiest way of consuming stream data. Developers that +require more fine-grained control over the transfer and generation of data can +use the [`EventEmitter`][] and `readable.pause()`/`readable.resume()` APIs. -#### Event: 'data' +#### Class: stream.Readable + -* `chunk` {Buffer|String} The chunk of data. + + +##### Event: 'close' + + +The `'close'` event is emitted when the stream and any of its underlying +resources (a file descriptor, for example) have been closed. The event indicates +that no more events will be emitted, and no further computation will occur. + +Not all [Readable][] streams will emit the `'close'` event. -Attaching a `'data'` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. +##### Event: 'data' + -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. +* `chunk` {Buffer|String|any} The chunk of data. For streams that are not + operating in object mode, the chunk will be either a string or `Buffer`. + For streams that are in object mode, the chunk can be any JavaScript value + other than `null`. + +The `'data'` event is emitted whenever the stream is relinquishing ownership of +a chunk of data to a consumer. This may occur whenever the stream is switched +in flowing mode by calling `readable.pipe()`, `readable.resume()`, or by +attaching a listener callback to the `'data'` event. The `'data'` event will +also be emitted whenever the `readable.read()` method is called and a chunk of +data is available to be returned. + +Attaching a `'data'` event listener to a stream that has not been explicitly +paused will switch the stream into flowing mode. Data will then be passed as +soon as it is available. + +The listener callback will be passed the chunk of data as a string if a default +encoding has been specified for the stream using the +`readable.setEncoding()` method; otherwise the data will be passed as a +`Buffer`. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); }); ``` -#### Event: 'end' +##### Event: 'end' + -This event fires when there will be no more data to read. +The `'end'` event is emitted when there is no more data to be consumed from +the stream. -Note that the `'end'` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling [`stream.read()`][stream-read] repeatedly until you get to the -end. +*Note*: The `'end'` event **will not be emitted** unless the data is +completely consumed. This can be accomplished by switching the stream into +flowing mode, or by calling [`stream.read()`][stream-read] repeatedly until +all data has been consumed. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); }); readable.on('end', () => { - console.log('there will be no more data.'); + console.log('There will be no more data.'); }); ``` -#### Event: 'error' +##### Event: 'error' + * {Error} -Emitted if there was an error receiving data. +The `'error'` event may be emitted by a Readable implementation at any time. +Typically, this may occur if the underlying stream in unable to generate data +due to an underlying internal failure, or when a stream implementation attempts +to push an invalid chunk of data. -#### Event: 'readable' +The listener callback will be passed a single `Error` object. -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. +##### Event: 'readable' + -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. +The `'readable'` event is emitted when there is data available to be read from +the stream. In some cases, attaching a listener for the `'readable'` event will +cause some amount of data to be read into an internal buffer. ```javascript -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('readable', () => { // there is some data to read now }); ``` +The `'readable'` event will also be emitted once the end of the stream data +has been reached but before the `'end'` event is emitted. -Once the internal buffer is drained, a `'readable'` event will fire -again when more data is available. - -The `'readable'` event is not emitted in the "flowing" mode with the -sole exception of the last one, on end-of-stream. - -The `'readable'` event indicates that the stream has new information: -either new data is available or the end of the stream has been reached. -In the former case, [`stream.read()`][stream-read] will return that data. In the -latter case, [`stream.read()`][stream-read] will return null. For instance, in -the following example, `foo.txt` is an empty file: +Effectively, the `'readable'` event indicates that the stream has new +information: either new data is available or the end of the stream has been +reached. In the former case, [`stream.read()`][stream-read] will return the +available data. In the latter case, [`stream.read()`][stream-read] will return +`null`. For instance, in the following example, `foo.txt` is an empty file: ```js const fs = require('fs'); -var rr = fs.createReadStream('foo.txt'); +const rr = fs.createReadStream('foo.txt'); rr.on('readable', () => { console.log('readable:', rr.read()); }); @@ -253,16 +682,23 @@ readable: null end ``` -#### readable.isPaused() +*Note*: In general, the `readable.pipe()` and `'data'` event mechanisms are +preferred over the use of the `'readable'` event. + +##### readable.isPaused() + * Return: {Boolean} -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using [`stream.pause()`][stream-pause] without a -corresponding [`stream.resume()`][stream-resume]). +The `readable.isPaused()` method returns the current operating state of the +Readable. This is used primarily by the mechanism that underlies the +`readable.pipe()` method. In most typical cases, there will be no reason to +use this method directly. ```js -var readable = new stream.Readable +const readable = new stream.Readable readable.isPaused() // === false readable.pause() @@ -271,68 +707,71 @@ readable.resume() readable.isPaused() // === false ``` -#### readable.pause() +##### readable.pause() + * Return: `this` -This method will cause a stream in flowing mode to stop emitting -[`'data'`][] events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. +The `readable.pause()` method will cause a stream in flowing mode to stop +emitting [`'data'`][] events, switching out of flowing mode. Any data that +becomes available will remain in the internal buffer. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); readable.pause(); - console.log('there will be no more data for 1 second'); + console.log('There will be no additional data for 1 second.'); setTimeout(() => { - console.log('now data will start flowing again'); + console.log('Now data will start flowing again.'); readable.resume(); }, 1000); }); ``` -#### readable.pipe(destination[, options]) +##### readable.pipe(destination[, options]) + * `destination` {stream.Writable} The destination for writing data * `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` + * `end` {Boolean} End the writer when the reader ends. Defaults to `true`. -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. +The `readable.pipe()` method attaches a [Writable][] stream to the `readable`, +causing it to switch automatically into flowing mode and push all of its data +to the attached [Writable][]. The flow of data will be automatically managed so +that the destination Writable stream is not overwhelmed by a faster Readable +stream. -Multiple destinations can be piped to safely. +The following example pipes all of the data from the `readable` into a file +named `file.txt`: ```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); +const readable = getReadableStreamSomehow(); +const writable = fs.createWriteStream('file.txt'); // All the data from readable goes into 'file.txt' readable.pipe(writable); ``` +It is possible to attach multiple Writable streams to a single Readable stream. -This function returns the destination stream, so you can set up pipe -chains like so: +The `readable.pipe()` method returns a reference to the *destination* stream +making it possible to set up chains of piped streams: ```js -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); +const r = fs.createReadStream('file.txt'); +const z = zlib.createGzip(); +const w = fs.createWriteStream('file.txt.gz'); r.pipe(z).pipe(w); ``` -For example, emulating the Unix `cat` command: - -```js -process.stdin.pipe(process.stdout); -``` - -By default [`stream.end()`][stream-end] is called on the destination when the -source stream emits [`'end'`][], so that `destination` is no longer writable. -Pass `{ end: false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. +By default, [`stream.end()`][stream-end] is called on the destination Writable +stream when the source Readable stream emits [`'end'`][], so that the +destination is no longer writable. To disable this default behavior, the `end` +option can be passed as `false`, causing the destination stream to remain open, +as illustrated in the following example: ```js reader.pipe(writer, { end: false }); @@ -341,88 +780,115 @@ reader.on('end', () => { }); ``` -Note that [`process.stderr`][] and [`process.stdout`][] are never closed until -the process exits, regardless of the specified options. +One important caveat is that if the Readable stream emits an error during +processing, the Writable destination *is not closed* automatically. If an +error occurs, it will be necessary to *manually* close each stream in order +to prevent memory leaks. + +*Note*: The [`process.stderr`][] and [`process.stdout`][] Writable streams are +never closed until the Node.js process exits, regardless of the specified +options. -#### readable.read([size]) +##### readable.read([size]) + * `size` {Number} Optional argument to specify how much data to read. * Return {String|Buffer|Null} -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. +The `readable.read()` method pulls some data out of the internal buffer and +returns it. If no data available to be read, `null` is returned. By default, +the data will be returned as a `Buffer` object unless an encoding has been +specified using the `readable.setEncoding()` method or the stream is operating +in object mode. -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`, -unless we've ended, in which case it will return the data remaining -in the buffer. +The optional `size` argument specifies a specific number of bytes to read. If +`size` bytes are not available to be read, `null` will be returned *unless* +the stream has ended, in which case all of the data remaining in the internal +buffer will be returned (*even if it exceeds `size` bytes*). -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. +If the `size` argument is not specified, all of the data contained in the +internal buffer will be returned. -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. +The `readable.read()` method should only be called on Readable streams operating +in paused mode. In flowing mode, `readable.read()` is called automatically until +the internal buffer is fully drained. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('readable', () => { var chunk; while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); } }); ``` -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'`][] event. +In general, it is recommended that developers avoid the use of the `'readable'` +event and the `readable.read()` method in favor of using either +`readable.pipe()` or the `'data'` event. -Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] -event has been triggered will return `null`. No runtime error will be raised. +A Readable stream in object mode will always return a single item from +a call to [`readable.read(size)`][stream-read], regardless of the value of the +`size` argument. + +*Note:* If the `readable.read()` method returns a chunk of data, a `'data'` +event will also be emitted. -#### readable.resume() +*Note*: Calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been emitted will return `null`. No runtime error will be raised. + +##### readable.resume() + * Return: `this` -This method will cause the readable stream to resume emitting [`'data'`][] -events. +The `readable.resume()` method causes an explicitly paused Readable stream to +resume emitting [`'data'`][] events, switching the stream into flowing mode. -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open -the flow of data. +The `readable.resume()` method can be used to fully consume the data from a +stream without actually processing any of that data as illustrated in the +following example: ```js -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', () => { - console.log('got to the end, but did not read anything'); -}); +getReadableStreamSomehow() + .resume() + .on('end', () => { + console.log('Reached the end, but did not read anything.'); + }); ``` -#### readable.setEncoding(encoding) +##### readable.setEncoding(encoding) + * `encoding` {String} The encoding to use. * Return: `this` -Call this function to cause the stream to return strings of the specified -encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be interpreted as -UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, -then the data will be encoded in hexadecimal string format. +The `readable.setEncoding()` method sets the default character encoding for +data read from the Readable stream. -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called [`buf.toString(encoding)`][] on them. If you want to read the data -as strings, always use this method. +Setting an encoding causes the stream data +to be returned as string of the specified encoding rather than as `Buffer` +objects. For instance, calling `readable.setEncoding('utf8')` will cause the +output data will be interpreted as UTF-8 data, and passed as strings. Calling +`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal +string format. -Also you can disable any encoding at all with `readable.setEncoding(null)`. -This approach is very useful if you deal with binary data or with large -multi-byte strings spread out over multiple chunks. +The Readable stream will properly handle multi-byte characters delivered through +the stream that would otherwise become improperly decoded if simply pulled from +the stream as `Buffer` objects. + +Encoding can be disabled by calling `readable.setEncoding(null)`. This approach +is useful when working with binary data or with large multi-byte strings spread +out over multiple chunks. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.setEncoding('utf8'); readable.on('data', (chunk) => { assert.equal(typeof chunk, 'string'); @@ -430,47 +896,53 @@ readable.on('data', (chunk) => { }); ``` -#### readable.unpipe([destination]) +##### readable.unpipe([destination]) + * `destination` {stream.Writable} Optional specific stream to unpipe -This method will remove the hooks set up for a previous [`stream.pipe()`][] -call. +The `readable.unpipe()` method detaches a Writable stream previously attached +using the [`stream.pipe()`][] method. -If the destination is not specified, then all pipes are removed. +If the `destination` is not specified, then *all* pipes are detached. -If the destination is specified, but no pipe is set up for it, then -this is a no-op. +If the `destination` is specified, but no pipe is set up for it, then +the method does nothing. ```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); +const readable = getReadableStreamSomehow(); +const writable = fs.createWriteStream('file.txt'); // All the data from readable goes into 'file.txt', // but only for the first second readable.pipe(writable); setTimeout(() => { - console.log('stop writing to file.txt'); + console.log('Stop writing to file.txt'); readable.unpipe(writable); - console.log('manually close the file stream'); + console.log('Manually close the file stream'); writable.end(); }, 1000); ``` -#### readable.unshift(chunk) +##### readable.unshift(chunk) + * `chunk` {Buffer|String} Chunk of data to unshift onto the read queue -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. +The `readable.unshift()` method pushes a chunk of data back into the internal +buffer. This is useful in certain situations where a stream is being consumed by +code that needs to "un-consume" some amount of data that it has optimistically +pulled out of the source, so that the data can be passed on to some other party. -Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event -has been triggered; a runtime error will be raised. +*Note*: The `stream.unshift(chunk)` method cannot be called after the +[`'end'`][] event has been emitted or a runtime error will be thrown. -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See [API -for Stream Implementors][].) +Developers using `stream.unshift()` often should consider switching to +use of a [Transform][] stream instead. See the [API for Stream Implementers][] +section for more information. ```js // Pull off a header delimited by \n\n @@ -480,7 +952,7 @@ const StringDecoder = require('string_decoder').StringDecoder; function parseHeader(stream, callback) { stream.on('error', callback); stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); + const decoder = new StringDecoder('utf8'); var header = ''; function onReadable() { var chunk; @@ -490,8 +962,8 @@ function parseHeader(stream, callback) { // found the header boundary var split = str.split(/\n\n/); header += split.shift(); - var remaining = split.join('\n\n'); - var buf = Buffer.from(remaining, 'utf8'); + const remaining = split.join('\n\n'); + const buf = Buffer.from(remaining, 'utf8'); if (buf.length) stream.unshift(buf); stream.removeListener('error', callback); @@ -507,30 +979,34 @@ function parseHeader(stream, callback) { } ``` -Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +*Note*: Unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` will not end the reading process by resetting the internal reading state of the -stream. This can cause unexpected results if `unshift()` is called during a -read (i.e. from within a [`stream._read()`][stream-_read] implementation on a -custom stream). Following the call to `unshift()` with an immediate -[`stream.push('')`][stream-push] will reset the reading state appropriately, -however it is best to simply avoid calling `unshift()` while in the process of -performing a read. - -#### readable.wrap(stream) +stream. This can cause unexpected results if `readable.unshift()` is called +during a read (i.e. from within a [`stream._read()`][stream-_read] +implementation on a custom stream). Following the call to `readable.unshift()` +with an immediate [`stream.push('')`][stream-push] will reset the reading state +appropriately, however it is best to simply avoid calling `readable.unshift()` +while in the process of performing a read. + +##### readable.wrap(stream) + * `stream` {Stream} An "old style" readable stream Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See [Compatibility][] for -more information.) +entire `stream` module API as it is currently defined. (See [Compatibility][] +for more information.) -If you are using an older Node.js library that emits [`'data'`][] events and -has a [`stream.pause()`][stream-pause] method that is advisory only, then you -can use the `wrap()` method to create a [Readable][] stream that uses the old -stream as its data source. +When using an older Node.js library that emits [`'data'`][] events and has a +[`stream.pause()`][stream-pause] method that is advisory only, the +`readable.wrap()` method can be used to create a [Readable][] stream that uses +the old stream as its data source. -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old Node.js programs and libraries. +It will rarely be necessary to use `readable.wrap()` but the method has been +provided as a convenience for interacting with older Node.js applications and +libraries. For example: @@ -545,210 +1021,65 @@ myReader.on('readable', () => { }); ``` -### Class: stream.Transform +### Duplex and Transform Streams -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and +#### Class: stream.Duplex + + + + +Duplex streams are streams that implement both the [Readable][] and [Writable][] interfaces. -Examples of Transform streams include: +Examples of Duplex streams include: +* [TCP sockets][] * [zlib streams][zlib] * [crypto streams][crypto] -### Class: stream.Writable +#### Class: stream.Transform + -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. +Transform streams are [Duplex][] streams where the output is in some way +related to the input. Like all [Duplex][] streams, Transform streams +implement both the [Readable][] and [Writable][] interfaces. -Examples of writable streams include: +Examples of Transform streams include: -* [HTTP requests, on the client][] -* [HTTP responses, on the server][] -* [fs write streams][] * [zlib streams][zlib] * [crypto streams][crypto] -* [TCP sockets][] -* [child process stdin][] -* [`process.stdout`][], [`process.stderr`][] -#### Event: 'close' -Emitted when the stream and any of its underlying resources (a file descriptor, -for example) have been closed. The event indicates that no more events will be -emitted, and no further computation will occur. +## API for Stream Implementers -Not all streams will emit the `'close'` event as the `'close'` event is -optional. + -#### Event: 'drain' +The `stream` module API has been designed to make it possible to easily +implement streams using JavaScript's prototypical inheritance model. -If a [`stream.write(chunk)`][stream-write] call returns `false`, then the -`'drain'` event will indicate when it is appropriate to begin writing more data -to the stream. +First, a stream developer would declare a new JavaScript class that extends one +of the four basic stream classes (`stream.Writable`, `stream.Readable`, +`stream.Duplex`, or `stream.Transform`), making sure the call the appropriate +parent class constructor: ```js -// Write the data to the supplied writable stream one million times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### Event: 'error' - -* {Error} - -Emitted if there was an error when writing or piping data. - -#### Event: 'finish' - -When the [`stream.end()`][stream-end] method has been called, and all data has -been flushed to the underlying system, this event is emitted. +const Writable = require('stream').Writable; -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #${i}!\n'); +class MyWritable extends Writable { + constructor(options) { + super(options); + } } -writer.end('this is the end\n'); -writer.on('finish', () => { - console.error('all writes are now complete.'); -}); ``` -#### Event: 'pipe' - -* `src` {stream.Readable} source stream that is piping to this writable - -This is emitted whenever the [`stream.pipe()`][] method is called on a readable -stream, adding this writable to its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', (src) => { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that - [unpiped][`stream.unpipe()`] this writable - -This is emitted whenever the [`stream.unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', (src) => { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at [`stream.uncork()`][] or at -[`stream.end()`][stream-end] call. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String|Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If supplied, -the callback is attached as a listener on the [`'finish'`][] event. - -Calling [`stream.write()`][stream-write] after calling -[`stream.end()`][stream-end] will raise an error. - -```js -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding -* Return: `this` - -Sets the default encoding for a writable stream. - -#### writable.uncork() - -Flush all data, buffered since [`stream.cork()`][] call. - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String|Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} `true` if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. If an error -occurs, the callback may or may not be called with the error as its -first argument. To detect write errors, listen for the `'error'` event. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the [`'drain'`][] event before writing more data. - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits()`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -3. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: +The new stream class must then implement one or more specific methods, depending +on the type of stream being created, as detailed in the chart below: @@ -769,7 +1100,7 @@ of stream class you are writing:

    Reading only

    -

    [Readable](#stream_class_stream_readable_1)

    +

    [Readable](#stream_class_stream_readable)

    [_read][stream-_read]

    @@ -780,7 +1111,7 @@ of stream class you are writing:

    Writing only

    -

    [Writable](#stream_class_stream_writable_1)

    +

    [Writable](#stream_class_stream_writable)

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

    @@ -791,7 +1122,7 @@ of stream class you are writing:

    Reading and writing

    -

    [Duplex](#stream_class_stream_duplex_1)

    +

    [Duplex](#stream_class_stream_duplex)

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

    @@ -802,7 +1133,7 @@ of stream class you are writing:

    Operate on written data, then read the result

    -

    [Transform](#stream_class_stream_transform_1)

    +

    [Transform](#stream_class_stream_transform)

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

    @@ -810,726 +1141,731 @@ of stream class you are writing:
    -In your implementation code, it is very important to never call the methods -described in [API for Stream Consumers][]. Otherwise, you can potentially cause -adverse side effects in programs that consume your streaming interfaces. - -### Class: stream.Duplex +*Note*: The implementation code for a stream should *never* call the "public" +methods of a stream that are intended for use by consumers (as described in +the [API for Stream Consumers][] section). Doing so may lead to adverse +side effects in application code consuming the stream. - - -A "duplex" stream is one that is both Readable and Writable, such as a TCP -socket connection. +### Simplified Construction -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the [`stream._read(size)`][stream-_read] -and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you -would with a Readable or Writable stream class. +For many simple cases, it is possible to construct a stream without relying on +inheritance. This can be accomplished by directly creating instances of the +`stream.Writable`, `stream.Readable`, `stream.Duplex` or `stream.Transform` +objects and passing appropriate methods as constructor options. -Since JavaScript doesn't have multiple prototypal inheritance, this class -prototypally inherits from Readable, and then parasitically from Writable. It is -thus up to the user to implement both the low-level -[`stream._read(n)`][stream-_read] method as well as the low-level -[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension -duplex classes. +For example: -#### new stream.Duplex(options) +```js +const Writable = require('stream').Writable; -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. +const myWritable = new Writable({ + write(chunk, encoding, callback) { + // ... + } +}); +``` -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. +### Implementing a Writable Stream -### Class: stream.PassThrough +The `stream.Writable` class is extended to implement a [Writable][] stream. -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. +Custom Writable streams *must* call the `new stream.Writable([options])` +constructor and implement the `writable._write()` method. The +`writable._writev()` method *may* also be implemented. -### Class: stream.Readable +#### Constructor: new stream.Writable([options]) - +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Defaults to + `16384` (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Defaults to `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. When set, + it becomes possible to write JavaScript values other than string or + `Buffer` if supported by the stream implementation. Defaults to `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`stream._read(size)`][stream-_read] method. +For example: -Please see [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. +```js +const Writable = require('stream').Writable; -#### new stream.Readable([options]) +class MyWritable extends Writable { + constructor(options) { + // Calls the stream.Writable() constructor + super(options); + } +} +``` -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default = `16384` (16kb), or `16` for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default = `null` - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns - a single value instead of a Buffer of size n. Default = `false` - * `read` {Function} Implementation for the [`stream._read()`][stream-_read] - method. +Or, when using pre-ES6 style constructors: -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. +```js +const Writable = require('stream').Writable; +const util = require('util'); -#### readable.\_read(size) +function MyWritable(options) { + if (!(this instanceof MyWritable)) + return new MyWritable(options); + Writable.call(this, options); +} +util.inherits(MyWritable, Writable); +``` -* `size` {Number} Number of bytes to read asynchronously +Or, using the Simplified Constructor approach: -Note: **Implement this method, but do NOT call it directly.** - -This method is prefixed with an underscore because it is internal to the -class that defines it and should only be called by the internal Readable -class methods. All Readable stream implementations must provide a \_read -method to fetch data from the underlying resource. - -When `_read()` is called, if data is available from the resource, the `_read()` -implementation should start pushing that data into the read queue by calling -[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from -the resource and pushing data until push returns `false`, at which point it -should stop reading from the resource. Only when `_read()` is called again after -it has stopped should it start reading more data from the resource and pushing -that data onto the queue. - -Note: once the `_read()` method is called, it will not be called again until -the [`stream.push()`][stream-push] method is called. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. +```js +const Writable = require('stream').Writable; -#### readable.push(chunk[, encoding]) +const myWritable = new Writable({ + write(chunk, encoding, callback) { + // ... + }, + writev(chunks, callback) { + // ... + } +}); +``` +#### writable.\_write(chunk, encoding, callback) -* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then `encoding` is the + character encoding of that string. If chunk is a `Buffer`, or if the + stream is operating in object mode, `encoding` may be ignored. +* `callback` {Function} Call this function (optionally with an error + argument) when processing is complete for the supplied chunk. -Note: **This method should be called by Readable implementors, NOT -by consumers of Readable streams.** +All Writable stream implementations must provide a +[`writable._write()`][stream-_write] method to send data to the underlying +resource. -If a value other than null is passed, The `push()` method adds a chunk of data -into the queue for subsequent stream processors to consume. If `null` is -passed, it signals the end of the stream (EOF), after which no more data -can be written. +*Note*: [Transform][] streams provide their own implementation of the +[`writable._write()`][stream-_write]. -The data added with `push()` can be pulled out by calling the -[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Writable +class methods only. -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: +The `callback` method must be called to signal either that the write completed +successfully or failed with an error. The first argument passed to the +`callback` must be the `Error` object if the call failed or `null` if the +write succeeded. -```js -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. +It is important to note that all calls to `writable.write()` that occur between +the time `writable._write()` is called and the `callback` is called will cause +the written data to be buffered. Once the `callback` is invoked, the stream will +emit a `'drain'` event. If a stream implementation is capable of processing +multiple chunks of data at once, the `writable._writev()` method should be +implemented. -util.inherits(SourceWrapper, Readable); +If the `decodeStrings` property is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the character encoding of the string. This is to support +implementations that have an optimized handling for certain string +data encodings. If the `decodeStrings` property is explicitly set to `false`, +the `encoding` argument can be safely ignored, and `chunk` will always be a +`Buffer`. -function SourceWrapper(options) { - Readable.call(this, options); +The `writable._write()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. - this._source = getLowlevelSourceObject(); +#### writable.\_writev(chunks, callback) - // Every time there's data, we push it into the internal buffer. - this._source.ondata = (chunk) => { - // if push() returns false, then we need to stop reading from source - if (!this.push(chunk)) - this._source.readStop(); - }; +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} A callback function (optionally with an error + argument) to be invoked when processing is complete for the supplied chunks. - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = () => { - this.push(null); - }; -} +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Writable +class methods only. -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` +The `writable._writev()` method may be implemented in addition to +`writable._write()` in stream implementations that are capable of processing +multiple chunks of data at once. If implemented, the method will be called with +all chunks of data currently buffered in the write queue. -#### Example: A Counting Stream +The `writable._writev()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. - +#### Errors While Writing -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. +It is recommended that errors occurring during the processing of the +`writable._write()` and `writable._writev()` methods are reported by invoking +the callback and passing the error as the first argument. This will cause an +`'error'` event to be emitted by the Writable. Throwing an Error from within +`writable._write()` can result in expected and inconsistent behavior depending +on how the stream is being used. Using the callback ensures consistent and +predictable handling of errors. ```js -const Readable = require('stream').Readable; -const util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} +const Writable = require('stream').Writable; -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = Buffer.from(str, 'ascii'); - this.push(buf); +const myWritable = new Writable({ + write(chunk, encoding, callback) { + if (chunk.toString().indexOf('a') >= 0) { + callback(new Error('chunk is invalid')); + } else { + callback(); + } } -}; +}); ``` -#### Example: SimpleProtocol v1 (Sub-optimal) +#### An Example Writable Stream -This is similar to the `parseHeader` function described -[here](#stream_readable_unshift_chunk), but implemented as a custom stream. -Also, note that this implementation does not convert the incoming data to a -string. - -However, this would be better implemented as a [Transform][] stream. See -[SimpleProtocol v2][] for a better implementation. +The following illustrates a rather simplistic (and somewhat pointless) custom +Writable stream implementation. While this specific Writable stream instance +is not of any real particular usefulness, the example illustrates each of the +required elements of a custom [Writable][] stream instance: ```js -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. +const Writable = require('stream').Writable; -const Readable = require('stream').Readable; -const util = require('util'); +class MyWritable extends Writable { + constructor(options) { + super(options); + } -util.inherits(SimpleProtocol, Readable); + _write(chunk, encoding, callback) { + if (chunk.toString().indexOf('a') >= 0) { + callback(new Error('chunk is invalid')); + } else { + callback(); + } + } +} +``` -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); +### Implementing a Readable Stream - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; +The `stream.Readable` class is extended to implement a [Readable][] stream. - // source is a readable stream, such as a socket or file - this._source = source; +Custom Readable streams *must* call the `new stream.Readable([options])` +constructor and implement the `readable._read()` method. - source.on('end', () => { - this.push(null); - }); +#### new stream.Readable([options]) - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', () => { - this.read(0); - }); +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Defaults to `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Defaults to `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Defaults to `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. - this._rawHeader = []; - this.header = null; -} +For example: -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } +```js +const Readable = require('stream').Readable; - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - // calling unshift by itself does not reset the reading state - // of the stream; since we're inside _read, doing an additional - // push('') will reset the state appropriately. - this.push(''); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); +class MyReadable extends Readable { + constructor(options) { + // Calls the stream.Readable(options) constructor + super(options); } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. +} ``` -### Class: stream.Transform +Or, when using pre-ES6 style constructors: -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. +```js +const Readable = require('stream').Readable; +const util = require('util'); -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. +function MyReadable(options) { + if (!(this instanceof MyReadable)) + return new MyReadable(options); + Readable.call(this, options); +} +util.inherits(MyReadable, Readable); +``` -Rather than implement the [`stream._read()`][stream-_read] and -[`stream._write()`][stream-_write] methods, Transform classes must implement the -[`stream._transform()`][stream-_transform] method, and may optionally -also implement the [`stream._flush()`][stream-_flush] method. (See below.) +Or, using the Simplified Constructor approach: -#### new stream.Transform([options]) +```js +const Readable = require('stream').Readable; -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `transform` {Function} Implementation for the - [`stream._transform()`][stream-_transform] method. - * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] - method. +const myReadable = new Readable({ + read(size) { + // ... + } +}); +``` -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. +#### readable.\_read(size) -#### Events: 'finish' and 'end' +* `size` {Number} Number of bytes to read asynchronously -The [`'finish'`][] and [`'end'`][] events are from the parent Writable -and Readable classes respectively. The `'finish'` event is fired after -[`stream.end()`][stream-end] is called and all chunks have been processed by -[`stream._transform()`][stream-_transform], `'end'` is fired after all data has -been output which is after the callback in [`stream._flush()`][stream-_flush] -has been called. +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Readable +class methods only. -#### transform.\_flush(callback) +All Readable stream implementations must provide an implementation of the +`readable._read()` method to fetch data from the underlying resource. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. +When `readable._read()` is called, if data is available from the resource, the +implementation should begin pushing that data into the read queue using the +[`this.push(dataChunk)`][stream-push] method. `_read()` should continue reading +from the resource and pushing data until `readable.push()` returns `false`. Only +when `_read()` is called again after it has stopped should it resume pushing +additional data onto the queue. -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. +*Note*: Once the `readable._read()` method has been called, it will not be +called again until the [`readable.push()`][stream-push] method is called. -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. +The `size` argument is advisory. For implementations where a "read" is a +single operation that returns data can use the `size` argument to determine how +much data to fetch. Other implementations may ignore this argument and simply +provide data whenever it becomes available. There is no need to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. -In those cases, you can implement a `_flush()` method, which will be -called at the very end, after all the written data is consumed, but -before emitting [`'end'`][] to signal the end of the readable side. Just -like with [`stream._transform()`][stream-_transform], call -`transform.push(chunk)` zero or more times, as appropriate, and call `callback` -when the flush operation is complete. +The `readable._read()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. +#### readable.push(chunk[, encoding]) -#### transform.\_transform(chunk, encoding, callback) +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* Returns {Boolean} `true` if additional chunks of data may continued to be + pushed; `false` otherwise. -* `chunk` {Buffer|String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. +When `chunk` is a `Buffer` or `string`, the `chunk` of data will be added to the +internal queue for users of the stream to consume. Passing `chunk` as `null` +signals the end of the stream (EOF), after which no more data can be written. -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. +When the Readable is operating in paused mode, the data added with +`readable.push()` can be read out by calling the +[`readable.read()`][stream-read] method when the [`'readable'`][] event is +emitted. -All Transform stream implementations must provide a `_transform()` -method to accept input and produce output. +When the Readable is operating in flowing mode, the data added with +`readable.push()` will be delivered by emitting a `'data'` event. -`_transform()` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. +The `readable.push()` method is designed to be as flexible as possible. For +example, when wrapping a lower-level source that provides some form of +pause/resume mechanism, and a data callback, the low-level source can be wrapped +by the custom Readable instance as illustrated in the following example: -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply a second argument to the callback -it will be passed to the push method. In other words the following are -equivalent: +class SourceWrapper extends Readable { + constructor(options) { + super(options); -```js -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -}; + this._source = getLowlevelSourceObject(); -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -}; + // Every time there's data, push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; + } + // _read will be called when the stream wants to pull more data in + // the advisory size argument is ignored in this case. + _read(size) { + this._source.readStart(); + } +} ``` +*Note*: The `readable.push()` method is intended be called only by Readable +Implementers, and only from within the `readable._read()` method. -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. +#### Errors While Reading -#### Example: `SimpleProtocol` parser v2 +It is recommended that errors occurring during the processing of the +`readable._read()` method are emitted using the `'error'` event rather than +being thrown. Throwing an Error from within `readable._read()` can result in +expected and inconsistent behavior depending on whether the stream is operating +in flowing or paused mode. Using the `'error'` event ensures consistent and +predictable handling of errors. -The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple -protocol parser can be implemented simply by using the higher level -[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol -v1` examples. +```js +const Readable = require('stream').Readable; -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic Node.js stream -approach. +const myReadable = new Readable({ + read(size) { + if (checkSomeErrorCondition()) { + process.nextTick(() => this.emit('error', err)); + return; + } + // do some work + } +}); +``` -```javascript -const util = require('util'); -const Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); +#### An Example Counting Stream -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); + - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} +The following is a basic example of a Readable stream that emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } +```js +const Readable = require('stream').Readable; - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); +class Counter extends Readable { + constructor(opt) { + super(opt); + this._max = 1000000; + this._index = 1; + } - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); + _read() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = Buffer.from(str, 'ascii'); + this.push(buf); } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. +} ``` -### Class: stream.Writable +### Implementing a Duplex Stream - +A [Duplex][] stream is one that implements both [Readable][] and [Writable][], +such as a TCP socket connection. -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the -[`stream._write(chunk, encoding, callback)`][stream-_write] method. +Because Javascript does not have support for multiple inheritance, the +`stream.Duplex` class is extended to implement a [Duplex][] stream (as opposed +to extending the `stream.Readable` *and* `stream.Writable` classes). -Please see [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. +*Note*: The `stream.Duplex` class prototypically inherits from `stream.Readable` +and parasitically from `stream.Writable`. -#### new stream.Writable([options]) +Custom Duplex streams *must* call the `new stream.Duplex([options])` +constructor and implement *both* the `readable._read()` and +`writable._write()` methods. -* `options` {Object} - * `highWaterMark` {Number} Buffer level when - [`stream.write()`][stream-write] starts returning `false`. Default = `16384` - (16kb), or `16` for `objectMode` streams. - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`stream._write()`][stream-_write]. - Default = `true` - * `objectMode` {Boolean} Whether or not the - [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can - write arbitrary data instead of only `Buffer` / `String` data. - Default = `false` - * `write` {Function} Implementation for the - [`stream._write()`][stream-_write] method. - * `writev` {Function} Implementation for the - [`stream._writev()`][stream-_writev] method. +#### new stream.Duplex(options) -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Defaults to `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Defaults to `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Defaults to `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. -#### writable.\_write(chunk, encoding, callback) +For example: -* `chunk` {Buffer|String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. +```js +const Duplex = require('stream').Duplex; -All Writable stream implementations must provide a -[`stream._write()`][stream-_write] method to send data to the underlying -resource. +class MyDuplex extends Duplex { + constructor(options) { + super(options); + } +} +``` -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. +Or, when using pre-ES6 style constructors: -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. +```js +const Duplex = require('stream').Duplex; +const util = require('util'); -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. +function MyDuplex(options) { + if (!(this instanceof MyDuplex)) + return new MyDuplex(options); + Duplex.call(this, options); +} +util.inherits(MyDuplex, Duplex); +``` -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. +Or, using the Simplified Constructor approach: -#### writable.\_writev(chunks, callback) +```js +const Duplex = require('stream').Duplex; -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. +const myDuplex = new Duplex({ + read(size) { + // ... + }, + write(chunk, encoding, callback) { + // ... + } +}); +``` -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. +#### An Example Duplex Stream -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. +The following illustrates a simple example of a Duplex stream that wraps a +hypothetical lower-level source object to which data can be written, and +from which data can be read, albeit using an API that is not compatible with +Node.js streams. +The following illustrates a simple example of a Duplex stream that buffers +incoming written data via the [Writable][] interface that is read back out +via the [Readable][] interface. +```js +const Duplex = require('stream').Duplex; +const kSource = Symbol('source'); -## Simplified Constructor API +class MyDuplex extends Duplex { + constructor(source, options) { + super(options); + this[kSource] = source; + } - + _write(chunk, encoding, callback) { + // The underlying source only deals with strings + if (Buffer.isBuffer(chunk)) + chunk = chunk.toString(encoding); + this[kSource].writeSomeData(chunk, encoding); + callback(); + } + + _read(size) { + this[kSource].fetchSomeData(size, (data, encoding) => { + this.push(Buffer.from(data, encoding)); + }); + } +} +``` -In simple cases there is now the added benefit of being able to construct a -stream without inheritance. +The most important aspect of a Duplex stream is that the Readable and Writable +sides operate independently of one another despite co-existing within a single +object instance. -This can be done by passing the appropriate methods as constructor options: +#### Object Mode Duplex Streams -Examples: +For Duplex streams, `objectMode` can be set exclusively for either the Readable +or Writable side using the `readableObjectMode` and `writableObjectMode` options +respectively. -### Duplex +In the following example, for instance, a new Transform stream (which is a +type of [Duplex][] stream) is created that has an object mode Writable side +that accepts JavaScript numbers that are converted to hexidecimal strings on +the Readable side. ```js -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood +const Transform = require('stream').Transform; - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood +// All Transform streams are also Duplex Streams +const myTransform = new Transform({ + writableObjectMode: true, + + transform(chunk, encoding, callback) { + // Coerce the chunk to a number if necessary + chunk |= 0; - // An optional error can be passed as the first argument - next() + // Transform the chunk into something else. + const data = chunk.toString(16); + + // Push the data onto the readable queue. + callback(null, '0'.repeat(data.length % 2) + data); } }); -// or +myTransform.setEncoding('ascii'); +myTransform.on('data', (chunk) => console.log(chunk)); -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood +myTransform.write(1); + // Prints: 01 +myTransform.write(10); + // Prints: 0a +myTransform.write(100); + // Prints: 64 +``` - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - writev: function(chunks, next) { - // sets this._writev under the hood +### Implementing a Transform Stream - // An optional error can be passed as the first argument - next() - } -}); -``` +A [Transform][] stream is a [Duplex][] stream where the output is computed +in some way from the input. Examples include [zlib][] streams or [crypto][] +streams that compress, encrypt, or decrypt data. + +*Note*: There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A `zlib` stream will produce output +that is either much smaller or much larger than its input. + +The `stream.Transform` class is extended to implement a [Transform][] stream. + +The `stream.Transform` class prototypically inherits from `stream.Duplex` and +implements its own versions of the `writable._write()` and `readable._read()` +methods. Custom Transform implementations *must* implement the +[`transform._transform()`][stream-_transform] method and *may* also implement +the [`transform._flush()`][stream-_flush] method. + +*Note*: Care must be taken when using Transform streams in that data written +to the stream can cause the Writable side of the stream to become paused if +the output on the Readable side is not consumed. + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. -### Readable +For example: ```js -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood +const Transform = require('stream').Transform; - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); +class MyTransform extends Transform { + constructor(options) { + super(options); } -}); +} ``` -### Transform +Or, when using pre-ES6 style constructors: ```js -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood +const Transform = require('stream').Transform; +const util = require('util'); - // generate output as many times as needed - // this.push(chunk); +function MyTransform(options) { + if (!(this instanceof MyTransform)) + return new MyTransform(options); + Transform.call(this, options); +} +util.inherits(MyTransform, Transform); +``` - // call when the current chunk is consumed - next(); - }, - flush: function(done) { - // sets this._flush under the hood +Or, using the Simplified Constructor approach: - // generate output as many times as needed - // this.push(chunk); +```js +const Transform = require('stream').Transform; - done(); +const myTransform = new Transform({ + transform(chunk, encoding, callback) { + // ... } }); ``` -### Writable +#### Events: 'finish' and 'end' -```js -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood +The [`'finish'`][] and [`'end'`][] events are from the `stream.Writable` +and `stream.Readable` classes, respectively. The `'finish'` event is emitted +after [`stream.end()`][stream-end] is called and all chunks have been processed +by [`stream._transform()`][stream-_transform]. The `'end'` event is emitted +after all data has been output, which occurs after the callback in +[`transform._flush()`][stream-_flush] has been called. - // An optional error can be passed as the first argument - next() - } -}); +#### transform.\_flush(callback) -// or +* `callback` {Function} A callback function (optionally with an error + argument) to be called when remaining data has been flushed. -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Readable +class methods only. - // An optional error can be passed as the first argument - next() - } -}); -``` +In some cases, a transform operation may need to emit an additional bit of +data at the end of the stream. For example, a `zlib` compression stream will +store an amount of internal state used to optimally compress the output. When +the stream ends, however, that additional data needs to be flushed so that the +compressed data will be complete. -## Streams: Under the Hood +Custom [Transform][] implementations *may* implement the `transform._flush()` +method. This will be called when there is no more written data to be consumed, +but before the [`'end'`][] event is emitted signaling the end of the +[Readable][] stream. - +Within the `transform._flush()` implementation, the `readable.push()` method +may be called zero or more times, as appropriate. The `callback` function must +be called when the flush operation is complete. -### Buffering +The `transform._flush()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. - +#### transform.\_transform(chunk, encoding, callback) -Both Writable and Readable streams will buffer data on an internal -object which can be retrieved from `_writableState.getBuffer()` or -`_readableState.buffer`, respectively. +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} A callback function (optionally with an error + argument and data) to be called after the supplied `chunk` has been + processed. -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Readable +class methods only. -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not -call [`stream.read()`][stream-read], then the data will sit in the internal -queue until it is consumed. +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. The `transform._transform()` +implementation handles the bytes being written, computes an output, then passes +that output off to the readable portion using the `readable.push()` method. + +The `transform.push()` method may be called zero or more times to generate +output from a single input chunk, depending on how much is to be output +as a result of the chunk. -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. +It is possible that no output is generated from any given chunk of input data. -The purpose of streams, especially with the [`stream.pipe()`][] method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. +The `callback` function must be called only when the current chunk is completely +consumed. The first argument passed to the `callback` must be an `Error` object +if an error occurred while processing the input or `null` otherwise. If a second +argument is passed to the `callback`, it will be forwarded on to the +`readable.push()` method. In other words the following are equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +The `transform._transform()` method is prefixed with an underscore because it +is internal to the class that defines it, and should never be called directly by +user programs. + +#### Class: stream.PassThrough + +The `stream.PassThrough` class is a trivial implementation of a [Transform][] +stream that simply passes the input bytes across to the output. Its purpose is +primarily for examples and testing, but there are some use cases where +`stream.PassThrough` is useful as a building block for novel sorts of streams. + +## Additional Notes + + ### Compatibility with Older Node.js Versions @@ -1538,26 +1874,26 @@ destinations of varying speed will not overwhelm the available memory. In versions of Node.js prior to v0.10, the Readable stream interface was simpler, but also less powerful and less useful. -* Rather than waiting for you to call the [`stream.read()`][stream-read] method, - [`'data'`][] events would start emitting immediately. If you needed to do - some I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. +* Rather than waiting for calls the [`stream.read()`][stream-read] method, + [`'data'`][] events would begin emitting immediately. Applications that + would need to perform some amount of work to decide how to handle data + were required to store read data into buffers so the data would not be lost. * The [`stream.pause()`][stream-pause] method was advisory, rather than - guaranteed. This meant that you still had to be prepared to receive - [`'data'`][] events even when the stream was in a paused state. - -In Node.js v0.10, the [Readable][] class was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a [`'data'`][] event handler is added, or -when the [`stream.resume()`][stream-resume] method is called. The effect is -that, even if you are not using the new [`stream.read()`][stream-read] method -and [`'readable'`][] event, you no longer have to worry about losing + guaranteed. This meant that it was still necessary to be prepared to receive + [`'data'`][] events *even when the stream was in a paused state*. + +In Node.js v0.10, the [Readable][] class was added. For backwards compatibility +with older Node.js programs, Readable streams switch into "flowing mode" when a +[`'data'`][] event handler is added, or when the +[`stream.resume()`][stream-resume] method is called. The effect is that, even +when not using the new [`stream.read()`][stream-read] method and +[`'readable'`][] event, it is no longer necessary to worry about losing [`'data'`][] chunks. -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: +While most applications will continue to function normally, this introduces an +edge case in the following conditions: -* No [`'data'`][] event handler is added. +* No [`'data'`][] event listener is added. * The [`stream.resume()`][stream-resume] method is never called. * The stream is not piped to any writable destination. @@ -1570,25 +1906,25 @@ net.createServer((socket) => { // we add an 'end' method, but never consume the data socket.on('end', () => { // It will never get here. - socket.end('I got your message (but didnt read it)\n'); + socket.end('The message was received but was not processed.\n'); }); }).listen(1337); ``` In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in Node.js v0.10 and beyond, -the socket will remain paused forever. +simply discarded. However, in Node.js v0.10 and beyond, the socket remains +paused forever. The workaround in this situation is to call the -[`stream.resume()`][stream-resume] method to start the flow of data: +[`stream.resume()`][stream-resume] method to begin the flow of data: ```js // Workaround net.createServer((socket) => { socket.on('end', () => { - socket.end('I got your message (but didnt read it)\n'); + socket.end('The message was received but was not processed.\n'); }); // start the flow of data, discarding it. @@ -1599,159 +1935,66 @@ net.createServer((socket) => { In addition to new Readable streams switching into flowing mode, pre-v0.10 style streams can be wrapped in a Readable class using the -[`stream.wrap()`][] method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to [`stream.read(size)`][stream-read], regardless of what the size -argument is. - -A Writable stream in object mode will always ignore the `encoding` -argument to [`stream.write(data, encoding)`][stream-write]. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from [`stream.read()`][stream-read] indicates that there is no more -data, and [`stream.push(null)`][stream-push] will signal the end of stream data -(`EOF`). +[`readable.wrap()`][`stream.wrap()`] method. -No streams in Node.js core are object mode streams. This pattern is only -used by userland streaming libraries. -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. +### `readable.read(0)` -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```js -const util = require('util'); -const StringDecoder = require('string_decoder').StringDecoder; -const Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the +There are some cases where it is necessary to trigger a refresh of the underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. +data. In such cases, it is possible to call `readable.read(0)`, which will +always return `null`. If the internal read buffer is below the `highWaterMark`, and the stream is not currently reading, then calling `stream.read(0)` will trigger a low-level [`stream._read()`][stream-_read] call. -There is almost never a need to do this. However, you will see some -cases in Node.js's internals where this is done, particularly in the +While most applications will almost never need to do this, there are +situations within Node.js where this is done, particularly in the Readable stream class internals. -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][stream-push], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. +### `readable.push('')` -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling [`stream.read(0)`][stream-read]. -In those cases, you *may* call `stream.push('')`. +Use of `readable.push('')` is not recommended. -So far, the only use case for this functionality is in the -[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. +Pushing a zero-byte string or `Buffer` to a stream that is not in object mode +has an interesting side effect. Because it *is* a call to +[`readable.push()`][stream-push], the call will end the reading process. +However, because the argument is an empty string, no data is added to the +readable buffer so there is nothing for a user to consume. [`'data'`]: #stream_event_data [`'drain'`]: #stream_event_drain [`'end'`]: #stream_event_end [`'finish'`]: #stream_event_finish [`'readable'`]: #stream_event_readable -[`buf.toString(encoding)`]: https://nodejs.org/docs/v6.1.0/api/buffer.html#buffer_buf_tostring_encoding_start_end -[`EventEmitter`]: https://nodejs.org/docs/v6.1.0/api/events.html#events_class_eventemitter -[`process.stderr`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stderr -[`process.stdin`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stdin -[`process.stdout`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stdout +[`buf.toString(encoding)`]: https://nodejs.org/docs/v6.3.1/api/buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: https://nodejs.org/docs/v6.3.1/api/events.html#events_class_eventemitter +[`process.stderr`]: https://nodejs.org/docs/v6.3.1/api/process.html#process_process_stderr +[`process.stdin`]: https://nodejs.org/docs/v6.3.1/api/process.html#process_process_stdin +[`process.stdout`]: https://nodejs.org/docs/v6.3.1/api/process.html#process_process_stdout [`stream.cork()`]: #stream_writable_cork [`stream.pipe()`]: #stream_readable_pipe_destination_options [`stream.uncork()`]: #stream_writable_uncork [`stream.unpipe()`]: #stream_readable_unpipe_destination [`stream.wrap()`]: #stream_readable_wrap_stream -[`tls.CryptoStream`]: https://nodejs.org/docs/v6.1.0/api/tls.html#tls_class_cryptostream -[`util.inherits()`]: https://nodejs.org/docs/v6.1.0/api/util.html#util_util_inherits_constructor_superconstructor +[`tls.CryptoStream`]: https://nodejs.org/docs/v6.3.1/api/tls.html#tls_class_cryptostream [API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[child process stdin]: https://nodejs.org/docs/v6.1.0/api/child_process.html#child_process_child_stdin -[child process stdout and stderr]: https://nodejs.org/docs/v6.1.0/api/child_process.html#child_process_child_stdout +[API for Stream Implementers]: #stream_api_for_stream_implementers +[child process stdin]: https://nodejs.org/docs/v6.3.1/api/child_process.html#child_process_child_stdin +[child process stdout and stderr]: https://nodejs.org/docs/v6.3.1/api/child_process.html#child_process_child_stdout [Compatibility]: #stream_compatibility_with_older_node_js_versions [crypto]: crypto.html [Duplex]: #stream_class_stream_duplex -[fs read streams]: https://nodejs.org/docs/v6.1.0/api/fs.html#fs_class_fs_readstream -[fs write streams]: https://nodejs.org/docs/v6.1.0/api/fs.html#fs_class_fs_writestream -[HTTP requests, on the client]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_clientrequest -[HTTP responses, on the server]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_serverresponse -[http-incoming-message]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_incomingmessage +[fs read streams]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_class_fs_writestream +[`fs.createReadStream()`]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_fs_createreadstream_path_options +[`fs.createWriteStream()`]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_fs_createwritestream_path_options +[`net.Socket`]: https://nodejs.org/docs/v6.3.1/api/net.html#net_class_net_socket +[`zlib.createDeflate()`]: https://nodejs.org/docs/v6.3.1/api/zlib.html#zlib_zlib_createdeflate_options +[HTTP requests, on the client]: https://nodejs.org/docs/v6.3.1/api/http.html#http_class_http_clientrequest +[HTTP responses, on the server]: https://nodejs.org/docs/v6.3.1/api/http.html#http_class_http_serverresponse +[http-incoming-message]: https://nodejs.org/docs/v6.3.1/api/http.html#http_class_http_incomingmessage [Object mode]: #stream_object_mode [Readable]: #stream_class_stream_readable [SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 @@ -1766,7 +2009,7 @@ horribly wrong. [stream-read]: #stream_readable_read_size [stream-resume]: #stream_readable_resume [stream-write]: #stream_writable_write_chunk_encoding_callback -[TCP sockets]: https://nodejs.org/docs/v6.1.0/api/net.html#net_class_net_socket +[TCP sockets]: https://nodejs.org/docs/v6.3.1/api/net.html#net_class_net_socket [Transform]: #stream_class_stream_transform [Writable]: #stream_class_stream_writable [zlib]: zlib.html diff --git a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index c141a99c26c638..83275f192e4077 100644 --- a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,3 +56,5 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section + + diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js index 79914fa684cbb1..208cc65f1cca99 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js @@ -51,21 +51,21 @@ if (debugUtil && debugUtil.debuglog) { } /**/ +var BufferList = require('./internal/streams/BufferList'); var StringDecoder; util.inherits(Readable, Stream); -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); - - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. This is here - // only because this code needs to continue to work with older versions - // of Node.js that do not include the prependListener() method. The goal - // is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + if (typeof emitter.prependListener === 'function') { + return emitter.prependListener(event, fn); + } else { + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + } } var Duplex; @@ -89,7 +89,10 @@ function ReadableState(options, stream) { // cast to ints. this.highWaterMark = ~ ~this.highWaterMark; - this.buffer = []; + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; @@ -252,7 +255,8 @@ function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { - // Get the next highest power of 2 + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; @@ -264,44 +268,34 @@ function computeNewHighWaterMark(n) { return n; } +// This function is designed to be inlinable, so please take care when making +// changes to the function body. function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } - - if (n <= 0) return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. + // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; } - - return n; + return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); + n = parseInt(n, 10); var state = this._readableState; var nOrig = n; - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger @@ -357,9 +351,7 @@ Readable.prototype.read = function (n) { if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); - } - - if (doRead) { + } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; @@ -368,28 +360,29 @@ Readable.prototype.read = function (n) { // call internal read method this._read(state.highWaterMark); state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); } - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; + } else { + state.length -= n; } - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } if (ret !== null) this.emit('data', ret); @@ -537,11 +530,17 @@ Readable.prototype.pipe = function (dest, pipeOpts) { if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; src.on('data', ondata); function ondata(chunk) { debug('ondata'); + increasedAwaitDrain = false; var ret = dest.write(chunk); - if (false === ret) { + if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. @@ -549,6 +548,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; + increasedAwaitDrain = true; } src.pause(); } @@ -662,18 +662,14 @@ Readable.prototype.unpipe = function (dest) { Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && !this._readableState.endEmitted) { + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; state.emittedReadable = false; - state.needReadable = true; if (!state.reading) { processNextTick(nReadingNextTick, this); } else if (state.length) { @@ -717,6 +713,7 @@ function resume_(stream, state) { } state.resumeScheduled = false; + state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); @@ -735,11 +732,7 @@ Readable.prototype.pause = function () { function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } + while (state.flowing && stream.read() !== null) {} } // wrap an old-style stream as the async data source. @@ -810,50 +803,101 @@ Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) return null; + // nothing buffered + if (state.length === 0) return null; - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var _buf = list[0]; - var cpy = Math.min(n - c, _buf.length); + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } - if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + return ret; +} - if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} - c += cpy; +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); } + break; } + ++c; } + list.length -= c; + return ret; +} +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = bufferShim.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; return ret; } diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 00000000000000..e4bfcf02dc8bbf --- /dev/null +++ b/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,64 @@ +'use strict'; + +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ + +module.exports = BufferList; + +function BufferList() { + this.head = null; + this.tail = null; + this.length = 0; +} + +BufferList.prototype.push = function (v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; +}; + +BufferList.prototype.unshift = function (v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; +}; + +BufferList.prototype.shift = function () { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; +}; + +BufferList.prototype.clear = function () { + this.head = this.tail = null; + this.length = 0; +}; + +BufferList.prototype.join = function (s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; +}; + +BufferList.prototype.concat = function (n) { + if (this.length === 0) return bufferShim.alloc(0); + if (this.length === 1) return this.head.data; + var ret = bufferShim.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + p.data.copy(ret, i); + i += p.data.length; + p = p.next; + } + return ret; +}; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile index 0ecc29c402c243..787d56e1e982e4 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile @@ -3,3 +3,4 @@ test: @node_modules/.bin/tape test.js .PHONY: test + diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js index f7f7bcd19fec56..e0c3444d85d5c7 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js @@ -17,3 +17,4 @@ test('is array', function(t){ t.end(); }); + diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json index 1932ad2ac7a3f8..6cdacd2f62da22 100644 --- a/deps/npm/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/readable-stream/package.json @@ -2,26 +2,25 @@ "_args": [ [ { - "raw": "readable-stream@latest", + "raw": "readable-stream@2.1.5", "scope": null, "escapedName": "readable-stream", "name": "readable-stream", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "2.1.5", + "spec": "2.1.5", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "readable-stream@latest", - "_id": "readable-stream@2.1.4", + "_from": "readable-stream@2.1.5", + "_id": "readable-stream@2.1.5", "_inCache": true, - "_installable": true, "_location": "/readable-stream", - "_nodeVersion": "5.11.0", + "_nodeVersion": "5.12.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/readable-stream-2.1.4.tgz_1463679605032_0.6917394688352942" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.1.5.tgz_1471463532993_0.15824943827465177" }, "_npmUser": { "name": "cwmma", @@ -30,29 +29,30 @@ "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { - "raw": "readable-stream@latest", + "raw": "readable-stream@2.1.5", "scope": null, "escapedName": "readable-stream", "name": "readable-stream", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "2.1.5", + "spec": "2.1.5", + "type": "version" }, "_requiredBy": [ "#USER", "/", "/fs-write-stream-atomic", "/node-gyp/npmlog/are-we-there-yet", + "/npm-registry-client/npmlog/are-we-there-yet", "/npmlog/are-we-there-yet", "/sha", "/tap", "/tap/tap-parser" ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz", - "_shasum": "70b9791c6fcb8480db44bd155a0f6bb58f172468", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", + "_shasum": "66fa8b720e1438b364681f2ad1a63c618448c9d0", "_shrinkwrap": null, - "_spec": "readable-stream@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "readable-stream@2.1.5", + "_where": "/Users/zkat/Documents/code/npm", "browser": { "util": false }, @@ -71,18 +71,18 @@ "description": "Streams3, a user-land copy of the stream library from Node.js", "devDependencies": { "assert": "~1.4.0", + "babel-polyfill": "^6.9.1", "nyc": "^6.4.0", "tap": "~0.7.1", "tape": "~4.5.1", - "zuul": "~3.9.0", - "zuul-ngrok": "^4.0.0" + "zuul": "~3.10.0" }, "directories": {}, "dist": { - "shasum": "70b9791c6fcb8480db44bd155a0f6bb58f172468", - "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" + "shasum": "66fa8b720e1438b364681f2ad1a63c618448c9d0", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz" }, - "gitHead": "7752832fba237929388dea6c96911a0a6379abfc", + "gitHead": "758c8b3845af855fde736b6a7f58a15fba00d1e7", "homepage": "https://github.com/nodejs/readable-stream#readme", "keywords": [ "readable", @@ -122,12 +122,12 @@ "url": "git://github.com/nodejs/readable-stream.git" }, "scripts": { - "browser": "npm run write-zuul && zuul -- test/browser.js", + "browser": "npm run write-zuul && zuul --browser-retries 2 -- test/browser.js", "cover": "nyc npm test", - "local": "zuul --local -- test/browser.js", + "local": "zuul --local 3000 --no-coverage -- test/browser.js", "report": "nyc report --reporter=lcov", "test": "tap test/parallel/*.js test/ours/*.js", - "write-zuul": "printf \"ui: tape\ntunnel: ngrok\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" }, - "version": "2.1.4" + "version": "2.1.5" } diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml index e5d9bde26263c5..6f2d753b615f83 100644 --- a/deps/npm/node_modules/request/.travis.yml +++ b/deps/npm/node_modules/request/.travis.yml @@ -1,13 +1,15 @@ + language: node_js node_js: - node + - 4 - 0.12 - 0.10 after_script: - npm run test-cov - - cat ./coverage/lcov.info | codecov + - codecov - cat ./coverage/lcov.info | coveralls webhooks: diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index ce6826f2f65228..2b5d17765a8c1d 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,5 +1,24 @@ ## Change Log +### v2.74.0 (2016/07/22) +- [#2295](https://github.com/request/request/pull/2295) Update tough-cookie to 2.3.0 (@stash-sfdc) +- [#2280](https://github.com/request/request/pull/2280) Update karma-tap to version 2.0.1 🚀 (@greenkeeperio-bot) + +### v2.73.0 (2016/07/09) +- [#2240](https://github.com/request/request/pull/2240) Remove connectionErrorHandler to fix #1903 (@zarenner) +- [#2251](https://github.com/request/request/pull/2251) tape@4.6.0 breaks build 🚨 (@greenkeeperio-bot) +- [#2225](https://github.com/request/request/pull/2225) Update docs (@ArtskydJ) +- [#2203](https://github.com/request/request/pull/2203) Update browserify to version 13.0.1 🚀 (@greenkeeperio-bot) +- [#2275](https://github.com/request/request/pull/2275) Update karma to version 1.1.1 🚀 (@greenkeeperio-bot) +- [#2204](https://github.com/request/request/pull/2204) Add codecov.yml and disable PR comments (@simov) +- [#2212](https://github.com/request/request/pull/2212) Fix link to http.IncomingMessage documentation (@nazieb) +- [#2208](https://github.com/request/request/pull/2208) Update to form-data RC4 and pass null values to it (@simov) +- [#2207](https://github.com/request/request/pull/2207) Move aws4 require statement to the top (@simov) +- [#2199](https://github.com/request/request/pull/2199) Update karma-coverage to version 1.0.0 🚀 (@greenkeeperio-bot) +- [#2206](https://github.com/request/request/pull/2206) Update qs to version 6.2.0 🚀 (@greenkeeperio-bot) +- [#2205](https://github.com/request/request/pull/2205) Use server-destory to close hanging sockets in tests (@simov) +- [#2200](https://github.com/request/request/pull/2200) Update karma-cli to version 1.0.0 🚀 (@greenkeeperio-bot) + ### v2.72.0 (2016/04/17) - [#2176](https://github.com/request/request/pull/2176) Do not try to pipe Gzip responses with no body (@simov) - [#2175](https://github.com/request/request/pull/2175) Add 'delete' alias for the 'del' API method (@simov, @MuhanZou) @@ -53,7 +72,7 @@ - [#1902](https://github.com/request/request/pull/1902) node-uuid@1.4.7 breaks build 🚨 (@greenkeeperio-bot) - [#1894](https://github.com/request/request/pull/1894) Fix tunneling after redirection from https (Original: #1881) (@simov, @falms) - [#1893](https://github.com/request/request/pull/1893) Update eslint to version 1.9.0 🚀 (@greenkeeperio-bot) -- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @Bloutiouf) +- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @KoltesDigital) - [#1876](https://github.com/request/request/pull/1876) Implement loose matching for har mime types (@simov) - [#1875](https://github.com/request/request/pull/1875) Update bluebird to version 3.0.2 🚀 (@simov, @greenkeeperio-bot) - [#1871](https://github.com/request/request/pull/1871) Update browserify to version 12.0.1 🚀 (@greenkeeperio-bot) @@ -64,7 +83,7 @@ - [#1857](https://github.com/request/request/pull/1857) Fix Referer header to point to the original host name (@simov) - [#1850](https://github.com/request/request/pull/1850) Update karma-coverage to version 0.5.3 🚀 (@greenkeeperio-bot) - [#1847](https://github.com/request/request/pull/1847) Use node's latest version when building (@simov) -- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@Bloutiouf) +- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@KoltesDigital) - [#1820](https://github.com/request/request/pull/1820) Set href as request.js uses it (@mgenereu) - [#1840](https://github.com/request/request/pull/1840) Update http-signature to version 1.0.2 🚀 (@greenkeeperio-bot) - [#1845](https://github.com/request/request/pull/1845) Update istanbul to version 0.4.0 🚀 (@greenkeeperio-bot) @@ -114,8 +133,7 @@ - [#1687](https://github.com/request/request/pull/1687) Fix caseless bug - content-type not being set for multipart/form-data (@simov, @garymathews) ### v2.59.0 (2015/07/20) -- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. - Forever option defaults to using http(s).Agent in node 0.12+ (@simov) +- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. Forever option defaults to using http(s).Agent in node 0.12+ (@simov) - [#1679](https://github.com/request/request/pull/1679) Fix - do not remove OAuth param when using OAuth realm (@simov, @jhalickman) - [#1668](https://github.com/request/request/pull/1668) updated dependencies (@deamme) - [#1656](https://github.com/request/request/pull/1656) Fix form method (@simov) @@ -182,7 +200,7 @@ - [#1460](https://github.com/request/request/pull/1460) localAddress or proxy config is lost when redirecting (@simov, @0x4139) - [#1453](https://github.com/request/request/pull/1453) Test on Node.js 0.12 and io.js with allowed failures (@nicolasmccurdy, @demohi) - [#1426](https://github.com/request/request/pull/1426) Fixing tests to pass on io.js and node 0.12 (only test-https.js stiff failing) (@mikeal) -- [#1446](https://github.com/request/request/pull/1446) Missing HTTP referer header with redirects Fixes #1038 (@simov, @guimonz) +- [#1446](https://github.com/request/request/pull/1446) Missing HTTP referer header with redirects Fixes #1038 (@simov, @guimon) - [#1428](https://github.com/request/request/pull/1428) Deprecate Node v0.8.x (@nylen) - [#1436](https://github.com/request/request/pull/1436) Add ability to set a requester without setting default options (@tikotzky) - [#1435](https://github.com/request/request/pull/1435) dry up verb methods (@sethpollack) @@ -310,7 +328,7 @@ - [#1131](https://github.com/request/request/pull/1131) Update pool documentation (@FredKSchott) - [#1143](https://github.com/request/request/pull/1143) Rewrite all tests to use tape (@nylen) - [#1137](https://github.com/request/request/pull/1137) Add ability to specifiy querystring lib in options. (@jgrund) -- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@cappslock) +- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@slimelabs) - [#1134](https://github.com/request/request/pull/1134) Fix multiple redirects and `self.followRedirect` (@blakeembrey) - [#1130](https://github.com/request/request/pull/1130) documentation fix: add note about npm test for contributing (@FredKSchott) - [#1120](https://github.com/request/request/pull/1120) Support/refactor request setup tunnel (@seanstrom) @@ -479,28 +497,20 @@ - [#596](https://github.com/request/request/pull/596) Global agent is being used when pool is specified (@Cauldrath) - [#594](https://github.com/request/request/pull/594) Emit complete event when there is no callback (@RomainLK) - [#601](https://github.com/request/request/pull/601) Fixed a small typo (@michalstanko) - -### v2.23.0 (2013/07/23) - [#589](https://github.com/request/request/pull/589) Prevent setting headers after they are sent (@geek) - [#587](https://github.com/request/request/pull/587) Global cookie jar disabled by default (@threepointone) - -### v2.22.0 (2013/07/05) - [#544](https://github.com/request/request/pull/544) Update http-signature version. (@davidlehn) - [#581](https://github.com/request/request/pull/581) Fix spelling of "ignoring." (@bigeasy) - [#568](https://github.com/request/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette) - [#564](https://github.com/request/request/pull/564) Fix redirections (@criloz) - [#541](https://github.com/request/request/pull/541) The exported request function doesn't have an auth method (@tschaub) - [#542](https://github.com/request/request/pull/542) Expose Request class (@regality) - -### v2.21.0 (2013/04/30) - [#536](https://github.com/request/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando) - [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva) - [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath) - [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) - [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421) - [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka) - -### v2.20.0 (2013/04/22) - [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421) - [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421) - [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun) diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index cf9072a21a229a..81ecac50999a34 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -67,7 +67,7 @@ Request can also `pipe` to itself. When doing so, `content-type` and `content-le request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) ``` -Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage). +Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage). ```js request @@ -601,7 +601,6 @@ var options = { key: fs.readFileSync(keyFile), passphrase: 'password', ca: fs.readFileSync(caFile) - } }; request.get(options); @@ -819,7 +818,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]). The callback argument gets 3 arguments: 1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object) -2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object +2. An [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) object 3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied) [back to top](#table-of-contents) diff --git a/deps/npm/node_modules/request/codecov.yml b/deps/npm/node_modules/request/codecov.yml new file mode 100644 index 00000000000000..acd3f33ceb5d2b --- /dev/null +++ b/deps/npm/node_modules/request/codecov.yml @@ -0,0 +1,2 @@ + +comment: false diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js index 54766a13518173..ac72093083975c 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js @@ -27,7 +27,7 @@ var crypto = require('crypto') * Valid keys. */ -var keys = +var keys = [ 'acl' , 'location' , 'logging' @@ -66,7 +66,7 @@ module.exports.authorization = authorization * @param {Object} options * @return {String} * @api private - */ + */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') @@ -75,8 +75,8 @@ function hmacSha1 (options) { module.exports.hmacSha1 = hmacSha1 /** - * Create a base64 sha1 HMAC for `options`. - * + * Create a base64 sha1 HMAC for `options`. + * * @param {Object} options * @return {String} * @api private @@ -89,10 +89,10 @@ function sign (options) { module.exports.sign = sign /** - * Create a base64 sha1 HMAC for `options`. + * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs - * + * * @param {Object} options * @return {String} * @api private @@ -108,7 +108,7 @@ module.exports.signQuery= signQuery * Return a string for sign() with the given `options`. * * Spec: - * + * * \n * \n * \n @@ -124,7 +124,7 @@ module.exports.signQuery= signQuery function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' - var r = + var r = [ options.verb , options.md5 , options.contentType @@ -140,7 +140,7 @@ module.exports.queryStringToSign = stringToSign * for S3 presigned URLs * * Spec: - * + * * \n * * diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json index 0fe40d0b6e88b3..9ece6179c9d282 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json @@ -1,49 +1,82 @@ { + "_args": [ + [ + { + "raw": "aws-sign2@~0.6.0", + "scope": null, + "escapedName": "aws-sign2", + "name": "aws-sign2", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "aws-sign2@>=0.6.0 <0.7.0", + "_id": "aws-sign2@0.6.0", + "_inCache": true, + "_installable": true, + "_location": "/request/aws-sign2", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "raw": "aws-sign2@~0.6.0", + "scope": null, + "escapedName": "aws-sign2", + "name": "aws-sign2", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "_shrinkwrap": null, + "_spec": "aws-sign2@~0.6.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, - "name": "aws-sign2", - "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.6.0", - "repository": { - "url": "git+https://github.com/mikeal/aws-sign.git" + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" }, - "license": "Apache-2.0", - "main": "index.js", "dependencies": {}, + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", "devDependencies": {}, - "optionalDependencies": {}, + "directories": {}, + "dist": { + "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "tarball": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, "engines": { "node": "*" }, "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", - "bugs": { - "url": "https://github.com/mikeal/aws-sign/issues" - }, "homepage": "https://github.com/mikeal/aws-sign#readme", - "_id": "aws-sign2@0.6.0", - "scripts": {}, - "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", - "_from": "aws-sign2@>=0.6.0 <0.7.0", - "_npmVersion": "2.14.4", - "_nodeVersion": "4.1.2", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, + "license": "Apache-2.0", + "main": "index.js", "maintainers": [ { "name": "mikeal", "email": "mikeal.rogers@gmail.com" } ], - "dist": { - "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", - "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + "name": "aws-sign2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": {}, + "version": "0.6.0" } diff --git a/deps/npm/node_modules/request/node_modules/aws4/README.md b/deps/npm/node_modules/request/node_modules/aws4/README.md index ec663e9237ec5e..6c55da80528c74 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/README.md +++ b/deps/npm/node_modules/request/node_modules/aws4/README.md @@ -511,3 +511,4 @@ committed and subsequently extracted this code. Also thanks to the [official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving me a start on implementing the v4 signature. + diff --git a/deps/npm/node_modules/request/node_modules/aws4/aws4.js b/deps/npm/node_modules/request/node_modules/aws4/aws4.js index 71e08bbc17c9d1..cbe5dc90494efe 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/aws4.js +++ b/deps/npm/node_modules/request/node_modules/aws4/aws4.js @@ -2,7 +2,7 @@ var aws4 = exports, url = require('url'), querystring = require('querystring'), crypto = require('crypto'), - lru = require('lru-cache'), + lru = require('./lru'), credentialsCache = lru(1000) // http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html diff --git a/deps/npm/node_modules/request/node_modules/aws4/lru.js b/deps/npm/node_modules/request/node_modules/aws4/lru.js new file mode 100644 index 00000000000000..333f66a4436ec4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md deleted file mode 100644 index 1bc7b03f3ea731..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n, key) { return n * 2 + key.length } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -// non-string keys ARE fully supported -var someObject = {} -cache.set(someObject, 'a value') -cache.set('[object Object]', 'a different value') -assert.equal(cache.get(someObject), 'a value') - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n, key){return n.length}`. The default is - `function(){return 1}`, which is fine if you want to store `max` - like-sized things. They item is passed as the first argument, and - the key is passed as the second argumnet. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value, maxAge)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. `maxAge` is optional and overrides the - cache `maxAge` option if provided. - - If the key is not found, `get()` will return `undefined`. - - The key and val can be any value. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `rforEach(function(value,key,cache), [thisp])` - - The same as `cache.forEach(...)` but items are iterated over in - reverse order. (ie, less recently used items are iterated over - first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. - -* `length` - - Return total length of objects in cache taking into account - `length` options function. - -* `itemCount` - - Return total quantity of objects currently in cache. Note, that - `stale` (see options) items are returned as part of this item - count. - -* `dump()` - - Return an array of the cache entries ready for serialization and usage - with 'destinationCache.load(arr)`. - -* `load(cacheEntriesArray)` - - Loads another cache entries array, obtained with `sourceCache.dump()`, - into the cache. The destination cache is reset before loading new entries - -* `prune()` - - Manually iterates over the entire cache proactively pruning old entries diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index e98ef78a53dc79..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,469 +0,0 @@ -module.exports = LRUCache - -// This will be a proper iterable 'Map' in engines that support it, -// or a fakey-fake PseudoMap in older versions. -var Map = require('pseudomap') -var util = require('util') - -// A linked list to keep track of recently-used-ness -var Yallist = require('yallist') - -// use symbols if possible, otherwise just _props -var symbols = {} -var hasSymbol = typeof Symbol === 'function' -var makeSymbol -/* istanbul ignore if */ -if (hasSymbol) { - makeSymbol = function (key) { - return Symbol.for(key) - } -} else { - makeSymbol = function (key) { - return '_' + key - } -} - -function priv (obj, key, val) { - var sym - if (symbols[key]) { - sym = symbols[key] - } else { - sym = makeSymbol(key) - symbols[key] = sym - } - if (arguments.length === 2) { - return obj[sym] - } else { - obj[sym] = val - return val - } -} - -function naiveLength () { return 1 } - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -function LRUCache (options) { - if (!(this instanceof LRUCache)) { - return new LRUCache(options) - } - - if (typeof options === 'number') { - options = { max: options } - } - - if (!options) { - options = {} - } - - var max = priv(this, 'max', options.max) - // Kind of weird to have a default max of Infinity, but oh well. - if (!max || - !(typeof max === 'number') || - max <= 0) { - priv(this, 'max', Infinity) - } - - var lc = options.length || naiveLength - if (typeof lc !== 'function') { - lc = naiveLength - } - priv(this, 'lengthCalculator', lc) - - priv(this, 'allowStale', options.stale || false) - priv(this, 'maxAge', options.maxAge || 0) - priv(this, 'dispose', options.dispose) - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, 'max', { - set: function (mL) { - if (!mL || !(typeof mL === 'number') || mL <= 0) { - mL = Infinity - } - priv(this, 'max', mL) - trim(this) - }, - get: function () { - return priv(this, 'max') - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'allowStale', { - set: function (allowStale) { - priv(this, 'allowStale', !!allowStale) - }, - get: function () { - return priv(this, 'allowStale') - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'maxAge', { - set: function (mA) { - if (!mA || !(typeof mA === 'number') || mA < 0) { - mA = 0 - } - priv(this, 'maxAge', mA) - trim(this) - }, - get: function () { - return priv(this, 'maxAge') - }, - enumerable: true -}) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { - set: function (lC) { - if (typeof lC !== 'function') { - lC = naiveLength - } - if (lC !== priv(this, 'lengthCalculator')) { - priv(this, 'lengthCalculator', lC) - priv(this, 'length', 0) - priv(this, 'lruList').forEach(function (hit) { - hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key) - priv(this, 'length', priv(this, 'length') + hit.length) - }, this) - } - trim(this) - }, - get: function () { return priv(this, 'lengthCalculator') }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'length', { - get: function () { return priv(this, 'length') }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'itemCount', { - get: function () { return priv(this, 'lruList').length }, - enumerable: true -}) - -LRUCache.prototype.rforEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = priv(this, 'lruList').tail; walker !== null;) { - var prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev - } -} - -function forEachStep (self, fn, node, thisp) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!priv(self, 'allowStale')) { - hit = undefined - } - } - if (hit) { - fn.call(thisp, hit.value, hit.key, self) - } -} - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = priv(this, 'lruList').head; walker !== null;) { - var next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next - } -} - -LRUCache.prototype.keys = function () { - return priv(this, 'lruList').toArray().map(function (k) { - return k.key - }, this) -} - -LRUCache.prototype.values = function () { - return priv(this, 'lruList').toArray().map(function (k) { - return k.value - }, this) -} - -LRUCache.prototype.reset = function () { - if (priv(this, 'dispose') && - priv(this, 'lruList') && - priv(this, 'lruList').length) { - priv(this, 'lruList').forEach(function (hit) { - priv(this, 'dispose').call(this, hit.key, hit.value) - }, this) - } - - priv(this, 'cache', new Map()) // hash of items by key - priv(this, 'lruList', new Yallist()) // list of items in order of use recency - priv(this, 'length', 0) // length of items in the list -} - -LRUCache.prototype.dump = function () { - return priv(this, 'lruList').map(function (hit) { - if (!isStale(this, hit)) { - return { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - } - } - }, this).toArray().filter(function (h) { - return h - }) -} - -LRUCache.prototype.dumpLru = function () { - return priv(this, 'lruList') -} - -LRUCache.prototype.inspect = function (n, opts) { - var str = 'LRUCache {' - var extras = false - - var as = priv(this, 'allowStale') - if (as) { - str += '\n allowStale: true' - extras = true - } - - var max = priv(this, 'max') - if (max && max !== Infinity) { - if (extras) { - str += ',' - } - str += '\n max: ' + util.inspect(max, opts) - extras = true - } - - var maxAge = priv(this, 'maxAge') - if (maxAge) { - if (extras) { - str += ',' - } - str += '\n maxAge: ' + util.inspect(maxAge, opts) - extras = true - } - - var lc = priv(this, 'lengthCalculator') - if (lc && lc !== naiveLength) { - if (extras) { - str += ',' - } - str += '\n length: ' + util.inspect(priv(this, 'length'), opts) - extras = true - } - - var didFirst = false - priv(this, 'lruList').forEach(function (item) { - if (didFirst) { - str += ',\n ' - } else { - if (extras) { - str += ',\n' - } - didFirst = true - str += '\n ' - } - var key = util.inspect(item.key).split('\n').join('\n ') - var val = { value: item.value } - if (item.maxAge !== maxAge) { - val.maxAge = item.maxAge - } - if (lc !== naiveLength) { - val.length = item.length - } - if (isStale(this, item)) { - val.stale = true - } - - val = util.inspect(val, opts).split('\n').join('\n ') - str += key + ' => ' + val - }) - - if (didFirst || extras) { - str += '\n' - } - str += '}' - - return str -} - -LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || priv(this, 'maxAge') - - var now = maxAge ? Date.now() : 0 - var len = priv(this, 'lengthCalculator').call(this, value, key) - - if (priv(this, 'cache').has(key)) { - if (len > priv(this, 'max')) { - del(this, priv(this, 'cache').get(key)) - return false - } - - var node = priv(this, 'cache').get(key) - var item = node.value - - // dispose of the old one before overwriting - if (priv(this, 'dispose')) { - priv(this, 'dispose').call(this, key, item.value) - } - - item.now = now - item.maxAge = maxAge - item.value = value - priv(this, 'length', priv(this, 'length') + (len - item.length)) - item.length = len - this.get(key) - trim(this) - return true - } - - var hit = new Entry(key, value, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > priv(this, 'max')) { - if (priv(this, 'dispose')) { - priv(this, 'dispose').call(this, key, value) - } - return false - } - - priv(this, 'length', priv(this, 'length') + hit.length) - priv(this, 'lruList').unshift(hit) - priv(this, 'cache').set(key, priv(this, 'lruList').head) - trim(this) - return true -} - -LRUCache.prototype.has = function (key) { - if (!priv(this, 'cache').has(key)) return false - var hit = priv(this, 'cache').get(key).value - if (isStale(this, hit)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var node = priv(this, 'lruList').tail - if (!node) return null - del(this, node) - return node.value -} - -LRUCache.prototype.del = function (key) { - del(this, priv(this, 'cache').get(key)) -} - -LRUCache.prototype.load = function (arr) { - // reset the cache - this.reset() - - var now = Date.now() - // A previous serialized cache has the most recent items first - for (var l = arr.length - 1; l >= 0; l--) { - var hit = arr[l] - var expiresAt = hit.e || 0 - if (expiresAt === 0) { - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - } else { - var maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) - } - } - } -} - -LRUCache.prototype.prune = function () { - var self = this - priv(this, 'cache').forEach(function (value, key) { - get(self, key, false) - }) -} - -function get (self, key, doUse) { - var node = priv(self, 'cache').get(key) - if (node) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!priv(self, 'allowStale')) hit = undefined - } else { - if (doUse) { - priv(self, 'lruList').unshiftNode(node) - } - } - if (hit) hit = hit.value - } - return hit -} - -function isStale (self, hit) { - if (!hit || (!hit.maxAge && !priv(self, 'maxAge'))) { - return false - } - var stale = false - var diff = Date.now() - hit.now - if (hit.maxAge) { - stale = diff > hit.maxAge - } else { - stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge')) - } - return stale -} - -function trim (self) { - if (priv(self, 'length') > priv(self, 'max')) { - for (var walker = priv(self, 'lruList').tail; - priv(self, 'length') > priv(self, 'max') && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - var prev = walker.prev - del(self, walker) - walker = prev - } - } -} - -function del (self, node) { - if (node) { - var hit = node.value - if (priv(self, 'dispose')) { - priv(self, 'dispose').call(this, hit.key, hit.value) - } - priv(self, 'length', priv(self, 'length') - hit.length) - priv(self, 'cache').delete(hit.key) - priv(self, 'lruList').removeNode(node) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md deleted file mode 100644 index 778bf01dfaaf9f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# pseudomap - -A thing that is a lot like ES6 `Map`, but without iterators, for use -in environments where `for..of` syntax and `Map` are not available. - -If you need iterators, or just in general a more faithful polyfill to -ES6 Maps, check out [es6-map](http://npm.im/es6-map). - -If you are in an environment where `Map` is supported, then that will -be returned instead, unless `process.env.TEST_PSEUDOMAP` is set. - -You can use any value as keys, and any value as data. Setting again -with the identical key will overwrite the previous value. - -Internally, data is stored on an `Object.create(null)` style object. -The key is coerced to a string to generate the key on the internal -data-bag object. The original key used is stored along with the data. - -In the event of a stringified-key collision, a new key is generated by -appending an increasing number to the stringified-key until finding -either the intended key or an empty spot. - -Note that because object traversal order of plain objects is not -guaranteed to be identical to insertion order, the insertion order -guarantee of `Map.prototype.forEach` is not guaranteed in this -implementation. However, in all versions of Node.js and V8 where this -module works, `forEach` does traverse data in insertion order. - -## API - -Most of the [Map -API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), -with the following exceptions: - -1. A `Map` object is not an iterator. -2. `values`, `keys`, and `entries` methods are not implemented, - because they return iterators. -3. The argument to the constructor can be an Array of `[key, value]` - pairs, or a `Map` or `PseudoMap` object. But, since iterators - aren't used, passing any plain-old iterator won't initialize the - map properly. - -## USAGE - -Use just like a regular ES6 Map. - -```javascript -var PseudoMap = require('pseudomap') - -// optionally provide a pseudomap, or an array of [key,value] pairs -// as the argument to initialize the map with -var myMap = new PseudoMap() - -myMap.set(1, 'number 1') -myMap.set('1', 'string 1') -var akey = {} -var bkey = {} -myMap.set(akey, { some: 'data' }) -myMap.set(bkey, { some: 'other data' }) -``` diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js deleted file mode 100644 index 7db15994612fd9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js +++ /dev/null @@ -1,9 +0,0 @@ -if (process.env.npm_package_name === 'pseudomap' && - process.env.npm_lifecycle_script === 'test') - process.env.TEST_PSEUDOMAP = 'true' - -if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { - module.exports = Map -} else { - module.exports = require('./pseudomap') -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json deleted file mode 100644 index 8e1129b8d3bd5f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_args": [ - [ - "pseudomap@^1.0.1", - "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache" - ] - ], - "_from": "pseudomap@>=1.0.1 <2.0.0", - "_id": "pseudomap@1.0.2", - "_inCache": true, - "_installable": true, - "_location": "/request/aws4/lru-cache/pseudomap", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "name": "pseudomap", - "raw": "pseudomap@^1.0.1", - "rawSpec": "^1.0.1", - "scope": null, - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/aws4/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "_shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", - "_shrinkwrap": null, - "_spec": "pseudomap@^1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/pseudomap/issues" - }, - "dependencies": {}, - "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.", - "devDependencies": { - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", - "tarball": "http://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" - }, - "gitHead": "b6dc728207a0321ede6479e34506d3e0e13a940b", - "homepage": "https://github.com/isaacs/pseudomap#readme", - "license": "ISC", - "main": "map.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "pseudomap", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/pseudomap.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js deleted file mode 100644 index 25a21d829e8b3f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js +++ /dev/null @@ -1,113 +0,0 @@ -var hasOwnProperty = Object.prototype.hasOwnProperty - -module.exports = PseudoMap - -function PseudoMap (set) { - if (!(this instanceof PseudoMap)) // whyyyyyyy - throw new TypeError("Constructor PseudoMap requires 'new'") - - this.clear() - - if (set) { - if ((set instanceof PseudoMap) || - (typeof Map === 'function' && set instanceof Map)) - set.forEach(function (value, key) { - this.set(key, value) - }, this) - else if (Array.isArray(set)) - set.forEach(function (kv) { - this.set(kv[0], kv[1]) - }, this) - else - throw new TypeError('invalid argument') - } -} - -PseudoMap.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - Object.keys(this._data).forEach(function (k) { - if (k !== 'size') - fn.call(thisp, this._data[k].value, this._data[k].key) - }, this) -} - -PseudoMap.prototype.has = function (k) { - return !!find(this._data, k) -} - -PseudoMap.prototype.get = function (k) { - var res = find(this._data, k) - return res && res.value -} - -PseudoMap.prototype.set = function (k, v) { - set(this._data, k, v) -} - -PseudoMap.prototype.delete = function (k) { - var res = find(this._data, k) - if (res) { - delete this._data[res._index] - this._data.size-- - } -} - -PseudoMap.prototype.clear = function () { - var data = Object.create(null) - data.size = 0 - - Object.defineProperty(this, '_data', { - value: data, - enumerable: false, - configurable: true, - writable: false - }) -} - -Object.defineProperty(PseudoMap.prototype, 'size', { - get: function () { - return this._data.size - }, - set: function (n) {}, - enumerable: true, - configurable: true -}) - -PseudoMap.prototype.values = -PseudoMap.prototype.keys = -PseudoMap.prototype.entries = function () { - throw new Error('iterators are not implemented in this version') -} - -// Either identical, or both NaN -function same (a, b) { - return a === b || a !== a && b !== b -} - -function Entry (k, v, i) { - this.key = k - this.value = v - this._index = i -} - -function find (data, k) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) - return data[key] - } -} - -function set (data, k, v) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) { - data[key].value = v - return - } - } - data.size++ - data[key] = new Entry(k, v, key) -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js deleted file mode 100644 index 4378e4541e9a14..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js +++ /dev/null @@ -1,86 +0,0 @@ -var t = require('tap') - -process.env.TEST_PSEUDOMAP = 'true' - -var PM = require('../') -runTests(PM) - -// if possible, verify that Map also behaves the same way -if (typeof Map === 'function') - runTests(Map) - - -function runTests (Map) { - t.throws(Map) - - var m = new Map() - - t.equal(m.size, 0) - - m.set(1, '1 string') - t.equal(m.get(1), '1 string') - t.equal(m.size, 1) - m.size = 1000 - t.equal(m.size, 1) - m.size = 0 - t.equal(m.size, 1) - - m = new Map([[1, 'number 1'], ['1', 'string 1']]) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - m = new Map(m) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - var akey = {} - var bkey = {} - m.set(akey, { some: 'data' }) - m.set(bkey, { some: 'other data' }) - t.same(m.get(akey), { some: 'data' }) - t.same(m.get(bkey), { some: 'other data' }) - t.equal(m.size, 4) - - var x = /x/ - var y = /x/ - m.set(x, 'x regex') - m.set(y, 'y regex') - t.equal(m.get(x), 'x regex') - m.set(x, 'x again') - t.equal(m.get(x), 'x again') - t.equal(m.size, 6) - - m.set(NaN, 'not a number') - t.equal(m.get(NaN), 'not a number') - m.set(NaN, 'it is a ' + typeof NaN) - t.equal(m.get(NaN), 'it is a number') - m.set('NaN', 'stringie nan') - t.equal(m.get(NaN), 'it is a number') - t.equal(m.get('NaN'), 'stringie nan') - t.equal(m.size, 8) - - m.delete(NaN) - t.equal(m.get(NaN), undefined) - t.equal(m.size, 7) - - var expect = [ - { value: 'number 1', key: 1 }, - { value: 'string 1', key: '1' }, - { value: { some: 'data' }, key: {} }, - { value: { some: 'other data' }, key: {} }, - { value: 'x again', key: /x/ }, - { value: 'y regex', key: /x/ }, - { value: 'stringie nan', key: 'NaN' } - ] - var actual = [] - - m.forEach(function (value, key) { - actual.push({ value: value, key: key }) - }) - t.same(actual, expect) - - m.clear() - t.equal(m.size, 0) -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore deleted file mode 100644 index 534108e3f481cf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -coverage/ -.nyc_output/ -nyc_output/ diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml deleted file mode 100644 index 9c1a7b6ccd2c9e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -sudo: false -language: node_js -node_js: - - '0.10' - - '0.12' - - '4' - - '5' diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md deleted file mode 100644 index 5f51e6f1e53405..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -1. The whole API is public. No underscore-prefixed pretend-private - things or hidden Object.create magic mumbo jumbo here. Plain old - objects that are created from constructors. -2. 100% test coverage must be maintained. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md deleted file mode 100644 index f5861018696688..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# yallist - -Yet Another Linked List - -There are many doubly-linked list implementations like it, but this -one is mine. - -For when an array would be too big, and a Map can't be iterated in -reverse order. - - -[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) - -## basic usage - -```javascript -var yallist = require('yallist') -var myList = yallist.create([1, 2, 3]) -myList.push('foo') -myList.unshift('bar') -// of course pop() and shift() are there, too -console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] -myList.forEach(function (k) { - // walk the list head to tail -}) -myList.forEachReverse(function (k, index, list) { - // walk the list tail to head -}) -var myDoubledList = myList.map(function (k) { - return k + k -}) -// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] -// mapReverse is also a thing -var myDoubledListReverse = myList.mapReverse(function (k) { - return k + k -}) // ['foofoo', 6, 4, 2, 'barbar'] - -var reduced = myList.reduce(function (set, entry) { - set += entry - return set -}, 'start') -console.log(reduced) // 'startfoo123bar' -``` - -## api - -The whole API is considered "public". - -Functions with the same name as an Array method work more or less the -same way. - -There's reverse versions of most things because that's the point. - -### Yallist - -Default export, the class that holds and manages a list. - -Call it with either a forEach-able (like an array) or a set of -arguments, to initialize the list. - -The Array-ish methods all act like you'd expect. No magic length, -though, so if you change that it won't automatically prune or add -empty spots. - -### Yallist.create(..) - -Alias for Yallist function. Some people like factories. - -#### yallist.head - -The first node in the list - -#### yallist.tail - -The last node in the list - -#### yallist.length - -The number of nodes in the list. (Change this at your peril. It is -not magic like Array length.) - -#### yallist.toArray() - -Convert the list to an array. - -#### yallist.forEach(fn, [thisp]) - -Call a function on each item in the list. - -#### yallist.forEachReverse(fn, [thisp]) - -Call a function on each item in the list, in reverse order. - -#### yallist.get(n) - -Get the data at position `n` in the list. If you use this a lot, -probably better off just using an Array. - -#### yallist.getReverse(n) - -Get the data at position `n`, counting from the tail. - -#### yallist.map(fn, thisp) - -Create a new Yallist with the result of calling the function on each -item. - -#### yallist.mapReverse(fn, thisp) - -Same as `map`, but in reverse. - -#### yallist.pop() - -Get the data from the list tail, and remove the tail from the list. - -#### yallist.push(item, ...) - -Insert one or more items to the tail of the list. - -#### yallist.reduce(fn, initialValue) - -Like Array.reduce. - -#### yallist.reduceReverse - -Like Array.reduce, but in reverse. - -#### yallist.reverse - -Reverse the list in place. - -#### yallist.shift() - -Get the data from the list head, and remove the head from the list. - -#### yallist.slice([from], [to]) - -Just like Array.slice, but returns a new Yallist. - -#### yallist.sliceReverse([from], [to]) - -Just like yallist.slice, but the result is returned in reverse. - -#### yallist.toArray() - -Create an array representation of the list. - -#### yallist.toArrayReverse() - -Create a reversed array representation of the list. - -#### yallist.unshift(item, ...) - -Insert one or more items to the head of the list. - -#### yallist.unshiftNode(node) - -Move a Node object to the front of the list. (That is, pull it out of -wherever it lives, and make it the new head.) - -If the node belongs to a different list, then that list will remove it -first. - -#### yallist.pushNode(node) - -Move a Node object to the end of the list. (That is, pull it out of -wherever it lives, and make it the new tail.) - -If the node belongs to a list already, then that list will remove it -first. - -#### yallist.removeNode(node) - -Remove a node from the list, preserving referential integrity of head -and tail and other nodes. - -Will throw an error if you try to have a list remove a node that -doesn't belong to it. - -### Yallist.Node - -The class that holds the data and is actually the list. - -Call with `var n = new Node(value, previousNode, nextNode)` - -Note that if you do direct operations on Nodes themselves, it's very -easy to get into weird states where the list is broken. Be careful :) - -#### node.next - -The next node in the list. - -#### node.prev - -The previous node in the list. - -#### node.value - -The data the node contains. - -#### node.list - -The list to which this node belongs. (Null if it does not belong to -any list.) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json deleted file mode 100644 index a1c290b52f3392..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_args": [ - [ - "yallist@^2.0.0", - "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache" - ] - ], - "_from": "yallist@>=2.0.0 <3.0.0", - "_id": "yallist@2.0.0", - "_inCache": true, - "_installable": true, - "_location": "/request/aws4/lru-cache/yallist", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "name": "yallist", - "raw": "yallist@^2.0.0", - "rawSpec": "^2.0.0", - "scope": null, - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/aws4/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", - "_shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", - "_shrinkwrap": null, - "_spec": "yallist@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/yallist/issues" - }, - "dependencies": {}, - "description": "Yet Another Linked List", - "devDependencies": { - "tap": "^2.3.2" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", - "tarball": "http://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" - }, - "gitHead": "702eaba87deefa9f8fc2f8e36cb225bc2141fdc3", - "homepage": "https://github.com/isaacs/yallist#readme", - "license": "ISC", - "main": "yallist.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "yallist", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" - }, - "scripts": { - "test": "tap test/*.js --cov" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js deleted file mode 100644 index 3c8d1f48d904a2..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js +++ /dev/null @@ -1,188 +0,0 @@ -var t = require('tap') -var Yallist = require('../yallist.js') - -var y = new Yallist(1,2,3,4,5) -var z = new Yallist([1,2,3,4,5]) -t.similar(y, z, 'build from single list or args') - -function add10 (i) { - return i + 10 -} -t.similar(y.map(add10).toArray(), [11, 12, 13, 14, 15]) -t.similar(y.mapReverse(add10).toArray(), [15, 14, 13, 12, 11]) - -t.similar(y.map(add10).toArrayReverse(), [15, 14, 13, 12, 11]) -t.isa(Yallist(1,2,3), 'Yallist') -t.equal(y.push(6, 7, 8), 8) -t.similar(y.toArray(), [1, 2, 3, 4, 5, 6, 7, 8]) -y.pop() -y.shift() -y.unshift(100) - -var expect = [100, 2, 3, 4, 5, 6, 7] -var expectReverse = [ 7, 6, 5, 4, 3, 2, 100 ] - -t.similar(y.toArray(), expect) -t.equal(y.length, y.toArray().length) - -t.test(function forEach (t) { - t.plan(y.length * 2) - y.forEach(function (item, i, list) { - t.equal(item, expect[i]) - t.equal(list, y) - }) -}) - -t.test(function forEach (t) { - t.plan(y.length * 5) - var n = 0 - y.forEachReverse(function (item, i, list) { - t.equal(item, expectReverse[n]) - t.equal(item, expect[i]) - t.equal(item, y.get(i)) - t.equal(item, y.getReverse(n)) - n += 1 - t.equal(list, y) - }) -}) - -t.equal(y.getReverse(100), undefined) - -t.equal(y.get(9999), undefined) - - -function sum (a, b) { return a + b } -t.equal(y.reduce(sum), 127) -t.equal(y.reduce(sum, 100), 227) -t.equal(y.reduceReverse(sum), 127) -t.equal(y.reduceReverse(sum, 100), 227) - -t.equal(Yallist().pop(), undefined) -t.equal(Yallist().shift(), undefined) - -var x = Yallist() -x.unshift(1) -t.equal(x.length, 1) -t.similar(x.toArray(), [1]) - -// verify that y.toArray() returns an array and if we create a -// new Yallist from that array, we get a list matching -t.similar(Yallist(y.toArray()), y) -t.similar(Yallist.apply(null, y.toArray()), y) - -t.throws(function () { - new Yallist().reduce(function () {}) -}, {}, new TypeError('Reduce of empty list with no initial value')) -t.throws(function () { - new Yallist().reduceReverse(function () {}) -}, {}, new TypeError('Reduce of empty list with no initial value')) - -var z = y.reverse() -t.equal(z, y) -t.similar(y.toArray(), expectReverse) -y.reverse() -t.similar(y.toArray(), expect) - -var a = Yallist(1,2,3,4,5,6) -var cases = [ - [ [2, 4], [3, 4] ], - [ [2, -4], [] ], - [ [2, -2], [3, 4] ], - [ [1, -2], [2, 3, 4] ], - [ [-1, -2], [] ], - [ [-5, -2], [2, 3, 4] ], - [ [-99, 2], [1, 2] ], - [ [5, 99], [6] ], - [ [], [1,2,3,4,5,6] ] -] -t.test('slice', function (t) { - t.plan(cases.length) - cases.forEach(function (c) { - t.test(JSON.stringify(c), function (t) { - t.similar(a.slice.apply(a, c[0]), Yallist(c[1])) - t.similar([].slice.apply(a.toArray(), c[0]), c[1]) - t.end() - }) - }) -}) - -t.test('sliceReverse', function (t) { - t.plan(cases.length) - cases.forEach(function (c) { - var rev = c[1].slice().reverse() - t.test(JSON.stringify([c[0], rev]), function (t) { - t.similar(a.sliceReverse.apply(a, c[0]), Yallist(rev)) - t.similar([].slice.apply(a.toArray(), c[0]).reverse(), rev) - t.end() - }) - }) -}) - -var inserter = Yallist(1,2,3,4,5) -inserter.unshiftNode(inserter.head.next) -t.similar(inserter.toArray(), [2,1,3,4,5]) -inserter.unshiftNode(inserter.tail) -t.similar(inserter.toArray(), [5,2,1,3,4]) -inserter.unshiftNode(inserter.head) -t.similar(inserter.toArray(), [5,2,1,3,4]) - -var single = Yallist(1) -single.unshiftNode(single.head) -t.similar(single.toArray(), [1]) - -inserter = Yallist(1,2,3,4,5) -inserter.pushNode(inserter.tail.prev) -t.similar(inserter.toArray(), [1,2,3,5,4]) -inserter.pushNode(inserter.head) -t.similar(inserter.toArray(), [2,3,5,4,1]) -inserter.unshiftNode(inserter.head) -t.similar(inserter.toArray(), [2,3,5,4,1]) - -single = Yallist(1) -single.pushNode(single.tail) -t.similar(single.toArray(), [1]) - -var swiped = Yallist(9,8,7) -inserter.unshiftNode(swiped.head.next) -t.similar(inserter.toArray(), [8,2,3,5,4,1]) -t.similar(swiped.toArray(), [9,7]) - -swiped = Yallist(9,8,7) -inserter.pushNode(swiped.head.next) -t.similar(inserter.toArray(), [8,2,3,5,4,1,8]) -t.similar(swiped.toArray(), [9,7]) - -swiped.unshiftNode(Yallist.Node(99)) -t.similar(swiped.toArray(), [99,9,7]) -swiped.pushNode(Yallist.Node(66)) -t.similar(swiped.toArray(), [99,9,7,66]) - -var e = Yallist() -e.unshiftNode(Yallist.Node(1)) -t.same(e.toArray(), [1]) -e = Yallist() -e.pushNode(Yallist.Node(1)) -t.same(e.toArray(), [1]) - -// steal them back, don't break the lists -swiped.unshiftNode(inserter.head) -t.same(swiped, Yallist(8,99,9,7,66)) -t.same(inserter, Yallist(2,3,5,4,1,8)) -swiped.unshiftNode(inserter.tail) -t.same(inserter, Yallist(2,3,5,4,1)) -t.same(swiped, Yallist(8,8,99,9,7,66)) - - -t.throws(function remove_foreign_node () { - e.removeNode(swiped.head) -}, {}, new Error('removing node which does not belong to this list')) -t.throws(function remove_unlisted_node () { - e.removeNode(Yallist.Node('nope')) -}, {}, new Error('removing node which does not belong to this list')) - -e = Yallist(1,2) -e.removeNode(e.head) -t.same(e, Yallist(2)) -e = Yallist(1,2) -e.removeNode(e.tail) -t.same(e, Yallist(1)) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js deleted file mode 100644 index fb60fc2878b438..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js +++ /dev/null @@ -1,360 +0,0 @@ -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length -- - node.next = null - node.prev = null - node.list = null -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length ++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length ++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) - return undefined - - var res = this.tail.value - this.tail = this.tail.prev - this.tail.next = null - this.length -- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) - return undefined - - var res = this.head.value - this.head = this.head.next - this.head.prev = null - this.length -- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null; ) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length ++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length ++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json deleted file mode 100644 index fafc088e725c0c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_args": [ - [ - "lru-cache@^4.0.0", - "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4" - ] - ], - "_from": "lru-cache@>=4.0.0 <5.0.0", - "_id": "lru-cache@4.0.1", - "_inCache": true, - "_installable": true, - "_location": "/request/aws4/lru-cache", - "_nodeVersion": "5.6.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lru-cache-4.0.1.tgz_1458667372415_0.8005518841091543" - }, - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.7.3", - "_phantomChildren": {}, - "_requested": { - "name": "lru-cache", - "raw": "lru-cache@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/aws4" - ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", - "_shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", - "_shrinkwrap": null, - "_spec": "lru-cache@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "dependencies": { - "pseudomap": "^1.0.1", - "yallist": "^2.0.0" - }, - "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "standard": "^5.4.1", - "tap": "^5.1.1" - }, - "directories": {}, - "dist": { - "shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz" - }, - "files": [ - "lib/lru-cache.js" - ], - "gitHead": "6cd8c8a43cf56c585bdb696faae94f9836cb9e28", - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "keywords": [ - "mru", - "lru", - "cache" - ], - "license": "ISC", - "main": "lib/lru-cache.js", - "maintainers": [ - { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" - } - ], - "name": "lru-cache", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "scripts": { - "posttest": "standard test/*.js lib/*.js", - "test": "tap test --branches=100 --functions=100 --lines=100 --statements=100" - }, - "version": "4.0.1" -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json index 5e7ae9de2d0e92..7151d7aae931f2 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/package.json +++ b/deps/npm/node_modules/request/node_modules/aws4/package.json @@ -1,53 +1,60 @@ { "_args": [ [ - "aws4@^1.2.1", + { + "raw": "aws4@^1.2.1", + "scope": null, + "escapedName": "aws4", + "name": "aws4", + "rawSpec": "^1.2.1", + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "aws4@>=1.2.1 <2.0.0", - "_id": "aws4@1.3.2", + "_id": "aws4@1.4.1", "_inCache": true, "_installable": true, "_location": "/request/aws4", - "_nodeVersion": "4.3.1", + "_nodeVersion": "4.4.3", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/aws4-1.3.2.tgz_1456871543899_0.13955276948399842" + "tmp": "tmp/aws4-1.4.1.tgz_1462643218465_0.6527479749638587" }, "_npmUser": { - "email": "michael.hart.au@gmail.com", - "name": "hichaelmart" + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" }, - "_npmVersion": "2.14.21", + "_npmVersion": "2.15.4", "_phantomChildren": {}, "_requested": { - "name": "aws4", "raw": "aws4@^1.2.1", - "rawSpec": "^1.2.1", "scope": null, + "escapedName": "aws4", + "name": "aws4", + "rawSpec": "^1.2.1", "spec": ">=1.2.1 <2.0.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz", - "_shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1", + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz", + "_shasum": "fde7d5292466d230e5ee0f4e038d9dfaab08fc61", "_shrinkwrap": null, "_spec": "aws4@^1.2.1", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "michael.hart.au@gmail.com", "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", "url": "http://github.com/mhart" }, "bugs": { "url": "https://github.com/mhart/aws4/issues" }, - "dependencies": { - "lru-cache": "^4.0.0" - }, + "dependencies": {}, "description": "Signs and prepares requests using AWS Signature Version 4", "devDependencies": { "mocha": "^2.4.5", @@ -55,10 +62,10 @@ }, "directories": {}, "dist": { - "shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1", - "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz" + "shasum": "fde7d5292466d230e5ee0f4e038d9dfaab08fc61", + "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz" }, - "gitHead": "e899db3aacbf2a034398f7dd483345dc793e8d72", + "gitHead": "f126d3ff80be1ddde0fc6b50bb51a7f199547e81", "homepage": "https://github.com/mhart/aws4#readme", "keywords": [ "amazon", @@ -116,8 +123,8 @@ "main": "aws4.js", "maintainers": [ { - "email": "michael.hart.au@gmail.com", - "name": "hichaelmart" + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" } ], "name": "aws4", @@ -130,5 +137,5 @@ "scripts": { "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" }, - "version": "1.3.2" + "version": "1.4.1" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md index 1a67c48cd031b5..86b95a3bf6df4e 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md @@ -21,7 +21,7 @@ Node-core, including [documentation](doc/stream.markdown). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -As of version 2.0.0 **readable-stream** uses semantic versioning. +As of version 2.0.0 **readable-stream** uses semantic versioning. # Streams WG Team Members diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index c141a99c26c638..83275f192e4077 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,3 +56,5 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section + + diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json index 1be49d90f5f82a..14b70d3d29b7d0 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "core-util-is@~1.0.0", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "core-util-is@~1.0.0", + { + "raw": "core-util-is@~1.0.0", + "scope": null, + "escapedName": "core-util-is", + "name": "core-util-is", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -16,28 +20,31 @@ "_location": "/request/bl/readable-stream/core-util-is", "_nodeVersion": "4.0.0", "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, "_npmVersion": "3.3.2", "_phantomChildren": {}, "_requested": { - "name": "core-util-is", "raw": "core-util-is@~1.0.0", - "rawSpec": "~1.0.0", "scope": null, + "escapedName": "core-util-is", + "name": "core-util-is", + "rawSpec": "~1.0.0", "spec": ">=1.0.0 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", "_shrinkwrap": null, "_spec": "core-util-is@~1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -51,7 +58,7 @@ "directories": {}, "dist": { "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" }, "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", "homepage": "https://github.com/isaacs/core-util-is#readme", @@ -70,8 +77,8 @@ "main": "lib/util.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "core-util-is", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile index 0ecc29c402c243..787d56e1e982e4 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile @@ -3,3 +3,4 @@ test: @node_modules/.bin/tape test.js .PHONY: test + diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json index b8f76c40e4102d..6510f4eef73f77 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "isarray@~1.0.0", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "isarray@~1.0.0", + { + "raw": "isarray@~1.0.0", + "scope": null, + "escapedName": "isarray", + "name": "isarray", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -16,28 +20,31 @@ "_location": "/request/bl/readable-stream/isarray", "_nodeVersion": "5.1.0", "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "isarray", "raw": "isarray@~1.0.0", - "rawSpec": "~1.0.0", "scope": null, + "escapedName": "isarray", + "name": "isarray", + "rawSpec": "~1.0.0", "spec": ">=1.0.0 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", "_shrinkwrap": null, "_spec": "isarray@~1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -51,7 +58,7 @@ "directories": {}, "dist": { "shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" }, "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", "homepage": "https://github.com/juliangruber/isarray", @@ -64,8 +71,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "isarray", @@ -79,6 +86,7 @@ "test": "tape test.js" }, "testling": { + "files": "test.js", "browsers": [ "ie/8..latest", "firefox/17..latest", @@ -91,8 +99,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test.js" + ] }, "version": "1.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js index f7f7bcd19fec56..e0c3444d85d5c7 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js @@ -17,3 +17,4 @@ test('is array', function(t){ t.end(); }); + diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js index 571c276783c779..a4f40f845faa65 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -8,13 +8,36 @@ if (!process.version || module.exports = process.nextTick; } -function nextTick(fn) { - var args = new Array(arguments.length - 1); - var i = 0; - while (i < args.length) { - args[i++] = arguments[i]; +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); } - process.nextTick(function afterTick() { - fn.apply(null, args); - }); } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json index bae43acf21c1ba..e100c0e08fbdd5 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -1,37 +1,48 @@ { "_args": [ [ - "process-nextick-args@~1.0.6", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "process-nextick-args@~1.0.6", + { + "raw": "process-nextick-args@~1.0.6", + "scope": null, + "escapedName": "process-nextick-args", + "name": "process-nextick-args", + "rawSpec": "~1.0.6", + "spec": ">=1.0.6 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], "_from": "process-nextick-args@>=1.0.6 <1.1.0", - "_id": "process-nextick-args@1.0.6", + "_id": "process-nextick-args@1.0.7", "_inCache": true, "_installable": true, "_location": "/request/bl/readable-stream/process-nextick-args", - "_nodeVersion": "4.1.1", + "_nodeVersion": "5.11.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" + }, "_npmUser": { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" }, - "_npmVersion": "2.14.4", + "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { - "name": "process-nextick-args", "raw": "process-nextick-args@~1.0.6", - "rawSpec": "~1.0.6", "scope": null, + "escapedName": "process-nextick-args", + "name": "process-nextick-args", + "rawSpec": "~1.0.6", "spec": ">=1.0.6 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", "_shrinkwrap": null, "_spec": "process-nextick-args@~1.0.6", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", @@ -46,17 +57,17 @@ }, "directories": {}, "dist": { - "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" + "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, - "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78", + "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", "homepage": "https://github.com/calvinmetcalf/process-nextick-args", "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" } ], "name": "process-nextick-args", @@ -69,5 +80,5 @@ "scripts": { "test": "node test.js" }, - "version": "1.0.6" + "version": "1.0.7" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json index 977e5976d64923..a4cb8bc4a9d151 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "string_decoder@~0.10.x", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "string_decoder@~0.10.x", + { + "raw": "string_decoder@~0.10.x", + "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "~0.10.x", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -15,22 +19,25 @@ "_installable": true, "_location": "/request/bl/readable-stream/string_decoder", "_npmUser": { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, "_npmVersion": "1.4.23", "_phantomChildren": {}, "_requested": { - "name": "string_decoder", "raw": "string_decoder@~0.10.x", - "rawSpec": "~0.10.x", "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "~0.10.x", "spec": ">=0.10.0 <0.11.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", "_shrinkwrap": null, "_spec": "string_decoder@~0.10.x", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", @@ -45,7 +52,7 @@ "directories": {}, "dist": { "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" }, "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", "homepage": "https://github.com/rvagg/string_decoder", @@ -59,12 +66,12 @@ "main": "index.js", "maintainers": [ { - "email": "mail@substack.net", - "name": "substack" + "name": "substack", + "email": "mail@substack.net" }, { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" } ], "name": "string_decoder", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json index 63869c0e04c12b..14eb7c631cb4fc 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "util-deprecate@~1.0.1", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "util-deprecate@~1.0.1", + { + "raw": "util-deprecate@~1.0.1", + "scope": null, + "escapedName": "util-deprecate", + "name": "util-deprecate", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -16,28 +20,31 @@ "_location": "/request/bl/readable-stream/util-deprecate", "_nodeVersion": "4.1.2", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "2.14.4", "_phantomChildren": {}, "_requested": { - "name": "util-deprecate", "raw": "util-deprecate@~1.0.1", - "rawSpec": "~1.0.1", "scope": null, + "escapedName": "util-deprecate", + "name": "util-deprecate", + "rawSpec": "~1.0.1", "spec": ">=1.0.1 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", "_shrinkwrap": null, "_spec": "util-deprecate@~1.0.1", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, "browser": "browser.js", @@ -50,7 +57,7 @@ "directories": {}, "dist": { "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" }, "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", "homepage": "https://github.com/TooTallNate/util-deprecate", @@ -65,8 +72,8 @@ "main": "node.js", "maintainers": [ { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" } ], "name": "util-deprecate", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json index f818ebf1b62108..27ef41cb1c1743 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "readable-stream@~2.0.5", + { + "raw": "readable-stream@~2.0.5", + "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "~2.0.5", + "spec": ">=2.0.5 <2.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" }, "_npmUser": { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" }, "_npmVersion": "3.6.0", "_phantomChildren": {}, "_requested": { - "name": "readable-stream", "raw": "readable-stream@~2.0.5", - "rawSpec": "~2.0.5", "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "~2.0.5", "spec": ">=2.0.5 <2.1.0", "type": "range" }, @@ -73,20 +82,20 @@ "main": "readable.js", "maintainers": [ { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" }, { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" } ], "name": "readable-stream", diff --git a/deps/npm/node_modules/request/node_modules/bl/package.json b/deps/npm/node_modules/request/node_modules/bl/package.json index 09ebb7b7413344..47862b0b623691 100644 --- a/deps/npm/node_modules/request/node_modules/bl/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "bl@~1.1.2", + { + "raw": "bl@~1.1.2", + "scope": null, + "escapedName": "bl", + "name": "bl", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], @@ -16,16 +24,19 @@ "tmp": "tmp/bl-1.1.2.tgz_1455246621698_0.6300242957659066" }, "_npmUser": { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, "_npmVersion": "3.3.12", - "_phantomChildren": {}, + "_phantomChildren": { + "inherits": "2.0.1" + }, "_requested": { - "name": "bl", "raw": "bl@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "bl", + "name": "bl", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, @@ -71,8 +82,8 @@ "main": "bl.js", "maintainers": [ { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" } ], "name": "bl", diff --git a/deps/npm/node_modules/request/node_modules/caseless/package.json b/deps/npm/node_modules/request/node_modules/caseless/package.json index 2cd79ea01ab69b..7470678232df15 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/package.json +++ b/deps/npm/node_modules/request/node_modules/caseless/package.json @@ -1,43 +1,73 @@ { - "name": "caseless", - "version": "0.11.0", - "description": "Caseless object set/get/has, very useful when working with HTTP headers.", - "main": "index.js", - "scripts": { - "test": "node test.js" + "_args": [ + [ + { + "raw": "caseless@~0.11.0", + "scope": null, + "escapedName": "caseless", + "name": "caseless", + "rawSpec": "~0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "caseless@>=0.11.0 <0.12.0", + "_id": "caseless@0.11.0", + "_inCache": true, + "_installable": true, + "_location": "/request/caseless", + "_nodeVersion": "1.8.1", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, - "repository": { - "type": "git", - "url": "git+https://github.com/mikeal/caseless.git" + "_npmVersion": "2.8.3", + "_phantomChildren": {}, + "_requested": { + "raw": "caseless@~0.11.0", + "scope": null, + "escapedName": "caseless", + "name": "caseless", + "rawSpec": "~0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" }, - "keywords": [ - "headers", - "http", - "caseless" + "_requiredBy": [ + "/request" ], - "test": "node test.js", + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "_shrinkwrap": null, + "_spec": "caseless@~0.11.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" }, - "license": "Apache-2.0", "bugs": { "url": "https://github.com/mikeal/caseless/issues" }, + "dependencies": {}, + "description": "Caseless object set/get/has, very useful when working with HTTP headers.", "devDependencies": { "tape": "^2.10.2" }, + "directories": {}, + "dist": { + "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, "gitHead": "c578232a02cc2b46b6da8851caf57fdbfac89ff5", "homepage": "https://github.com/mikeal/caseless#readme", - "_id": "caseless@0.11.0", - "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", - "_from": "caseless@>=0.11.0 <0.12.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.8.1", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, + "keywords": [ + "headers", + "http", + "caseless" + ], + "license": "Apache-2.0", + "main": "index.js", "maintainers": [ { "name": "mikeal", @@ -52,11 +82,16 @@ "email": "simeonvelichkov@gmail.com" } ], - "dist": { - "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", - "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + "name": "caseless", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mikeal/caseless.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "node test.js" + }, + "test": "node test.js", + "version": "0.11.0" } diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile index 2d7580746d0b84..b4ff85a33b6eb4 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile @@ -4,3 +4,4 @@ test: @./test/run.js .PHONY: test + diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json index 8ac66b814c8162..cec42698168d6d 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json @@ -1,53 +1,79 @@ { + "_args": [ + [ + { + "raw": "delayed-stream@~1.0.0", + "scope": null, + "escapedName": "delayed-stream", + "name": "delayed-stream", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/combined-stream" + ] + ], + "_from": "delayed-stream@>=1.0.0 <1.1.0", + "_id": "delayed-stream@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/combined-stream/delayed-stream", + "_nodeVersion": "1.6.4", + "_npmUser": { + "name": "apechimp", + "email": "apeherder@gmail.com" + }, + "_npmVersion": "2.8.3", + "_phantomChildren": {}, + "_requested": { + "raw": "delayed-stream@~1.0.0", + "scope": null, + "escapedName": "delayed-stream", + "name": "delayed-stream", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request/combined-stream" + ], + "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", + "_shrinkwrap": null, + "_spec": "delayed-stream@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/combined-stream", "author": { "name": "Felix Geisendörfer", "email": "felix@debuggable.com", "url": "http://debuggable.com/" }, + "bugs": { + "url": "https://github.com/felixge/node-delayed-stream/issues" + }, "contributors": [ { "name": "Mike Atkins", "email": "apeherder@gmail.com" } ], - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "license": "MIT", - "version": "1.0.0", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "scripts": { - "test": "make test" - }, "dependencies": {}, + "description": "Buffers events from a stream until you are ready to handle them.", "devDependencies": { "fake": "0.2.0", "far": "0.0.1" }, - "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@1.0.0", - "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", - "_from": "delayed-stream@>=1.0.0 <1.1.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.6.4", - "_npmUser": { - "name": "apechimp", - "email": "apeherder@gmail.com" - }, + "directories": {}, "dist": { "shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", - "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" }, + "engines": { + "node": ">=0.4.0" + }, + "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84", + "homepage": "https://github.com/felixge/node-delayed-stream", + "license": "MIT", + "main": "./lib/delayed_stream", "maintainers": [ { "name": "felixge", @@ -58,7 +84,15 @@ "email": "apeherder@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "delayed-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-delayed-stream.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/package.json index e0cd160ff6dbe5..3dec78c0f97955 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/combined-stream/package.json @@ -1,48 +1,75 @@ { + "_args": [ + [ + { + "raw": "combined-stream@~1.0.5", + "scope": null, + "escapedName": "combined-stream", + "name": "combined-stream", + "rawSpec": "~1.0.5", + "spec": ">=1.0.5 <1.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "combined-stream@>=1.0.5 <1.1.0", + "_id": "combined-stream@1.0.5", + "_inCache": true, + "_installable": true, + "_location": "/request/combined-stream", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "combined-stream@~1.0.5", + "scope": null, + "escapedName": "combined-stream", + "name": "combined-stream", + "rawSpec": "~1.0.5", + "spec": ">=1.0.5 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request", + "/request/form-data" + ], + "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "_shrinkwrap": null, + "_spec": "combined-stream@~1.0.5", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Felix Geisendörfer", "email": "felix@debuggable.com", "url": "http://debuggable.com/" }, - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "1.0.5", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.8" + "bugs": { + "url": "https://github.com/felixge/node-combined-stream/issues" }, "dependencies": { "delayed-stream": "~1.0.0" }, + "description": "A stream that emits multiple other streams one after another.", "devDependencies": { "far": "~0.0.7" }, - "license": "MIT", - "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7", - "bugs": { - "url": "https://github.com/felixge/node-combined-stream/issues" - }, - "_id": "combined-stream@1.0.5", - "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", - "_from": "combined-stream@>=1.0.5 <1.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "alexindigo", - "email": "iam@alexindigo.com" - }, + "directories": {}, "dist": { "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", - "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + "tarball": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, + "engines": { + "node": ">= 0.8" }, + "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7", + "homepage": "https://github.com/felixge/node-combined-stream", + "license": "MIT", + "main": "./lib/combined_stream", "maintainers": [ { "name": "felixge", @@ -61,7 +88,15 @@ "email": "apeherder@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "readme": "ERROR: No README data found!" + "name": "combined-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "scripts": { + "test": "node test/run.js" + }, + "version": "1.0.5" } diff --git a/deps/npm/node_modules/request/node_modules/extend/.jscs.json b/deps/npm/node_modules/request/node_modules/extend/.jscs.json index 59faa8bd9f6c60..7e84b282bb1763 100644 --- a/deps/npm/node_modules/request/node_modules/extend/.jscs.json +++ b/deps/npm/node_modules/request/node_modules/extend/.jscs.json @@ -101,3 +101,4 @@ "requirePaddingNewLinesAfterUseStrict": true } + diff --git a/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md index 2874d2ecda1861..ee0cfd6adb5a2e 100644 --- a/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md @@ -66,3 +66,4 @@ 1.0.0 / 2012-04-08 ================== * Initial commit + diff --git a/deps/npm/node_modules/request/node_modules/extend/LICENSE b/deps/npm/node_modules/request/node_modules/extend/LICENSE index 92d41503d32ec1..e16d6a56ca64e2 100644 --- a/deps/npm/node_modules/request/node_modules/extend/LICENSE +++ b/deps/npm/node_modules/request/node_modules/extend/LICENSE @@ -20,3 +20,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/deps/npm/node_modules/request/node_modules/extend/README.md b/deps/npm/node_modules/request/node_modules/extend/README.md index 3a47b21880fa94..632fb0f96fd347 100644 --- a/deps/npm/node_modules/request/node_modules/extend/README.md +++ b/deps/npm/node_modules/request/node_modules/extend/README.md @@ -59,3 +59,4 @@ Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jon [deps-url]: https://david-dm.org/justmoon/node-extend [dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg [dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies + diff --git a/deps/npm/node_modules/request/node_modules/extend/component.json b/deps/npm/node_modules/request/node_modules/extend/component.json index 0f76b59305b7bc..1500a2f3718182 100644 --- a/deps/npm/node_modules/request/node_modules/extend/component.json +++ b/deps/npm/node_modules/request/node_modules/extend/component.json @@ -29,3 +29,4 @@ "jscs": "~1.6.2" } } + diff --git a/deps/npm/node_modules/request/node_modules/extend/index.js b/deps/npm/node_modules/request/node_modules/extend/index.js index 2f957482eef381..f5ec75d52f5f61 100644 --- a/deps/npm/node_modules/request/node_modules/extend/index.js +++ b/deps/npm/node_modules/request/node_modules/extend/index.js @@ -83,3 +83,4 @@ module.exports = function extend() { // Return the modified object return target; }; + diff --git a/deps/npm/node_modules/request/node_modules/extend/package.json b/deps/npm/node_modules/request/node_modules/extend/package.json index c8c7cac9967924..cbcd8ee4a8172d 100644 --- a/deps/npm/node_modules/request/node_modules/extend/package.json +++ b/deps/npm/node_modules/request/node_modules/extend/package.json @@ -1,20 +1,54 @@ { - "name": "extend", + "_args": [ + [ + { + "raw": "extend@~3.0.0", + "scope": null, + "escapedName": "extend", + "name": "extend", + "rawSpec": "~3.0.0", + "spec": ">=3.0.0 <3.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "extend@>=3.0.0 <3.1.0", + "_id": "extend@3.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/extend", + "_nodeVersion": "2.3.1", + "_npmUser": { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "extend@~3.0.0", + "scope": null, + "escapedName": "extend", + "name": "extend", + "rawSpec": "~3.0.0", + "spec": ">=3.0.0 <3.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", + "_shrinkwrap": null, + "_spec": "extend@~3.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Stefan Thomas", "email": "justmoon@members.fsf.org", "url": "http://www.justmoon.net" }, - "version": "3.0.0", - "description": "Port of jQuery.extend for node.js and the browser", - "main": "index", - "scripts": { - "test": "npm run lint && node test/index.js && npm run coverage-quiet", - "coverage": "covert test/index.js", - "coverage-quiet": "covert test/index.js --quiet", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js" + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" }, "contributors": [ { @@ -22,41 +56,28 @@ "url": "https://github.com/ljharb" } ], - "keywords": [ - "extend", - "clone", - "merge" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/justmoon/node-extend.git" - }, "dependencies": {}, + "description": "Port of jQuery.extend for node.js and the browser", "devDependencies": { - "tape": "^4.0.0", "covert": "^1.1.0", + "eslint": "^0.24.0", "jscs": "^1.13.1", - "eslint": "^0.24.0" - }, - "license": "MIT", - "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d", - "bugs": { - "url": "https://github.com/justmoon/node-extend/issues" - }, - "homepage": "https://github.com/justmoon/node-extend#readme", - "_id": "extend@3.0.0", - "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", - "_from": "extend@>=3.0.0 <3.1.0", - "_npmVersion": "2.11.3", - "_nodeVersion": "2.3.1", - "_npmUser": { - "name": "ljharb", - "email": "ljharb@gmail.com" + "tape": "^4.0.0" }, + "directories": {}, "dist": { "shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", - "tarball": "http://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + "tarball": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" }, + "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d", + "homepage": "https://github.com/justmoon/node-extend#readme", + "keywords": [ + "extend", + "clone", + "merge" + ], + "license": "MIT", + "main": "index", "maintainers": [ { "name": "justmoon", @@ -67,7 +88,20 @@ "email": "ljharb@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "extend", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "test": "npm run lint && node test/index.js && npm run coverage-quiet" + }, + "version": "3.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/index.js b/deps/npm/node_modules/request/node_modules/forever-agent/index.js index d7276fd97391c6..416c7abd709233 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/index.js +++ b/deps/npm/node_modules/request/node_modules/forever-agent/index.js @@ -6,8 +6,8 @@ var util = require('util') , net = require('net') , tls = require('tls') , AgentSSL = require('https').Agent - -function getConnectionName(host, port) { + +function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port @@ -16,7 +16,7 @@ function getConnectionName(host, port) { name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name -} +} function ForeverAgent(options) { var self = this @@ -34,7 +34,7 @@ function ForeverAgent(options) { } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) - + // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() @@ -60,7 +60,7 @@ ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) - + if (typeof host !== 'string') { var options = host port = options.port @@ -89,7 +89,7 @@ ForeverAgent.prototype.removeSocket = function(s, name, host, port) { delete this.sockets[name] delete this.requests[name] } - + if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/package.json b/deps/npm/node_modules/request/node_modules/forever-agent/package.json index 1d672c1c9a885e..58acb7700b6a5b 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/forever-agent/package.json @@ -1,31 +1,89 @@ { + "_args": [ + [ + { + "raw": "forever-agent@~0.6.1", + "scope": null, + "escapedName": "forever-agent", + "name": "forever-agent", + "rawSpec": "~0.6.1", + "spec": ">=0.6.1 <0.7.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "forever-agent@>=0.6.1 <0.7.0", + "_id": "forever-agent@0.6.1", + "_inCache": true, + "_installable": true, + "_location": "/request/forever-agent", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "forever-agent@~0.6.1", + "scope": null, + "escapedName": "forever-agent", + "name": "forever-agent", + "rawSpec": "~0.6.1", + "spec": ">=0.6.1 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "_shrinkwrap": null, + "_spec": "forever-agent@~0.6.1", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, - "name": "forever-agent", - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", - "version": "0.6.1", - "license": "Apache-2.0", - "repository": { - "url": "git+https://github.com/mikeal/forever-agent.git" + "bugs": { + "url": "https://github.com/mikeal/forever-agent/issues" }, - "main": "index.js", "dependencies": {}, + "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, - "optionalDependencies": {}, + "directories": {}, + "dist": { + "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "tarball": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, "engines": { "node": "*" }, - "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" + "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d", + "homepage": "https://github.com/mikeal/forever-agent", + "license": "Apache-2.0", + "main": "index.js", + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "name": "forever-agent", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/mikeal/forever-agent.git" }, - "homepage": "https://github.com/mikeal/forever-agent#readme", - "_id": "forever-agent@0.6.1", - "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "_from": "forever-agent@>=0.6.1 <0.7.0" + "scripts": {}, + "version": "0.6.1" } diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md index fcb2b2c0c90711..f15e08121b2ecb 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md @@ -80,7 +80,7 @@ Bug Fixes: Bug Fix: -- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) # v1.1.0 @@ -92,7 +92,7 @@ New Features: - Optimized `map`, `eachOf`, and `waterfall` families of functions - Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667). - The callback is now optional for the composed results of `compose` and `seq`. (#618) -- Reduced file size by 4kb, (minified version by 1kb) +- Reduced file size by 4kb, (minified version by 1kb) - Added code coverage through `nyc` and `coveralls` (#768) Bug Fixes: diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md index 3a0f017719b309..316c40505c7ff3 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md @@ -1448,7 +1448,7 @@ __Arguments__ * `opts` - Can be either an object with `times` and `interval` or a number. * `times` - The number of attempts to make before giving up. The default is `5`. * `interval` - The time to wait between retries, in milliseconds. The default is `0`. - * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. + * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. * `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` which must be called when finished, passing `err` (which can be `null`) and the `result` of the function's execution, and (2) a `results` object, containing the results of @@ -1466,14 +1466,14 @@ async.retry(3, apiMethod, function(err, result) { ``` ```js -// try calling apiMethod 3 times, waiting 200 ms between each retry +// try calling apiMethod 3 times, waiting 200 ms between each retry async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { // do something with the result }); ``` ```js -// try calling apiMethod the default 5 times no delay between each retry +// try calling apiMethod the default 5 times no delay between each retry async.retry(apiMethod, function(err, result) { // do something with the result }); @@ -1792,7 +1792,7 @@ async.waterfall([ return db.model.create(contents); }), function (model, next) { - // `model` is the instantiated model object. + // `model` is the instantiated model object. // If there was an error, this function would be skipped. } ], callback) diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js index ee0a268e6d7932..31e7620fb6ffb3 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js @@ -1090,7 +1090,7 @@ var memoized = _restParam(function memoized(args) { var callback = args.pop(); var key = hasher.apply(null, args); - if (has.call(memo, key)) { + if (has.call(memo, key)) { async.setImmediate(function () { callback.apply(null, memo[key]); }); diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js index ee0a268e6d7932..31e7620fb6ffb3 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js @@ -1090,7 +1090,7 @@ var memoized = _restParam(function memoized(args) { var callback = args.pop(); var key = hasher.apply(null, args); - if (has.call(memo, key)) { + if (has.call(memo, key)) { async.setImmediate(function () { callback.apply(null, memo[key]); }); diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json index 97921ec00b0378..88b1fa0c84661f 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "async@^1.4.0", + { + "raw": "async@^1.5.2", + "scope": null, + "escapedName": "async", + "name": "async", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/form-data" ] ], - "_from": "async@>=1.4.0 <2.0.0", + "_from": "async@>=1.5.2 <2.0.0", "_id": "async@1.5.2", "_inCache": true, "_installable": true, "_location": "/request/form-data/async", "_nodeVersion": "4.2.3", "_npmUser": { - "email": "alexander.early@gmail.com", - "name": "aearly" + "name": "aearly", + "email": "alexander.early@gmail.com" }, "_npmVersion": "3.5.2", "_phantomChildren": {}, "_requested": { - "name": "async", - "raw": "async@^1.4.0", - "rawSpec": "^1.4.0", + "raw": "async@^1.5.2", "scope": null, - "spec": ">=1.4.0 <2.0.0", + "escapedName": "async", + "name": "async", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", "type": "range" }, "_requiredBy": [ @@ -31,7 +40,7 @@ "_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a", "_shrinkwrap": null, - "_spec": "async@^1.4.0", + "_spec": "async@^1.5.2", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/form-data", "author": { "name": "Caolan McMahon" @@ -69,31 +78,31 @@ "directories": {}, "dist": { "shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a", - "tarball": "http://registry.npmjs.org/async/-/async-1.5.2.tgz" + "tarball": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" }, "files": [ + "lib", "dist/async.js", - "dist/async.min.js", - "lib" + "dist/async.min.js" ], "gitHead": "9ab5c67b7cb3a4c3dad4a2d4552a2f6775545d6c", "homepage": "https://github.com/caolan/async#readme", "jam": { - "categories": [ - "Utilities" - ], + "main": "lib/async.js", "include": [ - "LICENSE", + "lib/async.js", "README.md", - "lib/async.js" + "LICENSE" ], - "main": "lib/async.js" + "categories": [ + "Utilities" + ] }, "keywords": [ "async", "callback", - "module", - "utility" + "utility", + "module" ], "license": "MIT", "main": "lib/async.js", @@ -137,13 +146,13 @@ }, "version": "1.5.2", "volo": { + "main": "lib/async.js", "ignore": [ "**/.*", - "bower_components", "node_modules", + "bower_components", "test", "tests" - ], - "main": "lib/async.js" + ] } } diff --git a/deps/npm/node_modules/request/node_modules/form-data/package.json b/deps/npm/node_modules/request/node_modules/form-data/package.json index 8977f984e81a7e..5c4375edfe0207 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/package.json @@ -1,11 +1,19 @@ { "_args": [ [ - "form-data@~1.0.0-rc3", + { + "raw": "form-data@~1.0.0-rc4", + "scope": null, + "escapedName": "form-data", + "name": "form-data", + "rawSpec": "~1.0.0-rc4", + "spec": ">=1.0.0-rc4 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "form-data@>=1.0.0-rc3 <1.1.0", + "_from": "form-data@>=1.0.0-rc4 <1.1.0", "_id": "form-data@1.0.0-rc4", "_inCache": true, "_installable": true, @@ -16,17 +24,18 @@ "tmp": "tmp/form-data-1.0.0-rc4.tgz_1458059747097_0.14101114077493548" }, "_npmUser": { - "email": "iam@alexindigo.com", - "name": "alexindigo" + "name": "alexindigo", + "email": "iam@alexindigo.com" }, "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { - "name": "form-data", - "raw": "form-data@~1.0.0-rc3", - "rawSpec": "~1.0.0-rc3", + "raw": "form-data@~1.0.0-rc4", "scope": null, - "spec": ">=1.0.0-rc3 <1.1.0", + "escapedName": "form-data", + "name": "form-data", + "rawSpec": "~1.0.0-rc4", + "spec": ">=1.0.0-rc4 <1.1.0", "type": "range" }, "_requiredBy": [ @@ -35,11 +44,11 @@ "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", "_shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e", "_shrinkwrap": null, - "_spec": "form-data@~1.0.0-rc3", + "_spec": "form-data@~1.0.0-rc4", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "felix@debuggable.com", "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", "url": "http://debuggable.com/" }, "browser": "./lib/browser", @@ -79,28 +88,28 @@ "main": "./lib/form_data", "maintainers": [ { - "email": "felix@debuggable.com", - "name": "felixge" + "name": "felixge", + "email": "felix@debuggable.com" }, { - "email": "igor@buran.us", - "name": "idralyuk" + "name": "idralyuk", + "email": "igor@buran.us" }, { - "email": "iam@alexindigo.com", - "name": "alexindigo" + "name": "alexindigo", + "email": "iam@alexindigo.com" }, { - "email": "mikeal.rogers@gmail.com", - "name": "mikeal" + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, { - "email": "dtyree77@gmail.com", - "name": "celer" + "name": "celer", + "email": "dtyree77@gmail.com" }, { - "email": "pierceydylan@gmail.com", - "name": "dylanpiercey" + "name": "dylanpiercey", + "email": "pierceydylan@gmail.com" } ], "name": "form-data", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json index 98f45803886225..cfca2b9295a374 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "ansi-styles@^2.2.1", + { + "raw": "ansi-styles@^2.2.1", + "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^2.2.1", + "spec": ">=2.2.1 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, "_npmVersion": "3.8.3", "_phantomChildren": {}, "_requested": { - "name": "ansi-styles", "raw": "ansi-styles@^2.2.1", - "rawSpec": "^2.2.1", "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^2.2.1", "spec": ">=2.2.1 <3.0.0", "type": "range" }, @@ -38,8 +47,8 @@ "_spec": "ansi-styles@^2.2.1", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { - "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { @@ -88,8 +97,8 @@ "license": "MIT", "maintainers": [ { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" } ], "name": "ansi-styles", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json index 13999335413ffb..187d3126611a4d 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "escape-string-regexp@^1.0.2", + { + "raw": "escape-string-regexp@^1.0.2", + "scope": null, + "escapedName": "escape-string-regexp", + "name": "escape-string-regexp", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" }, "_npmUser": { - "email": "jappelman@xebia.com", - "name": "jbnicolai" + "name": "jbnicolai", + "email": "jappelman@xebia.com" }, "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { - "name": "escape-string-regexp", "raw": "escape-string-regexp@^1.0.2", - "rawSpec": "^1.0.2", "scope": null, + "escapedName": "escape-string-regexp", + "name": "escape-string-regexp", + "rawSpec": "^1.0.2", "spec": ">=1.0.2 <2.0.0", "type": "range" }, @@ -38,8 +47,8 @@ "_spec": "escape-string-regexp@^1.0.2", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { - "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { @@ -54,7 +63,7 @@ "directories": {}, "dist": { "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" }, "engines": { "node": ">=0.8.0" @@ -79,12 +88,12 @@ "license": "MIT", "maintainers": [ { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, { - "email": "jappelman@xebia.com", - "name": "jbnicolai" + "name": "jbnicolai", + "email": "jappelman@xebia.com" } ], "name": "escape-string-regexp", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json index 15f623780f02e6..8ecf94571f78cf 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json @@ -1,38 +1,75 @@ { - "name": "has-ansi", - "version": "2.0.0", - "description": "Check if a string has ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-ansi.git" + "_args": [ + [ + { + "raw": "has-ansi@^2.0.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" + ] + ], + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_id": "has-ansi@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/chalk/has-ansi", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "has-ansi@^2.0.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" }, + "_requiredBy": [ + "/request/har-validator/chalk" + ], + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_shrinkwrap": null, + "_spec": "has-ansi@^2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - } - ], + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "description": "Check if a string has ANSI escape codes", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "node test.js" - }, "files": [ "index.js" ], + "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "homepage": "https://github.com/sindresorhus/has-ansi", "keywords": [ "ansi", "styles", @@ -57,20 +94,26 @@ "pattern", "has" ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "has-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" }, - "readme": "# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)\n\n> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save has-ansi\n```\n\n\n## Usage\n\n```js\nvar hasAnsi = require('has-ansi');\n\nhasAnsi('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nhasAnsi('cake');\n//=> false\n```\n\n\n## Related\n\n- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module\n- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes\n- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes\n- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "bugs": { - "url": "https://github.com/sindresorhus/has-ansi/issues" + "scripts": { + "test": "node test.js" }, - "homepage": "https://github.com/sindresorhus/has-ansi#readme", - "_id": "has-ansi@2.0.0", - "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "_from": "has-ansi@>=2.0.0 <3.0.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json index c43b7aa8c3a54f..cd92886ca2db99 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json @@ -1,38 +1,74 @@ { - "name": "supports-color", - "version": "2.0.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" + "_args": [ + [ + { + "raw": "supports-color@^2.0.0", + "scope": null, + "escapedName": "supports-color", + "name": "supports-color", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" + ] + ], + "_from": "supports-color@>=2.0.0 <3.0.0", + "_id": "supports-color@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/chalk/supports-color", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "supports-color@^2.0.0", + "scope": null, + "escapedName": "supports-color", + "name": "supports-color", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" }, + "_requiredBy": [ + "/request/har-validator/chalk" + ], + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "_shrinkwrap": null, + "_spec": "supports-color@^2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - } - ], + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*", + "require-uncached": "^1.0.2" + }, + "directories": {}, + "dist": { + "shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + }, "engines": { "node": ">=0.8.0" }, - "scripts": { - "test": "mocha" - }, "files": [ "index.js" ], + "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", + "homepage": "https://github.com/chalk/supports-color", "keywords": [ "color", "colour", @@ -53,18 +89,26 @@ "capability", "detect" ], - "devDependencies": { - "mocha": "*", - "require-uncached": "^1.0.2" + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "supports-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" }, - "readme": "# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)\n\n> Detect whether a terminal supports color\n\n\n## Install\n\n```\n$ npm install --save supports-color\n```\n\n\n## Usage\n\n```js\nvar supportsColor = require('supports-color');\n\nif (supportsColor) {\n\tconsole.log('Terminal supports color');\n}\n```\n\nIt obeys the `--color` and `--no-color` CLI flags.\n\nFor situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n\n## Related\n\n- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" + "scripts": { + "test": "mocha" }, - "homepage": "https://github.com/chalk/supports-color#readme", - "_id": "supports-color@2.0.0", - "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "_from": "supports-color@>=2.0.0 <3.0.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json index cf2ae5bd38d3b4..a29160d3a292b1 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "chalk@^1.1.1", + { + "raw": "chalk@^1.1.1", + "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" ] ], @@ -16,18 +24,19 @@ "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" }, "_npmUser": { - "email": "i.am.qix@gmail.com", - "name": "qix" + "name": "qix", + "email": "i.am.qix@gmail.com" }, "_npmVersion": "2.14.2", "_phantomChildren": { "ansi-regex": "2.0.0" }, "_requested": { - "name": "chalk", "raw": "chalk@^1.1.1", - "rawSpec": "^1.1.1", "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^1.1.1", "spec": ">=1.1.1 <2.0.0", "type": "range" }, @@ -99,16 +108,16 @@ "license": "MIT", "maintainers": [ { - "email": "i.am.qix@gmail.com", - "name": "qix" + "name": "qix", + "email": "i.am.qix@gmail.com" }, { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, { - "email": "sindresorhus+unicorn@gmail.com", - "name": "unicorn" + "name": "unicorn", + "email": "sindresorhus+unicorn@gmail.com" } ], "name": "chalk", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md index 60eb67599e5288..08b9e4cb94ab58 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md @@ -6,7 +6,7 @@ [![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander). + The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander). [API documentation](http://tj.github.com/commander.js/) @@ -95,7 +95,7 @@ program .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) .parse(process.argv); - + console.log(' size: %j', program.size); console.log(' drink: %j', program.drink); ``` @@ -171,7 +171,7 @@ program .parse(process.argv); ``` -When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. +When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`. Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. @@ -188,7 +188,7 @@ You can enable `--harmony` option in two ways: The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: -``` +``` $ ./examples/pizza --help Usage: pizza [options] @@ -348,3 +348,4 @@ More Demos can be found in the [examples](https://github.com/tj/commander.js/tre ## License MIT + diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js index 8ed463c34ab385..a19c05d2e3dd91 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js @@ -1107,3 +1107,4 @@ function exists(file) { return false; } } + diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE index 50d1e5c666c05b..d1f842f0bb2722 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js index c4a79d1afad211..7e9fc70f0ac251 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js @@ -8,3 +8,5 @@ exports.readlinkSync = function (p) { return p; } }; + + diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json index 64d7d644dbcb59..19f11158e6b99a 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json @@ -1,31 +1,84 @@ { - "name": "graceful-readlink", - "version": "1.0.1", - "description": "graceful fs.readlink", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/zhiyelee/graceful-readlink.git" + "_args": [ + [ + { + "raw": "graceful-readlink@>= 1.0.0", + "scope": null, + "escapedName": "graceful-readlink", + "name": "graceful-readlink", + "rawSpec": ">= 1.0.0", + "spec": ">=1.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/commander" + ] + ], + "_from": "graceful-readlink@>=1.0.0", + "_id": "graceful-readlink@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/commander/graceful-readlink", + "_nodeVersion": "0.11.14", + "_npmUser": { + "name": "zhiyelee", + "email": "zhiyelee@gmail.com" + }, + "_npmVersion": "2.1.17", + "_phantomChildren": {}, + "_requested": { + "raw": "graceful-readlink@>= 1.0.0", + "scope": null, + "escapedName": "graceful-readlink", + "name": "graceful-readlink", + "rawSpec": ">= 1.0.0", + "spec": ">=1.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/commander" + ], + "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", + "_shrinkwrap": null, + "_spec": "graceful-readlink@>= 1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/commander", + "author": { + "name": "zhiyelee" }, - "homepage": "https://github.com/zhiyelee/graceful-readlink", "bugs": { "url": "https://github.com/zhiyelee/graceful-readlink/issues" }, + "dependencies": {}, + "description": "graceful fs.readlink", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", + "tarball": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + }, + "gitHead": "f6655275bebef706fb63fd01b5f062a7052419a5", + "homepage": "https://github.com/zhiyelee/graceful-readlink", "keywords": [ "fs.readlink", "readlink" ], - "author": { - "name": "zhiyelee" - }, "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "zhiyelee", + "email": "zhiyelee@gmail.com" + } + ], + "name": "graceful-readlink", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/zhiyelee/graceful-readlink.git" + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "readme": "# graceful-readlink\n[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n\n\n## Usage\n\n```js\nvar readlinkSync = require('graceful-readlink').readlinkSync;\nconsole.log(readlinkSync(f));\n// output\n// the file pointed to when `f` is a symbolic link\n// the `f` itself when `f` is not a symbolic link\n```\n## Licence\n\nMIT License\n", - "readmeFilename": "README.md", - "_id": "graceful-readlink@1.0.1", - "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", - "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "_from": "graceful-readlink@>=1.0.0" + "version": "1.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json index ccc77e036e4994..591bfdf33de61a 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json @@ -1,56 +1,82 @@ { - "name": "commander", - "version": "2.9.0", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser" + "_args": [ + [ + { + "raw": "commander@^2.9.0", + "scope": null, + "escapedName": "commander", + "name": "commander", + "rawSpec": "^2.9.0", + "spec": ">=2.9.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" + ] ], + "_from": "commander@>=2.9.0 <3.0.0", + "_id": "commander@2.9.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/commander", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "zhiyelee", + "email": "zhiyelee@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "commander@^2.9.0", + "scope": null, + "escapedName": "commander", + "name": "commander", + "rawSpec": "^2.9.0", + "spec": ">=2.9.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator" + ], + "_resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "_shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", + "_shrinkwrap": null, + "_spec": "commander@^2.9.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/tj/commander.js.git" + "bugs": { + "url": "https://github.com/tj/commander.js/issues" + }, + "dependencies": { + "graceful-readlink": ">= 1.0.0" }, + "description": "the complete solution for node.js command-line programs", "devDependencies": { "should": ">= 0.0.1", "sinon": ">=1.17.1" }, - "scripts": { - "test": "make test" + "directories": {}, + "dist": { + "shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", + "tarball": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz" }, - "main": "index", "engines": { "node": ">= 0.6.x" }, "files": [ "index.js" ], - "dependencies": { - "graceful-readlink": ">= 1.0.0" - }, "gitHead": "b2aad7a8471d434593a85306aa73777a526e9f75", - "bugs": { - "url": "https://github.com/tj/commander.js/issues" - }, "homepage": "https://github.com/tj/commander.js#readme", - "_id": "commander@2.9.0", - "_shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", - "_from": "commander@>=2.8.1 <3.0.0", - "_npmVersion": "2.11.3", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "zhiyelee", - "email": "zhiyelee@gmail.com" - }, - "dist": { - "shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", - "tarball": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz" - }, + "keywords": [ + "command", + "option", + "parser" + ], + "license": "MIT", + "main": "index", "maintainers": [ { "name": "tjholowaychuk", @@ -65,7 +91,15 @@ "email": "zhiyelee@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "readme": "ERROR: No README data found!" + "name": "commander", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tj/commander.js.git" + }, + "scripts": { + "test": "make test" + }, + "version": "2.9.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json index e2bc77284d01bc..329219aec9a943 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json @@ -1,15 +1,64 @@ { - "name": "generate-function", - "version": "2.0.0", + "_args": [ + [ + { + "raw": "generate-function@^2.0.0", + "scope": null, + "escapedName": "generate-function", + "name": "generate-function", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + ] + ], + "_from": "generate-function@>=2.0.0 <3.0.0", + "_id": "generate-function@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/generate-function", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "raw": "generate-function@^2.0.0", + "scope": null, + "escapedName": "generate-function", + "name": "generate-function", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", + "_shrinkwrap": null, + "_spec": "generate-function@^2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/generate-function/issues" + }, + "dependencies": {}, "description": "Module that helps you write generated functions in Node", - "main": "index.js", - "scripts": { - "test": "tape test.js" + "devDependencies": { + "tape": "^2.13.4" }, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-function.git" + "directories": {}, + "dist": { + "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", + "tarball": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" }, + "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149", + "homepage": "https://github.com/mafintosh/generate-function", "keywords": [ "generate", "code", @@ -17,21 +66,23 @@ "function", "performance" ], - "author": { - "name": "Mathias Buus" - }, "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/generate-function/issues" + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "generate-function", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/generate-function.git" }, - "homepage": "https://github.com/mafintosh/generate-function", - "devDependencies": { - "tape": "^2.13.4" + "scripts": { + "test": "tape test.js" }, - "readme": "# generate-function\n\nModule that helps you write generated functions in Node\n\n```\nnpm install generate-function\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function)\n\n## Disclamer\n\nWriting code that generates code is hard.\nYou should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc).\n\n## Usage\n\n``` js\nvar genfun = require('generate-function')\n\nvar addNumber = function(val) {\n var fn = genfun()\n ('function add(n) {')\n ('return n + %d', val) // supports format strings to insert values\n ('}')\n\n return fn.toFunction() // will compile the function\n}\n\nvar add2 = addNumber(2)\n\nconsole.log('1+2=', add2(1))\nconsole.log(add2.toString()) // prints the generated function\n```\n\nIf you need to close over variables in your generated function pass them to `toFunction(scope)`\n\n``` js\nvar multiply = function(a, b) {\n return a * b\n}\n\nvar addAndMultiplyNumber = function(val) {\n var fn = genfun()\n ('function(n) {')\n ('if (typeof n !== \"number\") {') // ending a line with { will indent the source\n ('throw new Error(\"argument should be a number\")')\n ('}')\n ('var result = multiply(%d, n+%d)', val, val)\n ('return result')\n ('}')\n\n // use fn.toString() if you want to see the generated source\n\n return fn.toFunction({\n multiply: multiply\n })\n}\n\nvar addAndMultiply2 = addAndMultiplyNumber(2)\n\nconsole.log('(3 + 2) * 2 =', addAndMultiply2(3))\n```\n\n## Related\n\nSee [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that\ncan be used to reference an object property\n\n## License\n\nMIT", - "readmeFilename": "README.md", - "_id": "generate-function@2.0.0", - "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "_from": "generate-function@>=2.0.0 <3.0.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md index 9846a8bb9fc51b..ef1d00b62f8022 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md @@ -16,7 +16,7 @@ Install ------- npm install is-property - + ### `require("is-property")(str)` Checks if str is a property diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json index 41225e266e4c80..13c59a3483c979 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json @@ -1,22 +1,67 @@ { - "name": "is-property", - "version": "1.0.2", - "description": "Tests if a JSON property can be accessed using . syntax", - "main": "is-property.js", - "directories": { - "test": "test" + "_args": [ + [ + { + "raw": "is-property@^1.0.0", + "scope": null, + "escapedName": "is-property", + "name": "is-property", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property" + ] + ], + "_from": "is-property@>=1.0.0 <2.0.0", + "_id": "is-property@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/generate-object-property/is-property", + "_nodeVersion": "0.10.26", + "_npmUser": { + "name": "mikolalysenko", + "email": "mikolalysenko@gmail.com" + }, + "_npmVersion": "2.1.4", + "_phantomChildren": {}, + "_requested": { + "raw": "is-property@^1.0.0", + "scope": null, + "escapedName": "is-property", + "name": "is-property", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/is-my-json-valid/generate-object-property" + ], + "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", + "_shrinkwrap": null, + "_spec": "is-property@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property", + "author": { + "name": "Mikola Lysenko" + }, + "bugs": { + "url": "https://github.com/mikolalysenko/is-property/issues" }, "dependencies": {}, + "description": "Tests if a JSON property can be accessed using . syntax", "devDependencies": { "tape": "~1.0.4" }, - "scripts": { - "test": "tap test/*.js" + "directories": { + "test": "test" }, - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/is-property.git" + "dist": { + "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", + "tarball": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" }, + "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", + "homepage": "https://github.com/mikolalysenko/is-property", "keywords": [ "is", "property", @@ -26,19 +71,23 @@ ".", "[]" ], - "author": { - "name": "Mikola Lysenko" - }, "license": "MIT", - "readmeFilename": "README.md", - "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", - "bugs": { - "url": "https://github.com/mikolalysenko/is-property/issues" + "main": "is-property.js", + "maintainers": [ + { + "name": "mikolalysenko", + "email": "mikolalysenko@gmail.com" + } + ], + "name": "is-property", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/is-property.git" }, - "readme": "is-property\n===========\nTests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[\" ... \"])\n\nExample\n-------\n\n```javascript\nvar isProperty = require(\"is-property\")\n\nconsole.log(isProperty(\"foo\")) //Prints true\nconsole.log(isProperty(\"0\")) //Prints false\n```\n\nInstall\n-------\n\n npm install is-property\n \n### `require(\"is-property\")(str)`\nChecks if str is a property\n\n* `str` is a string which we will test if it is a property or not\n\n**Returns** true or false depending if str is a property\n\n## Credits\n(c) 2013 Mikola Lysenko. MIT License", - "homepage": "https://github.com/mikolalysenko/is-property#readme", - "_id": "is-property@1.0.2", - "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", - "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "_from": "is-property@>=1.0.0 <2.0.0" + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.2" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json index 0d018abfa04521..ad1db2fc767506 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json @@ -1,34 +1,85 @@ { - "name": "generate-object-property", - "version": "1.2.0", - "description": "Generate safe JS code that can used to reference a object property", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-object-property.git" + "_args": [ + [ + { + "raw": "generate-object-property@^1.1.0", + "scope": null, + "escapedName": "generate-object-property", + "name": "generate-object-property", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + ] + ], + "_from": "generate-object-property@>=1.1.0 <2.0.0", + "_id": "generate-object-property@1.2.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/generate-object-property", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" }, - "devDependencies": { - "tape": "^2.13.0" + "_npmVersion": "2.9.0", + "_phantomChildren": {}, + "_requested": { + "raw": "generate-object-property@^1.1.0", + "scope": null, + "escapedName": "generate-object-property", + "name": "generate-object-property", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" }, - "scripts": { - "test": "tape test.js" + "_requiredBy": [ + "/request/har-validator/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", + "_shrinkwrap": null, + "_spec": "generate-object-property@^1.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", + "author": { + "name": "Mathias Buus", + "url": "@mafintosh" + }, + "bugs": { + "url": "https://github.com/mafintosh/generate-object-property/issues" }, "dependencies": { "is-property": "^1.0.0" }, - "bugs": { - "url": "https://github.com/mafintosh/generate-object-property/issues" + "description": "Generate safe JS code that can used to reference a object property", + "devDependencies": { + "tape": "^2.13.0" }, + "directories": {}, + "dist": { + "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", + "tarball": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" + }, + "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c", "homepage": "https://github.com/mafintosh/generate-object-property", + "license": "MIT", "main": "index.js", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "generate-object-property", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/generate-object-property.git" }, - "license": "MIT", - "readme": "# generate-object-property\n\nGenerate safe JS code that can used to reference a object property\n\n\tnpm install generate-object-property\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property)\n\n## Usage\n\n``` js\nvar gen = require('generate-object-property');\nconsole.log(gen('a','b')); // prints a.b\nconsole.log(gen('a', 'foo-bar')); // prints a[\"foo-bar\"]\n```\n\n## License\n\nMIT", - "readmeFilename": "README.md", - "_id": "generate-object-property@1.2.0", - "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "_from": "generate-object-property@>=1.1.0 <2.0.0" + "scripts": { + "test": "tape test.js" + }, + "version": "1.2.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json index 4b0677650bcd69..c90dcced7caae7 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json @@ -1,49 +1,75 @@ { - "name": "jsonpointer", - "description": "Simple JSON Addressing.", - "tags": [ - "util", - "simple", - "util", - "utility" + "_args": [ + [ + { + "raw": "jsonpointer@2.0.0", + "scope": null, + "escapedName": "jsonpointer", + "name": "jsonpointer", + "rawSpec": "2.0.0", + "spec": "2.0.0", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + ] + ], + "_from": "jsonpointer@2.0.0", + "_id": "jsonpointer@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/jsonpointer", + "_nodeVersion": "0.10.36", + "_npmUser": { + "name": "marcbachmann", + "email": "marc.brookman@gmail.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "jsonpointer@2.0.0", + "scope": null, + "escapedName": "jsonpointer", + "name": "jsonpointer", + "rawSpec": "2.0.0", + "spec": "2.0.0", + "type": "version" + }, + "_requiredBy": [ + "/request/har-validator/is-my-json-valid" ], - "version": "2.0.0", + "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", + "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", + "_shrinkwrap": null, + "_spec": "jsonpointer@2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", "author": { "name": "Jan Lehnardt", "email": "jan@apache.org" }, + "bugs": { + "url": "http://github.com/janl/node-jsonpointer/issues" + }, "contributors": [ { "name": "Joe Hildebrand", "email": "joe-github@cursive.net" } ], - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/janl/node-jsonpointer.git" - }, - "bugs": { - "url": "http://github.com/janl/node-jsonpointer/issues" + "dependencies": {}, + "description": "Simple JSON Addressing.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", + "tarball": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" }, "engines": { "node": ">=0.6.0" }, - "main": "./jsonpointer", - "scripts": { - "test": "node test.js" - }, - "license": "MIT", "gitHead": "26ea4a5c0fcb6d9a2e87f733403791dd05637af8", "homepage": "https://github.com/janl/node-jsonpointer#readme", - "_id": "jsonpointer@2.0.0", - "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", - "_from": "jsonpointer@2.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.10.36", - "_npmUser": { - "name": "marcbachmann", - "email": "marc.brookman@gmail.com" - }, + "license": "MIT", + "main": "./jsonpointer", "maintainers": [ { "name": "jan", @@ -54,11 +80,21 @@ "email": "marc.brookman@gmail.com" } ], - "dist": { - "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", - "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" + "name": "jsonpointer", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/janl/node-jsonpointer.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "node test.js" + }, + "tags": [ + "util", + "simple", + "util", + "utility" + ], + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json index f16c4235fb1fbb..87e47bd4ff9b36 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "xtend@^4.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + { + "raw": "xtend@^4.0.0", + "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" ] ], "_from": "xtend@>=4.0.0 <5.0.0", @@ -12,16 +20,17 @@ "_location": "/request/har-validator/is-my-json-valid/xtend", "_nodeVersion": "0.10.32", "_npmUser": { - "email": "raynos2@gmail.com", - "name": "raynos" + "name": "raynos", + "email": "raynos2@gmail.com" }, "_npmVersion": "2.14.1", "_phantomChildren": {}, "_requested": { - "name": "xtend", "raw": "xtend@^4.0.0", - "rawSpec": "^4.0.0", "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "^4.0.0", "spec": ">=4.0.0 <5.0.0", "type": "range" }, @@ -32,14 +41,14 @@ "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", "_shrinkwrap": null, "_spec": "xtend@^4.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", "author": { - "email": "raynos2@gmail.com", - "name": "Raynos" + "name": "Raynos", + "email": "raynos2@gmail.com" }, "bugs": { - "email": "raynos2@gmail.com", - "url": "https://github.com/Raynos/xtend/issues" + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" }, "contributors": [ { @@ -57,7 +66,7 @@ "directories": {}, "dist": { "shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "tarball": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" }, "engines": { "node": ">=0.4" @@ -65,12 +74,12 @@ "gitHead": "23dc302a89756da89c1897bc732a752317e35390", "homepage": "https://github.com/Raynos/xtend", "keywords": [ - "array", "extend", "merge", - "object", "options", - "opts" + "opts", + "object", + "array" ], "license": "MIT", "main": "immutable", @@ -91,19 +100,19 @@ "test": "node test" }, "testling": { + "files": "test.js", "browsers": [ - "chrome/22..latest", - "chrome/canary", + "ie/7..latest", "firefox/16..latest", "firefox/nightly", - "ie/7..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", + "chrome/22..latest", + "chrome/canary", "opera/12..latest", "opera/next", - "safari/5.1..latest" - ], - "files": "test.js" + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest" + ] }, "version": "4.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json index 97fba32e742564..aedffd1037d5fc 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "is-my-json-valid@^2.12.4", + { + "raw": "is-my-json-valid@^2.12.4", + "scope": null, + "escapedName": "is-my-json-valid", + "name": "is-my-json-valid", + "rawSpec": "^2.12.4", + "spec": ">=2.12.4 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/is-my-json-valid-2.13.1.tgz_1456180270224_0.17748022079467773" }, "_npmUser": { - "email": "mathiasbuus@gmail.com", - "name": "mafintosh" + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" }, "_npmVersion": "2.14.7", "_phantomChildren": {}, "_requested": { - "name": "is-my-json-valid", "raw": "is-my-json-valid@^2.12.4", - "rawSpec": "^2.12.4", "scope": null, + "escapedName": "is-my-json-valid", + "name": "is-my-json-valid", + "rawSpec": "^2.12.4", "spec": ">=2.12.4 <3.0.0", "type": "range" }, @@ -56,7 +65,7 @@ "directories": {}, "dist": { "shasum": "d55778a82feb6b0963ff4be111d5d1684e890707", - "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" + "tarball": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" }, "gitHead": "5bacc71441750bc6e79829abcfc21d4f2f0c4396", "homepage": "https://github.com/mafintosh/is-my-json-valid", @@ -70,20 +79,20 @@ "main": "index.js", "maintainers": [ { - "email": "freeall@gmail.com", - "name": "freeall" + "name": "freeall", + "email": "freeall@gmail.com" }, { - "email": "mathiasbuus@gmail.com", - "name": "mafintosh" + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" }, { - "email": "w@tson.dk", - "name": "watson" + "name": "watson", + "email": "w@tson.dk" }, { - "email": "i@yoshuawuyts.com", - "name": "yoshuawuyts" + "name": "yoshuawuyts", + "email": "i@yoshuawuyts.com" } ], "name": "is-my-json-valid", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json index f66690fe1bbff5..cbb7f46bf8bc5b 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json @@ -74,7 +74,7 @@ "description": "forbidden property", "schema": { "properties": { - "foo": { + "foo": { "not": {} } } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json index 8cebb11e4c5584..c034b70c549182 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "pinkie@^2.0.0", + { + "raw": "pinkie@^2.0.0", + "scope": null, + "escapedName": "pinkie", + "name": "pinkie", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise" ] ], @@ -12,16 +20,17 @@ "_location": "/request/har-validator/pinkie-promise/pinkie", "_nodeVersion": "4.2.4", "_npmUser": { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" }, "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { - "name": "pinkie", "raw": "pinkie@^2.0.0", - "rawSpec": "^2.0.0", "scope": null, + "escapedName": "pinkie", + "name": "pinkie", + "rawSpec": "^2.0.0", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "pinkie@^2.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise", "author": { - "email": "floatdrop@gmail.com", "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", "url": "github.com/floatdrop" }, "bugs": { @@ -54,7 +63,7 @@ "directories": {}, "dist": { "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", - "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "tarball": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" }, "engines": { "node": ">=0.10.0" @@ -73,8 +82,8 @@ "license": "MIT", "maintainers": [ { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" } ], "name": "pinkie", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md index 54747f60cc538b..1565f95889661b 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md @@ -51,7 +51,7 @@ Returns new instance of `Promise`. ##### executor -*Required* +*Required* Type: `function` Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json index 438996b7ea8bf1..b09c56001ed8dc 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "pinkie-promise@^2.0.0", + { + "raw": "pinkie-promise@^2.0.0", + "scope": null, + "escapedName": "pinkie-promise", + "name": "pinkie-promise", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/pinkie-promise-2.0.1.tgz_1460309839126_0.3422858319245279" }, "_npmUser": { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" }, "_npmVersion": "2.14.20", "_phantomChildren": {}, "_requested": { - "name": "pinkie-promise", "raw": "pinkie-promise@^2.0.0", - "rawSpec": "^2.0.0", "scope": null, + "escapedName": "pinkie-promise", + "name": "pinkie-promise", + "rawSpec": "^2.0.0", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -38,8 +47,8 @@ "_spec": "pinkie-promise@^2.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator", "author": { - "email": "floatdrop@gmail.com", "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", "url": "github.com/floatdrop" }, "bugs": { @@ -76,8 +85,8 @@ "license": "MIT", "maintainers": [ { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" } ], "name": "pinkie-promise", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/package.json b/deps/npm/node_modules/request/node_modules/har-validator/package.json index 76f57480e6e320..269c1490cd81a9 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/package.json @@ -1,31 +1,40 @@ { "_args": [ [ - "har-validator@~2.0.2", + { + "raw": "har-validator@~2.0.6", + "scope": null, + "escapedName": "har-validator", + "name": "har-validator", + "rawSpec": "~2.0.6", + "spec": ">=2.0.6 <2.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "har-validator@>=2.0.2 <2.1.0", + "_from": "har-validator@>=2.0.6 <2.1.0", "_id": "har-validator@2.0.6", "_inCache": true, "_installable": true, "_location": "/request/har-validator", "_nodeVersion": "5.2.0", "_npmUser": { - "email": "ahmad@ahmadnassri.com", - "name": "ahmadnassri" + "name": "ahmadnassri", + "email": "ahmad@ahmadnassri.com" }, "_npmVersion": "3.3.12", "_phantomChildren": { "ansi-regex": "2.0.0", - "strip-ansi": "3.0.0" + "strip-ansi": "3.0.1" }, "_requested": { - "name": "har-validator", - "raw": "har-validator@~2.0.2", - "rawSpec": "~2.0.2", + "raw": "har-validator@~2.0.6", "scope": null, - "spec": ">=2.0.2 <2.1.0", + "escapedName": "har-validator", + "name": "har-validator", + "rawSpec": "~2.0.6", + "spec": ">=2.0.6 <2.1.0", "type": "range" }, "_requiredBy": [ @@ -34,11 +43,11 @@ "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", "_shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d", "_shrinkwrap": null, - "_spec": "har-validator@~2.0.2", + "_spec": "har-validator@~2.0.6", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "ahmad@ahmadnassri.com", "name": "Ahmad Nassri", + "email": "ahmad@ahmadnassri.com", "url": "https://www.ahmadnassri.com/" }, "bin": { @@ -66,7 +75,7 @@ "directories": {}, "dist": { "shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d", - "tarball": "http://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz" + "tarball": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz" }, "echint": { "ignore": [ @@ -83,9 +92,9 @@ "gitHead": "92ccddad2e5d13e6e32c764e06c347d67805b211", "homepage": "https://github.com/ahmadnassri/har-validator", "keywords": [ - "archive", "har", "http", + "archive", "validate", "validator" ], diff --git a/deps/npm/node_modules/request/node_modules/hawk/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/.npmignore index ab108bf92f34a7..70febc05e4f360 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/.npmignore @@ -17,3 +17,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/.travis.yml index 77795c6a9b47df..047f7e3d5e1e39 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/.travis.yml @@ -2,3 +2,4 @@ language: node_js node_js: - 0.10 + diff --git a/deps/npm/node_modules/request/node_modules/hawk/README.md b/deps/npm/node_modules/request/node_modules/hawk/README.md index 63725034fc5e72..4aff23f3a3f7c5 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/README.md +++ b/deps/npm/node_modules/request/node_modules/hawk/README.md @@ -75,12 +75,12 @@ and the server. ## Replay Protection -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when +Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more +than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when making requests. This gives the server enough information to prevent replay attacks. The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. +key identifier combination. The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. @@ -373,7 +373,7 @@ and for a finite period of time. Both the client and server can issue bewit cred credentials as the client to maintain clear traceability as to who issued which credentials. In order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within -the granted access timeframe. +the granted access timeframe. ## Bewit Usage Example @@ -496,7 +496,7 @@ which can often affect how the request body is interpreted by the server. If the or value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the `ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC. -The response authentication, when performed, only covers the response payload, content-type, and the request information +The response authentication, when performed, only covers the response payload, content-type, and the request information provided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or any other response header field (e.g. Location) which can affect the client's behaviour. diff --git a/deps/npm/node_modules/request/node_modules/hawk/example/usage.js b/deps/npm/node_modules/request/node_modules/hawk/example/usage.js index 64fe17674a5753..13b860b4c5ad8a 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/example/usage.js +++ b/deps/npm/node_modules/request/node_modules/hawk/example/usage.js @@ -75,3 +75,4 @@ credentialsFunc('dh37fgj492je', function (err, credentials) { process.exit(0); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/client.js b/deps/npm/node_modules/request/node_modules/hawk/lib/client.js index f9ae69171343bd..b3e8649e3a6215 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/lib/client.js +++ b/deps/npm/node_modules/request/node_modules/hawk/lib/client.js @@ -364,3 +364,6 @@ exports.message = function (host, port, message, options) { return result; }; + + + diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/index.js b/deps/npm/node_modules/request/node_modules/hawk/lib/index.js index 911b906aabdaed..a883882c8c538c 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/hawk/lib/index.js @@ -12,3 +12,4 @@ exports.uri = { authenticate: exports.server.authenticateBewit, getBewit: exports.client.getBewit }; + diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js b/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js index 2da3343904aeab..28a35118ff8c00 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js @@ -181,3 +181,4 @@ exports.unauthorized = function (message, attributes) { return Boom.unauthorized(message, 'Hawk', attributes); }; + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore index b0939eabe34d2d..77ba16cb055ca5 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore @@ -15,3 +15,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml index 7a64dd2210cb10..dd1b24f13ac1f8 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml @@ -5,3 +5,4 @@ node_js: - 4.0 sudo: false + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json index 42749188a596be..c95a8315cc02fa 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "boom@2.x.x", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/hawk" + { + "raw": "boom@2.x.x", + "scope": null, + "escapedName": "boom", + "name": "boom", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" ] ], "_from": "boom@>=2.0.0 <3.0.0", @@ -12,16 +20,17 @@ "_location": "/request/hawk/boom", "_nodeVersion": "0.10.40", "_npmUser": { - "email": "arbretz@gmail.com", - "name": "arb" + "name": "arb", + "email": "arbretz@gmail.com" }, "_npmVersion": "2.11.1", "_phantomChildren": {}, "_requested": { - "name": "boom", "raw": "boom@2.x.x", - "rawSpec": "2.x.x", "scope": null, + "escapedName": "boom", + "name": "boom", + "rawSpec": "2.x.x", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -33,7 +42,7 @@ "_shasum": "39c8918ceff5799f83f9492a848f625add0c766f", "_shrinkwrap": null, "_spec": "boom@2.x.x", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/hawk", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", "bugs": { "url": "https://github.com/hapijs/boom/issues" }, @@ -48,7 +57,7 @@ "directories": {}, "dist": { "shasum": "39c8918ceff5799f83f9492a848f625add0c766f", - "tarball": "http://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + "tarball": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" }, "engines": { "node": ">=0.10.40" diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore index b0939eabe34d2d..77ba16cb055ca5 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore @@ -15,3 +15,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml index 7a64dd2210cb10..dd1b24f13ac1f8 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml @@ -5,3 +5,4 @@ node_js: - 4.0 sudo: false + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js index c8a046d7433235..f385870ee68e3a 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js @@ -64,3 +64,5 @@ exports.fixedTimeComparison = function (a, b) { return (mismatch === 0); }; + + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json index c65fd094047c73..6783bde465e7e6 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json @@ -1,50 +1,75 @@ { - "name": "cryptiles", - "description": "General purpose crypto utilities", - "version": "2.0.5", - "repository": { - "type": "git", - "url": "git://github.com/hapijs/cryptiles.git" + "_args": [ + [ + { + "raw": "cryptiles@2.x.x", + "scope": null, + "escapedName": "cryptiles", + "name": "cryptiles", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" + ] + ], + "_from": "cryptiles@>=2.0.0 <3.0.0", + "_id": "cryptiles@2.0.5", + "_inCache": true, + "_installable": true, + "_location": "/request/hawk/cryptiles", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "hueniverse", + "email": "eran@hammer.io" }, - "main": "lib/index.js", - "keywords": [ - "cryptography", - "security", - "utilites" + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "raw": "cryptiles@2.x.x", + "scope": null, + "escapedName": "cryptiles", + "name": "cryptiles", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/hawk" ], - "engines": { - "node": ">=0.10.40" + "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "_shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", + "_shrinkwrap": null, + "_spec": "cryptiles@2.x.x", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/cryptiles/issues" }, "dependencies": { "boom": "2.x.x" }, + "description": "General purpose crypto utilities", "devDependencies": { "code": "1.x.x", "lab": "5.x.x" }, - "scripts": { - "test": "lab -a code -t 100 -L", - "test-cov-html": "lab -a code -r html -o coverage.html" - }, - "license": "BSD-3-Clause", - "gitHead": "9bc5a852f01cd51e615814e1cb255fe2df810649", - "bugs": { - "url": "https://github.com/hapijs/cryptiles/issues" - }, - "homepage": "https://github.com/hapijs/cryptiles#readme", - "_id": "cryptiles@2.0.5", - "_shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", - "_from": "cryptiles@>=2.0.0 <3.0.0", - "_npmVersion": "2.14.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "hueniverse", - "email": "eran@hammer.io" - }, + "directories": {}, "dist": { "shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", - "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + "tarball": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + }, + "engines": { + "node": ">=0.10.40" }, + "gitHead": "9bc5a852f01cd51e615814e1cb255fe2df810649", + "homepage": "https://github.com/hapijs/cryptiles#readme", + "keywords": [ + "cryptography", + "security", + "utilites" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", "maintainers": [ { "name": "hueniverse", @@ -55,7 +80,16 @@ "email": "ceejceej@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "readme": "ERROR: No README data found!" + "name": "cryptiles", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/cryptiles.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L", + "test-cov-html": "lab -a code -r html -o coverage.html" + }, + "version": "2.0.5" } diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json index 6e76778c7aa5f3..1dbb2af39eefa6 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json @@ -1,36 +1,97 @@ { - "name": "hoek", - "description": "General purpose node utilities", - "version": "2.16.3", - "repository": { - "type": "git", - "url": "git://github.com/hapijs/hoek.git" + "_args": [ + [ + { + "raw": "hoek@2.x.x", + "scope": null, + "escapedName": "hoek", + "name": "hoek", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" + ] + ], + "_from": "hoek@>=2.0.0 <3.0.0", + "_id": "hoek@2.16.3", + "_inCache": true, + "_installable": true, + "_location": "/request/hawk/hoek", + "_nodeVersion": "4.1.0", + "_npmUser": { + "name": "nlf", + "email": "quitlahok@gmail.com" }, - "main": "lib/index.js", - "keywords": [ - "utilities" + "_npmVersion": "3.3.3", + "_phantomChildren": {}, + "_requested": { + "raw": "hoek@2.x.x", + "scope": null, + "escapedName": "hoek", + "name": "hoek", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/hawk", + "/request/hawk/boom", + "/request/hawk/sntp" ], - "engines": { - "node": ">=0.10.40" + "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "_shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed", + "_shrinkwrap": null, + "_spec": "hoek@2.x.x", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/hoek/issues" }, "dependencies": {}, + "description": "General purpose node utilities", "devDependencies": { "code": "1.x.x", "lab": "5.x.x" }, + "directories": {}, + "dist": { + "shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed", + "tarball": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, + "engines": { + "node": ">=0.10.40" + }, + "gitHead": "20f36e85616264d4b73a64a374803175213a9121", + "homepage": "https://github.com/hapijs/hoek#readme", + "keywords": [ + "utilities" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + { + "name": "wyatt", + "email": "wpreul@gmail.com" + }, + { + "name": "nlf", + "email": "quitlahok@gmail.com" + } + ], + "name": "hoek", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/hoek.git" + }, "scripts": { "test": "lab -a code -t 100 -L", "test-cov-html": "lab -a code -t 100 -L -r html -o coverage.html" }, - "license": "BSD-3-Clause", - "readme": "![hoek Logo](https://raw.github.com/hapijs/hoek/master/images/hoek.png)\n\nUtility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore).\n\n[![Build Status](https://secure.travis-ci.org/hapijs/hoek.svg)](http://travis-ci.org/hapijs/hoek)\n\nLead Maintainer: [Nathan LaFreniere](https://github.com/nlf)\n\n# Table of Contents\n\n* [Introduction](#introduction \"Introduction\")\n* [Object](#object \"Object\")\n * [clone](#cloneobj \"clone\")\n * [cloneWithShallow](#clonewithshallowobj-keys \"cloneWithShallow\")\n * [merge](#mergetarget-source-isnulloverride-ismergearrays \"merge\")\n * [applyToDefaults](#applytodefaultsdefaults-options-isnulloverride \"applyToDefaults\")\n * [applyToDefaultsWithShallow](#applytodefaultswithshallowdefaults-options-keys \"applyToDefaultsWithShallow\")\n * [deepEqual](#deepequala-b \"deepEqual\")\n * [unique](#uniquearray-key \"unique\")\n * [mapToObject](#maptoobjectarray-key \"mapToObject\")\n * [intersect](#intersectarray1-array2 \"intersect\")\n * [contain](#containref-values-options \"contain\")\n * [flatten](#flattenarray-target \"flatten\")\n * [reach](#reachobj-chain-options \"reach\")\n * [reachTemplate](#reachtemplateobj-template-options \"reachTemplate\")\n * [transform](#transformobj-transform-options \"transform\")\n * [shallow](#shallowobj \"shallow\")\n * [stringify](#stringifyobj \"stringify\")\n* [Timer](#timer \"Timer\")\n* [Bench](#bench \"Bench\")\n* [Binary Encoding/Decoding](#binary-encodingdecoding \"Binary Encoding/Decoding\")\n * [base64urlEncode](#base64urlencodevalue \"binary64urlEncode\")\n * [base64urlDecode](#base64urldecodevalue \"binary64urlDecode\")\n* [Escaping Characters](#escaping-characters \"Escaping Characters\")\n * [escapeHtml](#escapehtmlstring \"escapeHtml\")\n * [escapeHeaderAttribute](#escapeheaderattributeattribute \"escapeHeaderAttribute\")\n * [escapeRegex](#escaperegexstring \"escapeRegex\")\n* [Errors](#errors \"Errors\")\n * [assert](#assertcondition-message \"assert\")\n * [abort](#abortmessage \"abort\")\n * [displayStack](#displaystackslice \"displayStack\")\n * [callStack](#callstackslice \"callStack\")\n* [Function](#function \"Function\")\n * [nextTick](#nexttickfn \"nextTick\")\n * [once](#oncefn \"once\")\n * [ignore](#ignore \"ignore\")\n* [Miscellaneous](#miscellaneous \"Miscellaneous\")\n * [uniqueFilename](#uniquefilenamepath-extension \"uniqueFilename\")\n * [isAbsolutePath](#isabsolutepathpath-platform \"isAbsolutePath\")\n * [isInteger](#isintegervalue \"isInteger\")\n\n\n\n# Introduction\n\nThe *Hoek* library contains some common functions used within the hapi ecosystem. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.\n\nFor example, to use Hoek to set configuration with default options:\n```javascript\nvar Hoek = require('hoek');\n\nvar default = {url : \"www.github.com\", port : \"8000\", debug : true};\n\nvar config = Hoek.applyToDefaults(default, {port : \"3000\", admin : true});\n\n// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }\n```\n\nUnder each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the `var Hoek = require('hoek');` is omitted for brevity.\n\n## Object\n\nHoek provides several helpful methods for objects and arrays.\n\n### clone(obj)\n\nThis method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects, as well as non-enumerable properties).\n\n```javascript\n\nvar nestedObj = {\n w: /^something$/ig,\n x: {\n a: [1, 2, 3],\n b: 123456,\n c: new Date()\n },\n y: 'y',\n z: new Date()\n };\n\nvar copy = Hoek.clone(nestedObj);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y); // results in 'y'\nconsole.log(nestedObj.x.b); // results in 123456\nconsole.log(copy.x.b); // results in 100\n```\n\n### cloneWithShallow(obj, keys)\nkeys is an array of key names to shallow copy\n\nThis method is also used to clone an object or array, however any keys listed in the `keys` array are shallow copied while those not listed are deep copied.\n\n```javascript\n\nvar nestedObj = {\n w: /^something$/ig,\n x: {\n a: [1, 2, 3],\n b: 123456,\n c: new Date()\n },\n y: 'y',\n z: new Date()\n };\n\nvar copy = Hoek.cloneWithShallow(nestedObj, ['x']);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y); // results in 'y'\nconsole.log(nestedObj.x.b); // results in 100\nconsole.log(copy.x.b); // results in 100\n```\n\n### merge(target, source, isNullOverride, isMergeArrays)\nisNullOverride, isMergeArrays default to true\n\nMerge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied.\nMerge is destructive where the target is modified. For non destructive merge, use `applyToDefaults`.\n\n\n```javascript\n\nvar target = {a: 1, b : 2};\nvar source = {a: 0, c: 5};\nvar source2 = {a: null, c: 5};\n\nHoek.merge(target, source); // results in {a: 0, b: 2, c: 5}\nHoek.merge(target, source2); // results in {a: null, b: 2, c: 5}\nHoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}\n\nvar targetArray = [1, 2, 3];\nvar sourceArray = [4, 5];\n\nHoek.merge(targetArray, sourceArray); // results in [1, 2, 3, 4, 5]\nHoek.merge(targetArray, sourceArray, true, false); // results in [4, 5]\n```\n\n### applyToDefaults(defaults, options, isNullOverride)\nisNullOverride defaults to false\n\nApply options to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options); // results in { host: \"localhost\", port: 8080 }\n```\n\nApply options with a null value to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { host: null, port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options, true); // results in { host: null, port: 8080 }\n```\n\n### applyToDefaultsWithShallow(defaults, options, keys)\nkeys is an array of key names to shallow copy\n\nApply options to a copy of the defaults. Keys specified in the last parameter are shallow copied from options instead of merged.\n\n```javascript\n\nvar defaults = {\n server: {\n host: \"localhost\",\n port: 8000\n },\n name: 'example'\n };\n\nvar options = { server: { port: 8080 } };\n\nvar config = Hoek.applyToDefaultsWithShallow(defaults, options, ['server']); // results in { server: { port: 8080 }, name: 'example' }\n```\n\n### deepEqual(b, a, [options])\n\nPerforms a deep comparison of the two values including support for circular dependencies, prototype, and properties. To skip prototype comparisons, use `options.prototype = false`\n\n```javascript\nHoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true\nHoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true\nHoek.deepEqual(Object.create(null), {}); //results in false\n```\n\n### unique(array, key)\n\nRemove duplicate items from Array\n\n```javascript\n\nvar array = [1, 2, 2, 3, 3, 4, 5, 6];\n\nvar newArray = Hoek.unique(array); // results in [1,2,3,4,5,6]\n\narray = [{id: 1}, {id: 1}, {id: 2}];\n\nnewArray = Hoek.unique(array, \"id\"); // results in [{id: 1}, {id: 2}]\n```\n\n### mapToObject(array, key)\n\nConvert an Array into an Object\n\n```javascript\n\nvar array = [1,2,3];\nvar newObject = Hoek.mapToObject(array); // results in [{\"1\": true}, {\"2\": true}, {\"3\": true}]\n\narray = [{id: 1}, {id: 2}];\nnewObject = Hoek.mapToObject(array, \"id\"); // results in [{\"id\": 1}, {\"id\": 2}]\n```\n\n### intersect(array1, array2)\n\nFind the common unique items in two arrays\n\n```javascript\n\nvar array1 = [1, 2, 3];\nvar array2 = [1, 4, 5];\n\nvar newArray = Hoek.intersect(array1, array2); // results in [1]\n```\n\n### contain(ref, values, [options])\n\nTests if the reference value contains the provided values where:\n- `ref` - the reference string, array, or object.\n- `values` - a single or array of values to find within the `ref` value. If `ref` is an object, `values` can be a key name,\n an array of key names, or an object with key-value pairs to compare.\n- `options` - an optional object with the following optional settings:\n - `deep` - if `true`, performed a deep comparison of the values.\n - `once` - if `true`, allows only one occurrence of each value.\n - `only` - if `true`, does not allow values not explicitly listed.\n - `part` - if `true`, allows partial match of the values (at least one must always match).\n\nNote: comparing a string to overlapping values will result in failed comparison (e.g. `contain('abc', ['ab', 'bc'])`).\nAlso, if an object key's value does not match the provided value, `false` is returned even when `part` is specified.\n\n```javascript\nHoek.contain('aaa', 'a', { only: true });\t\t\t\t\t\t\t// true\nHoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true });\t\t\t\t// true\nHoek.contain([1, 2, 2], [1, 2], { once: true });\t\t\t\t\t// false\nHoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true\n```\n\n### flatten(array, [target])\n\nFlatten an array\n\n```javascript\n\nvar array = [1, [2, 3]];\n\nvar flattenedArray = Hoek.flatten(array); // results in [1, 2, 3]\n\narray = [1, [2, 3]];\ntarget = [4, [5]];\n\nflattenedArray = Hoek.flatten(array, target); // results in [4, [5], 1, 2, 3]\n```\n\n### reach(obj, chain, [options])\n\nConverts an object key chain string to reference\n\n- `options` - optional settings\n - `separator` - string to split chain path on, defaults to '.'\n - `default` - value to return if the path or value is not present, default is `undefined`\n - `strict` - if `true`, will throw an error on missing member, default is `false`\n - `functions` - if `true` allow traversing functions for properties. `false` will throw an error if a function is part of the chain.\n\nA chain including negative numbers will work like negative indices on an\narray.\n\nIf chain is `null`, `undefined` or `false`, the object itself will be returned.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reach(obj, chain); // returns 1\n\nvar chain = 'a.b.-1';\nvar obj = {a : {b : [2,3,6]}};\n\nHoek.reach(obj, chain); // returns 6\n```\n\n### reachTemplate(obj, template, [options])\n\nReplaces string parameters (`{name}`) with their corresponding object key values by applying the\n(`reach()`)[#reachobj-chain-options] method where:\n\n- `obj` - the context object used for key lookup.\n- `template` - a string containing `{}` parameters.\n- `options` - optional (`reach()`)[#reachobj-chain-options] options.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'\n```\n\n### transform(obj, transform, [options])\n\nTransforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options. The first argument can also be an array of objects. In that case the method will return an array of transformed objects.\n\n```javascript\nvar source = {\n address: {\n one: '123 main street',\n two: 'PO Box 1234'\n },\n title: 'Warehouse',\n state: 'CA'\n};\n\nvar result = Hoek.transform(source, {\n 'person.address.lineOne': 'address.one',\n 'person.address.lineTwo': 'address.two',\n 'title': 'title',\n 'person.address.region': 'state'\n});\n// Results in\n// {\n// person: {\n// address: {\n// lineOne: '123 main street',\n// lineTwo: 'PO Box 1234',\n// region: 'CA'\n// }\n// },\n// title: 'Warehouse'\n// }\n```\n\n### shallow(obj)\n\nPerforms a shallow copy by copying the references of all the top level children where:\n- `obj` - the object to be copied.\n\n```javascript\nvar shallow = Hoek.shallow({ a: { b: 1 } });\n```\n\n### stringify(obj)\n\nConverts an object to string using the built-in `JSON.stringify()` method with the difference that any errors are caught\nand reported back in the form of the returned string. Used as a shortcut for displaying information to the console (e.g. in\nerror message) without the need to worry about invalid conversion.\n\n```javascript\nvar a = {};\na.b = a;\nHoek.stringify(a);\t\t// Returns '[Cannot display object: Converting circular structure to JSON]'\n```\n\n# Timer\n\nA Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\n\n```javascript\n\nvar timerObj = new Hoek.Timer();\nconsole.log(\"Time is now: \" + timerObj.ts);\nconsole.log(\"Elapsed time from initialization: \" + timerObj.elapsed() + 'milliseconds');\n```\n\n\n# Bench\n\nSame as Timer with the exception that `ts` stores the internal node clock which is not related to `Date.now()` and cannot be used to display\nhuman-readable timestamps. More accurate for benchmarking or internal timers.\n\n# Binary Encoding/Decoding\n\n### base64urlEncode(value)\n\nEncodes value in Base64 or URL encoding\n\n### base64urlDecode(value)\n\nDecodes data in Base64 or URL encoding.\n# Escaping Characters\n\nHoek provides convenient methods for escaping html characters. The escaped characters are as followed:\n\n```javascript\n\ninternals.htmlEscaped = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n```\n\n### escapeHtml(string)\n\n```javascript\n\nvar string = ' hey ';\nvar escapedString = Hoek.escapeHtml(string); // returns <html> hey </html>\n```\n\n### escapeHeaderAttribute(attribute)\n\nEscape attribute value for use in HTTP header\n\n```javascript\n\nvar a = Hoek.escapeHeaderAttribute('I said \"go w\\\\o me\"'); //returns I said \\\"go w\\\\o me\\\"\n```\n\n\n### escapeRegex(string)\n\nEscape string for Regex construction\n\n```javascript\n\nvar a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\\\/`\"(>)[<]d{}s,'); // returns 4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`\"\\(>\\)\\[<\\]d\\{\\}s\\,\n```\n\n# Errors\n\n### assert(condition, message)\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, 'a should equal b'); // Throws 'a should equal b'\n```\n\nNote that you may also pass an already created Error object as the second parameter, and `assert` will throw that object.\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, new Error('a should equal b')); // Throws the given error object\n```\n\n### abort(message)\n\nFirst checks if `process.env.NODE_ENV === 'test'`, and if so, throws error message. Otherwise,\ndisplays most recent stack and then exits process.\n\n\n\n### displayStack(slice)\n\nDisplays the trace stack\n\n```javascript\n\nvar stack = Hoek.displayStack();\nconsole.log(stack); // returns something like:\n\n[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',\n 'Module._compile (module.js:449:26)',\n 'Module._extensions..js (module.js:467:10)',\n 'Module.load (module.js:356:32)',\n 'Module._load (module.js:312:12)',\n 'Module.runMain (module.js:492:10)',\n 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]\n```\n\n### callStack(slice)\n\nReturns a trace stack array.\n\n```javascript\n\nvar stack = Hoek.callStack();\nconsole.log(stack); // returns something like:\n\n[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],\n [ 'module.js', 449, 26, 'Module._compile', false ],\n [ 'module.js', 467, 10, 'Module._extensions..js', false ],\n [ 'module.js', 356, 32, 'Module.load', false ],\n [ 'module.js', 312, 12, 'Module._load', false ],\n [ 'module.js', 492, 10, 'Module.runMain', false ],\n [ 'node.js',\n 244,\n 9,\n 'startup.processNextTick.process._tickCallback',\n false ] ]\n```\n\n## Function\n\n### nextTick(fn)\n\nReturns a new function that wraps `fn` in `process.nextTick`.\n\n```javascript\n\nvar myFn = function () {\n console.log('Do this later');\n};\n\nvar nextFn = Hoek.nextTick(myFn);\n\nnextFn();\nconsole.log('Do this first');\n\n// Results in:\n//\n// Do this first\n// Do this later\n```\n\n### once(fn)\n\nReturns a new function that can be run multiple times, but makes sure `fn` is only run once.\n\n```javascript\n\nvar myFn = function () {\n console.log('Ran myFn');\n};\n\nvar onceFn = Hoek.once(myFn);\nonceFn(); // results in \"Ran myFn\"\nonceFn(); // results in undefined\n```\n\n### ignore\n\nA simple no-op function. It does nothing at all.\n\n## Miscellaneous\n\n### uniqueFilename(path, extension)\n`path` to prepend with the randomly generated file name. `extension` is the optional file extension, defaults to `''`.\n\nReturns a randomly generated file name at the specified `path`. The result is a fully resolved path to a file.\n\n```javascript\nvar result = Hoek.uniqueFilename('./test/modules', 'txt'); // results in \"full/path/test/modules/{random}.txt\"\n```\n\n### isAbsolutePath(path, [platform])\n\nDetermines whether `path` is an absolute path. Returns `true` or `false`.\n\n- `path` - A file path to test for whether it is absolute or not.\n- `platform` - An optional parameter used for specifying the platform. Defaults to `process.platform`.\n\n### isInteger(value)\n\nCheck `value` to see if it is an integer. Returns true/false.\n\n```javascript\nvar result = Hoek.isInteger('23')\n```\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hapijs/hoek/issues" - }, - "homepage": "https://github.com/hapijs/hoek#readme", - "_id": "hoek@2.16.3", - "_shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed", - "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "_from": "hoek@>=2.0.0 <3.0.0" + "version": "2.16.3" } diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore index b0939eabe34d2d..77ba16cb055ca5 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore @@ -15,3 +15,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml index 77795c6a9b47df..047f7e3d5e1e39 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml @@ -2,3 +2,4 @@ language: node_js node_js: - 0.10 + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile index 43189de8e3577e..417fd93708605f 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile @@ -1,8 +1,9 @@ test: @node node_modules/lab/bin/lab -test-cov: +test-cov: @node node_modules/lab/bin/lab -t 100 -m 3000 test-cov-html: @node node_modules/lab/bin/lab -r html -o coverage.html .PHONY: test test-cov test-cov-html + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md index ec5c1a14af19ff..98a6e025dba0b5 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md @@ -65,3 +65,4 @@ Sntp.start(function () { Sntp.stop(); }); ``` + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js index 58f3cf93e036ff..0303f6dcfa7623 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js @@ -13,3 +13,4 @@ Sntp.offset(function (err, offset) { console.log(offset); // Identical (served from cache) }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js index ff2589f75ebb33..bd70d0e6a516f4 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js @@ -22,3 +22,4 @@ Sntp.time(options, function (err, time) { console.log('Local clock is off by: ' + time.t + ' milliseconds'); process.exit(0); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json index 9ae1b926efae26..08c207b1a82726 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json @@ -1,49 +1,99 @@ { - "name": "sntp", - "description": "SNTP Client", - "version": "1.0.9", + "_args": [ + [ + { + "raw": "sntp@1.x.x", + "scope": null, + "escapedName": "sntp", + "name": "sntp", + "rawSpec": "1.x.x", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" + ] + ], + "_from": "sntp@>=1.0.0 <2.0.0", + "_id": "sntp@1.0.9", + "_inCache": true, + "_installable": true, + "_location": "/request/hawk/sntp", + "_npmUser": { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "raw": "sntp@1.x.x", + "scope": null, + "escapedName": "sntp", + "name": "sntp", + "rawSpec": "1.x.x", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/hawk" + ], + "_resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "_shasum": "6541184cc90aeea6c6e7b35e2659082443c66198", + "_shrinkwrap": null, + "_spec": "sntp@1.x.x", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", "author": { "name": "Eran Hammer", "email": "eran@hammer.io", "url": "http://hueniverse.com" }, - "contributors": [], - "repository": { - "type": "git", - "url": "git://github.com/hueniverse/sntp.git" - }, - "main": "index", - "keywords": [ - "sntp", - "ntp", - "time" - ], - "engines": { - "node": ">=0.8.0" + "bugs": { + "url": "https://github.com/hueniverse/sntp/issues" }, + "contributors": [], "dependencies": { "hoek": "2.x.x" }, + "description": "SNTP Client", "devDependencies": { "lab": "4.x.x" }, - "scripts": { - "test": "make test-cov" + "directories": {}, + "dist": { + "shasum": "6541184cc90aeea6c6e7b35e2659082443c66198", + "tarball": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" }, + "engines": { + "node": ">=0.8.0" + }, + "gitHead": "ee2e35284f684609990681734d39010cd356d7da", + "homepage": "https://github.com/hueniverse/sntp", + "keywords": [ + "sntp", + "ntp", + "time" + ], "licenses": [ { "type": "BSD", "url": "http://github.com/hueniverse/sntp/raw/master/LICENSE" } ], - "readme": "# sntp\n\nAn SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time\nalong with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset\nto the local time.\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)\n\n# Usage\n\n```javascript\nvar Sntp = require('sntp');\n\n// All options are optional\n\nvar options = {\n host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org\n port: 123, // Defaults to 123 (NTP)\n resolveReference: true, // Default to false (not resolving)\n timeout: 1000 // Defaults to zero (no timeout)\n};\n\n// Request server time\n\nSntp.time(options, function (err, time) {\n\n if (err) {\n console.log('Failed: ' + err.message);\n process.exit(1);\n }\n\n console.log('Local clock is off by: ' + time.t + ' milliseconds');\n process.exit(0);\n});\n```\n\nIf an application needs to maintain continuous time synchronization, the module provides a stateful method for\nquerying the current offset only when the last one is too old (defaults to daily).\n\n```javascript\n// Request offset once\n\nSntp.offset(function (err, offset) {\n\n console.log(offset); // New (served fresh)\n\n // Request offset again\n\n Sntp.offset(function (err, offset) {\n\n console.log(offset); // Identical (served from cache)\n });\n});\n```\n\nTo set a background offset refresh, start the interval and use the provided now() method. If for any reason the\nclient fails to obtain an up-to-date offset, the current system clock is used.\n\n```javascript\nvar before = Sntp.now(); // System time without offset\n\nSntp.start(function () {\n\n var now = Sntp.now(); // With offset\n Sntp.stop();\n});\n```\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hueniverse/sntp/issues" + "main": "index", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + } + ], + "name": "sntp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hueniverse/sntp.git" }, - "homepage": "https://github.com/hueniverse/sntp#readme", - "_id": "sntp@1.0.9", - "_shasum": "6541184cc90aeea6c6e7b35e2659082443c66198", - "_resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "_from": "sntp@>=1.0.0 <2.0.0" + "scripts": { + "test": "make test-cov" + }, + "version": "1.0.9" } diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js index 2b8a1c256e8fe5..f1d1cdabf5bb66 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js @@ -432,3 +432,4 @@ describe('SNTP', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/package.json b/deps/npm/node_modules/request/node_modules/hawk/package.json index 4bae96efecbfc7..fb9176edbe4437 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "hawk@~3.1.0", + { + "raw": "hawk@~3.1.3", + "scope": null, + "escapedName": "hawk", + "name": "hawk", + "rawSpec": "~3.1.3", + "spec": ">=3.1.3 <3.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "hawk@>=3.1.0 <3.2.0", + "_from": "hawk@>=3.1.3 <3.2.0", "_id": "hawk@3.1.3", "_inCache": true, "_installable": true, "_location": "/request/hawk", "_nodeVersion": "5.4.1", "_npmUser": { - "email": "eran@hammer.io", - "name": "hueniverse" + "name": "hueniverse", + "email": "eran@hammer.io" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "hawk", - "raw": "hawk@~3.1.0", - "rawSpec": "~3.1.0", + "raw": "hawk@~3.1.3", "scope": null, - "spec": ">=3.1.0 <3.2.0", + "escapedName": "hawk", + "name": "hawk", + "rawSpec": "~3.1.3", + "spec": ">=3.1.3 <3.2.0", "type": "range" }, "_requiredBy": [ @@ -31,11 +40,11 @@ "_resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "_shasum": "078444bd7c1640b0fe540d2c9b73d59678e8e1c4", "_shrinkwrap": null, - "_spec": "hawk@~3.1.0", + "_spec": "hawk@~3.1.3", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "eran@hammer.io", "name": "Eran Hammer", + "email": "eran@hammer.io", "url": "http://hueniverse.com" }, "browser": "./lib/browser.js", @@ -57,7 +66,7 @@ "directories": {}, "dist": { "shasum": "078444bd7c1640b0fe540d2c9b73d59678e8e1c4", - "tarball": "http://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz" + "tarball": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz" }, "engines": { "node": ">=0.10.32" @@ -65,10 +74,10 @@ "gitHead": "2f0b93b34ed9b0ebc865838ef70c6a4035591430", "homepage": "https://github.com/hueniverse/hawk#readme", "keywords": [ - "authentication", - "hawk", "http", - "scheme" + "authentication", + "scheme", + "hawk" ], "license": "BSD-3-Clause", "main": "lib/index.js", diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/readme.js b/deps/npm/node_modules/request/node_modules/hawk/test/readme.js index 7a343f5e219c61..a466264667ee64 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/test/readme.js +++ b/deps/npm/node_modules/request/node_modules/hawk/test/readme.js @@ -92,3 +92,4 @@ describe('README', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/server.js b/deps/npm/node_modules/request/node_modules/hawk/test/server.js index 0fdf13d435913e..1d3405a9ecc11e 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/test/server.js +++ b/deps/npm/node_modules/request/node_modules/hawk/test/server.js @@ -1326,3 +1326,4 @@ describe('Server', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/uri.js b/deps/npm/node_modules/request/node_modules/hawk/test/uri.js index 3dc8e6a1c51042..f3c6ba2d629a65 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/test/uri.js +++ b/deps/npm/node_modules/request/node_modules/hawk/test/uri.js @@ -835,3 +835,4 @@ describe('Uri', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md b/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md index 3e4b13881e0de4..6f69444ba6a0f6 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md @@ -27,7 +27,7 @@ - First semver release. - #36: Ensure verifySignature does not leak useful timing information -- #42: Bring the library up to the latest version of the spec (including the +- #42: Bring the library up to the latest version of the spec (including the request-target changes) - Support for ECDSA keys and signatures. - Now uses `sshpk` for key parsing, validation and conversion. diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json index b596b28af873e0..411084732a6649 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "assert-plus@^0.2.0", + { + "raw": "assert-plus@^0.2.0", + "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature" ] ], @@ -12,23 +20,22 @@ "_location": "/request/http-signature/assert-plus", "_nodeVersion": "0.10.36", "_npmUser": { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" }, "_npmVersion": "3.3.8", "_phantomChildren": {}, "_requested": { - "name": "assert-plus", "raw": "assert-plus@^0.2.0", - "rawSpec": "^0.2.0", "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^0.2.0", "spec": ">=0.2.0 <0.3.0", "type": "range" }, "_requiredBy": [ - "/request/http-signature", - "/request/http-signature/sshpk", - "/request/http-signature/sshpk/dashdash" + "/request/http-signature" ], "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "_shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", @@ -36,8 +43,8 @@ "_spec": "assert-plus@^0.2.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature", "author": { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, "bugs": { "url": "https://github.com/mcavage/node-assert-plus/issues" @@ -77,7 +84,7 @@ "directories": {}, "dist": { "shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", - "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" }, "engines": { "node": ">=0.8" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md index 75bc4f025c8c32..ab3a66417a6fa6 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md @@ -4,6 +4,11 @@ None yet. +## v1.3.0 (2016-06-22) + +* #14 add safer version of hasOwnProperty() +* #15 forEachKey() should ignore inherited properties + ## v1.2.2 (2015-10-15) * #11 NPM package shouldn't include any code that does `require('JSV')` diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md index b502b2d3a4d7e4..7303642e016487 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md @@ -19,14 +19,23 @@ Returns whether two objects are equal. Returns true if the given object has no properties and false otherwise. This is O(1) (unlike `Object.keys(obj).length === 0`, which is O(N)). +### hasKey(obj, key) + +Returns true if the given object has an enumerable, non-inherited property +called `key`. [For information on enumerability and ownership of properties, see +the MDN +documentation.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) ### forEachKey(obj, callback) -Like Array.forEach, but iterates properties of an object rather than elements -of an array. Equivalent to: +Like Array.forEach, but iterates enumerable, owned properties of an object +rather than elements of an array. Equivalent to: - for (var key in obj) - callback(key, obj[key]); + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + callback(key, obj[key]); + } + } ### flattenObject(obj, depth) diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js index 5ee46889223915..26c3ba1c076f3f 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js @@ -15,6 +15,7 @@ var mod_jsonschema = require('json-schema'); exports.deepCopy = deepCopy; exports.deepEqual = deepEqual; exports.isEmpty = isEmpty; +exports.hasKey = hasKey; exports.forEachKey = forEachKey; exports.pluck = pluck; exports.flattenObject = flattenObject; @@ -122,10 +123,19 @@ function isEmpty(obj) return (true); } +function hasKey(obj, key) +{ + mod_assert.equal(typeof (key), 'string'); + return (Object.prototype.hasOwnProperty.call(obj, key)); +} + function forEachKey(obj, callback) { - for (var key in obj) - callback(key, obj[key]); + for (var key in obj) { + if (hasKey(obj, key)) { + callback(key, obj[key]); + } + } } function pluck(obj, key) diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf index eabe9650f5e489..03f787ffbdee4e 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf @@ -1,5 +1,5 @@ # -# Configuration File for JavaScript Lint +# Configuration File for JavaScript Lint # # This configuration file can be used to lint a collection of scripts, or to enable # or disable warnings for scripts that are linted via the command line. @@ -134,3 +134,4 @@ # To add a set of files, use "+process FileName", "+process Folder\Path\*.js", # or "+process Folder\Path\*.htm". # + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json index 660308afc6d2b8..2fd7273a9038dc 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "extsprintf@1.0.2", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" + { + "raw": "extsprintf@1.0.2", + "scope": null, + "escapedName": "extsprintf", + "name": "extsprintf", + "rawSpec": "1.0.2", + "spec": "1.0.2", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" ] ], "_from": "extsprintf@1.0.2", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/jsprim/extsprintf", "_npmUser": { - "email": "dap@cs.brown.edu", - "name": "dap" + "name": "dap", + "email": "dap@cs.brown.edu" }, "_npmVersion": "1.1.65", "_phantomChildren": {}, "_requested": { - "name": "extsprintf", "raw": "extsprintf@1.0.2", - "rawSpec": "1.0.2", "scope": null, + "escapedName": "extsprintf", + "name": "extsprintf", + "rawSpec": "1.0.2", "spec": "1.0.2", "type": "version" }, @@ -32,7 +41,7 @@ "_shasum": "e1080e0658e300b06294990cc70e1502235fd550", "_shrinkwrap": null, "_spec": "extsprintf@1.0.2", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", "bugs": { "url": "https://github.com/davepacheco/node-extsprintf/issues" }, @@ -42,7 +51,7 @@ "directories": {}, "dist": { "shasum": "e1080e0658e300b06294990cc70e1502235fd550", - "tarball": "http://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" }, "engines": [ "node >=0.6.0" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md index 78b81d39683251..4de0124476e98c 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md @@ -1,5 +1,5 @@ JSON Schema is a repository for the JSON Schema specification, reference schemas and a CommonJS implementation of JSON Schema (not the only JavaScript implementation of JSON Schema, JSV is another excellent JavaScript validator). -Code is licensed under the AFL or BSD license as part of the Persevere +Code is licensed under the AFL or BSD license as part of the Persevere project which is administered under the Dojo foundation, and all contributions require a Dojo CLA. \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema index 36a85ccd244926..de80b918b671c7 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema @@ -8,61 +8,61 @@ "items" : {"$ref" : "http://json-schema.org/draft-00/links#"}, "optional" : true }, - + "fragmentResolution" : { "type" : "string", "optional" : true, "default" : "dot-delimited" }, - + "root" : { "type" : "boolean", "optional" : true, "default" : false }, - + "readonly" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pathStart" : { "type" : "string", "optional" : true, "format" : "uri" }, - + "mediaType" : { "type" : "string", "optional" : true, "format" : "media-type" }, - + "alternate" : { "type" : "array", "items" : {"$ref" : "#"}, "optional" : true } }, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited", "extends" : {"$ref" : "http://json-schema.org/draft-00/schema#"} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref index 5d1f76b6a694a4..3a872a71c973dc 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-00/hyper-schema#", "id" : "http://json-schema.org/draft-00/json-ref#", - + "items" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links index cbef326dd3de5b..8a5e7807250cf9 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links @@ -2,28 +2,28 @@ "$schema" : "http://json-schema.org/draft-00/hyper-schema#", "id" : "http://json-schema.org/draft-00/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string" }, - + "rel" : { "type" : "string" }, - + "method" : { "type" : "string", "default" : "GET", "optional" : true }, - + "enctype" : { "type" : "string", "requires" : "method", "optional" : true }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-00/hyper-schema#"}, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema index d452b023ee484a..9aa2fbc57a4054 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-00/hyper-schema#", "id" : "http://json-schema.org/draft-00/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -12,136 +12,136 @@ "optional" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "optional" : { "type" : "boolean", "optional" : true, "default" : false }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "optional" : true, "default" : {} }, - + "requires" : { "type" : ["string", {"$ref" : "#"}], "optional" : true }, - + "minimum" : { "type" : "number", "optional" : true }, - + "maximum" : { "type" : "number", "optional" : true }, - + "minimumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "minimum", "default" : true }, - + "maximumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "maximum", "default" : true }, - + "minItems" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "pattern" : { "type" : "string", "optional" : true, "format" : "regex" }, - + "minLength" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer", "optional" : true }, - + "enum" : { "type" : "array", "optional" : true, "minItems" : 1 }, - + "title" : { "type" : "string", "optional" : true }, - + "description" : { "type" : "string", "optional" : true }, - + "format" : { "type" : "string", "optional" : true }, - + "contentEncoding" : { "type" : "string", "optional" : true }, - + "default" : { "type" : "any", "optional" : true }, - + "maxDecimal" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "disallow" : { "type" : ["string", "array"], "items" : {"type" : "string"}, "optional" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -149,7 +149,7 @@ "default" : {} } }, - + "optional" : true, "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema index b0fb5e157ef9bd..3f6c6cc2c012df 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema @@ -8,61 +8,61 @@ "items" : {"$ref" : "http://json-schema.org/draft-01/links#"}, "optional" : true }, - + "fragmentResolution" : { "type" : "string", "optional" : true, "default" : "dot-delimited" }, - + "root" : { "type" : "boolean", "optional" : true, "default" : false }, - + "readonly" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pathStart" : { "type" : "string", "optional" : true, "format" : "uri" }, - + "mediaType" : { "type" : "string", "optional" : true, "format" : "media-type" }, - + "alternate" : { "type" : "array", "items" : {"$ref" : "#"}, "optional" : true } }, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited", "extends" : {"$ref" : "http://json-schema.org/draft-01/schema#"} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref index cbac1ba2e53286..4d26174ef17ad9 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-01/hyper-schema#", "id" : "http://json-schema.org/draft-01/json-ref#", - + "items" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links index ebc7b7b58b1326..52430a5d94ac75 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links @@ -2,28 +2,28 @@ "$schema" : "http://json-schema.org/draft-01/hyper-schema#", "id" : "http://json-schema.org/draft-01/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string" }, - + "rel" : { "type" : "string" }, - + "method" : { "type" : "string", "default" : "GET", "optional" : true }, - + "enctype" : { "type" : "string", "requires" : "method", "optional" : true }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-01/hyper-schema#"}, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema index a0f3801f840cca..7a208e680e631b 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-01/hyper-schema#", "id" : "http://json-schema.org/draft-01/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -12,136 +12,136 @@ "optional" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "optional" : { "type" : "boolean", "optional" : true, "default" : false }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "optional" : true, "default" : {} }, - + "requires" : { "type" : ["string", {"$ref" : "#"}], "optional" : true }, - + "minimum" : { "type" : "number", "optional" : true }, - + "maximum" : { "type" : "number", "optional" : true }, - + "minimumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "minimum", "default" : true }, - + "maximumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "maximum", "default" : true }, - + "minItems" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "pattern" : { "type" : "string", "optional" : true, "format" : "regex" }, - + "minLength" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer", "optional" : true }, - + "enum" : { "type" : "array", "optional" : true, "minItems" : 1 }, - + "title" : { "type" : "string", "optional" : true }, - + "description" : { "type" : "string", "optional" : true }, - + "format" : { "type" : "string", "optional" : true }, - + "contentEncoding" : { "type" : "string", "optional" : true }, - + "default" : { "type" : "any", "optional" : true }, - + "maxDecimal" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "disallow" : { "type" : ["string", "array"], "items" : {"type" : "string"}, "optional" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -149,7 +149,7 @@ "default" : {} } }, - + "optional" : true, "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema index 0771e2b31e8eef..4ec1b7569137c3 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema @@ -8,61 +8,61 @@ "items" : {"$ref" : "http://json-schema.org/draft-02/links#"}, "optional" : true }, - + "fragmentResolution" : { "type" : "string", "optional" : true, "default" : "slash-delimited" }, - + "root" : { "type" : "boolean", "optional" : true, "default" : false }, - + "readonly" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pathStart" : { "type" : "string", "optional" : true, "format" : "uri" }, - + "mediaType" : { "type" : "string", "optional" : true, "format" : "media-type" }, - + "alternate" : { "type" : "array", "items" : {"$ref" : "#"}, "optional" : true } }, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "slash-delimited", "extends" : {"$ref" : "http://json-schema.org/draft-02/schema#"} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref index 1a6c56d04b665a..6526c394556665 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-02/hyper-schema#", "id" : "http://json-schema.org/draft-02/json-ref#", - + "items" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links index dacc53a1a4adb6..1b176178a2c333 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links @@ -2,30 +2,30 @@ "$schema" : "http://json-schema.org/draft-02/hyper-schema#", "id" : "http://json-schema.org/draft-02/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string" }, - + "rel" : { "type" : "string" }, - + "targetSchema" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"}, - + "method" : { "type" : "string", "default" : "GET", "optional" : true }, - + "enctype" : { "type" : "string", "requires" : "method", "optional" : true }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"}, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema index a4998abea2065e..61b8de15483962 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-02/hyper-schema#", "id" : "http://json-schema.org/draft-02/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -13,131 +13,131 @@ "uniqueItems" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "optional" : { "type" : "boolean", "optional" : true, "default" : false }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "optional" : true, "default" : {} }, - + "requires" : { "type" : ["string", {"$ref" : "#"}], "optional" : true }, - + "minimum" : { "type" : "number", "optional" : true }, - + "maximum" : { "type" : "number", "optional" : true }, - + "minimumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "minimum", "default" : true }, - + "maximumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "maximum", "default" : true }, - + "minItems" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "uniqueItems" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pattern" : { "type" : "string", "optional" : true, "format" : "regex" }, - + "minLength" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer", "optional" : true }, - + "enum" : { "type" : "array", "optional" : true, "minItems" : 1, "uniqueItems" : true }, - + "title" : { "type" : "string", "optional" : true }, - + "description" : { "type" : "string", "optional" : true }, - + "format" : { "type" : "string", "optional" : true }, - + "contentEncoding" : { "type" : "string", "optional" : true }, - + "default" : { "type" : "any", "optional" : true }, - + "divisibleBy" : { "type" : "number", "minimum" : 0, @@ -145,14 +145,14 @@ "optional" : true, "default" : 1 }, - + "disallow" : { "type" : ["string", "array"], "items" : {"type" : "string"}, "optional" : true, "uniqueItems" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -160,7 +160,7 @@ "default" : {} } }, - + "optional" : true, "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar index d8fb5335f081b4..463cfb314b6431 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar @@ -12,12 +12,12 @@ "type":"string", "required":true }, - "location" : { - "type" : "string" + "location" : { + "type" : "string" }, "url" : { - "type" : "string", - "format" : "url" + "type" : "string", + "format" : "url" }, "dtend" : { "format" : "date-time", @@ -47,3 +47,7 @@ "geo" : { "$ref" : "http://json-schema.org/draft-03/geo" } } } + + + + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces index 84ebf83a993f6d..288a19856b7263 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces @@ -6,18 +6,18 @@ "type":"object", "description":"This defines the set of methods available to the class instances", "additionalProperties":{ - "type":"object", - "description":"The definition of the method", - "properties":{ - "parameters":{ - "type":"array", - "description":"The set of parameters that should be passed to the method when it is called", - "items":{"$ref":"#"}, - "required": true - }, - "returns":{"$ref":"#"} - } + "type":"object", + "description":"The definition of the method", + "properties":{ + "parameters":{ + "type":"array", + "description":"The set of parameters that should be passed to the method when it is called", + "items":{"$ref":"#"}, + "required": true + }, + "returns":{"$ref":"#"} + } } - } + } } } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref index 388476323a08ab..7e491a8e882347 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-03/hyper-schema#", "id" : "http://json-schema.org/draft-03/json-ref#", - + "additionalItems" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{id}", "rel" : "self" }, - + { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links index 3dbcdba73cc4e8..6b0a85a6295b25 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links @@ -2,31 +2,31 @@ "$schema" : "http://json-schema.org/draft-03/hyper-schema#", "id" : "http://json-schema.org/draft-03/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string", "required" : true, "format" : "link-description-object-template" }, - + "rel" : { "type" : "string", "required" : true }, - + "targetSchema" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"}, - + "method" : { "type" : "string", "default" : "GET" }, - + "enctype" : { "type" : "string", "requires" : "method" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema index 361456d8a7e89e..55ae47d808c0ab 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-03/schema#", "id" : "http://json-schema.org/draft-03/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -12,40 +12,40 @@ "uniqueItems" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "patternProperties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "default" : {} }, - + "additionalItems" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "required" : { "type" : "boolean", "default" : false }, - + "dependencies" : { "type" : "object", "additionalProperties" : { @@ -56,85 +56,85 @@ }, "default" : {} }, - + "minimum" : { "type" : "number" }, - + "maximum" : { "type" : "number" }, - + "exclusiveMinimum" : { "type" : "boolean", "default" : false }, - + "exclusiveMaximum" : { "type" : "boolean", "default" : false }, - + "minItems" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "minimum" : 0 }, - + "uniqueItems" : { "type" : "boolean", "default" : false }, - + "pattern" : { "type" : "string", "format" : "regex" }, - + "minLength" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer" }, - + "enum" : { "type" : "array", "minItems" : 1, "uniqueItems" : true }, - + "default" : { "type" : "any" }, - + "title" : { "type" : "string" }, - + "description" : { "type" : "string" }, - + "format" : { "type" : "string" }, - + "divisibleBy" : { "type" : "number", "minimum" : 0, "exclusiveMinimum" : true, "default" : 1 }, - + "disallow" : { "type" : ["string", "array"], "items" : { @@ -142,33 +142,33 @@ }, "uniqueItems" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "default" : {} }, - + "id" : { "type" : "string", "format" : "uri" }, - + "$ref" : { "type" : "string", "format" : "uri" }, - + "$schema" : { "type" : "string", "format" : "uri" } }, - + "dependencies" : { "exclusiveMinimum" : "minimum", "exclusiveMaximum" : "maximum" }, - + "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links index 7cf7c92c20965c..de272cc4513d0a 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-04/hyper-schema#", "id" : "http://json-schema.org/draft-04/links#", "type" : "object", - + "properties" : { "rel" : { "type" : "string" @@ -15,26 +15,26 @@ "template" : { "type" : "string" }, - + "targetSchema" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"}, - + "method" : { "type" : "string", "default" : "GET" }, - + "enctype" : { "type" : "string" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"} } }, - + "required" : ["rel", "href"], - + "dependencies" : { "enctype" : "method" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema index e9c90699fda128..598951e57d2eb7 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-04/schema#", "id" : "http://json-schema.org/draft-04/schema#", "type" : "object", - + "properties" : { "type" : { "type" : [ @@ -10,19 +10,19 @@ "id" : "#simple-type", "type" : "string", "enum" : ["object", "array", "string", "number", "boolean", "null", "any"] - }, + }, "array" ], "items" : { "type" : [ - {"$ref" : "#simple-type"}, + {"$ref" : "#simple-type"}, {"$ref" : "#"} ] }, "uniqueItems" : true, "default" : "any" }, - + "disallow" : { "type" : ["string", "array"], "items" : { @@ -30,7 +30,7 @@ }, "uniqueItems" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -42,108 +42,108 @@ "minItems" : 1, "uniqueItems" : true }, - + "minimum" : { "type" : "number" }, - + "maximum" : { "type" : "number" }, - + "exclusiveMinimum" : { "type" : "boolean", "default" : false }, - + "exclusiveMaximum" : { "type" : "boolean", "default" : false }, - + "divisibleBy" : { "type" : "number", "minimum" : 0, "exclusiveMinimum" : true, "default" : 1 }, - + "minLength" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer" }, - + "pattern" : { "type" : "string" }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "default" : {} }, - + "additionalItems" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "minItems" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "minimum" : 0 }, - + "uniqueItems" : { "type" : "boolean", "default" : false }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "patternProperties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "minProperties" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxProperties" : { "type" : "integer", "minimum" : 0 }, - + "required" : { "type" : "array", "items" : { "type" : "string" } }, - + "dependencies" : { "type" : "object", "additionalProperties" : { @@ -154,36 +154,36 @@ }, "default" : {} }, - + "id" : { "type" : "string" }, - + "$ref" : { "type" : "string" }, - + "$schema" : { "type" : "string" }, - + "title" : { "type" : "string" }, - + "description" : { "type" : "string" }, - + "default" : { "type" : "any" } }, - + "dependencies" : { "exclusiveMinimum" : "minimum", "exclusiveMaximum" : "maximum" }, - + "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml index 1cf715910b5a83..c28f40dcd6ee44 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml @@ -24,7 +24,7 @@ A JSON Media Type for Describing the Structure and Meaning of JSON Documents - + SitePen (USA)
    @@ -37,7 +37,7 @@ kris@sitepen.com
    - +
    @@ -48,7 +48,7 @@ gary.court@gmail.com
    - + Internet Engineering Task Force JSON @@ -58,59 +58,59 @@ Notation Hyper Schema Hypermedia - + - JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", - a JSON based format for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", + a JSON based format for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - JSON (JavaScript Object Notation) Schema is a JSON media type for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema is a JSON media type for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
    - + - +
    - JSON Schema defines the media type "application/schema+json" for + JSON Schema defines the media type "application/schema+json" for describing the structure of other - JSON documents. JSON Schema is JSON-based and includes facilities + JSON documents. JSON Schema is JSON-based and includes facilities for describing the structure of JSON documents in terms of allowable values, descriptions, and interpreting relations with other resources. - JSON Schema format is organized into several separate definitions. The first - definition is the core schema specification. This definition is primary + JSON Schema format is organized into several separate definitions. The first + definition is the core schema specification. This definition is primary concerned with describing a JSON structure and specifying valid elements in the structure. The second definition is the Hyper Schema specification which is intended define elements in a structure that can be interpreted as hyperlinks. - Hyper Schema builds on JSON Schema to describe the hyperlink structure of + Hyper Schema builds on JSON Schema to describe the hyperlink structure of other JSON documents and elements of interaction. This allows user agents to be able to successfully navigate JSON documents based on their schemas. @@ -118,12 +118,12 @@ Cumulatively JSON Schema acts as a meta-document that can be used to define the required type and constraints on property values, as well as define the meaning of the property values for the purpose of describing a resource and determining hyperlinks - within the representation. + within the representation.
    An example JSON Schema that describes products might look like: - - This schema defines the properties of the instance JSON documents, + This schema defines the properties of the instance JSON documents, the required properties (id, name, and price), as well as an optional property (tags). This also defines the link relations of the instance JSON documents.
    - +
    - For this specification, schema will be used to denote a JSON Schema - definition, and an instance refers to a JSON value that the schema + For this specification, schema will be used to denote a JSON Schema + definition, and an instance refers to a JSON value that the schema will be describing and validating.
    - +
    The JSON Schema media type does not attempt to dictate the structure of JSON @@ -194,7 +194,7 @@ This specification is protocol agnostic. The underlying protocol (such as HTTP) should sufficiently define the semantics of the client-server interface, the retrieval of resource - representations linked to by JSON representations, and modification of + representations linked to by JSON representations, and modification of those resources. The goal of this format is to sufficiently describe JSON structures such that one can utilize existing information available in existing JSON @@ -203,7 +203,7 @@
    - +
    JSON Schema instances are correlated to their schema by the "describedby" @@ -217,22 +217,22 @@ representation and messages may retain the self-descriptive characteristic, avoiding the need for out-of-band information about instance data. Two approaches are recommended for declaring the - relation to the schema that describes the meaning of a JSON instance's (or collection + relation to the schema that describes the meaning of a JSON instance's (or collection of instances) structure. A MIME type parameter named "profile" or a relation of "describedby" (which could be defined by a Link header) may be used: - +
    -
    - + or if the content is being transferred by a protocol (such as HTTP) that provides headers, a Link header can be used: - +
    ; rel="describedby" ]]>
    - - Instances MAY specify multiple schemas, to indicate all the schemas that - are applicable to the data, and the data SHOULD be valid by all the schemas. - The instance data MAY have multiple schemas - that it is defined by (the instance data SHOULD be valid for those schemas). - Or if the document is a collection of instances, the collection MAY contain - instances from different schemas. When collections contain heterogeneous - instances, the "pathStart" attribute MAY be specified in the - schema to disambiguate which schema should be applied for each item in the + + Instances MAY specify multiple schemas, to indicate all the schemas that + are applicable to the data, and the data SHOULD be valid by all the schemas. + The instance data MAY have multiple schemas + that it is defined by (the instance data SHOULD be valid for those schemas). + Or if the document is a collection of instances, the collection MAY contain + instances from different schemas. When collections contain heterogeneous + instances, the "pathStart" attribute MAY be specified in the + schema to disambiguate which schema should be applied for each item in the collection. However, ultimately, the mechanism for referencing a schema is up to the media type of the instance documents (if they choose to specify that schemas can be referenced).
    - +
    - JSON Schemas can themselves be described using JSON Schemas. + JSON Schemas can themselves be described using JSON Schemas. A self-describing JSON Schema for the core JSON Schema can - be found at http://json-schema.org/schema for the latest version or - http://json-schema.org/draft-03/schema for the draft-03 version. The hyper schema - self-description can be found at http://json-schema.org/hyper-schema + be found at http://json-schema.org/schema for the latest version or + http://json-schema.org/draft-03/schema for the draft-03 version. The hyper schema + self-description can be found at http://json-schema.org/hyper-schema or http://json-schema.org/draft-03/hyper-schema. All schemas used within a protocol with media type definitions SHOULD include a MIME parameter that refers to the self-descriptive hyper schema or another schema that extends this hyper schema: - +
    - @@ -277,15 +277,15 @@ Content-Type: application/json;
    - +
    - A JSON Schema is a JSON Object that defines various attributes + A JSON Schema is a JSON Object that defines various attributes (including usage and valid values) of a JSON value. JSON Schema has recursive capabilities; there are a number of elements in the structure that allow for nested JSON Schemas. - +
    An example JSON Schema definition could look like: @@ -307,15 +307,15 @@ Content-Type: application/json; ]]>
    - + A JSON Schema object may have any of the following properties, called schema attributes (all attributes are optional): - +
    - This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. + This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. This attribute can take one of two forms: @@ -332,19 +332,19 @@ Content-Type: application/json; Value MUST be null. Note this is mainly for purpose of being able use union types to define nullability. If this type is not included in a union, null values are not allowed (the primitives listed above do not allow nulls on their own). Value MAY be of any type including null. - - If the property is not defined or is not in this list, then any type of value is acceptable. - Other type values MAY be used for custom purposes, but minimal validators of the specification + + If the property is not defined or is not in this list, then any type of value is acceptable. + Other type values MAY be used for custom purposes, but minimal validators of the specification implementation can allow any instance value on unknown type values. - + An array of two or more simple type definitions. Each item in the array MUST be a simple type definition or a schema. - The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in the array. + The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in the array. - +
    For example, a schema that defines if an instance can be a string or a number would be: @@ -355,38 +355,38 @@ Content-Type: application/json; ]]>
    - +
    This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition's value MUST be a schema, and the property's name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the schema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order.
    - +
    This attribute is an object that defines the schema for a set of property names of an object instance. The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value.
    - +
    This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties.
    - +
    This attribute defines the allowed items in an instance array, and MUST be a schema or an array of schemas. The default value is an empty schema which allows any value for items in the instance array. When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute using the same rules as "additionalProperties" for objects.
    - +
    This provides a definition for additional items in an array instance when tuple definitions of the items is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema that defines the schema of the additional items.
    - +
    This attribute indicates if the instance must have a value, and not be undefined. This is false by default, making the instance optional.
    - +
    This attribute is an object that defines the requirements of a property on an instance object. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). The dependency value can take one of two forms: - + If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. @@ -398,36 +398,36 @@ Content-Type: application/json;
    - +
    This attribute defines the minimum value of the instance property when the type of the instance value is a number.
    - +
    This attribute defines the maximum value of the instance property when the type of the instance value is a number.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value.
    - +
    This attribute defines the minimum number of values in an array when the array is the instance value.
    - +
    This attribute defines the maximum number of values in an array when the array is the instance value.
    - +
    This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). Two instance are consider equal if they are both of the same type and: - + are null; or are booleans/numbers/strings and have the same value; or @@ -436,41 +436,41 @@ Content-Type: application/json;
    - +
    When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5
    - +
    When the instance value is a string, this defines the minimum length of the string.
    - +
    When the instance value is a string, this defines the maximum length of the string.
    - +
    This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems".
    - +
    This attribute defines the default value of the instance when the instance is undefined.
    - +
    This attribute is a string that provides a short description of the instance property.
    - +
    This attribute is a string that provides a full description of the of purpose the instance property.
    - +
    This property defines the type of data, content type, or microformat to be expected in the instance property values. A format attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators MAY (but are not required to) validate that the instance values conform to a format. - + The following formats are predefined: - + This SHOULD be a date in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time. This is the recommended form of date/timestamp. This SHOULD be a date in the format of YYYY-MM-DD. It is recommended that you use the "date-time" format instead of "date" unless you need to transfer only the date part. @@ -487,18 +487,18 @@ Content-Type: application/json; This SHOULD be a host-name. - + Additional custom formats MAY be created. These custom formats MAY be expressed as an URI, and this URI MAY reference a schema of that format.
    - +
    This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0.
    - +
    This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid.
    - +
    The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. @@ -506,7 +506,7 @@ Content-Type: application/json; instance against all constraints in the extending schema as well as the extended schema(s). More optimized implementations that merge schemas are possible, but are not required. Some examples of using "extends": - +
    - +
    - +
    This attribute defines the current URI of this schema (this attribute is @@ -553,28 +553,28 @@ Content-Type: application/json; is also used to construct relative references such as for $ref.
    - +
    - This attribute defines a URI of a schema that contains the full representation of this schema. - When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. + This attribute defines a URI of a schema that contains the full representation of this schema. + When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema.
    - +
    - This attribute defines a URI of a JSON Schema that is the schema of the current schema. + This attribute defines a URI of a JSON Schema that is the schema of the current schema. When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. - + - A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. + A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes.
    - +
    The following attributes are specified in addition to those @@ -586,28 +586,28 @@ Content-Type: application/json; essentially describes plain JSON (no constraints on the structures). Addition of attributes provides additive information for user agents. - +
    - The value of the links property MUST be an array, where each item + The value of the links property MUST be an array, where each item in the array is a link description object which describes the link relations of the instances. - +
    - A link description object is used to describe link relations. In - the context of a schema, it defines the link relations of the + A link description object is used to describe link relations. In + the context of a schema, it defines the link relations of the instances of the schema, and can be parameterized by the instance values. The link description format can be used on its own in regular (non-schema documents), and use of this format can be declared by referencing the normative link description - schema as the the schema for the data structure that uses the - links. The URI of the normative link description schema is: + schema as the the schema for the data structure that uses the + links. The URI of the normative link description schema is: http://json-schema.org/links (latest version) or http://json-schema.org/draft-03/links (draft-03 version). - +
    The value of the "href" link description property @@ -615,19 +615,19 @@ Content-Type: application/json; of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 and MAY be a relative URI. The base URI to be used for relative resolution SHOULD be the URI used to retrieve the instance object (not the schema) - when used within a schema. Also, when links are used within a schema, the URI - SHOULD be parametrized by the property values of the instance + when used within a schema. Also, when links are used within a schema, the URI + SHOULD be parametrized by the property values of the instance object, if property values exist for the corresponding variables in the template (otherwise they MAY be provided from alternate sources, like user input). - + Instance property values SHOULD be substituted into the URIs where matching braces ('{', '}') are found surrounding zero or more characters, creating an expanded URI. Instance property value substitutions are resolved by using the text between the braces to denote the property name - from the instance to get the value to substitute. - + from the instance to get the value to substitute. +
    For example, if an href value is defined: @@ -637,7 +637,7 @@ http://somesite.com/{id} Then it would be resolved by replace the value of the "id" property value from the instance object.
    - +
    If the value of the "id" property was "45", the expanded URI would be: @@ -646,23 +646,23 @@ http://somesite.com/45 ]]>
    - - If matching braces are found with the string "@" (no quotes) between the braces, then the + + If matching braces are found with the string "@" (no quotes) between the braces, then the actual instance value SHOULD be used to replace the braces, rather than a property value. - This should only be used in situations where the instance is a scalar (string, + This should only be used in situations where the instance is a scalar (string, boolean, or number), and not for objects or arrays.
    - +
    - The value of the "rel" property indicates the name of the + The value of the "rel" property indicates the name of the relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. - + Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: - + If the relation value is "self", when this property is encountered in @@ -670,15 +670,15 @@ http://somesite.com/45 treated as a full representation of the target resource identified by the specified URI. - + This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. - + This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. - + This relation indicates that the target of the link SHOULD be treated as the root or the body of the representation for the @@ -688,7 +688,7 @@ http://somesite.com/45 - + The following relations are applicable for schemas (the schema as the "from" resource in the relation): @@ -697,7 +697,7 @@ http://somesite.com/45 This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). - +
    For example, if a schema is defined: @@ -718,7 +718,7 @@ http://somesite.com/45 ]]>
    - +
    And if a collection of instance resource's JSON representation was retrieved: @@ -742,37 +742,37 @@ GET /Resource/ The "children" collection would be located at "/Resource/?upId=thing".
    - +
    This property value is a schema that defines the expected structure of the JSON representation of the target of the link.
    - +
    - The following properties also apply to link definition objects, and - provide functionality analogous to HTML forms, in providing a + The following properties also apply to link definition objects, and + provide functionality analogous to HTML forms, in providing a means for submitting extra (often user supplied) information to send to a server. - +
    - This attribute defines which method can be used to access the target resource. - In an HTTP environment, this would be "GET" or "POST" (other HTTP methods - such as "PUT" and "DELETE" have semantics that are clearly implied by - accessed resources, and do not need to be defined here). + This attribute defines which method can be used to access the target resource. + In an HTTP environment, this would be "GET" or "POST" (other HTTP methods + such as "PUT" and "DELETE" have semantics that are clearly implied by + accessed resources, and do not need to be defined here). This defaults to "GET".
    - +
    If present, this property indicates a query media type format that the server - supports for querying or posting to the collection of instances at the target - resource. The query can be + supports for querying or posting to the collection of instances at the target + resource. The query can be suffixed to the target URI to query the collection with property-based constraints on the resources that SHOULD be returned from the server or used to post data to the resource (depending on the method). - +
    For example, with the following schema: @@ -793,7 +793,7 @@ GET /Resource/ This indicates that the client can query the server for instances that have a specific name.
    - +
    For example: @@ -803,23 +803,23 @@ GET /Resource/
    - If no enctype or method is specified, only the single URI specified by - the href property is defined. If the method is POST, "application/json" is + If no enctype or method is specified, only the single URI specified by + the href property is defined. If the method is POST, "application/json" is the default media type.
    - +
    This attribute contains a schema which defines the acceptable structure of the submitted - request (for a GET request, this schema would define the properties for the query string + request (for a GET request, this schema would define the properties for the query string and for a POST request, this would define the body).
    - +
    This property indicates the fragment resolution protocol to use for @@ -829,12 +829,12 @@ GET /Resource/ protocol is "slash-delimited", which is defined below. Other fragment resolution protocols MAY be used, but are not defined in this document. - + The fragment identifier is based on RFC 2396, Sec 5, and defines the mechanism for resolving references to entities within a document. - +
    With the slash-delimited fragment resolution protocol, the fragment @@ -852,15 +852,15 @@ GET /Resource/ item in array the array with the index defined by the next property reference token (which MUST be a number). The target is successively updated for each property reference token, until the entire fragment has - been traversed. + been traversed. - + - Property names SHOULD be URI-encoded. In particular, any "/" in a - property name MUST be encoded to avoid being interpreted as a property + Property names SHOULD be URI-encoded. In particular, any "/" in a + property name MUST be encoded to avoid being interpreted as a property delimiter. - +
    For example, for the following JSON representation: @@ -879,7 +879,7 @@ GET /Resource/ ]]>
    - +
    The following fragment identifiers would be resolved: @@ -889,10 +889,10 @@ fragment identifier resolution # self, the root of the resource itself #/foo the object referred to by the foo property #/foo/another%20prop the object referred to by the "another prop" - property of the object referred to by the + property of the object referred to by the "foo" property #/foo/another%20prop/baz the string referred to by the value of "baz" - property of the "another prop" property of + property of the "another prop" property of the object referred to by the "foo" property #/foo/anArray/0 the first object in the "anArray" array ]]> @@ -900,61 +900,61 @@ fragment identifier resolution
    - +
    - The dot-delimited fragment resolution protocol is the same as - slash-delimited fragment resolution protocol except that the "." character - (\x2E) is used as the delimiter between property names (instead of "/") and + The dot-delimited fragment resolution protocol is the same as + slash-delimited fragment resolution protocol except that the "." character + (\x2E) is used as the delimiter between property names (instead of "/") and the path does not need to start with a ".". For example, #.foo and #foo are a valid fragment identifiers for referencing the value of the foo propery.
    - +
    This attribute indicates that the instance property SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server.
    - +
    If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property.
    - +
    - This attribute is a URI that defines what the instance's URI MUST start with in order to validate. - The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, + This attribute is a URI that defines what the instance's URI MUST start with in order to validate. + The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, and is relative to the instance's URI. - + - When multiple schemas have been referenced for an instance, the user agent - can determine if this schema is applicable for a particular instance by + When multiple schemas have been referenced for an instance, the user agent + can determine if this schema is applicable for a particular instance by determining if the URI of the instance begins with the the value of the "pathStart" - attribute. If the URI of the instance does not start with this URI, - or if another schema specifies a starting URI that is longer and also matches the - instance, this schema SHOULD NOT be applied to the instance. Any schema - that does not have a pathStart attribute SHOULD be considered applicable + attribute. If the URI of the instance does not start with this URI, + or if another schema specifies a starting URI that is longer and also matches the + instance, this schema SHOULD NOT be applied to the instance. Any schema + that does not have a pathStart attribute SHOULD be considered applicable to all the instances for which it is referenced.
    - +
    This attribute defines the media type of the instance representations that this schema is defining.
    - +
    - This specification is a sub-type of the JSON format, and - consequently the security considerations are generally the same as RFC 4627. + This specification is a sub-type of the JSON format, and + consequently the security considerations are generally the same as RFC 4627. However, an additional issue is that when link relation of "self" - is used to denote a full representation of an object, the user agent + is used to denote a full representation of an object, the user agent SHOULD NOT consider the representation to be the authoritative representation of the resource denoted by the target URI if the target URI is not - equivalent to or a sub-path of the the URI used to request the resource + equivalent to or a sub-path of the the URI used to request the resource representation which contains the target URI with the "self" link. - +
    For example, if a hyper schema was defined: @@ -968,7 +968,7 @@ fragment identifier resolution ]]>
    - +
    And a resource was requested from somesite.com: @@ -1005,22 +1005,22 @@ Content-Type: application/json; profile=/schema-for-this-data
    - +
    The proposed MIME media type for JSON Schema is "application/schema+json". Type name: application Subtype name: schema+json Required parameters: profile - The value of the profile parameter SHOULD be a URI (relative or absolute) that - refers to the schema used to define the structure of this structure (the + The value of the profile parameter SHOULD be a URI (relative or absolute) that + refers to the schema used to define the structure of this structure (the meta-schema). Normally the value would be http://json-schema.org/draft-03/hyper-schema, but it is allowable to use other schemas that extend the hyper schema's meta- schema. Optional parameters: pretty The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. - +
    This registry is maintained by IANA per RFC 4287 and this specification adds @@ -1032,7 +1032,7 @@ Content-Type: application/json; profile=/schema-for-this-data
    - + @@ -1080,7 +1080,7 @@ Content-Type: application/json; profile=/schema-for-this-data Added "$ref" and "$schema" attributes. - + Replaced "maxDecimal" attribute with "divisibleBy" attribute. @@ -1090,13 +1090,13 @@ Content-Type: application/json; profile=/schema-for-this-data Added "targetSchema" attribute to link description object. - + Fixed category and updates from template. - + Initial draft. @@ -1105,7 +1105,7 @@ Content-Type: application/json; profile=/schema-for-this-data - +
    diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml index 22fb3290df1472..f9c1ea5a0c00a2 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml @@ -23,7 +23,7 @@ A JSON Media Type for Describing the Structure and Meaning of JSON Documents - + SitePen (USA)
    @@ -36,7 +36,7 @@ kris@sitepen.com
    - +
    @@ -47,7 +47,7 @@ gary.court@gmail.com
    - + Internet Engineering Task Force JSON @@ -57,48 +57,48 @@ Notation Hyper Schema Hypermedia - + - JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", - a JSON based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", + a JSON based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - JSON (JavaScript Object Notation) Schema is a JSON media type for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema is a JSON media type for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119. - + - The terms "JSON", "JSON text", "JSON value", "member", "element", "object", - "array", "number", "string", "boolean", "true", "false", and "null" in this + The terms "JSON", "JSON text", "JSON value", "member", "element", "object", + "array", "number", "string", "boolean", "true", "false", and "null" in this document are to be interpreted as defined in RFC 4627. - + This specification also uses the following defined terms: - + A JSON Schema object. Equivalent to "JSON value" as defined in RFC 4627. @@ -108,35 +108,35 @@
    - +
    - JSON Schema defines the media type "application/schema+json" for - describing the structure of JSON text. JSON Schemas are also written in JSON and includes facilities + JSON Schema defines the media type "application/schema+json" for + describing the structure of JSON text. JSON Schemas are also written in JSON and includes facilities for describing the structure of JSON in terms of allowable values, descriptions, and interpreting relations with other resources. - This document is organized into several separate definitions. The first - definition is the core schema specification. This definition is primary + This document is organized into several separate definitions. The first + definition is the core schema specification. This definition is primary concerned with describing a JSON structure and specifying valid elements in the structure. The second definition is the Hyper Schema specification which is intended to define elements in a structure that can be interpreted as hyperlinks. - Hyper Schema builds on JSON Schema to describe the hyperlink structure of + Hyper Schema builds on JSON Schema to describe the hyperlink structure of JSON values. This allows user agents to be able to successfully navigate documents containing JSON based on their schemas. - Cumulatively JSON Schema acts as meta-JSON that can be used to define the + Cumulatively JSON Schema acts as meta-JSON that can be used to define the required type and constraints on JSON values, as well as define the meaning of the JSON values for the purpose of describing a resource and determining - hyperlinks within the representation. + hyperlinks within the representation.
    An example JSON Schema that describes products might look like: - - This schema defines the properties of the instance, + This schema defines the properties of the instance, the required properties (id, name, and price), as well as an optional property (tags). This also defines the link relations of the instance.
    - +
    The JSON Schema media type does not attempt to dictate the structure of JSON @@ -195,7 +195,7 @@ This specification is protocol agnostic. The underlying protocol (such as HTTP) should sufficiently define the semantics of the client-server interface, the retrieval of resource - representations linked to by JSON representations, and modification of + representations linked to by JSON representations, and modification of those resources. The goal of this format is to sufficiently describe JSON structures such that one can utilize existing information available in existing JSON @@ -204,35 +204,35 @@
    - +
    JSON values are correlated to their schema by the "describedby" relation, where the schema is the target of the relation. JSON values MUST be of the "application/json" media type or - any other subtype. Consequently, dictating how a JSON value should + any other subtype. Consequently, dictating how a JSON value should specify the relation to the schema is beyond the normative scope of this document since this document specifically defines the JSON Schema media type, and no other. It is RECOMMNENDED that JSON values specify their schema so that user agents can interpret the instance and retain the self-descriptive characteristics. This avoides the need for out-of-band information about instance data. Two approaches are recommended for declaring the - relation to the schema that describes the meaning of a JSON instance's (or collection + relation to the schema that describes the meaning of a JSON instance's (or collection of instances) structure. A MIME type parameter named "profile" or a relation of "describedby" (which could be specified by a Link header) may be used: - +
    -
    - + or if the content is being transferred by a protocol (such as HTTP) that provides headers, a Link header can be used: - +
    ; rel="describedby" ]]>
    - - Instances MAY specify multiple schemas, to indicate all the schemas that - are applicable to the data, and the data SHOULD be valid by all the schemas. - The instance data MAY have multiple schemas - that it is described by (the instance data SHOULD be valid for those schemas). - Or if the document is a collection of instances, the collection MAY contain - instances from different schemas. The mechanism for referencing a schema is - determined by the media type of the instance (if it provides a method for + + Instances MAY specify multiple schemas, to indicate all the schemas that + are applicable to the data, and the data SHOULD be valid by all the schemas. + The instance data MAY have multiple schemas + that it is described by (the instance data SHOULD be valid for those schemas). + Or if the document is a collection of instances, the collection MAY contain + instances from different schemas. The mechanism for referencing a schema is + determined by the media type of the instance (if it provides a method for referencing schemas).
    - +
    - JSON Schemas can themselves be described using JSON Schemas. + JSON Schemas can themselves be described using JSON Schemas. A self-describing JSON Schema for the core JSON Schema can - be found at http://json-schema.org/schema for the latest version or - http://json-schema.org/draft-04/schema for the draft-04 version. The hyper schema - self-description can be found at http://json-schema.org/hyper-schema + be found at http://json-schema.org/schema for the latest version or + http://json-schema.org/draft-04/schema for the draft-04 version. The hyper schema + self-description can be found at http://json-schema.org/hyper-schema or http://json-schema.org/draft-04/hyper-schema. All schemas used within a protocol with a media type specified SHOULD include a MIME parameter that refers to the self-descriptive hyper schema or another schema that extends this hyper schema: - +
    - @@ -273,15 +273,15 @@ Content-Type: application/json;
    - +
    - A JSON Schema is a JSON object that defines various attributes + A JSON Schema is a JSON object that defines various attributes (including usage and valid values) of a JSON value. JSON Schema has recursive capabilities; there are a number of elements in the structure that allow for nested JSON Schemas. - +
    An example JSON Schema could look like: @@ -305,17 +305,17 @@ Content-Type: application/json; ]]>
    - + A JSON Schema object MAY have any of the following optional properties: - + - +
    - This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. + This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. This attribute can take one of two forms: @@ -332,16 +332,16 @@ Content-Type: application/json; Instance MAY be of any type, including null. - + An array of one or more simple or schema types. - The instance value is valid if it is of the same type as one of the simple types, or valid by one of the schemas, in the array. + The instance value is valid if it is of the same type as one of the simple types, or valid by one of the schemas, in the array. - - If this attribute is not specified, then all value types are accepted. + + If this attribute is not specified, then all value types are accepted. - +
    For example, a schema that defines if an instance can be a string or a number would be: @@ -352,37 +352,37 @@ Content-Type: application/json; ]]>
    - +
    This attribute is an object with properties that specify the schemas for the properties of the instance object. - In this attribute's object, each property value MUST be a schema. + In this attribute's object, each property value MUST be a schema. When the instance value is an object, the value of the instance's properties MUST be valid according to the schemas with the same property names specified in this attribute. Objects are unordered, so therefore the order of the instance properties or attribute properties MUST NOT determine validation success.
    - +
    - This attribute is an object that defines the schema for a set of property names of an object instance. - The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. + This attribute is an object that defines the schema for a set of property names of an object instance. + The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value.
    - +
    - This attribute specifies how any instance property that is not explicitly defined by either the "properties" or "patternProperties" attributes (hereafter referred to as "additional properties") is handled. If specified, the value MUST be a schema or a boolean. + This attribute specifies how any instance property that is not explicitly defined by either the "properties" or "patternProperties" attributes (hereafter referred to as "additional properties") is handled. If specified, the value MUST be a schema or a boolean. If a schema is provided, then all additional properties MUST be valid according to the schema. If false is provided, then no additional properties are allowed. The default value is an empty schema, which allows any value for additional properties.
    - +
    This attribute provides the allowed items in an array instance. If specified, this attribute MUST be a schema or an array of schemas. When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST be valid according to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute the same way as "additionalProperties" for objects is.
    - +
    This attribute specifies how any item in the array instance that is not explicitly defined by "items" (hereafter referred to as "additional items") is handled. If specified, the value MUST be a schema or a boolean. If a schema is provided: @@ -395,16 +395,16 @@ Content-Type: application/json; If false is provided, then any additional items in the array are not allowed. The default value is an empty schema, which allows any value for additional items.
    - +
    This attribute is an array of strings that defines all the property names that must exist on the object instance.
    - +
    This attribute is an object that specifies the requirements of a property on an object instance. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). The dependency value can take one of two forms: - + If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. @@ -416,44 +416,44 @@ Content-Type: application/json;
    - +
    This attribute defines the minimum value of the instance property when the type of the instance value is a number.
    - +
    This attribute defines the maximum value of the instance property when the type of the instance value is a number.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value.
    - +
    This attribute defines the minimum number of values in an array when the array is the instance value.
    - +
    This attribute defines the maximum number of values in an array when the array is the instance value.
    - +
    This attribute defines the minimum number of properties required on an object instance.
    - +
    This attribute defines the maximum number of properties the object instance can have.
    - +
    This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). Two instance are consider equal if they are both of the same type and: - + are null; or are booleans/numbers/strings and have the same value; or @@ -462,43 +462,43 @@ Content-Type: application/json;
    - +
    When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5
    - +
    When the instance value is a string, this defines the minimum length of the string.
    - +
    When the instance value is a string, this defines the maximum length of the string.
    - +
    This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems".
    - +
    This attribute defines the default value of the instance when the instance is undefined.
    - +
    This attribute is a string that provides a short description of the instance property.
    - +
    This attribute is a string that provides a full description of the of purpose the instance property.
    - +
    This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0.
    - +
    This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid.
    - +
    The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. @@ -506,7 +506,7 @@ Content-Type: application/json; instance against all constraints in the extending schema as well as the extended schema(s). More optimized implementations that merge schemas are possible, but are not required. Some examples of using "extends": - +
    - +
    - +
    This attribute defines the current URI of this schema (this attribute is @@ -553,28 +553,28 @@ Content-Type: application/json; is also used to construct relative references such as for $ref.
    - +
    - This attribute defines a URI of a schema that contains the full representation of this schema. - When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. + This attribute defines a URI of a schema that contains the full representation of this schema. + When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema.
    - +
    - This attribute defines a URI of a JSON Schema that is the schema of the current schema. + This attribute defines a URI of a JSON Schema that is the schema of the current schema. When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. - + - A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. + A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes.
    - +
    The following attributes are specified in addition to those @@ -586,30 +586,30 @@ Content-Type: application/json; essentially describes plain JSON (no constraints on the structures). Addition of attributes provides additive information for user agents. - +
    - The value of the links property MUST be an array, where each item + The value of the links property MUST be an array, where each item in the array is a link description object which describes the link relations of the instances. - + - +
    - A link description object is used to describe link relations. In - the context of a schema, it defines the link relations of the + A link description object is used to describe link relations. In + the context of a schema, it defines the link relations of the instances of the schema, and can be parameterized by the instance - values. The link description format can be used without JSON Schema, + values. The link description format can be used without JSON Schema, and use of this format can be declared by referencing the normative link description - schema as the the schema for the data structure that uses the - links. The URI of the normative link description schema is: + schema as the the schema for the data structure that uses the + links. The URI of the normative link description schema is: http://json-schema.org/links (latest version) or http://json-schema.org/draft-04/links (draft-04 version). - +
    The value of the "href" link description property @@ -617,19 +617,19 @@ Content-Type: application/json; of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 and MAY be a relative URI. The base URI to be used for relative resolution SHOULD be the URI used to retrieve the instance object (not the schema) - when used within a schema. Also, when links are used within a schema, the URI - SHOULD be parametrized by the property values of the instance + when used within a schema. Also, when links are used within a schema, the URI + SHOULD be parametrized by the property values of the instance object, if property values exist for the corresponding variables in the template (otherwise they MAY be provided from alternate sources, like user input). - + Instance property values SHOULD be substituted into the URIs where matching braces ('{', '}') are found surrounding zero or more characters, creating an expanded URI. Instance property value substitutions are resolved by using the text between the braces to denote the property name - from the instance to get the value to substitute. - + from the instance to get the value to substitute. +
    For example, if an href value is defined: @@ -639,7 +639,7 @@ http://somesite.com/{id} Then it would be resolved by replace the value of the "id" property value from the instance object.
    - +
    If the value of the "id" property was "45", the expanded URI would be: @@ -648,23 +648,23 @@ http://somesite.com/45 ]]>
    - - If matching braces are found with the string "@" (no quotes) between the braces, then the + + If matching braces are found with the string "@" (no quotes) between the braces, then the actual instance value SHOULD be used to replace the braces, rather than a property value. - This should only be used in situations where the instance is a scalar (string, + This should only be used in situations where the instance is a scalar (string, boolean, or number), and not for objects or arrays.
    - +
    - The value of the "rel" property indicates the name of the + The value of the "rel" property indicates the name of the relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. - + Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: - + If the relation value is "self", when this property is encountered in @@ -672,15 +672,15 @@ http://somesite.com/45 treated as a full representation of the target resource identified by the specified URI. - + This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. - + This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. - + This relation indicates that the target of the link SHOULD be treated as the root or the body of the representation for the @@ -690,7 +690,7 @@ http://somesite.com/45 - + The following relations are applicable for schemas (the schema as the "from" resource in the relation): @@ -699,7 +699,7 @@ http://somesite.com/45 This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). - +
    For example, if a schema is defined: @@ -720,7 +720,7 @@ http://somesite.com/45 ]]>
    - +
    And if a collection of instance resource's JSON representation was retrieved: @@ -744,41 +744,41 @@ GET /Resource/ The "children" collection would be located at "/Resource/?upId=thing".
    - +
    This property value is a string that defines the templating language used in the "href" attribute. If no templating language is defined, then the default Link Description Object templating langauge is used.
    - +
    This property value is a schema that defines the expected structure of the JSON representation of the target of the link.
    - +
    - The following properties also apply to link definition objects, and - provide functionality analogous to HTML forms, in providing a + The following properties also apply to link definition objects, and + provide functionality analogous to HTML forms, in providing a means for submitting extra (often user supplied) information to send to a server. - +
    - This attribute defines which method can be used to access the target resource. - In an HTTP environment, this would be "GET" or "POST" (other HTTP methods - such as "PUT" and "DELETE" have semantics that are clearly implied by - accessed resources, and do not need to be defined here). + This attribute defines which method can be used to access the target resource. + In an HTTP environment, this would be "GET" or "POST" (other HTTP methods + such as "PUT" and "DELETE" have semantics that are clearly implied by + accessed resources, and do not need to be defined here). This defaults to "GET".
    - +
    If present, this property indicates a query media type format that the server - supports for querying or posting to the collection of instances at the target - resource. The query can be + supports for querying or posting to the collection of instances at the target + resource. The query can be suffixed to the target URI to query the collection with property-based constraints on the resources that SHOULD be returned from the server or used to post data to the resource (depending on the method). - +
    For example, with the following schema: @@ -799,7 +799,7 @@ GET /Resource/ This indicates that the client can query the server for instances that have a specific name.
    - +
    For example: @@ -809,23 +809,23 @@ GET /Resource/
    - If no enctype or method is specified, only the single URI specified by - the href property is defined. If the method is POST, "application/json" is + If no enctype or method is specified, only the single URI specified by + the href property is defined. If the method is POST, "application/json" is the default media type.
    - +
    This attribute contains a schema which defines the acceptable structure of the submitted - request (for a GET request, this schema would define the properties for the query string + request (for a GET request, this schema would define the properties for the query string and for a POST request, this would define the body).
    - +
    This property indicates the fragment resolution protocol to use for @@ -835,62 +835,62 @@ GET /Resource/ protocol is "json-pointer", which is defined below. Other fragment resolution protocols MAY be used, but are not defined in this document. - + The fragment identifier is based on RFC 3986, Sec 5, and defines the mechanism for resolving references to entities within a document. - +
    The "json-pointer" fragment resolution protocol uses a JSON Pointer to resolve fragment identifiers in URIs within instance representations.
    - + - +
    This attribute indicates that the instance value SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server.
    - +
    If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property.
    - +
    - This attribute is a URI that defines what the instance's URI MUST start with in order to validate. - The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, + This attribute is a URI that defines what the instance's URI MUST start with in order to validate. + The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, and is relative to the instance's URI. - + - When multiple schemas have been referenced for an instance, the user agent - can determine if this schema is applicable for a particular instance by + When multiple schemas have been referenced for an instance, the user agent + can determine if this schema is applicable for a particular instance by determining if the URI of the instance begins with the the value of the "pathStart" - attribute. If the URI of the instance does not start with this URI, - or if another schema specifies a starting URI that is longer and also matches the - instance, this schema SHOULD NOT be applied to the instance. Any schema - that does not have a pathStart attribute SHOULD be considered applicable + attribute. If the URI of the instance does not start with this URI, + or if another schema specifies a starting URI that is longer and also matches the + instance, this schema SHOULD NOT be applied to the instance. Any schema + that does not have a pathStart attribute SHOULD be considered applicable to all the instances for which it is referenced.
    - +
    This attribute defines the media type of the instance representations that this schema is defining.
    - +
    - This specification is a sub-type of the JSON format, and - consequently the security considerations are generally the same as RFC 4627. + This specification is a sub-type of the JSON format, and + consequently the security considerations are generally the same as RFC 4627. However, an additional issue is that when link relation of "self" - is used to denote a full representation of an object, the user agent + is used to denote a full representation of an object, the user agent SHOULD NOT consider the representation to be the authoritative representation of the resource denoted by the target URI if the target URI is not - equivalent to or a sub-path of the the URI used to request the resource + equivalent to or a sub-path of the the URI used to request the resource representation which contains the target URI with the "self" link. - +
    For example, if a hyper schema was defined: @@ -904,7 +904,7 @@ GET /Resource/ ]]>
    - +
    And a resource was requested from somesite.com: @@ -941,22 +941,22 @@ Content-Type: application/json; profile=/schema-for-this-data
    - +
    The proposed MIME media type for JSON Schema is "application/schema+json". Type name: application Subtype name: schema+json Required parameters: profile - The value of the profile parameter SHOULD be a URI (relative or absolute) that - refers to the schema used to define the structure of this structure (the + The value of the profile parameter SHOULD be a URI (relative or absolute) that + refers to the schema used to define the structure of this structure (the meta-schema). Normally the value would be http://json-schema.org/draft-04/hyper-schema, but it is allowable to use other schemas that extend the hyper schema's meta- schema. Optional parameters: pretty The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. - +
    This registry is maintained by IANA per RFC 4287 and this specification adds @@ -968,7 +968,7 @@ Content-Type: application/json; profile=/schema-for-this-data
    - + @@ -1019,7 +1019,7 @@ Content-Type: application/json; profile=/schema-for-this-data Improved wording of many sections.
    - + Added example and verbiage to "extends" attribute. @@ -1043,7 +1043,7 @@ Content-Type: application/json; profile=/schema-for-this-data Added "$ref" and "$schema" attributes. - + Replaced "maxDecimal" attribute with "divisibleBy" attribute. @@ -1053,13 +1053,13 @@ Content-Type: application/json; profile=/schema-for-this-data Added "targetSchema" attribute to link description object. - + Fixed category and updates from template. - + Initial draft. diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js index 60b38233344cf6..5b1bbbfdd61c8d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js @@ -1,4 +1,4 @@ -/** +/** * JSON Schema link handler * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) * Licensed under the MIT (MIT-LICENSE.txt) license. @@ -11,11 +11,11 @@ exports.getLink = function(relation, instance, schema){ // gets the URI of the link for the given relation based on the instance and schema // for example: // getLink( - // "brother", - // {"brother_id":33}, + // "brother", + // {"brother_id":33}, // {links:[{rel:"brother", href:"Brother/{brother_id}"}]}) -> // "Brother/33" - var links = schema.__linkTemplates; + var links = schema.__linkTemplates; if(!links){ links = {}; var schemaLinks = schema.links; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js index 53c7233cc83613..97cbbf6fa34603 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js @@ -194,8 +194,8 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O if(typeof instance != 'object' || instance instanceof Array){ errors.push({property:path,message:"an object is required"}); } - - for(var i in objTypeDef){ + + for(var i in objTypeDef){ if(objTypeDef.hasOwnProperty(i)){ var value = instance[i]; // skip _not_ specified properties diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json index ff4eeb116747e8..b77d8b34664b20 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "json-schema@0.2.2", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" + { + "raw": "json-schema@0.2.2", + "scope": null, + "escapedName": "json-schema", + "name": "json-schema", + "rawSpec": "0.2.2", + "spec": "0.2.2", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" ] ], "_from": "json-schema@0.2.2", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/jsprim/json-schema", "_npmUser": { - "email": "kriszyp@gmail.com", - "name": "kriszyp" + "name": "kriszyp", + "email": "kriszyp@gmail.com" }, "_npmVersion": "1.1.59", "_phantomChildren": {}, "_requested": { - "name": "json-schema", "raw": "json-schema@0.2.2", - "rawSpec": "0.2.2", "scope": null, + "escapedName": "json-schema", + "name": "json-schema", + "rawSpec": "0.2.2", "spec": "0.2.2", "type": "version" }, @@ -31,7 +40,7 @@ "_shasum": "50354f19f603917c695f70b85afa77c3b0f23506", "_shrinkwrap": null, "_spec": "json-schema@0.2.2", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", "author": { "name": "Kris Zyp" }, @@ -48,7 +57,7 @@ }, "dist": { "shasum": "50354f19f603917c695f70b85afa77c3b0f23506", - "tarball": "http://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz" + "tarball": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz" }, "homepage": "https://github.com/kriszyp/json-schema#readme", "keywords": [ diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md index 3393baeecb0337..e9b5497851cc45 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md @@ -41,7 +41,7 @@ request handler that stats a file and fails if it doesn't exist: fs.stat(filename, function (err) { if (err) /* Annotate the "stat" error with what we were doing. */ - return (callback(new verror.VError(err, + return (callback(new verror.VError(err, 'failed to check "%s"', filename))); /* ... */ @@ -49,14 +49,14 @@ request handler that stats a file and fails if it doesn't exist: } function handleRequest(filename, callback) { - checkFile('/nonexistent', function (err) { - if (err) { - /* Annotate the "checkFile" error with what we were doing. */ - return (callback(new verror.VError(err, 'request failed'))); - } - - /* ... */ - }); + checkFile('/nonexistent', function (err) { + if (err) { + /* Annotate the "checkFile" error with what we were doing. */ + return (callback(new verror.VError(err, 'request failed'))); + } + + /* ... */ + }); } handleRequest('/nonexistent', function (err) { diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf index 9b19899be678b9..bd724a2c784030 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf @@ -1,5 +1,5 @@ # -# Configuration File for JavaScript Lint +# Configuration File for JavaScript Lint # # This configuration file can be used to lint a collection of scripts, or to enable # or disable warnings for scripts that are linted via the command line. @@ -136,3 +136,4 @@ # To add a set of files, use "+process FileName", "+process Folder\Path\*.js", # or "+process Folder\Path\*.htm". # + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json index d1cd81287b3ec4..888fea03ebf0ec 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "verror@1.3.6", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" + { + "raw": "verror@1.3.6", + "scope": null, + "escapedName": "verror", + "name": "verror", + "rawSpec": "1.3.6", + "spec": "1.3.6", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" ] ], "_from": "verror@1.3.6", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/jsprim/verror", "_npmUser": { - "email": "dap@cs.brown.edu", - "name": "dap" + "name": "dap", + "email": "dap@cs.brown.edu" }, "_npmVersion": "1.1.65", "_phantomChildren": {}, "_requested": { - "name": "verror", "raw": "verror@1.3.6", - "rawSpec": "1.3.6", "scope": null, + "escapedName": "verror", + "name": "verror", + "rawSpec": "1.3.6", "spec": "1.3.6", "type": "version" }, @@ -31,7 +40,7 @@ "_shasum": "cff5df12946d297d2baaefaa2689e25be01c005c", "_shrinkwrap": null, "_spec": "verror@1.3.6", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", "bugs": { "url": "https://github.com/davepacheco/node-verror/issues" }, @@ -43,7 +52,7 @@ "directories": {}, "dist": { "shasum": "cff5df12946d297d2baaefaa2689e25be01c005c", - "tarball": "http://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + "tarball": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" }, "engines": [ "node >=0.6.0" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json index c172f623371be1..e7c32411843366 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json @@ -1,38 +1,51 @@ { "_args": [ [ - "jsprim@^1.2.2", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature" + { + "raw": "jsprim@^1.2.2", + "scope": null, + "escapedName": "jsprim", + "name": "jsprim", + "rawSpec": "^1.2.2", + "spec": ">=1.2.2 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature" ] ], "_from": "jsprim@>=1.2.2 <2.0.0", - "_id": "jsprim@1.2.2", + "_id": "jsprim@1.3.0", "_inCache": true, "_installable": true, "_location": "/request/http-signature/jsprim", - "_nodeVersion": "0.12.2", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/jsprim-1.3.0.tgz_1466708163640_0.5282344303559512" + }, "_npmUser": { - "email": "dap@cs.brown.edu", - "name": "dap" + "name": "dap", + "email": "dap@cs.brown.edu" }, - "_npmVersion": "2.7.4", + "_npmVersion": "2.11.3", "_phantomChildren": {}, "_requested": { - "name": "jsprim", "raw": "jsprim@^1.2.2", - "rawSpec": "^1.2.2", "scope": null, + "escapedName": "jsprim", + "name": "jsprim", + "rawSpec": "^1.2.2", "spec": ">=1.2.2 <2.0.0", "type": "range" }, "_requiredBy": [ "/request/http-signature" ], - "_resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz", - "_shasum": "f20c906ac92abd58e3b79ac8bc70a48832512da1", + "_resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.0.tgz", + "_shasum": "ce2e1bef835204b4f3099928c602f8b6ae615650", "_shrinkwrap": null, "_spec": "jsprim@^1.2.2", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature", "bugs": { "url": "https://github.com/davepacheco/node-jsprim/issues" }, @@ -45,14 +58,14 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "f20c906ac92abd58e3b79ac8bc70a48832512da1", - "tarball": "http://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz" + "shasum": "ce2e1bef835204b4f3099928c602f8b6ae615650", + "tarball": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.0.tgz" }, "engines": [ "node >=0.6.0" ], - "gitHead": "0e709876c35eddfe4c1f95104ac3c4abfc9dab84", - "homepage": "https://github.com/davepacheco/node-jsprim", + "gitHead": "694edcb22e2291c21f6c2a23907bf02e1edbfdf4", + "homepage": "https://github.com/davepacheco/node-jsprim#readme", "license": "MIT", "main": "./lib/jsprim.js", "maintainers": [ @@ -69,5 +82,5 @@ "url": "git://github.com/davepacheco/node-jsprim.git" }, "scripts": {}, - "version": "1.2.2" + "version": "1.3.0" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml index 54692343d99003..c3394c258fc2aa 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml @@ -1,11 +1,11 @@ language: node_js node_js: - - "4.2" + - "5.10" + - "4.4" - "4.1" - "0.12" - "0.10" - - "0.8" before_install: - "make check" after_success: - - '[ "${TRAVIS_NODE_VERSION}" = "4.2" ] && make codecovio' + - '[ "${TRAVIS_NODE_VERSION}" = "4.4" ] && make codecovio' diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md index bc34d48a49fd3d..00a4055204f14c 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md @@ -4,7 +4,7 @@ sshpk Parse, convert, fingerprint and use SSH keys (both public and private) in pure node -- no `ssh-keygen` or other external dependencies. -Supports RSA, DSA, ECDSA (nistp-\*) and ED25519 key types, in PEM (PKCS#1, +Supports RSA, DSA, ECDSA (nistp-\*) and ED25519 key types, in PEM (PKCS#1, PKCS#8) and OpenSSH formats. This library has been extracted from @@ -111,7 +111,7 @@ Usage ## Public keys -### `parseKey(data[, format = 'auto'[, name]])` +### `parseKey(data[, format = 'auto'[, options]])` Parses a key from a given data format and returns a new `Key` object. @@ -124,10 +124,14 @@ Parameters - `ssh`: standard OpenSSH format, - `pkcs1`, `pkcs8`: variants of `pem` - `rfc4253`: raw OpenSSH wire format - - `openssh`: new post-OpenSSH 6.5 internal format, produced by + - `openssh`: new post-OpenSSH 6.5 internal format, produced by `ssh-keygen -o` -- `name` -- Optional name for the key being parsed (eg. the filename that - was opened). Used to generate Error messages +- `options` -- Optional Object, extra options, with keys: + - `filename` -- Optional String, name for the key being parsed + (eg. the filename that was opened). Used to generate + Error messages + - `passphrase` -- Optional String, encryption passphrase used to decrypt an + encrypted PEM file ### `Key.isKey(obj)` @@ -212,7 +216,7 @@ to call this function on other keys will yield an `Error`. ## Private keys -### `parsePrivateKey(data[, format = 'auto'[, name]])` +### `parsePrivateKey(data[, format = 'auto'[, options]])` Parses a private key from a given data format and returns a new `PrivateKey` object. @@ -223,12 +227,16 @@ Parameters - `format` -- String name of format to use, valid options are: - `auto`: choose automatically from all below - `pem`: supports both PKCS#1 and PKCS#8 - - `ssh`, `openssh`: new post-OpenSSH 6.5 internal format, produced by + - `ssh`, `openssh`: new post-OpenSSH 6.5 internal format, produced by `ssh-keygen -o` - `pkcs1`, `pkcs8`: variants of `pem` - `rfc4253`: raw OpenSSH wire format -- `name` -- Optional name for the key being parsed (eg. the filename that - was opened). Used to generate Error messages +- `options` -- Optional Object, extra options, with keys: + - `filename` -- Optional String, name for the key being parsed + (eg. the filename that was opened). Used to generate + Error messages + - `passphrase` -- Optional String, encryption passphrase used to decrypt an + encrypted PEM file ### `PrivateKey.isPrivateKey(obj)` @@ -261,7 +269,7 @@ a Buffer. Parameters -- `format` -- String name of format to use, valid options are listed under +- `format` -- String name of format to use, valid options are listed under `parsePrivateKey`. Note that ED25519 keys default to `openssh` format instead (as they have no `pkcs1` representation). @@ -393,6 +401,206 @@ Parameters Same as `this.toBuffer(format).toString('base64')`. +## Certificates + +`sshpk` includes basic support for parsing certificates in X.509 (PEM) format +and the OpenSSH certificate format. This feature is intended to be used mainly +to access basic metadata about certificates, extract public keys from them, and +also to generate simple self-signed certificates from an existing key. + +Notably, there is no implementation of CA chain-of-trust verification, and no +support for key usage restrictions (or other kinds of restrictions). Please do +the security world a favour, and DO NOT use this code for certificate +verification in the traditional X.509 CA chain style. + +### `parseCertificate(data, format)` + +Parameters + + - `data` -- a Buffer or String + - `format` -- a String, format to use, one of `'openssh'`, `'pem'` (X.509 in a + PEM wrapper), or `'x509'` (raw DER encoded) + +### `createSelfSignedCertificate(subject, privateKey[, options])` + +Parameters + + - `subject` -- an Identity, the subject of the certificate + - `privateKey` -- a PrivateKey, the key of the subject: will be used both to be + placed in the certificate and also to sign it (since this is + a self-signed certificate) + - `options` -- optional Object, with keys: + - `lifetime` -- optional Number, lifetime of the certificate from now in + seconds + - `validFrom`, `validUntil` -- optional Dates, beginning and end of + certificate validity period. If given + `lifetime` will be ignored + - `serial` -- optional Buffer, the serial number of the certificate + +### `createCertificate(subject, key, issuer, issuerKey[, options])` + +Parameters + + - `subject` -- an Identity, the subject of the certificate + - `key` -- a Key, the public key of the subject + - `issuer` -- an Identity, the issuer of the certificate who will sign it + - `issuerKey` -- a PrivateKey, the issuer's private key for signing + - `options` -- optional Object, with keys: + - `lifetime` -- optional Number, lifetime of the certificate from now in + seconds + - `validFrom`, `validUntil` -- optional Dates, beginning and end of + certificate validity period. If given + `lifetime` will be ignored + - `serial` -- optional Buffer, the serial number of the certificate + +### `Certificate#subjects` + +Array of `Identity` instances describing the subject of this certificate. + +### `Certificate#issuer` + +The `Identity` of the Certificate's issuer (signer). + +### `Certificate#subjectKey` + +The public key of the subject of the certificate, as a `Key` instance. + +### `Certificate#issuerKey` + +The public key of the signing issuer of this certificate, as a `Key` instance. +May be `undefined` if the issuer's key is unknown (e.g. on an X509 certificate). + +### `Certificate#serial` + +The serial number of the certificate. As this is normally a 64-bit or wider +integer, it is returned as a Buffer. + +### `Certificate#isExpired([when])` + +Tests whether the Certificate is currently expired (i.e. the `validFrom` and +`validUntil` dates specify a range of time that does not include the current +time). + +Parameters + + - `when` -- optional Date, if specified, tests whether the Certificate was or + will be expired at the specified time instead of now + +Returns a Boolean. + +### `Certificate#isSignedByKey(key)` + +Tests whether the Certificate was validly signed by the given (public) Key. + +Parameters + + - `key` -- a Key instance + +Returns a Boolean. + +### `Certificate#isSignedBy(certificate)` + +Tests whether this Certificate was validly signed by the subject of the given +certificate. Also tests that the issuer Identity of this Certificate and the +subject Identity of the other Certificate are equivalent. + +Parameters + + - `certificate` -- another Certificate instance + +Returns a Boolean. + +### `Certificate#fingerprint([hashAlgo])` + +Returns the X509-style fingerprint of the entire certificate (as a Fingerprint +instance). This matches what a web-browser or similar would display as the +certificate fingerprint and should not be confused with the fingerprint of the +subject's public key. + +Parameters + + - `hashAlgo` -- an optional String, any hash function name + +### `Certificate#toBuffer([format])` + +Serializes the Certificate to a Buffer and returns it. + +Parameters + + - `format` -- an optional String, output format, one of `'openssh'`, `'pem'` or + `'x509'`. Defaults to `'x509'`. + +Returns a Buffer. + +### `Certificate#toString([format])` + + - `format` -- an optional String, output format, one of `'openssh'`, `'pem'` or + `'x509'`. Defaults to `'pem'`. + +Returns a String. + +## Certificate identities + +### `identityForHost(hostname)` + +Constructs a host-type Identity for a given hostname. + +Parameters + + - `hostname` -- the fully qualified DNS name of the host + +Returns an Identity instance. + +### `identityForUser(uid)` + +Constructs a user-type Identity for a given UID. + +Parameters + + - `uid` -- a String, user identifier (login name) + +Returns an Identity instance. + +### `identityForEmail(email)` + +Constructs an email-type Identity for a given email address. + +Parameters + + - `email` -- a String, email address + +Returns an Identity instance. + +### `identityFromDN(dn)` + +Parses an LDAP-style DN string (e.g. `'CN=foo, C=US'`) and turns it into an +Identity instance. + +Parameters + + - `dn` -- a String + +Returns an Identity instance. + +### `Identity#toString()` + +Returns the identity as an LDAP-style DN string. +e.g. `'CN=foo, O=bar corp, C=us'` + +### `Identity#type` + +The type of identity. One of `'host'`, `'user'`, `'email'` or `'unknown'` + +### `Identity#hostname` +### `Identity#uid` +### `Identity#email` + +Set when `type` is `'host'`, `'user'`, or `'email'`, respectively. Strings. + +### `Identity#cn` + +The value of the first `CN=` in the DN, if any. + Errors ------ @@ -425,8 +633,30 @@ The key data given could not be parsed as a valid key. Properties -- `keyName` -- `name` that was given to `Key#parse` +- `keyName` -- `filename` that was given to `parseKey` +- `format` -- the `format` that was trying to parse the key (see `parseKey`) +- `innerErr` -- the inner Error thrown by the format parser + +### `KeyEncryptedError` + +The key is encrypted with a symmetric key (ie, it is password protected). The +parsing operation would succeed if it was given the `passphrase` option. + +Properties + +- `keyName` -- `filename` that was given to `parseKey` +- `format` -- the `format` that was trying to parse the key (currently can only + be `"pem"`) + +### `CertificateParseError` + +The certificate data given could not be parsed as a valid certificate. + +Properties + +- `certName` -- `filename` that was given to `parseCertificate` - `format` -- the `format` that was trying to parse the key + (see `parseCertificate`) - `innerErr` -- the inner Error thrown by the format parser Friends of sshpk diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv index 8eec411ffb8cb1..a1205a45d5431f 100755 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv @@ -7,6 +7,9 @@ var dashdash = require('dashdash'); var sshpk = require('../lib/index'); var fs = require('fs'); var path = require('path'); +var tty = require('tty'); +var readline = require('readline'); +var getPassword = require('getpass').getPass; var options = [ { @@ -131,7 +134,9 @@ if (require.main === module) { while ((data = inFile.read())) bufs.push(data); }); - inFile.on('end', function () { + var parseOpts = {}; + parseOpts.filename = inFileName; + inFile.on('end', function processKey() { var buf = Buffer.concat(bufs); var fmt = 'auto'; if (opts.informat) @@ -140,8 +145,15 @@ if (require.main === module) { if (opts.private) f = sshpk.parsePrivateKey; try { - var key = f(buf, fmt, inFileName); + var key = f(buf, fmt, parseOpts); } catch (e) { + if (e.name === 'KeyEncryptedError') { + getPassword(function (err, pw) { + parseOpts.passphrase = pw; + processKey(); + }); + return; + } console.error('sshpk-conv: ' + e.name + ': ' + e.message); process.exit(1); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign index c8b91932aa62ee..673fc9864214db 100755 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign @@ -7,6 +7,7 @@ var dashdash = require('dashdash'); var sshpk = require('../lib/index'); var fs = require('fs'); var path = require('path'); +var getPassword = require('getpass').getPass; var options = [ { @@ -51,6 +52,8 @@ var options = [ } ]; +var parseOpts = {}; + if (require.main === module) { var parser = dashdash.createParser({ options: options @@ -79,11 +82,23 @@ if (require.main === module) { } var keyData = fs.readFileSync(opts.identity); + parseOpts.filename = opts.identity; + + run(); +} +function run() { var key; try { - key = sshpk.parsePrivateKey(keyData); + key = sshpk.parsePrivateKey(keyData, 'auto', parseOpts); } catch (e) { + if (e.name === 'KeyEncryptedError') { + getPassword(function (err, pw) { + parseOpts.passphrase = pw; + run(); + }); + return; + } console.error('sshpk-sign: error loading private key "' + opts.identity + '": ' + e.name + ': ' + e.message); process.exit(1); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/certificate.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/certificate.js new file mode 100644 index 00000000000000..4fbe6abad451da --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/certificate.js @@ -0,0 +1,291 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = Certificate; + +var assert = require('assert-plus'); +var algs = require('./algs'); +var crypto = require('crypto'); +var Fingerprint = require('./fingerprint'); +var Signature = require('./signature'); +var errs = require('./errors'); +var util = require('util'); +var utils = require('./utils'); +var Key = require('./key'); +var PrivateKey = require('./private-key'); +var Identity = require('./identity'); + +var formats = {}; +formats['openssh'] = require('./formats/openssh-cert'); +formats['x509'] = require('./formats/x509'); +formats['pem'] = require('./formats/x509-pem'); + +var CertificateParseError = errs.CertificateParseError; +var InvalidAlgorithmError = errs.InvalidAlgorithmError; + +function Certificate(opts) { + assert.object(opts, 'options'); + assert.arrayOfObject(opts.subjects, 'options.subjects'); + utils.assertCompatible(opts.subjects[0], Identity, [1, 0], + 'options.subjects'); + utils.assertCompatible(opts.subjectKey, Key, [1, 0], + 'options.subjectKey'); + utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); + if (opts.issuerKey !== undefined) { + utils.assertCompatible(opts.issuerKey, Key, [1, 0], + 'options.issuerKey'); + } + assert.object(opts.signatures, 'options.signatures'); + assert.buffer(opts.serial, 'options.serial'); + assert.date(opts.validFrom, 'options.validFrom'); + assert.date(opts.validUntil, 'optons.validUntil'); + + this._hashCache = {}; + + this.subjects = opts.subjects; + this.issuer = opts.issuer; + this.subjectKey = opts.subjectKey; + this.issuerKey = opts.issuerKey; + this.signatures = opts.signatures; + this.serial = opts.serial; + this.validFrom = opts.validFrom; + this.validUntil = opts.validUntil; +} + +Certificate.formats = formats; + +Certificate.prototype.toBuffer = function (format, options) { + if (format === undefined) + format = 'x509'; + assert.string(format, 'format'); + assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); + + return (formats[format].write(this, options)); +}; + +Certificate.prototype.toString = function (format, options) { + if (format === undefined) + format = 'pem'; + return (this.toBuffer(format, options).toString()); +}; + +Certificate.prototype.fingerprint = function (algo) { + if (algo === undefined) + algo = 'sha256'; + assert.string(algo, 'algorithm'); + var opts = { + type: 'certificate', + hash: this.hash(algo), + algorithm: algo + }; + return (new Fingerprint(opts)); +}; + +Certificate.prototype.hash = function (algo) { + assert.string(algo, 'algorithm'); + algo = algo.toLowerCase(); + if (algs.hashAlgs[algo] === undefined) + throw (new InvalidAlgorithmError(algo)); + + if (this._hashCache[algo]) + return (this._hashCache[algo]); + + var hash = crypto.createHash(algo). + update(this.toBuffer('x509')).digest(); + this._hashCache[algo] = hash; + return (hash); +}; + +Certificate.prototype.isExpired = function (when) { + if (when === undefined) + when = new Date(); + return (!((when.getTime() >= this.validFrom.getTime()) && + (when.getTime() < this.validUntil.getTime()))); +}; + +Certificate.prototype.isSignedBy = function (issuerCert) { + utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); + + if (!this.issuer.equals(issuerCert.subjects[0])) + return (false); + + return (this.isSignedByKey(issuerCert.subjectKey)); +}; + +Certificate.prototype.isSignedByKey = function (issuerKey) { + utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); + + if (this.issuerKey !== undefined) { + return (this.issuerKey. + fingerprint('sha512').matches(issuerKey)); + } + + var fmt = Object.keys(this.signatures)[0]; + var valid = formats[fmt].verify(this, issuerKey); + if (valid) + this.issuerKey = issuerKey; + return (valid); +}; + +Certificate.prototype.signWith = function (key) { + utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); + var fmts = Object.keys(formats); + var didOne = false; + for (var i = 0; i < fmts.length; ++i) { + if (fmts[i] !== 'pem') { + var ret = formats[fmts[i]].sign(this, key); + if (ret === true) + didOne = true; + } + } + if (!didOne) { + throw (new Error('Failed to sign the certificate for any ' + + 'available certificate formats')); + } +}; + +Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; + + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); + + utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = new Buffer('0000000000000001', 'hex'); + + var cert = new Certificate({ + subjects: subjects, + issuer: subjects[0], + subjectKey: key.toPublic(), + issuerKey: key.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil + }); + cert.signWith(key); + + return (cert); +}; + +Certificate.create = + function (subjectOrSubjects, key, issuer, issuerKey, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; + + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); + + utils.assertCompatible(key, Key, [1, 0], 'key'); + if (PrivateKey.isPrivateKey(key)) + key = key.toPublic(); + utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); + utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = new Buffer('0000000000000001', 'hex'); + + var cert = new Certificate({ + subjects: subjects, + issuer: issuer, + subjectKey: key, + issuerKey: issuerKey.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil + }); + cert.signWith(issuerKey); + + return (cert); +}; + +Certificate.parse = function (data, format, options) { + if (typeof (data) !== 'string') + assert.buffer(data, 'data'); + if (format === undefined) + format = 'auto'; + assert.string(format, 'format'); + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; + + assert.object(formats[format], 'formats[format]'); + + try { + var k = formats[format].read(data, options); + return (k); + } catch (e) { + throw (new CertificateParseError(options.filename, format, e)); + } +}; + +Certificate.isCertificate = function (obj, ver) { + return (utils.isCompatible(obj, Certificate, ver)); +}; + +/* + * API versions for Certificate: + * [1,0] -- initial ver + */ +Certificate.prototype._sshpkApiVersion = [1, 0]; + +Certificate._oldVersionDetect = function (obj) { + return ([1, 0]); +}; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js index 3551c1071e27ad..1cc09ec71d48db 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js @@ -50,9 +50,35 @@ function SignatureParseError(type, format, innerErr) { } util.inherits(SignatureParseError, Error); +function CertificateParseError(name, format, innerErr) { + if (Error.captureStackTrace) + Error.captureStackTrace(this, CertificateParseError); + this.name = 'CertificateParseError'; + this.format = format; + this.certName = name; + this.innerErr = innerErr; + this.message = 'Failed to parse ' + name + ' as a valid ' + format + + ' format certificate: ' + innerErr.message; +} +util.inherits(CertificateParseError, Error); + +function KeyEncryptedError(name, format) { + if (Error.captureStackTrace) + Error.captureStackTrace(this, KeyEncryptedError); + this.name = 'KeyEncryptedError'; + this.format = format; + this.keyName = name; + this.message = 'The ' + format + ' format key ' + name + ' is ' + + 'encrypted (password-protected), and no passphrase was ' + + 'provided in `options`'; +} +util.inherits(KeyEncryptedError, Error); + module.exports = { FingerprintFormatError: FingerprintFormatError, InvalidAlgorithmError: InvalidAlgorithmError, KeyParseError: KeyParseError, - SignatureParseError: SignatureParseError + SignatureParseError: SignatureParseError, + KeyEncryptedError: KeyEncryptedError, + CertificateParseError: CertificateParseError }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js index c607330e7f5f68..7ed7e5130467ff 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js @@ -7,6 +7,7 @@ var algs = require('./algs'); var crypto = require('crypto'); var errs = require('./errors'); var Key = require('./key'); +var Certificate = require('./certificate'); var utils = require('./utils'); var FingerprintFormatError = errs.FingerprintFormatError; @@ -14,6 +15,7 @@ var InvalidAlgorithmError = errs.InvalidAlgorithmError; function Fingerprint(opts) { assert.object(opts, 'options'); + assert.string(opts.type, 'options.type'); assert.buffer(opts.hash, 'options.hash'); assert.string(opts.algorithm, 'options.algorithm'); @@ -22,6 +24,7 @@ function Fingerprint(opts) { throw (new InvalidAlgorithmError(this.algorithm)); this.hash = opts.hash; + this.type = opts.type; } Fingerprint.prototype.toString = function (format) { @@ -44,11 +47,16 @@ Fingerprint.prototype.toString = function (format) { } }; -Fingerprint.prototype.matches = function (key) { - assert.object(key, 'key'); - utils.assertCompatible(key, Key, [1, 0], 'key'); +Fingerprint.prototype.matches = function (other) { + assert.object(other, 'key or certificate'); + if (this.type === 'key') { + utils.assertCompatible(other, Key, [1, 0], 'key'); + } else { + utils.assertCompatible(other, Certificate, [1, 0], + 'certificate'); + } - var theirHash = key.hash(this.algorithm); + var theirHash = other.hash(this.algorithm); var theirHash2 = crypto.createHash(this.algorithm). update(theirHash).digest('base64'); @@ -59,10 +67,19 @@ Fingerprint.prototype.matches = function (key) { return (this.hash2 === theirHash2); }; -Fingerprint.parse = function (fp, enAlgs) { +Fingerprint.parse = function (fp, options) { assert.string(fp, 'fingerprint'); - var alg, hash; + var alg, hash, enAlgs; + if (Array.isArray(options)) { + enAlgs = options; + options = {}; + } + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + if (options.enAlgs !== undefined) + enAlgs = options.enAlgs; assert.optionalArrayOfString(enAlgs, 'algorithms'); var parts = fp.split(':'); @@ -105,7 +122,11 @@ Fingerprint.parse = function (fp, enAlgs) { throw (new InvalidAlgorithmError(alg)); } - return (new Fingerprint({algorithm: alg, hash: hash})); + return (new Fingerprint({ + algorithm: alg, + hash: hash, + type: options.type || 'key' + })); }; function addColons(s) { diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js index 37c3cc81356676..973c03245e3807 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js @@ -14,24 +14,24 @@ var pem = require('./pem'); var ssh = require('./ssh'); var rfc4253 = require('./rfc4253'); -function read(buf) { +function read(buf, options) { if (typeof (buf) === 'string') { if (buf.trim().match(/^[-]+[ ]*BEGIN/)) - return (pem.read(buf)); + return (pem.read(buf, options)); if (buf.match(/^\s*ssh-[a-z]/)) - return (ssh.read(buf)); + return (ssh.read(buf, options)); if (buf.match(/^\s*ecdsa-/)) - return (ssh.read(buf)); + return (ssh.read(buf, options)); buf = new Buffer(buf, 'binary'); } else { assert.buffer(buf); if (findPEMHeader(buf)) - return (pem.read(buf)); + return (pem.read(buf, options)); if (findSSHHeader(buf)) - return (ssh.read(buf)); + return (ssh.read(buf, options)); } if (buf.readUInt32BE(0) < buf.length) - return (rfc4253.read(buf)); + return (rfc4253.read(buf, options)); throw (new Error('Failed to auto-detect format of key')); } @@ -68,6 +68,6 @@ function findPEMHeader(buf) { return (true); } -function write(key) { +function write(key, options) { throw (new Error('"auto" format cannot be used for writing')); } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/openssh-cert.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/openssh-cert.js new file mode 100644 index 00000000000000..8ce7350fee26bb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/openssh-cert.js @@ -0,0 +1,289 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = { + read: read, + verify: verify, + sign: sign, + write: write, + + /* Internal private API */ + fromBuffer: fromBuffer, + toBuffer: toBuffer +}; + +var assert = require('assert-plus'); +var SSHBuffer = require('../ssh-buffer'); +var crypto = require('crypto'); +var algs = require('../algs'); +var Key = require('../key'); +var PrivateKey = require('../private-key'); +var Identity = require('../identity'); +var rfc4253 = require('./rfc4253'); +var Signature = require('../signature'); +var utils = require('../utils'); +var Certificate = require('../certificate'); + +function verify(cert, key) { + /* + * We always give an issuerKey, so if our verify() is being called then + * there was no signature. Return false. + */ + return (false); +} + +var TYPES = { + 'user': 1, + 'host': 2 +}; +Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; }); + +var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; + +function read(buf, options) { + if (Buffer.isBuffer(buf)) + buf = buf.toString('ascii'); + var parts = buf.trim().split(/[ \t\n]+/g); + if (parts.length < 2 || parts.length > 3) + throw (new Error('Not a valid SSH certificate line')); + + var algo = parts[0]; + var data = parts[1]; + + data = new Buffer(data, 'base64'); + return (fromBuffer(data, algo)); +} + +function fromBuffer(data, algo, partial) { + var sshbuf = new SSHBuffer({ buffer: data }); + var innerAlgo = sshbuf.readString(); + if (algo !== undefined && innerAlgo !== algo) + throw (new Error('SSH certificate algorithm mismatch')); + if (algo === undefined) + algo = innerAlgo; + + var cert = {}; + cert.signatures = {}; + cert.signatures.openssh = {}; + + cert.signatures.openssh.nonce = sshbuf.readBuffer(); + + var key = {}; + var parts = (key.parts = []); + key.type = getAlg(algo); + + var partCount = algs.info[key.type].parts.length; + while (parts.length < partCount) + parts.push(sshbuf.readPart()); + assert.ok(parts.length >= 1, 'key must have at least one part'); + + var algInfo = algs.info[key.type]; + if (key.type === 'ecdsa') { + var res = ECDSA_ALGO.exec(algo); + assert.ok(res !== null); + assert.strictEqual(res[1], parts[0].data.toString()); + } + + for (var i = 0; i < algInfo.parts.length; ++i) { + parts[i].name = algInfo.parts[i]; + if (parts[i].name !== 'curve' && + algInfo.normalize !== false) { + var p = parts[i]; + p.data = utils.mpNormalize(p.data); + } + } + + cert.subjectKey = new Key(key); + + cert.serial = sshbuf.readInt64(); + + var type = TYPES[sshbuf.readInt()]; + assert.string(type, 'valid cert type'); + + cert.signatures.openssh.keyId = sshbuf.readString(); + + var principals = []; + var pbuf = sshbuf.readBuffer(); + var psshbuf = new SSHBuffer({ buffer: pbuf }); + while (!psshbuf.atEnd()) + principals.push(psshbuf.readString()); + if (principals.length === 0) + principals = ['*']; + + cert.subjects = principals.map(function (pr) { + if (type === 'user') + return (Identity.forUser(pr)); + else if (type === 'host') + return (Identity.forHost(pr)); + throw (new Error('Unknown identity type ' + type)); + }); + + cert.validFrom = int64ToDate(sshbuf.readInt64()); + cert.validUntil = int64ToDate(sshbuf.readInt64()); + + cert.signatures.openssh.critical = sshbuf.readBuffer(); + cert.signatures.openssh.exts = sshbuf.readBuffer(); + + /* reserved */ + sshbuf.readBuffer(); + + var signingKeyBuf = sshbuf.readBuffer(); + cert.issuerKey = rfc4253.read(signingKeyBuf); + + /* + * OpenSSH certs don't give the identity of the issuer, just their + * public key. So, we use an Identity that matches anything. The + * isSignedBy() function will later tell you if the key matches. + */ + cert.issuer = Identity.forHost('**'); + + var sigBuf = sshbuf.readBuffer(); + cert.signatures.openssh.signature = + Signature.parse(sigBuf, cert.issuerKey.type, 'ssh'); + + if (partial !== undefined) { + partial.remainder = sshbuf.remainder(); + partial.consumed = sshbuf._offset; + } + + return (new Certificate(cert)); +} + +function int64ToDate(buf) { + var i = buf.readUInt32BE(0) * 4294967296; + i += buf.readUInt32BE(4); + var d = new Date(); + d.setTime(i * 1000); + d.sourceInt64 = buf; + return (d); +} + +function dateToInt64(date) { + if (date.sourceInt64 !== undefined) + return (date.sourceInt64); + var i = Math.round(date.getTime() / 1000); + var upper = Math.floor(i / 4294967296); + var lower = Math.floor(i % 4294967296); + var buf = new Buffer(8); + buf.writeUInt32BE(upper, 0); + buf.writeUInt32BE(lower, 4); + return (buf); +} + +function sign(cert, key) { + if (cert.signatures.openssh === undefined) + cert.signatures.openssh = {}; + try { + var blob = toBuffer(cert, true); + } catch (e) { + delete (cert.signatures.openssh); + return (false); + } + var sig = cert.signatures.openssh; + var hashAlgo = undefined; + if (key.type === 'rsa' || key.type === 'dsa') + hashAlgo = 'sha1'; + var signer = key.createSign(hashAlgo); + signer.write(blob); + sig.signature = signer.sign(); + return (true); +} + +function write(cert, options) { + if (options === undefined) + options = {}; + + var blob = toBuffer(cert); + var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64'); + if (options.comment) + out = out + ' ' + options.comment; + return (out); +} + + +function toBuffer(cert, noSig) { + assert.object(cert.signatures.openssh, 'signature for openssh format'); + var sig = cert.signatures.openssh; + + if (sig.nonce === undefined) + sig.nonce = crypto.randomBytes(16); + var buf = new SSHBuffer({}); + buf.writeString(getCertType(cert.subjectKey)); + buf.writeBuffer(sig.nonce); + + var key = cert.subjectKey; + var algInfo = algs.info[key.type]; + algInfo.parts.forEach(function (part) { + buf.writePart(key.part[part]); + }); + + buf.writeInt64(cert.serial); + + var type = cert.subjects[0].type; + assert.notStrictEqual(type, 'unknown'); + cert.subjects.forEach(function (id) { + assert.strictEqual(id.type, type); + }); + type = TYPES[type]; + buf.writeInt(type); + + if (sig.keyId === undefined) { + sig.keyId = cert.subjects[0].type + '_' + + (cert.subjects[0].uid || cert.subjects[0].hostname); + } + buf.writeString(sig.keyId); + + var sub = new SSHBuffer({}); + cert.subjects.forEach(function (id) { + if (type === TYPES.host) + sub.writeString(id.hostname); + else if (type === TYPES.user) + sub.writeString(id.uid); + }); + buf.writeBuffer(sub.toBuffer()); + + buf.writeInt64(dateToInt64(cert.validFrom)); + buf.writeInt64(dateToInt64(cert.validUntil)); + + if (sig.critical === undefined) + sig.critical = new Buffer(0); + buf.writeBuffer(sig.critical); + + if (sig.exts === undefined) + sig.exts = new Buffer(0); + buf.writeBuffer(sig.exts); + + /* reserved */ + buf.writeBuffer(new Buffer(0)); + + sub = rfc4253.write(cert.issuerKey); + buf.writeBuffer(sub); + + if (!noSig) + buf.writeBuffer(sig.signature.toBuffer('ssh')); + + return (buf.toBuffer()); +} + +function getAlg(certType) { + if (certType === 'ssh-rsa-cert-v01@openssh.com') + return ('rsa'); + if (certType === 'ssh-dss-cert-v01@openssh.com') + return ('dsa'); + if (certType.match(ECDSA_ALGO)) + return ('ecdsa'); + if (certType === 'ssh-ed25519-cert-v01@openssh.com') + return ('ed25519'); + throw (new Error('Unsupported cert type ' + certType)); +} + +function getCertType(key) { + if (key.type === 'rsa') + return ('ssh-rsa-cert-v01@openssh.com'); + if (key.type === 'dsa') + return ('ssh-dss-cert-v01@openssh.com'); + if (key.type === 'ecdsa') + return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com'); + if (key.type === 'ed25519') + return ('ssh-ed25519-cert-v01@openssh.com'); + throw (new Error('Unsupported key type ' + key.type)); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js index 1d907607e29dc3..5318b35165336d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js @@ -7,6 +7,7 @@ module.exports = { var assert = require('assert-plus'); var asn1 = require('asn1'); +var crypto = require('crypto'); var algs = require('../algs'); var utils = require('../utils'); var Key = require('../key'); @@ -17,11 +18,13 @@ var pkcs8 = require('./pkcs8'); var sshpriv = require('./ssh-private'); var rfc4253 = require('./rfc4253'); +var errors = require('../errors'); + /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, * we just take the public component of it and use that. */ -function read(buf, forceType) { +function read(buf, options, forceType) { var input = buf; if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); @@ -58,12 +61,26 @@ function read(buf, forceType) { break; headers[m[1].toLowerCase()] = m[2]; } + + var cipher, key, iv; if (headers['proc-type']) { var parts = headers['proc-type'].split(','); if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { - throw (new Error('PEM key is encrypted ' + - '(password-protected). Please use the ' + - 'SSH agent or decrypt the key.')); + if (typeof (options.passphrase) === 'string') { + options.passphrase = new Buffer( + options.passphrase, 'utf-8'); + } + if (!Buffer.isBuffer(options.passphrase)) { + throw (new errors.KeyEncryptedError( + options.filename, 'PEM')); + } else { + parts = headers['dek-info'].split(','); + assert.ok(parts.length === 2); + cipher = parts[0].toLowerCase(); + iv = new Buffer(parts[1], 'hex'); + key = utils.opensslKeyDeriv(cipher, iv, + options.passphrase, 1).key; + } } } @@ -71,6 +88,23 @@ function read(buf, forceType) { lines = lines.slice(0, -1).join(''); buf = new Buffer(lines, 'base64'); + if (cipher && key && iv) { + var cipherStream = crypto.createDecipheriv(cipher, key, iv); + var chunk, chunks = []; + cipherStream.once('error', function (e) { + if (e.toString().indexOf('bad decrypt') !== -1) { + throw (new Error('Incorrect passphrase ' + + 'supplied, could not decrypt key')); + } + throw (e); + }); + cipherStream.write(buf); + cipherStream.end(); + while ((chunk = cipherStream.read()) !== null) + chunks.push(chunk); + buf = Buffer.concat(chunks); + } + /* The new OpenSSH internal format abuses PEM headers */ if (alg && alg.toLowerCase() === 'openssh') return (sshpriv.readSSHPrivate(type, buf)); @@ -98,7 +132,7 @@ function read(buf, forceType) { } } -function write(key, type) { +function write(key, options, type) { assert.object(key); var alg = {'ecdsa': 'EC', 'rsa': 'RSA', 'dsa': 'DSA'}[key.type]; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js index 6f9a24f115042b..a5676af6ef8420 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js @@ -19,12 +19,12 @@ var pem = require('./pem'); var pkcs8 = require('./pkcs8'); var readECDSACurve = pkcs8.readECDSACurve; -function read(buf) { - return (pem.read(buf, 'pkcs1')); +function read(buf, options) { + return (pem.read(buf, options, 'pkcs1')); } -function write(key) { - return (pem.write(key, 'pkcs1')); +function write(key, options) { + return (pem.write(key, options, 'pkcs1')); } /* Helper to read in a single mpint */ diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js index c57c85537a72ca..4ccbefcbec2be2 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js @@ -18,12 +18,12 @@ var Key = require('../key'); var PrivateKey = require('../private-key'); var pem = require('./pem'); -function read(buf) { - return (pem.read(buf, 'pkcs8')); +function read(buf, options) { + return (pem.read(buf, options, 'pkcs8')); } -function write(key) { - return (pem.write(key, 'pkcs8')); +function write(key, options) { + return (pem.write(key, options, 'pkcs8')); } /* Helper to read in a single mpint */ @@ -42,10 +42,12 @@ function readPkcs8(alg, type, der) { } der.readSequence(); + var next = der.offset + der.length; var oid = der.readOID(); switch (oid) { case '1.2.840.113549.1.1.1': + der._offset = next; if (type === 'public') return (readPkcs8RSAPublic(der)); else @@ -66,10 +68,6 @@ function readPkcs8(alg, type, der) { } function readPkcs8RSAPublic(der) { - // Null -- XXX this probably isn't good practice - der.readByte(); - der.readByte(); - // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); @@ -93,9 +91,6 @@ function readPkcs8RSAPublic(der) { } function readPkcs8RSAPrivate(der) { - der.readByte(); - der.readByte(); - der.readSequence(asn1.Ber.OctetString); der.readSequence(); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js index 3e0e286cdef33f..9d436dd92155f6 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js @@ -52,7 +52,7 @@ function keyTypeToAlg(key) { throw (new Error('Unknown key type ' + key.type)); } -function read(partial, type, buf) { +function read(partial, type, buf, options) { if (typeof (buf) === 'string') buf = new Buffer(buf); assert.buffer(buf, 'buf'); @@ -120,7 +120,7 @@ function read(partial, type, buf) { return (new Constructor(key)); } -function write(key) { +function write(key, options) { assert.object(key); var alg = keyTypeToAlg(key); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js index 02d7c27e8f33dd..bfbdab527f9b82 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js @@ -18,8 +18,8 @@ var pem = require('./pem'); var rfc4253 = require('./rfc4253'); var SSHBuffer = require('../ssh-buffer'); -function read(buf) { - return (pem.read(buf)); +function read(buf, options) { + return (pem.read(buf, options)); } var MAGIC = 'openssh-key-v1'; @@ -76,7 +76,7 @@ function readSSHPrivate(type, buf) { return (key); } -function write(key) { +function write(key, options) { var pubKey; if (PrivateKey.isPrivateKey(key)) pubKey = key.toPublic(); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js index f7baa48cfea2f4..655c9eaf3bf7c9 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js @@ -18,7 +18,7 @@ var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/; /*JSSTYLED*/ var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/; -function read(buf) { +function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); @@ -95,7 +95,7 @@ function read(buf) { return (key); } -function write(key) { +function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509-pem.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509-pem.js new file mode 100644 index 00000000000000..c59c7d5ff0a29a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509-pem.js @@ -0,0 +1,77 @@ +// Copyright 2016 Joyent, Inc. + +var x509 = require('./x509'); + +module.exports = { + read: read, + verify: x509.verify, + sign: x509.sign, + write: write +}; + +var assert = require('assert-plus'); +var asn1 = require('asn1'); +var algs = require('../algs'); +var utils = require('../utils'); +var Key = require('../key'); +var PrivateKey = require('../private-key'); +var pem = require('./pem'); +var Identity = require('../identity'); +var Signature = require('../signature'); +var Certificate = require('../certificate'); + +function read(buf, options) { + if (typeof (buf) !== 'string') { + assert.buffer(buf, 'buf'); + buf = buf.toString('ascii'); + } + + var lines = buf.trim().split(/[\r\n]+/g); + + var m = lines[0].match(/*JSSTYLED*/ + /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); + assert.ok(m, 'invalid PEM header'); + + var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ + /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); + assert.ok(m2, 'invalid PEM footer'); + + var headers = {}; + while (true) { + lines = lines.slice(1); + m = lines[0].match(/*JSSTYLED*/ + /^([A-Za-z0-9-]+): (.+)$/); + if (!m) + break; + headers[m[1].toLowerCase()] = m[2]; + } + + /* Chop off the first and last lines */ + lines = lines.slice(0, -1).join(''); + buf = new Buffer(lines, 'base64'); + + return (x509.read(buf, options)); +} + +function write(cert, options) { + var dbuf = x509.write(cert, options); + + var header = 'CERTIFICATE'; + var tmp = dbuf.toString('base64'); + var len = tmp.length + (tmp.length / 64) + + 18 + 16 + header.length*2 + 10; + var buf = new Buffer(len); + var o = 0; + o += buf.write('-----BEGIN ' + header + '-----\n', o); + for (var i = 0; i < tmp.length; ) { + var limit = i + 64; + if (limit > tmp.length) + limit = tmp.length; + o += buf.write(tmp.slice(i, limit), o); + buf[o++] = 10; + i = limit; + } + o += buf.write('-----END ' + header + '-----\n', o); + + return (buf.slice(0, o)); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509.js new file mode 100644 index 00000000000000..a2975404a52cdb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509.js @@ -0,0 +1,484 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = { + read: read, + verify: verify, + sign: sign, + write: write +}; + +var assert = require('assert-plus'); +var asn1 = require('asn1'); +var algs = require('../algs'); +var utils = require('../utils'); +var Key = require('../key'); +var PrivateKey = require('../private-key'); +var pem = require('./pem'); +var Identity = require('../identity'); +var Signature = require('../signature'); +var Certificate = require('../certificate'); +var pkcs8 = require('./pkcs8'); + +/* + * This file is based on RFC5280 (X.509). + */ + +/* Helper to read in a single mpint */ +function readMPInt(der, nm) { + assert.strictEqual(der.peek(), asn1.Ber.Integer, + nm + ' is not an Integer'); + return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); +} + +function verify(cert, key) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); + + var algParts = sig.algo.split('-'); + if (algParts[0] !== key.type) + return (false); + + var blob = sig.cache; + if (blob === undefined) { + var der = new asn1.BerWriter(); + writeTBSCert(cert, der); + blob = der.buffer; + } + + var verifier = key.createVerify(algParts[1]); + verifier.write(blob); + return (verifier.verify(sig.signature)); +} + +function Local(i) { + return (asn1.Ber.Context | asn1.Ber.Constructor | i); +} + +function Context(i) { + return (asn1.Ber.Context | i); +} + +var SIGN_ALGS = { + 'rsa-md5': '1.2.840.113549.1.1.4', + 'rsa-sha1': '1.2.840.113549.1.1.5', + 'rsa-sha256': '1.2.840.113549.1.1.11', + 'rsa-sha384': '1.2.840.113549.1.1.12', + 'rsa-sha512': '1.2.840.113549.1.1.13', + 'dsa-sha1': '1.2.840.10040.4.3', + 'dsa-sha256': '2.16.840.1.101.3.4.3.2', + 'ecdsa-sha1': '1.2.840.10045.4.1', + 'ecdsa-sha256': '1.2.840.10045.4.3.2', + 'ecdsa-sha384': '1.2.840.10045.4.3.3', + 'ecdsa-sha512': '1.2.840.10045.4.3.4' +}; +Object.keys(SIGN_ALGS).forEach(function (k) { + SIGN_ALGS[SIGN_ALGS[k]] = k; +}); +SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; +SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; + +var EXTS = { + 'issuerKeyId': '2.5.29.35', + 'altName': '2.5.29.17' +}; + +function read(buf, options) { + if (typeof (buf) === 'string') { + buf = new Buffer(buf, 'binary'); + } + assert.buffer(buf, 'buf'); + + var der = new asn1.BerReader(buf); + + der.readSequence(); + if (Math.abs(der.length - der.remain) > 1) { + throw (new Error('DER sequence does not contain whole byte ' + + 'stream')); + } + + var tbsStart = der.offset; + der.readSequence(); + var sigOffset = der.offset + der.length; + var tbsEnd = sigOffset; + + if (der.peek() === Local(0)) { + der.readSequence(Local(0)); + var version = der.readInt(); + assert.ok(version <= 3, + 'only x.509 versions up to v3 supported'); + } + + var cert = {}; + cert.signatures = {}; + var sig = (cert.signatures.x509 = {}); + sig.extras = {}; + + cert.serial = readMPInt(der, 'serial'); + + der.readSequence(); + var after = der.offset + der.length; + var certAlgOid = der.readOID(); + var certAlg = SIGN_ALGS[certAlgOid]; + if (certAlg === undefined) + throw (new Error('unknown signature algorithm ' + certAlgOid)); + + der._offset = after; + cert.issuer = Identity.parseAsn1(der); + + der.readSequence(); + cert.validFrom = readDate(der); + cert.validUntil = readDate(der); + + cert.subjects = [Identity.parseAsn1(der)]; + + der.readSequence(); + after = der.offset + der.length; + cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der); + der._offset = after; + + /* issuerUniqueID */ + if (der.peek() === Local(1)) { + der.readSequence(Local(1)); + sig.extras.issuerUniqueID = + buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + } + + /* subjectUniqueID */ + if (der.peek() === Local(2)) { + der.readSequence(Local(2)); + sig.extras.subjectUniqueID = + buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + } + + /* extensions */ + if (der.peek() === Local(3)) { + der.readSequence(Local(3)); + var extEnd = der.offset + der.length; + der.readSequence(); + + while (der.offset < extEnd) + readExtension(cert, buf, der); + + assert.strictEqual(der.offset, extEnd); + } + + assert.strictEqual(der.offset, sigOffset); + + der.readSequence(); + after = der.offset + der.length; + var sigAlgOid = der.readOID(); + var sigAlg = SIGN_ALGS[sigAlgOid]; + if (sigAlg === undefined) + throw (new Error('unknown signature algorithm ' + sigAlgOid)); + der._offset = after; + + var sigData = der.readString(asn1.Ber.BitString, true); + if (sigData[0] === 0) + sigData = sigData.slice(1); + var algParts = sigAlg.split('-'); + + sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); + sig.signature.hashAlgorithm = algParts[1]; + sig.algo = sigAlg; + sig.cache = buf.slice(tbsStart, tbsEnd); + + return (new Certificate(cert)); +} + +function readDate(der) { + if (der.peek() === asn1.Ber.UTCTime) { + return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); + } else if (der.peek() === asn1.Ber.GeneralizedTime) { + return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); + } else { + throw (new Error('Unsupported date format')); + } +} + +/* RFC5280, section 4.2.1.6 (GeneralName type) */ +var ALTNAME = { + OtherName: Local(0), + RFC822Name: Context(1), + DNSName: Context(2), + X400Address: Local(3), + DirectoryName: Local(4), + EDIPartyName: Local(5), + URI: Context(6), + IPAddress: Context(7), + OID: Context(8) +}; + +function readExtension(cert, buf, der) { + der.readSequence(); + var after = der.offset + der.length; + var extId = der.readOID(); + var id; + var sig = cert.signatures.x509; + sig.extras.exts = []; + + var critical; + if (der.peek() === asn1.Ber.Boolean) + critical = der.readBoolean(); + + switch (extId) { + case (EXTS.altName): + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + var aeEnd = der.offset + der.length; + while (der.offset < aeEnd) { + switch (der.peek()) { + case ALTNAME.OtherName: + case ALTNAME.EDIPartyName: + der.readSequence(); + der._offset += der.length; + break; + case ALTNAME.OID: + der.readOID(ALTNAME.OID); + break; + case ALTNAME.RFC822Name: + /* RFC822 specifies email addresses */ + var email = der.readString(ALTNAME.RFC822Name); + id = Identity.forEmail(email); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + case ALTNAME.DirectoryName: + der.readSequence(ALTNAME.DirectoryName); + id = Identity.parseAsn1(der); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + case ALTNAME.DNSName: + var host = der.readString( + ALTNAME.DNSName); + id = Identity.forHost(host); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + default: + der.readString(der.peek()); + break; + } + } + sig.extras.exts.push({ oid: extId, critical: critical }); + break; + default: + sig.extras.exts.push({ + oid: extId, + critical: critical, + data: der.readString(asn1.Ber.OctetString, true) + }); + break; + } + + der._offset = after; +} + +var UTCTIME_RE = + /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; +function utcTimeToDate(t) { + var m = t.match(UTCTIME_RE); + assert.ok(m, 'timestamps must be in UTC'); + var d = new Date(); + + var thisYear = d.getUTCFullYear(); + var century = Math.floor(thisYear / 100) * 100; + + var year = parseInt(m[1], 10); + if (thisYear % 100 < 50 && year >= 60) + year += (century - 1); + else + year += century; + d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); + d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); + if (m[6] && m[6].length > 0) + d.setUTCSeconds(parseInt(m[6], 10)); + return (d); +} + +var GTIME_RE = + /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; +function gTimeToDate(t) { + var m = t.match(GTIME_RE); + assert.ok(m); + var d = new Date(); + + d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, + parseInt(m[3], 10)); + d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); + if (m[6] && m[6].length > 0) + d.setUTCSeconds(parseInt(m[6], 10)); + return (d); +} + +function zeroPad(n) { + var s = '' + n; + while (s.length < 2) + s = '0' + s; + return (s); +} + +function dateToUTCTime(d) { + var s = ''; + s += zeroPad(d.getUTCFullYear() % 100); + s += zeroPad(d.getUTCMonth() + 1); + s += zeroPad(d.getUTCDate()); + s += zeroPad(d.getUTCHours()); + s += zeroPad(d.getUTCMinutes()); + s += zeroPad(d.getUTCSeconds()); + s += 'Z'; + return (s); +} + +function sign(cert, key) { + if (cert.signatures.x509 === undefined) + cert.signatures.x509 = {}; + var sig = cert.signatures.x509; + + sig.algo = key.type + '-' + key.defaultHashAlgorithm(); + if (SIGN_ALGS[sig.algo] === undefined) + return (false); + + var der = new asn1.BerWriter(); + writeTBSCert(cert, der); + var blob = der.buffer; + sig.cache = blob; + + var signer = key.createSign(); + signer.write(blob); + cert.signatures.x509.signature = signer.sign(); + + return (true); +} + +function write(cert, options) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); + + var der = new asn1.BerWriter(); + der.startSequence(); + if (sig.cache) { + der._ensure(sig.cache.length); + sig.cache.copy(der._buf, der._offset); + der._offset += sig.cache.length; + } else { + writeTBSCert(cert, der); + } + + der.startSequence(); + der.writeOID(SIGN_ALGS[sig.algo]); + if (sig.algo.match(/^rsa-/)) + der.writeNull(); + der.endSequence(); + + var sigData = sig.signature.toBuffer('asn1'); + var data = new Buffer(sigData.length + 1); + data[0] = 0; + sigData.copy(data, 1); + der.writeBuffer(data, asn1.Ber.BitString); + der.endSequence(); + + return (der.buffer); +} + +function writeTBSCert(cert, der) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); + + der.startSequence(); + + der.startSequence(Local(0)); + der.writeInt(2); + der.endSequence(); + + der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer); + + der.startSequence(); + der.writeOID(SIGN_ALGS[sig.algo]); + der.endSequence(); + + cert.issuer.toAsn1(der); + + der.startSequence(); + der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime); + der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime); + der.endSequence(); + + var subject = cert.subjects[0]; + var altNames = cert.subjects.slice(1); + subject.toAsn1(der); + + pkcs8.writePkcs8(der, cert.subjectKey); + + if (sig.extras && sig.extras.issuerUniqueID) { + der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); + } + + if (sig.extras && sig.extras.subjectUniqueID) { + der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); + } + + if (altNames.length > 0 || subject.type === 'host' || + (sig.extras && sig.extras.exts)) { + der.startSequence(Local(3)); + der.startSequence(); + + var exts = [ + { oid: EXTS.altName } + ]; + if (sig.extras && sig.extras.exts) + exts = sig.extras.exts; + + for (var i = 0; i < exts.length; ++i) { + der.startSequence(); + der.writeOID(exts[i].oid); + + if (exts[i].critical !== undefined) + der.writeBoolean(exts[i].critical); + + if (exts[i].oid === EXTS.altName) { + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + if (subject.type === 'host') { + der.writeString(subject.hostname, + Context(2)); + } + for (var j = 0; j < altNames.length; ++j) { + if (altNames[j].type === 'host') { + der.writeString( + altNames[j].hostname, + ALTNAME.DNSName); + } else if (altNames[j].type === + 'email') { + der.writeString( + altNames[j].email, + ALTNAME.RFC822Name); + } else { + /* + * Encode anything else as a + * DN style name for now. + */ + der.startSequence( + ALTNAME.DirectoryName); + altNames[j].toAsn1(der); + der.endSequence(); + } + } + der.endSequence(); + der.endSequence(); + } else { + der.writeBuffer(exts[i].data, + asn1.Ber.OctetString); + } + + der.endSequence(); + } + + der.endSequence(); + der.endSequence(); + } + + der.endSequence(); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/identity.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/identity.js new file mode 100644 index 00000000000000..b4f5cd73ec516d --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/identity.js @@ -0,0 +1,255 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = Identity; + +var assert = require('assert-plus'); +var algs = require('./algs'); +var crypto = require('crypto'); +var Fingerprint = require('./fingerprint'); +var Signature = require('./signature'); +var errs = require('./errors'); +var util = require('util'); +var utils = require('./utils'); +var asn1 = require('asn1'); + +/*JSSTYLED*/ +var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; + +var oids = {}; +oids.cn = '2.5.4.3'; +oids.o = '2.5.4.10'; +oids.ou = '2.5.4.11'; +oids.l = '2.5.4.7'; +oids.s = '2.5.4.8'; +oids.c = '2.5.4.6'; +oids.sn = '2.5.4.4'; +oids.dc = '0.9.2342.19200300.100.1.25'; +oids.uid = '0.9.2342.19200300.100.1.1'; +oids.mail = '0.9.2342.19200300.100.1.3'; + +var unoids = {}; +Object.keys(oids).forEach(function (k) { + unoids[oids[k]] = k; +}); + +function Identity(opts) { + var self = this; + assert.object(opts, 'options'); + assert.arrayOfObject(opts.components, 'options.components'); + this.components = opts.components; + this.componentLookup = {}; + this.components.forEach(function (c) { + if (c.name && !c.oid) + c.oid = oids[c.name]; + if (c.oid && !c.name) + c.name = unoids[c.oid]; + if (self.componentLookup[c.name] === undefined) + self.componentLookup[c.name] = []; + self.componentLookup[c.name].push(c); + }); + if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { + this.cn = this.componentLookup.cn[0].value; + } + assert.optionalString(opts.type, 'options.type'); + if (opts.type === undefined) { + if (this.components.length === 1 && + this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.dc && + this.components.length === this.componentLookup.dc.length) { + this.type = 'host'; + this.hostname = this.componentLookup.dc.map( + function (c) { + return (c.value); + }).join('.'); + + } else if (this.componentLookup.uid && + this.components.length === + this.componentLookup.uid.length) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.uid && + this.componentLookup.uid.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.mail && + this.componentLookup.mail.length === 1) { + this.type = 'email'; + this.email = this.componentLookup.mail[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.cn[0].value; + + } else { + this.type = 'unknown'; + } + } else { + this.type = opts.type; + if (this.type === 'host') + this.hostname = opts.hostname; + else if (this.type === 'user') + this.uid = opts.uid; + else if (this.type === 'email') + this.email = opts.email; + else + throw (new Error('Unknown type ' + this.type)); + } +} + +Identity.prototype.toString = function () { + return (this.components.map(function (c) { + return (c.name.toUpperCase() + '=' + c.value); + }).join(', ')); +}; + +Identity.prototype.toAsn1 = function (der, tag) { + der.startSequence(tag); + this.components.forEach(function (c) { + der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); + der.startSequence(); + der.writeOID(c.oid); + der.writeString(c.value, asn1.Ber.PrintableString); + der.endSequence(); + der.endSequence(); + }); + der.endSequence(); +}; + +function globMatch(a, b) { + if (a === '**' || b === '**') + return (true); + var aParts = a.split('.'); + var bParts = b.split('.'); + if (aParts.length !== bParts.length) + return (false); + for (var i = 0; i < aParts.length; ++i) { + if (aParts[i] === '*' || bParts[i] === '*') + continue; + if (aParts[i] !== bParts[i]) + return (false); + } + return (true); +} + +Identity.prototype.equals = function (other) { + if (!Identity.isIdentity(other, [1, 0])) + return (false); + if (other.components.length !== this.components.length) + return (false); + for (var i = 0; i < this.components.length; ++i) { + if (this.components[i].oid !== other.components[i].oid) + return (false); + if (!globMatch(this.components[i].value, + other.components[i].value)) { + return (false); + } + } + return (true); +}; + +Identity.forHost = function (hostname) { + assert.string(hostname, 'hostname'); + return (new Identity({ + type: 'host', + hostname: hostname, + components: [ { name: 'cn', value: hostname } ] + })); +}; + +Identity.forUser = function (uid) { + assert.string(uid, 'uid'); + return (new Identity({ + type: 'user', + uid: uid, + components: [ { name: 'uid', value: uid } ] + })); +}; + +Identity.forEmail = function (email) { + assert.string(email, 'email'); + return (new Identity({ + type: 'email', + email: email, + components: [ { name: 'mail', value: email } ] + })); +}; + +Identity.parseDN = function (dn) { + assert.string(dn, 'dn'); + var parts = dn.split(','); + var cmps = parts.map(function (c) { + c = c.trim(); + var eqPos = c.indexOf('='); + var name = c.slice(0, eqPos).toLowerCase(); + var value = c.slice(eqPos + 1); + return ({ name: name, value: value }); + }); + return (new Identity({ components: cmps })); +}; + +Identity.parseAsn1 = function (der, top) { + var components = []; + der.readSequence(top); + var end = der.offset + der.length; + while (der.offset < end) { + der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); + var after = der.offset + der.length; + der.readSequence(); + var oid = der.readOID(); + var type = der.peek(); + var value; + switch (type) { + case asn1.Ber.PrintableString: + case asn1.Ber.IA5String: + case asn1.Ber.OctetString: + case asn1.Ber.T61String: + value = der.readString(type); + break; + case asn1.Ber.Utf8String: + value = der.readString(type, true); + value = value.toString('utf8'); + break; + case asn1.Ber.CharacterString: + case asn1.Ber.BMPString: + value = der.readString(type, true); + value = value.toString('utf16le'); + break; + default: + throw (new Error('Unknown asn1 type ' + type)); + } + components.push({ oid: oid, value: value }); + der._offset = after; + } + der._offset = end; + return (new Identity({ + components: components + })); +}; + +Identity.isIdentity = function (obj, ver) { + return (utils.isCompatible(obj, Identity, ver)); +}; + +/* + * API versions for Identity: + * [1,0] -- initial ver + */ +Identity.prototype._sshpkApiVersion = [1, 0]; + +Identity._oldVersionDetect = function (obj) { + return ([1, 0]); +}; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js index 5cd962b31257fc..96a1384286a811 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js @@ -4,6 +4,8 @@ var Key = require('./key'); var Fingerprint = require('./fingerprint'); var Signature = require('./signature'); var PrivateKey = require('./private-key'); +var Certificate = require('./certificate'); +var Identity = require('./identity'); var errs = require('./errors'); module.exports = { @@ -16,10 +18,21 @@ module.exports = { parseSignature: Signature.parse, PrivateKey: PrivateKey, parsePrivateKey: PrivateKey.parse, + Certificate: Certificate, + parseCertificate: Certificate.parse, + createSelfSignedCertificate: Certificate.createSelfSigned, + createCertificate: Certificate.create, + Identity: Identity, + identityFromDN: Identity.parseDN, + identityForHost: Identity.forHost, + identityForUser: Identity.forUser, + identityForEmail: Identity.forEmail, /* errors */ FingerprintFormatError: errs.FingerprintFormatError, InvalidAlgorithmError: errs.InvalidAlgorithmError, KeyParseError: errs.KeyParseError, - SignatureParseError: errs.SignatureParseError + SignatureParseError: errs.SignatureParseError, + KeyEncryptedError: errs.KeyEncryptedError, + CertificateParseError: errs.CertificateParseError }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js index d140f0e54d8bcd..ff5c3637337cd3 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js @@ -77,11 +77,12 @@ function Key(opts) { Key.formats = formats; -Key.prototype.toBuffer = function (format) { +Key.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'ssh'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); if (format === 'rfc4253') { if (this._rfc4253Cache === undefined) @@ -89,11 +90,11 @@ Key.prototype.toBuffer = function (format) { return (this._rfc4253Cache); } - return (formats[format].write(this)); + return (formats[format].write(this, options)); }; -Key.prototype.toString = function (format) { - return (this.toBuffer(format).toString()); +Key.prototype.toString = function (format, options) { + return (this.toBuffer(format, options).toString()); }; Key.prototype.hash = function (algo) { @@ -107,9 +108,6 @@ Key.prototype.hash = function (algo) { var hash = crypto.createHash(algo). update(this.toBuffer('rfc4253')).digest(); - /* Workaround for node 0.8 */ - if (typeof (hash) === 'string') - hash = new Buffer(hash, 'binary'); this._hashCache[algo] = hash; return (hash); }; @@ -119,6 +117,7 @@ Key.prototype.fingerprint = function (algo) { algo = 'sha256'; assert.string(algo, 'algorithm'); var opts = { + type: 'key', hash: this.hash(algo), algorithm: algo }; @@ -158,10 +157,7 @@ Key.prototype.createVerify = function (hashAlgo) { var v, nm, err; try { - nm = this.type.toUpperCase() + '-'; - if (this.type === 'ecdsa') - nm = 'ecdsa-with-'; - nm += hashAlgo.toUpperCase(); + nm = hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } catch (e) { err = e; @@ -213,26 +209,34 @@ Key.prototype.createDiffieHellman = function () { }; Key.prototype.createDH = Key.prototype.createDiffieHellman; -Key.parse = function (data, format, name) { +Key.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); - if (name === undefined) - name = '(unnamed)'; + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { - var k = formats[format].read(data); + var k = formats[format].read(data, options); if (k instanceof PrivateKey) k = k.toPublic(); if (!k.comment) - k.comment = name; + k.comment = options.filename; return (k); } catch (e) { - throw (new KeyParseError(name, format, e)); + if (e.name === 'KeyEncryptedError') + throw (e); + throw (new KeyParseError(options.filename, format, e)); } }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js index 993ae32650237a..f80d93966286b5 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js @@ -23,6 +23,7 @@ var Key = require('./key'); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; +var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; formats['auto'] = require('./formats/auto'); @@ -44,13 +45,14 @@ util.inherits(PrivateKey, Key); PrivateKey.formats = formats; -PrivateKey.prototype.toBuffer = function (format) { +PrivateKey.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'pkcs1'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); - return (formats[format].write(this)); + return (formats[format].write(this, options)); }; PrivateKey.prototype.hash = function (algo) { @@ -146,10 +148,7 @@ PrivateKey.prototype.createSign = function (hashAlgo) { var v, nm, err; try { - nm = this.type.toUpperCase() + '-'; - if (this.type === 'ecdsa') - nm = 'ecdsa-with-'; - nm += hashAlgo.toUpperCase(); + nm = hashAlgo.toUpperCase(); v = crypto.createSign(nm); } catch (e) { err = e; @@ -175,25 +174,33 @@ PrivateKey.prototype.createSign = function (hashAlgo) { return (v); }; -PrivateKey.parse = function (data, format, name) { +PrivateKey.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); - if (name === undefined) - name = '(unnamed)'; + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { - var k = formats[format].read(data); + var k = formats[format].read(data, options); assert.ok(k instanceof PrivateKey, 'key is not a private key'); if (!k.comment) - k.comment = name; + k.comment = options.filename; return (k); } catch (e) { - throw (new KeyParseError(name, format, e)); + if (e.name === 'KeyEncryptedError') + throw (e); + throw (new KeyParseError(options.filename, format, e)); } }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js index ddf4a8c988c908..964f55cb5667c0 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js @@ -65,23 +65,31 @@ Signature.prototype.toBuffer = function (format) { buf = new SSHBuffer({}); buf.writeString('ssh-dss'); r = this.part.r.data; - if (r[0] === 0x00) + if (r.length > 20 && r[0] === 0x00) r = r.slice(1); s = this.part.s.data; + if (s.length > 20 && s[0] === 0x00) + s = s.slice(1); + if ((this.hashAlgorithm && + this.hashAlgorithm !== 'sha1') || + r.length + s.length !== 40) { + throw (new Error('OpenSSH only supports ' + + 'DSA signatures with SHA1 hash')); + } buf.writeBuffer(Buffer.concat([r, s])); return (buf.toBuffer()); } else if (format === 'ssh' && this.type === 'ecdsa') { var inner = new SSHBuffer({}); - r = this.part.r; - if (r[0] === 0x00) - r = r.slice(1); - inner.writePart(r); + r = this.part.r.data; + inner.writeBuffer(r); inner.writePart(this.part.s); buf = new SSHBuffer({}); /* XXX: find a more proper way to do this? */ var curve; - var sz = this.part.r.data.length * 8; + if (r[0] === 0x00) + r = r.slice(1); + var sz = r.length * 8; if (sz === 256) curve = 'nistp256'; else if (sz === 384) diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js index 0b0027734959a4..8fc2cb87852f40 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js @@ -73,6 +73,14 @@ SSHBuffer.prototype.readInt = function () { return (v); }; +SSHBuffer.prototype.readInt64 = function () { + assert.ok(this._offset + 8 < this._buffer.length, + 'buffer not long enough to read Int64'); + var v = this._buffer.slice(this._offset, this._offset + 8); + this._offset += 8; + return (v); +}; + SSHBuffer.prototype.readChar = function () { var v = this._buffer[this._offset++]; return (v); @@ -106,6 +114,22 @@ SSHBuffer.prototype.writeInt = function (v) { this._offset += 4; }; +SSHBuffer.prototype.writeInt64 = function (v) { + assert.buffer(v, 'value'); + if (v.length > 8) { + var lead = v.slice(0, v.length - 8); + for (var i = 0; i < lead.length; ++i) { + assert.strictEqual(lead[i], 0, + 'must fit in 64 bits of precision'); + } + v = v.slice(v.length - 8, v.length); + } + while (this._offset + 8 > this._size) + this.expand(); + v.copy(this._buffer, this._offset); + this._offset += 8; +}; + SSHBuffer.prototype.writeChar = function (v) { while (this._offset + 1 > this._size) this.expand(); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js index 34c22d31a6cf11..d57245cc16b41d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js @@ -8,11 +8,13 @@ module.exports = { ecNormalize: ecNormalize, countZeros: countZeros, assertCompatible: assertCompatible, - isCompatible: isCompatible + isCompatible: isCompatible, + opensslKeyDeriv: opensslKeyDeriv }; var assert = require('assert-plus'); var PrivateKey = require('./private-key'); +var crypto = require('crypto'); var MAX_CLASS_DEPTH = 3; @@ -68,6 +70,43 @@ function assertCompatible(obj, klass, needVer, name) { 'version ' + needVer[0] + '.' + needVer[1]); } +var CIPHER_LEN = { + 'des-ede3-cbc': { key: 7, iv: 8 }, + 'aes-128-cbc': { key: 16, iv: 16 } +}; +var PKCS5_SALT_LEN = 8; + +function opensslKeyDeriv(cipher, salt, passphrase, count) { + assert.buffer(salt, 'salt'); + assert.buffer(passphrase, 'passphrase'); + assert.number(count, 'iteration count'); + + var clen = CIPHER_LEN[cipher]; + assert.object(clen, 'supported cipher'); + + salt = salt.slice(0, PKCS5_SALT_LEN); + + var D, D_prev, bufs; + var material = new Buffer(0); + while (material.length < clen.key + clen.iv) { + bufs = []; + if (D_prev) + bufs.push(D_prev); + bufs.push(passphrase); + bufs.push(salt); + D = Buffer.concat(bufs); + for (var j = 0; j < count; ++j) + D = crypto.createHash('md5').update(D).digest(); + material = Buffer.concat([material, D]); + D_prev = D; + } + + return ({ + key: material.slice(0, clen.key), + iv: material.slice(clen.key, clen.key + clen.iv) + }); +} + /* Count leading zero bits on a buffer */ function countZeros(buf) { var o = 0, obit = 8; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 index d03b3067395d34..0887dce2728fb2 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 @@ -13,7 +13,7 @@ Reads in a public or private key and converts it between different formats, particularly formats used in the SSH protocol and the well\-known PEM PKCS#1/7 formats. .PP -In the second form, with the \fB\fC\-i\fR option given, identifies a key and prints to +In the second form, with the \fB\fC\-i\fR option given, identifies a key and prints to stderr information about its nature, size and fingerprint. .SH EXAMPLES .PP @@ -76,7 +76,7 @@ MIIDpAIBAAKCAQEA6T/GYJndb1TRH3+NL.... .SH OPTIONS .TP \fB\fC\-i, \-\-identify\fR -Instead of converting the key, output identifying information about it to +Instead of converting the key, output identifying information about it to stderr, including its type, size and fingerprints. .TP \fB\fC\-p, \-\-private\fR @@ -125,7 +125,7 @@ The internal binary format of keys when sent over the wire in the SSH protocol. This is also the format that the \fB\fCssh\-agent\fR uses in its protocol. .SH SEE ALSO .PP -.BR ssh-keygen (1), +.BR ssh-keygen (1), .BR openssl (1) .SH BUGS .PP diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json index 9d3b1f7ecfcce5..7e1f2b3ace550d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "asn1@>=0.2.3 <0.3.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "asn1@~0.2.3", + "scope": null, + "escapedName": "asn1", + "name": "asn1", + "rawSpec": "~0.2.3", + "spec": ">=0.2.3 <0.3.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], "_from": "asn1@>=0.2.3 <0.3.0", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/sshpk/asn1", "_npmUser": { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" }, "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "name": "asn1", - "raw": "asn1@>=0.2.3 <0.3.0", - "rawSpec": ">=0.2.3 <0.3.0", + "raw": "asn1@~0.2.3", "scope": null, + "escapedName": "asn1", + "name": "asn1", + "rawSpec": "~0.2.3", "spec": ">=0.2.3 <0.3.0", "type": "range" }, @@ -30,11 +39,11 @@ "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", "_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", "_shrinkwrap": null, - "_spec": "asn1@>=0.2.3 <0.3.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "asn1@~0.2.3", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, "bugs": { "url": "https://github.com/mcavage/node-asn1/issues" @@ -61,7 +70,7 @@ "directories": {}, "dist": { "shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", - "tarball": "http://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" + "tarball": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" }, "homepage": "https://github.com/mcavage/node-asn1", "license": "MIT", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/AUTHORS similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/AUTHORS diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/CHANGES.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/CHANGES.md diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/README.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/README.md diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/assert.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/assert.js diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json similarity index 58% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json index 5e7cfaadf2956c..305af0ddb3d97a 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json @@ -1,69 +1,80 @@ { "_args": [ [ - "assert-plus@^1.0.0", - "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash" + { + "raw": "assert-plus@^1.0.0", + "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], "_from": "assert-plus@>=1.0.0 <2.0.0", "_id": "assert-plus@1.0.0", "_inCache": true, "_installable": true, - "_location": "/request/http-signature/sshpk/dashdash/assert-plus", + "_location": "/request/http-signature/sshpk/assert-plus", "_nodeVersion": "0.10.40", "_npmUser": { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" }, "_npmVersion": "3.3.9", "_phantomChildren": {}, "_requested": { - "name": "assert-plus", "raw": "assert-plus@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/request/http-signature/sshpk/dashdash" + "/request/http-signature/sshpk", + "/request/http-signature/sshpk/dashdash", + "/request/http-signature/sshpk/getpass" ], "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", "_shrinkwrap": null, "_spec": "assert-plus@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, "bugs": { "url": "https://github.com/mcavage/node-assert-plus/issues" }, "contributors": [ { - "email": "dave@daveeddy.com", - "name": "Dave Eddy" + "name": "Dave Eddy", + "email": "dave@daveeddy.com" }, { - "email": "fred.kuo@joyent.com", - "name": "Fred Kuo" + "name": "Fred Kuo", + "email": "fred.kuo@joyent.com" }, { - "email": "ralphtheninja@riseup.net", - "name": "Lars-Magnus Skog" + "name": "Lars-Magnus Skog", + "email": "ralphtheninja@riseup.net" }, { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, { - "email": "pmooney@pfmooney.com", - "name": "Patrick Mooney" + "name": "Patrick Mooney", + "email": "pmooney@pfmooney.com" }, { - "email": "robert.gulewich@joyent.com", - "name": "Rob Gulewich" + "name": "Rob Gulewich", + "email": "robert.gulewich@joyent.com" } ], "dependencies": {}, @@ -75,7 +86,7 @@ "directories": {}, "dist": { "shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" }, "engines": { "node": ">=0.8" @@ -85,12 +96,12 @@ "main": "./assert.js", "maintainers": [ { - "email": "mcavage@gmail.com", - "name": "mcavage" + "name": "mcavage", + "email": "mcavage@gmail.com" }, { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" } ], "name": "assert-plus", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js index 572b00edee09b3..adb6f13b158420 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js @@ -826,7 +826,7 @@ function bashCompletionSpecFromOptions(args) { var longopts = []; var optargs = []; (args.options || []).forEach(function (o) { - if (o.group) { + if (o.group !== undefined && o.group !== null) { // Skip group headers. return; } @@ -999,12 +999,45 @@ function getOptionType(name) { } +/** + * Return a synopsis string for the given option spec. + * + * Examples: + * > synopsisFromOpt({names: ['help', 'h'], type: 'bool'}); + * '[ --help | -h ]' + * > synopsisFromOpt({name: 'file', type: 'string', helpArg: 'FILE'}); + * '[ --file=FILE ]' + */ +function synopsisFromOpt(o) { + assert.object(o, 'o'); + + if (o.hasOwnProperty('group')) { + return null; + } + var names = o.names || [o.name]; + // `type` here could be undefined if, for example, the command has a + // dashdash option spec with a bogus 'type'. + var type = getOptionType(o.type); + var helpArg = o.helpArg || (type && type.helpArg) || 'ARG'; + var parts = []; + names.forEach(function (name) { + var part = (name.length === 1 ? '-' : '--') + name; + if (type && type.takesArg) { + part += (name.length === 1 ? ' ' + helpArg : '=' + helpArg); + } + parts.push(part); + }); + return ('[ ' + parts.join(' | ') + ' ]'); +}; + + module.exports = { createParser: createParser, Parser: Parser, parse: parse, addOptionType: addOptionType, getOptionType: getOptionType, + synopsisFromOpt: synopsisFromOpt, // Bash completion-related exports BASH_COMPLETION_TEMPLATE_PATH: BASH_COMPLETION_TEMPLATE_PATH, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json index 81f871030f59f6..03c284deca9110 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json @@ -1,44 +1,53 @@ { "_args": [ [ - "dashdash@>=1.10.1 <2.0.0", + { + "raw": "dashdash@^1.12.0", + "scope": null, + "escapedName": "dashdash", + "name": "dashdash", + "rawSpec": "^1.12.0", + "spec": ">=1.12.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], - "_from": "dashdash@>=1.10.1 <2.0.0", - "_id": "dashdash@1.13.0", + "_from": "dashdash@>=1.12.0 <2.0.0", + "_id": "dashdash@1.14.0", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk/dashdash", "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/dashdash-1.13.0.tgz_1455248887432_0.5643249636050314" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/dashdash-1.14.0.tgz_1464847169030_0.07120498712174594" }, "_npmUser": { - "email": "trentm@gmail.com", - "name": "trentm" + "name": "trentm", + "email": "trentm@gmail.com" }, "_npmVersion": "1.4.29", "_phantomChildren": {}, "_requested": { - "name": "dashdash", - "raw": "dashdash@>=1.10.1 <2.0.0", - "rawSpec": ">=1.10.1 <2.0.0", + "raw": "dashdash@^1.12.0", "scope": null, - "spec": ">=1.10.1 <2.0.0", + "escapedName": "dashdash", + "name": "dashdash", + "rawSpec": "^1.12.0", + "spec": ">=1.12.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/request/http-signature/sshpk" ], - "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz", - "_shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a", + "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.0.tgz", + "_shasum": "29e486c5418bf0f356034a993d51686a33e84141", "_shrinkwrap": null, - "_spec": "dashdash@>=1.10.1 <2.0.0", + "_spec": "dashdash@^1.12.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { - "email": "trentm@gmail.com", "name": "Trent Mick", + "email": "trentm@gmail.com", "url": "http://trentm.com" }, "bugs": { @@ -46,8 +55,8 @@ }, "contributors": [ { - "email": "trentm@gmail.com", "name": "Trent Mick", + "email": "trentm@gmail.com", "url": "http://trentm.com" }, { @@ -76,13 +85,13 @@ }, "directories": {}, "dist": { - "shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a", - "tarball": "http://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz" + "shasum": "29e486c5418bf0f356034a993d51686a33e84141", + "tarball": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.0.tgz" }, "engines": { "node": ">=0.10" }, - "gitHead": "69425c9d9000d72c95e78ca43e3f84675f8f73ff", + "gitHead": "2f70d248a509418e4473922ee034faf9cd91b3f8", "homepage": "https://github.com/trentm/node-dashdash", "keywords": [ "option", @@ -98,8 +107,8 @@ "main": "./lib/dashdash.js", "maintainers": [ { - "email": "trentm@gmail.com", - "name": "trentm" + "name": "trentm", + "email": "trentm@gmail.com" } ], "name": "dashdash", @@ -112,5 +121,5 @@ "scripts": { "test": "nodeunit test/*.test.js" }, - "version": "1.13.0" + "version": "1.14.0" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js index 371b545c53072a..24372810b8bc25 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js @@ -25,11 +25,11 @@ exports.ECKey = function(curve, key, isPublic) // var y = key.slice(bytes+1); // this.P = new ECPointFp(curve, // curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)), -// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); +// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); this.P = curve.decodePointHex(key.toString("hex")); }else{ if(key.length != bytes) return false; - priv = new BigInteger(key.toString("hex"), 16); + priv = new BigInteger(key.toString("hex"), 16); } }else{ var n1 = n.subtract(BigInteger.ONE); @@ -51,6 +51,7 @@ exports.ECKey = function(curve, key, isPublic) if(!key || !key.P) return false; var S = key.P.multiply(priv); return new Buffer(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex"); - } + } } } + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn index c769b38beabae1..24502a9cf74836 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn @@ -18,9 +18,9 @@ This software is covered under the following copyright: * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js index 38dc523caaf279..3852671eca2204 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js @@ -434,7 +434,7 @@ ECFieldElementFp.prototype.modReduce = function(x) { u = u.multiply(this.getR()); } - x = u.add(v); + x = u.add(v); } while (x.compareTo(q) >= 0) { @@ -454,8 +454,8 @@ ECFieldElementFp.prototype.sqrt = function() // p mod 4 == 3 if (this.q.testBit(1)) { - var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); - return z.square().equals(this) ? z : null; + var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); + return z.square().equals(this) ? z : null; } // p mod 4 == 1 diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json index ec581d9a98d955..2054197955767d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "ecc-jsbn@>=0.0.1 <1.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "ecc-jsbn@~0.1.1", + "scope": null, + "escapedName": "ecc-jsbn", + "name": "ecc-jsbn", + "rawSpec": "~0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], - "_from": "ecc-jsbn@>=0.0.1 <1.0.0", + "_from": "ecc-jsbn@>=0.1.1 <0.2.0", "_id": "ecc-jsbn@0.1.1", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk/ecc-jsbn", "_nodeVersion": "0.12.6", "_npmUser": { - "email": "jeremie@jabber.org", - "name": "quartzjer" + "name": "quartzjer", + "email": "jeremie@jabber.org" }, "_npmVersion": "2.11.2", "_phantomChildren": {}, "_requested": { - "name": "ecc-jsbn", - "raw": "ecc-jsbn@>=0.0.1 <1.0.0", - "rawSpec": ">=0.0.1 <1.0.0", + "raw": "ecc-jsbn@~0.1.1", "scope": null, - "spec": ">=0.0.1 <1.0.0", + "escapedName": "ecc-jsbn", + "name": "ecc-jsbn", + "rawSpec": "~0.1.1", + "spec": ">=0.1.1 <0.2.0", "type": "range" }, "_requiredBy": [ @@ -31,11 +40,11 @@ "_resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", "_shasum": "0fc73a9ed5f0d53c38193398523ef7e543777505", "_shrinkwrap": null, - "_spec": "ecc-jsbn@>=0.0.1 <1.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "ecc-jsbn@~0.1.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { - "email": "jeremie@jabber.org", "name": "Jeremie Miller", + "email": "jeremie@jabber.org", "url": "http://jeremie.com/" }, "bugs": { @@ -49,14 +58,14 @@ "directories": {}, "dist": { "shasum": "0fc73a9ed5f0d53c38193398523ef7e543777505", - "tarball": "http://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz" + "tarball": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz" }, "gitHead": "d35a360352496721030da645e8054f07efc22487", "homepage": "https://github.com/quartzjer/ecc-jsbn", "keywords": [ - "browserify", + "jsbn", "ecc", - "jsbn" + "browserify" ], "license": "MIT", "main": "index.js", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.npmignore b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.npmignore new file mode 100644 index 00000000000000..a4261fc06feaaf --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.npmignore @@ -0,0 +1,8 @@ +.gitmodules +deps +docs +Makefile +node_modules +test +tools +coverage diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.travis.yml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.travis.yml new file mode 100644 index 00000000000000..d8b5833a71b22c --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "5.10" + - "4.4" + - "4.1" + - "0.12" + - "0.10" +before_install: + - "make check" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/LICENSE b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/LICENSE new file mode 100644 index 00000000000000..f6d947d2f61c41 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/README.md new file mode 100644 index 00000000000000..6e4a50f63f7f00 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/README.md @@ -0,0 +1,32 @@ +## getpass + +Get a password from the terminal. Sounds simple? Sounds like the `readline` +module should be able to do it? NOPE. + +## Install and use it + +```bash +npm install --save getpass +``` + +```javascript +const mod_getpass = require('getpass'); +``` + +## API + +### `mod_getpass.getPass([options, ]callback)` + +Gets a password from the terminal. If available, this uses `/dev/tty` to avoid +interfering with any data being piped in or out of stdio. + +This function prints a prompt (by default `Password:`) and then accepts input +without echoing. + +Parameters: + + * `options`, an Object, with properties: + * `prompt`, an optional String + * `callback`, a `Func(error, password)`, with arguments: + * `error`, either `null` (no error) or an `Error` instance + * `password`, a String diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/lib/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/lib/index.js new file mode 100644 index 00000000000000..55a7718c0f7f72 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/lib/index.js @@ -0,0 +1,123 @@ +/* + * Copyright 2016, Joyent, Inc. All rights reserved. + * Author: Alex Wilson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. +*/ + +module.exports = { + getPass: getPass +}; + +const mod_tty = require('tty'); +const mod_fs = require('fs'); +const mod_assert = require('assert-plus'); + +var BACKSPACE = String.fromCharCode(127); +var CTRLC = '\u0003'; +var CTRLD = '\u0004'; + +function getPass(opts, cb) { + if (typeof (opts) === 'function' && cb === undefined) { + cb = opts; + opts = {}; + } + mod_assert.object(opts, 'options'); + mod_assert.func(cb, 'callback'); + + mod_assert.optionalString(opts.prompt, 'options.prompt'); + if (opts.prompt === undefined) + opts.prompt = 'Password'; + + openTTY(function (err, rfd, wfd, rtty, wtty) { + if (err) { + cb(err); + return; + } + + wtty.write(opts.prompt + ':'); + rtty.resume(); + rtty.setRawMode(true); + rtty.resume(); + rtty.setEncoding('utf8'); + + var pw = ''; + rtty.on('data', onData); + + function onData(data) { + var str = data.toString('utf8'); + for (var i = 0; i < str.length; ++i) { + var ch = str[i]; + switch (ch) { + case '\r': + case '\n': + case CTRLD: + cleanup(); + cb(null, pw); + return; + case CTRLC: + cleanup(); + cb(new Error('Aborted')); + return; + case BACKSPACE: + pw = pw.slice(0, pw.length - 1); + break; + default: + pw += ch; + break; + } + } + } + + function cleanup() { + wtty.write('\r\n'); + rtty.setRawMode(false); + rtty.pause(); + rtty.removeListener('data', onData); + if (wfd !== undefined && wfd !== rfd) { + wtty.end(); + mod_fs.closeSync(wfd); + } + if (rfd !== undefined) { + rtty.end(); + mod_fs.closeSync(rfd); + } + } + }); +} + +function openTTY(cb) { + mod_fs.open('/dev/tty', 'r+', function (err, rttyfd) { + if ((err && (err.code === 'ENOENT' || err.code === 'EACCES')) || + (process.version.match(/^v0[.][0-8][.]/))) { + cb(null, undefined, undefined, process.stdin, + process.stdout); + return; + } + var rtty = new mod_tty.ReadStream(rttyfd); + mod_fs.open('/dev/tty', 'w+', function (err3, wttyfd) { + var wtty = new mod_tty.WriteStream(wttyfd); + if (err3) { + cb(err3); + return; + } + cb(null, rttyfd, wttyfd, rtty, wtty); + }); + }); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/package.json new file mode 100644 index 00000000000000..bb44e44afcbf23 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + { + "raw": "getpass@^0.1.1", + "scope": null, + "escapedName": "getpass", + "name": "getpass", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + ] + ], + "_from": "getpass@>=0.1.1 <0.2.0", + "_id": "getpass@0.1.6", + "_inCache": true, + "_installable": true, + "_location": "/request/http-signature/sshpk/getpass", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/getpass-0.1.6.tgz_1461907090215_0.6450737570412457" + }, + "_npmUser": { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "raw": "getpass@^0.1.1", + "scope": null, + "escapedName": "getpass", + "name": "getpass", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/request/http-signature/sshpk" + ], + "_resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "_shasum": "283ffd9fc1256840875311c1b60e8c40187110e6", + "_shrinkwrap": null, + "_spec": "getpass@^0.1.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "author": { + "name": "Alex Wilson", + "email": "alex.wilson@joyent.com" + }, + "bugs": { + "url": "https://github.com/arekinath/node-getpass/issues" + }, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "description": "getpass for node.js", + "devDependencies": { + "json": "^9.0.3", + "pty.js": "^0.3.0", + "tape": "^4.4.0" + }, + "directories": {}, + "dist": { + "shasum": "283ffd9fc1256840875311c1b60e8c40187110e6", + "tarball": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz" + }, + "gitHead": "e7fdf43ad60aa520f894d41856852aa320f36646", + "homepage": "https://github.com/arekinath/node-getpass#readme", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + } + ], + "name": "getpass", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/arekinath/node-getpass.git" + }, + "scripts": { + "test": "tape test/*.test.js" + }, + "version": "0.1.6" +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js index 11c83e86c7b47e..870983984b3482 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js @@ -3,9 +3,9 @@ /* * Copyright (c) 2014 Mega Limited * under the MIT License. - * + * * Authors: Guy K. Kloss - * + * * You should have received a copy of the license along with this program. */ @@ -13,7 +13,7 @@ var dh = require('./lib/dh'); var eddsa = require('./lib/eddsa'); var curve255 = require('./lib/curve255'); var utils = require('./lib/utils'); - + /** * @exports jodid25519 * Curve 25519-based cryptography collection. @@ -23,7 +23,7 @@ var utils = require('./lib/utils'); * (EdDSA) based on Ed25519. */ var ns = {}; - + /** Module version indicator as string (format: [major.minor.patch]). */ ns.VERSION = '0.7.1'; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json index 3bc9f501c6deb2..12f5e81553ba64 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "jodid25519@>=1.0.0 <2.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "jodid25519@^1.0.0", + "scope": null, + "escapedName": "jodid25519", + "name": "jodid25519", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], "_from": "jodid25519@>=1.0.0 <2.0.0", @@ -12,16 +20,17 @@ "_location": "/request/http-signature/sshpk/jodid25519", "_nodeVersion": "4.1.1", "_npmUser": { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" }, "_npmVersion": "2.14.4", "_phantomChildren": {}, "_requested": { - "name": "jodid25519", - "raw": "jodid25519@>=1.0.0 <2.0.0", - "rawSpec": ">=1.0.0 <2.0.0", + "raw": "jodid25519@^1.0.0", "scope": null, + "escapedName": "jodid25519", + "name": "jodid25519", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -31,8 +40,8 @@ "_resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", "_shasum": "06d4912255093419477d425633606e0e90782967", "_shrinkwrap": null, - "_spec": "jodid25519@>=1.0.0 <2.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "jodid25519@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { "name": "Michele Bini, Ron Garret, Guy K. Kloss" }, @@ -55,22 +64,22 @@ "sinon-chai": "^2.8.0" }, "directories": { - "doc": "doc", "src": "src", - "test": "test" + "test": "test", + "doc": "doc" }, "dist": { "shasum": "06d4912255093419477d425633606e0e90782967", - "tarball": "http://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz" }, "gitHead": "a83b9fcf7fd3be4f27cd4a57817aff171c7cd918", "homepage": "https://github.com/meganz/jodid25519", "keywords": [ "Curve25519", - "ECDH", - "ECDSA", "Ed25519", + "ECDH", "EdDSA", + "ECDSA", "encryption", "signing" ], diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE index 7ccbf5073c8650..2a6457e9ef1e09 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE @@ -18,9 +18,9 @@ This software is covered under the following copyright: * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md index 9686611db7f379..7aac67f53ff0ef 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md @@ -7,7 +7,7 @@ I felt compelled to put this on github and publish to npm. I haven't tested ever ## usage var BigInteger = require('jsbn'); - + var a = new BigInteger('91823918239182398123'); alert(a.bitLength()); // 67 @@ -171,3 +171,5 @@ returns new BI of absolute value ### bi.isProbablePrime + + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html index ea180b8cc4268f..7c26a5665c1b1a 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html @@ -5,8 +5,8 @@ - - + + \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json index 838d035ffcd59b..30d10169dc1ac7 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "jsbn@>=0.1.0 <0.2.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "jsbn@~0.1.0", + "scope": null, + "escapedName": "jsbn", + "name": "jsbn", + "rawSpec": "~0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], "_from": "jsbn@>=0.1.0 <0.2.0", @@ -12,16 +20,17 @@ "_location": "/request/http-signature/sshpk/jsbn", "_nodeVersion": "0.12.2", "_npmUser": { - "email": "andyperlitch@gmail.com", - "name": "andyperlitch" + "name": "andyperlitch", + "email": "andyperlitch@gmail.com" }, "_npmVersion": "2.7.4", "_phantomChildren": {}, "_requested": { - "name": "jsbn", - "raw": "jsbn@>=0.1.0 <0.2.0", - "rawSpec": ">=0.1.0 <0.2.0", + "raw": "jsbn@~0.1.0", "scope": null, + "escapedName": "jsbn", + "name": "jsbn", + "rawSpec": "~0.1.0", "spec": ">=0.1.0 <0.2.0", "type": "range" }, @@ -33,8 +42,8 @@ "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", "_shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", "_shrinkwrap": null, - "_spec": "jsbn@>=0.1.0 <0.2.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "jsbn@~0.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { "name": "Tom Wu" }, @@ -47,14 +56,14 @@ "directories": {}, "dist": { "shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", - "tarball": "http://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + "tarball": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" }, "gitHead": "148a967b112806e63ddeeed78ee7938eef74c84a", "homepage": "https://github.com/andyperlitch/jsbn", "keywords": [ - "big", "biginteger", "bignumber", + "big", "integer" ], "license": "BSD", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md index 3ebc0affaa8ec0..77c69bd5ee45be 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md @@ -2,59 +2,6 @@ TweetNaCl.js Changelog ====================== -v0.14.1 -------- - -No code changes, just tweaked packaging and added COPYING.txt. - - -v0.14.0 -------- - -* **Breaking change!** All functions from `nacl.util` have been removed. These - functions are no longer available: - - nacl.util.decodeUTF8 - nacl.util.encodeUTF8 - nacl.util.decodeBase64 - nacl.util.encodeBase64 - - If want to continue using them, you can include - package: - - - - - or - - var nacl = require('tweetnacl'); - nacl.util = require('tweetnacl-util'); - - However it is recommended to use better packages that have wider - compatibility and better performance. Functions from `nacl.util` were never - intended to be robust solution for string conversion and were included for - convenience: cryptography library is not the right place for them. - - Currently calling these functions will throw error pointing to - `tweetnacl-util-js` (in the next version this error message will be removed). - -* Improved detection of available random number generators, making it possible - to use `nacl.randomBytes` and related functions in Web Workers without - changes. - -* Changes to testing (see README). - - -v0.13.3 -------- - -No code changes. - -* Reverted license field in package.json to "Public domain". - -* Fixed typo in README. - - v0.13.2 ------- @@ -141,18 +88,18 @@ v0.10.0 * **Signature API breaking change!** `nacl.sign` and `nacl.sign.open` now deal with signed messages, and new `nacl.sign.detached` and `nacl.sign.detached.verify` are available. - + Previously, `nacl.sign` returned a signature, and `nacl.sign.open` accepted a message and "detached" signature. This was unlike NaCl's API, which dealt with signed messages (concatenation of signature and message). - + The new API is: nacl.sign(message, secretKey) -> signedMessage nacl.sign.open(signedMessage, publicKey) -> message | null Since detached signatures are common, two new API functions were introduced: - + nacl.sign.detached(message, secretKey) -> signature nacl.sign.detached.verify(message, signature, publicKey) -> true | false diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt deleted file mode 100644 index c2bd1e5b7e81ab..00000000000000 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt +++ /dev/null @@ -1,9 +0,0 @@ -Public Domain - -The person who associated a work with this deed has dedicated the work to the -public domain by waiving all of his or her rights to the work worldwide under -copyright law, including all related and neighboring rights, to the extent -allowed by law. - -You can copy, modify, distribute and perform the work, even for commercial -purposes, all without asking permission. diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md index c80bbed8d8da15..11bd3472c258d1 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md @@ -7,7 +7,7 @@ to JavaScript for modern browsers and Node.js. Public domain. [![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master) ](https://travis-ci.org/dchest/tweetnacl-js) -Demo: +[Demo](https://dchest.github.io/tweetnacl-js/) **:warning: Beta version. The library is stable and API is frozen, however it has not been independently reviewed. If you can help reviewing it, please @@ -26,6 +26,8 @@ Documentation * [Hashing](#hashing) * [Random bytes generation](#random-bytes-generation) * [Constant-time comparison](#constant-time-comparison) + * [Utilities](#utilities) +* [Examples](#examples) * [System requirements](#system-requirements) * [Development and testing](#development-and-testing) * [Contributors](#contributors) @@ -65,20 +67,10 @@ or [download source code](https://github.com/dchest/tweetnacl-js/releases). Usage ------ +------ All API functions accept and return bytes as `Uint8Array`s. If you need to -encode or decode strings, use functions from - or one of the more robust codec -packages. - -In Node.js v4 and later `Buffer` objects are backed by `Uint8Array`s, so you -can freely pass them to TweetNaCl.js functions as arguments. The returned -objects are still `Uint8Array`s, so if you need `Buffer`s, you'll have to -convert them manually; make sure to convert using copying: `new Buffer(array)`, -instead of sharing: `new Buffer(array.buffer)`, because some functions return -subarrays of their buffers. - +encode or decode strings, use functions from `nacl.util` namespace. ### Public-key authenticated encryption (box) @@ -295,6 +287,12 @@ depending on the platform it runs on: * `window.msCrypto.getRandomValues` (Internet Explorer 11) * `crypto.randomBytes` (Node.js) +Note that browsers are required to throw `QuotaExceededError` exception if +requested `length` is more than 65536, so do not ask for more than 65536 bytes +in *one call* (multiple calls to get as many bytes as you like are okay: +browsers can generate infinite amount of random bytes without any bad +consequences). + If the platform doesn't provide a suitable PRNG, the following functions, which require random numbers, will throw exception: @@ -328,6 +326,30 @@ Returns `false` if either of the arguments has zero length, or arguments have different lengths, or their contents differ. +### Utilities + +Encoding/decoding functions are provided for convenience. They are correct, +however their performance and wide compatibility with uncommon runtimes is not +something that is considered important compared to the simplicity and size of +implementation. You can use third-party libraries if you need to. + +#### nacl.util.decodeUTF8(string) + +Decodes string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeUTF8(array) + +Encodes `Uint8Array` or `Array` of bytes into string. + +#### nacl.util.decodeBase64(string) + +Decodes Base-64 encoded string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeBase64(array) + +Encodes `Uint8Array` or `Array` of bytes into string using Base-64 encoding. + + System requirements ------------------- @@ -342,7 +364,7 @@ of: Other systems: -* Node.js +* Node.js (we test on 0.10 and later) Development and testing @@ -363,36 +385,32 @@ Tests use minified version, so make sure to rebuild it every time you change To run tests in Node.js: - $ npm run test-node + $ npm test By default all tests described here work on `nacl.min.js`. To test other versions, set environment variable `NACL_SRC` to the file name you want to test. For example, the following command will test fast minified version: - $ NACL_SRC=nacl-fast.min.js npm run test-node + $ NACL_SRC=nacl-fast.min.js npm test To run full suite of tests in Node.js, including comparing outputs of JavaScript port to outputs of the original C version: - $ npm run test-node-all + $ npm run testall To prepare tests for browsers: - $ npm run build-test-browser + $ npm run browser and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to run them. -To run headless browser tests with `tape-run` (powered by Electron): +To run headless browser tests with `testling`: - $ npm run test-browser + $ npm run testling (If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.) -To run tests in both Node and Electron: - - $ npm test - ### Benchmarking To run benchmarks in Node.js: diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js index 5e4562fe89a1ab..6c4995848cc42c 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js @@ -745,7 +745,7 @@ poly1305.prototype.finish = function(mac, macpos) { } g[9] -= (1 << 13); - mask = (c ^ 1) - 1; + mask = (g[9] >>> ((2 * 8) - 1)) - 1; for (i = 0; i < 10; i++) g[i] &= mask; mask = ~mask; for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i]; @@ -2157,13 +2157,39 @@ function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } -// TODO: Completely remove this in v0.15. -if (!nacl.util) { - nacl.util = {}; - nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { - throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js'); - }; -} +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; nacl.randomBytes = function(n) { var b = new Uint8Array(n); @@ -2360,22 +2386,26 @@ nacl.setPRNG = function(fn) { (function() { // Initialize PRNG if environment provides CSPRNG. // If not, methods calling randombytes will throw. - var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null; - if (crypto && crypto.getRandomValues) { - // Browsers. - var QUOTA = 65536; - nacl.setPRNG(function(x, n) { - var i, v = new Uint8Array(n); - for (i = 0; i < n; i += QUOTA) { - crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); - } - for (i = 0; i < n; i++) x[i] = v[i]; - cleanup(v); - }); + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } } else if (typeof require !== 'undefined') { // Node.js. crypto = require('crypto'); - if (crypto && crypto.randomBytes) { + if (crypto) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); for (i = 0; i < n; i++) x[i] = v[i]; @@ -2385,4 +2415,4 @@ nacl.setPRNG = function(fn) { } })(); -})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {})); +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js index 624fbbe91e71fc..7072c2af4435bd 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js @@ -1,2 +1,2 @@ -!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;20>O;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;d=d+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+v|0,L=L+b|0,z=z+g|0,R=R+_|0,P=P+A|0,r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;20>O;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=P>>>0&255,r[13]=P>>>8&255,r[14]=P>>>16&255,r[15]=P>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function v(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function b(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function g(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function _(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(g(h),g(h),g(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,_(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function d(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,v=0,b=0,g=0,_=0,A=0,d=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,z=0,R=0,P=n[0],O=n[1],N=n[2],C=n[3],F=n[4],I=n[5],G=n[6],Z=n[7],j=n[8],q=n[9],V=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*P,h+=e*O,a+=e*N,f+=e*C,s+=e*F,u+=e*I,c+=e*G,y+=e*Z,l+=e*j,w+=e*q,p+=e*V,v+=e*X,b+=e*D,g+=e*H,_+=e*J,A+=e*Q,e=t[1],h+=e*P,a+=e*O,f+=e*N,s+=e*C,u+=e*F,c+=e*I,y+=e*G,l+=e*Z,w+=e*j,p+=e*q,v+=e*V,b+=e*X,g+=e*D,_+=e*H,A+=e*J,d+=e*Q,e=t[2],a+=e*P,f+=e*O,s+=e*N,u+=e*C,c+=e*F,y+=e*I,l+=e*G,w+=e*Z,p+=e*j,v+=e*q,b+=e*V,g+=e*X,_+=e*D,A+=e*H,d+=e*J,U+=e*Q,e=t[3],f+=e*P,s+=e*O,u+=e*N,c+=e*C,y+=e*F,l+=e*I,w+=e*G,p+=e*Z,v+=e*j,b+=e*q,g+=e*V,_+=e*X,A+=e*D,d+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*P,u+=e*O,c+=e*N,y+=e*C,l+=e*F,w+=e*I,p+=e*G,v+=e*Z,b+=e*j,g+=e*q,_+=e*V,A+=e*X,d+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*P,c+=e*O,y+=e*N,l+=e*C,w+=e*F,p+=e*I,v+=e*G,b+=e*Z,g+=e*j,_+=e*q,A+=e*V,d+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*P,y+=e*O,l+=e*N,w+=e*C,p+=e*F,v+=e*I,b+=e*G,g+=e*Z,_+=e*j,A+=e*q,d+=e*V,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*P,l+=e*O,w+=e*N,p+=e*C,v+=e*F,b+=e*I,g+=e*G,_+=e*Z,A+=e*j,d+=e*q,U+=e*V,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*P,w+=e*O,p+=e*N,v+=e*C,b+=e*F,g+=e*I,_+=e*G,A+=e*Z,d+=e*j,U+=e*q,E+=e*V,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*P,p+=e*O,v+=e*N,b+=e*C,g+=e*F,_+=e*I,A+=e*G,d+=e*Z,U+=e*j,E+=e*q,x+=e*V,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*P,v+=e*O,b+=e*N,g+=e*C,_+=e*F,A+=e*I,d+=e*G,U+=e*Z,E+=e*j,x+=e*q,M+=e*V,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],v+=e*P,b+=e*O,g+=e*N,_+=e*C,A+=e*F,d+=e*I,U+=e*G,E+=e*Z,x+=e*j,M+=e*q,m+=e*V,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],b+=e*P,g+=e*O,_+=e*N,A+=e*C,d+=e*F,U+=e*I,E+=e*G,x+=e*Z,M+=e*j,m+=e*q,B+=e*V,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],g+=e*P,_+=e*O,A+=e*N,d+=e*C,U+=e*F,E+=e*I,x+=e*G,M+=e*Z,m+=e*j,B+=e*q,S+=e*V,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],_+=e*P,A+=e*O,d+=e*N,U+=e*C,E+=e*F,x+=e*I,M+=e*G,m+=e*Z,B+=e*j,S+=e*q,K+=e*V,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,z+=e*Q,e=t[15],A+=e*P,d+=e*O,U+=e*N,E+=e*C,x+=e*F,M+=e*I,m+=e*G,B+=e*Z,S+=e*j,K+=e*q,T+=e*V,Y+=e*X,k+=e*D,L+=e*H,z+=e*J,R+=e*Q,i+=38*d,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,v+=38*k,b+=38*L,g+=38*z,_+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=v,r[12]=b,r[13]=g,r[14]=_,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,_(a,f,e),_(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),_(a,f,e),_(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function z(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function P(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,v,b,g,_,A,d,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],z=r[2],R=r[3],P=r[4],O=r[5],N=r[6],C=r[7],F=t[0],I=t[1],G=t[2],Z=t[3],j=t[4],q=t[5],V=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=z,a=R,f=P,s=O,u=N,c=C,y=F,l=I,w=G,p=Z,v=j,b=q,g=V,_=X,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(P>>>14|j<<18)^(P>>>18|j<<14)^(j>>>9|P<<23),M=(j>>>14|P<<18)^(j>>>18|P<<14)^(P>>>9|j<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=P&O^~P&N,M=j&q^~j&V,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,d=65535&m|B<<16,x=A,M=d,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&z^L&z,M=F&I^F&G^I&G,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,_=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=d,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,z=i,R=h,P=a,O=f,N=s,C=u,k=c,I=y,G=l,Z=w,j=p,q=v,V=b,X=g,F=_,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],d=Y[(E+1)%16],x=(A>>>1|d<<31)^(A>>>8|d<<24)^A>>>7,M=(d>>>1|A<<31)^(d>>>8|A<<24)^(d>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],d=Y[(E+14)%16],x=(A>>>19|d<<13)^(d>>>29|A<<3)^A>>>6,M=(d>>>19|A<<13)^(A>>>29|d<<3)^(d>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=z,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=z=65535&S|K<<16,t[2]=G=65535&m|B<<16,x=R,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=Z=65535&m|B<<16,x=P,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=P=65535&S|K<<16,t[4]=j=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=O=65535&S|K<<16,t[5]=q=65535&m|B<<16,x=N,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=N=65535&S|K<<16,t[6]=V=65535&m|B<<16,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=C=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function O(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,P(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),P(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function N(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function C(r,t,n){var e;for(e=0;4>e;e++)_(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(b(r[0],er),b(r[1],or),b(r[2],or),b(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,C(r,t,e),N(t,r),N(r,r),C(r,t,e)}function G(r,t){var n=[$(),$(),$(),$()];b(n[0],fr),b(n[1],sr),b(n[2],or),m(n[3],fr,sr),I(r,n,t)}function Z(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),O(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,G(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function j(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*vr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*vr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*vr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function q(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;j(r,n)}function V(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];O(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(O(f,r.subarray(32),n+32),q(f),G(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(O(a,r,n+64),q(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return j(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return b(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),d(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),d(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(O(f,r,n),q(f),I(s,u,f),G(u,t.subarray(32)),N(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==br)throw new Error("bad key size");if(t.length!==gr)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,v,b,g,_,A,d,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],O=this.r[4],N=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],G=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=x*(5*G),y+=M*(5*I),y+=m*(5*F),y+=B*(5*C),c=y>>>13,y&=8191,y+=S*(5*N),y+=K*(5*O),y+=T*(5*P),y+=Y*(5*R),y+=k*(5*z),c+=y>>>13,y&=8191,l=c,l+=E*z,l+=x*L,l+=M*(5*G),l+=m*(5*I),l+=B*(5*F),c=l>>>13,l&=8191,l+=S*(5*C),l+=K*(5*N),l+=T*(5*O),l+=Y*(5*P),l+=k*(5*R),c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*z,w+=M*L,w+=m*(5*G),w+=B*(5*I),c=w>>>13,w&=8191,w+=S*(5*F),w+=K*(5*C),w+=T*(5*N),w+=Y*(5*O),w+=k*(5*P),c+=w>>>13,w&=8191,p=c,p+=E*P,p+=x*R,p+=M*z,p+=m*L,p+=B*(5*G),c=p>>>13,p&=8191,p+=S*(5*I),p+=K*(5*F),p+=T*(5*C),p+=Y*(5*N),p+=k*(5*O),c+=p>>>13,p&=8191,v=c,v+=E*O,v+=x*P,v+=M*R,v+=m*z,v+=B*L,c=v>>>13,v&=8191,v+=S*(5*G),v+=K*(5*I),v+=T*(5*F),v+=Y*(5*C),v+=k*(5*N),c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*R,b+=B*z,c=b>>>13,b&=8191,b+=S*L,b+=K*(5*G),b+=T*(5*I),b+=Y*(5*F),b+=k*(5*C),c+=b>>>13,b&=8191,g=c,g+=E*C,g+=x*N,g+=M*O,g+=m*P,g+=B*R,c=g>>>13,g&=8191,g+=S*z,g+=K*L,g+=T*(5*G),g+=Y*(5*I),g+=k*(5*F),c+=g>>>13,g&=8191,_=c,_+=E*F,_+=x*C,_+=M*N,_+=m*O,_+=B*P,c=_>>>13,_&=8191,_+=S*R,_+=K*z,_+=T*L,_+=Y*(5*G),_+=k*(5*I),c+=_>>>13,_&=8191,A=c,A+=E*I,A+=x*F,A+=M*C,A+=m*N,A+=B*O,c=A>>>13,A&=8191,A+=S*P,A+=K*R,A+=T*z,A+=Y*L,A+=k*(5*G),c+=A>>>13,A&=8191,d=c,d+=E*G,d+=x*I,d+=M*F,d+=m*C,d+=B*N,c=d>>>13,d&=8191,d+=S*O,d+=K*P,d+=T*R,d+=Y*z,d+=k*L,c+=d>>>13,d&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=v,S=b,K=g,T=_,Y=A,k=d,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=v,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],vr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),br=32,gr=24,_r=32,Ar=16,dr=32,Ur=32,Er=32,xr=32,Mr=32,mr=gr,Br=_r,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:v,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:z,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:O,crypto_sign:V,crypto_sign_keypair:Z,crypto_sign_open:D,crypto_secretbox_KEYBYTES:br,crypto_secretbox_NONCEBYTES:gr,crypto_secretbox_ZEROBYTES:_r,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:dr,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util||(r.util={},r.util.decodeUTF8=r.util.encodeUTF8=r.util.encodeBase64=r.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),r.randomBytes=function(r){var t=new Uint8Array(r);return rr(t,r),t},r.secretbox=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(_r+r.length),o=new Uint8Array(e.length),i=0;ie)return null;for(var o=new Uint8Array(e),i=0;ie;e++)o[e]=t[e];for(e=0;e=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return Z(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;ne;e++)n[e]=r[e];return Z(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return O(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t), -0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){var n=65536;r.setPRNG(function(r,e){var o,i=new Uint8Array(e);for(o=0;e>o;o+=n)t.getRandomValues(i.subarray(o,o+Math.min(e-o,n)));for(o=0;e>o;o++)r[o]=i[o];W(i)})}else"undefined"!=typeof require&&(t=require("crypto"),t&&t.randomBytes&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{}); \ No newline at end of file +!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;_=_+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+g|0,L=L+v|0,C=C+b|0,R=R+d|0,z=z+A|0,r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=C>>>0&255,r[53]=C>>>8&255,r[54]=C>>>16&255,r[55]=C>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=z>>>0&255,r[61]=z>>>8&255,r[62]=z>>>16&255,r[63]=z>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=z>>>0&255,r[13]=z>>>8&255,r[14]=z>>>16&255,r[15]=z>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function g(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function v(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function b(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function d(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(b(h),b(h),b(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function _(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,g=0,v=0,b=0,d=0,A=0,_=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,C=0,R=0,z=n[0],P=n[1],O=n[2],N=n[3],F=n[4],I=n[5],j=n[6],G=n[7],Z=n[8],V=n[9],q=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*z,h+=e*P,a+=e*O,f+=e*N,s+=e*F,u+=e*I,c+=e*j,y+=e*G,l+=e*Z,w+=e*V,p+=e*q,g+=e*X,v+=e*D,b+=e*H,d+=e*J,A+=e*Q,e=t[1],h+=e*z,a+=e*P,f+=e*O,s+=e*N,u+=e*F,c+=e*I,y+=e*j,l+=e*G,w+=e*Z,p+=e*V,g+=e*q,v+=e*X,b+=e*D,d+=e*H,A+=e*J,_+=e*Q,e=t[2],a+=e*z,f+=e*P,s+=e*O,u+=e*N,c+=e*F,y+=e*I,l+=e*j,w+=e*G,p+=e*Z,g+=e*V,v+=e*q,b+=e*X,d+=e*D,A+=e*H,_+=e*J,U+=e*Q,e=t[3],f+=e*z,s+=e*P,u+=e*O,c+=e*N,y+=e*F,l+=e*I,w+=e*j,p+=e*G,g+=e*Z,v+=e*V,b+=e*q,d+=e*X,A+=e*D,_+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*z,u+=e*P,c+=e*O,y+=e*N,l+=e*F,w+=e*I,p+=e*j,g+=e*G,v+=e*Z,b+=e*V,d+=e*q,A+=e*X,_+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*z,c+=e*P,y+=e*O,l+=e*N,w+=e*F,p+=e*I,g+=e*j,v+=e*G,b+=e*Z,d+=e*V,A+=e*q,_+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*z,y+=e*P,l+=e*O,w+=e*N,p+=e*F,g+=e*I,v+=e*j,b+=e*G,d+=e*Z,A+=e*V,_+=e*q,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*z,l+=e*P,w+=e*O,p+=e*N,g+=e*F,v+=e*I,b+=e*j,d+=e*G,A+=e*Z,_+=e*V,U+=e*q,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*z,w+=e*P,p+=e*O,g+=e*N,v+=e*F,b+=e*I,d+=e*j,A+=e*G,_+=e*Z,U+=e*V,E+=e*q,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*z,p+=e*P,g+=e*O,v+=e*N,b+=e*F,d+=e*I,A+=e*j,_+=e*G,U+=e*Z,E+=e*V,x+=e*q,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*z,g+=e*P,v+=e*O,b+=e*N,d+=e*F,A+=e*I,_+=e*j,U+=e*G,E+=e*Z,x+=e*V,M+=e*q,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],g+=e*z,v+=e*P,b+=e*O,d+=e*N,A+=e*F,_+=e*I,U+=e*j,E+=e*G,x+=e*Z,M+=e*V,m+=e*q,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],v+=e*z,b+=e*P,d+=e*O,A+=e*N,_+=e*F,U+=e*I,E+=e*j,x+=e*G,M+=e*Z,m+=e*V,B+=e*q,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],b+=e*z,d+=e*P,A+=e*O,_+=e*N,U+=e*F,E+=e*I,x+=e*j,M+=e*G,m+=e*Z,B+=e*V,S+=e*q,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],d+=e*z,A+=e*P,_+=e*O,U+=e*N,E+=e*F,x+=e*I,M+=e*j,m+=e*G,B+=e*Z,S+=e*V,K+=e*q,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,C+=e*Q,e=t[15],A+=e*z,_+=e*P,U+=e*O,E+=e*N,x+=e*F,M+=e*I,m+=e*j,B+=e*G,S+=e*Z,K+=e*V,T+=e*q,Y+=e*X,k+=e*D,L+=e*H,C+=e*J,R+=e*Q,i+=38*_,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,g+=38*k,v+=38*L,b+=38*C,d+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=g,r[12]=v,r[13]=b,r[14]=d,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,d(a,f,e),d(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),d(a,f,e),d(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function C(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function z(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],C=r[2],R=r[3],z=r[4],P=r[5],O=r[6],N=r[7],F=t[0],I=t[1],j=t[2],G=t[3],Z=t[4],V=t[5],q=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=C,a=R,f=z,s=P,u=O,c=N,y=F,l=I,w=j,p=G,g=Z,v=V,b=q,d=X,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(z>>>14|Z<<18)^(z>>>18|Z<<14)^(Z>>>9|z<<23),M=(Z>>>14|z<<18)^(Z>>>18|z<<14)^(z>>>9|Z<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=z&P^~z&O,M=Z&V^~Z&q,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,_=65535&m|B<<16,x=A,M=_,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&C^L&C,M=F&I^F&j^I&j,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,d=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=_,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,C=i,R=h,z=a,P=f,O=s,N=u,k=c,I=y,j=l,G=w,Z=p,V=g,q=v,X=b,F=d,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],_=Y[(E+1)%16],x=(A>>>1|_<<31)^(A>>>8|_<<24)^A>>>7,M=(_>>>1|A<<31)^(_>>>8|A<<24)^(_>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],_=Y[(E+14)%16],x=(A>>>19|_<<13)^(_>>>29|A<<3)^A>>>6,M=(_>>>19|A<<13)^(A>>>29|_<<3)^(_>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=C,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=C=65535&S|K<<16,t[2]=j=65535&m|B<<16,x=R,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=G=65535&m|B<<16,x=z,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=z=65535&S|K<<16,t[4]=Z=65535&m|B<<16,x=P,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=P=65535&S|K<<16,t[5]=V=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=O=65535&S|K<<16,t[6]=q=65535&m|B<<16,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=N=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function P(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,z(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),z(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function O(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function N(r,t,n){var e;for(e=0;4>e;e++)d(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(v(r[0],er),v(r[1],or),v(r[2],or),v(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,N(r,t,e),O(t,r),O(r,r),N(r,t,e)}function j(r,t){var n=[$(),$(),$(),$()];v(n[0],fr),v(n[1],sr),v(n[2],or),m(n[3],fr,sr),I(r,n,t)}function G(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),P(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,j(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function Z(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*gr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*gr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*gr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function V(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;Z(r,n)}function q(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];P(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(P(f,r.subarray(32),n+32),V(f),j(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(P(a,r,n+64),V(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return Z(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return v(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),_(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),_(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(P(f,r,n),V(f),I(s,u,f),j(u,t.subarray(32)),O(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==vr)throw new Error("bad key size");if(t.length!==br)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],C=this.r[1],R=this.r[2],z=this.r[3],P=this.r[4],O=this.r[5],N=this.r[6],F=this.r[7],I=this.r[8],j=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=5*x*j,y+=5*M*I,y+=5*m*F,y+=5*B*N,c=y>>>13,y&=8191,y+=5*S*O,y+=5*K*P,y+=5*T*z,y+=5*Y*R,y+=5*k*C,c+=y>>>13,y&=8191,l=c,l+=E*C,l+=x*L,l+=5*M*j,l+=5*m*I,l+=5*B*F,c=l>>>13,l&=8191,l+=5*S*N,l+=5*K*O,l+=5*T*P,l+=5*Y*z,l+=5*k*R,c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*C,w+=M*L,w+=5*m*j,w+=5*B*I,c=w>>>13,w&=8191,w+=5*S*F,w+=5*K*N,w+=5*T*O,w+=5*Y*P,w+=5*k*z,c+=w>>>13,w&=8191,p=c,p+=E*z,p+=x*R,p+=M*C,p+=m*L,p+=5*B*j,c=p>>>13,p&=8191,p+=5*S*I,p+=5*K*F,p+=5*T*N,p+=5*Y*O,p+=5*k*P,c+=p>>>13,p&=8191,g=c,g+=E*P,g+=x*z,g+=M*R,g+=m*C,g+=B*L,c=g>>>13,g&=8191,g+=5*S*j,g+=5*K*I,g+=5*T*F,g+=5*Y*N,g+=5*k*O,c+=g>>>13,g&=8191,v=c,v+=E*O,v+=x*P,v+=M*z,v+=m*R,v+=B*C,c=v>>>13,v&=8191,v+=S*L,v+=5*K*j,v+=5*T*I,v+=5*Y*F,v+=5*k*N,c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*z,b+=B*R,c=b>>>13,b&=8191,b+=S*C,b+=K*L,b+=5*T*j,b+=5*Y*I,b+=5*k*F,c+=b>>>13,b&=8191,d=c,d+=E*F,d+=x*N,d+=M*O,d+=m*P,d+=B*z,c=d>>>13,d&=8191,d+=S*R,d+=K*C,d+=T*L,d+=5*Y*j,d+=5*k*I,c+=d>>>13,d&=8191,A=c,A+=E*I,A+=x*F,A+=M*N,A+=m*O,A+=B*P,c=A>>>13,A&=8191,A+=S*z,A+=K*R,A+=T*C,A+=Y*L,A+=5*k*j,c+=A>>>13,A&=8191,_=c,_+=E*j,_+=x*I,_+=M*F,_+=m*N,_+=B*O,c=_>>>13,_&=8191,_+=S*P,_+=K*z,_+=T*R,_+=Y*C,_+=k*L,c+=_>>>13,_&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=g,S=v,K=b,T=d,Y=A,k=_,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(h[9]>>>15)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=g,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],gr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),vr=32,br=24,dr=32,Ar=16,_r=32,Ur=32,Er=32,xr=32,Mr=32,mr=br,Br=dr,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:g,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:C,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:P,crypto_sign:q,crypto_sign_keypair:G,crypto_sign_open:D,crypto_secretbox_KEYBYTES:vr,crypto_secretbox_NONCEBYTES:br,crypto_secretbox_ZEROBYTES:dr,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:_r,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util={},r.util.decodeUTF8=function(r){var t,n=unescape(encodeURIComponent(r)),e=new Uint8Array(n.length);for(t=0;tt;t++)n.push(String.fromCharCode(r[t]));return btoa(n.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var t,n=atob(r),e=new Uint8Array(n.length);for(t=0;te)return null;for(var o=new Uint8Array(e),i=0;ie;e++)o[e]=t[e];for(e=0;e=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return G(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;ne;e++)n[e]=r[e];return G(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return P(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t),0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?t=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(t=window.msCrypto),t&&r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(t.getRandomValues(o),e=0;n>e;e++)r[e]=o[e];W(o)})):"undefined"!=typeof require&&(t=require("crypto"),t&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js index f72dd78d12550f..b8edbbee692cdf 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js @@ -944,13 +944,39 @@ function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } -// TODO: Completely remove this in v0.15. -if (!nacl.util) { - nacl.util = {}; - nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { - throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js'); - }; -} +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; nacl.randomBytes = function(n) { var b = new Uint8Array(n); @@ -1147,22 +1173,26 @@ nacl.setPRNG = function(fn) { (function() { // Initialize PRNG if environment provides CSPRNG. // If not, methods calling randombytes will throw. - var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null; - if (crypto && crypto.getRandomValues) { - // Browsers. - var QUOTA = 65536; - nacl.setPRNG(function(x, n) { - var i, v = new Uint8Array(n); - for (i = 0; i < n; i += QUOTA) { - crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); - } - for (i = 0; i < n; i++) x[i] = v[i]; - cleanup(v); - }); + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } } else if (typeof require !== 'undefined') { // Node.js. crypto = require('crypto'); - if (crypto && crypto.randomBytes) { + if (crypto) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); for (i = 0; i < n; i++) x[i] = v[i]; @@ -1172,4 +1202,4 @@ nacl.setPRNG = function(fn) { } })(); -})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {})); +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js index eed3854153ec05..95d869502e4b0d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js @@ -1 +1 @@ -!function(r){"use strict";function n(r,n){return r<>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function v(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function b(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,v(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(v(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,v(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function p(r,n,e,t,o,i){var a=new Uint8Array(16);return b(a,0,e,t,o,i),f(r,n,a,0)}function _(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),b(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function A(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==p(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function U(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function E(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function d(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(E(a),E(a),E(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];E(r),E(r)}function L(r,n){Y(r,n,n)}function k(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function z(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,d(f,u,t),d(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ar),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),d(f,u,t),d(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return k(l,l),Y(h,h,l),x(r,h),0}function P(r,n){return R(r,n,br)}function O(r,n){return gr(n,32),P(r,n)}function F(r,n,e){var t=new Uint8Array(32);return R(t,e,n),y(r,vr,t,Br)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Kr(r,n,e,t,a)}function C(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function G(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function Z(){var r,n=0,e=0;for(r=0;rn?(e=r.hi>>>n|r.lo<>>n|r.hi<n&&(e=r.lo>>>n|r.hi<>>n|r.lo<a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),q(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,V(w[0]),I(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,Er),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)d(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();k(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(U(r[0],pr),U(r[1],_r),U(r[2],_r),U(r[3],pr),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];U(e[0],dr),U(e[1],xr),U(e[2],_r),Y(e[3],dr,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*kr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*kr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*kr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return U(r[2],_r),S(r[1],n),L(o,r[1]),Y(i,o,Ur),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),z(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],pr,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==zr)throw new Error("bad key size");if(n.length!==Rr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Cr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;nt)return null;for(var o=new Uint8Array(t),i=0;it;t++)o[t]=n[t];for(t=0;t=0},r.sign.keyPair=function(){var r=new Uint8Array(Vr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(Vr),e=0;et;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=Vr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Ir,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var e=65536;r.setPRNG(function(r,t){var o,i=new Uint8Array(t);for(o=0;t>o;o+=e)n.getRandomValues(i.subarray(o,o+Math.min(t-o,e)));for(o=0;t>o;o++)r[o]=i[o];sr(i)})}else"undefined"!=typeof require&&(n=require("crypto"),n&&n.randomBytes&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{}); \ No newline at end of file +!function(r){"use strict";function n(r,n){return r<>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function p(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function v(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,p(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(p(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,p(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function b(r,n,e,t,o,i){var a=new Uint8Array(16);return v(a,0,e,t,o,i),f(r,n,a,0)}function A(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),v(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function U(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==b(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function _(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function d(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function E(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(d(a),d(a),d(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,E(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];d(r),d(r)}function L(r,n){Y(r,n,n)}function C(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function k(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,E(f,u,t),E(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ur),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),E(f,u,t),E(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return C(l,l),Y(h,h,l),x(r,h),0}function z(r,n){return k(r,n,vr)}function P(r,n){return gr(n,32),z(r,n)}function O(r,n,e){var t=new Uint8Array(32);return k(t,e,n),y(r,pr,t,Br)}function F(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Kr(r,n,e,t,a)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function j(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function G(){var r,n=0,e=0;for(r=0;rn?(e=r.hi>>>n|r.lo<>>n|r.hi<n&&(e=r.lo>>>n|r.hi<>>n|r.lo<a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),Z(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,q(w[0]),V(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,dr),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)E(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();C(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(_(r[0],br),_(r[1],Ar),_(r[2],Ar),_(r[3],br),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];_(e[0],Er),_(e[1],xr),_(e[2],Ar),Y(e[3],Er,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*Cr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*Cr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*Cr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return _(r[2],Ar),S(r[1],n),L(o,r[1]),Y(i,o,_r),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),R(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],br,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==Rr)throw new Error("bad key size");if(n.length!==kr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Nr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;nn;n++)e.push(String.fromCharCode(r[n]));return btoa(e.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var n,e=atob(r),t=new Uint8Array(e.length);for(n=0;nt)return null;for(var o=new Uint8Array(t),i=0;it;t++)o[t]=n[t];for(t=0;t=0},r.sign.keyPair=function(){var r=new Uint8Array(qr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(qr),e=0;et;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=qr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Vr,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?n=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(n=window.msCrypto),n&&r.setPRNG(function(r,e){var t,o=new Uint8Array(e);for(n.getRandomValues(o),t=0;e>t;t++)r[t]=o[t];sr(o)})):"undefined"!=typeof require&&(n=require("crypto"),n&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json index 0903b54ccfb82f..147ea92c406fa1 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json @@ -1,41 +1,46 @@ { "_args": [ [ - "tweetnacl@>=0.13.0 <1.0.0", + { + "raw": "tweetnacl@~0.13.0", + "scope": null, + "escapedName": "tweetnacl", + "name": "tweetnacl", + "rawSpec": "~0.13.0", + "spec": ">=0.13.0 <0.14.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], - "_from": "tweetnacl@>=0.13.0 <1.0.0", - "_id": "tweetnacl@0.14.3", + "_from": "tweetnacl@>=0.13.0 <0.14.0", + "_id": "tweetnacl@0.13.3", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk/tweetnacl", - "_nodeVersion": "5.6.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/tweetnacl-0.14.3.tgz_1459224951636_0.7403244483284652" - }, + "_nodeVersion": "4.2.3", "_npmUser": { - "email": "dmitry@codingrobots.com", - "name": "dchest" + "name": "dchest", + "email": "dmitry@codingrobots.com" }, - "_npmVersion": "3.7.3", + "_npmVersion": "2.14.7", "_phantomChildren": {}, "_requested": { - "name": "tweetnacl", - "raw": "tweetnacl@>=0.13.0 <1.0.0", - "rawSpec": ">=0.13.0 <1.0.0", + "raw": "tweetnacl@~0.13.0", "scope": null, - "spec": ">=0.13.0 <1.0.0", + "escapedName": "tweetnacl", + "name": "tweetnacl", + "rawSpec": "~0.13.0", + "spec": ">=0.13.0 <0.14.0", "type": "range" }, "_requiredBy": [ "/request/http-signature/sshpk" ], - "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz", - "_shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d", + "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz", + "_shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", "_shrinkwrap": null, - "_spec": "tweetnacl@>=0.13.0 <1.0.0", + "_spec": "tweetnacl@~0.13.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { "name": "TweetNaCl-js contributors" @@ -50,24 +55,23 @@ "dependencies": {}, "description": "Port of TweetNaCl cryptographic library to JavaScript", "devDependencies": { - "browserify": "^13.0.0", - "eslint": "^2.2.0", - "faucet": "^0.0.1", + "browserify": "^10.1.3", + "eslint": "^1.4.3", + "faucet": "0.0.1", "tap-browser-color": "^0.1.2", - "tape": "^4.4.0", - "tape-run": "^2.1.3", - "tweetnacl-util": "^0.13.3", - "uglify-js": "^2.6.1" + "tape": "^4.0.0", + "testling": "^1.7.1", + "uglify-js": "^2.4.21" }, "directories": { "test": "test" }, "dist": { - "shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d", - "tarball": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz" + "shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", + "tarball": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz" }, - "gitHead": "3eb4fc544a2a1d6c0a41b98b9906288ca8b087e4", - "homepage": "https://tweetnacl.js.org", + "gitHead": "2bb422cb707fba4a5ec9654688564a4fb861b068", + "homepage": "https://dchest.github.io/tweetnacl-js", "keywords": [ "crypto", "cryptography", @@ -82,12 +86,12 @@ "salsa20", "signatures" ], - "license": "SEE LICENSE IN COPYING.txt", + "license": "Public domain", "main": "nacl-fast.js", "maintainers": [ { - "email": "dmitry@codingrobots.com", - "name": "dchest" + "name": "dchest", + "email": "dmitry@codingrobots.com" } ], "name": "tweetnacl", @@ -99,13 +103,27 @@ }, "scripts": { "bench": "node test/benchmark/bench.js", + "browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null", + "browser-quick": "browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js", - "build-test-browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null && browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", + "chrome": "browserify test/browser/testling_init.js test/*.js | testling -x google-chrome | faucet", + "firefox": "browserify test/browser/testling_init.js test/*.js | testling -x firefox | faucet", "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js", - "test": "npm run test-node-all && npm run test-browser", - "test-browser": "NACL_SRC=${NACL_SRC:='nacl.min.js'} && npm run build-test-browser && cat $NACL_SRC test/browser/_bundle.js | tape-run | faucet", - "test-node": "tape test/*.js | faucet", - "test-node-all": "make -C test/c && tape test/*.js test/c/*.js | faucet" + "test": "tape test/*.js | faucet", + "testall": "make -C test/c && tape test/*.js test/c/*.js | faucet", + "testling": "browserify test/browser/testling_init.js test/*.js | testling | faucet" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "chrome/22..latest", + "firefox/16..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6..latest", + "ipad/6..latest", + "android-browser/latest" + ] }, - "version": "0.14.3" + "version": "0.13.3" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json index fc995b42cd3b5e..27d297637ebc2f 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json @@ -1,39 +1,48 @@ { "_args": [ [ - "sshpk@^1.7.0", + { + "raw": "sshpk@^1.7.0", + "scope": null, + "escapedName": "sshpk", + "name": "sshpk", + "rawSpec": "^1.7.0", + "spec": ">=1.7.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature" ] ], "_from": "sshpk@>=1.7.0 <2.0.0", - "_id": "sshpk@1.7.4", + "_id": "sshpk@1.9.2", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk", - "_nodeVersion": "0.12.9", + "_nodeVersion": "0.12.15", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/sshpk-1.7.4.tgz_1455236064846_0.4782760036177933" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/sshpk-1.9.2.tgz_1469841656006_0.10793639998883009" }, "_npmUser": { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" }, - "_npmVersion": "2.14.4", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "sshpk", "raw": "sshpk@^1.7.0", - "rawSpec": "^1.7.0", "scope": null, + "escapedName": "sshpk", + "name": "sshpk", + "rawSpec": "^1.7.0", "spec": ">=1.7.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/request/http-signature" ], - "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz", - "_shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38", + "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.9.2.tgz", + "_shasum": "3b41351bbad5c34ddf4bd8119937efee31a46765", "_shrinkwrap": null, "_spec": "sshpk@^1.7.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature", @@ -50,33 +59,34 @@ }, "contributors": [ { - "email": "dave@daveeddy.com", - "name": "Dave Eddy" + "name": "Dave Eddy", + "email": "dave@daveeddy.com" }, { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, { - "email": "alex@cooperi.net", - "name": "Alex Wilson" + "name": "Alex Wilson", + "email": "alex@cooperi.net" } ], "dependencies": { - "asn1": ">=0.2.3 <0.3.0", - "assert-plus": ">=0.2.0 <0.3.0", - "dashdash": ">=1.10.1 <2.0.0", - "ecc-jsbn": ">=0.0.1 <1.0.0", - "jodid25519": ">=1.0.0 <2.0.0", - "jsbn": ">=0.1.0 <0.2.0", - "tweetnacl": ">=0.13.0 <1.0.0" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jodid25519": "^1.0.0", + "jsbn": "~0.1.0", + "tweetnacl": "~0.13.0" }, "description": "A library for finding and using SSH public keys", "devDependencies": { - "benchmark": ">=1.0.0 <2.0.0", - "sinon": ">=1.17.2 <2.0.0", - "tape": ">=3.5.0 <4.0.0", - "temp": "0.8.2" + "benchmark": "^1.0.0", + "sinon": "^1.17.2", + "tape": "^3.5.0", + "temp": "^0.8.2" }, "directories": { "bin": "./bin", @@ -84,33 +94,33 @@ "man": "./man/man1" }, "dist": { - "shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38", - "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz" + "shasum": "3b41351bbad5c34ddf4bd8119937efee31a46765", + "tarball": "https://registry.npmjs.org/sshpk/-/sshpk-1.9.2.tgz" }, "engines": { - "node": ">=0.8.0" + "node": ">=0.10.0" }, - "gitHead": "9b86d45d512c97f6ea10b98a2970828dfb290310", + "gitHead": "a8b794384822a52eea5ed3b2f192a780b7909609", "homepage": "https://github.com/arekinath/node-sshpk#readme", "license": "MIT", "main": "lib/index.js", "maintainers": [ { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" } ], "man": [ - "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-conv.1", - "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-sign.1", - "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-verify.1" + "/Users/alex.wilson/dev/node-sshpk/man/man1/sshpk-conv.1", + "/Users/alex.wilson/dev/node-sshpk/man/man1/sshpk-sign.1", + "/Users/alex.wilson/dev/node-sshpk/man/man1/sshpk-verify.1" ], "name": "sshpk", "optionalDependencies": { - "ecc-jsbn": ">=0.0.1 <1.0.0", - "jodid25519": ">=1.0.0 <2.0.0", - "jsbn": ">=0.1.0 <0.2.0", - "tweetnacl": ">=0.13.0 <1.0.0" + "ecc-jsbn": "~0.1.1", + "jodid25519": "^1.0.0", + "jsbn": "~0.1.0", + "tweetnacl": "~0.13.0" }, "readme": "ERROR: No README data found!", "repository": { @@ -120,5 +130,5 @@ "scripts": { "test": "tape test/*.js" }, - "version": "1.7.4" + "version": "1.9.2" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/package.json b/deps/npm/node_modules/request/node_modules/http-signature/package.json index c7479c09ff97a4..2f9211c9a7468e 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "http-signature@~1.1.0", + { + "raw": "http-signature@~1.1.0", + "scope": null, + "escapedName": "http-signature", + "name": "http-signature", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], @@ -12,16 +20,17 @@ "_location": "/request/http-signature", "_nodeVersion": "0.12.9", "_npmUser": { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" }, "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { - "name": "http-signature", "raw": "http-signature@~1.1.0", - "rawSpec": "~1.1.0", "scope": null, + "escapedName": "http-signature", + "name": "http-signature", + "rawSpec": "~1.1.0", "spec": ">=1.1.0 <1.2.0", "type": "range" }, @@ -66,7 +75,7 @@ "directories": {}, "dist": { "shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf", - "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" + "tarball": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" }, "engines": { "node": ">=0.8", diff --git a/deps/npm/node_modules/request/node_modules/is-typedarray/package.json b/deps/npm/node_modules/request/node_modules/is-typedarray/package.json index 863afc5165c769..b90ee31390f16d 100644 --- a/deps/npm/node_modules/request/node_modules/is-typedarray/package.json +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "is-typedarray@~1.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "is-typedarray@~1.0.0", + "scope": null, + "escapedName": "is-typedarray", + "name": "is-typedarray", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "is-typedarray@>=1.0.0 <1.1.0", @@ -12,16 +20,17 @@ "_location": "/request/is-typedarray", "_nodeVersion": "0.10.36", "_npmUser": { - "email": "hughskennedy@gmail.com", - "name": "hughsk" + "name": "hughsk", + "email": "hughskennedy@gmail.com" }, "_npmVersion": "2.7.5", "_phantomChildren": {}, "_requested": { - "name": "is-typedarray", "raw": "is-typedarray@~1.0.0", - "rawSpec": "~1.0.0", "scope": null, + "escapedName": "is-typedarray", + "name": "is-typedarray", + "rawSpec": "~1.0.0", "spec": ">=1.0.0 <1.1.0", "type": "range" }, @@ -32,10 +41,10 @@ "_shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", "_shrinkwrap": null, "_spec": "is-typedarray@~1.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "hughskennedy@gmail.com", "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", "url": "http://hughsk.io/" }, "bugs": { @@ -49,15 +58,15 @@ "directories": {}, "dist": { "shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", - "tarball": "http://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" }, "gitHead": "0617cfa871686cf541af62b144f130488f44f6fe", "homepage": "https://github.com/hughsk/is-typedarray", "keywords": [ + "typed", "array", "detect", "is", - "typed", "util" ], "license": "MIT", diff --git a/deps/npm/node_modules/request/node_modules/isstream/package.json b/deps/npm/node_modules/request/node_modules/isstream/package.json index 87c26fe121c130..c2d661f5b63685 100644 --- a/deps/npm/node_modules/request/node_modules/isstream/package.json +++ b/deps/npm/node_modules/request/node_modules/isstream/package.json @@ -1,15 +1,70 @@ { - "name": "isstream", - "version": "0.1.2", + "_args": [ + [ + { + "raw": "isstream@~0.1.2", + "scope": null, + "escapedName": "isstream", + "name": "isstream", + "rawSpec": "~0.1.2", + "spec": ">=0.1.2 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "isstream@>=0.1.2 <0.2.0", + "_id": "isstream@0.1.2", + "_inCache": true, + "_installable": true, + "_location": "/request/isstream", + "_nodeVersion": "1.4.3", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "2.6.1", + "_phantomChildren": {}, + "_requested": { + "raw": "isstream@~0.1.2", + "scope": null, + "escapedName": "isstream", + "name": "isstream", + "rawSpec": "~0.1.2", + "spec": ">=0.1.2 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "_shrinkwrap": null, + "_spec": "isstream@~0.1.2", + "_where": "/Users/rebecca/code/npm/node_modules/request", + "author": { + "name": "Rod Vagg", + "email": "rod@vagg.org" + }, + "bugs": { + "url": "https://github.com/rvagg/isstream/issues" + }, + "dependencies": {}, "description": "Determine if an object is a Stream", - "main": "isstream.js", - "scripts": { - "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + "devDependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "tape": "~2.12.3" }, - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/isstream.git" + "directories": {}, + "dist": { + "shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "tarball": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" }, + "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc", + "homepage": "https://github.com/rvagg/isstream", "keywords": [ "stream", "type", @@ -17,26 +72,23 @@ "readable-stream", "hippo" ], - "devDependencies": { - "tape": "~2.12.3", - "core-util-is": "~1.0.0", - "isarray": "0.0.1", - "string_decoder": "~0.10.x", - "inherits": "~2.0.1" - }, - "author": { - "name": "Rod Vagg", - "email": "rod@vagg.org" - }, "license": "MIT", - "bugs": { - "url": "https://github.com/rvagg/isstream/issues" + "main": "isstream.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "isstream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/isstream.git" }, - "homepage": "https://github.com/rvagg/isstream", - "readme": "# isStream\n\n[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream)\n\n**Test if an object is a `Stream`**\n\n[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/)\n\nThe missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.\n\n## Usage:\n\n```js\nvar isStream = require('isstream')\nvar Stream = require('stream')\n\nisStream(new Stream()) // true\n\nisStream({}) // false\n\nisStream(new Stream.Readable()) // true\nisStream(new Stream.Writable()) // true\nisStream(new Stream.Duplex()) // true\nisStream(new Stream.Transform()) // true\nisStream(new Stream.PassThrough()) // true\n```\n\n## But wait! There's more!\n\nYou can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.\n\n```js\nvar isReadable = require('isstream').isReadable\nvar isWritable = require('isstream').isWritable\nvar isDuplex = require('isstream').isDuplex\nvar Stream = require('stream')\n\nisReadable(new Stream()) // false\nisWritable(new Stream()) // false\nisDuplex(new Stream()) // false\n\nisReadable(new Stream.Readable()) // true\nisReadable(new Stream.Writable()) // false\nisReadable(new Stream.Duplex()) // true\nisReadable(new Stream.Transform()) // true\nisReadable(new Stream.PassThrough()) // true\n\nisWritable(new Stream.Readable()) // false\nisWritable(new Stream.Writable()) // true\nisWritable(new Stream.Duplex()) // true\nisWritable(new Stream.Transform()) // true\nisWritable(new Stream.PassThrough()) // true\n\nisDuplex(new Stream.Readable()) // false\nisDuplex(new Stream.Writable()) // false\nisDuplex(new Stream.Duplex()) // true\nisDuplex(new Stream.Transform()) // true\nisDuplex(new Stream.PassThrough()) // true\n```\n\n*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*\n\n\n## License\n\n**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.\n", - "readmeFilename": "README.md", - "_id": "isstream@0.1.2", - "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", - "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "_from": "isstream@>=0.1.2 <0.2.0" + "scripts": { + "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + }, + "version": "0.1.2" } diff --git a/deps/npm/node_modules/request/node_modules/isstream/test.js b/deps/npm/node_modules/request/node_modules/isstream/test.js index 881e70b3098ff7..8c950c55e6375f 100644 --- a/deps/npm/node_modules/request/node_modules/isstream/test.js +++ b/deps/npm/node_modules/request/node_modules/isstream/test.js @@ -163,3 +163,6 @@ testDuplex(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrou }) }) + + + diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md index c5147d77f6c943..42bcb60af47a50 100644 --- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md @@ -1,8 +1,8 @@ ## Unreleased - Fixes stringify to only take ancestors into account when checking - circularity. + circularity. It previously assumed every visited object was circular which led to [false - positives][issue9]. + positives][issue9]. Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago. - Fixes calling the `replacer` function in the proper context (`thisArg`). - Fixes calling the `cycleReplacer` function in the proper context (`thisArg`). diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json index f09f9d57168c19..35400846685d6c 100644 --- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json +++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json @@ -1,22 +1,55 @@ { - "name": "json-stringify-safe", - "version": "5.0.1", - "description": "Like JSON.stringify, but doesn't blow up on circular refs.", - "keywords": [ - "json", - "stringify", - "circular", - "safe" + "_args": [ + [ + { + "raw": "json-stringify-safe@~5.0.1", + "scope": null, + "escapedName": "json-stringify-safe", + "name": "json-stringify-safe", + "rawSpec": "~5.0.1", + "spec": ">=5.0.1 <5.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] ], - "homepage": "https://github.com/isaacs/json-stringify-safe", - "bugs": { - "url": "https://github.com/isaacs/json-stringify-safe/issues" + "_from": "json-stringify-safe@>=5.0.1 <5.1.0", + "_id": "json-stringify-safe@5.0.1", + "_inCache": true, + "_installable": true, + "_location": "/request/json-stringify-safe", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "json-stringify-safe@~5.0.1", + "scope": null, + "escapedName": "json-stringify-safe", + "name": "json-stringify-safe", + "rawSpec": "~5.0.1", + "spec": ">=5.0.1 <5.1.0", + "type": "range" }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "_shrinkwrap": null, + "_spec": "json-stringify-safe@~5.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me" }, + "bugs": { + "url": "https://github.com/isaacs/json-stringify-safe/issues" + }, "contributors": [ { "name": "Andri Möll", @@ -24,24 +57,47 @@ "url": "http://themoll.com" } ], + "dependencies": {}, + "description": "Like JSON.stringify, but doesn't blow up on circular refs.", + "devDependencies": { + "mocha": ">= 2.1.0 < 3", + "must": ">= 0.12 < 0.13", + "sinon": ">= 1.12.2 < 2" + }, + "directories": {}, + "dist": { + "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "tarball": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5", + "homepage": "https://github.com/isaacs/json-stringify-safe", + "keywords": [ + "json", + "stringify", + "circular", + "safe" + ], "license": "ISC", + "main": "stringify.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "moll", + "email": "andri@dot.ee" + } + ], + "name": "json-stringify-safe", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/isaacs/json-stringify-safe.git" }, - "main": "stringify.js", "scripts": { "test": "node test.js" }, - "devDependencies": { - "mocha": ">= 2.1.0 < 3", - "must": ">= 0.12 < 0.13", - "sinon": ">= 1.12.2 < 2" - }, - "readme": "# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n \"circularRef\": \"[Circular]\",\n \"list\": [\n \"[Circular]\",\n \"[Circular]\"\n ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify. The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere. This is the actual\nfunction that's passed to JSON.stringify.\n\n**Note** that the function returned from `getSerialize` is stateful for now, so\ndo **not** use it more than once.\n", - "readmeFilename": "README.md", - "_id": "json-stringify-safe@5.0.1", - "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "_from": "json-stringify-safe@>=5.0.1 <5.1.0" + "version": "5.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md index 1d86a5cb154422..63bd4ea0b40ce4 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md +++ b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md @@ -1,3 +1,9 @@ +2.1.11 / 2016-05-01 +=================== + + * deps: mime-db@~1.23.0 + - Add new mime types + 2.1.10 / 2016-02-15 =================== diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md index 44f9f6465e949c..d6705ac86d114f 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md @@ -1,3 +1,24 @@ +1.23.0 / 2016-05-01 +=================== + + * Add `application/efi` + * Add `application/vnd.3gpp.sms+xml` + * Add `application/vnd.3lightssoftware.imagescal` + * Add `application/vnd.coreos.ignition+json` + * Add `application/vnd.desmume.movie` + * Add `application/vnd.onepager` + * Add `application/vnd.vel+json` + * Add `text/prs.prop.logic` + * Add `video/encaprtp` + * Add `video/h265` + * Add `video/iso.segment` + * Add `video/raptorfec` + * Add `video/rtploopback` + * Add `video/vnd.radgamettools.bink` + * Add `video/vnd.radgamettools.smacker` + * Add `video/vp8` + * Add extension `.3gpp` to `audio/3gpp` + 1.22.0 / 2016-02-15 =================== diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json index 863deb4f0a8bee..0a5a8a7bba5574 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json @@ -284,6 +284,9 @@ "source": "iana", "compressible": false }, + "application/efi": { + "source": "iana" + }, "application/emergencycalldata.comment+xml": { "source": "iana" }, @@ -1217,6 +1220,9 @@ "application/vnd.3gpp.sms": { "source": "iana" }, + "application/vnd.3gpp.sms+xml": { + "source": "iana" + }, "application/vnd.3gpp.srvcc-ext+xml": { "source": "iana" }, @@ -1239,6 +1245,9 @@ "source": "iana", "extensions": ["tcap"] }, + "application/vnd.3lightssoftware.imagescal": { + "source": "iana" + }, "application/vnd.3m.post-it-notes": { "source": "iana", "extensions": ["pwn"] @@ -1497,6 +1506,10 @@ "source": "iana", "extensions": ["cdbcmsg"] }, + "application/vnd.coreos.ignition+json": { + "source": "iana", + "compressible": true + }, "application/vnd.cosmocaller": { "source": "iana", "extensions": ["cmc"] @@ -1600,6 +1613,9 @@ "application/vnd.desmume-movie": { "source": "iana" }, + "application/vnd.desmume.movie": { + "source": "apache" + }, "application/vnd.dir-bi.plate-dl-nosuffix": { "source": "iana" }, @@ -3138,6 +3154,9 @@ "application/vnd.omaloc-supl-init": { "source": "iana" }, + "application/vnd.onepager": { + "source": "iana" + }, "application/vnd.openblox.game+xml": { "source": "iana" }, @@ -3981,6 +4000,10 @@ "application/vnd.vectorworks": { "source": "iana" }, + "application/vnd.vel+json": { + "source": "iana", + "compressible": true + }, "application/vnd.verimatrix.vcas": { "source": "iana" }, @@ -4826,7 +4849,9 @@ "source": "iana" }, "audio/3gpp": { - "source": "iana" + "source": "iana", + "compressible": false, + "extensions": ["3gpp"] }, "audio/3gpp2": { "source": "iana" @@ -5991,6 +6016,9 @@ "source": "iana", "extensions": ["dsc"] }, + "text/prs.prop.logic": { + "source": "iana" + }, "text/raptorfec": { "source": "iana" }, @@ -6282,6 +6310,9 @@ "video/dv": { "source": "apache" }, + "video/encaprtp": { + "source": "apache" + }, "video/h261": { "source": "apache", "extensions": ["h261"] @@ -6306,6 +6337,12 @@ "video/h264-svc": { "source": "apache" }, + "video/h265": { + "source": "apache" + }, + "video/iso.segment": { + "source": "apache" + }, "video/jpeg": { "source": "apache", "extensions": ["jpgv"] @@ -6369,12 +6406,18 @@ "compressible": false, "extensions": ["qt","mov"] }, + "video/raptorfec": { + "source": "apache" + }, "video/raw": { "source": "apache" }, "video/rtp-enc-aescm128": { "source": "apache" }, + "video/rtploopback": { + "source": "apache" + }, "video/rtx": { "source": "apache" }, @@ -6474,6 +6517,12 @@ "video/vnd.objectvideo": { "source": "apache" }, + "video/vnd.radgamettools.bink": { + "source": "apache" + }, + "video/vnd.radgamettools.smacker": { + "source": "apache" + }, "video/vnd.sealed.mpeg1": { "source": "apache" }, @@ -6494,6 +6543,9 @@ "source": "apache", "extensions": ["viv"] }, + "video/vp8": { + "source": "apache" + }, "video/webm": { "source": "apache", "compressible": false, diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json index 1abcdca6c79b95..8411c5ad0e3f7c 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json @@ -1,78 +1,87 @@ { "_args": [ [ - "mime-db@~1.22.0", + { + "raw": "mime-db@~1.23.0", + "scope": null, + "escapedName": "mime-db", + "name": "mime-db", + "rawSpec": "~1.23.0", + "spec": ">=1.23.0 <1.24.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types" ] ], - "_from": "mime-db@>=1.22.0 <1.23.0", - "_id": "mime-db@1.22.0", + "_from": "mime-db@>=1.23.0 <1.24.0", + "_id": "mime-db@1.23.0", "_inCache": true, "_installable": true, "_location": "/request/mime-types/mime-db", - "_nodeVersion": "4.2.3", + "_nodeVersion": "4.4.3", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/mime-db-1.22.0.tgz_1455558813990_0.7830642955377698" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/mime-db-1.23.0.tgz_1462163798086_0.43938886746764183" }, "_npmUser": { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.1", "_phantomChildren": {}, "_requested": { - "name": "mime-db", - "raw": "mime-db@~1.22.0", - "rawSpec": "~1.22.0", + "raw": "mime-db@~1.23.0", "scope": null, - "spec": ">=1.22.0 <1.23.0", + "escapedName": "mime-db", + "name": "mime-db", + "rawSpec": "~1.23.0", + "spec": ">=1.23.0 <1.24.0", "type": "range" }, "_requiredBy": [ "/request/mime-types" ], - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz", - "_shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a", + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz", + "_shasum": "a31b4070adaea27d732ea333740a64d0ec9a6659", "_shrinkwrap": null, - "_spec": "mime-db@~1.22.0", + "_spec": "mime-db@~1.23.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" }, "contributors": [ { - "email": "doug@somethingdoug.com", - "name": "Douglas Christopher Wilson" + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" }, { - "email": "me@jongleberry.com", "name": "Jonathan Ong", + "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, { - "email": "robert@broofa.com", "name": "Robert Kieffer", + "email": "robert@broofa.com", "url": "http://github.com/broofa" } ], "dependencies": {}, "description": "Media Type Database", "devDependencies": { - "bluebird": "3.3.1", + "bluebird": "3.3.5", "co": "4.6.0", "cogent": "1.0.1", - "csv-parse": "1.0.1", + "csv-parse": "1.1.0", "gnode": "0.1.2", - "istanbul": "0.4.2", + "istanbul": "0.4.3", "mocha": "1.21.5", - "raw-body": "2.1.5", - "stream-to-array": "2.2.1" + "raw-body": "2.1.6", + "stream-to-array": "2.3.0" }, "directories": {}, "dist": { - "shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a", - "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz" + "shasum": "a31b4070adaea27d732ea333740a64d0ec9a6659", + "tarball": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz" }, "engines": { "node": ">= 0.6" @@ -84,7 +93,7 @@ "db.json", "index.js" ], - "gitHead": "ed88d32405582a5aaff6225d1210005d6be2623e", + "gitHead": "ba0d99fd05b3bfdc2ebcd78f858c25cb7db6af41", "homepage": "https://github.com/jshttp/mime-db#readme", "keywords": [ "mime", @@ -98,12 +107,12 @@ "license": "MIT", "maintainers": [ { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, { - "email": "jonathanrichardong@gmail.com", - "name": "jongleberry" + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" } ], "name": "mime-db", @@ -121,5 +130,5 @@ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", "update": "npm run fetch && npm run build" }, - "version": "1.22.0" + "version": "1.23.0" } diff --git a/deps/npm/node_modules/request/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/mime-types/package.json index 8e7b5f62ba3b50..dae8f5a70a0c2e 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/package.json @@ -1,31 +1,40 @@ { "_args": [ [ - "mime-types@~2.1.7", + { + "raw": "mime-types@~2.1.7", + "scope": null, + "escapedName": "mime-types", + "name": "mime-types", + "rawSpec": "~2.1.7", + "spec": ">=2.1.7 <2.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "mime-types@>=2.1.7 <2.2.0", - "_id": "mime-types@2.1.10", + "_id": "mime-types@2.1.11", "_inCache": true, "_installable": true, "_location": "/request/mime-types", - "_nodeVersion": "4.2.3", + "_nodeVersion": "4.4.3", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/mime-types-2.1.10.tgz_1455575237256_0.9163766100537032" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/mime-types-2.1.11.tgz_1462165365027_0.7217204745393246" }, "_npmUser": { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.1", "_phantomChildren": {}, "_requested": { - "name": "mime-types", "raw": "mime-types@~2.1.7", - "rawSpec": "~2.1.7", "scope": null, + "escapedName": "mime-types", + "name": "mime-types", + "rawSpec": "~2.1.7", "spec": ">=2.1.7 <2.2.0", "type": "range" }, @@ -33,8 +42,8 @@ "/request", "/request/form-data" ], - "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz", - "_shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837", + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", + "_shasum": "c259c471bda808a85d6cd193b430a5fae4473b3c", "_shrinkwrap": null, "_spec": "mime-types@~2.1.7", "_where": "/Users/rebecca/code/npm/node_modules/request", @@ -43,32 +52,32 @@ }, "contributors": [ { - "email": "doug@somethingdoug.com", - "name": "Douglas Christopher Wilson" + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" }, { - "email": "fishrock123@rocketmail.com", "name": "Jeremiah Senkpiel", + "email": "fishrock123@rocketmail.com", "url": "https://searchbeam.jit.su" }, { - "email": "me@jongleberry.com", "name": "Jonathan Ong", + "email": "me@jongleberry.com", "url": "http://jongleberry.com" } ], "dependencies": { - "mime-db": "~1.22.0" + "mime-db": "~1.23.0" }, "description": "The ultimate javascript content-type utility.", "devDependencies": { - "istanbul": "0.4.2", + "istanbul": "0.4.3", "mocha": "1.21.5" }, "directories": {}, "dist": { - "shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837", - "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz" + "shasum": "c259c471bda808a85d6cd193b430a5fae4473b3c", + "tarball": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz" }, "engines": { "node": ">= 0.6" @@ -78,7 +87,7 @@ "LICENSE", "index.js" ], - "gitHead": "70785d38e9cc251137b00f73ab3d3257c4aea203", + "gitHead": "298ffcf490a5d6e60edea7bf7a69036df04846b1", "homepage": "https://github.com/jshttp/mime-types#readme", "keywords": [ "mime", @@ -87,16 +96,16 @@ "license": "MIT", "maintainers": [ { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, { - "email": "fishrock123@rocketmail.com", - "name": "fishrock123" + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" }, { - "email": "jonathanrichardong@gmail.com", - "name": "jongleberry" + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" } ], "name": "mime-types", @@ -111,5 +120,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" }, - "version": "2.1.10" + "version": "2.1.11" } diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md index a43093bf321f2b..652609b37e009c 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md +++ b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2010-2012 Robert Kieffer +Copyright (c) 2010-2012 Robert Kieffer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu index fd597ab681ae10..a342fbbe04e9ac 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ b/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu @@ -1,14 +1,14 @@ #!/opt/local/bin/gnuplot -persist # -# +# # G N U P L O T # Version 4.4 patchlevel 3 # last modified March 2011 # System: Darwin 10.8.0 -# +# # Copyright (C) 1986-1993, 1998, 2004, 2007-2010 # Thomas Williams, Colin Kelley and many others -# +# # gnuplot home: http://www.gnuplot.info # faq, bugs, etc: type "help seeking-assistance" # immediate help: type "help" @@ -17,7 +17,7 @@ set terminal postscript eps noenhanced defaultplex \ leveldefault color colortext \ solid linewidth 1.2 butt noclip \ palfuncparam 2000,0.003 \ - "Helvetica" 14 + "Helvetica" 14 set output 'bench.eps' unset clip points set clip one @@ -38,7 +38,7 @@ set timefmt cb "%d/%m/%y,%H:%M" set boxwidth set style fill empty border set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 +set style circle radius graph 0.02, first 0, 0 set dummy x,y set format x "% g" set format y "% g" @@ -50,7 +50,7 @@ set angles radians unset grid set key title "" set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 +set key noinvert samplen 4 spacing 1 width 0 height 0 set key maxcolumns 2 maxrows 0 unset label unset arrow @@ -107,10 +107,10 @@ set nox2tics set noy2tics set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 set cbtics autofreq norangelimit -set title "" +set title "" set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" +set timestamp bottom +set timestamp "" set timestamp offset character 0, 0, 0 font "" norotate set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) set autoscale rfixmin @@ -124,9 +124,9 @@ set autoscale ufixmax set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) set autoscale vfixmin set autoscale vfixmax -set xlabel "" +set xlabel "" set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" +set x2label "" set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) set autoscale xfixmin @@ -134,9 +134,9 @@ set autoscale xfixmax set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) set autoscale x2fixmin set autoscale x2fixmax -set ylabel "" +set ylabel "" set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" +set y2label "" set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) set autoscale yfixmin @@ -144,12 +144,12 @@ set autoscale yfixmax set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) set autoscale y2fixmin set autoscale y2fixmax -set zlabel "" +set zlabel "" set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) set autoscale zfixmin set autoscale zfixmax -set cblabel "" +set cblabel "" set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) set autoscale cbfixmin @@ -162,12 +162,12 @@ set tmargin -1 set pm3d explicit at s set pm3d scansautomatic set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB +set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB set palette rgbformulae 7, 5, 15 set colorbox default set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath +set loadpath +set fontpath set fit noerrorvariables GNUTERM = "aqua" plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/package.json b/deps/npm/node_modules/request/node_modules/node-uuid/package.json index 44c585893f7f49..a3a391590cc4c9 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/package.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "node-uuid@~1.4.7", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "node-uuid@~1.4.7", + "scope": null, + "escapedName": "node-uuid", + "name": "node-uuid", + "rawSpec": "~1.4.7", + "spec": ">=1.4.7 <1.5.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "node-uuid@>=1.4.7 <1.5.0", @@ -12,16 +20,17 @@ "_location": "/request/node-uuid", "_nodeVersion": "5.0.0", "_npmUser": { - "email": "coolaj86@gmail.com", - "name": "coolaj86" + "name": "coolaj86", + "email": "coolaj86@gmail.com" }, "_npmVersion": "3.3.6", "_phantomChildren": {}, "_requested": { - "name": "node-uuid", "raw": "node-uuid@~1.4.7", - "rawSpec": "~1.4.7", "scope": null, + "escapedName": "node-uuid", + "name": "node-uuid", + "rawSpec": "~1.4.7", "spec": ">=1.4.7 <1.5.0", "type": "range" }, @@ -32,10 +41,10 @@ "_shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", "_shrinkwrap": null, "_spec": "node-uuid@~1.4.7", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "robert@broofa.com", - "name": "Robert Kieffer" + "name": "Robert Kieffer", + "email": "robert@broofa.com" }, "bin": { "uuid": "./bin/uuid" @@ -61,7 +70,7 @@ "directories": {}, "dist": { "shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" + "tarball": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" }, "gitHead": "309512573ec1c60143c257157479a20f7f1f51cd", "homepage": "https://github.com/broofa/node-uuid", diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/README.md b/deps/npm/node_modules/request/node_modules/oauth-sign/README.md index af496148e4815a..34c4a85d2dde05 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/README.md +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/README.md @@ -1,4 +1,4 @@ oauth-sign ========== -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. +OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js index 4c20674c792a60..dadcba9709f792 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js @@ -45,7 +45,7 @@ function compare (a, b) { } function generateBase (httpMethod, base_uri, params) { - // adapted from https://dev.twitter.com/docs/auth/oauth and + // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature // Parameter normalization @@ -133,3 +133,4 @@ exports.plaintext = plaintext exports.sign = sign exports.rfc3986 = rfc3986 exports.generateBase = generateBase + diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json index 788eebb0c21a5d..a01120c9f5e7c1 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json @@ -1,41 +1,54 @@ { "_args": [ [ - "oauth-sign@~0.8.0", + { + "raw": "oauth-sign@~0.8.1", + "scope": null, + "escapedName": "oauth-sign", + "name": "oauth-sign", + "rawSpec": "~0.8.1", + "spec": ">=0.8.1 <0.9.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "oauth-sign@>=0.8.0 <0.9.0", - "_id": "oauth-sign@0.8.1", + "_from": "oauth-sign@>=0.8.1 <0.9.0", + "_id": "oauth-sign@0.8.2", "_inCache": true, "_installable": true, "_location": "/request/oauth-sign", - "_nodeVersion": "5.5.0", + "_nodeVersion": "5.9.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/oauth-sign-0.8.2.tgz_1462396399020_0.8175400267355144" + }, "_npmUser": { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" }, - "_npmVersion": "3.6.0", + "_npmVersion": "2.15.3", "_phantomChildren": {}, "_requested": { - "name": "oauth-sign", - "raw": "oauth-sign@~0.8.0", - "rawSpec": "~0.8.0", + "raw": "oauth-sign@~0.8.1", "scope": null, - "spec": ">=0.8.0 <0.9.0", + "escapedName": "oauth-sign", + "name": "oauth-sign", + "rawSpec": "~0.8.1", + "spec": ">=0.8.1 <0.9.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz", - "_shasum": "182439bdb91378bf7460e75c64ea43e6448def06", + "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "_shasum": "46a6ab7f0aead8deae9ec0565780b7d4efeb9d43", "_shrinkwrap": null, - "_spec": "oauth-sign@~0.8.0", + "_spec": "oauth-sign@~0.8.1", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "mikeal.rogers@gmail.com", "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, "bugs": { @@ -46,28 +59,31 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "182439bdb91378bf7460e75c64ea43e6448def06", - "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz" + "shasum": "46a6ab7f0aead8deae9ec0565780b7d4efeb9d43", + "tarball": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz" }, "engines": { "node": "*" }, - "gitHead": "9c7229a336c9face98b83f93b72cb7c80dbba08d", + "files": [ + "index.js" + ], + "gitHead": "0b034206316132f57e26970152c2fb18e71bddd5", "homepage": "https://github.com/mikeal/oauth-sign#readme", "license": "Apache-2.0", "main": "index.js", "maintainers": [ { - "email": "mikeal.rogers@gmail.com", - "name": "mikeal" + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, { - "email": "jnylen@gmail.com", - "name": "nylen" + "name": "nylen", + "email": "jnylen@gmail.com" }, { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" } ], "name": "oauth-sign", @@ -79,5 +95,5 @@ "scripts": { "test": "node test.js" }, - "version": "0.8.1" + "version": "0.8.2" } diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js b/deps/npm/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index 4cd02b8aa21967..00000000000000 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,89 +0,0 @@ -var oauth = require('./index') - , hmacsign = oauth.hmacsign - , assert = require('assert') - , qs = require('querystring') - ; - -// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth - -var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', - { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' - , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_timestamp: '1272323042' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") - -console.log(reqsign) -console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') -assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') - -var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', - { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' - , oauth_timestamp: '1272323047' - , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") - -console.log(accsign) -console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') -assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') - -var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', - { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" - , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , oauth_signature_method: "HMAC-SHA1" - , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , oauth_timestamp: "1272325550" - , oauth_version: "1.0" - , status: 'setting up my twitter 私のさえずりを設定する' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") - -console.log(upsign) -console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') -assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') - -// handle objects in params (useful for Wordpress REST API) -var upsign = hmacsign('POST', 'http://wordpress.com/wp-json', - { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" - , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , oauth_signature_method: "HMAC-SHA1" - , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , oauth_timestamp: "1272325550" - , oauth_version: "1.0" - , filter: { number: "-1" } - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") - -console.log(upsign) -console.log('YrJFBdwnjuIitGpKrxLUplcuuUQ=') -assert.equal(upsign, 'YrJFBdwnjuIitGpKrxLUplcuuUQ=') - -// example in rfc5849 -var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q') -params.oauth_consumer_key = '9djdj82h48djs9d2' -params.oauth_token = 'kkk9d7dh3k39sjv7' -params.oauth_nonce = '7d8f3e4a' -params.oauth_signature_method = 'HMAC-SHA1' -params.oauth_timestamp = '137131201' - -var rfc5849sign = hmacsign('POST', 'http://example.com/request', - params, "j49sk3j29djd", "dh893hdasih9") - -console.log(rfc5849sign) -console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=') -assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=') - - -// PLAINTEXT - -var plainSign = oauth.sign('PLAINTEXT', 'GET', 'http://dummy.com', {}, 'consumer_secret', 'token_secret') -console.log(plainSign) -assert.equal(plainSign, 'consumer_secret&token_secret') - -plainSign = oauth.plaintext('consumer_secret', 'token_secret') -console.log(plainSign) -assert.equal(plainSign, 'consumer_secret&token_secret') diff --git a/deps/npm/node_modules/request/node_modules/qs/.npmignore b/deps/npm/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index 7e1574dc5c3c81..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov -complexity.md diff --git a/deps/npm/node_modules/request/node_modules/qs/.travis.yml b/deps/npm/node_modules/request/node_modules/qs/.travis.yml deleted file mode 100644 index 63bdc12bebd6b9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/.travis.yml +++ /dev/null @@ -1,69 +0,0 @@ -language: node_js -node_js: - - "5.3" - - "5.2" - - "5.1" - - "5.0" - - "4.2" - - "4.1" - - "4.0" - - "iojs-v3.3" - - "iojs-v3.2" - - "iojs-v3.1" - - "iojs-v3.0" - - "iojs-v2.5" - - "iojs-v2.4" - - "iojs-v2.3" - - "iojs-v2.2" - - "iojs-v2.1" - - "iojs-v2.0" - - "iojs-v1.8" - - "iojs-v1.7" - - "iojs-v1.6" - - "iojs-v1.5" - - "iojs-v1.4" - - "iojs-v1.3" - - "iojs-v1.2" - - "iojs-v1.1" - - "iojs-v1.0" - - "0.12" - - "0.11" - - "0.10" - - "0.9" - - "0.8" - - "0.6" - - "0.4" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' -script: - - 'if [ "${TRAVIS_NODE_VERSION}" != "4.2" ]; then npm run tests-only ; else npm test ; fi' -sudo: false -matrix: - fast_finish: true - allow_failures: - - node_js: "5.2" - - node_js: "5.1" - - node_js: "5.0" - - node_js: "4.1" - - node_js: "4.0" - - node_js: "iojs-v3.2" - - node_js: "iojs-v3.1" - - node_js: "iojs-v3.0" - - node_js: "iojs-v2.4" - - node_js: "iojs-v2.3" - - node_js: "iojs-v2.2" - - node_js: "iojs-v2.1" - - node_js: "iojs-v2.0" - - node_js: "iojs-v1.7" - - node_js: "iojs-v1.6" - - node_js: "iojs-v1.5" - - node_js: "iojs-v1.4" - - node_js: "iojs-v1.3" - - node_js: "iojs-v1.2" - - node_js: "iojs-v1.1" - - node_js: "iojs-v1.0" - - node_js: "0.11" - - node_js: "0.9" - - node_js: "0.6" - - node_js: "0.4" diff --git a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md index 5c66ea44464cb1..86bea763886548 100644 --- a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md @@ -1,4 +1,16 @@ -## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=34&state=closed) +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) - [New] allowDots option for `stringify` (#151) - [Fix] "sort" option should work at a depth of 3 or more (#151) - [Fix] Restore `dist` directory; will be removed in v7 (#148) @@ -12,6 +24,9 @@ ## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) - [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + ## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) - [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string diff --git a/deps/npm/node_modules/request/node_modules/qs/README.md b/deps/npm/node_modules/request/node_modules/qs/README.md index 335eafb4be5a72..97e390796c7f34 100644 --- a/deps/npm/node_modules/request/node_modules/qs/README.md +++ b/deps/npm/node_modules/request/node_modules/qs/README.md @@ -225,6 +225,26 @@ var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); assert.equal(unencoded, 'a[b]=c'); ``` +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. When arrays are stringified, by default they are given explicit indices: @@ -333,3 +353,24 @@ To completely skip rendering keys with `null` values, use the `skipNulls` flag: var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); assert.equal(nullsSkipped, 'a=b'); ``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`. If you +wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` diff --git a/deps/npm/node_modules/request/node_modules/qs/bower.json b/deps/npm/node_modules/request/node_modules/qs/bower.json deleted file mode 100644 index 44f050642d73db..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "qs", - "main": "dist/qs.js", - "homepage": "https://github.com/hapijs/qs", - "authors": [ - "Nathan LaFreniere " - ], - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "keywords": [ - "querystring", - "qs" - ], - "license": "BSD-3-Clause", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/deps/npm/node_modules/request/node_modules/qs/component.json b/deps/npm/node_modules/request/node_modules/qs/component.json deleted file mode 100644 index cb8d93fb1fe8f7..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/component.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "qs", - "repository": "hapijs/qs", - "description": "query-string parser / stringifier with nesting support", - "version": "6.1.0", - "keywords": ["querystring", "query", "parser"], - "main": "lib/index.js", - "scripts": [ - "lib/index.js", - "lib/parse.js", - "lib/stringify.js", - "lib/utils.js" - ], - "license": "BSD-3-Clause" -} diff --git a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js index bb8ea31a957830..fcf825b584085f 100644 --- a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js +++ b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js @@ -14,7 +14,9 @@ module.exports = { var Utils = require('./utils'); -var internals = { +var has = Object.prototype.hasOwnProperty; + +var defaults = { delimiter: '&', depth: 5, arrayLimit: 20, @@ -22,10 +24,11 @@ var internals = { strictNullHandling: false, plainObjects: false, allowPrototypes: false, - allowDots: false + allowDots: false, + decoder: Utils.decode }; -internals.parseValues = function (str, options) { +var parseValues = function parseValues(str, options) { var obj = {}; var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); @@ -33,28 +36,25 @@ internals.parseValues = function (str, options) { var part = parts[i]; var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + var key, val; if (pos === -1) { - obj[Utils.decode(part)] = ''; - - if (options.strictNullHandling) { - obj[Utils.decode(part)] = null; - } + key = options.decoder(part); + val = options.strictNullHandling ? null : ''; } else { - var key = Utils.decode(part.slice(0, pos)); - var val = Utils.decode(part.slice(pos + 1)); - - if (Object.prototype.hasOwnProperty.call(obj, key)) { - obj[key] = [].concat(obj[key]).concat(val); - } else { - obj[key] = val; - } + key = options.decoder(part.slice(0, pos)); + val = options.decoder(part.slice(pos + 1)); + } + if (has.call(obj, key)) { + obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; } } return obj; }; -internals.parseObject = function (chain, val, options) { +var parseObject = function parseObject(chain, val, options) { if (!chain.length) { return val; } @@ -64,7 +64,7 @@ internals.parseObject = function (chain, val, options) { var obj; if (root === '[]') { obj = []; - obj = obj.concat(internals.parseObject(chain, val, options)); + obj = obj.concat(parseObject(chain, val, options)); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; @@ -77,16 +77,16 @@ internals.parseObject = function (chain, val, options) { (options.parseArrays && index <= options.arrayLimit) ) { obj = []; - obj[index] = internals.parseObject(chain, val, options); + obj[index] = parseObject(chain, val, options); } else { - obj[cleanRoot] = internals.parseObject(chain, val, options); + obj[cleanRoot] = parseObject(chain, val, options); } } return obj; }; -internals.parseKeys = function (givenKey, val, options) { +var parseKeys = function parseKeys(givenKey, val, options) { if (!givenKey) { return; } @@ -109,7 +109,7 @@ internals.parseKeys = function (givenKey, val, options) { if (segment[1]) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) { + if (!options.plainObjects && has.call(Object.prototype, segment[1])) { if (!options.allowPrototypes) { return; } @@ -123,7 +123,7 @@ internals.parseKeys = function (givenKey, val, options) { var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { if (!options.allowPrototypes) { continue; } @@ -137,30 +137,32 @@ internals.parseKeys = function (givenKey, val, options) { keys.push('[' + key.slice(segment.index) + ']'); } - return internals.parseObject(keys, val, options); + return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts || {}; - options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; - options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - - if ( - str === '' || - str === null || - typeof str === 'undefined' - ) { + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } - var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object @@ -168,7 +170,7 @@ module.exports = function (str, opts) { var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; - var newObj = internals.parseKeys(key, tempObj[key], options); + var newObj = parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj, options); } @@ -180,45 +182,45 @@ module.exports = function (str, opts) { var Utils = require('./utils'); -var internals = { - delimiter: '&', - arrayPrefixGenerators: { - brackets: function (prefix) { - return prefix + '[]'; - }, - indices: function (prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function (prefix) { - return prefix; - } +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var defaults = { + delimiter: '&', strictNullHandling: false, skipNulls: false, - encode: true + encode: true, + encoder: Utils.encode }; -internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) { +var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); - } else if (Utils.isBuffer(obj)) { - obj = String(obj); } else if (obj instanceof Date) { obj = obj.toISOString(); } else if (obj === null) { if (strictNullHandling) { - return encode ? Utils.encode(prefix) : prefix; + return encoder ? encoder(prefix) : prefix; } obj = ''; } - if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') { - if (encode) { - return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || Utils.isBuffer(obj)) { + if (encoder) { + return [encoder(prefix) + '=' + encoder(obj)]; } - return [prefix + '=' + obj]; + return [prefix + '=' + String(obj)]; } var values = []; @@ -243,9 +245,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH } if (Array.isArray(obj)) { - values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } else { - values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } } @@ -255,14 +257,20 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH module.exports = function (object, opts) { var obj = object; var options = opts || {}; - var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; - var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var objKeys; var filter; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); @@ -277,7 +285,7 @@ module.exports = function (object, opts) { } var arrayFormat; - if (options.arrayFormat in internals.arrayPrefixGenerators) { + if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; @@ -285,7 +293,7 @@ module.exports = function (object, opts) { arrayFormat = 'indices'; } - var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); @@ -302,7 +310,7 @@ module.exports = function (object, opts) { continue; } - keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } return keys.join(delimiter); @@ -357,7 +365,7 @@ exports.merge = function (target, source, options) { mergeTarget = exports.arrayToObject(target, options); } - return Object.keys(source).reduce(function (acc, key) { + return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (Object.prototype.hasOwnProperty.call(acc, key)) { @@ -365,7 +373,7 @@ exports.merge = function (target, source, options) { } else { acc[key] = value; } - return acc; + return acc; }, mergeTarget); }; @@ -420,7 +428,7 @@ exports.encode = function (str) { i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; @@ -443,7 +451,9 @@ exports.compact = function (obj, references) { var compacted = []; for (var i = 0; i < obj.length; ++i) { - if (typeof obj[i] !== 'undefined') { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } } diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js index 9b6cbd221987f0..8b37cb3b294580 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js @@ -2,7 +2,9 @@ var Utils = require('./utils'); -var internals = { +var has = Object.prototype.hasOwnProperty; + +var defaults = { delimiter: '&', depth: 5, arrayLimit: 20, @@ -10,10 +12,11 @@ var internals = { strictNullHandling: false, plainObjects: false, allowPrototypes: false, - allowDots: false + allowDots: false, + decoder: Utils.decode }; -internals.parseValues = function (str, options) { +var parseValues = function parseValues(str, options) { var obj = {}; var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); @@ -21,28 +24,25 @@ internals.parseValues = function (str, options) { var part = parts[i]; var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + var key, val; if (pos === -1) { - obj[Utils.decode(part)] = ''; - - if (options.strictNullHandling) { - obj[Utils.decode(part)] = null; - } + key = options.decoder(part); + val = options.strictNullHandling ? null : ''; } else { - var key = Utils.decode(part.slice(0, pos)); - var val = Utils.decode(part.slice(pos + 1)); - - if (Object.prototype.hasOwnProperty.call(obj, key)) { - obj[key] = [].concat(obj[key]).concat(val); - } else { - obj[key] = val; - } + key = options.decoder(part.slice(0, pos)); + val = options.decoder(part.slice(pos + 1)); + } + if (has.call(obj, key)) { + obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; } } return obj; }; -internals.parseObject = function (chain, val, options) { +var parseObject = function parseObject(chain, val, options) { if (!chain.length) { return val; } @@ -52,7 +52,7 @@ internals.parseObject = function (chain, val, options) { var obj; if (root === '[]') { obj = []; - obj = obj.concat(internals.parseObject(chain, val, options)); + obj = obj.concat(parseObject(chain, val, options)); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; @@ -65,16 +65,16 @@ internals.parseObject = function (chain, val, options) { (options.parseArrays && index <= options.arrayLimit) ) { obj = []; - obj[index] = internals.parseObject(chain, val, options); + obj[index] = parseObject(chain, val, options); } else { - obj[cleanRoot] = internals.parseObject(chain, val, options); + obj[cleanRoot] = parseObject(chain, val, options); } } return obj; }; -internals.parseKeys = function (givenKey, val, options) { +var parseKeys = function parseKeys(givenKey, val, options) { if (!givenKey) { return; } @@ -97,7 +97,7 @@ internals.parseKeys = function (givenKey, val, options) { if (segment[1]) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) { + if (!options.plainObjects && has.call(Object.prototype, segment[1])) { if (!options.allowPrototypes) { return; } @@ -111,7 +111,7 @@ internals.parseKeys = function (givenKey, val, options) { var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { if (!options.allowPrototypes) { continue; } @@ -125,30 +125,32 @@ internals.parseKeys = function (givenKey, val, options) { keys.push('[' + key.slice(segment.index) + ']'); } - return internals.parseObject(keys, val, options); + return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts || {}; - options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; - options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - - if ( - str === '' || - str === null || - typeof str === 'undefined' - ) { + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } - var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object @@ -156,7 +158,7 @@ module.exports = function (str, opts) { var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; - var newObj = internals.parseKeys(key, tempObj[key], options); + var newObj = parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj, options); } diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js index 892dad45a9f30f..6e1c9a263cd979 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js @@ -2,45 +2,45 @@ var Utils = require('./utils'); -var internals = { - delimiter: '&', - arrayPrefixGenerators: { - brackets: function (prefix) { - return prefix + '[]'; - }, - indices: function (prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function (prefix) { - return prefix; - } +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var defaults = { + delimiter: '&', strictNullHandling: false, skipNulls: false, - encode: true + encode: true, + encoder: Utils.encode }; -internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) { +var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); - } else if (Utils.isBuffer(obj)) { - obj = String(obj); } else if (obj instanceof Date) { obj = obj.toISOString(); } else if (obj === null) { if (strictNullHandling) { - return encode ? Utils.encode(prefix) : prefix; + return encoder ? encoder(prefix) : prefix; } obj = ''; } - if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') { - if (encode) { - return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || Utils.isBuffer(obj)) { + if (encoder) { + return [encoder(prefix) + '=' + encoder(obj)]; } - return [prefix + '=' + obj]; + return [prefix + '=' + String(obj)]; } var values = []; @@ -65,9 +65,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH } if (Array.isArray(obj)) { - values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } else { - values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } } @@ -77,14 +77,20 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH module.exports = function (object, opts) { var obj = object; var options = opts || {}; - var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; - var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var objKeys; var filter; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); @@ -99,7 +105,7 @@ module.exports = function (object, opts) { } var arrayFormat; - if (options.arrayFormat in internals.arrayPrefixGenerators) { + if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; @@ -107,7 +113,7 @@ module.exports = function (object, opts) { arrayFormat = 'indices'; } - var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); @@ -124,7 +130,7 @@ module.exports = function (object, opts) { continue; } - keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } return keys.join(delimiter); diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js index 5d433560306849..2c5c8ee503355b 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js @@ -46,7 +46,7 @@ exports.merge = function (target, source, options) { mergeTarget = exports.arrayToObject(target, options); } - return Object.keys(source).reduce(function (acc, key) { + return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (Object.prototype.hasOwnProperty.call(acc, key)) { @@ -54,7 +54,7 @@ exports.merge = function (target, source, options) { } else { acc[key] = value; } - return acc; + return acc; }, mergeTarget); }; @@ -109,7 +109,7 @@ exports.encode = function (str) { i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; @@ -132,7 +132,9 @@ exports.compact = function (obj, references) { var compacted = []; for (var i = 0; i < obj.length; ++i) { - if (typeof obj[i] !== 'undefined') { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } } diff --git a/deps/npm/node_modules/request/node_modules/qs/package.json b/deps/npm/node_modules/request/node_modules/qs/package.json index 33318a7253cc48..64853dbde47222 100644 --- a/deps/npm/node_modules/request/node_modules/qs/package.json +++ b/deps/npm/node_modules/request/node_modules/qs/package.json @@ -1,73 +1,84 @@ { "_args": [ [ - "qs@~6.1.0", + { + "raw": "qs@~6.2.0", + "scope": null, + "escapedName": "qs", + "name": "qs", + "rawSpec": "~6.2.0", + "spec": ">=6.2.0 <6.3.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "qs@>=6.1.0 <6.2.0", - "_id": "qs@6.1.0", + "_from": "qs@>=6.2.0 <6.3.0", + "_id": "qs@6.2.1", "_inCache": true, "_installable": true, "_location": "/request/qs", - "_nodeVersion": "5.5.0", + "_nodeVersion": "6.3.0", "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/qs-6.1.0.tgz_1454565583082_0.44599376199766994" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/qs-6.2.1.tgz_1469044929716_0.06957711698487401" }, "_npmUser": { - "email": "ljharb@gmail.com", - "name": "ljharb" + "name": "ljharb", + "email": "ljharb@gmail.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { - "name": "qs", - "raw": "qs@~6.1.0", - "rawSpec": "~6.1.0", + "raw": "qs@~6.2.0", "scope": null, - "spec": ">=6.1.0 <6.2.0", + "escapedName": "qs", + "name": "qs", + "rawSpec": "~6.2.0", + "spec": ">=6.2.0 <6.3.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-6.1.0.tgz", - "_shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26", + "_resolved": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz", + "_shasum": "ce03c5ff0935bc1d9d69a9f14cbd18e568d67625", "_shrinkwrap": null, - "_spec": "qs@~6.1.0", + "_spec": "qs@~6.2.0", "_where": "/Users/rebecca/code/npm/node_modules/request", "bugs": { "url": "https://github.com/ljharb/qs/issues" }, "contributors": [ { - "email": "ljharb@gmail.com", "name": "Jordan Harband", + "email": "ljharb@gmail.com", "url": "http://ljharb.codes" } ], "dependencies": {}, "description": "A querystring parser that supports nesting and arrays, with a depth limit", "devDependencies": { - "@ljharb/eslint-config": "^1.6.1", - "browserify": "^12.0.1", + "@ljharb/eslint-config": "^6.0.0", + "browserify": "^13.0.1", "covert": "^1.1.0", - "eslint": "^1.10.3", - "evalmd": "^0.0.16", + "eslint": "^3.1.0", + "evalmd": "^0.0.17", + "iconv-lite": "^0.4.13", "mkdirp": "^0.5.1", "parallelshell": "^2.0.0", - "tape": "^4.3.0" + "qs-iconv": "^1.0.3", + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26", - "tarball": "http://registry.npmjs.org/qs/-/qs-6.1.0.tgz" + "shasum": "ce03c5ff0935bc1d9d69a9f14cbd18e568d67625", + "tarball": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz" }, "engines": { "node": ">=0.6" }, - "gitHead": "5bd79545edb33d6a43398fec7df9ecef2da005ea", + "gitHead": "335f839142e6c2c69f5302c4940d92acb0e77561", "homepage": "https://github.com/ljharb/qs", "keywords": [ "querystring", @@ -77,16 +88,16 @@ "main": "lib/index.js", "maintainers": [ { - "email": "eran@hammer.io", - "name": "hueniverse" + "name": "hueniverse", + "email": "eran@hammer.io" }, { - "email": "ljharb@gmail.com", - "name": "ljharb" + "name": "ljharb", + "email": "ljharb@gmail.com" }, { - "email": "quitlahok@gmail.com", - "name": "nlf" + "name": "nlf", + "email": "quitlahok@gmail.com" } ], "name": "qs", @@ -101,9 +112,10 @@ "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", "lint": "eslint lib/*.js text/*.js", "prepublish": "npm run dist", + "pretest": "npm run --silent readme && npm run --silent lint", "readme": "evalmd README.md", - "test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'", + "test": "npm run --silent coverage", "tests-only": "node test" }, - "version": "6.1.0" + "version": "6.2.1" } diff --git a/deps/npm/node_modules/request/node_modules/qs/test/parse.js b/deps/npm/node_modules/request/node_modules/qs/test/parse.js index 5665d074e95bd4..ccf8c8c4c5365a 100755 --- a/deps/npm/node_modules/request/node_modules/qs/test/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/parse.js @@ -2,6 +2,7 @@ var test = require('tape'); var qs = require('../'); +var iconv = require('iconv-lite'); test('parse()', function (t) { t.test('parses a simple string', function (st) { @@ -120,8 +121,11 @@ test('parse()', function (t) { st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } }); st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c'), { a: { '0': 'b', t: 'u', c: true } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y'), { a: { '0': 'b', '1': 'c', x: 'y' } }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { '0': 'b', c: true, t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { '0': 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { '0': 'b', '1': 'c', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { '0': 'b', hasOwnProperty: 'c', x: 'y' } }); st.end(); }); @@ -173,14 +177,42 @@ test('parse()', function (t) { t.test('allows for empty strings in arrays', function (st) { st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true }), { a: ['b', null, 'c', ''] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true }), { a: ['b', '', 'c', null] }); - st.deepEqual(qs.parse('a[]=&a[]=b&a[]=c'), { a: ['', 'b', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); st.end(); }); t.test('compacts sparse arrays', function (st) { st.deepEqual(qs.parse('a[10]=1&a[2]=2'), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1'), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1'), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1'), { a: [[[{ c: ['1'] }]]] }); st.end(); }); @@ -390,4 +422,30 @@ test('parse()', function (t) { st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); st.end(); }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /\%([0-9A-F]{2})/ig; + var result = []; + var parts; + var last = 0; + while (parts = reg.exec(str)) { + result.push(parseInt(parts[1], 16)); + last = parts.index + parts[0].length; + } + return iconv.decode(new Buffer(result), 'shift_jis').toString(); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st.throws(function () { + qs.parse({}, { + decoder: 'string' + }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); }); diff --git a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js index 508c2460b69081..699397e3346a9e 100755 --- a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js @@ -2,6 +2,7 @@ var test = require('tape'); var qs = require('../'); +var iconv = require('iconv-lite'); test('stringify()', function (t) { t.test('stringifies a querystring object', function (st) { @@ -65,6 +66,11 @@ test('stringify()', function (t) { st.end(); }); + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal(qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }), 'a[0][b]=1&a[1]=2&a[2]=3'); + st.end(); + }); + t.test('stringifies an object inside an array with dots notation', function (st) { st.equal(qs.stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false }), 'a[0].b=c'); st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false }), 'a[0].b.c[0]=1'); @@ -256,4 +262,44 @@ test('stringify()', function (t) { st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: null, encode: false }), 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'); st.end(); }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': ''}, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i=0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st.throws(function () { + qs.stringify({}, { + encoder: 'string' + }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { + skip: typeof Buffer === 'undefined' + }, function (st) { + st.equal(qs.stringify({ a: new Buffer([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + st.end(); + }); }); diff --git a/deps/npm/node_modules/request/node_modules/stringstream/package.json b/deps/npm/node_modules/request/node_modules/stringstream/package.json index 9ab3d820ddb754..514c18dc16a847 100644 --- a/deps/npm/node_modules/request/node_modules/stringstream/package.json +++ b/deps/npm/node_modules/request/node_modules/stringstream/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "stringstream@~0.0.4", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "stringstream@~0.0.4", + "scope": null, + "escapedName": "stringstream", + "name": "stringstream", + "rawSpec": "~0.0.4", + "spec": ">=0.0.4 <0.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "stringstream@>=0.0.4 <0.1.0", @@ -12,16 +20,17 @@ "_location": "/request/stringstream", "_nodeVersion": "4.2.1", "_npmUser": { - "email": "michael.hart.au@gmail.com", - "name": "hichaelmart" + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" }, "_npmVersion": "2.14.8", "_phantomChildren": {}, "_requested": { - "name": "stringstream", "raw": "stringstream@~0.0.4", - "rawSpec": "~0.0.4", "scope": null, + "escapedName": "stringstream", + "name": "stringstream", + "rawSpec": "~0.0.4", "spec": ">=0.0.4 <0.1.0", "type": "range" }, @@ -32,10 +41,10 @@ "_shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", "_shrinkwrap": null, "_spec": "stringstream@~0.0.4", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "michael.hart.au@gmail.com", "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", "url": "http://github.com/mhart" }, "bugs": { @@ -47,15 +56,15 @@ "directories": {}, "dist": { "shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", - "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + "tarball": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" }, "gitHead": "1efe3bf507bf3a1161f8473908b60e881d41422b", "homepage": "https://github.com/mhart/StringStream#readme", "keywords": [ - "base64", - "gzip", + "string", "stream", - "string" + "base64", + "gzip" ], "license": "MIT", "main": "stringstream.js", diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md index 9899dbf6eed156..126f222b904646 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md @@ -1,9 +1,8 @@ [RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js -[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie) +[![npm package](https://nodei.co/npm/tough-cookie.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/tough-cookie/) -[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie) -![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9) +[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie) # Synopsis @@ -30,6 +29,10 @@ It's _so_ easy! Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken. +## Version Support + +Support for versions of node.js will follow that of the [request](https://www.npmjs.com/package/request) module. + # API ## tough @@ -426,6 +429,17 @@ Inherits from `Store`. A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API. +## Community Cookie Stores + +These are some Store implementations authored and maintained by the community. They aren't official and we don't vouch for them but you may be interested to have a look: + +- [`db-cookie-store`](https://github.com/JSBizon/db-cookie-store): SQL including SQLite-based databases +- [`file-cookie-store`](https://github.com/JSBizon/file-cookie-store): Netscape cookie file format on disk +- [`redis-cookie-store`](https://github.com/benkroeger/redis-cookie-store): Redis +- [`tough-cookie-filestore`](https://github.com/mitsuru/tough-cookie-filestore): JSON on disk +- [`tough-cookie-web-storage-store`](https://github.com/exponentjs/tough-cookie-web-storage-store): DOM localStorage and sessionStorage + + # Serialization Format **NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`. diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js index 12da297ac4d20f..c3dacfe44a3f2a 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js @@ -68,9 +68,6 @@ var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?([^\n\r\0]*)/; // Note ';' is \x3B var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; -// Used for checking whether or not there is a trailing semi-colon -var TRAILING_SEMICOLON = /;+$/; - var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/; var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/; var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i; @@ -327,12 +324,6 @@ function parse(str, options) { } str = str.trim(); - // S4.1.1 Trailing semi-colons are not part of the specification. - var semiColonCheck = TRAILING_SEMICOLON.exec(str); - if (semiColonCheck) { - str = str.slice(0, semiColonCheck.index); - } - // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 var pairRe = options.loose ? LOOSE_COOKIE_PAIR : COOKIE_PAIR; @@ -362,7 +353,7 @@ function parse(str, options) { // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question)." plus later on in the same section // "discard the first ";" and trim". - var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim(); + var unparsed = str.slice(firstSemi + 1).trim(); // "If the unparsed-attributes string is empty, skip the rest of these // steps." @@ -378,9 +369,12 @@ function parse(str, options) { * cookie-attribute-list". Therefore, in this implementation, we overwrite * the previous value. */ - var cookie_avs = unparsed.split(/\s*;\s*/); + var cookie_avs = unparsed.split(';'); while (cookie_avs.length) { - var av = cookie_avs.shift(); + var av = cookie_avs.shift().trim(); + if (av.length === 0) { // happens if ";;" appears + continue; + } var av_sep = av.indexOf('='); var av_key, av_value; diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json index 565dbe191469f9..ca65ee5216cf2b 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "tough-cookie@~2.2.0", + { + "raw": "tough-cookie@~2.3.0", + "scope": null, + "escapedName": "tough-cookie", + "name": "tough-cookie", + "rawSpec": "~2.3.0", + "spec": ">=2.3.0 <2.4.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "tough-cookie@>=2.2.0 <2.3.0", - "_id": "tough-cookie@2.2.2", + "_from": "tough-cookie@>=2.3.0 <2.4.0", + "_id": "tough-cookie@2.3.1", "_inCache": true, "_installable": true, "_location": "/request/tough-cookie", - "_nodeVersion": "5.1.1", + "_nodeVersion": "6.3.1", "_npmOperationalInternal": { - "host": "packages-13-west.internal.npmjs.com", - "tmp": "tmp/tough-cookie-2.2.2.tgz_1457564639182_0.5129188685677946" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/tough-cookie-2.3.1.tgz_1469494891088_0.8524557144846767" }, "_npmUser": { - "email": "jstash@gmail.com", - "name": "jstash" + "name": "jstash", + "email": "jstash@gmail.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { - "name": "tough-cookie", - "raw": "tough-cookie@~2.2.0", - "rawSpec": "~2.2.0", + "raw": "tough-cookie@~2.3.0", "scope": null, - "spec": ">=2.2.0 <2.3.0", + "escapedName": "tough-cookie", + "name": "tough-cookie", + "rawSpec": "~2.3.0", + "spec": ">=2.3.0 <2.4.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz", - "_shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7", + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz", + "_shasum": "99c77dfbb7d804249e8a299d4cb0fd81fef083fd", "_shrinkwrap": null, - "_spec": "tough-cookie@~2.2.0", + "_spec": "tough-cookie@~2.3.0", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "jstashewsky@salesforce.com", - "name": "Jeremy Stashewsky" + "name": "Jeremy Stashewsky", + "email": "jstashewsky@salesforce.com" }, "bugs": { "url": "https://github.com/SalesforceEng/tough-cookie/issues" @@ -68,20 +77,21 @@ "description": "RFC6265 Cookies and Cookie Jar for node.js", "devDependencies": { "async": "^1.4.2", + "string.prototype.repeat": "^0.2.0", "vows": "^0.8.1" }, "directories": {}, "dist": { - "shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7", - "tarball": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz" + "shasum": "99c77dfbb7d804249e8a299d4cb0fd81fef083fd", + "tarball": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.8" }, "files": [ "lib" ], - "gitHead": "cc46628c4d7d2e8c372ecba29293ca8a207ec192", + "gitHead": "c11a2d11d12348a35ef595c809e30e641a804a7d", "homepage": "https://github.com/SalesforceEng/tough-cookie", "keywords": [ "HTTP", @@ -97,12 +107,12 @@ "main": "./lib/cookie", "maintainers": [ { - "email": "jeremy@goinstant.com", - "name": "jstash" + "name": "jstash", + "email": "jstash@gmail.com" }, { - "email": "services@goinstant.com", - "name": "goinstant" + "name": "nexxy", + "email": "emily@contactvibe.com" } ], "name": "tough-cookie", @@ -116,5 +126,5 @@ "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js", "test": "vows test/*_test.js" }, - "version": "2.2.2" + "version": "2.3.1" } diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js b/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js index 177adb378b53e0..68013ac1f4ef33 100644 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js +++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js @@ -118,7 +118,7 @@ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var placeholder = {} self.sockets.push(placeholder) - var connectOptions = mergeOptions({}, self.proxyOptions, + var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT' , path: options.host + ':' + options.port , agent: false @@ -183,7 +183,7 @@ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) return - + this.sockets.splice(pos, 1) var pending = this.requests.shift() @@ -198,7 +198,7 @@ function createSecureSocket(options, cb) { var self = this TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, mergeOptions({}, self.options, + var secureSocket = tls.connect(0, mergeOptions({}, self.options, { servername: options.host , socket: socket } diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json index 0b2f3110ab3927..9c1a5262cade43 100644 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json @@ -1,41 +1,54 @@ { "_args": [ [ - "tunnel-agent@~0.4.1", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "tunnel-agent@~0.4.1", + "scope": null, + "escapedName": "tunnel-agent", + "name": "tunnel-agent", + "rawSpec": "~0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "tunnel-agent@>=0.4.1 <0.5.0", - "_id": "tunnel-agent@0.4.2", + "_id": "tunnel-agent@0.4.3", "_inCache": true, "_installable": true, "_location": "/request/tunnel-agent", - "_nodeVersion": "5.0.0", + "_nodeVersion": "5.9.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/tunnel-agent-0.4.3.tgz_1462396470295_0.23639482469297945" + }, "_npmUser": { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "2.15.3", "_phantomChildren": {}, "_requested": { - "name": "tunnel-agent", "raw": "tunnel-agent@~0.4.1", - "rawSpec": "~0.4.1", "scope": null, + "escapedName": "tunnel-agent", + "name": "tunnel-agent", + "rawSpec": "~0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz", - "_shasum": "1104e3f36ac87125c287270067d582d18133bfee", + "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "_shasum": "6373db76909fe570e08d73583365ed828a74eeeb", "_shrinkwrap": null, "_spec": "tunnel-agent@~0.4.1", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "mikeal.rogers@gmail.com", "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, "bugs": { @@ -46,13 +59,16 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "1104e3f36ac87125c287270067d582d18133bfee", - "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz" + "shasum": "6373db76909fe570e08d73583365ed828a74eeeb", + "tarball": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" }, "engines": { "node": "*" }, - "gitHead": "449634d1054949f9f145f4925985a8dea0f46b0f", + "files": [ + "index.js" + ], + "gitHead": "e72d830f5ed388a2a71d37ce062c38e3fb34bdde", "homepage": "https://github.com/mikeal/tunnel-agent#readme", "license": "Apache-2.0", "main": "index.js", @@ -81,5 +97,5 @@ "url": "git+https://github.com/mikeal/tunnel-agent.git" }, "scripts": {}, - "version": "0.4.2" + "version": "0.4.3" } diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json index 6c9fa0ec836af5..8e1c5b8a118203 100644 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -1,51 +1,63 @@ { "_args": [ [ - "request@latest", + { + "raw": "request@~2.74.0", + "scope": null, + "escapedName": "request", + "name": "request", + "rawSpec": "~2.74.0", + "spec": ">=2.74.0 <2.75.0", + "type": "range" + }, "/Users/rebecca/code/npm" ] ], - "_from": "request@latest", - "_id": "request@2.72.0", + "_from": "request@>=2.74.0 <2.75.0", + "_id": "request@2.74.0", "_inCache": true, "_installable": true, "_location": "/request", - "_nodeVersion": "5.9.0", + "_nodeVersion": "6.2.2", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/request-2.72.0.tgz_1460901215210_0.9173020373564214" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/request-2.74.0.tgz_1469231082306_0.13140005595050752" }, "_npmUser": { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" }, - "_npmVersion": "3.8.5", + "_npmVersion": "2.15.6", "_phantomChildren": { "ansi-regex": "2.0.0", "inherits": "2.0.1", "strip-ansi": "3.0.1" }, "_requested": { - "name": "request", - "raw": "request@latest", - "rawSpec": "latest", + "raw": "request@~2.74.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "request", + "name": "request", + "rawSpec": "~2.74.0", + "spec": ">=2.74.0 <2.75.0", + "type": "range" }, "_requiredBy": [ + "#USER", "/", "/node-gyp", - "/npm-registry-client" + "/npm-registry-client", + "/npm-registry-couchapp/couchapp", + "/npm-registry-couchapp/couchapp/nano" ], - "_resolved": "https://registry.npmjs.org/request/-/request-2.72.0.tgz", - "_shasum": "0ce3a179512620b10441f14c82e21c12c0ddb4e1", + "_resolved": "https://registry.npmjs.org/request/-/request-2.74.0.tgz", + "_shasum": "7693ca768bbb0ea5c8ce08c084a45efa05b892ab", "_shrinkwrap": null, - "_spec": "request@latest", + "_spec": "request@~2.74.0", "_where": "/Users/rebecca/code/npm", "author": { - "email": "mikeal.rogers@gmail.com", - "name": "Mikeal Rogers" + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com" }, "bugs": { "url": "http://github.com/request/request/issues" @@ -58,7 +70,7 @@ "combined-stream": "~1.0.5", "extend": "~3.0.0", "forever-agent": "~0.6.1", - "form-data": "~1.0.0-rc3", + "form-data": "~1.0.0-rc4", "har-validator": "~2.0.6", "hawk": "~3.1.3", "http-signature": "~1.1.0", @@ -68,62 +80,62 @@ "mime-types": "~2.1.7", "node-uuid": "~1.4.7", "oauth-sign": "~0.8.1", - "qs": "~6.1.0", + "qs": "~6.2.0", "stringstream": "~0.0.4", - "tough-cookie": "~2.2.0", + "tough-cookie": "~2.3.0", "tunnel-agent": "~0.4.1" }, "description": "Simplified HTTP request client.", "devDependencies": { "bluebird": "^3.2.1", - "browserify": "^12.0.2", + "browserify": "^13.0.1", "browserify-istanbul": "^2.0.0", "buffer-equal": "^1.0.0", - "codecov.io": "^0.1.6", + "codecov": "^1.0.1", "coveralls": "^2.11.4", "eslint": "^2.5.3", "function-bind": "^1.0.2", "istanbul": "^0.4.0", - "karma": "^0.13.10", + "karma": "^1.1.1", "karma-browserify": "^5.0.1", - "karma-cli": "^0.1.1", - "karma-coverage": "^0.5.3", + "karma-cli": "^1.0.0", + "karma-coverage": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0", - "karma-tap": "^1.0.3", + "karma-tap": "^2.0.1", "phantomjs-prebuilt": "^2.1.3", "rimraf": "^2.2.8", "server-destroy": "^1.0.1", - "tape": "^4.2.0", + "tape": "^4.6.0", "taper": "^0.4.0" }, "directories": {}, "dist": { - "shasum": "0ce3a179512620b10441f14c82e21c12c0ddb4e1", - "tarball": "https://registry.npmjs.org/request/-/request-2.72.0.tgz" + "shasum": "7693ca768bbb0ea5c8ce08c084a45efa05b892ab", + "tarball": "https://registry.npmjs.org/request/-/request-2.74.0.tgz" }, "engines": { "node": ">=0.8.0" }, - "gitHead": "6dcac13642955577592fdafb5ff3cdc8a6ff1b1b", + "gitHead": "76e82351cbc21049441b1763c6f2bbd504fa8f5a", "homepage": "https://github.com/request/request#readme", "license": "Apache-2.0", "main": "index.js", "maintainers": [ { - "email": "mikeal.rogers@gmail.com", - "name": "mikeal" + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, { - "email": "jnylen@gmail.com", - "name": "nylen" + "name": "nylen", + "email": "jnylen@gmail.com" }, { - "email": "fkschott@gmail.com", - "name": "fredkschott" + "name": "fredkschott", + "email": "fkschott@gmail.com" }, { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" } ], "name": "request", @@ -146,5 +158,5 @@ "util", "utility" ], - "version": "2.72.0" + "version": "2.74.0" } diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js index ac2cd8098f1045..8267c125375af4 100644 --- a/deps/npm/node_modules/request/request.js +++ b/deps/npm/node_modules/request/request.js @@ -9,6 +9,7 @@ var http = require('http') , bl = require('bl') , hawk = require('hawk') , aws2 = require('aws-sign2') + , aws4 = require('aws4') , httpSignature = require('http-signature') , mime = require('mime-types') , stringstream = require('stringstream') @@ -70,20 +71,6 @@ function filterOutReservedFunctions(reserved, options) { } -// Function for properly handling a connection error -function connectionErrorHandler(error) { - var socket = this - if (socket.res) { - if (socket.res.request) { - socket.res.request.emit('error', error) - } else { - socket.res.emit('error', error) - } - } else { - socket._httpMessage.emit('error', error) - } -} - // Return a simpler request object to allow serialization function requestToJSON() { var self = this @@ -335,7 +322,7 @@ Request.prototype.init = function (options) { var formData = options.formData var requestForm = self.form() var appendFormValue = function (key, value) { - if (value.hasOwnProperty('value') && value.hasOwnProperty('options')) { + if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { requestForm.append(key, value.value, value.options) } else { requestForm.append(key, value) @@ -804,11 +791,6 @@ Request.prototype.start = function () { self.emit('socket', socket) }) - self.on('end', function() { - if ( self.req.connection ) { - self.req.connection.removeListener('error', connectionErrorHandler) - } - }) self.emit('request', self.req) } @@ -843,11 +825,6 @@ Request.prototype.onRequestResponse = function (response) { debug('response end', self.uri.href, response.statusCode, response.headers) }) - // The check on response.connection is a workaround for browserify. - if (response.connection && response.connection.listeners('error').indexOf(connectionErrorHandler) === -1) { - response.connection.setMaxListeners(0) - response.connection.once('error', connectionErrorHandler) - } if (self._aborted) { debug('aborted', self.uri.href) response.resume() @@ -1266,7 +1243,6 @@ Request.prototype.aws = function (opts, now) { } if (opts.sign_version == 4 || opts.sign_version == '4') { - var aws4 = require('aws4') // use aws4 var options = { host: self.uri.host, diff --git a/deps/npm/node_modules/retry/Readme.md b/deps/npm/node_modules/retry/Readme.md index 26e50a3a7f3c6a..eee05f7bb61537 100644 --- a/deps/npm/node_modules/retry/Readme.md +++ b/deps/npm/node_modules/retry/Readme.md @@ -78,7 +78,7 @@ milliseconds. If `options` is an array, a copy of that array is returned. The formula used to calculate the individual timeouts is: ``` -var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout); +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) ``` Have a look at [this article][article] for a better explanation of approach. @@ -120,11 +120,11 @@ an array of method names which need to be wrapped. ``` retry.wrap(obj) -retry.wrap(obj, ['method1', 'method2']); +retry.wrap(obj, ['method1', 'method2']) -retry.wrap(obj, {retries: 3}); +retry.wrap(obj, {retries: 3}) -retry.wrap(obj, {retries: 3}, ['method1', 'method2']); +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) ``` The `options` object can take any options that the usual call to `retry.operation` can take. @@ -139,7 +139,7 @@ Available options: If `forever` is true, the following changes happen: * `RetryOperation.errors()` will only output an array of one item: the last error. -* `RetryOperation` will repeatedly use the last item in the `timeouts` array. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. #### retryOperation.errors() @@ -181,6 +181,10 @@ has been reached. Otherwise it returns `true`, and retries the operation after the timeout for the current attempt number. +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + #### retryOperation.attempts() Returns an int representing the number of attempts it took to call `fn` before it was successful. @@ -192,6 +196,10 @@ retry is licensed under the MIT license. # Changelog +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + 0.8.0 Implementing retry.wrap. 0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). diff --git a/deps/npm/node_modules/retry/example/dns.js b/deps/npm/node_modules/retry/example/dns.js index d6351e9d05bb33..446729b6f9af6b 100644 --- a/deps/npm/node_modules/retry/example/dns.js +++ b/deps/npm/node_modules/retry/example/dns.js @@ -28,4 +28,4 @@ faultTolerantResolve('nodejs.org', function(err, errors, addresses) { console.warn('addresses:'); console.log(addresses); -}); +}); \ No newline at end of file diff --git a/deps/npm/node_modules/retry/example/stop.js b/deps/npm/node_modules/retry/example/stop.js new file mode 100644 index 00000000000000..e1ceafeebafc51 --- /dev/null +++ b/deps/npm/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/deps/npm/node_modules/retry/lib/retry.js b/deps/npm/node_modules/retry/lib/retry.js index 02ab14729bd8b7..77428cfd0006fa 100644 --- a/deps/npm/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/retry/lib/retry.js @@ -33,6 +33,10 @@ exports.timeouts = function(options) { timeouts.push(this.createTimeout(i, opts)); } + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + // sort the array numerically ascending timeouts.sort(function(a,b) { return a - b; diff --git a/deps/npm/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/retry/lib/retry_operation.js index ad96efbdf3b02d..2b3db8e1776973 100644 --- a/deps/npm/node_modules/retry/lib/retry_operation.js +++ b/deps/npm/node_modules/retry/lib/retry_operation.js @@ -19,6 +19,15 @@ function RetryOperation(timeouts, options) { } module.exports = RetryOperation; +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + RetryOperation.prototype.retry = function(err) { if (this._timeout) { clearTimeout(this._timeout); diff --git a/deps/npm/node_modules/retry/package.json b/deps/npm/node_modules/retry/package.json index 9d2283a3986e54..73a2819edeeab9 100644 --- a/deps/npm/node_modules/retry/package.json +++ b/deps/npm/node_modules/retry/package.json @@ -1,41 +1,54 @@ { "_args": [ [ - "retry@latest", - "/Users/rebecca/code/npm" + { + "raw": "retry@0.10.0", + "scope": null, + "escapedName": "retry", + "name": "retry", + "rawSpec": "0.10.0", + "spec": "0.10.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "retry@latest", - "_id": "retry@0.9.0", + "_from": "retry@0.10.0", + "_id": "retry@0.10.0", "_inCache": true, - "_installable": true, "_location": "/retry", "_nodeVersion": "4.2.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/retry-0.10.0.tgz_1471682099847_0.5031970851123333" + }, "_npmUser": { - "email": "tim@debuggable.com", - "name": "tim-kos" + "name": "tim-kos", + "email": "tim@debuggable.com" }, "_npmVersion": "2.1.7", "_phantomChildren": {}, "_requested": { - "name": "retry", - "raw": "retry@latest", - "rawSpec": "latest", + "raw": "retry@0.10.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "retry", + "name": "retry", + "rawSpec": "0.10.0", + "spec": "0.10.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.9.0.tgz", - "_shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", + "_shasum": "649e15ca408422d98318161935e7f7d652d435dd", "_shrinkwrap": null, - "_spec": "retry@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "retry@0.10.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "tim@debuggable.com", "name": "Tim Koschützki", + "email": "tim@debuggable.com", "url": "http://debuggable.com/" }, "bugs": { @@ -51,13 +64,13 @@ "lib": "./lib" }, "dist": { - "shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", - "tarball": "http://registry.npmjs.org/retry/-/retry-0.9.0.tgz" + "shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "tarball": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz" }, "engines": { "node": "*" }, - "gitHead": "1b621cf499ef7647d005e3650006b93a8dbeb986", + "gitHead": "0616e6a6ebc49b5a36b619c8f7c414ced8c3813b", "homepage": "https://github.com/tim-kos/node-retry", "license": "MIT", "main": "index", @@ -75,5 +88,5 @@ "url": "git://github.com/tim-kos/node-retry.git" }, "scripts": {}, - "version": "0.9.0" + "version": "0.10.0" } diff --git a/deps/npm/node_modules/retry/test/integration/test-forever.js b/deps/npm/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 00000000000000..b41307cb529f12 --- /dev/null +++ b/deps/npm/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js index cecfa3b7310013..916936424f073b 100644 --- a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js +++ b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js @@ -104,3 +104,73 @@ var retry = require(common.dir.lib + '/retry'); fn(); })(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/deps/npm/node_modules/rimraf/package.json b/deps/npm/node_modules/rimraf/package.json index ccc09c5afd7a47..c4043f1eb37ecf 100644 --- a/deps/npm/node_modules/rimraf/package.json +++ b/deps/npm/node_modules/rimraf/package.json @@ -1,53 +1,59 @@ { "_args": [ [ - "rimraf@~2.5.1", + { + "raw": "rimraf@2.5.4", + "scope": null, + "escapedName": "rimraf", + "name": "rimraf", + "rawSpec": "2.5.4", + "spec": "2.5.4", + "type": "version" + }, "/Users/rebecca/code/npm" ] ], - "_from": "rimraf@>=2.5.1 <2.6.0", - "_id": "rimraf@2.5.2", + "_from": "rimraf@2.5.4", + "_id": "rimraf@2.5.4", "_inCache": true, "_installable": true, "_location": "/rimraf", - "_nodeVersion": "5.6.0", + "_nodeVersion": "4.4.4", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/rimraf-2.5.2.tgz_1455346499772_0.9326622514054179" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/rimraf-2.5.4.tgz_1469206941888_0.8645927573088557" }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.7.0", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "rimraf", - "raw": "rimraf@~2.5.1", - "rawSpec": "~2.5.1", + "raw": "rimraf@2.5.4", "scope": null, - "spec": ">=2.5.1 <2.6.0", - "type": "range" + "escapedName": "rimraf", + "name": "rimraf", + "rawSpec": "2.5.4", + "spec": "2.5.4", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/fs-vacuum", "/fstream", "/node-gyp", - "/npm-registry-client", - "/standard/standard-engine/eslint/file-entry-cache/flat-cache/del", - "/tacks", - "/tap/nyc", - "/tap/nyc/spawn-wrap" + "/npm-registry-client" ], - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz", - "_shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "_shasum": "96800093cbf1a0c86bd95b4625467535c29dfa04", "_shrinkwrap": null, - "_spec": "rimraf@~2.5.1", + "_spec": "rimraf@2.5.4", "_where": "/Users/rebecca/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bin": { @@ -57,17 +63,17 @@ "url": "https://github.com/isaacs/rimraf/issues" }, "dependencies": { - "glob": "^7.0.0" + "glob": "^7.0.5" }, "description": "A deep deletion module for node (like `rm -rf`)", "devDependencies": { "mkdirp": "^0.5.1", - "tap": "^5.1.1" + "tap": "^6.1.1" }, "directories": {}, "dist": { - "shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", - "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" + "shasum": "96800093cbf1a0c86bd95b4625467535c29dfa04", + "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz" }, "files": [ "LICENSE", @@ -75,14 +81,14 @@ "bin.js", "rimraf.js" ], - "gitHead": "f414f87021f88d004ac487eebc8d07ce6a152721", + "gitHead": "2af08bbbd0a03549b278414309dc5d8097699443", "homepage": "https://github.com/isaacs/rimraf#readme", "license": "ISC", "main": "rimraf.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "rimraf", @@ -95,5 +101,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "2.5.2" + "version": "2.5.4" } diff --git a/deps/npm/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/rimraf/rimraf.js index c01d13b200cc5e..5d9a5768a454dd 100644 --- a/deps/npm/node_modules/rimraf/rimraf.js +++ b/deps/npm/node_modules/rimraf/rimraf.js @@ -48,9 +48,9 @@ function rimraf (p, options, cb) { assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) @@ -61,7 +61,7 @@ function rimraf (p, options, cb) { if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) - fs.lstat(p, function (er, stat) { + options.lstat(p, function (er, stat) { if (!er) return afterGlob(null, [p]) @@ -135,6 +135,10 @@ function rimraf_ (p, options, cb) { if (er && er.code === "ENOENT") return cb(null) + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + if (st && st.isDirectory()) return rmdir(p, options, er, cb) @@ -269,7 +273,7 @@ function rimrafSync (p, options) { results = [p] } else { try { - fs.lstatSync(p) + options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) @@ -287,6 +291,10 @@ function rimrafSync (p, options) { } catch (er) { if (er.code === "ENOENT") return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) } try { diff --git a/deps/npm/node_modules/semver/.npmignore b/deps/npm/node_modules/semver/.npmignore deleted file mode 100644 index 534108e3f481cf..00000000000000 --- a/deps/npm/node_modules/semver/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -coverage/ -.nyc_output/ -nyc_output/ diff --git a/deps/npm/node_modules/semver/.travis.yml b/deps/npm/node_modules/semver/.travis.yml deleted file mode 100644 index 991d04b6e2272b..00000000000000 --- a/deps/npm/node_modules/semver/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'iojs' diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index 0b14a7e8103b07..cbd956549dbb01 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -4,6 +4,8 @@ semver(1) -- The semantic versioner for npm ## Usage $ npm install semver + $ node + var semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null @@ -16,18 +18,35 @@ As a command-line utility: $ semver -h - Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] - Test if version(s) satisfy the supplied range(s), and sort them. + SemVer 5.1.0 - Multiple versions or ranges may be supplied, unless increment - option is specified. In that case, only a single version may - be used, and it is incremented by the specified level + A JavaScript implementation of the http://semver.org/ specification + Copyright Isaac Z. Schlueter + + Usage: semver [options] [ [...]] + Prints valid versions sorted by SemVer precedence + + Options: + -r --range + Print versions that match the specified range. + + -i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + + --preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + + -l --loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. - If no versions are valid, or ranges are not satisfied, - then exits failure. + If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. @@ -242,7 +261,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? @@ -272,6 +291,8 @@ strings that they parse. same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. @@ -306,6 +327,8 @@ strings that they parse. range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index b1dfe4040c7bac..ae806605aed01c 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,31 +1,44 @@ { "_args": [ [ - "semver@~5.1.0", - "/Users/ogd/Documents/projects/npm/npm" + { + "raw": "semver@5.3.0", + "scope": null, + "escapedName": "semver", + "name": "semver", + "rawSpec": "5.3.0", + "spec": "5.3.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "semver@>=5.1.0 <5.2.0", - "_id": "semver@5.1.0", + "_from": "semver@5.3.0", + "_id": "semver@5.3.0", "_inCache": true, - "_installable": true, "_location": "/semver", - "_nodeVersion": "4.0.0", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/semver-5.3.0.tgz_1468515166602_0.9155273644719273" + }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "semver", - "raw": "semver@~5.1.0", - "rawSpec": "~5.1.0", + "raw": "semver@5.3.0", "scope": null, - "spec": ">=5.1.0 <5.2.0", - "type": "range" + "escapedName": "semver", + "name": "semver", + "rawSpec": "5.3.0", + "spec": "5.3.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/init-package-json", "/node-gyp", @@ -35,11 +48,11 @@ "/npm-registry-client", "/read-installed" ], - "_resolved": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz", - "_shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "_resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "_shasum": "9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f", "_shrinkwrap": null, - "_spec": "semver@~5.1.0", - "_where": "/Users/ogd/Documents/projects/npm/npm", + "_spec": "semver@5.3.0", + "_where": "/Users/zkat/Documents/code/npm", "bin": { "semver": "./bin/semver" }, @@ -53,10 +66,15 @@ }, "directories": {}, "dist": { - "shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", - "tarball": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz" + "shasum": "9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f", + "tarball": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz" }, - "gitHead": "8e33a30e62e40e4983d1c5f55e794331b861aadc", + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "gitHead": "d21444a0658224b152ce54965d02dbe0856afb84", "homepage": "https://github.com/npm/node-semver#readme", "license": "ISC", "main": "semver.js", @@ -80,5 +98,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "5.1.0" + "version": "5.3.0" } diff --git a/deps/npm/node_modules/semver/range.bnf b/deps/npm/node_modules/semver/range.bnf index 000df923a6963f..25ebd5c8325488 100644 --- a/deps/npm/node_modules/semver/range.bnf +++ b/deps/npm/node_modules/semver/range.bnf @@ -6,7 +6,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? diff --git a/deps/npm/node_modules/semver/semver.js b/deps/npm/node_modules/semver/semver.js index 71795f6f0720ae..5f1a3c5c9e5dc9 100644 --- a/deps/npm/node_modules/semver/semver.js +++ b/deps/npm/node_modules/semver/semver.js @@ -314,9 +314,9 @@ function SemVer(version, loose) { else this.prerelease = m[4].split('.').map(function(id) { if (/^[0-9]+$/.test(id)) { - var num = +id + var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) - return num + return num; } return id; }); @@ -836,7 +836,7 @@ function replaceTilde(comp, loose) { else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- + // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); @@ -966,11 +966,11 @@ function replaceXRange(comp, loose) { } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' + gtlt = '<'; if (xm) - M = +M + 1 + M = +M + 1; else - m = +m + 1 + m = +m + 1; } ret = gtlt + M + '.' + m + '.' + p; @@ -1094,6 +1094,15 @@ function maxSatisfying(versions, range, loose) { })[0] || null; } +exports.minSatisfying = minSatisfying; +function minSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return compare(a, b, loose); + })[0] || null; +} + exports.validRange = validRange; function validRange(range, loose) { try { @@ -1186,3 +1195,9 @@ function outside(version, range, hilo, loose) { } return true; } + +exports.prerelease = prerelease; +function prerelease(version, loose) { + var parsed = parse(version, loose); + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; +} diff --git a/deps/npm/node_modules/semver/test/big-numbers.js b/deps/npm/node_modules/semver/test/big-numbers.js deleted file mode 100644 index c051864bc978c2..00000000000000 --- a/deps/npm/node_modules/semver/test/big-numbers.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tap').test -var semver = require('../') - -test('long version is too long', function (t) { - var v = '1.2.' + new Array(256).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('big number is like too long version', function (t) { - var v = '1.2.' + new Array(100).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('parsing null does not throw', function (t) { - t.equal(semver.parse(null), null) - t.equal(semver.parse({}), null) - t.equal(semver.parse(new semver.SemVer('1.2.3')).version, '1.2.3') - t.end() -}) diff --git a/deps/npm/node_modules/semver/test/clean.js b/deps/npm/node_modules/semver/test/clean.js deleted file mode 100644 index 9e268de950ce8c..00000000000000 --- a/deps/npm/node_modules/semver/test/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var clean = semver.clean; - -test('\nclean tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', '1.2.3'], - [' 1.2.3 ', '1.2.3'], - [' 1.2.3-4 ', '1.2.3-4'], - [' 1.2.3-pre ', '1.2.3-pre'], - [' =v1.2.3 ', '1.2.3'], - ['v1.2.3', '1.2.3'], - [' v1.2.3 ', '1.2.3'], - ['\t1.2.3', '1.2.3'], - ['>1.2.3', null], - ['~1.2.3', null], - ['<=1.2.3', null], - ['1.2.x', null] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var msg = 'clean(' + range + ') = ' + version; - t.equal(clean(range), version, msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/gtr.js b/deps/npm/node_modules/semver/test/gtr.js deleted file mode 100644 index bbb87896c64fbb..00000000000000 --- a/deps/npm/node_modules/semver/test/gtr.js +++ /dev/null @@ -1,173 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var gtr = semver.gtr; - -test('\ngtr tests', function(t) { - // [range, version, loose] - // Version should be greater than range - [ - ['~1.2.2', '1.3.0'], - ['~0.6.1-1', '0.7.1-1'], - ['1.0.0 - 2.0.0', '2.0.1'], - ['1.0.0', '1.0.1-beta1'], - ['1.0.0', '2.0.0'], - ['<=2.0.0', '2.1.1'], - ['<=2.0.0', '3.2.9'], - ['<2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '1.2.5'], - ['2.x.x', '3.0.0'], - ['1.2.x', '1.3.0'], - ['1.2.x || 2.x', '3.0.0'], - ['2.*.*', '5.0.1'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '4.0.0'], - ['2', '3.0.0'], - ['2.3', '2.4.2'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.5.5'], - ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.4'], - ['~> 1', '3.2.3'], - ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.1.0'], - ['<1.2', '1.2.0'], - ['< 1.2', '1.2.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-pre', '0.6.0'], - ['~v0.5.4-pre', '0.6.1-pre'], - ['=0.7.x', '0.8.0'], - ['=0.7.x', '0.8.0-asdf'], - ['<0.7.x', '0.7.0'], - ['~1.2.2', '1.3.0'], - ['1.0.0 - 2.0.0', '2.2.3'], - ['1.0.0', '1.0.1'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['2', '3.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['1', '2.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['=0.7.x', '0.8.2'], - ['<0.7.x', '0.7.2'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(gtr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative gtr tests', function(t) { - // [range, version, loose] - // Version should NOT be greater than range - [ - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '0.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['*', 'v1.2.3-foo'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^1', '0.0.0-0'], - ['^3.0.0', '2.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(gtr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/index.js b/deps/npm/node_modules/semver/test/index.js deleted file mode 100644 index 47c3f5f9513103..00000000000000 --- a/deps/npm/node_modules/semver/test/index.js +++ /dev/null @@ -1,698 +0,0 @@ -'use strict'; - -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var eq = semver.eq; -var gt = semver.gt; -var lt = semver.lt; -var neq = semver.neq; -var cmp = semver.cmp; -var gte = semver.gte; -var lte = semver.lte; -var satisfies = semver.satisfies; -var validRange = semver.validRange; -var inc = semver.inc; -var diff = semver.diff; -var replaceStars = semver.replaceStars; -var toComparators = semver.toComparators; -var SemVer = semver.SemVer; -var Range = semver.Range; - -test('\ncomparison tests', function(t) { - // [version1, version2] - // version1 should be greater than version2 - [['0.0.0', '0.0.0-foo'], - ['0.0.1', '0.0.0'], - ['1.0.0', '0.9.9'], - ['0.10.0', '0.9.0'], - ['0.99.0', '0.10.0'], - ['2.0.0', '1.2.3'], - ['v0.0.0', '0.0.0-foo', true], - ['v0.0.1', '0.0.0', true], - ['v1.0.0', '0.9.9', true], - ['v0.10.0', '0.9.0', true], - ['v0.99.0', '0.10.0', true], - ['v2.0.0', '1.2.3', true], - ['0.0.0', 'v0.0.0-foo', true], - ['0.0.1', 'v0.0.0', true], - ['1.0.0', 'v0.9.9', true], - ['0.10.0', 'v0.9.0', true], - ['0.99.0', 'v0.10.0', true], - ['2.0.0', 'v1.2.3', true], - ['1.2.3', '1.2.3-asdf'], - ['1.2.3', '1.2.3-4'], - ['1.2.3', '1.2.3-4-foo'], - ['1.2.3-5-foo', '1.2.3-5'], - ['1.2.3-5', '1.2.3-4'], - ['1.2.3-5-foo', '1.2.3-5-Foo'], - ['3.0.0', '2.7.2+asdf'], - ['1.2.3-a.10', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a'], - ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'], - ['1.2.3-r2', '1.2.3-r100'], - ['1.2.3-r100', '1.2.3-R2'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); - t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); - t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); - t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); - t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); - t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); - t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); - t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); - }); - t.end(); -}); - -test('\nequality tests', function(t) { - // [version1, version2] - // version1 should be equivalent to version2 - [['1.2.3', 'v1.2.3', true], - ['1.2.3', '=1.2.3', true], - ['1.2.3', 'v 1.2.3', true], - ['1.2.3', '= 1.2.3', true], - ['1.2.3', ' v1.2.3', true], - ['1.2.3', ' =1.2.3', true], - ['1.2.3', ' v 1.2.3', true], - ['1.2.3', ' = 1.2.3', true], - ['1.2.3-0', 'v1.2.3-0', true], - ['1.2.3-0', '=1.2.3-0', true], - ['1.2.3-0', 'v 1.2.3-0', true], - ['1.2.3-0', '= 1.2.3-0', true], - ['1.2.3-0', ' v1.2.3-0', true], - ['1.2.3-0', ' =1.2.3-0', true], - ['1.2.3-0', ' v 1.2.3-0', true], - ['1.2.3-0', ' = 1.2.3-0', true], - ['1.2.3-1', 'v1.2.3-1', true], - ['1.2.3-1', '=1.2.3-1', true], - ['1.2.3-1', 'v 1.2.3-1', true], - ['1.2.3-1', '= 1.2.3-1', true], - ['1.2.3-1', ' v1.2.3-1', true], - ['1.2.3-1', ' =1.2.3-1', true], - ['1.2.3-1', ' v 1.2.3-1', true], - ['1.2.3-1', ' = 1.2.3-1', true], - ['1.2.3-beta', 'v1.2.3-beta', true], - ['1.2.3-beta', '=1.2.3-beta', true], - ['1.2.3-beta', 'v 1.2.3-beta', true], - ['1.2.3-beta', '= 1.2.3-beta', true], - ['1.2.3-beta', ' v1.2.3-beta', true], - ['1.2.3-beta', ' =1.2.3-beta', true], - ['1.2.3-beta', ' v 1.2.3-beta', true], - ['1.2.3-beta', ' = 1.2.3-beta', true], - ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], - ['1.2.3+build', ' = 1.2.3+otherbuild', true], - ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], - ['1.2.3+build', '1.2.3+otherbuild'], - [' v1.2.3+build', '1.2.3+otherbuild'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); - t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); - t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); - t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); - t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); - t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); - t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); - }); - t.end(); -}); - - -test('\nrange tests', function(t) { - // [range, version] - // version should be included by range - [['1.0.0 - 2.0.0', '1.2.3'], - ['^1.2.3+build', '1.2.3'], - ['^1.2.3+build', '1.3.0'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], - ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0'], - ['*', '1.2.3'], - ['*', 'v1.2.3', true], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97', true], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, - ['~ 1.0', '1.0.2'], - ['~ 1.0.3', '1.0.12'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['<=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['~1.2.1 >=1.2.3', '1.2.3'], - ['~1.2.1 =1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], - ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['>=1.2.1 1.2.3', '1.2.3'], - ['1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.1 >=1.2.3', '1.2.3'], - ['>=1.2', '1.2.8'], - ['^1.2.3', '1.8.1'], - ['^0.1.2', '0.1.2'], - ['^0.1', '0.1.2'], - ['^1.2', '1.4.2'], - ['^1.2 ^1', '1.4.2'], - ['^1.2.3-alpha', '1.2.3-pre'], - ['^1.2.0-alpha', '1.2.0-pre'], - ['^0.0.1-alpha', '0.0.1-beta'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); - }); - t.end(); -}); - -test('\nnegative range tests', function(t) { - // [range, version] - // version should not be included by range - [['1.0.0 - 2.0.0', '2.2.3'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], - ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], - ['^1.2.3+build', '2.0.0'], - ['^1.2.3+build', '1.2.0'], - ['^1.2.3', '1.2.3-pre'], - ['^1.2', '1.2.0-pre'], - ['>1.2', '1.3.0-beta'], - ['<=1.2.3', '1.2.3-beta'], - ['^1.2.3', '1.2.3-beta'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['1.0.0', '1.0.1'], - ['>=1.0.0', '0.0.0'], - ['>=1.0.0', '0.0.1'], - ['>=1.0.0', '0.1.0'], - ['>1.0.0', '0.0.1'], - ['>1.0.0', '0.1.0'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['>=0.1.97', 'v0.1.93', true], - ['>=0.1.97', '0.1.93'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['>=0.2.3 || <0.0.1', '0.0.3'], - ['>=0.2.3 || <0.0.1', '0.2.2'], - ['2.x.x', '1.1.3'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.9'], - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['>=1.2', '1.1.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-beta', '0.5.4-alpha'], - ['=0.7.x', '0.8.2'], - ['>=0.7.x', '0.6.2'], - ['<0.7.x', '0.7.2'], - ['<1.2.3', '1.2.3-beta'], - ['=1.2.3', '1.2.3-beta'], - ['>1.2', '1.2.8'], - ['^1.2.3', '2.0.0-alpha'], - ['^1.2.3', '1.2.2'], - ['^1.2', '1.1.9'], - ['*', 'v1.2.3-foo', true], - // invalid ranges never satisfied! - ['blerg', '1.2.3'], - ['git+https://user:password0123@github.com/foo', '123.0.0', true], - ['^1.2.3', '2.0.0-pre'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - var found = satisfies(ver, range, loose); - t.ok(!found, ver + ' not satisfied by ' + range); - }); - t.end(); -}); - -test('\nincrement versions test', function(t) { -// [version, inc, result, identifier] -// inc(version, inc) -> result - [['1.2.3', 'major', '2.0.0'], - ['1.2.3', 'minor', '1.3.0'], - ['1.2.3', 'patch', '1.2.4'], - ['1.2.3tag', 'major', '2.0.0', true], - ['1.2.3-tag', 'major', '2.0.0'], - ['1.2.3', 'fake', null], - ['1.2.0-0', 'patch', '1.2.0'], - ['fake', 'major', null], - ['1.2.3-4', 'major', '2.0.0'], - ['1.2.3-4', 'minor', '1.3.0'], - ['1.2.3-4', 'patch', '1.2.3'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], - ['1.2.4', 'prerelease', '1.2.5-0'], - ['1.2.3-0', 'prerelease', '1.2.3-1'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], - ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], - ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], - ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], - ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], - ['1.2.0', 'prepatch', '1.2.1-0'], - ['1.2.0-1', 'prepatch', '1.2.1-0'], - ['1.2.0', 'preminor', '1.3.0-0'], - ['1.2.3-1', 'preminor', '1.3.0-0'], - ['1.2.0', 'premajor', '2.0.0-0'], - ['1.2.3-1', 'premajor', '2.0.0-0'], - ['1.2.0-1', 'minor', '1.2.0'], - ['1.0.0-1', 'major', '1.0.0'], - - ['1.2.3', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'minor', '1.3.0', false, 'dev'], - ['1.2.3', 'patch', '1.2.4', false, 'dev'], - ['1.2.3tag', 'major', '2.0.0', true, 'dev'], - ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'fake', null, false, 'dev'], - ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], - ['fake', 'major', null, false, 'dev'], - ['1.2.3-4', 'major', '2.0.0', false, 'dev'], - ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], - ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], - ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], - ['1.2.0', 'prepatch', '1.2.1-dev.0', false, 'dev'], - ['1.2.0-1', 'prepatch', '1.2.1-dev.0', false, 'dev'], - ['1.2.0', 'preminor', '1.3.0-dev.0', false, 'dev'], - ['1.2.3-1', 'preminor', '1.3.0-dev.0', false, 'dev'], - ['1.2.0', 'premajor', '2.0.0-dev.0', false, 'dev'], - ['1.2.3-1', 'premajor', '2.0.0-dev.0', false, 'dev'], - ['1.2.0-1', 'minor', '1.2.0', false, 'dev'], - ['1.0.0-1', 'major', '1.0.0', false, 'dev'], - ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] - - ].forEach(function(v) { - var pre = v[0]; - var what = v[1]; - var wanted = v[2]; - var loose = v[3]; - var id = v[4]; - var found = inc(pre, what, loose, id); - var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - - var parsed = semver.parse(pre, loose); - if (wanted) { - parsed.inc(what, id); - t.equal(parsed.version, wanted, cmd + ' object version updated'); - t.equal(parsed.raw, wanted, cmd + ' object raw field updated'); - } else if (parsed) { - t.throws(function () { - parsed.inc(what, id) - }) - } else { - t.equal(parsed, null) - } - }); - - t.end(); -}); - -test('\ndiff versions test', function(t) { -// [version1, version2, result] -// diff(version1, version2) -> result - [['1.2.3', '0.2.3', 'major'], - ['1.4.5', '0.2.3', 'major'], - ['1.2.3', '2.0.0-pre', 'premajor'], - ['1.2.3', '1.3.3', 'minor'], - ['1.0.1', '1.1.0-pre', 'preminor'], - ['1.2.3', '1.2.4', 'patch'], - ['1.2.3', '1.2.4-pre', 'prepatch'], - ['0.0.1', '0.0.1-pre', 'prerelease'], - ['0.0.1', '0.0.1-pre-2', 'prerelease'], - ['1.1.0', '1.1.0-pre', 'prerelease'], - ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], - ['1.0.0', '1.0.0', null] - - ].forEach(function(v) { - var version1 = v[0]; - var version2 = v[1]; - var wanted = v[2]; - var found = diff(version1, version2); - var cmd = 'diff(' + version1 + ', ' + version2 + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - }); - - t.end(); -}); - -test('\nvalid range test', function(t) { - // [range, result] - // validRange(range) -> result - // translate ranges into their canonical form - [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], - ['1.0.0', '1.0.0'], - ['>=*', '*'], - ['', '*'], - ['*', '*'], - ['*', '*'], - ['>=1.0.0', '>=1.0.0'], - ['>1.0.0', '>1.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['1', '>=1.0.0 <2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<2.0.0', '<2.0.0'], - ['<2.0.0', '<2.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['>=0.1.97', '>=0.1.97'], - ['>=0.1.97', '>=0.1.97'], - ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['||', '||'], - ['2.x.x', '>=2.0.0 <3.0.0'], - ['1.2.x', '>=1.2.0 <1.3.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['x', '*'], - ['2.*.*', '>=2.0.0 <3.0.0'], - ['1.2.*', '>=1.2.0 <1.3.0'], - ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['*', '*'], - ['2', '>=2.0.0 <3.0.0'], - ['2.3', '>=2.3.0 <2.4.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~>3.2.1', '>=3.2.1 <3.3.0'], - ['~1', '>=1.0.0 <2.0.0'], - ['~>1', '>=1.0.0 <2.0.0'], - ['~> 1', '>=1.0.0 <2.0.0'], - ['~1.0', '>=1.0.0 <1.1.0'], - ['~ 1.0', '>=1.0.0 <1.1.0'], - ['^0', '>=0.0.0 <1.0.0'], - ['^ 1', '>=1.0.0 <2.0.0'], - ['^0.1', '>=0.1.0 <0.2.0'], - ['^1.0', '>=1.0.0 <2.0.0'], - ['^1.2', '>=1.2.0 <2.0.0'], - ['^0.0.1', '>=0.0.1 <0.0.2'], - ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], - ['^0.1.2', '>=0.1.2 <0.2.0'], - ['^1.2.3', '>=1.2.3 <2.0.0'], - ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], - ['<1', '<1.0.0'], - ['< 1', '<1.0.0'], - ['>=1', '>=1.0.0'], - ['>= 1', '>=1.0.0'], - ['<1.2', '<1.2.0'], - ['< 1.2', '<1.2.0'], - ['1', '>=1.0.0 <2.0.0'], - ['>01.02.03', '>1.2.3', true], - ['>01.02.03', null], - ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], - ['~1.2.3beta', null], - ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var loose = v[2]; - var found = validRange(pre, loose); - - t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); - }); - - t.end(); -}); - -test('\ncomparators test', function(t) { - // [range, comparators] - // turn range into a set of individual comparators - [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], - ['1.0.0', [['1.0.0']]], - ['>=*', [['']]], - ['', [['']]], - ['*', [['']]], - ['*', [['']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['< 2.0.0', [['<2.0.0']]], - ['<\t2.0.0', [['<2.0.0']]], - ['>=0.1.97', [['>=0.1.97']]], - ['>=0.1.97', [['>=0.1.97']]], - ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['||', [[''], ['']]], - ['2.x.x', [['>=2.0.0', '<3.0.0']]], - ['1.2.x', [['>=1.2.0', '<1.3.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['x', [['']]], - ['2.*.*', [['>=2.0.0', '<3.0.0']]], - ['1.2.*', [['>=1.2.0', '<1.3.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['*', [['']]], - ['2', [['>=2.0.0', '<3.0.0']]], - ['2.3', [['>=2.3.0', '<2.4.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], - ['~1', [['>=1.0.0', '<2.0.0']]], - ['~>1', [['>=1.0.0', '<2.0.0']]], - ['~> 1', [['>=1.0.0', '<2.0.0']]], - ['~1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['<1', [['<1.0.0']]], - ['< 1', [['<1.0.0']]], - ['>=1', [['>=1.0.0']]], - ['>= 1', [['>=1.0.0']]], - ['<1.2', [['<1.2.0']]], - ['< 1.2', [['<1.2.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], - ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], - ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], - ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], - ['>*', [['<0.0.0']]], - ['<*', [['<0.0.0']]] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var found = toComparators(v[0]); - var jw = JSON.stringify(wanted); - t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); - }); - - t.end(); -}); - -test('\ninvalid version numbers', function(t) { - ['1.2.3.4', - 'NOT VALID', - 1.2, - null, - 'Infinity.NaN.Infinity' - ].forEach(function(v) { - t.throws(function() { - new SemVer(v); - }, {name:'TypeError', message:'Invalid Version: ' + v}); - }); - - t.end(); -}); - -test('\nstrict vs loose version numbers', function(t) { - [['=1.2.3', '1.2.3'], - ['01.02.03', '1.2.3'], - ['1.2.3-beta.01', '1.2.3-beta.1'], - [' =1.2.3', '1.2.3'], - ['1.2.3foo', '1.2.3-foo'] - ].forEach(function(v) { - var loose = v[0]; - var strict = v[1]; - t.throws(function() { - new SemVer(loose); - }); - var lv = new SemVer(loose, true); - t.equal(lv.version, strict); - t.ok(eq(loose, strict, true)); - t.throws(function() { - eq(loose, strict); - }); - t.throws(function() { - new SemVer(strict).compare(loose); - }); - }); - t.end(); -}); - -test('\nstrict vs loose ranges', function(t) { - [['>=01.02.03', '>=1.2.3'], - ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] - ].forEach(function(v) { - var loose = v[0]; - var comps = v[1]; - t.throws(function() { - new Range(loose); - }); - t.equal(new Range(loose, true).range, comps); - }); - t.end(); -}); - -test('\nmax satisfying', function(t) { - [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], - [['1.2.4', '1.2.3'], '1.2', '1.2.4'], - [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], - [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] - ].forEach(function(v) { - var versions = v[0]; - var range = v[1]; - var expect = v[2]; - var loose = v[3]; - var actual = semver.maxSatisfying(versions, range, loose); - t.equal(actual, expect); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/ltr.js b/deps/npm/node_modules/semver/test/ltr.js deleted file mode 100644 index 0f7167d6589258..00000000000000 --- a/deps/npm/node_modules/semver/test/ltr.js +++ /dev/null @@ -1,181 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var ltr = semver.ltr; - -test('\nltr tests', function(t) { - // [range, version, loose] - // Version should be less than range - [ - ['~1.2.2', '1.2.1'], - ['~0.6.1-1', '0.6.1-0'], - ['1.0.0 - 2.0.0', '0.0.1'], - ['1.0.0-beta.2', '1.0.0-beta.1'], - ['1.0.0', '0.0.0'], - ['>=2.0.0', '1.1.1'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '0.1.5'], - ['2.x.x', '1.0.0'], - ['1.2.x', '1.1.0'], - ['1.2.x || 2.x', '1.0.0'], - ['2.*.*', '1.0.1'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.9999'], - ['2', '1.0.0'], - ['2.3', '2.2.2'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.5'], - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.4'], - ['~> 1', '0.2.3'], - ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '0.1.0'], - ['>1.2', '1.2.0'], - ['> 1.2', '1.2.1'], - ['1', '0.0.0beta', true], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['=0.7.x', '0.6.0'], - ['=0.7.x', '0.6.0-asdf'], - ['>=0.7.x', '0.6.0'], - ['~1.2.2', '1.2.1'], - ['1.0.0 - 2.0.0', '0.2.3'], - ['1.0.0', '0.0.1'], - ['>=2.0.0', '1.0.0'], - ['>=2.0.0', '1.9999.9999'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['>2.0.0', '1.2.9'], - ['2.x.x', '1.1.3'], - ['1.2.x', '1.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.9999.9999'], - ['2.3', '2.2.1'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.3'], - ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0 - ['>1', '1.0.0'], - ['2', '1.0.0beta', true], - ['>1', '1.0.0beta', true], - ['> 1', '1.0.0beta', true], - ['=0.7.x', '0.6.2'], - ['=0.7.x', '0.7.0-asdf'], - ['^1', '1.0.0-0'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['>=0.7.x', '0.6.2'], - ['>1.2.3', '1.3.0-alpha'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(ltr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative ltr tests', function(t) { - // [range, version, loose] - // Version should NOT be less than range - [ - ['~ 1.0', '1.1.0'], - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '2.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^3.0.0', '4.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], - ['^1.0.0alpha', '1.0.0beta', true], - ['~1.0.0alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0beta', true], - ['~1.0.0-alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0-beta'], - ['~1.0.0-alpha', '1.0.0-beta'], - ['=0.1.0', '1.0.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(ltr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/major-minor-patch.js b/deps/npm/node_modules/semver/test/major-minor-patch.js deleted file mode 100644 index e9d4039c8be629..00000000000000 --- a/deps/npm/node_modules/semver/test/major-minor-patch.js +++ /dev/null @@ -1,72 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); - -test('\nmajor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', 1], - [' 1.2.3 ', 1], - [' 2.2.3-4 ', 2], - [' 3.2.3-pre ', 3], - ['v5.2.3', 5], - [' v8.2.3 ', 8], - ['\t13.2.3', 13], - ['=21.2.3', 21, true], - ['v=34.2.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'major(' + range + ') = ' + version; - t.equal(semver.major(range, loose), version, msg); - }); - t.end(); -}); - -test('\nminor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.1.3', 1], - [' 1.1.3 ', 1], - [' 1.2.3-4 ', 2], - [' 1.3.3-pre ', 3], - ['v1.5.3', 5], - [' v1.8.3 ', 8], - ['\t1.13.3', 13], - ['=1.21.3', 21, true], - ['v=1.34.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'minor(' + range + ') = ' + version; - t.equal(semver.minor(range, loose), version, msg); - }); - t.end(); -}); - -test('\npatch tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.1', 1], - [' 1.2.1 ', 1], - [' 1.2.2-4 ', 2], - [' 1.2.3-pre ', 3], - ['v1.2.5', 5], - [' v1.2.8 ', 8], - ['\t1.2.13', 13], - ['=1.2.21', 21, true], - ['v=1.2.34', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'patch(' + range + ') = ' + version; - t.equal(semver.patch(range, loose), version, msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/tar/lib/entry.js b/deps/npm/node_modules/tar/lib/entry.js index 5f5dd3c2688a8b..591202bd3b9af4 100644 --- a/deps/npm/node_modules/tar/lib/entry.js +++ b/deps/npm/node_modules/tar/lib/entry.js @@ -210,7 +210,7 @@ Entry.prototype._setProps = function () { this._remaining = props.size } -// the parser may not call write if _abort is true. +// the parser may not call write if _abort is true. // useful for skipping data from some files quickly. Entry.prototype.abort = function(){ this._abort = true diff --git a/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js index b0f5d82546823e..c6db79a43d91d7 100644 --- a/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js +++ b/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js @@ -10,10 +10,10 @@ stack = new Buffer( tsize ); for ( ; i < tsize; i++) stack[i] = "x".charCodeAt(0); isize = 1 * 1024; // <- initial packet size with 4K no bug! -fsize = 2 * 1024 ; // <- first block-stream size +fsize = 2 * 1024 ; // <- first block-stream size psize = Math.ceil( isize / 6 ); // <- second block-stream size -fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first +fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first pexpected = Math.ceil( tsize / psize ); // <- packets expected for second diff --git a/deps/npm/node_modules/tar/test/parse-discard.js b/deps/npm/node_modules/tar/test/parse-discard.js index 79408c274b96e9..da01a65ccc7d7d 100644 --- a/deps/npm/node_modules/tar/test/parse-discard.js +++ b/deps/npm/node_modules/tar/test/parse-discard.js @@ -20,10 +20,10 @@ tap.test("parser test", function (t) { .pipe(parser) .on('entry',function(entry){ if(entry.path === 'c.txt') entry.abort() - + total += entry.size; entry.on('data',function(data){ - dataTotal += data.length + dataTotal += data.length }) }) }) diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md index 08f7a7b48fcd24..52de4277db20a0 100644 --- a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md @@ -17,3 +17,4 @@ hex. If *str* is not passed in, it will be 4 bytes coverted into 8 hex characters, generated by `crypto.pseudoRandomBytes`. + diff --git a/deps/npm/node_modules/validate-npm-package-license/LICENSE b/deps/npm/node_modules/validate-npm-package-license/LICENSE index 17de51c642a7da..a5e905d5521799 100644 --- a/deps/npm/node_modules/validate-npm-package-license/LICENSE +++ b/deps/npm/node_modules/validate-npm-package-license/LICENSE @@ -10,165 +10,165 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. -"License" shall mean the terms and conditions for use, reproduction, and +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. -"Licensor" shall mean the copyright owner or entity authorized by the +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. -"Legal Entity" shall mean the union of the acting entity and all other -entities that control, are controlled by, or are under common control -with that entity. For the purposes of this definition, "control" means -(i) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (ii) ownership of -fifty percent (50%) or more of the outstanding shares, or (iii) +"Legal Entity" shall mean the union of the acting entity and all other +entities that control, are controlled by, or are under common control +with that entity. For the purposes of this definition, "control" means +(i) the power, direct or indirect, to cause the direction or management +of such entity, whether by contract or otherwise, or (ii) ownership of +fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. -"You" (or "Your") shall mean an individual or Legal Entity exercising +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation source, +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, and configuration files. -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but not -limited to compiled object code, generated documentation, and +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but not +limited to compiled object code, generated documentation, and conversions to other media types. -"Work" shall mean the work of authorship, whether in Source or Object -form, made available under the License, as indicated by a copyright -notice that is included in or attached to the work (an example is +"Work" shall mean the work of authorship, whether in Source or Object +form, made available under the License, as indicated by a copyright +notice that is included in or attached to the work (an example is provided in the Appendix below). -"Derivative Works" shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. -"Contribution" shall mean any work of authorship, including the original -version of the Work and any modifications or additions to that Work or -Derivative Works thereof, that is intentionally submitted to Licensor -for inclusion in the Work by the copyright owner or by an individual or -Legal Entity authorized to submit on behalf of the copyright owner. For -the purposes of this definition, "submitted" means any form of -electronic, verbal, or written communication sent to the Licensor or its -representatives, including but not limited to communication on -electronic mailing lists, source code control systems, and issue -tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding -communication that is conspicuously marked or otherwise designated in +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor +for inclusion in the Work by the copyright owner or by an individual or +Legal Entity authorized to submit on behalf of the copyright owner. For +the purposes of this definition, "submitted" means any form of +electronic, verbal, or written communication sent to the Licensor or its +representatives, including but not limited to communication on +electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." -"Contributor" shall mean Licensor and any individual or Legal Entity on -behalf of whom a Contribution has been received by Licensor and +"Contributor" shall mean Licensor and any individual or Legal Entity on +behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. -2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright -license to reproduce, prepare Derivative Works of, publicly display, -publicly perform, sublicense, and distribute the Work and such +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright +license to reproduce, prepare Derivative Works of, publicly display, +publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. -3. Grant of Patent License. Subject to the terms and conditions of this -License, each Contributor hereby grants to You a perpetual, worldwide, -non-exclusive, no-charge, royalty-free, irrevocable (except as stated in -this section) patent license to make, have made, use, offer to sell, -sell, import, and otherwise transfer the Work, where such license -applies only to those patent claims licensable by such Contributor that -are necessarily infringed by their Contribution(s) alone or by -combination of their Contribution(s) with the Work to which such -Contribution(s) was submitted. If You institute patent litigation -against any entity (including a cross-claim or counterclaim in a -lawsuit) alleging that the Work or a Contribution incorporated within -the Work constitutes direct or contributory patent infringement, then -any patent licenses granted to You under this License for that Work +3. Grant of Patent License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable (except as stated in +this section) patent license to make, have made, use, offer to sell, +sell, import, and otherwise transfer the Work, where such license +applies only to those patent claims licensable by such Contributor that +are necessarily infringed by their Contribution(s) alone or by +combination of their Contribution(s) with the Work to which such +Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim in a +lawsuit) alleging that the Work or a Contribution incorporated within +the Work constitutes direct or contributory patent infringement, then +any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. -4. Redistribution. You may reproduce and distribute copies of the Work -or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You meet the +4. Redistribution. You may reproduce and distribute copies of the Work +or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You meet the following conditions: -(a) You must give any other recipients of the Work or Derivative Works a +(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and -(b) You must cause any modified files to carry prominent notices stating +(b) You must cause any modified files to carry prominent notices stating that You changed the files; and -(c) You must retain, in the Source form of any Derivative Works that You -distribute, all copyright, patent, trademark, and attribution notices -from the Source form of the Work, excluding those notices that do not +(c) You must retain, in the Source form of any Derivative Works that You +distribute, all copyright, patent, trademark, and attribution notices +from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -(d) If the Work includes a "NOTICE" text file as part of its -distribution, then any Derivative Works that You distribute must include -a readable copy of the attribution notices contained within such NOTICE -file, excluding those notices that do not pertain to any part of the -Derivative Works, in at least one of the following places: within a -NOTICE text file distributed as part of the Derivative Works; within the -Source form or documentation, if provided along with the Derivative -Works; or, within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents of the -NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative -Works that You distribute, alongside or as an addendum to the NOTICE -text from the Work, provided that such additional attribution notices +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must include +a readable copy of the attribution notices contained within such NOTICE +file, excluding those notices that do not pertain to any part of the +Derivative Works, in at least one of the following places: within a +NOTICE text file distributed as part of the Derivative Works; within the +Source form or documentation, if provided along with the Derivative +Works; or, within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents of the +NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative +Works that You distribute, alongside or as an addendum to the NOTICE +text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. -You may add Your own copyright statement to Your modifications and may -provide additional or different license terms and conditions for use, -reproduction, or distribution of Your modifications, or for any such -Derivative Works as a whole, provided Your use, reproduction, and -distribution of the Work otherwise complies with the conditions stated +You may add Your own copyright statement to Your modifications and may +provide additional or different license terms and conditions for use, +reproduction, or distribution of Your modifications, or for any such +Derivative Works as a whole, provided Your use, reproduction, and +distribution of the Work otherwise complies with the conditions stated in this License. -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work by -You to the Licensor shall be under the terms and conditions of this -License, without any additional terms or conditions. Notwithstanding the -above, nothing herein shall supersede or modify the terms of any -separate license agreement you may have executed with Licensor regarding +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work by +You to the Licensor shall be under the terms and conditions of this +License, without any additional terms or conditions. Notwithstanding the +above, nothing herein shall supersede or modify the terms of any +separate license agreement you may have executed with Licensor regarding such Contributions. -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. -7. Disclaimer of Warranty. Unless required by applicable law or agreed -to in writing, Licensor provides the Work (and each Contributor provides -its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS -OF ANY KIND, either express or implied, including, without limitation, -any warranties or conditions of TITLE, NON-INFRINGEMENT, -MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely -responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your +7. Disclaimer of Warranty. Unless required by applicable law or agreed +to in writing, Licensor provides the Work (and each Contributor provides +its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, either express or implied, including, without limitation, +any warranties or conditions of TITLE, NON-INFRINGEMENT, +MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of permissions under this License. -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, unless -required by applicable law (such as deliberate and grossly negligent -acts) or agreed to in writing, shall any Contributor be liable to You -for damages, including any direct, indirect, special, incidental, or -consequential damages of any character arising as a result of this -License or out of the use or inability to use the Work (including but -not limited to damages for loss of goodwill, work stoppage, computer -failure or malfunction, or any and all other commercial damages or -losses), even if such Contributor has been advised of the possibility of +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, unless +required by applicable law (such as deliberate and grossly negligent +acts) or agreed to in writing, shall any Contributor be liable to You +for damages, including any direct, indirect, special, incidental, or +consequential damages of any character arising as a result of this +License or out of the use or inability to use the Work (including but +not limited to damages for loss of goodwill, work stoppage, computer +failure or malfunction, or any and all other commercial damages or +losses), even if such Contributor has been advised of the possibility of such damages. -9. Accepting Warranty or Additional Liability. While redistributing the -Work or Derivative Works thereof, You may choose to offer, and charge a -fee for, acceptance of support, warranty, indemnity, or other liability -obligations and/or rights consistent with this License. However, in -accepting such obligations, You may act only on Your own behalf and on -Your sole responsibility, not on behalf of any other Contributor, and -only if You agree to indemnify, defend, and hold each Contributor -harmless for any liability incurred by, or claims asserted against, such -Contributor by reason of your accepting any such warranty or additional +9. Accepting Warranty or Additional Liability. While redistributing the +Work or Derivative Works thereof, You may choose to offer, and charge a +fee for, acceptance of support, warranty, indemnity, or other liability +obligations and/or rights consistent with this License. However, in +accepting such obligations, You may act only on Your own behalf and on +Your sole responsibility, not on behalf of any other Contributor, and +only if You agree to indemnify, defend, and hold each Contributor +harmless for any liability incurred by, or claims asserted against, such +Contributor by reason of your accepting any such warranty or additional liability. diff --git a/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md b/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md index e9837a5068ae0e..0eb45c420775eb 100644 --- a/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md +++ b/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md @@ -1,10 +1,10 @@ -0.0.7 / 2014-09-01 +0.0.7 / 2014-09-01 ================== * update .repository -0.0.6 / 2014-09-01 +0.0.6 / 2014-09-01 ================== * add travis @@ -22,17 +22,17 @@ * add timers -0.0.3 / 2014-02-22 +0.0.3 / 2014-02-22 ================== * add buffer -0.0.2 / 2014-02-11 +0.0.2 / 2014-02-11 ================== * add assert -0.0.1 / 2014-02-11 +0.0.1 / 2014-02-11 ================== * add main diff --git a/deps/npm/node_modules/which/CHANGELOG.md b/deps/npm/node_modules/which/CHANGELOG.md index 56106119e9a645..f2c6e4fd39de14 100644 --- a/deps/npm/node_modules/which/CHANGELOG.md +++ b/deps/npm/node_modules/which/CHANGELOG.md @@ -1,6 +1,10 @@ # Changes +## v1.2.11 + +* Prevent changelog script from being included in package + ## v1.2.10 * Use env.PATH only, not env.Path diff --git a/deps/npm/node_modules/which/changelog.sh b/deps/npm/node_modules/which/changelog.sh deleted file mode 100644 index 360e54af40f6af..00000000000000 --- a/deps/npm/node_modules/which/changelog.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -( - echo '# Changes' - echo '' - git log --first-parent --pretty=format:'%s' \ - | grep -v '^update changelog' \ - | perl -p -e 's/^((v?[0-9]+\.?)+)$/\n## \1\n/g' \ - | perl -p -e 's/^([^#\s].*)$/* \1/g' -)> CHANGELOG.md diff --git a/deps/npm/node_modules/which/package.json b/deps/npm/node_modules/which/package.json index 27071d747a9d0d..dcdb66c9ebc3d1 100644 --- a/deps/npm/node_modules/which/package.json +++ b/deps/npm/node_modules/which/package.json @@ -2,41 +2,40 @@ "_args": [ [ { - "raw": "which@latest", + "raw": "which@1.2.11", "scope": null, "escapedName": "which", "name": "which", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "1.2.11", + "spec": "1.2.11", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "which@latest", - "_id": "which@1.2.10", + "_from": "which@1.2.11", + "_id": "which@1.2.11", "_inCache": true, - "_installable": true, "_location": "/which", - "_nodeVersion": "4.4.4", + "_nodeVersion": "6.5.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/which-1.2.10.tgz_1465116744337_0.4818702598568052" + "tmp": "tmp/which-1.2.11.tgz_1473093398489_0.1032072464004159" }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "3.9.1", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "raw": "which@latest", + "raw": "which@1.2.11", "scope": null, "escapedName": "which", "name": "which", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "1.2.11", + "spec": "1.2.11", + "type": "version" }, "_requiredBy": [ "#USER", @@ -44,11 +43,11 @@ "/node-gyp", "/tap/foreground-child/cross-spawn" ], - "_resolved": "https://registry.npmjs.org/which/-/which-1.2.10.tgz", - "_shasum": "91cd9bd0751322411b659b40f054b21de957ab2d", + "_resolved": "https://registry.npmjs.org/which/-/which-1.2.11.tgz", + "_shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b", "_shrinkwrap": null, - "_spec": "which@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "which@1.2.11", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -71,14 +70,14 @@ }, "directories": {}, "dist": { - "shasum": "91cd9bd0751322411b659b40f054b21de957ab2d", - "tarball": "https://registry.npmjs.org/which/-/which-1.2.10.tgz" + "shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b", + "tarball": "https://registry.npmjs.org/which/-/which-1.2.11.tgz" }, "files": [ "which.js", "bin/which" ], - "gitHead": "3f590834623ee940d922e12b1c8b9cbf24bd5012", + "gitHead": "8a7d0aa1ca10173f9f4d84bf528a3efc1f5d0c6f", "homepage": "https://github.com/isaacs/node-which#readme", "license": "ISC", "main": "which.js", @@ -96,9 +95,9 @@ "url": "git://github.com/isaacs/node-which.git" }, "scripts": { - "changelog": "bash changelog.sh", + "changelog": "bash gen-changelog.sh", "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}", "test": "tap test/*.js --cov" }, - "version": "1.2.10" + "version": "1.2.11" } diff --git a/deps/npm/node_modules/write-file-atomic/.npmignore b/deps/npm/node_modules/write-file-atomic/.npmignore deleted file mode 100644 index 454382637b44d0..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -*~ -DEADJOE -.#* -node_modules \ No newline at end of file diff --git a/deps/npm/node_modules/write-file-atomic/.travis.yml b/deps/npm/node_modules/write-file-atomic/.travis.yml deleted file mode 100644 index 3bc5d90c5666ca..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -sudo: false -before_install: - - "npm -g install npm" -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" - - "4" - - "5" diff --git a/deps/npm/node_modules/write-file-atomic/LICENSE b/deps/npm/node_modules/write-file-atomic/LICENSE index af4588069db82d..95e65a7706e0e9 100644 --- a/deps/npm/node_modules/write-file-atomic/LICENSE +++ b/deps/npm/node_modules/write-file-atomic/LICENSE @@ -3,3 +3,4 @@ Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/deps/npm/node_modules/write-file-atomic/README.md b/deps/npm/node_modules/write-file-atomic/README.md index 26e434d19437b0..a9d3461db1c781 100644 --- a/deps/npm/node_modules/write-file-atomic/README.md +++ b/deps/npm/node_modules/write-file-atomic/README.md @@ -19,7 +19,7 @@ callback **Function** Atomically and asynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer. -The file is initially named `filename + "." + md5hex(__filename, process.pid, ++invocations)`. +The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. If writeFile completes successfully then, if passed the **chown** option it will change the ownership of the file. Finally it renames the file back to the filename you specified. If it encounters errors at any of these steps it will attempt to unlink the temporary file and then diff --git a/deps/npm/node_modules/write-file-atomic/index.js b/deps/npm/node_modules/write-file-atomic/index.js index 797e571779f9d8..519aacad988057 100644 --- a/deps/npm/node_modules/write-file-atomic/index.js +++ b/deps/npm/node_modules/write-file-atomic/index.js @@ -2,6 +2,7 @@ var fs = require('graceful-fs') var chain = require('slide').chain var MurmurHash3 = require('imurmurhash') +var extend = Object.assign || require('util')._extend function murmurhex () { var hash = new MurmurHash3() @@ -20,22 +21,63 @@ module.exports = function writeFile (filename, data, options, callback) { } if (!options) options = {} var tmpfile = getTmpname(filename) - chain([ - [fs, fs.writeFile, tmpfile, data, options], - options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid], - [fs, fs.rename, tmpfile, filename] - ], function (err) { - err ? fs.unlink(tmpfile, function () { callback(err) }) - : callback() - }) + + if (options.mode && options.chmod) { + return thenWriteFile() + } else { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + return fs.stat(filename, function (err, stats) { + options = extend({}, options) + if (!err && stats && !options.mode) { + options.mode = stats.mode + } + if (!err && stats && !options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + return thenWriteFile() + }) + } + + function thenWriteFile () { + chain([ + [fs, fs.writeFile, tmpfile, data, options.encoding || 'utf8'], + options.mode && [fs, fs.chmod, tmpfile, options.mode], + options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid], + [fs, fs.rename, tmpfile, filename] + ], function (err) { + err ? fs.unlink(tmpfile, function () { callback(err) }) + : callback() + }) + } } module.exports.sync = function writeFileSync (filename, data, options) { if (!options) options = {} var tmpfile = getTmpname(filename) + try { - fs.writeFileSync(tmpfile, data, options) + if (!options.mode || !options.chmod) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + var stats = fs.statSync(filename) + + options = extend({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + fs.writeFileSync(tmpfile, data, options.encoding || 'utf8') if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + if (options.mode) fs.chmodSync(tmpfile, options.mode) fs.renameSync(tmpfile, filename) } catch (err) { try { fs.unlinkSync(tmpfile) } catch (e) {} diff --git a/deps/npm/node_modules/write-file-atomic/package.json b/deps/npm/node_modules/write-file-atomic/package.json index 8fad457888a3f4..76e9e9bf03159c 100644 --- a/deps/npm/node_modules/write-file-atomic/package.json +++ b/deps/npm/node_modules/write-file-atomic/package.json @@ -1,40 +1,54 @@ { "_args": [ [ - "write-file-atomic@^1.1.4", - "/Users/ogd/Documents/projects/npm/npm" + { + "raw": "write-file-atomic@1.2.0", + "scope": null, + "escapedName": "write-file-atomic", + "name": "write-file-atomic", + "rawSpec": "1.2.0", + "spec": "1.2.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "write-file-atomic@>=1.1.4 <2.0.0", - "_id": "write-file-atomic@1.1.4", + "_from": "write-file-atomic@1.2.0", + "_id": "write-file-atomic@1.2.0", "_inCache": true, - "_installable": true, "_location": "/write-file-atomic", - "_nodeVersion": "5.1.0", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/write-file-atomic-1.2.0.tgz_1471552371956_0.5829780481290072" + }, "_npmUser": { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "iarna", + "email": "me@re-becca.org" }, - "_npmVersion": "3.5.1", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "name": "write-file-atomic", - "raw": "write-file-atomic@^1.1.4", - "rawSpec": "^1.1.4", + "raw": "write-file-atomic@1.2.0", "scope": null, - "spec": ">=1.1.4 <2.0.0", - "type": "range" + "escapedName": "write-file-atomic", + "name": "write-file-atomic", + "rawSpec": "1.2.0", + "spec": "1.2.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", + "_resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.2.0.tgz", + "_shasum": "14c66d4e4cb3ca0565c28cf3b7a6f3e4d5938fab", "_shrinkwrap": null, - "_spec": "write-file-atomic@^1.1.4", - "_where": "/Users/ogd/Documents/projects/npm/npm", + "_spec": "write-file-atomic@1.2.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "me@re-becca.org", "name": "Rebecca Turner", + "email": "me@re-becca.org", "url": "http://re-becca.org" }, "bugs": { @@ -49,18 +63,22 @@ "devDependencies": { "require-inject": "^1.1.0", "standard": "^5.4.1", - "tap": "^2.3.1" + "tap": "^2.3.1", + "tmp": "0.0.28" }, "directories": {}, "dist": { - "shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", - "tarball": "http://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz" + "shasum": "14c66d4e4cb3ca0565c28cf3b7a6f3e4d5938fab", + "tarball": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.2.0.tgz" }, - "gitHead": "42dc04a17af96ac045f4979c8c951ee5a14a8b8b", + "files": [ + "index.js" + ], + "gitHead": "c29f37cb5955f597066ad7aedea7aa6f7408a5b7", "homepage": "https://github.com/iarna/write-file-atomic", "keywords": [ - "atomic", - "writeFile" + "writeFile", + "atomic" ], "license": "ISC", "main": "index.js", @@ -84,5 +102,5 @@ "scripts": { "test": "standard && tap --coverage test/*.js" }, - "version": "1.1.4" + "version": "1.2.0" } diff --git a/deps/npm/node_modules/write-file-atomic/test/basic.js b/deps/npm/node_modules/write-file-atomic/test/basic.js deleted file mode 100644 index 13b971973321d2..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/test/basic.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') -var writeFileAtomic = requireInject('../index', { - 'graceful-fs': { - writeFile: function (tmpfile, data, options, cb) { - if (/nowrite/.test(tmpfile)) return cb(new Error('ENOWRITE')) - cb() - }, - chown: function (tmpfile, uid, gid, cb) { - if (/nochown/.test(tmpfile)) return cb(new Error('ENOCHOWN')) - cb() - }, - rename: function (tmpfile, filename, cb) { - if (/norename/.test(tmpfile)) return cb(new Error('ENORENAME')) - cb() - }, - unlink: function (tmpfile, cb) { - if (/nounlink/.test(tmpfile)) return cb(new Error('ENOUNLINK')) - cb() - }, - writeFileSync: function (tmpfile, data, options) { - if (/nowrite/.test(tmpfile)) throw new Error('ENOWRITE') - }, - chownSync: function (tmpfile, uid, gid) { - if (/nochown/.test(tmpfile)) throw new Error('ENOCHOWN') - }, - renameSync: function (tmpfile, filename) { - if (/norename/.test(tmpfile)) throw new Error('ENORENAME') - }, - unlinkSync: function (tmpfile) { - if (/nounlink/.test(tmpfile)) throw new Error('ENOUNLINK') - } - } -}) -var writeFileAtomicSync = writeFileAtomic.sync - -test('async tests', function (t) { - t.plan(7) - writeFileAtomic('good', 'test', {mode: '0777'}, function (err) { - t.notOk(err, 'No errors occur when passing in options') - }) - writeFileAtomic('good', 'test', function (err) { - t.notOk(err, 'No errors occur when NOT passing in options') - }) - writeFileAtomic('nowrite', 'test', function (err) { - t.is(err.message, 'ENOWRITE', 'writeFile failures propagate') - }) - writeFileAtomic('nochown', 'test', {chown: {uid: 100, gid: 100}}, function (err) { - t.is(err.message, 'ENOCHOWN', 'Chown failures propagate') - }) - writeFileAtomic('nochown', 'test', function (err) { - t.notOk(err, 'No attempt to chown when no uid/gid passed in') - }) - writeFileAtomic('norename', 'test', function (err) { - t.is(err.message, 'ENORENAME', 'Rename errors propagate') - }) - writeFileAtomic('norename nounlink', 'test', function (err) { - t.is(err.message, 'ENORENAME', 'Failure to unlink the temp file does not clobber the original error') - }) -}) - -test('sync tests', function (t) { - t.plan(7) - var throws = function (shouldthrow, msg, todo) { - var err - try { todo() } catch (e) { err = e } - t.is(shouldthrow, err.message, msg) - } - var noexception = function (msg, todo) { - var err - try { todo() } catch (e) { err = e } - t.notOk(err, msg) - } - - noexception('No errors occur when passing in options', function () { - writeFileAtomicSync('good', 'test', {mode: '0777'}) - }) - noexception('No errors occur when NOT passing in options', function () { - writeFileAtomicSync('good', 'test') - }) - throws('ENOWRITE', 'writeFile failures propagate', function () { - writeFileAtomicSync('nowrite', 'test') - }) - throws('ENOCHOWN', 'Chown failures propagate', function () { - writeFileAtomicSync('nochown', 'test', {chown: {uid: 100, gid: 100}}) - }) - noexception('No attempt to chown when no uid/gid passed in', function () { - writeFileAtomicSync('nochown', 'test') - }) - throws('ENORENAME', 'Rename errors propagate', function () { - writeFileAtomicSync('norename', 'test') - }) - throws('ENORENAME', 'Failure to unlink the temp file does not clobber the original error', function () { - writeFileAtomicSync('norename nounlink', 'test') - }) -}) diff --git a/deps/npm/package.json b/deps/npm/package.json index 0a34e4355e8608..860059b4f5ed29 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "3.10.3", + "version": "3.10.8", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -45,34 +45,34 @@ "fs-vacuum": "~1.2.9", "fs-write-stream-atomic": "~1.0.8", "fstream": "~1.0.10", - "fstream-npm": "~1.1.0", - "glob": "~7.0.4", - "graceful-fs": "~4.1.4", + "fstream-npm": "~1.2.0", + "glob": "~7.0.6", + "graceful-fs": "~4.1.6", "has-unicode": "~2.0.1", "hosted-git-info": "~2.1.5", "iferr": "~0.1.5", "inflight": "~1.0.5", - "inherits": "~2.0.1", + "inherits": "~2.0.3", "ini": "~1.3.4", "init-package-json": "~1.9.4", "lockfile": "~1.0.1", "lodash._baseuniq": "~4.6.0", - "lodash.clonedeep": "~4.3.2", - "lodash.union": "~4.4.0", - "lodash.uniq": "~4.3.0", - "lodash.without": "~4.2.0", + "lodash.clonedeep": "~4.5.0", + "lodash.union": "~4.6.0", + "lodash.uniq": "~4.5.0", + "lodash.without": "~4.4.0", "mkdirp": "~0.5.1", - "node-gyp": "~3.3.1", + "node-gyp": "~3.4.0", "nopt": "~3.0.6", "normalize-git-url": "~3.0.2", "normalize-package-data": "~2.3.5", "npm-cache-filename": "~1.0.2", "npm-install-checks": "~3.0.0", "npm-package-arg": "~4.2.0", - "npm-registry-client": "~7.1.2", - "npm-user-validate": "~0.1.4", - "npmlog": "~3.1.2", - "once": "~1.3.3", + "npm-registry-client": "~7.2.1", + "npm-user-validate": "~0.1.5", + "npmlog": "~4.0.0", + "once": "~1.4.0", "opener": "~1.4.1", "osenv": "~0.1.3", "path-is-inside": "~1.0.1", @@ -81,12 +81,12 @@ "read-installed": "~4.0.3", "read-package-json": "~2.0.4", "read-package-tree": "~5.1.5", - "readable-stream": "~2.1.4", + "readable-stream": "~2.1.5", "realize-package-specifier": "~3.0.3", - "request": "~2.72.0", - "retry": "~0.9.0", - "rimraf": "~2.5.2", - "semver": "~5.1.0", + "request": "~2.74.0", + "retry": "~0.10.0", + "rimraf": "~2.5.4", + "semver": "~5.3.0", "sha": "~2.0.1", "slide": "~1.1.6", "sorted-object": "~2.0.0", @@ -98,9 +98,9 @@ "unique-filename": "~1.1.0", "unpipe": "~1.0.0", "validate-npm-package-name": "~2.2.2", - "which": "~1.2.10", + "which": "~1.2.11", "wrappy": "~1.0.2", - "write-file-atomic": "~1.1.4" + "write-file-atomic": "~1.2.0" }, "bundleDependencies": [ "abbrev", @@ -188,7 +188,7 @@ ], "devDependencies": { "deep-equal": "~1.0.1", - "marked": "~0.3.5", + "marked": "~0.3.6", "marked-man": "~0.1.5", "npm-registry-couchapp": "~2.6.12", "npm-registry-mock": "~1.0.1", @@ -196,16 +196,18 @@ "sprintf-js": "~1.0.3", "standard": "~6.0.8", "tacks": "~1.2.1", - "tap": "~5.7.2" + "tap": "~6.3.2" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make doc-clean && make -j4 doc", "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true", - "tap": "tap --coverage --reporter=classic --timeout 300", + "tap": "tap --reporter=classic --timeout 300", + "tap-cover": "tap --coverage --reporter=classic --timeout 600", "test": "standard && npm run test-tap", + "test-coverage": "npm run tap-cover -- \"test/tap/*.js\" \"test/network/*.js\"", "test-tap": "npm run tap -- \"test/tap/*.js\"", - "test-node": "\"$NODE\" \"node_modules/.bin/tap\" --timeout 240 \"test/tap/*.js\"" + "test-node": "\"$NODE\" \"node_modules/.bin/tap\" --timeout 240 \"test/tap/*.js\" \"test/network/*.js\"" }, "license": "Artistic-2.0" } diff --git a/deps/npm/scripts/changelog.js b/deps/npm/scripts/changelog.js index 35685ffc6031b3..c60c6c664baea8 100644 --- a/deps/npm/scripts/changelog.js +++ b/deps/npm/scripts/changelog.js @@ -13,32 +13,38 @@ the result to the changelog. */ const execSync = require('child_process').execSync const branch = process.argv[2] || 'master' -const log = execSync(`git log --pretty='format:%h %H%d %s (%aN)%n%b%n---%n' ${branch}...`).toString().split(/\n/) -const authormap = { - 'Rebecca Turner': 'iarna', - 'Forrest L Norvell': 'othiym23', - 'Kyle Mitchell': 'kemitchell', - 'Chris Rebert': 'cvrebert', - 'Kat Marchán': 'zkat' -} +const log = execSync(`git log --reverse --pretty='format:%h %H%d %s (%aN)%n%b%n---%n' ${branch}...`).toString().split(/\n/) main() +function shortname (url) { + let matched = url.match(/https:\/\/github.com\/([^/]+\/[^/]+)\/(?:pull|issues)\/(\d+)/) + if (!matched) return false + let repo = matched[1] + let id = matched[2] + if (repo !== 'npm/npm') { + return `${repo}#${id}` + } else { + return `${id}` + } +} + function print_commit (c) { - let m console.log(`* [\`${c.shortid}\`](https://github.com/npm/npm/commit/${c.fullid})`) if (c.fixes) { - console.log(` [#${c.fixes}](https://github.com/npm/npm/issues/${c.fixes})`) - } else if (c.prurl && (m = c.prurl.match(/https:\/\/github.com\/([^/]+\/[^/]+)\/pull\/(\d+)/))) { - let repo = m[1] - let prid = m[2] - if (repo !== 'npm/npm') { - console.log(` [${repo}#${prid}](${c.prurl})`) + let label = shortname(c.fixes) + if (label) { + console.log(` [${label}](${c.fixes})`) } else { - console.log(` [#${prid}](${c.prurl})`) + console.log(` [#${c.fixes}](https://github.com/npm/npm/issues/${c.fixes})`) } } else if (c.prurl) { - console.log(` [#](${c.prurl})`) + let label = shortname(c.prurl) + if (label) { + console.log(` [${label}](${c.prurl})`) + } else { + console.log(` [#](${c.prurl})`) + } } let msg = c.message .replace(/^\s+/mg, '') @@ -74,7 +80,7 @@ function main () { fullid: m[2], branch: m[3], message: m[4], - author: authormap[m[5]] || m[5], + author: m[5], prurl: null, fixes: null, credit: null @@ -84,7 +90,7 @@ function main () { } else if (m = line.match(/^Credit: @(.*)/)) { if (!commit.credit) commit.credit = [] commit.credit.push(m[1]) - } else if (m = line.match(/^Fixes: #(.*)/)) { + } else if (m = line.match(/^Fixes: (.*)/)) { commit.fixes = m[1] } else if (m = line.match(/^Reviewed-By: @(.*)/)) { commit.reviewed = m[1] diff --git a/deps/npm/scripts/maketest b/deps/npm/scripts/maketest new file mode 100755 index 00000000000000..b4f674393baac5 --- /dev/null +++ b/deps/npm/scripts/maketest @@ -0,0 +1,94 @@ +#!/usr/bin/env node +'use strict' +var loadFromDir = require('tacks/load-from-dir.js') + +process.exit(main(process.argv.slice(2))) + +function main (argv) { + if (argv.length !== 1) { + console.error('Usage: maketest ') + return 1 + } + var fixturedir = process.argv[2] + + console.log(generateFromDir(fixturedir)) + return 0 +} + +function indent (ind, str) { + return str.replace(/\n/g, '\n' + ind) +} + +function generateFromDir (dir) { + var tacks = loadFromDir(dir) + return `'use strict' +var path = require('path') +var test = require('tap').test +var mr = require('npm-registry-mock') +var Tacks = require('tacks') +var File = Tacks.File +var Symlink = Tacks.Symlink +var Dir = Tacks.Dir +var extend = Object.assign || require('util')._extend +var common = require('../common-tap.js') + +var basedir = path.join(__dirname, path.basename(__filename, '.js')) +var testdir = path.join(basedir, 'testdir') +var cachedir = path.join(basedir, 'cache') +var globaldir = path.join(basedir, 'global') +var tmpdir = path.join(basedir, 'tmp') + +var conf = { + cwd: testdir, + env: extend({ + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn' + }, process.env) +} + +var server +var fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: ${indent(' ', tacks.fixture.toSource())} +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + if (err) throw err + server = s + t.done() + }) +}) + +test('example', function (t) { + common.npm(['install'], conf, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'command ran ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + // your assertions here + t.done() + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.done() +})\n` +} diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index 847c87ba0fa172..14c1581f7873db 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -45,6 +45,7 @@ exports.npm = function (cmd, opts, cb) { if (!opts.env.npm_config_cache) { opts.env.npm_config_cache = npm_config_cache } + nodeBin = opts.nodeExecPath || nodeBin var stdout = '' var stderr = '' diff --git a/deps/npm/test/tap/bearer-token-check.js b/deps/npm/test/network/bearer-token-check.js similarity index 100% rename from deps/npm/test/tap/bearer-token-check.js rename to deps/npm/test/network/bearer-token-check.js diff --git a/deps/npm/test/tap/git-cache-locking.js b/deps/npm/test/network/git-cache-locking.js similarity index 100% rename from deps/npm/test/tap/git-cache-locking.js rename to deps/npm/test/network/git-cache-locking.js diff --git a/deps/npm/test/tap/git-cache-no-hooks.js b/deps/npm/test/network/git-cache-no-hooks.js similarity index 100% rename from deps/npm/test/tap/git-cache-no-hooks.js rename to deps/npm/test/network/git-cache-no-hooks.js diff --git a/deps/npm/test/tap/it.js b/deps/npm/test/network/it.js similarity index 100% rename from deps/npm/test/tap/it.js rename to deps/npm/test/network/it.js diff --git a/deps/npm/test/tap/legacy-bundled-git.js b/deps/npm/test/network/legacy-bundled-git.js similarity index 100% rename from deps/npm/test/tap/legacy-bundled-git.js rename to deps/npm/test/network/legacy-bundled-git.js diff --git a/deps/npm/test/tap/legacy-optional-deps.js b/deps/npm/test/network/legacy-optional-deps.js similarity index 100% rename from deps/npm/test/tap/legacy-optional-deps.js rename to deps/npm/test/network/legacy-optional-deps.js diff --git a/deps/npm/test/tap/legacy-shrinkwrap.js b/deps/npm/test/network/legacy-shrinkwrap.js similarity index 100% rename from deps/npm/test/tap/legacy-shrinkwrap.js rename to deps/npm/test/network/legacy-shrinkwrap.js diff --git a/deps/npm/test/tap/legacy-url-dep.js b/deps/npm/test/network/legacy-url-dep.js similarity index 100% rename from deps/npm/test/tap/legacy-url-dep.js rename to deps/npm/test/network/legacy-url-dep.js diff --git a/deps/npm/test/tap/outdated-symlink.js b/deps/npm/test/network/outdated-symlink.js similarity index 100% rename from deps/npm/test/tap/outdated-symlink.js rename to deps/npm/test/network/outdated-symlink.js diff --git a/deps/npm/test/tap/registry.js b/deps/npm/test/network/registry.js similarity index 100% rename from deps/npm/test/tap/registry.js rename to deps/npm/test/network/registry.js diff --git a/deps/npm/test/tap/404-private-registry-scoped.js b/deps/npm/test/tap/404-private-registry-scoped.js index 84251b113c2a9c..0f0cbc4ec70134 100644 --- a/deps/npm/test/tap/404-private-registry-scoped.js +++ b/deps/npm/test/tap/404-private-registry-scoped.js @@ -1,9 +1,24 @@ var test = require('tap').test +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') var common = require('../common-tap.js') var mr = require('npm-registry-mock') var server +var testdir = path.join(__dirname, path.basename(__filename, '.js')) + +function setup () { + cleanup() + mkdirp.sync(testdir) +} + +function cleanup () { + rimraf.sync(testdir) +} + test('setup', function (t) { + setup() mr({port: common.port, throwOnUnmatched: true}, function (err, s) { t.ifError(err, 'registry mocked successfully') server = s @@ -12,8 +27,11 @@ test('setup', function (t) { }) test('scoped package names not mangled on error with non-root registry', function (t) { + server.get('/@scope%2ffoo').reply(404, {}) common.npm( [ + '--registry=' + common.registry, + '--cache=' + testdir, 'cache', 'add', '@scope/foo@*', @@ -23,16 +41,17 @@ test('scoped package names not mangled on error with non-root registry', functio function (er, code, stdout, stderr) { t.ifError(er, 'correctly handled 404') t.equal(code, 1, 'exited with error') - t.match(stderr, /404 Not found/, 'should notify the sort of error as a 404') + t.match(stderr, /E404/, 'should notify the sort of error as a 404') t.match(stderr, /@scope\/foo/, 'should have package name in error') + server.done() t.end() } ) }) test('cleanup', function (t) { - t.pass('cleaned up') - server.done() server.close() + cleanup() + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/404-private-registry.js b/deps/npm/test/tap/404-private-registry.js index a30f61432a4d91..a38fa02c12536e 100644 --- a/deps/npm/test/tap/404-private-registry.js +++ b/deps/npm/test/tap/404-private-registry.js @@ -1,13 +1,25 @@ -require('../common-tap') var test = require('tap').test var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') var common = require('../common-tap.js') var mr = require('npm-registry-mock') var server var packageName = path.basename(__filename, '.js') +var testdir = path.join(__dirname, packageName) + +function setup () { + cleanup() + mkdirp.sync(testdir) +} + +function cleanup () { + rimraf.sync(testdir) +} test('setup', function (t) { + setup() mr({port: common.port, throwOnUnmatched: true}, function (err, s) { t.ifError(err, 'registry mocked successfully') server = s @@ -16,8 +28,11 @@ test('setup', function (t) { }) test('package names not mangled on error with non-root registry', function (t) { + server.get('/' + packageName).reply(404, {}) common.npm( [ + '--registry=' + common.registry, + '--cache=' + testdir, 'cache', 'add', packageName + '@*' @@ -27,14 +42,15 @@ test('package names not mangled on error with non-root registry', function (t) { t.ifError(er, 'correctly handled 404') t.equal(code, 1, 'exited with error') t.match(stderr, packageName, 'should have package name in error') + server.done() t.end() } ) }) test('cleanup', function (t) { - t.pass('cleaned up') - server.done() server.close() + cleanup() + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/add-local.js b/deps/npm/test/tap/add-local.js new file mode 100644 index 00000000000000..cc615b8997fb8f --- /dev/null +++ b/deps/npm/test/tap/add-local.js @@ -0,0 +1,137 @@ +var path = require('path') +var test = require('tap').test +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var requireInject = require('require-inject') + +var pkg = path.join(__dirname, '/local-dir') +var cache = path.join(pkg, '/cache') +var tmp = path.join(pkg, '/tmp') +var prefix = path.join(pkg, '/prefix') + +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +test('addLocal directory race on Windows', function (t) { + setup() + var p = { + name: 'test', + version: '1.0.0', + type: 'directory', + spec: pkg + } + var fixture = new Tacks( + Dir({ + 'package.json': File(p) + }) + ) + var addLocal = requireInject('../../lib/cache/add-local', { + '../../lib/npm.js': { + cache: cache, + tmp: tmp, + prefix: prefix + }, + '../../lib/cache/get-stat': function (cb) { + cb(null, {}) + }, + chownr: function (x, y, z, cb) { + cb(new Error('chownr should never have been called')) + }, + '../../lib/cache/add-local-tarball.js': function (tgz, data, shasum, cb) { + cb(null) + }, + '../../lib/utils/lifecycle.js': function (data, cycle, p, cb) { + cb(null) + }, + '../../lib/utils/tar.js': { + pack: function (tgz, p, data, cb) { + cb(null) + } + }, + 'sha': { + get: function (tgz, cb) { + cb(null, 'deadbeef') + } + } + }) + + fixture.create(pkg) + addLocal(p, null, function (err) { + t.ifErr(err, 'addLocal completed without error') + t.done() + }) +}) + +test('addLocal temporary cache file race', function (t) { + // See https://github.com/npm/npm/issues/12669 + setup() + var p = { + name: 'test', + version: '1.0.0', + type: 'directory', + spec: pkg + } + var fixture = new Tacks( + Dir({ + 'package.json': File(p) + }) + ) + var addLocal = requireInject('../../lib/cache/add-local', { + // basic setup/mock stuff + '../../lib/npm.js': { + cache: cache, + tmp: tmp, + prefix: prefix + }, + '../../lib/cache/add-local-tarball.js': function (tgz, data, shasum, cb) { + cb(null) + }, + '../../lib/utils/lifecycle.js': function (data, cycle, p, cb) { + cb(null) + }, + '../../lib/utils/tar.js': { + pack: function (tgz, p, data, cb) { + cb(null) + } + }, + 'sha': { + get: function (tgz, cb) { + cb(null, 'deadbeef') + } + }, + + // Test-specific mocked values to simulate race. + '../../lib/cache/get-stat': function (cb) { + cb(null, {uid: 1, gid: 2}) + }, + chownr: function (x, y, z, cb) { + // Simulate a race condition between `tar.pack` and `chownr` + // where the latter will return `ENOENT` when an async process + // removes a file that its internal `fs.readdir` listed. + cb({code: 'ENOENT'}) + } + }) + + fixture.create(pkg) + addLocal(p, null, function (err) { + t.ifErr(err, 'addLocal completed without error') + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + mkdirp.sync(cache) + mkdirp.sync(tmp) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/bundled-dependencies.js b/deps/npm/test/tap/bundled-dependencies.js new file mode 100644 index 00000000000000..a49610e666d2d5 --- /dev/null +++ b/deps/npm/test/tap/bundled-dependencies.js @@ -0,0 +1,112 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var fs = require('graceful-fs') +var tar = require('tar') +var zlib = require('zlib') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-bundled-deps') +var targetpath = path.resolve(basepath, 'target') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +test('basic bundling', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + bundledDependencies: [ + 'addme' + ] + }), + node_modules: Dir({ + addme: Dir({ + 'index.js': File('') + }), + iggyme: Dir({ + 'index.js': File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('node_modules/addme'), 'bundled dep included') + t.notOk(fileExists('node_modules/iggyme'), 'unspecified dep not included') + done() + }) +}) + +test('scoped dep bundling', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + bundledDependencies: [ + '@foo/addme' + ] + }), + node_modules: Dir({ + '@foo': Dir({ + addme: Dir({ + 'index.js': File('') + }), + iggyme: Dir({ + 'index.js': File('') + }) + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('node_modules/@foo/addme'), 'bundled dep included') + t.notOk( + fileExists('node_modules/@foo/iggyme'), + 'unspecified dep not included') + done() + }) +}) + +function fileExists (file) { + try { + return !!fs.statSync(path.resolve(targetpath, 'package', file)) + } catch (_) { + return false + } +} + +function withFixture (t, fixture, tester) { + fixture.create(fixturepath) + mkdirp.sync(targetpath) + common.npm(['pack', fixturepath], {cwd: basepath}, extractAndCheck) + function extractAndCheck (err, code) { + if (err) throw err + t.is(code, 0, 'pack went ok') + extractTarball(checkTests) + } + function checkTests (err) { + if (err) throw err + tester(removeAndDone) + } + function removeAndDone (err) { + if (err) throw err + fixture.remove(fixturepath) + rimraf.sync(basepath) + t.done() + } +} + +function extractTarball (cb) { + // Unpack to disk so case-insensitive filesystems are consistent + fs.createReadStream(path.join(basepath, 'npm-test-files-1.2.5.tgz')) + .pipe(zlib.Unzip()) + .on('error', cb) + .pipe(tar.Extract(targetpath)) + .on('error', cb) + .on('end', function () { cb() }) +} diff --git a/deps/npm/test/tap/correct-mkdir.js b/deps/npm/test/tap/correct-mkdir.js index 4bfc6b1c977614..a4f86598737c05 100644 --- a/deps/npm/test/tap/correct-mkdir.js +++ b/deps/npm/test/tap/correct-mkdir.js @@ -56,3 +56,108 @@ test('correct-mkdir: no race conditions', function (t) { // Immediate call again in case of race condition there correctMkdir(cache_dir, handleCallFinish) }) + +test('correct-mkdir: ignore ENOENTs from chownr', function (t) { + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + cb({code: 'ENOENT'}) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish (err) { + t.ifErr(err, 'chownr\'s ENOENT errors were ignored') + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) + +// NEED TO RUN LAST + +// These test checks that Windows users are protected by crashes related to +// unexpectedly having a UID/GID other than 0 if a user happens to add these +// variables to their environment. There are assumptions in correct-mkdir +// that special-case Windows by checking on UID-related things. +test('correct-mkdir: SUDO_UID and SUDO_GID non-Windows', function (t) { + process.env.SUDO_UID = 999 + process.env.SUDO_GID = 999 + process.getuid = function () { return 0 } + process.getgid = function () { return 0 } + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + uid: 0, + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + t.is(uid, +process.env.SUDO_UID, 'using the environment\'s UID') + t.is(gid, +process.env.SUDO_GID, 'using the environment\'s GID') + cb(null, {}) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish () { + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) + +test('correct-mkdir: SUDO_UID and SUDO_GID Windows', function (t) { + process.env.SUDO_UID = 999 + process.env.SUDO_GID = 999 + delete process.getuid + delete process.getgid + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + uid: 0, + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + t.fail('chownr should not be called at all on Windows') + cb('nope') + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish (err) { + t.ifErr(err, 'chownr was not called because Windows') + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) diff --git a/deps/npm/test/tap/files-and-ignores.js b/deps/npm/test/tap/files-and-ignores.js index a8f4b222b89675..88d9d12922b4e0 100644 --- a/deps/npm/test/tap/files-and-ignores.js +++ b/deps/npm/test/tap/files-and-ignores.js @@ -404,7 +404,8 @@ test('certain files ignored unconditionally', function (t) { '.npmrc', '.foo.swp', '.DS_Store', - '._ohno' + '._ohno', + 'foo.orig' ] }), '.git': Dir({foo: File('')}), @@ -421,7 +422,8 @@ test('certain files ignored unconditionally', function (t) { '.foo.swp': File(''), '.DS_Store': Dir({foo: File('')}), '._ohno': File(''), - '._ohnoes': Dir({noes: File('')}) + '._ohnoes': Dir({noes: File('')}), + 'foo.orig': File('') }) ) withFixture(t, fixture, function (done) { @@ -440,6 +442,7 @@ test('certain files ignored unconditionally', function (t) { t.notOk(fileExists('.DS_Store'), '.DS_Store not included') t.notOk(fileExists('._ohno'), '._ohno not included') t.notOk(fileExists('._ohnoes'), '._ohnoes not included') + t.notOk(fileExists('foo.orig'), 'foo.orig not included') done() }) }) diff --git a/deps/npm/test/tap/full-warning-messages.js b/deps/npm/test/tap/full-warning-messages.js index 3c74c61d0cd4e8..6745ee3db2e67f 100644 --- a/deps/npm/test/tap/full-warning-messages.js +++ b/deps/npm/test/tap/full-warning-messages.js @@ -94,8 +94,8 @@ test('tree-style', function (t) { t.notMatch(stdout, /modB/, 'modB not installed') var stderrlines = stderr.trim().split(/\n/) t.is(stderrlines.length, 2, 'two lines of warnings') - t.match(stderr, /Skipping failed optional dependency/, 'expected optional failure warning') - t.match(stderr, /Not compatible with your operating system or architecture/, 'reason for optional failure') + t.match(stderr, /SKIPPING OPTIONAL DEPENDENCY/, 'expected optional failure warning') + t.match(stderr, /Unsupported platform/, 'reason for optional failure') exists(t, modJoin(base, 'modA'), 'module A') notExists(t, modJoin(base, 'modB'), 'module B') t.done() diff --git a/deps/npm/test/tap/install-cli-only-shrinkwrap.js b/deps/npm/test/tap/install-cli-only-shrinkwrap.js new file mode 100644 index 00000000000000..17ff1ec9559eca --- /dev/null +++ b/deps/npm/test/tap/install-cli-only-shrinkwrap.js @@ -0,0 +1,139 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, path.basename(__filename, '.js')) + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-cli-only-shrinkwrap', + description: 'fixture', + version: '0.0.0', + dependencies: { + dependency: 'file:./dependency' + }, + devDependencies: { + 'dev-dependency': 'file:./dev-dependency' + } +} + +var shrinkwrap = { + name: 'install-cli-only-shrinkwrap', + description: 'fixture', + version: '0.0.0', + dependencies: { + dependency: { + version: '0.0.0', + from: 'file:./dependency' + }, + 'dev-dependency': { + version: '0.0.0', + from: 'file:./dev-dependency', + dev: true + } + } +} + +var dependency = { + name: 'dependency', + description: 'fixture', + version: '0.0.0' +} + +var devDependency = { + name: 'dev-dependency', + description: 'fixture', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.pass('setup ran') + t.end() +}) + +test('\'npm install --only=development\' should only install devDependencies', function (t) { + common.npm(['install', '--only=development'], EXEC_OPTS, function (err, code, stderr, stdout) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'npm install did not raise error code') + t.ok( + existsSync( + path.resolve(pkg, 'node_modules/dev-dependency/package.json') + ), + 'devDependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), + 'dependency was NOT installed' + ) + t.end() + }) +}) + +test('\'npm install --only=production\' should only install dependencies', function (t) { + cleanup() + setup() + common.npm(['install', '--only=production'], EXEC_OPTS, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'npm install did not raise error code') + t.ok( + existsSync( + path.resolve(pkg, 'node_modules/dependency/package.json') + ), + 'dependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), + 'devDependency was NOT installed' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.pass('cleaned up') + t.end() +}) + +function setup () { + mkdirp.sync(path.join(pkg, 'dependency')) + fs.writeFileSync( + path.join(pkg, 'dependency', 'package.json'), + JSON.stringify(dependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'dev-dependency')) + fs.writeFileSync( + path.join(pkg, 'dev-dependency', 'package.json'), + JSON.stringify(devDependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync( + path.join(pkg, 'npm-shrinkwrap.json'), + JSON.stringify(shrinkwrap, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/install-parse-error.js b/deps/npm/test/tap/install-parse-error.js index b142abb39a1ade..72d19efc25dff0 100644 --- a/deps/npm/test/tap/install-parse-error.js +++ b/deps/npm/test/tap/install-parse-error.js @@ -49,3 +49,4 @@ test('cleanup', function (t) { cleanup() t.end() }) + diff --git a/deps/npm/test/tap/install-property-conflicts.js b/deps/npm/test/tap/install-property-conflicts.js new file mode 100644 index 00000000000000..8f293885abf401 --- /dev/null +++ b/deps/npm/test/tap/install-property-conflicts.js @@ -0,0 +1,74 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'install-property-conflicts') +var target = resolve(pkg, '_target') + +var EXEC_OPTS = { + cwd: target +} + +var json = { + name: 'install-property-conflicts', + version: '1.2.3', + type: 'nose-boop!' +} + +test('setup', function (t) { + setup() + t.pass('setup ran') + t.end() +}) + +test('install package with a `type` property', function (t) { + t.comment('issue: https://github.com/npm/npm/issues/11398') + common.npm( + [ + 'install', + '--prefix', target, + pkg + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm command ran from test') + t.equals(code, 0, 'install exited with success (0)') + var installedPkg = resolve( + target, + 'node_modules', + 'install-property-conflicts', + 'package.json') + t.ok(fs.statSync(installedPkg), 'package installed successfully') + t.end() + } + ) +}) + +test('clean', function (t) { + cleanup() + t.pass('cleaned up') + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + // make sure it installs locally + mkdirp.sync(resolve(target, 'node_modules')) + fs.writeFileSync( + resolve(pkg, 'package.json'), + JSON.stringify(json, null, 2) + '\n' + ) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + rimraf.sync(target) +} diff --git a/deps/npm/test/tap/install-shrinkwrapped-git.js b/deps/npm/test/tap/install-shrinkwrapped-git.js new file mode 100644 index 00000000000000..34875ffb651a5e --- /dev/null +++ b/deps/npm/test/tap/install-shrinkwrapped-git.js @@ -0,0 +1,159 @@ +var fs = require('fs') +var path = require('path') +var resolve = path.resolve +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var npm = require('../../lib/npm') +var common = require('../common-tap') +var chain = require('slide').chain + +var mockPath = resolve(__dirname, 'install-shrinkwrapped') +var parentPath = resolve(mockPath, 'parent') +var parentNodeModulesPath = path.join(parentPath, 'node_modules') +var outdatedNodeModulesPath = resolve(mockPath, 'node-modules-backup') +var childPath = resolve(mockPath, 'child.git') + +var gitDaemon +var gitDaemonPID +var git + +var parentPackageJSON = JSON.stringify({ + name: 'parent', + version: '0.1.0' +}) + +var childPackageJSON = JSON.stringify({ + name: 'child', + version: '0.1.0' +}) + +test('setup', function (t) { + setup(function (err, result) { + t.ifError(err, 'git started up successfully') + + if (!err) { + gitDaemon = result[result.length - 2] + gitDaemonPID = result[result.length - 1] + } + + t.end() + }) +}) + +test('shrinkwrapped git dependency got updated', function (t) { + t.comment('test for https://github.com/npm/npm/issues/12718') + + // Prepare the child package git repo with two commits + prepareChildAndGetRefs(function (refs) { + chain([ + // Install & shrinkwrap child package's first commit + [npm.commands.install, ['git://localhost:1234/child.git#' + refs[0]]], + [npm.commands.shrinkwrap, []], + // Backup node_modules with the first commit + [fs.rename, parentNodeModulesPath, outdatedNodeModulesPath], + // Install & shrinkwrap child package's second commit + [npm.commands.install, ['git://localhost:1234/child.git#' + refs[1]]], + [npm.commands.shrinkwrap, []], + // Restore node_modules with the first commit + [rimraf, parentNodeModulesPath], + [fs.rename, outdatedNodeModulesPath, parentNodeModulesPath], + // Update node_modules + [npm.commands.install, []] + ], function () { + var childPackageJSON = require(path.join(parentNodeModulesPath, 'child', 'package.json')) + t.equal( + childPackageJSON._resolved, + 'git://localhost:1234/child.git#' + refs[1], + "Child package wasn't updated" + ) + t.end() + }) + }) +}) + +test('clean', function (t) { + gitDaemon.on('close', function () { + cleanup() + t.end() + }) + process.kill(gitDaemonPID) +}) + +function setup (cb) { + // Setup parent package + mkdirp.sync(parentPath) + fs.writeFileSync(resolve(parentPath, 'package.json'), parentPackageJSON) + process.chdir(parentPath) + + // Setup child + mkdirp.sync(childPath) + fs.writeFileSync(resolve(childPath, 'package.json'), childPackageJSON) + + // Setup npm and then git + npm.load({ + registry: common.registry, + loglevel: 'silent', + save: true // Always install packages with --save + }, function () { + // It's important to initialize git after npm because it uses config + initializeGit(cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(mockPath) + rimraf.sync(common['npm_config_cache']) +} + +function prepareChildAndGetRefs (cb) { + var opts = { cwd: childPath, env: { PATH: process.env.PATH } } + chain([ + [fs.writeFile, path.join(childPath, 'README.md'), ''], + git.chainableExec(['add', 'README.md'], opts), + git.chainableExec(['commit', '-m', 'Add README'], opts), + git.chainableExec(['log', '--pretty=format:"%H"', '-2'], opts) + ], function () { + var gitLogStdout = arguments[arguments.length - 1] + var refs = gitLogStdout[gitLogStdout.length - 1].split('\n').map(function (ref) { + return ref.match(/^"(.+)"$/)[1] + }).reverse() // Reverse refs order: last, first -> first, last + cb(refs) + }) +} + +function initializeGit (cb) { + git = require('../../lib/utils/git') + common.makeGitRepo({ + path: childPath, + commands: [startGitDaemon] + }, cb) +} + +function startGitDaemon (cb) { + var daemon = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=' + mockPath, // Path to the dir that contains child.git + '--reuseaddr', + '--port=1234' + ], + { + cwd: parentPath, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + daemon.stderr.on('data', function findChild (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', findChild) + cb(null, [daemon, cpid[1]]) + } + }) +} diff --git a/deps/npm/test/tap/invalid-dep-version-filtering.js b/deps/npm/test/tap/invalid-dep-version-filtering.js new file mode 100644 index 00000000000000..a4a872f54e972d --- /dev/null +++ b/deps/npm/test/tap/invalid-dep-version-filtering.js @@ -0,0 +1,135 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var testdir = path.join(__dirname, path.basename(__filename, '.js')) +var cachedir = path.join(testdir, 'cache') + +var fixture = new Tacks(Dir({ + cache: Dir(), + node_modules: Dir(), + tarballs: Dir({ + 'pkgA.tgz': File(new Buffer( + '1f8b0800000000000003edcfcf0a0221100670cf3ec5e0396cfcb703bd8d' + + '842cb5e4ca5a5da2776f5da153b78408fc5d3e6684e133f9e3e4c7b04f35' + + 'e539cf9135868883b5509206b725ea3a6f9c01a634598d8e48134365d0e0' + + 'fadebac827b77cf5cb5ae5db3bf52bf0ce3ff1e00022fa4b100710691abd' + + 'd895cd3d2cf934c7b25412250afee4bfaeda755dd735f40211b5bced0008' + + '0000', + 'hex' + )), + 'pkgB1.tgz': File(new Buffer( + '1f8b0800000000000003edcfc10a0221140550d77ec5c375d8d3d111fa1b' + + '0b196ac891b16913fd7be308adda2544f0cee6e25d3caec99f463f847daa' + + '292f798aac3144ec8d8192aeb75ba2aeef8ded8029ed8c46eb1c1a86aa43' + + 'bd76d87ac8274bbef9799df2ed9dfa1578e79f78700011fd35880388340e' + + '47b12bcd3dccf93cc5522a8912057ff25f4f258410d2d00b247d22080008' + + '0000', + 'hex' + )) + }) +})) + +var pkgAtgz = path.join(testdir, 'tarballs', 'pkgA.tgz') +var pkgB1tgz = path.join(testdir, 'tarballs', 'pkgB1.tgz') + +var server + +var pkgA = { + name: 'pkg-a', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'pkg-a', + version: '1.0.0', + dependencies: { + 'pkg-b': '1.0.0' + }, + dist: { + shasum: 'dc5471ce0439f0f47749bb01473cad4570cc7dc5', + tarball: common.registry + '/pkg-a/-/pkg-a-1.0.0.tgz' + } + } + } +} + +var pkgB = { + name: 'pkg-b', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'pkg-b', + version: '1.0.0', + dist: { + shasum: '53031aa2cf774c0e841c6fdbbe54c13825cd5640', + tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0.tgz' + } + }, + '1.0.0rc1': { + name: 'pkg-b', + version: '1.0.0rc1', + dist: { + shasum: '7f4b1bf680e3a31113d77619b4dc7c3b4c7dc15c', + tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0-rc1.tgz' + } + } + } +} + +function setup () { + cleanup() + fixture.create(testdir) +} +function cleanup () { + fixture.remove(testdir) +} + +test('setup', function (t) { + setup() + mr({ port: common.port, throwOnUnmatched: true }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +test('invalid versions should be ignored', function (t) { + server.get('/pkg-a').reply(200, pkgA) + server.get('/pkg-b').reply(200, pkgB) + server.get('/pkg-a/-/pkg-a-1.0.0.tgz').replyWithFile(200, pkgAtgz) + server.get('/pkg-b/-/pkg-b-1.0.0.tgz').replyWithFile(200, pkgB1tgz) + + common.npm( + [ + 'install', + '--cache', cachedir, + '--registry', common.registry, + '--fetch-retries=0', + 'pkg-a@1.0.0' + ], + {cwd: testdir}, + function (err, code, stdout, stderr) { + if (err) throw err + t.equal(code, 0, 'install succeded') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + server.done() + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/lifecycle-order.js b/deps/npm/test/tap/lifecycle-order.js new file mode 100644 index 00000000000000..903e1945d1e915 --- /dev/null +++ b/deps/npm/test/tap/lifecycle-order.js @@ -0,0 +1,57 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, path.basename(__filename, '.js')) + +var json = { + name: 'lifecycle-order', + version: '1.0.0', + scripts: { + preinstall: 'node -e "var fs = require(\'fs\'); fs.openSync(\'preinstall-step\', \'w+\'); if (fs.existsSync(\'node_modules\')) { throw \'node_modules exists on preinstall\' }"', + install: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'preinstall-step\')) { fs.openSync(\'install-step\', \'w+\') } else { throw \'Out of order\' }"', + postinstall: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'install-step\')) { fs.openSync(\'postinstall-step\', \'w+\') } else { throw \'Out of order\' }"' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('lifecycle scripts execute in the proper order', function (t) { + common.npm('install', {cwd: pkg}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'no error') + + // All three files should exist + t.ok(fs.existsSync(path.join(pkg, 'preinstall-step')), 'preinstall ok') + t.ok(fs.existsSync(path.join(pkg, 'install-step')), 'install ok') + t.ok(fs.existsSync(path.join(pkg, 'postinstall-step')), 'postinstall ok') + + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/lifecycle-path.js b/deps/npm/test/tap/lifecycle-path.js index 3264fe87be9552..684fd4d3b589b8 100644 --- a/deps/npm/test/tap/lifecycle-path.js +++ b/deps/npm/test/tap/lifecycle-path.js @@ -31,11 +31,33 @@ test('setup', function (t) { t.end() }) -test('make sure the path is correct', function (t) { +test('make sure the path is correct, without directory of current node', function (t) { + checkPath(false, t) +}) + +test('make sure the path is correct, with directory of current node', function (t) { + checkPath(true, t) +}) + +function checkPath (withDirOfCurrentNode, t) { + var newPATH = PATH + var currentNodeExecPath = process.execPath + if (withDirOfCurrentNode) { + var newNodeExeDir = path.join(pkg, 'node-bin') + mkdirp.sync(newNodeExeDir) + currentNodeExecPath = path.join(newNodeExeDir, 'my_bundled_' + path.basename(process.execPath)) + fs.writeFileSync(currentNodeExecPath, fs.readFileSync(process.execPath)) + fs.chmodSync(currentNodeExecPath, '755') + } else { + // Ensure that current node interpreter will be found in the PATH, + // so the PATH won't be prepended with its parent directory + newPATH = [path.dirname(process.execPath), PATH].join(process.platform === 'win32' ? ';' : ':') + } common.npm(['run-script', 'env'], { cwd: pkg, + nodeExecPath: currentNodeExecPath, env: { - PATH: PATH + PATH: newPATH }, stdio: [ 0, 'pipe', 2 ] }, function (er, code, stdout) { @@ -60,17 +82,18 @@ test('make sure the path is correct', function (t) { }) // get the ones we tacked on, then the system-specific requirements - var expect = [ - '{{ROOT}}/bin/node-gyp-bin', - '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin', - path.dirname(process.execPath) - ].concat(PATH.split(pathSplit)).map(function (p) { + var expectedPaths = ['{{ROOT}}/bin/node-gyp-bin', + '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin'] + if (withDirOfCurrentNode) { + expectedPaths.push('{{ROOT}}/test/tap/lifecycle-path/node-bin') + } + var expect = expectedPaths.concat(newPATH.split(pathSplit)).map(function (p) { return p.replace(/\\/g, '/') }) t.same(actual, expect) t.end() }) -}) +} test('cleanup', function (t) { cleanup() diff --git a/deps/npm/test/tap/local-args-relative-to-cwd.js b/deps/npm/test/tap/local-args-relative-to-cwd.js new file mode 100644 index 00000000000000..6c424bf67f123c --- /dev/null +++ b/deps/npm/test/tap/local-args-relative-to-cwd.js @@ -0,0 +1,65 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var common = require('../common-tap.js') +var testdir = path.join(__dirname, path.basename(__filename, '.js')) + +var fixture = new Tacks( + Dir({ + example: Dir({ + }), + mod1: Dir({ + 'package.json': File({ + name: 'mod1', + version: '1.0.0' + }) + }), + node_modules: Dir({ + }) + }) +) + +function setup () { + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +function exists (file) { + try { + fs.statSync(file) + return true + } catch (ex) { + return false + } +} + +test('local-args-relative-to-cwd', function (t) { + var instdir = path.join(testdir, 'example') + var config = ['--loglevel=error'] + common.npm(config.concat(['install', '../mod1']), {cwd: instdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'install ran ok') + t.ok(exists(path.join(testdir, 'node_modules', 'mod1')), 'mod1 installed') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/node-modules-path-munge.js b/deps/npm/test/tap/node-modules-path-munge.js new file mode 100644 index 00000000000000..fdca0393cc1d10 --- /dev/null +++ b/deps/npm/test/tap/node-modules-path-munge.js @@ -0,0 +1,39 @@ +var common = require('../common-tap.js') +var t = require('tap') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var path = require('path') +var dir = path.join(__dirname, 'my_node_modules') +var script = process.platform === 'win32' ? 'echo %PATH%' : 'echo $PATH' + +t.test('setup', function (t) { + rimraf.sync(dir) + mkdirp.sync(dir) + fs.writeFileSync(dir + '/package.json', JSON.stringify({ + name: 'my_node_modules', + version: '1.2.3', + scripts: { + test: script + } + })) + t.end() +}) + +t.test('verify PATH is munged right', function (t) { + common.npm(['test'], { cwd: dir }, function (err, code, stdout, stderr) { + if (err) { + throw err + } + t.equal(code, 0, 'exit ok') + t.notOk(stderr, 'should have no stderr') + var expect = path.resolve(dir, 'node_modules', '.bin').toLowerCase() + t.contains(stdout.toLowerCase(), expect) + t.end() + }) +}) + +t.test('cleanup', function (t) { + rimraf.sync(dir) + t.end() +}) diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision.js b/deps/npm/test/tap/optional-metadep-rollback-collision.js index a9294858d2722c..bc1bccd16e93c0 100644 --- a/deps/npm/test/tap/optional-metadep-rollback-collision.js +++ b/deps/npm/test/tap/optional-metadep-rollback-collision.js @@ -199,14 +199,12 @@ test('go go test racer', function (t) { env: { PATH: process.env.PATH, Path: process.env.Path - }, - stdio: [0, 'pipe', 2] + } }, function (er, code, stdout, stderr) { t.ifError(er, 'install ran to completion without error') t.is(code, 0, 'npm install exited with code 0') - t.is(stderr, '') - + t.comment(stdout.trim()) // stdout should be empty, because we only have one, optional, dep and // if it fails we shouldn't try installing anything t.equal(stdout, '') diff --git a/deps/npm/test/tap/shrinkwrap-default-arg-ver.js b/deps/npm/test/tap/shrinkwrap-default-arg-ver.js new file mode 100644 index 00000000000000..d87bc92391ffe6 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-default-arg-ver.js @@ -0,0 +1,104 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') + +var testdir = path.join(__dirname, path.basename(__filename, '.js')) +var config = [ + '--loglevel=error', + '--registry=' + common.registry, + '--cache=' + path.join(testdir, 'cache') +] + +var fixture = new Tacks( + Dir({ + 'cache': Dir(), + 'npm-shrinkwrap.json': File({ + name: 'shrinkwrap-default-arg-ver', + version: '1.0.0', + dependencies: { + underscore: { + version: '1.3.1', + from: 'mod1@>=1.3.1 <2.0.0', + resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' + } + } + }), + 'package.json': File({ + name: 'shrinkwrap-default-arg-ver', + version: '1.0.0', + dependencies: { + underscore: '^1.3.1' + } + }) + }) +) +var installed = path.join(testdir, 'node_modules', 'underscore', 'package.json') + +function setup () { + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +var server +test('setup', function (t) { + cleanup() + setup() + mr({port: common.port}, function (er, s) { + if (er) throw er + server = s + t.end() + }) +}) + +function exists (file) { + try { + fs.statSync(file) + return true + } catch (ex) { + return false + } +} +test('shrinkwrap-default-arg-version', function (t) { + // When this feature was malfunctioning npm would select the version of + // `mod1` from the `package.json` instead of the `npm-shrinkwrap.json`, + // which in this case would mean trying the registry instead of installing + // from a local folder. + common.npm(config.concat(['install', 'underscore']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'installed ok') + t.ok(exists(path.join(testdir, 'node_modules', 'underscore')), 'underscore installed') + var pjson = JSON.parse(fs.readFileSync(installed)) + t.is(pjson.version, '1.3.1', 'got shrinkwrap version') + t.end() + }) +}) + +test('can-override', function (t) { + common.npm(config.concat(['install', 'underscore@latest']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'installed ok') + t.ok(exists(path.join(testdir, 'node_modules', 'underscore')), 'underscore installed') + var pjson = JSON.parse(fs.readFileSync(installed)) + t.is(pjson.version, '1.5.1', 'got latest version') + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js b/deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js new file mode 100644 index 00000000000000..c9511bb152ea74 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js @@ -0,0 +1,93 @@ +'use strict' +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var common = require('../common-tap.js') +var testdir = path.join(__dirname, path.basename(__filename, '.js')) + +var fixture = new Tacks( + Dir({ + node_modules: Dir({ + 'a': Dir({ + 'package.json': File({ + _requested: { + rawSpec: 'file:///mods/a' + }, + dependencies: { + 'b': 'file:///mods/b' + }, + name: 'a', + version: '1.0.0' + }) + }), + 'b': Dir({ + 'package.json': File({ + _requested: { + rawSpec: 'file:///mods/b' + }, + dependencies: { + 'a': 'file:///mods/a' + }, + name: 'b', + version: '1.0.0' + }) + }) + }), + 'package.json': File({ + name: 'test', + version: '1.0.0', + devDependencies: { + 'a': 'file:///mods/a' + } + }) + }) +) + +var expectedShrinkwrap = { + name: 'test', + version: '1.0.0', + dependencies: {} +} + +function setup () { + cleanup() + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +function readJson (file) { + try { + var contents = fs.readFileSync(file) + return JSON.parse(contents) + } catch (ex) { + return ex + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('shrinkwrap cycle in dev deps', function (t) { + common.npm(['shrinkwrap'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'result code = ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + var actualShrinkwrap = readJson(path.join(testdir, 'npm-shrinkwrap.json')) + t.isDeeply(actualShrinkwrap, expectedShrinkwrap, 'shrinkwrap is right') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/shrinkwrap-local-dependency.js b/deps/npm/test/tap/shrinkwrap-local-dependency.js index 8d7c0712f9ae58..d3537756c062d8 100644 --- a/deps/npm/test/tap/shrinkwrap-local-dependency.js +++ b/deps/npm/test/tap/shrinkwrap-local-dependency.js @@ -1,121 +1,123 @@ var test = require('tap').test var path = require('path') var fs = require('fs') -var osenv = require('osenv') var rimraf = require('rimraf') -var mkdirp = require('mkdirp') var common = require('../common-tap.js') - -var PKG_DIR = path.resolve(__dirname, 'shrinkwrap-local-dependency') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') -var DEP_DIR = path.resolve(PKG_DIR, 'dep') - -var desired = { - 'name': 'npm-test-shrinkwrap-local-dependency', - 'version': '0.0.0', - 'dependencies': { - 'npm-test-shrinkwrap-local-dependency-dep': { - 'version': '0.0.0', - 'from': 'dep', - 'resolved': 'file:dep' +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var testdir = path.resolve(__dirname, path.basename(__filename, '.js')) +var cachedir = path.resolve(testdir, 'cache') +var config = ['--cache=' + cachedir, '--loglevel=error'] + +var shrinkwrap = { + name: 'shrinkwrap-local-dependency', + version: '1.0.0', + dependencies: { + mod2: { + version: '1.0.0', + from: path.join('mods', 'mod2'), + resolved: 'file:' + path.join('mods', 'mod2'), + dependencies: { + mod1: { + version: '1.0.0', + from: path.join('mods', 'mod1'), + resolved: 'file:' + path.join('mods', 'mod1') + } + } } } } -var root = { - 'author': 'Thomas Torp', - 'name': 'npm-test-shrinkwrap-local-dependency', - 'version': '0.0.0', - 'dependencies': { - 'npm-test-shrinkwrap-local-dependency-dep': 'file:./dep' - } +var fixture = new Tacks( + Dir({ + cache: Dir(), + mods: Dir({ + mod1: Dir({ + 'package.json': File({ + name: 'mod1', + version: '1.0.0' + }) + }), + mod2: Dir({ + 'package.json': File({ + name: 'mod2', + version: '1.0.0', + dependencies: { + mod1: 'file:' + path.join('..', 'mod1') + } + }) + }) + }), + 'package.json': File({ + name: 'shrinkwrap-local-dependency', + version: '1.0.0', + dependencies: { + mod2: 'file:' + path.join('mods', 'mod2') + } + }) + }) +) + +function setup () { + cleanup() + fixture.create(testdir) +} + +function cleanNodeModules () { + rimraf.sync(path.resolve(testdir, 'node_modules')) } -var dependency = { - 'author': 'Thomas Torp', - 'name': 'npm-test-shrinkwrap-local-dependency-dep', - 'version': '0.0.0' +function cleanup () { + fixture.remove(testdir) } test('shrinkwrap uses resolved with file: on local deps', function (t) { setup() - common.npm( - ['--cache=' + CACHE_DIR, '--loglevel=silent', 'install', '.'], - {}, - function (err, code) { - t.ifError(err, 'npm install worked') - t.equal(code, 0, 'npm exited normally') - - common.npm( - ['--cache=' + CACHE_DIR, '--loglevel=silent', 'shrinkwrap'], - {}, - function (err, code) { - t.ifError(err, 'npm shrinkwrap worked') - t.equal(code, 0, 'npm exited normally') - - fs.readFile('npm-shrinkwrap.json', { encoding: 'utf8' }, function (err, data) { - t.ifError(err, 'read file correctly') - t.deepEqual(JSON.parse(data), desired, 'shrinkwrap looks correct') + common.npm(config.concat(['install', '--legacy']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.equal(code, 0, 'npm exited normally') - t.end() - }) - } - ) - } - ) + common.npm(config.concat('shrinkwrap'), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.equal(code, 0, 'npm exited normally') + var data = fs.readFileSync(path.join(testdir, 'npm-shrinkwrap.json'), { encoding: 'utf8' }) + t.deepEqual(JSON.parse(data), shrinkwrap, 'shrinkwrap looks correct') + t.end() + }) + }) }) +function exists (file) { + try { + fs.statSync(file) + return true + } catch (ex) { + return false + } +} + test("'npm install' should install local packages from shrinkwrap", function (t) { cleanNodeModules() - common.npm( - ['--cache=' + CACHE_DIR, '--loglevel=silent', 'install', '.'], - {}, - function (err, code) { - t.ifError(err, 'install ran correctly') - t.notOk(code, 'npm install exited with code 0') - var dependencyPackageJson = path.resolve( - PKG_DIR, - 'node_modules/npm-test-shrinkwrap-local-dependency-dep/package.json' - ) - t.ok( - JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')), - 'package with local dependency installed from shrinkwrap' - ) - - t.end() - } - ) + common.npm(config.concat(['install']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.equal(code, 0, 'npm exited normally') + t.ok(exists(path.join(testdir, 'node_modules', 'mod2')), 'mod2 exists') + t.ok(exists(path.join(testdir, 'node_modules', 'mod2', 'node_modules', 'mod1')), 'mod1 exists') + t.end() + }) }) test('cleanup', function (t) { cleanup() t.end() }) - -function setup () { - cleanup() - mkdirp.sync(PKG_DIR) - mkdirp.sync(CACHE_DIR) - mkdirp.sync(DEP_DIR) - fs.writeFileSync( - path.resolve(PKG_DIR, 'package.json'), - JSON.stringify(root, null, 2) - ) - fs.writeFileSync( - path.resolve(DEP_DIR, 'package.json'), - JSON.stringify(dependency, null, 2) - ) - process.chdir(PKG_DIR) -} - -function cleanNodeModules () { - rimraf.sync(path.resolve(PKG_DIR, 'node_modules')) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - cleanNodeModules() - rimraf.sync(PKG_DIR) -} diff --git a/deps/npm/test/tap/shrinkwrap-optional-platform.js b/deps/npm/test/tap/shrinkwrap-optional-platform.js new file mode 100644 index 00000000000000..09d26f778be303 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-optional-platform.js @@ -0,0 +1,96 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var extend = Object.assign || require('util')._extend +var common = require('../common-tap.js') + +var basedir = path.join(__dirname, path.basename(__filename, '.js')) +var testdir = path.join(basedir, 'testdir') +var cachedir = path.join(basedir, 'cache') +var globaldir = path.join(basedir, 'global') +var tmpdir = path.join(basedir, 'tmp') + +var conf = { + cwd: testdir, + env: extend(extend({}, process.env), { + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn' + }) +} + +var fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + mod1: Dir({ + 'package.json': File({ + name: 'mod1', + version: '1.0.0', + scripts: { + + }, + os: ['nosuchos'] + }) + }), + 'npm-shrinkwrap.json': File({ + name: 'shrinkwrap-optional-platform', + version: '1.0.0', + dependencies: { + mod1: { + version: '1.0.0', + from: 'mod1', + resolved: 'file:mod1', + optional: true + } + } + }), + 'package.json': File({ + name: 'shrinkwrap-optional-platform', + version: '1.0.0', + optionalDependencies: { + mod1: 'file:mod1' + }, + description: 'x', + repository: 'x', + license: 'Artistic-2.0' + }) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + t.done() +}) + +test('example', function (t) { + common.npm(['install'], conf, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install ran ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.notMatch(stderr, /Exit status 1/, 'did not try to install opt dep') + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + diff --git a/deps/npm/test/tap/shrinkwrap-optional-property.js b/deps/npm/test/tap/shrinkwrap-optional-property.js new file mode 100644 index 00000000000000..47f11a750b233d --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-optional-property.js @@ -0,0 +1,100 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'shrinkwrap-optional-dependency') + +test('shrinkwrap adds optional property when optional dependency', function (t) { + t.plan(1) + + mr({port: common.port}, function (er, s) { + function fail (err) { + s.close() // Close on failure to allow node to exit + t.fail(err) + } + + setup(function (err) { + if (err) return fail(err) + + // Install with the optional dependency + npm.install('.', function (err) { + if (err) return fail(err) + + writePackage() + + npm.commands.shrinkwrap([], true, function (err, results) { + if (err) return fail(err) + + t.deepEqual(results, desired) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +var desired = { + name: 'npm-test-shrinkwrap-optional-dependency', + version: '0.0.0', + dependencies: { + 'test-package': { + version: '0.0.0', + from: 'test-package@0.0.0', + resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz' + }, + 'underscore': { + version: '1.3.3', + from: 'underscore@1.3.3', + resolved: 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + optional: true + } + } +} + +var json = { + author: 'Maximilian Antoni', + name: 'npm-test-shrinkwrap-optional-dependency', + version: '0.0.0', + dependencies: { + 'test-package': '0.0.0' + }, + optionalDependencies: { + 'underscore': '1.3.3' + } +} + +function writePackage () { + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) +} + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + writePackage() + process.chdir(pkg) + + var opts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry + } + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js b/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js index 723960ac321699..d3e86fcd659c18 100644 --- a/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js +++ b/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js @@ -70,6 +70,7 @@ var desired = { resolved: common.registry + '/request/-/request-0.9.0.tgz' }, underscore: { + dev: true, version: '1.5.1', from: 'underscore@1.5.1', resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' diff --git a/deps/npm/test/tap/shrinkwrap-prod-dependency.js b/deps/npm/test/tap/shrinkwrap-prod-dependency.js index 5bc834376eb1a3..57d6ecd3b19d9a 100644 --- a/deps/npm/test/tap/shrinkwrap-prod-dependency.js +++ b/deps/npm/test/tap/shrinkwrap-prod-dependency.js @@ -50,6 +50,7 @@ var desired = { resolved: common.registry + '/request/-/request-0.9.0.tgz' }, underscore: { + dev: true, version: '1.5.1', from: 'underscore@1.5.1', resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' diff --git a/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js b/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js new file mode 100644 index 00000000000000..eacea9e3ceafe3 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js @@ -0,0 +1,102 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var installme = path.join(base, 'installme') +var installme_pkg = path.join(installme, 'package.json') +var example = path.join(base, 'example') +var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') +var example_pkg = path.join(example, 'package.json') +var installed_prod = path.join(example, 'node_modules', 'installed-prod') +var installed_prod_pkg = path.join(installed_prod, 'package.json') +var installed_dev = path.join(example, 'node_modules', 'installed-dev') +var installed_dev_pkg = path.join(installed_dev, 'package.json') + +var EXEC_OPTS = { cwd: example } + +var installme_pkg_json = { + name: 'installme', + version: '1.0.0', + dependencies: {} +} + +var example_pkg_json = { + name: 'example', + version: '1.0.0', + dependencies: { + 'installed-prod': '1.0' + }, + devDependencies: { + 'installed-dev': '1.0' + } +} + +var example_shrinkwrap_json = { + name: 'example', + version: '1.0.0', + dependencies: { + 'installed-prod': { + version: '1.0.0' + }, + 'installed-dev': { + version: '1.0.0' + } + } +} + +var installed_prod_pkg_json = { + _id: 'installed-prod@1.0.0', + name: 'installed-prod', + version: '1.0.0' +} + +var installed_dev_pkg_json = { + _id: 'installed-dev@1.0.0', + name: 'installed-dev', + version: '1.0.0' +} + +function writeJson (filename, obj) { + mkdirp.sync(path.dirname(filename)) + fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) +} + +test('setup', function (t) { + cleanup() + writeJson(installme_pkg, installme_pkg_json) + writeJson(example_pkg, example_pkg_json) + writeJson(example_shrinkwrap, example_shrinkwrap_json) + writeJson(installed_prod_pkg, installed_prod_pkg_json) + writeJson(installed_dev_pkg, installed_dev_pkg_json) + t.end() +}) + +test('install --save-dev leaves prod deps alone', function (t) { + common.npm(['install', '--save-dev', 'file://' + installme], EXEC_OPTS, function (er, code, stdout, stderr) { + t.ifError(er, "spawn didn't catch fire") + t.is(code, 0, 'install completed ok') + t.is(stderr, '', 'install completed without error output') + var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) + t.ok(shrinkwrap.dependencies['installed-prod'], "save-dev new install didn't remove prod dep") + t.ok(shrinkwrap.dependencies['installed-dev'], "save-dev new install didn't remove dev dep") + t.ok(shrinkwrap.dependencies.installme, 'save-dev new install DID add new dev dep') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/shrinkwrap-save-dev-without-existing-dev-deps.js b/deps/npm/test/tap/shrinkwrap-save-dev-without-existing-dev-deps.js new file mode 100644 index 00000000000000..436b17895a4838 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-save-dev-without-existing-dev-deps.js @@ -0,0 +1,87 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var installme = path.join(base, 'installme') +var installme_pkg = path.join(installme, 'package.json') +var example = path.join(base, 'example') +var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') +var example_pkg = path.join(example, 'package.json') +var installed = path.join(example, 'node_modules', 'installed') +var installed_pkg = path.join(installed, 'package.json') + +var EXEC_OPTS = { cwd: example } + +var installme_pkg_json = { + name: 'installme', + version: '1.0.0', + dependencies: {} +} + +var example_pkg_json = { + name: 'example', + version: '1.0.0', + dependencies: { + 'installed': '1.0' + }, + devDependencies: {} +} + +var example_shrinkwrap_json = { + name: 'example', + version: '1.0.0', + dependencies: { + installed: { + version: '1.0.0' + } + } +} + +var installed_pkg_json = { + _id: 'installed@1.0.0', + name: 'installed', + version: '1.0.0' +} + +function writeJson (filename, obj) { + mkdirp.sync(path.dirname(filename)) + fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) +} + +test('setup', function (t) { + cleanup() + writeJson(installme_pkg, installme_pkg_json) + writeJson(example_pkg, example_pkg_json) + writeJson(example_shrinkwrap, example_shrinkwrap_json) + writeJson(installed_pkg, installed_pkg_json) + t.end() +}) + +test('install --save-dev leaves dev deps alone', function (t) { + common.npm(['install', '--save-dev', 'file://' + installme], EXEC_OPTS, function (er, code, stdout, stderr) { + t.ifError(er, "spawn didn't catch fire") + t.is(code, 0, 'install completed ok') + t.is(stderr, '', 'install completed without error output') + var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) + t.ok(shrinkwrap.dependencies.installed, "save-dev new install didn't remove dep") + t.notOk(shrinkwrap.dependencies.installme, 'save-dev new install DID NOT add new dev dep') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/shrinkwrap-transitive-dev.js b/deps/npm/test/tap/shrinkwrap-transitive-dev.js new file mode 100644 index 00000000000000..80a38f7f9eb2b6 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-transitive-dev.js @@ -0,0 +1,83 @@ +'use strict' +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var common = require('../common-tap.js') +var File = Tacks.File +var Dir = Tacks.Dir + +var testname = path.basename(__filename, '.js') +var testdir = path.join(__dirname, testname) +var cachedir = path.join(testdir, 'cache') +var swfile = path.join(testdir, 'npm-shrinkwrap.json') +var fixture = new Tacks( + Dir({ + cache: Dir(), + mods: Dir({ + moda: Dir({ + 'package.json': File({ + name: 'moda', + version: '1.0.0', + dependencies: { + modb: '../modb' + } + }) + }), + modb: Dir({ + 'package.json': File({ + name: 'modb', + version: '1.0.0' + }) + }) + }), + 'package.json': File({ + name: testname, + version: '1.0.0', + devDependencies: { + moda: 'file:mods/moda' + } + }) + }) +) + +function setup () { + cleanup() + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +test('setup', function (t) { + setup() + common.npm(['install', '--cache=' + cachedir], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'setup ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.end() + }) +}) + +test('transitive-deps-of-dev-deps', function (t) { + common.npm(['shrinkwrap', '--loglevel=error'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'shrinkwrap ran ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + try { + var shrinkwrap = JSON.parse(fs.readFileSync(swfile)) + t.isDeeply(shrinkwrap.dependencies, {}, 'empty shrinkwrap') + } catch (ex) { + t.ifError(ex) + } + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/update-symlink.js b/deps/npm/test/tap/update-symlink.js index 1447fde628a945..1fb07b8a752efa 100644 --- a/deps/npm/test/tap/update-symlink.js +++ b/deps/npm/test/tap/update-symlink.js @@ -1,6 +1,5 @@ var fs = require('graceful-fs') var path = require('path') -var osenv = require('osenv') var mkdirp = require('mkdirp') var mr = require('npm-registry-mock') var rimraf = require('rimraf') @@ -8,14 +7,17 @@ var test = require('tap').test var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, 'update-symlink') -var originalLog - -var fakeRoot = path.join(__dirname, 'fakeRoot') +var testdir = path.join(__dirname, path.basename(__filename, '.js')) +var pkg = path.resolve(testdir, 'update-symlink') +var cachedir = path.join(testdir, 'cache') +var globaldir = path.join(testdir, 'global') var OPTS = { env: { - 'npm_config_prefix': fakeRoot - } + 'npm_config_cache': cachedir, + 'npm_config_prefix': globaldir, + 'npm_config_registry': common.registry + }, + cwd: pkg } var jsonLocal = { @@ -28,57 +30,92 @@ var jsonLocal = { } } +var server test('setup', function (t) { cleanup() - originalLog = console.log + mkdirp.sync(cachedir) mkdirp.sync(pkg) - common.npm(['install', '-g', 'underscore@1.3.1'], OPTS, function (err, c, out) { + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(jsonLocal, null, 2) + ) + + mr({ port: common.port }, thenInstallUnderscore) + + function thenInstallUnderscore (er, s) { + server = s + common.npm(['install', '-g', 'underscore@1.3.1'], OPTS, thenLink) + } + + function thenLink (err, c, out) { t.ifError(err, 'global install did not error') - process.chdir(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(jsonLocal, null, 2) - ) - common.npm(['link', 'underscore'], OPTS, function (err, c, out) { - t.ifError(err, 'link did not error') - common.npm(['install', 'async@0.2.9'], OPTS, function (err, c, out) { - t.ifError(err, 'local install did not error') - common.npm(['ls'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /async@0.2.9/, 'installed ok') - t.has(out, /underscore@1.3.1/, 'creates local link ok') - t.end() - }) - }) - }) - }) -}) + common.npm(['link', 'underscore'], OPTS, thenInstallAsync) + } -test('when update is called linked packages should be excluded', function (t) { - console.log = function () {} - mr({ port: common.port }, function (er, s) { - common.npm(['update'], OPTS, function (err, c, out, stderr) { + function thenInstallAsync (err, c, out) { + t.ifError(err, 'link did not error') + common.npm(['install', 'async@0.2.9'], OPTS, thenVerify) + } + + function thenVerify (err, c, out) { + t.ifError(err, 'local install did not error') + common.npm(['ls'], OPTS, function (err, c, out, stderr) { t.ifError(err) - t.has(out, /async@1.5.2/, 'updated ok') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - s.close() + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /async@0.2.9/, 'installed ok') + t.has(out, /underscore@1.3.1/, 'creates local link ok') t.end() }) + } +}) + +test('when update is called linked packages should be excluded', function (t) { + common.npm(['update'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.has(out, /async@0.2.10/, 'updated ok') + t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') + t.end() + }) +}) + +test('when install is called and the package already exists as a link, outputs a warning if the requested version is not the same as the linked one', function (t) { + common.npm(['install', 'underscore'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + + t.comment(out.trim()) + t.comment(stderr.trim()) + t.doesNotHave(out, /underscore/, 'linked package not updated') + t.has(stderr, /underscore/, 'warning output relating to linked package') + t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') + t.end() + }) +}) + +test('when install is called and the package already exists as a link, does not warn if the requested version is same as the linked one', function (t) { + common.npm(['install', 'underscore@1.3.1'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.comment(out.trim()) + t.comment(stderr.trim()) + t.doesNotHave(out, /underscore/, 'linked package not updated') + t.doesNotHave(stderr, /underscore/, 'no warning or error relating to linked package') + t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') + t.end() }) }) test('cleanup', function (t) { + server.close() common.npm(['rm', 'underscore', 'async'], OPTS, function (err, code) { t.ifError(err, 'npm removed the linked package without error') t.equal(code, 0, 'cleanup in local ok') - process.chdir(osenv.tmpdir()) common.npm(['rm', '-g', 'underscore'], OPTS, function (err, code) { t.ifError(err, 'npm removed the global package without error') t.equal(code, 0, 'cleanup in global ok') - console.log = originalLog cleanup() t.end() }) @@ -86,6 +123,5 @@ test('cleanup', function (t) { }) function cleanup () { - rimraf.sync(pkg) - rimraf.sync(fakeRoot) + rimraf.sync(testdir) } From 4d41bd9c68136194f3afcf2be872da281ea5c425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 22 Sep 2016 08:01:49 -0700 Subject: [PATCH 002/216] deps: hotfix upgrade npm tap version for tests PR-URL: https://github.com/nodejs/node/pull/8706 Reviewed-By: Jeremiah Senkpiel --- deps/npm/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/npm/package.json b/deps/npm/package.json index 860059b4f5ed29..55659aab66248a 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -196,7 +196,7 @@ "sprintf-js": "~1.0.3", "standard": "~6.0.8", "tacks": "~1.2.1", - "tap": "~6.3.2" + "tap": "~7.0.0" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", From 3222b66abe506d644a3dbefa91c92d6c914e8e25 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Tue, 13 Sep 2016 20:15:51 -0700 Subject: [PATCH 003/216] inspector: fix tests on Windows Should help with https://github.com/nodejs/node/pull/8034. PR-URL: https://github.com/nodejs/node/pull/8528 Reviewed-By: bnoordhuis - Ben Noordhuis --- src/inspector_socket.cc | 10 ++++- test/cctest/test_inspector_socket.cc | 56 +++++++++++++++++++--------- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index 0399f984d7df57..ddf9e865229d4a 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -450,14 +450,20 @@ static void close_and_report_handshake_failure(inspector_socket_t* inspector) { } } +static void then_close_and_report_failure(uv_write_t* req, int status) { + inspector_socket_t* inspector = WriteRequest::from_write_req(req)->inspector; + write_request_cleanup(req, status); + close_and_report_handshake_failure(inspector); +} + static void handshake_failed(inspector_socket_t* inspector) { const char HANDSHAKE_FAILED_RESPONSE[] = "HTTP/1.0 400 Bad Request\r\n" "Content-Type: text/html; charset=UTF-8\r\n\r\n" "WebSockets request was expected\r\n"; write_to_client(inspector, HANDSHAKE_FAILED_RESPONSE, - sizeof(HANDSHAKE_FAILED_RESPONSE) - 1); - close_and_report_handshake_failure(inspector); + sizeof(HANDSHAKE_FAILED_RESPONSE) - 1, + then_close_and_report_failure); } // init_handshake references message_complete_cb diff --git a/test/cctest/test_inspector_socket.cc b/test/cctest/test_inspector_socket.cc index 23d382ebe63c57..83e538be5a8889 100644 --- a/test/cctest/test_inspector_socket.cc +++ b/test/cctest/test_inspector_socket.cc @@ -9,16 +9,14 @@ static const int MAX_LOOP_ITERATIONS = 10000; #define SPIN_WHILE(condition) \ { \ bool timed_out = false; \ - timeout_timer.data = &timed_out; \ - uv_timer_start(&timeout_timer, set_timeout_flag, 5000, 0); \ + uv_timer_t* timer = start_timer(&timed_out); \ while (((condition)) && !timed_out) { \ uv_run(&loop, UV_RUN_NOWAIT); \ } \ ASSERT_FALSE((condition)); \ - uv_timer_stop(&timeout_timer); \ + cleanup_timer(timer); \ } -static uv_timer_t timeout_timer; static bool connected = false; static bool inspector_ready = false; static int handshake_events = 0; @@ -46,10 +44,33 @@ static const char HANDSHAKE_REQ[] = "GET /ws/path HTTP/1.1\r\n" "Sec-WebSocket-Key: aaa==\r\n" "Sec-WebSocket-Version: 13\r\n\r\n"; +static void dispose_handle(uv_handle_t* handle) { + *static_cast(handle->data) = true; +} + static void set_timeout_flag(uv_timer_t* timer) { *(static_cast(timer->data)) = true; } +static uv_timer_t* start_timer(bool* flag) { + uv_timer_t* timer = new uv_timer_t(); + uv_timer_init(&loop, timer); + timer->data = flag; + uv_timer_start(timer, set_timeout_flag, 5000, 0); + return timer; +} + +static void cleanup_timer(uv_timer_t* timer) { + bool done = false; + timer->data = &done; + uv_timer_stop(timer); + uv_close(reinterpret_cast(timer), dispose_handle); + while (!done) { + uv_run(&loop, UV_RUN_NOWAIT); + } + delete timer; +} + static void stop_if_stop_path(enum inspector_handshake_event state, const std::string& path, bool* cont) { *cont = path.empty() || path != "/close"; @@ -87,7 +108,7 @@ static void do_write(const char* data, int len) { uv_buf_t buf[1]; buf[0].base = const_cast(data); buf[0].len = len; - uv_write(&req, reinterpret_cast(&client_socket), buf, 1, + uv_write(&req, reinterpret_cast(&client_socket), buf, 1, write_done); SPIN_WHILE(req.data); } @@ -124,7 +145,7 @@ static void check_data_cb(read_expects* expectation, ssize_t nread, static void check_data_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { bool retval = false; - read_expects* expects = static_cast(stream->data); + read_expects* expects = static_cast(stream->data); expects->callback_called = true; check_data_cb(expects, nread, buf, &retval); if (retval) { @@ -154,17 +175,18 @@ static void fail_callback(uv_stream_t* stream, ssize_t nread, } static void expect_nothing_on_client() { - int err = uv_read_start(reinterpret_cast(&client_socket), - buffer_alloc_cb, fail_callback); + uv_stream_t* stream = reinterpret_cast(&client_socket); + int err = uv_read_start(stream, buffer_alloc_cb, fail_callback); GTEST_ASSERT_EQ(0, err); for (int i = 0; i < MAX_LOOP_ITERATIONS; i++) uv_run(&loop, UV_RUN_NOWAIT); + uv_read_stop(stream); } static void expect_on_client(const char* data, size_t len) { read_expects expectation = prepare_expects(data, len); client_socket.data = ℰ - uv_read_start(reinterpret_cast(&client_socket), + uv_read_start(reinterpret_cast(&client_socket), buffer_alloc_cb, check_data_cb); SPIN_WHILE(!expectation.read_expected); } @@ -256,7 +278,7 @@ static void inspector_record_error_code(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { inspector_socket_t *inspector = inspector_from_stream(stream); // Increment instead of assign is to ensure the function is only called once - *(static_cast(inspector->data)) += nread; + *(static_cast(inspector->data)) += nread; } static void expect_server_read_error() { @@ -325,18 +347,17 @@ class InspectorSocketTest : public ::testing::Test { client_socket = uv_tcp_t(); server.data = &inspector; sockaddr_in addr; - uv_timer_init(&loop, &timeout_timer); uv_tcp_init(&loop, &server); uv_tcp_init(&loop, &client_socket); - uv_ip4_addr("localhost", PORT, &addr); - uv_tcp_bind(&server, reinterpret_cast(&addr), 0); - int err = uv_listen(reinterpret_cast(&server), - 0, on_new_connection); + uv_ip4_addr("127.0.0.1", PORT, &addr); + uv_tcp_bind(&server, reinterpret_cast(&addr), 0); + int err = uv_listen(reinterpret_cast(&server), + 1, on_new_connection); GTEST_ASSERT_EQ(0, err); uv_connect_t connect; connect.data = nullptr; uv_tcp_connect(&connect, &client_socket, - reinterpret_cast(&addr), on_connection); + reinterpret_cast(&addr), on_connection); uv_tcp_nodelay(&client_socket, 1); // The buffering messes up the test SPIN_WHILE(!connect.data || !connected); really_close(reinterpret_cast(&server)); @@ -344,7 +365,6 @@ class InspectorSocketTest : public ::testing::Test { virtual void TearDown() { really_close(reinterpret_cast(&client_socket)); - really_close(reinterpret_cast(&timeout_timer)); EXPECT_TRUE(inspector.buffer.empty()); expectations* expects = static_cast(inspector.data); if (expects != nullptr) { @@ -753,7 +773,7 @@ TEST_F(InspectorSocketTest, WriteBeforeHandshake) { static void CleanupSocketAfterEOF_close_cb(inspector_socket_t* inspector, int status) { - *(static_cast(inspector->data)) = true; + *(static_cast(inspector->data)) = true; } static void CleanupSocketAfterEOF_read_cb(uv_stream_t* stream, ssize_t nread, From 0b90ff7a8da9eabea3d21c4da33626fcd56b62d7 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Thu, 1 Sep 2016 16:25:02 -0700 Subject: [PATCH 004/216] inspector: introduce a smoke test This test executes a simple debug session over the inspector protocol. PR-URL: https://github.com/nodejs/node/pull/8429 Reviewed-By: ofrobots - Ali Ijaz Sheikh --- Makefile | 7 +- src/inspector_agent.cc | 3 + src/inspector_socket.cc | 2 +- test/README.md | 9 + test/fixtures/loop.js | 10 + test/inspector/inspector-helper.js | 424 +++++++++++++++++++++++++++++ test/inspector/test-inspector.js | 167 ++++++++++++ test/inspector/testcfg.py | 6 + tools/test.py | 1 + vcbuild.bat | 7 +- 10 files changed, 630 insertions(+), 6 deletions(-) create mode 100644 test/fixtures/loop.js create mode 100644 test/inspector/inspector-helper.js create mode 100644 test/inspector/test-inspector.js create mode 100644 test/inspector/testcfg.py diff --git a/Makefile b/Makefile index 4b3886aced4521..6f955b5e3ae24d 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ test: all $(MAKE) build-addons $(MAKE) cctest $(PYTHON) tools/test.py --mode=release -J \ - addons doctool known_issues message pseudo-tty parallel sequential + addons doctool inspector known_issues message pseudo-tty parallel sequential $(MAKE) lint test-parallel: all @@ -193,7 +193,7 @@ test-all-valgrind: test-build $(PYTHON) tools/test.py --mode=debug,release --valgrind CI_NATIVE_SUITES := addons -CI_JS_SUITES := doctool known_issues message parallel pseudo-tty sequential +CI_JS_SUITES := doctool inspector known_issues message parallel pseudo-tty sequential # Build and test addons without building anything else test-ci-native: | test/addons/.buildstamp @@ -233,6 +233,9 @@ test-internet: all test-debugger: all $(PYTHON) tools/test.py debugger +test-inspector: all + $(PYTHON) tools/test.py inspector + test-known-issues: all $(PYTHON) tools/test.py known_issues diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index d1c12d6e5a99f6..9c1dc6b8995c8e 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -48,6 +48,7 @@ void PrintDebuggerReadyMessage(int port) { "@%s/inspector.html?" "experiments=true&v8only=true&ws=localhost:%d/node\n", port, DEVTOOLS_HASH, port); + fflush(stderr); } bool AcceptsConnection(inspector_socket_t* socket, const std::string& path) { @@ -525,6 +526,7 @@ bool AgentImpl::IsStarted() { void AgentImpl::WaitForDisconnect() { shutting_down_ = true; fprintf(stderr, "Waiting for the debugger to disconnect...\n"); + fflush(stderr); inspector_->runMessageLoopOnPause(0); } @@ -620,6 +622,7 @@ bool AgentImpl::OnInspectorHandshakeIO(inspector_socket_t* socket, return false; default: UNREACHABLE(); + return false; } } diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index ddf9e865229d4a..5160843ff2dfe6 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -33,7 +33,7 @@ static void dump_hex(const char* buf, size_t len) { while (ptr < end) { cptr = ptr; for (i = 0; i < 16 && ptr < end; i++) { - printf("%2.2X ", *(ptr++)); + printf("%2.2X ", static_cast(*(ptr++))); } for (i = 72 - (i * 4); i > 0; i--) { printf(" "); diff --git a/test/README.md b/test/README.md index 73512413c02834..a32266f085d71e 100644 --- a/test/README.md +++ b/test/README.md @@ -54,6 +54,15 @@ Tests for garbage collection related functionality. |:----------:| | No | + +### inspector + +Tests for the V8 inspector integration. + +| Runs on CI | +|:----------:| +| Yes | + ### internet Tests that make real outbound connections (mainly networking related modules). diff --git a/test/fixtures/loop.js b/test/fixtures/loop.js new file mode 100644 index 00000000000000..e91b831d01b816 --- /dev/null +++ b/test/fixtures/loop.js @@ -0,0 +1,10 @@ +var t = 1; +var k = 1; +console.log('A message', 5); +while (t > 0) { + if (t++ === 1000) { + t = 0; + console.log('Outputed message #' + k++); + } +} +process.exit(55); diff --git a/test/inspector/inspector-helper.js b/test/inspector/inspector-helper.js new file mode 100644 index 00000000000000..865ddeb3b5fefa --- /dev/null +++ b/test/inspector/inspector-helper.js @@ -0,0 +1,424 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const http = require('http'); +const path = require('path'); +const spawn = require('child_process').spawn; + +const TIMEOUT = 15 * 1000; + +const mainScript = path.join(common.fixturesDir, 'loop.js'); + +function send(socket, message, id, callback) { + const msg = JSON.parse(JSON.stringify(message)); // Clone! + msg['id'] = id; + const messageBuf = Buffer.from(JSON.stringify(msg)); + + const wsHeaderBuf = Buffer.allocUnsafe(16); + wsHeaderBuf.writeUInt8(0x81, 0); + let byte2 = 0x80; + const bodyLen = messageBuf.length; + let maskOffset = 2; + if (bodyLen < 126) { + byte2 = 0x80 + bodyLen; + } else if (bodyLen < 65536) { + byte2 = 0xFE; + wsHeaderBuf.writeUInt16BE(bodyLen, 2); + maskOffset = 4; + } else { + byte2 = 0xFF; + wsHeaderBuf.writeUInt32BE(bodyLen, 2); + wsHeaderBuf.writeUInt32BE(0, 6); + maskOffset = 10; + } + wsHeaderBuf.writeUInt8(byte2, 1); + wsHeaderBuf.writeUInt32BE(0x01020408, maskOffset); + + for (let i = 0; i < messageBuf.length; i++) + messageBuf[i] = messageBuf[i] ^ (1 << (i % 4)); + socket.write( + Buffer.concat([wsHeaderBuf.slice(0, maskOffset + 4), messageBuf]), + callback); +} + +function parseWSFrame(buffer, handler) { + if (buffer.length < 2) + return 0; + assert.strictEqual(0x81, buffer[0]); + let dataLen = 0x7F & buffer[1]; + let bodyOffset = 2; + if (buffer.length < bodyOffset + dataLen) + return 0; + if (dataLen === 126) { + dataLen = buffer.readUInt16BE(2); + bodyOffset = 4; + } else if (dataLen === 127) { + dataLen = buffer.readUInt32BE(2); + bodyOffset = 10; + } + if (buffer.length < bodyOffset + dataLen) + return 0; + const message = JSON.parse( + buffer.slice(bodyOffset, bodyOffset + dataLen).toString('utf8')); + handler(message); + return bodyOffset + dataLen; +} + +function tearDown(child, err) { + child.kill(); + if (err instanceof Error) { + console.error(err.stack); + process.exit(1); + } +} + +function checkHttpResponse(port, path, callback) { + http.get({port, path}, function(res) { + let response = ''; + res.setEncoding('utf8'); + res. + on('data', (data) => response += data.toString()). + on('end', () => callback(JSON.parse(response))); + }); +} + +function makeBufferingDataCallback(dataCallback) { + let buffer = new Buffer(0); + return (data) => { + const newData = Buffer.concat([buffer, data]); + const str = newData.toString('utf8'); + const lines = str.split('\n'); + if (str.endsWith('\n')) + buffer = new Buffer(0); + else + buffer = Buffer.from(lines.pop(), 'utf8'); + for (var line of lines) + dataCallback(line); + }; +} + +function timeout(message, multiplicator) { + return setTimeout(() => common.fail(message), TIMEOUT * (multiplicator || 1)); +} + +const TestSession = function(socket, harness) { + this.mainScriptPath = harness.mainScriptPath; + this.mainScriptId = null; + + this.harness_ = harness; + this.socket_ = socket; + this.expectClose_ = false; + this.scripts_ = {}; + this.messagefilter_ = null; + this.responseCheckers_ = {}; + this.lastId_ = 0; + this.messages_ = {}; + this.expectedId_ = 1; + this.lastMessageResponseCallback_ = null; + + let buffer = Buffer.from(''); + socket.on('data', (data) => { + buffer = Buffer.concat([buffer, data]); + let consumed; + do { + consumed = parseWSFrame(buffer, this.processMessage_.bind(this)); + if (consumed) + buffer = buffer.slice(consumed); + } while (consumed); + }).on('close', () => assert(this.expectClose_, 'Socket closed prematurely')); +}; + +TestSession.prototype.scriptUrlForId = function(id) { + return this.scripts_[id]; +}; + +TestSession.prototype.processMessage_ = function(message) { + const method = message['method']; + if (method === 'Debugger.scriptParsed') { + const script = message['params']; + const scriptId = script['scriptId']; + const url = script['url']; + this.scripts_[scriptId] = url; + if (url === mainScript) + this.mainScriptId = scriptId; + } + this.messagefilter_ && this.messagefilter_(message); + const id = message['id']; + if (id) { + assert.strictEqual(id, this.expectedId_); + this.expectedId_++; + if (this.responseCheckers_[id]) { + assert(message['result'], JSON.stringify(message) + ' (response to ' + + JSON.stringify(this.messages_[id]) + ')'); + this.responseCheckers_[id](message['result']); + delete this.responseCheckers_[id]; + } + assert(!message['error'], JSON.stringify(message) + ' (replying to ' + + JSON.stringify(this.messages_[id]) + ')'); + delete this.messages_[id]; + if (id === this.lastId_) { + this.lastMessageResponseCallback_ && this.lastMessageResponseCallback_(); + this.lastMessageResponseCallback_ = null; + } + } +}; + +TestSession.prototype.sendAll_ = function(commands, callback) { + if (!commands.length) { + callback(); + } else { + this.lastId_++; + let command = commands[0]; + if (command instanceof Array) { + this.responseCheckers_[this.lastId_] = command[1]; + command = command[0]; + } + if (command instanceof Function) + command = command(); + this.messages_[this.lastId_] = command; + send(this.socket_, command, this.lastId_, + () => this.sendAll_(commands.slice(1), callback)); + } +}; + +TestSession.prototype.sendInspectorCommands = function(commands) { + if (!(commands instanceof Array)) + commands = [commands]; + return this.enqueue((callback) => { + let timeoutId = null; + this.lastMessageResponseCallback_ = () => { + timeoutId && clearTimeout(timeoutId); + callback(); + }; + this.sendAll_(commands, () => { + timeoutId = setTimeout(() => { + let s = ''; + for (const id in this.messages_) { + s += this.messages_[id] + '\n'; + } + common.fail(s.substring(0, s.length - 1)); + }, TIMEOUT); + }); + }); +}; + +TestSession.prototype.createCallbackWithTimeout_ = function(message) { + var promise = new Promise((resolve) => { + this.enqueue((callback) => { + const timeoutId = timeout(message); + resolve(() => { + clearTimeout(timeoutId); + callback(); + }); + }); + }); + return () => promise.then((callback) => callback()); +}; + +TestSession.prototype.expectMessages = function(expects) { + if (!(expects instanceof Array)) expects = [ expects ]; + + const callback = this.createCallbackWithTimeout_( + 'Matching response was not received:\n' + expects[0]); + this.messagefilter_ = (message) => { + if (expects[0](message)) + expects.shift(); + if (!expects.length) { + this.messagefilter_ = null; + callback(); + } + }; + return this; +}; + +TestSession.prototype.expectStderrOutput = function(regexp) { + this.harness_.addStderrFilter( + regexp, + this.createCallbackWithTimeout_('Timed out waiting for ' + regexp)); + return this; +}; + +TestSession.prototype.runNext_ = function() { + if (this.task_) { + setTimeout(() => { + this.task_(() => { + this.task_ = this.task_.next_; + this.runNext_(); + }); + }); + } +}; + +TestSession.prototype.enqueue = function(task) { + if (!this.task_) { + this.task_ = task; + this.runNext_(); + } else { + let t = this.task_; + while (t.next_) + t = t.next_; + t.next_ = task; + } + return this; +}; + +TestSession.prototype.disconnect = function(childDone) { + return this.enqueue((callback) => { + this.expectClose_ = true; + this.harness_.childInstanceDone = + this.harness_.childInstanceDone || childDone; + this.socket_.end(); + callback(); + }); +}; + +const Harness = function(port, childProcess) { + this.port = port; + this.mainScriptPath = mainScript; + this.stderrFilters_ = []; + this.process_ = childProcess; + this.childInstanceDone = false; + this.returnCode_ = null; + this.running_ = true; + + childProcess.stdout.on('data', makeBufferingDataCallback( + (line) => console.log('[out]', line))); + + + childProcess.stderr.on('data', makeBufferingDataCallback((message) => { + const pending = []; + console.log('[err]', message); + for (const filter of this.stderrFilters_) + if (!filter(message)) pending.push(filter); + this.stderrFilters_ = pending; + })); + childProcess.on('close', (code, signal) => { + assert(this.childInstanceDone, 'Child instance died prematurely'); + this.returnCode_ = code; + this.running_ = false; + }); +}; + +Harness.prototype.addStderrFilter = function(regexp, callback) { + this.stderrFilters_.push((message) => { + if (message.match(regexp)) { + callback(); + return true; + } + }); +}; + +Harness.prototype.run_ = function() { + setTimeout(() => { + this.task_(() => { + this.task_ = this.task_.next_; + if (this.task_) + this.run_(); + }); + }); +}; + +Harness.prototype.enqueue_ = function(task) { + if (!this.task_) { + this.task_ = task; + this.run_(); + } else { + let chain = this.task_; + while (chain.next_) + chain = chain.next_; + chain.next_ = task; + } + return this; +}; + +Harness.prototype.testHttpResponse = function(path, check) { + return this.enqueue_((doneCallback) => { + checkHttpResponse(this.port, path, (response) => { + check.call(this, response); + doneCallback(); + }); + }); +}; + +Harness.prototype.runFrontendSession = function(tests) { + return this.enqueue_((callback) => { + http.get({ + port: this.port, + path: '/node', + headers: { + 'Connection': 'Upgrade', + 'Upgrade': 'websocket', + 'Sec-WebSocket-Version': 13, + 'Sec-WebSocket-Key': 'key==' + } + }).on('upgrade', (message, socket) => { + const session = new TestSession(socket, this); + if (!(tests instanceof Array)) + tests = [tests]; + function enqueue(tests) { + session.enqueue((sessionCb) => { + if (tests.length) { + tests[0](session); + session.enqueue((cb2) => { + enqueue(tests.slice(1)); + cb2(); + }); + } else { + callback(); + } + sessionCb(); + }); + } + enqueue(tests); + }).on('response', () => common.fail('Upgrade was not received')); + }); +}; + +Harness.prototype.expectShutDown = function(errorCode) { + this.enqueue_((callback) => { + if (this.running_) { + const timeoutId = timeout('Have not terminated'); + this.process_.on('exit', (code) => { + clearTimeout(timeoutId); + assert.strictEqual(errorCode, code); + callback(); + }); + } else { + assert.strictEqual(errorCode, this.returnCode_); + callback(); + } + }); +}; + +exports.startNodeForInspectorTest = function(callback) { + const child = spawn(process.execPath, + [ '--inspect', '--debug-brk', mainScript ]); + + const timeoutId = timeout('Child process did not start properly', 4); + + let found = false; + + const dataCallback = makeBufferingDataCallback((text) => { + clearTimeout(timeoutId); + console.log('[err]', text); + if (found) return; + const match = text.match(/Debugger listening on port (\d+)/); + found = true; + child.stderr.removeListener('data', dataCallback); + assert.ok(match, text); + callback(new Harness(match[1], child)); + }); + + child.stderr.on('data', dataCallback); + + const handler = tearDown.bind(null, child); + + process.on('exit', handler); + process.on('uncaughtException', handler); + process.on('SIGINT', handler); +}; + +exports.mainScriptSource = function() { + return fs.readFileSync(mainScript, 'utf8'); +}; diff --git a/test/inspector/test-inspector.js b/test/inspector/test-inspector.js new file mode 100644 index 00000000000000..2e550f6a02677c --- /dev/null +++ b/test/inspector/test-inspector.js @@ -0,0 +1,167 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const helper = require('./inspector-helper.js'); + +let scopeId; + +function checkListResponse(response) { + assert.strictEqual(1, response.length); + assert.ok(response[0]['devtoolsFrontendUrl']); + assert.strictEqual('ws://localhost:' + this.port + '/node', + response[0]['webSocketDebuggerUrl']); +} + +function expectMainScriptSource(result) { + const expected = helper.mainScriptSource(); + const source = result['scriptSource']; + assert(source && (source.indexOf(expected) >= 0), + 'Script source is wrong: ' + source); +} + +function setupExpectBreakOnLine(line, url, session, scopeIdCallback) { + return function(message) { + if ('Debugger.paused' === message['method']) { + const callFrame = message['params']['callFrames'][0]; + const location = callFrame['location']; + assert.strictEqual(url, session.scriptUrlForId(location['scriptId'])); + assert.strictEqual(line, location['lineNumber']); + scopeIdCallback && + scopeIdCallback(callFrame['scopeChain'][0]['object']['objectId']); + return true; + } + }; +} + +function setupExpectConsoleOutput(type, values) { + if (!(values instanceof Array)) + values = [ values ]; + return function(message) { + if ('Runtime.consoleAPICalled' === message['method']) { + const params = message['params']; + if (params['type'] === type) { + let i = 0; + for (const value of params['args']) { + if (value['value'] !== values[i++]) + return false; + } + return i === values.length; + } + } + }; +} + +function setupExpectScopeValues(expected) { + return function(result) { + for (const actual of result['result']) { + const value = expected[actual['name']]; + if (value) + assert.strictEqual(value, actual['value']['value']); + } + }; +} + +function setupExpectValue(value) { + return function(result) { + assert.strictEqual(value, result['result']['value']); + }; +} + +function testBreakpointOnStart(session) { + console.log('[test]', + 'Verifying debugger stops on start (--debug-brk option)'); + const commands = [ + { 'method': 'Runtime.enable' }, + { 'method': 'Debugger.enable' }, + { 'method': 'Debugger.setPauseOnExceptions', + 'params': {'state': 'none'} }, + { 'method': 'Debugger.setAsyncCallStackDepth', + 'params': {'maxDepth': 0} }, + { 'method': 'Profiler.enable' }, + { 'method': 'Profiler.setSamplingInterval', + 'params': {'interval': 100} }, + { 'method': 'Debugger.setBlackboxPatterns', + 'params': {'patterns': []} }, + { 'method': 'Runtime.runIfWaitingForDebugger' } + ]; + + session. + sendInspectorCommands(commands). + expectMessages(setupExpectBreakOnLine(0, session.mainScriptPath, session)); +} + +function testSetBreakpointAndResume(session) { + console.log('[test]', 'Setting a breakpoint and verifying it is hit'); + const commands = [ + { 'method': 'Debugger.setBreakpointByUrl', + 'params': { 'lineNumber': 5, + 'url': session.mainScriptPath, + 'columnNumber': 0, + 'condition': '' + } + }, + { 'method': 'Debugger.resume'}, + [ { 'method': 'Debugger.getScriptSource', + 'params': { 'scriptId': session.mainScriptId } }, + expectMainScriptSource ], + ]; + session. + sendInspectorCommands(commands). + expectMessages([ + setupExpectConsoleOutput('log', ['A message', 5]), + setupExpectBreakOnLine(5, session.mainScriptPath, + session, (id) => scopeId = id), + ]); +} + +function testInspectScope(session) { + console.log('[test]', 'Verify we can read current application state'); + session.sendInspectorCommands([ + [ + { + 'method': 'Runtime.getProperties', + 'params': { + 'objectId': scopeId, + 'ownProperties': false, + 'accessorPropertiesOnly': false, + 'generatePreview': true + } + }, setupExpectScopeValues({t: 1001, k: 1}) + ], + [ + { + 'method': 'Debugger.evaluateOnCallFrame', 'params': { + 'callFrameId': '{\"ordinal\":0,\"injectedScriptId\":1}', + 'expression': 'k + t', + 'objectGroup': 'console', + 'includeCommandLineAPI': true, + 'silent': false, + 'returnByValue': false, + 'generatePreview': true + } + }, setupExpectValue(1002) + ], + ]); +} + +function testWaitsForFrontendDisconnect(session, harness) { + console.log('[test]', 'Verify node waits for the frontend to disconnect'); + session.sendInspectorCommands({ 'method': 'Debugger.resume'}). + expectStderrOutput('Waiting for the debugger to disconnect...'). + disconnect(true); +} + +function runTests(harness) { + harness + .testHttpResponse('/json', checkListResponse) + .testHttpResponse('/json/list', checkListResponse) + .testHttpResponse('/json/version', assert.ok) + .runFrontendSession([ + testBreakpointOnStart, + testSetBreakpointAndResume, + testInspectScope, + testWaitsForFrontendDisconnect + ]).expectShutDown(55); +} + +helper.startNodeForInspectorTest(runTests); diff --git a/test/inspector/testcfg.py b/test/inspector/testcfg.py new file mode 100644 index 00000000000000..93182b6abed515 --- /dev/null +++ b/test/inspector/testcfg.py @@ -0,0 +1,6 @@ +import sys, os +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) +import testpy + +def GetConfiguration(context, root): + return testpy.SimpleTestConfiguration(context, root, 'inspector') diff --git a/tools/test.py b/tools/test.py index 2613ad59d7dbc3..b543010990c364 100755 --- a/tools/test.py +++ b/tools/test.py @@ -1465,6 +1465,7 @@ def ExpandCommand(args): 'gc', 'debugger', 'doctool', + 'inspector', ] diff --git a/vcbuild.bat b/vcbuild.bat index 31fe8670ab4268..fafa5491d0b570 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -57,14 +57,15 @@ if /i "%1"=="noetw" set noetw=1&goto arg-ok if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok if /i "%1"=="licensertf" set licensertf=1&goto arg-ok if /i "%1"=="test" set test_args=%test_args% addons doctool known_issues message parallel sequential -J&set jslint=1&set build_addons=1&goto arg-ok -if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons doctool known_issues message sequential parallel&set build_addons=1&goto arg-ok +if /i "%1"=="test-ci" set test_args=%test_args% %test_ci_args% -p tap --logfile test.tap addons doctool inspector known_issues message sequential parallel&set build_addons=1&goto arg-ok if /i "%1"=="test-addons" set test_args=%test_args% addons&set build_addons=1&goto arg-ok if /i "%1"=="test-simple" set test_args=%test_args% sequential parallel -J&goto arg-ok if /i "%1"=="test-message" set test_args=%test_args% message&goto arg-ok if /i "%1"=="test-gc" set test_args=%test_args% gc&set buildnodeweak=1&goto arg-ok +if /i "%1"=="test-inspector" set test_args=%test_args% inspector&goto arg-ok if /i "%1"=="test-internet" set test_args=%test_args% internet&goto arg-ok if /i "%1"=="test-pummel" set test_args=%test_args% pummel&goto arg-ok -if /i "%1"=="test-all" set test_args=%test_args% sequential parallel message gc internet pummel&set buildnodeweak=1&set jslint=1&goto arg-ok +if /i "%1"=="test-all" set test_args=%test_args% sequential parallel message gc inspector internet pummel&set buildnodeweak=1&set jslint=1&goto arg-ok if /i "%1"=="test-known-issues" set test_args=%test_args% known_issues&goto arg-ok if /i "%1"=="jslint" set jslint=1&goto arg-ok if /i "%1"=="jslint-ci" set jslint_ci=1&goto arg-ok @@ -387,7 +388,7 @@ echo Failed to create vc project files. goto exit :help -echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] +echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build From b05ce842cef00eaff4f796c1565261d962511a09 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Wed, 14 Sep 2016 10:15:38 -0700 Subject: [PATCH 005/216] inspector: zero out structure members Ctor has to be added as memset to 0 is no longer an option, since the structure now has std::vector member. Attempt at fixing nodejs/node#8155 (so far I was not able to repro it) PR-URL: https://github.com/nodejs/node/pull/8536 Reviewed-By: bnoordhuis - Ben Noordhuis --- src/inspector_agent.cc | 37 +++++++------ src/inspector_socket.cc | 80 ++++++++++++++++------------ src/inspector_socket.h | 46 ++++++++++------ test/cctest/test_inspector_socket.cc | 18 ++++--- 4 files changed, 104 insertions(+), 77 deletions(-) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 9c1dc6b8995c8e..60844d20eb8bfc 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -32,6 +32,7 @@ #endif namespace node { +namespace inspector { namespace { const char TAG_CONNECT[] = "#connect"; @@ -51,7 +52,7 @@ void PrintDebuggerReadyMessage(int port) { fflush(stderr); } -bool AcceptsConnection(inspector_socket_t* socket, const std::string& path) { +bool AcceptsConnection(InspectorSocket* socket, const std::string& path) { return StringEqualNoCaseN(path.c_str(), DEVTOOLS_PATH, sizeof(DEVTOOLS_PATH) - 1); } @@ -62,11 +63,11 @@ void Escape(std::string* string) { } } -void DisposeInspector(inspector_socket_t* socket, int status) { +void DisposeInspector(InspectorSocket* socket, int status) { delete socket; } -void DisconnectAndDisposeIO(inspector_socket_t* socket) { +void DisconnectAndDisposeIO(InspectorSocket* socket) { if (socket) { inspector_close(socket, DisposeInspector); } @@ -77,7 +78,7 @@ void OnBufferAlloc(uv_handle_t* handle, size_t len, uv_buf_t* buf) { buf->len = len; } -void SendHttpResponse(inspector_socket_t* socket, const char* response, +void SendHttpResponse(InspectorSocket* socket, const char* response, size_t len) { const char HEADERS[] = "HTTP/1.0 200 OK\r\n" "Content-Type: application/json; charset=UTF-8\r\n" @@ -90,7 +91,7 @@ void SendHttpResponse(inspector_socket_t* socket, const char* response, inspector_write(socket, response, len); } -void SendVersionResponse(inspector_socket_t* socket) { +void SendVersionResponse(InspectorSocket* socket) { const char VERSION_RESPONSE_TEMPLATE[] = "[ {" " \"Browser\": \"node.js/%s\"," @@ -117,7 +118,7 @@ std::string GetProcessTitle() { } } -void SendTargentsListResponse(inspector_socket_t* socket, +void SendTargentsListResponse(InspectorSocket* socket, const std::string& script_name_, const std::string& script_path_, int port) { @@ -169,7 +170,7 @@ const char* match_path_segment(const char* path, const char* expected) { return nullptr; } -bool RespondToGet(inspector_socket_t* socket, const std::string& script_name_, +bool RespondToGet(InspectorSocket* socket, const std::string& script_name_, const std::string& script_path_, const std::string& path, int port) { const char* command = match_path_segment(path.c_str(), "/json"); @@ -192,8 +193,6 @@ bool RespondToGet(inspector_socket_t* socket, const std::string& script_name_, } // namespace -namespace inspector { - class V8NodeInspector; @@ -220,7 +219,7 @@ class AgentImpl { static void ThreadCbIO(void* agent); static void OnSocketConnectionIO(uv_stream_t* server, int status); - static bool OnInspectorHandshakeIO(inspector_socket_t* socket, + static bool OnInspectorHandshakeIO(InspectorSocket* socket, enum inspector_handshake_event state, const std::string& path); static void WriteCbIO(uv_async_t* async); @@ -228,8 +227,8 @@ class AgentImpl { void InstallInspectorOnProcess(); void WorkerRunIO(); - void OnInspectorConnectionIO(inspector_socket_t* socket); - void OnRemoteDataIO(inspector_socket_t* stream, ssize_t read, + void OnInspectorConnectionIO(InspectorSocket* socket); + void OnRemoteDataIO(InspectorSocket* stream, ssize_t read, const uv_buf_t* b); void SetConnected(bool connected); void DispatchMessages(); @@ -255,7 +254,7 @@ class AgentImpl { uv_async_t* data_written_; uv_async_t io_thread_req_; - inspector_socket_t* client_socket_; + InspectorSocket* client_socket_; V8NodeInspector* inspector_; v8::Platform* platform_; MessageQueue incoming_message_queue_; @@ -281,7 +280,7 @@ void InterruptCallback(v8::Isolate*, void* agent) { } void DataCallback(uv_stream_t* stream, ssize_t read, const uv_buf_t* buf) { - inspector_socket_t* socket = inspector_from_stream(stream); + InspectorSocket* socket = inspector_from_stream(stream); static_cast(socket->data)->OnRemoteDataIO(socket, read, buf); } @@ -594,7 +593,7 @@ void AgentImpl::ThreadCbIO(void* agent) { // static void AgentImpl::OnSocketConnectionIO(uv_stream_t* server, int status) { if (status == 0) { - inspector_socket_t* socket = new inspector_socket_t(); + InspectorSocket* socket = new InspectorSocket(); socket->data = server->data; if (inspector_accept(server, socket, AgentImpl::OnInspectorHandshakeIO) != 0) { @@ -604,7 +603,7 @@ void AgentImpl::OnSocketConnectionIO(uv_stream_t* server, int status) { } // static -bool AgentImpl::OnInspectorHandshakeIO(inspector_socket_t* socket, +bool AgentImpl::OnInspectorHandshakeIO(InspectorSocket* socket, enum inspector_handshake_event state, const std::string& path) { AgentImpl* agent = static_cast(socket->data); @@ -626,7 +625,7 @@ bool AgentImpl::OnInspectorHandshakeIO(inspector_socket_t* socket, } } -void AgentImpl::OnRemoteDataIO(inspector_socket_t* socket, +void AgentImpl::OnRemoteDataIO(InspectorSocket* socket, ssize_t read, const uv_buf_t* buf) { Mutex::ScopedLock scoped_lock(pause_lock_); @@ -660,7 +659,7 @@ void AgentImpl::OnRemoteDataIO(inspector_socket_t* socket, // static void AgentImpl::WriteCbIO(uv_async_t* async) { AgentImpl* agent = static_cast(async->data); - inspector_socket_t* socket = agent->client_socket_; + InspectorSocket* socket = agent->client_socket_; if (socket) { MessageQueue outgoing_messages; agent->SwapBehindLock(&agent->outgoing_message_queue_, &outgoing_messages); @@ -741,7 +740,7 @@ void AgentImpl::PostIncomingMessage(const String16& message) { } } -void AgentImpl::OnInspectorConnectionIO(inspector_socket_t* socket) { +void AgentImpl::OnInspectorConnectionIO(InspectorSocket* socket) { if (client_socket_) { DisconnectAndDisposeIO(socket); return; diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index 5160843ff2dfe6..6edc08248b6a85 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -16,6 +16,9 @@ #define DUMP_READS 0 #define DUMP_WRITES 0 +namespace node { +namespace inspector { + static const char CLOSE_FRAME[] = {'\x88', '\x00'}; enum ws_decode_result { @@ -53,7 +56,7 @@ static void remove_from_beginning(std::vector* buffer, size_t count) { } static void dispose_inspector(uv_handle_t* handle) { - inspector_socket_t* inspector = inspector_from_stream(handle); + InspectorSocket* inspector = inspector_from_stream(handle); inspector_cb close = inspector->ws_mode ? inspector->ws_state->close_cb : nullptr; inspector->buffer.clear(); @@ -64,7 +67,7 @@ static void dispose_inspector(uv_handle_t* handle) { } } -static void close_connection(inspector_socket_t* inspector) { +static void close_connection(InspectorSocket* inspector) { uv_handle_t* socket = reinterpret_cast(&inspector->client); if (!uv_is_closing(socket)) { uv_read_stop(reinterpret_cast(socket)); @@ -73,7 +76,7 @@ static void close_connection(inspector_socket_t* inspector) { } struct WriteRequest { - WriteRequest(inspector_socket_t* inspector, const char* data, size_t size) + WriteRequest(InspectorSocket* inspector, const char* data, size_t size) : inspector(inspector) , storage(data, data + size) , buf(uv_buf_init(&storage[0], storage.size())) {} @@ -82,7 +85,7 @@ struct WriteRequest { return node::ContainerOf(&WriteRequest::req, req); } - inspector_socket_t* const inspector; + InspectorSocket* const inspector; std::vector storage; uv_write_t req; uv_buf_t buf; @@ -93,7 +96,7 @@ static void write_request_cleanup(uv_write_t* req, int status) { delete WriteRequest::from_write_req(req); } -static int write_to_client(inspector_socket_t* inspector, +static int write_to_client(InspectorSocket* inspector, const char* msg, size_t len, uv_write_cb write_cb = write_request_cleanup) { @@ -246,7 +249,7 @@ static ws_decode_result decode_frame_hybi17(const std::vector& buffer, return closed ? FRAME_CLOSE : FRAME_OK; } -static void invoke_read_callback(inspector_socket_t* inspector, +static void invoke_read_callback(InspectorSocket* inspector, int status, const uv_buf_t* buf) { if (inspector->ws_state->read_cb) { inspector->ws_state->read_cb( @@ -254,13 +257,13 @@ static void invoke_read_callback(inspector_socket_t* inspector, } } -static void shutdown_complete(inspector_socket_t* inspector) { +static void shutdown_complete(InspectorSocket* inspector) { close_connection(inspector); } static void on_close_frame_written(uv_write_t* req, int status) { WriteRequest* wr = WriteRequest::from_write_req(req); - inspector_socket_t* inspector = wr->inspector; + InspectorSocket* inspector = wr->inspector; delete wr; inspector->ws_state->close_sent = true; if (inspector->ws_state->received_close) { @@ -268,7 +271,7 @@ static void on_close_frame_written(uv_write_t* req, int status) { } } -static void close_frame_received(inspector_socket_t* inspector) { +static void close_frame_received(InspectorSocket* inspector) { inspector->ws_state->received_close = true; if (!inspector->ws_state->close_sent) { invoke_read_callback(inspector, 0, 0); @@ -279,7 +282,7 @@ static void close_frame_received(inspector_socket_t* inspector) { } } -static int parse_ws_frames(inspector_socket_t* inspector) { +static int parse_ws_frames(InspectorSocket* inspector) { int bytes_consumed = 0; std::vector output; bool compressed = false; @@ -314,7 +317,7 @@ static void prepare_buffer(uv_handle_t* stream, size_t len, uv_buf_t* buf) { *buf = uv_buf_init(new char[len], len); } -static void reclaim_uv_buf(inspector_socket_t* inspector, const uv_buf_t* buf, +static void reclaim_uv_buf(InspectorSocket* inspector, const uv_buf_t* buf, ssize_t read) { if (read > 0) { std::vector& buffer = inspector->buffer; @@ -325,7 +328,7 @@ static void reclaim_uv_buf(inspector_socket_t* inspector, const uv_buf_t* buf, static void websockets_data_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - inspector_socket_t* inspector = inspector_from_stream(stream); + InspectorSocket* inspector = inspector_from_stream(stream); reclaim_uv_buf(inspector, buf, nread); if (nread < 0 || nread == UV_EOF) { inspector->connection_eof = true; @@ -352,7 +355,7 @@ static void websockets_data_cb(uv_stream_t* stream, ssize_t nread, } } -int inspector_read_start(inspector_socket_t* inspector, +int inspector_read_start(InspectorSocket* inspector, uv_alloc_cb alloc_cb, uv_read_cb read_cb) { ASSERT(inspector->ws_mode); ASSERT(!inspector->shutting_down || read_cb == nullptr); @@ -369,7 +372,7 @@ int inspector_read_start(inspector_socket_t* inspector, return err; } -void inspector_read_stop(inspector_socket_t* inspector) { +void inspector_read_stop(InspectorSocket* inspector) { uv_read_stop(reinterpret_cast(&inspector->client)); inspector->ws_state->alloc_cb = nullptr; inspector->ws_state->read_cb = nullptr; @@ -388,7 +391,7 @@ static void generate_accept_string(const std::string& client_key, static int header_value_cb(http_parser* parser, const char* at, size_t length) { static const char SEC_WEBSOCKET_KEY_HEADER[] = "Sec-WebSocket-Key"; - auto inspector = static_cast(parser->data); + auto inspector = static_cast(parser->data); auto state = inspector->http_parsing_state; state->parsing_value = true; if (state->current_header.size() == sizeof(SEC_WEBSOCKET_KEY_HEADER) - 1 && @@ -401,7 +404,7 @@ static int header_value_cb(http_parser* parser, const char* at, size_t length) { } static int header_field_cb(http_parser* parser, const char* at, size_t length) { - auto inspector = static_cast(parser->data); + auto inspector = static_cast(parser->data); auto state = inspector->http_parsing_state; if (state->parsing_value) { state->parsing_value = false; @@ -412,13 +415,13 @@ static int header_field_cb(http_parser* parser, const char* at, size_t length) { } static int path_cb(http_parser* parser, const char* at, size_t length) { - auto inspector = static_cast(parser->data); + auto inspector = static_cast(parser->data); auto state = inspector->http_parsing_state; state->path.append(at, length); return 0; } -static void handshake_complete(inspector_socket_t* inspector) { +static void handshake_complete(InspectorSocket* inspector) { uv_read_stop(reinterpret_cast(&inspector->client)); handshake_cb callback = inspector->http_parsing_state->callback; inspector->ws_state = new ws_state_s(); @@ -427,20 +430,20 @@ static void handshake_complete(inspector_socket_t* inspector) { inspector->http_parsing_state->path); } -static void cleanup_http_parsing_state(inspector_socket_t* inspector) { +static void cleanup_http_parsing_state(InspectorSocket* inspector) { delete inspector->http_parsing_state; inspector->http_parsing_state = nullptr; } static void report_handshake_failure_cb(uv_handle_t* handle) { dispose_inspector(handle); - inspector_socket_t* inspector = inspector_from_stream(handle); + InspectorSocket* inspector = inspector_from_stream(handle); handshake_cb cb = inspector->http_parsing_state->callback; cleanup_http_parsing_state(inspector); cb(inspector, kInspectorHandshakeFailed, std::string()); } -static void close_and_report_handshake_failure(inspector_socket_t* inspector) { +static void close_and_report_handshake_failure(InspectorSocket* inspector) { uv_handle_t* socket = reinterpret_cast(&inspector->client); if (uv_is_closing(socket)) { report_handshake_failure_cb(socket); @@ -451,12 +454,12 @@ static void close_and_report_handshake_failure(inspector_socket_t* inspector) { } static void then_close_and_report_failure(uv_write_t* req, int status) { - inspector_socket_t* inspector = WriteRequest::from_write_req(req)->inspector; + InspectorSocket* inspector = WriteRequest::from_write_req(req)->inspector; write_request_cleanup(req, status); close_and_report_handshake_failure(inspector); } -static void handshake_failed(inspector_socket_t* inspector) { +static void handshake_failed(InspectorSocket* inspector) { const char HANDSHAKE_FAILED_RESPONSE[] = "HTTP/1.0 400 Bad Request\r\n" "Content-Type: text/html; charset=UTF-8\r\n\r\n" @@ -467,11 +470,10 @@ static void handshake_failed(inspector_socket_t* inspector) { } // init_handshake references message_complete_cb -static void init_handshake(inspector_socket_t* inspector); +static void init_handshake(InspectorSocket* inspector); static int message_complete_cb(http_parser* parser) { - inspector_socket_t* inspector = - reinterpret_cast(parser->data); + InspectorSocket* inspector = static_cast(parser->data); struct http_parsing_state_s* state = inspector->http_parsing_state; if (parser->method != HTTP_GET) { handshake_failed(inspector); @@ -517,7 +519,7 @@ static void data_received_cb(uv_stream_s* client, ssize_t nread, printf("[%s:%d] %s\n", __FUNCTION__, __LINE__, uv_err_name(nread)); } #endif - inspector_socket_t* inspector = inspector_from_stream(client); + InspectorSocket* inspector = inspector_from_stream(client); reclaim_uv_buf(inspector, buf, nread); if (nread < 0 || nread == UV_EOF) { close_and_report_handshake_failure(inspector); @@ -536,7 +538,7 @@ static void data_received_cb(uv_stream_s* client, ssize_t nread, } } -static void init_handshake(inspector_socket_t* inspector) { +static void init_handshake(InspectorSocket* inspector) { http_parsing_state_s* state = inspector->http_parsing_state; CHECK_NE(state, nullptr); state->current_header.clear(); @@ -553,13 +555,13 @@ static void init_handshake(inspector_socket_t* inspector) { settings->on_url = path_cb; } -int inspector_accept(uv_stream_t* server, inspector_socket_t* inspector, +int inspector_accept(uv_stream_t* server, InspectorSocket* inspector, handshake_cb callback) { ASSERT_NE(callback, nullptr); CHECK_EQ(inspector->http_parsing_state, nullptr); + inspector->http_parsing_state = new http_parsing_state_s(); uv_stream_t* client = reinterpret_cast(&inspector->client); - CHECK_NE(client, nullptr); int err = uv_tcp_init(server->loop, &inspector->client); if (err == 0) { @@ -577,7 +579,7 @@ int inspector_accept(uv_stream_t* server, inspector_socket_t* inspector, return err; } -void inspector_write(inspector_socket_t* inspector, const char* data, +void inspector_write(InspectorSocket* inspector, const char* data, size_t len) { if (inspector->ws_mode) { std::vector output = encode_frame_hybi17(data, len); @@ -587,7 +589,7 @@ void inspector_write(inspector_socket_t* inspector, const char* data, } } -void inspector_close(inspector_socket_t* inspector, +void inspector_close(InspectorSocket* inspector, inspector_cb callback) { // libuv throws assertions when closing stream that's already closed - we // need to do the same. @@ -605,8 +607,20 @@ void inspector_close(inspector_socket_t* inspector, } } -bool inspector_is_active(const struct inspector_socket_s* inspector) { +bool inspector_is_active(const InspectorSocket* inspector) { const uv_handle_t* client = reinterpret_cast(&inspector->client); return !inspector->shutting_down && !uv_is_closing(client); } + +void InspectorSocket::reinit() { + http_parsing_state = nullptr; + ws_state = nullptr; + buffer.clear(); + ws_mode = false; + shutting_down = false; + connection_eof = false; +} + +} // namespace inspector +} // namespace node diff --git a/src/inspector_socket.h b/src/inspector_socket.h index de57d09e98eebb..558d87bcb76bf1 100644 --- a/src/inspector_socket.h +++ b/src/inspector_socket.h @@ -9,6 +9,9 @@ #include #include +namespace node { +namespace inspector { + enum inspector_handshake_event { kInspectorHandshakeUpgrading, kInspectorHandshakeUpgraded, @@ -16,13 +19,13 @@ enum inspector_handshake_event { kInspectorHandshakeFailed }; -struct inspector_socket_s; +class InspectorSocket; -typedef void (*inspector_cb)(struct inspector_socket_s*, int); +typedef void (*inspector_cb)(InspectorSocket*, int); // Notifies as handshake is progressing. Returning false as a response to // kInspectorHandshakeUpgrading or kInspectorHandshakeHttpGet event will abort // the connection. inspector_write can be used from the callback. -typedef bool (*handshake_cb)(struct inspector_socket_s*, +typedef bool (*handshake_cb)(InspectorSocket*, enum inspector_handshake_event state, const std::string& path); @@ -45,7 +48,12 @@ struct ws_state_s { bool received_close; }; -struct inspector_socket_s { +class InspectorSocket { + public: + InspectorSocket() : data(nullptr), http_parsing_state(nullptr), + ws_state(nullptr), buffer(0), ws_mode(false), + shutting_down(false), connection_eof(false) { } + void reinit(); void* data; struct http_parsing_state_s* http_parsing_state; struct ws_state_s* ws_state; @@ -54,35 +62,39 @@ struct inspector_socket_s { bool ws_mode; bool shutting_down; bool connection_eof; + private: + DISALLOW_COPY_AND_ASSIGN(InspectorSocket); }; -typedef struct inspector_socket_s inspector_socket_t; - -int inspector_accept(uv_stream_t* server, struct inspector_socket_s* inspector, +int inspector_accept(uv_stream_t* server, InspectorSocket* inspector, handshake_cb callback); -void inspector_close(struct inspector_socket_s* inspector, +void inspector_close(InspectorSocket* inspector, inspector_cb callback); // Callbacks will receive stream handles. Use inspector_from_stream to get -// inspector_socket_t* from the stream handle. -int inspector_read_start(struct inspector_socket_s* inspector, uv_alloc_cb, +// InspectorSocket* from the stream handle. +int inspector_read_start(InspectorSocket* inspector, uv_alloc_cb, uv_read_cb); -void inspector_read_stop(struct inspector_socket_s* inspector); -void inspector_write(struct inspector_socket_s* inspector, +void inspector_read_stop(InspectorSocket* inspector); +void inspector_write(InspectorSocket* inspector, const char* data, size_t len); -bool inspector_is_active(const struct inspector_socket_s* inspector); +bool inspector_is_active(const InspectorSocket* inspector); -inline inspector_socket_t* inspector_from_stream(uv_tcp_t* stream) { - return node::ContainerOf(&inspector_socket_t::client, stream); +inline InspectorSocket* inspector_from_stream(uv_tcp_t* stream) { + return node::ContainerOf(&InspectorSocket::client, stream); } -inline inspector_socket_t* inspector_from_stream(uv_stream_t* stream) { +inline InspectorSocket* inspector_from_stream(uv_stream_t* stream) { return inspector_from_stream(reinterpret_cast(stream)); } -inline inspector_socket_t* inspector_from_stream(uv_handle_t* stream) { +inline InspectorSocket* inspector_from_stream(uv_handle_t* stream) { return inspector_from_stream(reinterpret_cast(stream)); } +} // namespace inspector +} // namespace node + + #endif // SRC_INSPECTOR_SOCKET_H_ diff --git a/test/cctest/test_inspector_socket.cc b/test/cctest/test_inspector_socket.cc index 83e538be5a8889..f45593584abece 100644 --- a/test/cctest/test_inspector_socket.cc +++ b/test/cctest/test_inspector_socket.cc @@ -4,6 +4,8 @@ #define PORT 9444 +using namespace node::inspector; + static const int MAX_LOOP_ITERATIONS = 10000; #define SPIN_WHILE(condition) \ @@ -23,7 +25,7 @@ static int handshake_events = 0; static enum inspector_handshake_event last_event = kInspectorHandshakeHttpGet; static uv_loop_t loop; static uv_tcp_t server, client_socket; -static inspector_socket_t inspector; +static InspectorSocket inspector; static std::string last_path; static void (*handshake_delegate)(enum inspector_handshake_event state, const std::string& path, @@ -76,7 +78,7 @@ static void stop_if_stop_path(enum inspector_handshake_event state, *cont = path.empty() || path != "/close"; } -static bool connected_cb(inspector_socket_t* socket, +static bool connected_cb(InspectorSocket* socket, enum inspector_handshake_event state, const std::string& path) { inspector_ready = state == kInspectorHandshakeUpgraded; @@ -95,7 +97,7 @@ static bool connected_cb(inspector_socket_t* socket, static void on_new_connection(uv_stream_t* server, int status) { GTEST_ASSERT_EQ(0, status); connected = true; - inspector_accept(server, reinterpret_cast(server->data), + inspector_accept(server, static_cast(server->data), connected_cb); } @@ -276,7 +278,7 @@ static void expect_on_server(const char* data, size_t len) { static void inspector_record_error_code(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - inspector_socket_t *inspector = inspector_from_stream(stream); + InspectorSocket *inspector = inspector_from_stream(stream); // Increment instead of assign is to ensure the function is only called once *(static_cast(inspector->data)) += nread; } @@ -336,13 +338,13 @@ static void on_connection(uv_connect_t* connect, int status) { class InspectorSocketTest : public ::testing::Test { protected: virtual void SetUp() { + inspector.reinit(); handshake_delegate = stop_if_stop_path; handshake_events = 0; connected = false; inspector_ready = false; last_event = kInspectorHandshakeHttpGet; uv_loop_init(&loop); - inspector = inspector_socket_t(); server = uv_tcp_t(); client_socket = uv_tcp_t(); server.data = &inspector; @@ -568,7 +570,7 @@ TEST_F(InspectorSocketTest, CanStopReadingFromInspector) { static int inspector_closed = 0; -void inspector_closed_cb(inspector_socket_t *inspector, int code) { +void inspector_closed_cb(InspectorSocket *inspector, int code) { inspector_closed++; } @@ -771,7 +773,7 @@ TEST_F(InspectorSocketTest, WriteBeforeHandshake) { SPIN_WHILE(inspector_closed == 0); } -static void CleanupSocketAfterEOF_close_cb(inspector_socket_t* inspector, +static void CleanupSocketAfterEOF_close_cb(InspectorSocket* inspector, int status) { *(static_cast(inspector->data)) = true; } @@ -779,7 +781,7 @@ static void CleanupSocketAfterEOF_close_cb(inspector_socket_t* inspector, static void CleanupSocketAfterEOF_read_cb(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { EXPECT_EQ(UV_EOF, nread); - inspector_socket_t* insp = inspector_from_stream(stream); + InspectorSocket* insp = inspector_from_stream(stream); inspector_close(insp, CleanupSocketAfterEOF_close_cb); } From 4ed46b47a14099bf8455bc388a09098b662cbac4 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 12 Sep 2016 11:58:26 -0700 Subject: [PATCH 006/216] inspector: report default context Fixes: https://github.com/nodejs/node/issues/8426 PR-URL: https://github.com/nodejs/node/pull/8502 Reviewed-By: bnoordhuis - Ben Noordhuis --- src/inspector_agent.cc | 11 ++++++++--- test/inspector/test-inspector.js | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 60844d20eb8bfc..774f0011430725 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -328,7 +328,7 @@ class V8NodeInspector : public v8_inspector::V8InspectorClient { V8NodeInspector(AgentImpl* agent, node::Environment* env, v8::Platform* platform) : agent_(agent), - isolate_(env->isolate()), + env_(env), platform_(platform), terminated_(false), running_nested_loop_(false), @@ -348,7 +348,7 @@ class V8NodeInspector : public v8_inspector::V8InspectorClient { Mutex::ScopedLock scoped_lock(agent_->pause_lock_); agent_->pause_cond_.Wait(scoped_lock); } - while (v8::platform::PumpMessageLoop(platform_, isolate_)) + while (v8::platform::PumpMessageLoop(platform_, env_->isolate())) {} } while (!terminated_); terminated_ = false; @@ -376,13 +376,18 @@ class V8NodeInspector : public v8_inspector::V8InspectorClient { session_->dispatchProtocolMessage(message); } + v8::Local ensureDefaultContextInGroup(int contextGroupId) + override { + return env_->context(); + } + V8Inspector* inspector() { return inspector_.get(); } private: AgentImpl* agent_; - v8::Isolate* isolate_; + node::Environment* env_; v8::Platform* platform_; bool terminated_; bool running_nested_loop_; diff --git a/test/inspector/test-inspector.js b/test/inspector/test-inspector.js index 2e550f6a02677c..e2493c87396112 100644 --- a/test/inspector/test-inspector.js +++ b/test/inspector/test-inspector.js @@ -141,6 +141,13 @@ function testInspectScope(session) { } }, setupExpectValue(1002) ], + [ + { + 'method': 'Runtime.evaluate', 'params': { + 'expression': '5 * 5' + } + }, (message) => assert.strictEqual(25, message['result']['value']) + ], ]); } From f817875235aec724ba1c7130d7dfebb046b99da2 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 12 Sep 2016 14:49:07 -0700 Subject: [PATCH 007/216] inspector: wait for both sides closing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes race condition when test relied on both sides of the socket to be closed on the same UV event loop iteration. Fixes: nodejs/node#8498 PR-URL: https://github.com/nodejs/node/pull/8505 Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Saúl Ibarra Corretgé Reviewed-By: James M Snell Reviewed-by: Fedor Indutny --- test/cctest/test_inspector_socket.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/cctest/test_inspector_socket.cc b/test/cctest/test_inspector_socket.cc index f45593584abece..3b927bdc2c7252 100644 --- a/test/cctest/test_inspector_socket.cc +++ b/test/cctest/test_inspector_socket.cc @@ -330,6 +330,11 @@ static void manual_inspector_socket_cleanup() { inspector.buffer.clear(); } +static void assert_both_sockets_closed() { + SPIN_WHILE(uv_is_active(reinterpret_cast(&client_socket))); + SPIN_WHILE(uv_is_active(reinterpret_cast(&inspector.client))); +} + static void on_connection(uv_connect_t* connect, int status) { GTEST_ASSERT_EQ(0, status); connect->data = connect; @@ -503,8 +508,7 @@ TEST_F(InspectorSocketTest, ExtraTextBeforeRequest) { do_write(const_cast(HANDSHAKE_REQ), sizeof(HANDSHAKE_REQ) - 1); SPIN_WHILE(last_event != kInspectorHandshakeFailed); expect_handshake_failure(); - EXPECT_EQ(uv_is_active(reinterpret_cast(&client_socket)), 0); - EXPECT_EQ(uv_is_active(reinterpret_cast(&socket)), 0); + assert_both_sockets_closed(); } TEST_F(InspectorSocketTest, ExtraLettersBeforeRequest) { @@ -515,8 +519,7 @@ TEST_F(InspectorSocketTest, ExtraLettersBeforeRequest) { do_write(const_cast(HANDSHAKE_REQ), sizeof(HANDSHAKE_REQ) - 1); SPIN_WHILE(last_event != kInspectorHandshakeFailed); expect_handshake_failure(); - EXPECT_EQ(uv_is_active(reinterpret_cast(&client_socket)), 0); - EXPECT_EQ(uv_is_active(reinterpret_cast(&socket)), 0); + assert_both_sockets_closed(); } TEST_F(InspectorSocketTest, RequestWithoutKey) { @@ -530,8 +533,7 @@ TEST_F(InspectorSocketTest, RequestWithoutKey) { do_write(const_cast(BROKEN_REQUEST), sizeof(BROKEN_REQUEST) - 1); SPIN_WHILE(last_event != kInspectorHandshakeFailed); expect_handshake_failure(); - EXPECT_EQ(uv_is_active(reinterpret_cast(&client_socket)), 0); - EXPECT_EQ(uv_is_active(reinterpret_cast(&socket)), 0); + assert_both_sockets_closed(); } TEST_F(InspectorSocketTest, KillsConnectionOnProtocolViolation) { From a62999ac7039b22aca08ad978aa09228f03385ad Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 29 Jun 2016 23:20:06 +0200 Subject: [PATCH 008/216] src: add /json/protocol endpoint to inspector Embed the compressed and minified protocol.json from the bundled v8_inspector and make it available through the /json/protocol endpoint. Refs: https://github.com/nodejs/diagnostics/issues/52 PR-URL: https://github.com/nodejs/node/pull/7491 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- deps/zlib/zlib.gyp | 4 +++ node.gyp | 29 +++++++++++++++++++ src/inspector_agent.cc | 28 ++++++++++++++++++ test/common.js | 1 + .../test-v8-inspector-json-protocol.js | 22 ++++++++++++++ test/testpy/__init__.py | 5 +++- tools/compress_json.py | 25 ++++++++++++++++ 7 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-v8-inspector-json-protocol.js create mode 100644 tools/compress_json.py diff --git a/deps/zlib/zlib.gyp b/deps/zlib/zlib.gyp index cf0b090d9ef0c4..65133d5fce6cd8 100644 --- a/deps/zlib/zlib.gyp +++ b/deps/zlib/zlib.gyp @@ -12,6 +12,7 @@ { 'target_name': 'zlib', 'type': 'static_library', + 'defines': [ 'ZLIB_CONST' ], 'sources': [ 'adler32.c', 'compress.c', @@ -44,6 +45,7 @@ '.', ], 'direct_dependent_settings': { + 'defines': [ 'ZLIB_CONST' ], 'include_dirs': [ '.', ], @@ -72,10 +74,12 @@ 'direct_dependent_settings': { 'defines': [ 'USE_SYSTEM_ZLIB', + 'ZLIB_CONST', ], }, 'defines': [ 'USE_SYSTEM_ZLIB', + 'ZLIB_CONST', ], 'link_settings': { 'libraries': [ diff --git a/node.gyp b/node.gyp index 0f263d1346f1b5..4043269930da27 100644 --- a/node.gyp +++ b/node.gyp @@ -322,6 +322,7 @@ 'dependencies': [ 'deps/v8_inspector/third_party/v8_inspector/platform/' 'v8_inspector/v8_inspector.gyp:v8_inspector_stl', + 'v8_inspector_compress_protocol_json#host', ], 'include_dirs': [ 'deps/v8_inspector/third_party/v8_inspector', @@ -650,6 +651,34 @@ } ] ] }, + { + 'target_name': 'v8_inspector_compress_protocol_json', + 'type': 'none', + 'toolsets': ['host'], + 'conditions': [ + [ 'v8_inspector=="true"', { + 'actions': [ + { + 'action_name': 'v8_inspector_compress_protocol_json', + 'process_outputs_as_sources': 1, + 'inputs': [ + 'deps/v8_inspector/third_party/' + 'v8_inspector/platform/v8_inspector/js_protocol.json', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/v8_inspector_protocol_json.h', + ], + 'action': [ + 'python', + 'tools/compress_json.py', + '<@(_inputs)', + '<@(_outputs)', + ], + }, + ], + }], + ], + }, { 'target_name': 'node_js2c', 'type': 'none', diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 774f0011430725..7dd83c7eafc87c 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -8,6 +8,7 @@ #include "node_version.h" #include "v8-platform.h" #include "util.h" +#include "zlib.h" #include "platform/v8_inspector/public/InspectorVersion.h" #include "platform/v8_inspector/public/V8Inspector.h" @@ -41,6 +42,10 @@ const char TAG_DISCONNECT[] = "#disconnect"; const char DEVTOOLS_PATH[] = "/node"; const char DEVTOOLS_HASH[] = V8_INSPECTOR_REVISION; +static const uint8_t PROTOCOL_JSON[] = { +#include "v8_inspector_protocol_json.h" // NOLINT(build/include_order) +}; + void PrintDebuggerReadyMessage(int port) { fprintf(stderr, "Debugger listening on port %d.\n" "Warning: This is an experimental feature and could change at any time.\n" @@ -161,6 +166,27 @@ void SendTargentsListResponse(InspectorSocket* socket, SendHttpResponse(socket, buffer.data(), len); } +void SendProtocolJson(InspectorSocket* socket) { + z_stream strm; + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + CHECK_EQ(Z_OK, inflateInit(&strm)); + static const size_t kDecompressedSize = + PROTOCOL_JSON[0] * 0x10000u + + PROTOCOL_JSON[1] * 0x100u + + PROTOCOL_JSON[2]; + strm.next_in = PROTOCOL_JSON + 3; + strm.avail_in = sizeof(PROTOCOL_JSON) - 3; + std::vector data(kDecompressedSize); + strm.next_out = reinterpret_cast(&data[0]); + strm.avail_out = data.size(); + CHECK_EQ(Z_STREAM_END, inflate(&strm, Z_FINISH)); + CHECK_EQ(0, strm.avail_out); + CHECK_EQ(Z_OK, inflateEnd(&strm)); + SendHttpResponse(socket, &data[0], data.size()); +} + const char* match_path_segment(const char* path, const char* expected) { size_t len = strlen(expected); if (StringEqualNoCaseN(path, expected, len)) { @@ -179,6 +205,8 @@ bool RespondToGet(InspectorSocket* socket, const std::string& script_name_, if (match_path_segment(command, "list") || command[0] == '\0') { SendTargentsListResponse(socket, script_name_, script_path_, port); + } else if (match_path_segment(command, "protocol")) { + SendProtocolJson(socket); } else if (match_path_segment(command, "version")) { SendVersionResponse(socket); } else { diff --git a/test/common.js b/test/common.js index 3eaaccacc96738..5d226e29c5b6ff 100644 --- a/test/common.js +++ b/test/common.js @@ -16,6 +16,7 @@ exports.testDir = __dirname; exports.fixturesDir = path.join(exports.testDir, 'fixtures'); exports.libDir = path.join(exports.testDir, '../lib'); exports.tmpDirName = 'tmp'; +// PORT should match the definition in test/testpy/__init__.py. exports.PORT = +process.env.NODE_COMMON_PORT || 12346; exports.isWindows = process.platform === 'win32'; exports.isWOW64 = exports.isWindows && diff --git a/test/parallel/test-v8-inspector-json-protocol.js b/test/parallel/test-v8-inspector-json-protocol.js new file mode 100644 index 00000000000000..762c4386bb906a --- /dev/null +++ b/test/parallel/test-v8-inspector-json-protocol.js @@ -0,0 +1,22 @@ +// Flags: --inspect={PORT} +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const options = { + path: '/json/protocol', + port: common.PORT, + host: common.localhostIPv4, +}; + +http.get(options, common.mustCall((res) => { + let body = ''; + res.setEncoding('utf8'); + res.on('data', (data) => body += data); + res.on('end', common.mustCall(() => { + assert(body.length > 0); + assert.deepStrictEqual(JSON.stringify(JSON.parse(body)), body); + })); +})); diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 9fff0b969c4952..367346f6e1509d 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -61,7 +61,10 @@ def GetCommand(self): source = open(self.file).read() flags_match = FLAGS_PATTERN.search(source) if flags_match: - result += flags_match.group(1).strip().split() + # PORT should match the definition in test/common.js. + env = { 'PORT': int(os.getenv('NODE_COMMON_PORT', '12346')) } + env['PORT'] += self.thread_id * 100 + result += flags_match.group(1).strip().format(**env).split() files_match = FILES_PATTERN.search(source); additional_files = [] if files_match: diff --git a/tools/compress_json.py b/tools/compress_json.py new file mode 100644 index 00000000000000..34dbb878c48a27 --- /dev/null +++ b/tools/compress_json.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import json +import struct +import sys +import zlib + +if __name__ == '__main__': + fp = open(sys.argv[1]) + obj = json.load(fp) + text = json.dumps(obj, separators=(',', ':')) + data = zlib.compress(text, zlib.Z_BEST_COMPRESSION) + + # To make decompression a little easier, we prepend the compressed data + # with the size of the uncompressed data as a 24 bits BE unsigned integer. + assert len(text) < 1 << 24, 'Uncompressed JSON must be < 16 MB.' + data = struct.pack('>I', len(text))[1:4] + data + + step = 20 + slices = (data[i:i+step] for i in xrange(0, len(data), step)) + slices = map(lambda s: ','.join(str(ord(c)) for c in s), slices) + text = ',\n'.join(slices) + + fp = open(sys.argv[2], 'w') + fp.write(text) From e80ae1350cc0a280a15598dae374e2f7bd768822 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Mon, 19 Sep 2016 16:52:16 -0700 Subject: [PATCH 009/216] inspector: address race conditions Stress tests uncovered 2 race conditions, when IO events happened during V8 entering event loop on pause or during Node.js shutdown. Fixes: nodejs/node#8669 PR-URL: https://github.com/nodejs/node/pull/8672 Reviewed-By: Ben Noordhuis Reviewed-By: Aleksey Kozyatinskiy --- src/inspector_agent.cc | 35 ++++++++++++++++++------------ test/inspector/inspector-helper.js | 16 ++++++++++---- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 7dd83c7eafc87c..13305168f8f04f 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -265,12 +265,13 @@ class AgentImpl { const String16& message); void SwapBehindLock(MessageQueue* vector1, MessageQueue* vector2); void PostIncomingMessage(const String16& message); + void WaitForFrontendMessage(); + void NotifyMessageReceived(); State ToState(State state); uv_sem_t start_sem_; - ConditionVariable pause_cond_; - Mutex pause_lock_; - Mutex queue_lock_; + ConditionVariable incoming_message_cond_; + Mutex state_lock_; uv_thread_t thread_; uv_loop_t child_loop_; @@ -370,15 +371,11 @@ class V8NodeInspector : public v8_inspector::V8InspectorClient { return; terminated_ = false; running_nested_loop_ = true; - agent_->DispatchMessages(); - do { - { - Mutex::ScopedLock scoped_lock(agent_->pause_lock_); - agent_->pause_cond_.Wait(scoped_lock); - } + while (!terminated_) { + agent_->WaitForFrontendMessage(); while (v8::platform::PumpMessageLoop(platform_, env_->isolate())) {} - } while (!terminated_); + } terminated_ = false; running_nested_loop_ = false; } @@ -661,7 +658,6 @@ bool AgentImpl::OnInspectorHandshakeIO(InspectorSocket* socket, void AgentImpl::OnRemoteDataIO(InspectorSocket* socket, ssize_t read, const uv_buf_t* buf) { - Mutex::ScopedLock scoped_lock(pause_lock_); if (read > 0) { String16 str = String16::fromUTF8(buf->base, read); // TODO(pfeldman): Instead of blocking execution while debugger @@ -686,7 +682,6 @@ void AgentImpl::OnRemoteDataIO(InspectorSocket* socket, if (buf) { delete[] buf->base; } - pause_cond_.Broadcast(scoped_lock); } // static @@ -752,14 +747,14 @@ void AgentImpl::WorkerRunIO() { bool AgentImpl::AppendMessage(MessageQueue* queue, int session_id, const String16& message) { - Mutex::ScopedLock scoped_lock(queue_lock_); + Mutex::ScopedLock scoped_lock(state_lock_); bool trigger_pumping = queue->empty(); queue->push_back(std::make_pair(session_id, message)); return trigger_pumping; } void AgentImpl::SwapBehindLock(MessageQueue* vector1, MessageQueue* vector2) { - Mutex::ScopedLock scoped_lock(queue_lock_); + Mutex::ScopedLock scoped_lock(state_lock_); vector1->swap(*vector2); } @@ -771,6 +766,18 @@ void AgentImpl::PostIncomingMessage(const String16& message) { isolate->RequestInterrupt(InterruptCallback, this); uv_async_send(data_written_); } + NotifyMessageReceived(); +} + +void AgentImpl::WaitForFrontendMessage() { + Mutex::ScopedLock scoped_lock(state_lock_); + if (incoming_message_queue_.empty()) + incoming_message_cond_.Wait(scoped_lock); +} + +void AgentImpl::NotifyMessageReceived() { + Mutex::ScopedLock scoped_lock(state_lock_); + incoming_message_cond_.Broadcast(scoped_lock); } void AgentImpl::OnInspectorConnectionIO(InspectorSocket* socket) { diff --git a/test/inspector/inspector-helper.js b/test/inspector/inspector-helper.js index 865ddeb3b5fefa..3bbe442f22e293 100644 --- a/test/inspector/inspector-helper.js +++ b/test/inspector/inspector-helper.js @@ -6,6 +6,8 @@ const http = require('http'); const path = require('path'); const spawn = require('child_process').spawn; +const DEBUG = false; + const TIMEOUT = 15 * 1000; const mainScript = path.join(common.fixturesDir, 'loop.js'); @@ -13,6 +15,8 @@ const mainScript = path.join(common.fixturesDir, 'loop.js'); function send(socket, message, id, callback) { const msg = JSON.parse(JSON.stringify(message)); // Clone! msg['id'] = id; + if (DEBUG) + console.log('[sent]', JSON.stringify(msg)); const messageBuf = Buffer.from(JSON.stringify(msg)); const wsHeaderBuf = Buffer.allocUnsafe(16); @@ -61,6 +65,8 @@ function parseWSFrame(buffer, handler) { return 0; const message = JSON.parse( buffer.slice(bodyOffset, bodyOffset + dataLen).toString('utf8')); + if (DEBUG) + console.log('[received]', JSON.stringify(message)); handler(message); return bodyOffset + dataLen; } @@ -117,7 +123,7 @@ const TestSession = function(socket, harness) { this.expectedId_ = 1; this.lastMessageResponseCallback_ = null; - let buffer = Buffer.from(''); + let buffer = new Buffer(0); socket.on('data', (data) => { buffer = Buffer.concat([buffer, data]); let consumed; @@ -195,9 +201,10 @@ TestSession.prototype.sendInspectorCommands = function(commands) { timeoutId = setTimeout(() => { let s = ''; for (const id in this.messages_) { - s += this.messages_[id] + '\n'; + s += id + ', '; } - common.fail(s.substring(0, s.length - 1)); + common.fail('Messages without response: ' + + s.substring(0, s.length - 2)); }, TIMEOUT); }); }); @@ -269,6 +276,7 @@ TestSession.prototype.disconnect = function(childDone) { this.harness_.childInstanceDone = this.harness_.childInstanceDone || childDone; this.socket_.end(); + console.log('[test]', 'Connection terminated'); callback(); }); }; @@ -293,7 +301,7 @@ const Harness = function(port, childProcess) { if (!filter(message)) pending.push(filter); this.stderrFilters_ = pending; })); - childProcess.on('close', (code, signal) => { + childProcess.on('exit', (code, signal) => { assert(this.childInstanceDone, 'Child instance died prematurely'); this.returnCode_ = code; this.running_ = false; From f4f9cf779f41e300b82fe3949f387e761c3e4e0c Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Fri, 23 Sep 2016 14:13:49 -0700 Subject: [PATCH 010/216] inspector: build file cleanup Remove obsolete build file entries. Reviewed-By: James M Snell Reviewed-By: Ilkka Myller Reviewed-By: Colin Ihrig PR-URL: https://github.com/nodejs/node/pull/8753 --- .../v8_inspector/platform/v8_inspector/v8_inspector.gyp | 3 --- 1 file changed, 3 deletions(-) diff --git a/deps/v8_inspector/third_party/v8_inspector/platform/v8_inspector/v8_inspector.gyp b/deps/v8_inspector/third_party/v8_inspector/platform/v8_inspector/v8_inspector.gyp index dead4f127f49a0..c957ee2c184635 100644 --- a/deps/v8_inspector/third_party/v8_inspector/platform/v8_inspector/v8_inspector.gyp +++ b/deps/v8_inspector/third_party/v8_inspector/platform/v8_inspector/v8_inspector.gyp @@ -262,7 +262,6 @@ 'InspectedContext.h', 'JavaScriptCallFrame.cpp', 'JavaScriptCallFrame.h', - 'MuteConsoleScope.h', 'PlatformSTL.h', 'RemoteObjectId.cpp', 'RemoteObjectId.h', @@ -307,11 +306,9 @@ 'V8StringUtil.h', 'V8ValueCopier.cpp', 'V8ValueCopier.h', - 'public/V8EventListenerInfo.h', 'public/V8ContextInfo.h', 'public/V8Inspector.h', 'public/V8InspectorClient.h', - 'public/V8HeapProfilerAgent.h', 'public/V8InspectorSession.h', 'public/V8StackTrace.h', From 83ed5085f4c4572057ad95d455e01db930374586 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 28 Sep 2016 11:17:23 -0700 Subject: [PATCH 011/216] test: mark test-inspector flaky on windows PR-URL: https://github.com/nodejs/node/pull/8835 Reviewed-By: Eugene Ostroukhov Reviewed-By: Myles Borins Reviewed-By: Colin Ihrig --- test/inspector/inspector.status | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 test/inspector/inspector.status diff --git a/test/inspector/inspector.status b/test/inspector/inspector.status new file mode 100644 index 00000000000000..69865843c940fc --- /dev/null +++ b/test/inspector/inspector.status @@ -0,0 +1,10 @@ +prefix inspector + +# To mark a test as flaky, list the test name in the appropriate section +# below, without ".js", followed by ": PASS,FLAKY". Example: +# sample-test : PASS,FLAKY + +[true] # This section applies to all platforms + +[$system==win32] +test-inspector : PASS,FLAKY From 3eb93e1fe84ecf95fd1773031a38bca0c714b574 Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Thu, 29 Sep 2016 10:43:51 +0200 Subject: [PATCH 012/216] doc: add example for running with v8-inspector Add example to show what running Node.js with `--inspect` should look like. Some IDEs do not show the link when running with `--inspect`. This example hints to what the full output looks like. PR-URL: https://github.com/nodejs/node/pull/8845 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins Reviewed-By: James M Snell Reviewed-By: Gibson Fahnestock --- doc/api/debugger.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api/debugger.md b/doc/api/debugger.md index acffe65cbaac38..b0d4e9897d45ad 100644 --- a/doc/api/debugger.md +++ b/doc/api/debugger.md @@ -193,4 +193,12 @@ e.g. `--inspect=9222` will accept DevTools connections on port 9222. To break on the first line of the application code, provide the `--debug-brk` flag in addition to `--inspect`. +```txt +$ node --inspect index.js +Debugger listening on port 9229. +Warning: This is an experimental feature and could change at any time. +To start debugging, open the following URL in Chrome: + chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:9229/node +``` + [TCP-based protocol]: https://github.com/v8/v8/wiki/Debugging-Protocol From 9d41e8913fe945bdd97884987185271bea168feb Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Thu, 29 Sep 2016 15:38:07 -0400 Subject: [PATCH 013/216] deps: bump V8 patch to 84 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patch should have been bumped in aafc314 but it was missed. Ref: https://github.com/nodejs/node/commit/aafc314a8322e102dad239105a8f4a52903aaede Ref: https://github.com/nodejs/node/pull/8673 PR-URL: https://github.com/nodejs/node/pull/8851 Reviewed-By: Franziska Hinkelmann Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis --- deps/v8/include/v8-version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 18fe67b59d172e..6540e787d28346 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 1 #define V8_BUILD_NUMBER 281 -#define V8_PATCH_LEVEL 83 +#define V8_PATCH_LEVEL 84 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) From 125df45b806585cb00d72482afc137bf2b7fbf2b Mon Sep 17 00:00:00 2001 From: not-an-aardvark Date: Tue, 13 Sep 2016 18:20:46 -0400 Subject: [PATCH 014/216] doc: add not-an-aardvark to collaborators PR-URL: https://github.com/nodejs/node/pull/8525 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Evan Lucas Reviewed-By: Rich Trott --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 019d67a0a33b9d..c6d9651d06ac43 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,8 @@ more information about the governance of the Node.js project, see **Mikeal Rogers** <mikeal.rogers@gmail.com> * [monsanto](https://github.com/monsanto) - **Christopher Monsanto** <chris@monsan.to> +* [not-an-aardvark](https://github.com/not-an-aardvark) - +**Teddy Katz** <teddy.katz@gmail.com> * [Olegas](https://github.com/Olegas) - **Oleg Elifantiev** <oleg@elifantiev.ru> * [orangemocha](https://github.com/orangemocha) - From ff238c8d15cfe81f61f7433834aa225427694332 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 10 Sep 2016 10:42:05 -0700 Subject: [PATCH 015/216] test: fix flaky test-force-repl Increase time allowed for startup from 1 second to 5 seconds to avoid occasional flakiness. While at it, refactor a few minor things such as var->const and using common.mustCall(). Fixes: https://github.com/nodejs/node/issues/8483 PR-URL: https://github.com/nodejs/node/pull/8484 Reviewed-By: Santiago Gimeno Reviewed-By: James M Snell --- test/parallel/test-force-repl.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/test/parallel/test-force-repl.js b/test/parallel/test-force-repl.js index 5907dc2019a3a3..37f2f603342a1c 100644 --- a/test/parallel/test-force-repl.js +++ b/test/parallel/test-force-repl.js @@ -1,24 +1,18 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; // spawn a node child process in "interactive" mode (force the repl) -var cp = spawn(process.execPath, ['-i']); -var gotToEnd = false; +const cp = spawn(process.execPath, ['-i']); var timeoutId = setTimeout(function() { - throw new Error('timeout!'); -}, common.platformTimeout(1000)); // give node + the repl 1 second to boot up + common.fail('timeout!'); +}, common.platformTimeout(5000)); // give node + the repl 5 seconds to start cp.stdout.setEncoding('utf8'); -cp.stdout.once('data', function(b) { +cp.stdout.once('data', common.mustCall(function(b) { clearTimeout(timeoutId); - assert.equal(b, '> '); - gotToEnd = true; + assert.strictEqual(b, '> '); cp.kill(); -}); - -process.on('exit', function() { - assert(gotToEnd); -}); +})); From 929d9bb2224b5527795f2e8bd4c36c5db88b4ae5 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Mon, 29 Aug 2016 22:35:03 -0700 Subject: [PATCH 016/216] doc: standardize rest parameters PR-URL: https://github.com/nodejs/node/pull/8485 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/console.md | 18 +++++++++--------- doc/api/domain.md | 7 ++++--- doc/api/events.md | 2 +- doc/api/globals.md | 12 ++++++------ doc/api/path.md | 8 ++++---- doc/api/process.md | 7 +++---- doc/api/timers.md | 18 +++++++++--------- doc/api/util.md | 20 ++++++++++---------- 8 files changed, 46 insertions(+), 46 deletions(-) diff --git a/doc/api/console.md b/doc/api/console.md index 74850c0c2e0c9f..7b8d893197473f 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -100,7 +100,7 @@ The global `console` is a special `Console` whose output is sent to new Console(process.stdout, process.stderr); ``` -### console.assert(value[, message][, ...]) +### console.assert(value[, message][, ...args]) @@ -177,7 +177,7 @@ Defaults to `2`. To make it recurse indefinitely, pass `null`. Defaults to `false`. Colors are customizable; see [customizing `util.inspect()` colors][]. -### console.error([data][, ...]) +### console.error([data][, ...args]) @@ -199,14 +199,14 @@ If formatting elements (e.g. `%d`) are not found in the first string then [`util.inspect()`][] is called on each argument and the resulting string values are concatenated. See [`util.format()`][] for more information. -### console.info([data][, ...]) +### console.info([data][, ...args]) The `console.info()` function is an alias for [`console.log()`][]. -### console.log([data][, ...]) +### console.log([data][, ...args]) @@ -260,7 +260,7 @@ leaking it. On older versions, the timer persisted. This allowed `console.timeEnd()` to be called multiple times for the same label. This functionality was unintended and is no longer supported.* -### console.trace(message[, ...]) +### console.trace(message[, ...args]) @@ -284,20 +284,20 @@ console.trace('Show me'); // at REPLServer.Interface._ttyWrite (readline.js:826:14) ``` -### console.warn([data][, ...]) +### console.warn([data][, ...args]) The `console.warn()` function is an alias for [`console.error()`][]. -[`console.error()`]: #console_console_error_data -[`console.log()`]: #console_console_log_data +[`console.error()`]: #console_console_error_data_args +[`console.log()`]: #console_console_log_data_args [`console.time()`]: #console_console_time_label [`console.timeEnd()`]: #console_console_timeend_label [`process.stderr`]: process.html#process_process_stderr [`process.stdout`]: process.html#process_process_stdout -[`util.format()`]: util.html#util_util_format_format +[`util.format()`]: util.html#util_util_format_format_args [`util.inspect()`]: util.html#util_util_inspect_object_options [customizing `util.inspect()` colors]: util.html#util_customizing_util_inspect_colors [web-api-assert]: https://developer.mozilla.org/en-US/docs/Web/API/console/assert diff --git a/doc/api/domain.md b/doc/api/domain.md index 2fe7e2c39af718..e1dd65e05c45d3 100644 --- a/doc/api/domain.md +++ b/doc/api/domain.md @@ -269,9 +269,10 @@ uncaught exceptions to the active Domain object. Domain is a child class of [`EventEmitter`][]. To handle the errors that it catches, listen to its `'error'` event. -### domain.run(fn[, arg][, ...]) +### domain.run(fn[, ...args]) * `fn` {Function} +* `...args` {any} Run the supplied function in the context of the domain, implicitly binding all event emitters, timers, and lowlevel requests that are @@ -449,6 +450,6 @@ is emitted. [`domain.exit()`]: #domain_domain_exit [`Error`]: errors.html#errors_class_error [`EventEmitter`]: events.html#events_class_eventemitter -[`setInterval()`]: timers.html#timers_setinterval_callback_delay_arg -[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_arg +[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args +[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args [`throw`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw diff --git a/doc/api/events.md b/doc/api/events.md index 6b19287881c132..7affd97ef37dc0 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -293,7 +293,7 @@ added: v0.1.26 Alias for `emitter.on(eventName, listener)`. -### emitter.emit(eventName[, arg1][, arg2][, ...]) +### emitter.emit(eventName[, ...args]) diff --git a/doc/api/globals.md b/doc/api/globals.md index 63fbf64f6e3d25..85eda3169b0871 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -182,19 +182,19 @@ left untouched. Use the internal `require()` machinery to look up the location of a module, but rather than loading the module, just return the resolved filename. -## setImmediate(callback[, arg][, ...]) +## setImmediate(callback[, ...args]) [`setImmediate`] is described in the [timers][] section. -## setInterval(callback, delay[, arg][, ...]) +## setInterval(callback, delay[, ...args]) [`setInterval`] is described in the [timers][] section. -## setTimeout(callback, delay[, arg][, ...]) +## setTimeout(callback, delay[, ...args]) @@ -210,7 +210,7 @@ but rather than loading the module, just return the resolved filename. [`clearImmediate`]: timers.html#timers_clearimmediate_immediate [`clearInterval`]: timers.html#timers_clearinterval_timeout [`clearTimeout`]: timers.html#timers_cleartimeout_timeout -[`setImmediate`]: timers.html#timers_setimmediate_callback_arg -[`setInterval`]: timers.html#timers_setinterval_callback_delay_arg -[`setTimeout`]: timers.html#timers_settimeout_callback_delay_arg +[`setImmediate`]: timers.html#timers_setimmediate_callback_args +[`setInterval`]: timers.html#timers_setinterval_callback_delay_args +[`setTimeout`]: timers.html#timers_settimeout_callback_delay_args [built-in objects]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects diff --git a/doc/api/path.md b/doc/api/path.md index eb7d9766bc4b80..e99d34f1e341b5 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -272,12 +272,12 @@ path.isAbsolute('.') // false A [`TypeError`][] is thrown if `path` is not a string. -## path.join([path[, ...]]) +## path.join([...paths]) -* `[path[, ...]]` {String} A sequence of path segments +* `...paths` {String} A sequence of path segments The `path.join()` method join all given `path` segments together using the platform specific separator as a delimiter, then normalizes the resulting path. @@ -438,12 +438,12 @@ path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb') A [`TypeError`][] is thrown if neither `from` nor `to` is a string. -## path.resolve([path[, ...]]) +## path.resolve([...paths]) -* `[path[, ...]]` {String} A sequence of paths or path segments +* `...paths` {String} A sequence of paths or path segments The `path.resolve()` method resolves a sequence of paths or path segments into an absolute path. diff --git a/doc/api/process.md b/doc/api/process.md index fd67f55dbe2e1d..94c5f2dc919002 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1143,14 +1143,13 @@ Will generate: `heapTotal` and `heapUsed` refer to V8's memory usage. -## process.nextTick(callback[, arg][, ...]) +## process.nextTick(callback[, ...args]) * `callback` {Function} -* `[, arg][, ...]` {any} Additional arguments to pass when invoking the - `callback` +* `...args` {any} Additional arguments to pass when invoking the `callback` The `process.nextTick()` method adds the `callback` to the "next tick queue". Once the current turn of the event loop turn runs to completion, all callbacks @@ -1705,7 +1704,7 @@ cases: [`process.execPath`]: #process_process_execpath [`promise.catch()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch [`require.main`]: modules.html#modules_accessing_the_main_module -[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_arg +[`setTimeout(fn, 0)`]: timers.html#timers_settimeout_callback_delay_args [process_emit_warning]: #process_process_emitwarning_warning_name_ctor [process_warning]: #process_event_warning [Signal Events]: #process_signal_events diff --git a/doc/api/timers.md b/doc/api/timers.md index e356d2d672d793..b833e06d6e3336 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -65,14 +65,14 @@ a certain period of time. When a timer's function is called varies depending on which method was used to create the timer and what other work the Node.js event loop is doing. -### setImmediate(callback[, ...arg]) +### setImmediate(callback[, ...args]) * `callback` {Function} The function to call at the end of this turn of [the Node.js Event Loop] -* `[, ...arg]` Optional arguments to pass when the `callback` is called. +* `...args` {any} Optional arguments to pass when the `callback` is called. Schedules the "immediate" execution of the `callback` after I/O events' callbacks and before timers created using [`setTimeout()`][] and @@ -87,7 +87,7 @@ next event loop iteration. If `callback` is not a function, a [`TypeError`][] will be thrown. -### setInterval(callback, delay[, ...arg]) +### setInterval(callback, delay[, ...args]) @@ -95,7 +95,7 @@ added: v0.0.1 * `callback` {Function} The function to call when the timer elapses. * `delay` {number} The number of milliseconds to wait before calling the `callback`. -* `[, ...arg]` Optional arguments to pass when the `callback` is called. +* `...args` {any} Optional arguments to pass when the `callback` is called. Schedules repeated execution of `callback` every `delay` milliseconds. Returns a `Timeout` for use with [`clearInterval()`][]. @@ -105,7 +105,7 @@ set to `1`. If `callback` is not a function, a [`TypeError`][] will be thrown. -### setTimeout(callback, delay[, ...arg]) +### setTimeout(callback, delay[, ...args]) @@ -113,7 +113,7 @@ added: v0.0.1 * `callback` {Function} The function to call when the timer elapses. * `delay` {number} The number of milliseconds to wait before calling the `callback`. -* `[, ...arg]` Optional arguments to pass when the `callback` is called. +* `...args` {any} Optional arguments to pass when the `callback` is called. Schedules execution of a one-time `callback` after `delay` milliseconds. Returns a `Timeout` for use with [`clearTimeout()`][]. @@ -168,6 +168,6 @@ Cancels a `Timeout` object created by [`setTimeout()`][]. [`clearImmediate()`]: timers.html#timers_clearimmediate_immediate [`clearInterval()`]: timers.html#timers_clearinterval_timeout [`clearTimeout()`]: timers.html#timers_cleartimeout_timeout -[`setImmediate()`]: timers.html#timers_setimmediate_callback_arg -[`setInterval()`]: timers.html#timers_setinterval_callback_delay_arg -[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_arg +[`setImmediate()`]: timers.html#timers_setimmediate_callback_args +[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args +[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args diff --git a/doc/api/util.md b/doc/api/util.md index 03d6f4d8f923f2..3cd80cb5dc2941 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -88,12 +88,12 @@ The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`. -## util.format(format[, ...]) +## util.format(format[, ...args]) -* `format` {string} A `printf`-like format string. +* `format` {String} A `printf`-like format string. The `util.format()` method returns a formatted string using the first argument as a `printf`-like format. @@ -367,11 +367,11 @@ deprecated: v0.11.3 > Stability: 0 - Deprecated: Use [`console.error()`][] instead. -* `string` {string} The message to print to `stderr` +* `string` {String} The message to print to `stderr` Deprecated predecessor of `console.error`. -### util.error([...]) +### util.error([...strings]) -* `urlString` {string} The URL string to parse. -* `parseQueryString` {boolean} If `true`, the `query` property will always +* `urlString` {String} The URL string to parse. +* `parseQueryString` {Boolean} If `true`, the `query` property will always be set to an object returned by the [`querystring`][] module's `parse()` method. If `false`, the `query` property on the returned URL object will be an unparsed, undecoded string. Defaults to `false`. -* `slashesDenoteHost` {boolean} If `true`, the first token after the literal +* `slashesDenoteHost` {Boolean} If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. @@ -221,8 +221,8 @@ object. added: v0.1.25 --> -* `from` {string} The Base URL being resolved against. -* `to` {string} The HREF URL being resolved. +* `from` {String} The Base URL being resolved against. +* `to` {String} The HREF URL being resolved. The `url.resolve()` method resolves a target URL relative to a base URL in a manner similar to that of a Web browser resolving an anchor tag HREF. From 02da155e4b93c391b7c89947918f2e4c2728ccc5 Mon Sep 17 00:00:00 2001 From: yorkie Date: Sun, 11 Sep 2016 09:06:39 +0800 Subject: [PATCH 020/216] timers: remove unreachable code PR-URL: https://github.com/nodejs/node/pull/8487 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen Reviewed-By: Jeremiah Senkpiel --- lib/timers.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/timers.js b/lib/timers.js index f6ecf3e100a81e..574fb810d61e02 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -333,7 +333,6 @@ exports.setTimeout = function(callback, after) { var ontimeout = callback; switch (length) { // fast cases - case 0: case 1: case 2: break; @@ -392,7 +391,6 @@ exports.setInterval = function(callback, repeat) { var length = arguments.length; var ontimeout = callback; switch (length) { - case 0: case 1: case 2: break; @@ -605,7 +603,6 @@ exports.setImmediate = function(callback, arg1, arg2, arg3) { switch (arguments.length) { // fast cases - case 0: case 1: break; case 2: From 8a1f74338c37fb8ebc85688511a0d2bf1203d132 Mon Sep 17 00:00:00 2001 From: "Italo A. Casas" Date: Mon, 12 Sep 2016 09:11:05 -0400 Subject: [PATCH 021/216] doc: remove duplicate content from readline doc Remove a duplicate sentence from the `rl.close()` method description. PR-URL: https://github.com/nodejs/node/pull/8497 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Prince John Wesley Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- doc/api/readline.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/api/readline.md b/doc/api/readline.md index 0717c7400a7c88..36c7e4502274bd 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -202,8 +202,6 @@ added: v0.1.98 The `rl.close()` method closes the `readline.Interface` instance and relinquishes control over the `input` and `output` streams. When called, the `'close'` event will be emitted. -Closes the `Interface` instance, relinquishing control on the `input` and -`output` streams. The `'close'` event will also be emitted. ### rl.pause() const and let Changed assert.equal --> assert.strictEqual PR-URL: https://github.com/nodejs/node/pull/8602 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Ilkka Myller --- .../parallel/test-child-process-disconnect.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/parallel/test-child-process-disconnect.js b/test/parallel/test-child-process-disconnect.js index 4681e0405340d5..ee9488d1cd0b05 100644 --- a/test/parallel/test-child-process-disconnect.js +++ b/test/parallel/test-child-process-disconnect.js @@ -1,14 +1,14 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var fork = require('child_process').fork; -var net = require('net'); +const assert = require('assert'); +const fork = require('child_process').fork; +const net = require('net'); // child if (process.argv[2] === 'child') { // Check that the 'disconnect' event is deferred to the next event loop tick. - var disconnect = process.disconnect; + const disconnect = process.disconnect; process.disconnect = function() { disconnect.apply(this, arguments); // If the event is emitted synchronously, we're too late by now. @@ -17,7 +17,7 @@ if (process.argv[2] === 'child') { function disconnectIsNotAsync() {} }; - var server = net.createServer(); + const server = net.createServer(); server.on('connection', function(socket) { @@ -45,10 +45,10 @@ if (process.argv[2] === 'child') { } else { // testcase - var child = fork(process.argv[1], ['child']); + const child = fork(process.argv[1], ['child']); - var childFlag = false; - var parentFlag = false; + let childFlag = false; + let parentFlag = false; // when calling .disconnect the event should emit // and the disconnected flag should be true. @@ -64,7 +64,7 @@ if (process.argv[2] === 'child') { if (obj && obj.msg === 'ready') { // connect to child using TCP to know if disconnect was emitted - var socket = net.connect(obj.port); + const socket = net.connect(obj.port); socket.on('data', function(data) { data = data.toString(); @@ -84,7 +84,7 @@ if (process.argv[2] === 'child') { }); process.on('exit', function() { - assert.equal(childFlag, false); - assert.equal(parentFlag, false); + assert.strictEqual(childFlag, false); + assert.strictEqual(parentFlag, false); }); } From f2f6353bc44321ab7f3b8c0bcb456cd8714863ee Mon Sep 17 00:00:00 2001 From: Alessandro Metta Date: Wed, 14 Sep 2016 23:28:35 -0700 Subject: [PATCH 045/216] test: cleanup test-intl.js Improved variables to be all const. Enforced assert.strictEqual across all tests. Modified haveIntl tests to check for int. Fixed alignment. PR-URL: https://github.com/nodejs/node/pull/8641 Reviewed-By: Rich Trott Reviewed-By: Ilkka Myller --- test/parallel/test-intl.js | 63 ++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index 7c24ad69b31146..3b56defe471af0 100644 --- a/test/parallel/test-intl.js +++ b/test/parallel/test-intl.js @@ -1,21 +1,21 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); // does node think that i18n was enabled? -var enablei18n = process.config.variables.v8_enable_i18n_support; +let enablei18n = process.config.variables.v8_enable_i18n_support; if (enablei18n === undefined) { - enablei18n = false; + enablei18n = 0; } // is the Intl object present? -var haveIntl = (global.Intl != undefined); +const haveIntl = (global.Intl !== undefined); // Returns true if no specific locale ids were configured (i.e. "all") // Else, returns true if loc is in the configured list // Else, returns false function haveLocale(loc) { - var locs = process.config.variables.icu_locales.split(','); + const locs = process.config.variables.icu_locales.split(','); return locs.indexOf(loc) !== -1; } @@ -23,7 +23,7 @@ if (!haveIntl) { const erMsg = '"Intl" object is NOT present but v8_enable_i18n_support is ' + enablei18n; - assert.equal(enablei18n, false, erMsg); + assert.strictEqual(enablei18n, 0, erMsg); common.skip('Intl tests because Intl object not present.'); } else { @@ -31,16 +31,16 @@ if (!haveIntl) { '"Intl" object is present but v8_enable_i18n_support is ' + enablei18n + '. Is this test out of date?'; - assert.equal(enablei18n, true, erMsg); + assert.strictEqual(enablei18n, 1, erMsg); // Construct a new date at the beginning of Unix time - var date0 = new Date(0); + const date0 = new Date(0); // Use the GMT time zone - var GMT = 'Etc/GMT'; + const GMT = 'Etc/GMT'; // Construct an English formatter. Should format to "Jan 70" - var dtf = + const dtf = new Intl.DateTimeFormat(['en'], {timeZone: GMT, month: 'short', year: '2-digit'}); @@ -54,30 +54,33 @@ if (!haveIntl) { } // Check with toLocaleString - var localeString = dtf.format(date0); - assert.equal(localeString, 'Jan 70'); - + { + const localeString = dtf.format(date0); + assert.strictEqual(localeString, 'Jan 70'); + } // Options to request GMT - var optsGMT = {timeZone: GMT}; + const optsGMT = {timeZone: GMT}; // Test format - localeString = date0.toLocaleString(['en'], optsGMT); - assert.equal(localeString, '1/1/1970, 12:00:00 AM'); - + { + const localeString = date0.toLocaleString(['en'], optsGMT); + assert.strictEqual(localeString, '1/1/1970, 12:00:00 AM'); + } // number format - assert.equal(new Intl.NumberFormat(['en']).format(12345.67890), '12,345.679'); + const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890); + assert.strictEqual(numberFormat, '12,345.679'); - var collOpts = { sensitivity: 'base', ignorePunctuation: true }; - var coll = new Intl.Collator(['en'], collOpts); + const collOpts = { sensitivity: 'base', ignorePunctuation: true }; + const coll = new Intl.Collator(['en'], collOpts); - assert.equal(coll.compare('blackbird', 'black-bird'), 0, - 'ignore punctuation failed'); - assert.equal(coll.compare('blackbird', 'red-bird'), -1, - 'compare less failed'); - assert.equal(coll.compare('bluebird', 'blackbird'), 1, - 'compare greater failed'); - assert.equal(coll.compare('Bluebird', 'bluebird'), 0, - 'ignore case failed'); - assert.equal(coll.compare('\ufb03', 'ffi'), 0, - 'ffi ligature (contraction) failed'); + assert.strictEqual(coll.compare('blackbird', 'black-bird'), 0, + 'ignore punctuation failed'); + assert.strictEqual(coll.compare('blackbird', 'red-bird'), -1, + 'compare less failed'); + assert.strictEqual(coll.compare('bluebird', 'blackbird'), 1, + 'compare greater failed'); + assert.strictEqual(coll.compare('Bluebird', 'bluebird'), 0, + 'ignore case failed'); + assert.strictEqual(coll.compare('\ufb03', 'ffi'), 0, + 'ffi ligature (contraction) failed'); } From a425c4da981b5bb9af33f6ae54bb3de647bc1c2d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 5 Sep 2016 22:34:06 +0200 Subject: [PATCH 046/216] build: run `npm install` for doc builds in tarball MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run `npm install` before building the documentation from release tarballs. The doctool currently depends on `js-yaml`, which is imported from the `tools/eslint` subtree; however, release tarballs don’t contain that directory. Running `npm install` is clearly not a beautiful solution, but it works. Fixes: https://github.com/nodejs/node/issues/7872 PR-URL: https://github.com/nodejs/node/pull/8413 Reviewed-By: Ben Noordhuis Reviewed-By: Johan Bergström Reviewed-By: James M Snell --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 6f955b5e3ae24d..062147bbf2d981 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ EXEEXT := $(shell $(PYTHON) -c \ NODE_EXE = node$(EXEEXT) NODE ?= ./$(NODE_EXE) NODE_G_EXE = node_g$(EXEEXT) +NPM ?= ./deps/npm/bin/npm-cli.js # Flags for packaging. BUILD_DOWNLOAD_FLAGS ?= --download=all @@ -311,11 +312,25 @@ out/doc/%: doc/% # check if ./node is actually set, else use user pre-installed binary gen-json = tools/doc/generate.js --format=json $< > $@ out/doc/api/%.json: doc/api/%.md + [ -e tools/doc/node_modules/js-yaml/package.json ] || \ + [ -e tools/eslint/node_modules/js-yaml/package.json ] || \ + if [ -x $(NODE) ]; then \ + cd tools/doc && ../../$(NODE) ../../$(NPM) install; \ + else \ + cd tools/doc && node ../../$(NPM) install; \ + fi [ -x $(NODE) ] && $(NODE) $(gen-json) || node $(gen-json) # check if ./node is actually set, else use user pre-installed binary gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html --template=doc/template.html $< > $@ out/doc/api/%.html: doc/api/%.md + [ -e tools/doc/node_modules/js-yaml/package.json ] || \ + [ -e tools/eslint/node_modules/js-yaml/package.json ] || \ + if [ -x $(NODE) ]; then \ + cd tools/doc && ../../$(NODE) ../../$(NPM) install; \ + else \ + cd tools/doc && node ../../$(NPM) install; \ + fi [ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html) docopen: out/doc/api/all.html From 7728f95967fb5d58f51b7a3a1593fe09b25b608d Mon Sep 17 00:00:00 2001 From: Dany Shaanan Date: Sat, 17 Sep 2016 10:34:13 +0200 Subject: [PATCH 047/216] util: simplify SIMD setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/8579 Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen Reviewed-By: Ilkka Myller --- lib/util.js | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/lib/util.js b/lib/util.js index 245b19639324df..2d7ba651639c20 100644 --- a/lib/util.js +++ b/lib/util.js @@ -38,35 +38,23 @@ if (typeof global.SIMD === 'object' && global.SIMD !== null) { const SIMD = global.SIMD; // Pacify eslint. - if (typeof SIMD.Bool16x8 === 'function') - simdFormatters.set(SIMD.Bool16x8, make(SIMD.Bool16x8.extractLane, 8)); - - if (typeof SIMD.Bool32x4 === 'function') - simdFormatters.set(SIMD.Bool32x4, make(SIMD.Bool32x4.extractLane, 4)); - - if (typeof SIMD.Bool8x16 === 'function') - simdFormatters.set(SIMD.Bool8x16, make(SIMD.Bool8x16.extractLane, 16)); - - if (typeof SIMD.Float32x4 === 'function') - simdFormatters.set(SIMD.Float32x4, make(SIMD.Float32x4.extractLane, 4)); - - if (typeof SIMD.Int16x8 === 'function') - simdFormatters.set(SIMD.Int16x8, make(SIMD.Int16x8.extractLane, 8)); - - if (typeof SIMD.Int32x4 === 'function') - simdFormatters.set(SIMD.Int32x4, make(SIMD.Int32x4.extractLane, 4)); - - if (typeof SIMD.Int8x16 === 'function') - simdFormatters.set(SIMD.Int8x16, make(SIMD.Int8x16.extractLane, 16)); - - if (typeof SIMD.Uint16x8 === 'function') - simdFormatters.set(SIMD.Uint16x8, make(SIMD.Uint16x8.extractLane, 8)); - - if (typeof SIMD.Uint32x4 === 'function') - simdFormatters.set(SIMD.Uint32x4, make(SIMD.Uint32x4.extractLane, 4)); + const countPerType = { + Bool16x8: 8, + Bool32x4: 4, + Bool8x16: 16, + Float32x4: 4, + Int16x8: 8, + Int32x4: 4, + Int8x16: 16, + Uint16x8: 8, + Uint32x4: 4, + Uint8x16: 16 + }; - if (typeof SIMD.Uint8x16 === 'function') - simdFormatters.set(SIMD.Uint8x16, make(SIMD.Uint8x16.extractLane, 16)); + for (const key in countPerType) { + const type = SIMD[key]; + simdFormatters.set(type, make(type.extractLane, countPerType[key])); + } } function tryStringify(arg) { From a12ff5cc5db3bd185da0dd8017954427554e4d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Sat, 6 Aug 2016 13:58:55 +0300 Subject: [PATCH 048/216] tools: clean up icu/README.md formatting 1. Normalize headings. 2. Specify language in all code blocks. PR-URL: https://github.com/nodejs/node/pull/8660 Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen --- tools/icu/README.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tools/icu/README.md b/tools/icu/README.md index 6c08bf15980739..2e53563cddf0f7 100644 --- a/tools/icu/README.md +++ b/tools/icu/README.md @@ -1,13 +1,11 @@ -Notes about the icu directory. -=== +# Notes about the icu directory. -How to upgrade ICU ---- +## How to upgrade ICU - Make sure your node workspace is clean (clean `git status`) should be sufficient. - Configure Node with the specific [ICU version](http://icu-project.org/download) you want to upgrade to, for example: -``` +```shell ./configure \ --with-intl=small-icu \ --with-icu-source=http://download.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.zip @@ -21,7 +19,7 @@ version specific stuff) - Verify the node build works -``` +```shell make test-ci ``` @@ -36,7 +34,7 @@ Also running - Now, copy `deps/icu` over to `deps/icu-small` -``` +```shell python tools/icu/shrink-icu-src.py ``` @@ -44,7 +42,7 @@ python tools/icu/shrink-icu-src.py (TODO: fix this when these options become default) -``` +```shell ./configure --with-intl=small-icu --with-icu-source=deps/icu-small make ``` @@ -64,7 +62,7 @@ This is a big commit, so make this a separate commit from other changes. the `configure_intl()` function. It should match the ICU URL used in the first step. When this is done, the following should build with full ICU. -``` +```shell # clean up rm -rf out deps/icu deps/icu4c* ./configure --with-intl=full-icu --download=all @@ -76,8 +74,7 @@ make test-ci ----- -Notes about these tools ---- +## Notes about these tools The files in this directory were written for the node.js effort. It's the intent of their author (Steven R. Loomis / srl295) to merge them From fc6b4970b50f6330dc9a78dc706dcb7256ed5610 Mon Sep 17 00:00:00 2001 From: Pavol Otcenas Date: Sat, 17 Sep 2016 10:30:29 +0200 Subject: [PATCH 049/216] test: modernize JS and tighten equality checking Changed var --> const and let. Changed assert.equal !== --> assert.notStrictEqual Correctly aligned argument PR-URL: https://github.com/nodejs/node/pull/8580 Reviewed-By: Robert Jefe Lindstaedt Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- test/parallel/test-child-process-detached.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-child-process-detached.js b/test/parallel/test-child-process-detached.js index 97de4881eb691a..b4cb8f41360092 100644 --- a/test/parallel/test-child-process-detached.js +++ b/test/parallel/test-child-process-detached.js @@ -1,21 +1,21 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); -var spawn = require('child_process').spawn; -var childPath = path.join(common.fixturesDir, - 'parent-process-nonpersistent.js'); -var persistentPid = -1; +const spawn = require('child_process').spawn; +const childPath = path.join(common.fixturesDir, + 'parent-process-nonpersistent.js'); +let persistentPid = -1; -var child = spawn(process.execPath, [ childPath ]); +const child = spawn(process.execPath, [ childPath ]); child.stdout.on('data', function(data) { persistentPid = parseInt(data, 10); }); process.on('exit', function() { - assert(persistentPid !== -1); + assert.notStrictEqual(persistentPid, -1); assert.throws(function() { process.kill(child.pid); }); From fd7f87ef402c87580df168151ed1cbd644623699 Mon Sep 17 00:00:00 2001 From: Ishan Aditya Date: Sat, 17 Sep 2016 14:39:36 +0200 Subject: [PATCH 050/216] test: var variables to const in zlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in test-zlib-from-string is because var->const pushed us over the max char limit per line. PR-URL: https://github.com/nodejs/node/pull/8627 Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: targos - Michaël Zasso Reviewed-By: Anna Henningsen --- test/parallel/test-zlib-close-after-write.js | 4 +- test/parallel/test-zlib-const.js | 4 +- .../parallel/test-zlib-convenience-methods.js | 8 +-- test/parallel/test-zlib-dictionary-fail.js | 6 +- test/parallel/test-zlib-flush.js | 10 ++-- test/parallel/test-zlib-from-gzip.js | 26 ++++----- test/parallel/test-zlib-from-string.js | 57 ++++++++++--------- test/parallel/test-zlib-invalid-input.js | 4 +- test/parallel/test-zlib-params.js | 13 +++-- test/parallel/test-zlib-random-byte-pipes.js | 18 +++--- test/parallel/test-zlib-write-after-close.js | 6 +- test/parallel/test-zlib-write-after-flush.js | 10 ++-- test/parallel/test-zlib-zero-byte.js | 8 +-- test/parallel/test-zlib.js | 8 +-- 14 files changed, 92 insertions(+), 90 deletions(-) diff --git a/test/parallel/test-zlib-close-after-write.js b/test/parallel/test-zlib-close-after-write.js index 4e99ad07760ad4..d25ccfe381f113 100644 --- a/test/parallel/test-zlib-close-after-write.js +++ b/test/parallel/test-zlib-close-after-write.js @@ -1,9 +1,9 @@ 'use strict'; const common = require('../common'); -var zlib = require('zlib'); +const zlib = require('zlib'); zlib.gzip('hello', common.mustCall(function(err, out) { - var unzip = zlib.createGunzip(); + const unzip = zlib.createGunzip(); unzip.write(out); unzip.close(common.mustCall(function() {})); })); diff --git a/test/parallel/test-zlib-const.js b/test/parallel/test-zlib-const.js index b7eb31d2c5f48c..22852b297e7ed0 100644 --- a/test/parallel/test-zlib-const.js +++ b/test/parallel/test-zlib-const.js @@ -1,8 +1,8 @@ /* eslint-disable strict */ require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var zlib = require('zlib'); +const zlib = require('zlib'); assert.equal(zlib.Z_OK, 0, 'Z_OK should be 0'); zlib.Z_OK = 1; diff --git a/test/parallel/test-zlib-convenience-methods.js b/test/parallel/test-zlib-convenience-methods.js index ccb3347266a9b4..3aac0142b55d66 100644 --- a/test/parallel/test-zlib-convenience-methods.js +++ b/test/parallel/test-zlib-convenience-methods.js @@ -2,13 +2,13 @@ // test convenience methods with and without options supplied require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); +const assert = require('assert'); +const zlib = require('zlib'); var hadRun = 0; -var expect = 'blahblahblahblahblahblah'; -var opts = { +const expect = 'blahblahblahblahblahblah'; +const opts = { level: 9, chunkSize: 1024, }; diff --git a/test/parallel/test-zlib-dictionary-fail.js b/test/parallel/test-zlib-dictionary-fail.js index 21c94b2c41015b..52f295157b7e4f 100644 --- a/test/parallel/test-zlib-dictionary-fail.js +++ b/test/parallel/test-zlib-dictionary-fail.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); // Should raise an error, not trigger an assertion in src/node_zlib.cc { diff --git a/test/parallel/test-zlib-flush.js b/test/parallel/test-zlib-flush.js index 1bec5ff54391f6..abaa9ed2953d49 100644 --- a/test/parallel/test-zlib-flush.js +++ b/test/parallel/test-zlib-flush.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); +const path = require('path'); +const fs = require('fs'); const file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')); const chunkSize = 16; diff --git a/test/parallel/test-zlib-from-gzip.js b/test/parallel/test-zlib-from-gzip.js index 5d1c4bb562da52..3739d8f9b48b28 100644 --- a/test/parallel/test-zlib-from-gzip.js +++ b/test/parallel/test-zlib-from-gzip.js @@ -2,27 +2,27 @@ // test unzipping a file that was created with a non-node gzip lib, // piped in as fast as possible. -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); +const path = require('path'); common.refreshTmpDir(); -var gunzip = zlib.createGunzip(); +const gunzip = zlib.createGunzip(); -var fs = require('fs'); +const fs = require('fs'); -var fixture = path.resolve(common.fixturesDir, 'person.jpg.gz'); -var unzippedFixture = path.resolve(common.fixturesDir, 'person.jpg'); -var outputFile = path.resolve(common.tmpDir, 'person.jpg'); -var expect = fs.readFileSync(unzippedFixture); -var inp = fs.createReadStream(fixture); -var out = fs.createWriteStream(outputFile); +const fixture = path.resolve(common.fixturesDir, 'person.jpg.gz'); +const unzippedFixture = path.resolve(common.fixturesDir, 'person.jpg'); +const outputFile = path.resolve(common.tmpDir, 'person.jpg'); +const expect = fs.readFileSync(unzippedFixture); +const inp = fs.createReadStream(fixture); +const out = fs.createWriteStream(outputFile); inp.pipe(gunzip).pipe(out); out.on('close', function() { - var actual = fs.readFileSync(outputFile); + const actual = fs.readFileSync(outputFile); assert.equal(actual.length, expect.length, 'length should match'); for (var i = 0, l = actual.length; i < l; i++) { assert.equal(actual[i], expect[i], 'byte[' + i + ']'); diff --git a/test/parallel/test-zlib-from-string.js b/test/parallel/test-zlib-from-string.js index bff81b78d67ced..f3b8426eb4d862 100644 --- a/test/parallel/test-zlib-from-string.js +++ b/test/parallel/test-zlib-from-string.js @@ -2,35 +2,36 @@ // test compressing and uncompressing a string with zlib require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); +const assert = require('assert'); +const zlib = require('zlib'); -var inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing elit.' + - ' Morbi faucibus, purus at gravida dictum, libero arcu conv' + - 'allis lacus, in commodo libero metus eu nisi. Nullam commo' + - 'do, neque nec porta placerat, nisi est fermentum augue, vi' + - 'tae gravida tellus sapien sit amet tellus. Aenean non diam' + - ' orci. Proin quis elit turpis. Suspendisse non diam ipsum.' + - ' Suspendisse nec ullamcorper odio. Vestibulum arcu mi, sod' + - 'ales non suscipit id, ultrices ut massa. Sed ac sem sit am' + - 'et arcu malesuada fermentum. Nunc sed. '; -var expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpmXAK' + - 'LRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkDlKWL' + - 'JWkncJG5403HQXAkT3Jw29B9uIEmToMukglZ0vS6ociBh4JG' + - '8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491LofoAbWh8do43' + - 'oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+RSQsGoC7dn' + - '2t/xjhduTA1NWyQIZR0pbHwMDatnD+crPqKSqGPHp1vnlsWM' + - '/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqqqfKBtNMhe3OZh6N' + - '95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOHaFE4RdpnGavKtrB5' + - 'xzfO/Ll9'; -var expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN496' + - 'pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajNPk6Q' + - 'OUpYslaSdwkbnjTcdBcCRPcnDb0H24gSZOgy6SCVnS9LqhyIGHg' + - 'kbyxXihUsRQKK0raTGrVbM+cKEcPOxoYrLj3Uuh+gBtaHx2jjeh' + - '65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCwagLt2fa3/G' + - 'OF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+eWxYz/Tu5t/t' + - 'uF4XuSpKPzgGbRHV9hN9ory+qqp8oG00yF7c5mHo33kJO8xfkck' + - 'mLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2sHnHNzRtagj5AQAA'; +const inputString = 'ΩΩLorem ipsum dolor sit amet, consectetur adipiscing eli' + + 't. Morbi faucibus, purus at gravida dictum, libero arcu ' + + 'convallis lacus, in commodo libero metus eu nisi. Nullam' + + ' commodo, neque nec porta placerat, nisi est fermentum a' + + 'ugue, vitae gravida tellus sapien sit amet tellus. Aenea' + + 'n non diam orci. Proin quis elit turpis. Suspendisse non' + + ' diam ipsum. Suspendisse nec ullamcorper odio. Vestibulu' + + 'm arcu mi, sodales non suscipit id, ultrices ut massa. S' + + 'ed ac sem sit amet arcu malesuada fermentum. Nunc sed. '; +const expectedBase64Deflate = 'eJxdUUtOQzEMvMoc4OndgT0gJCT2buJWlpI4jePeqZfpmX' + + 'AKLRKbLOzx/HK73q6vOrhCunlF1qIDJhNUeW5I2ozT5OkD' + + 'lKWLJWkncJG5403HQXAkT3Jw29B9uIEmToMukglZ0vS6oc' + + 'iBh4JG8sV4oVLEUCitK2kxq1WzPnChHDzsaGKy491LofoA' + + 'bWh8do43oeuYhB5EPCjcLjzYJo48KrfQBvnJecNFJvHT1+' + + 'RSQsGoC7dn2t/xjhduTA1NWyQIZR0pbHwMDatnD+crPqKS' + + 'qGPHp1vnlsWM/07ubf7bheF7kqSj84Bm0R1fYTfaK8vqqq' + + 'fKBtNMhe3OZh6N95CTvMX5HJJi4xOVzCgUOIMSLH7wmeOH' + + 'aFE4RdpnGavKtrB5xzfO/Ll9'; +const expectedBase64Gzip = 'H4sIAAAAAAAAA11RS05DMQy8yhzg6d2BPSAkJPZu4laWkjiN4' + + '96pl+mZcAotEpss7PH8crverq86uEK6eUXWogMmE1R5bkjajN' + + 'Pk6QOUpYslaSdwkbnjTcdBcCRPcnDb0H24gSZOgy6SCVnS9Lq' + + 'hyIGHgkbyxXihUsRQKK0raTGrVbM+cKEcPOxoYrLj3Uuh+gBt' + + 'aHx2jjeh65iEHkQ8KNwuPNgmjjwqt9AG+cl5w0Um8dPX5FJCw' + + 'agLt2fa3/GOF25MDU1bJAhlHSlsfAwNq2cP5ys+opKoY8enW+' + + 'eWxYz/Tu5t/tuF4XuSpKPzgGbRHV9hN9ory+qqp8oG00yF7c5' + + 'mHo33kJO8xfkckmLjE5XMKBQ4gxIsfvCZ44doUThF2mcZq8q2' + + 'sHnHNzRtagj5AQAA'; zlib.deflate(inputString, function(err, buffer) { assert.equal(buffer.toString('base64'), expectedBase64Deflate, diff --git a/test/parallel/test-zlib-invalid-input.js b/test/parallel/test-zlib-invalid-input.js index 4eb6779c4158ae..ee2ee85d73ff09 100644 --- a/test/parallel/test-zlib-invalid-input.js +++ b/test/parallel/test-zlib-invalid-input.js @@ -5,7 +5,7 @@ require('../common'); const assert = require('assert'); const zlib = require('zlib'); -var nonStringInputs = [1, true, {a: 1}, ['a']]; +const nonStringInputs = [1, true, {a: 1}, ['a']]; console.error('Doing the non-strings'); nonStringInputs.forEach(function(input) { @@ -20,7 +20,7 @@ nonStringInputs.forEach(function(input) { console.error('Doing the unzips'); // zlib.Unzip classes need to get valid data, or else they'll throw. -var unzips = [ zlib.Unzip(), +const unzips = [ zlib.Unzip(), zlib.Gunzip(), zlib.Inflate(), zlib.InflateRaw() ]; diff --git a/test/parallel/test-zlib-params.js b/test/parallel/test-zlib-params.js index eea47979e3b3db..fc5888b32ac60d 100644 --- a/test/parallel/test-zlib-params.js +++ b/test/parallel/test-zlib-params.js @@ -1,9 +1,9 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); -var path = require('path'); -var fs = require('fs'); +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); +const path = require('path'); +const fs = require('fs'); const file = fs.readFileSync(path.resolve(common.fixturesDir, 'person.jpg')); const chunkSize = 12 * 1024; @@ -20,7 +20,8 @@ deflater.write(chunk1, function() { deflater.params(0, zlib.Z_DEFAULT_STRATEGY, function() { while (deflater.read()); deflater.end(chunk2, function() { - var bufs = [], buf; + const bufs = []; + var buf; while (buf = deflater.read()) bufs.push(buf); actual = Buffer.concat(bufs); diff --git a/test/parallel/test-zlib-random-byte-pipes.js b/test/parallel/test-zlib-random-byte-pipes.js index 006bf14b8c2d80..6037703f7bf2ca 100644 --- a/test/parallel/test-zlib-random-byte-pipes.js +++ b/test/parallel/test-zlib-random-byte-pipes.js @@ -1,17 +1,17 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); if (!common.hasCrypto) { common.skip('missing crypto'); return; } -var crypto = require('crypto'); +const crypto = require('crypto'); -var stream = require('stream'); -var Stream = stream.Stream; -var util = require('util'); -var zlib = require('zlib'); +const stream = require('stream'); +const Stream = stream.Stream; +const util = require('util'); +const zlib = require('zlib'); // emit random bytes, and keep a shasum @@ -73,12 +73,12 @@ RandomReadStream.prototype._process = function() { // figure out how many bytes to output // if finished, then just emit end. var block = this._opt.block; - var jitter = this._opt.jitter; + const jitter = this._opt.jitter; if (jitter) { block += Math.ceil(Math.random() * jitter - (jitter / 2)); } block = Math.min(block, this._remaining); - var buf = Buffer.allocUnsafe(block); + const buf = Buffer.allocUnsafe(block); for (var i = 0; i < block; i++) { buf[i] = Math.random() * 256; } diff --git a/test/parallel/test-zlib-write-after-close.js b/test/parallel/test-zlib-write-after-close.js index b346d2069a5e96..0c54270ec29b13 100644 --- a/test/parallel/test-zlib-write-after-close.js +++ b/test/parallel/test-zlib-write-after-close.js @@ -1,10 +1,10 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); +const assert = require('assert'); +const zlib = require('zlib'); zlib.gzip('hello', common.mustCall(function(err, out) { - var unzip = zlib.createGunzip(); + const unzip = zlib.createGunzip(); unzip.close(common.mustCall(function() {})); assert.throws(function() { unzip.write(out); diff --git a/test/parallel/test-zlib-write-after-flush.js b/test/parallel/test-zlib-write-after-flush.js index fa70c5f14dee6c..9409558a3dee69 100644 --- a/test/parallel/test-zlib-write-after-flush.js +++ b/test/parallel/test-zlib-write-after-flush.js @@ -1,15 +1,15 @@ 'use strict'; require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); +const assert = require('assert'); +const zlib = require('zlib'); -var gzip = zlib.createGzip(); -var gunz = zlib.createUnzip(); +const gzip = zlib.createGzip(); +const gunz = zlib.createUnzip(); gzip.pipe(gunz); var output = ''; -var input = 'A line of data\n'; +const input = 'A line of data\n'; gunz.setEncoding('utf8'); gunz.on('data', function(c) { output += c; diff --git a/test/parallel/test-zlib-zero-byte.js b/test/parallel/test-zlib-zero-byte.js index 97586040541046..ca58d06ff272ba 100644 --- a/test/parallel/test-zlib-zero-byte.js +++ b/test/parallel/test-zlib-zero-byte.js @@ -1,10 +1,10 @@ 'use strict'; const common = require('../common'); -var assert = require('assert'); +const assert = require('assert'); -var zlib = require('zlib'); -var gz = zlib.Gzip(); -var emptyBuffer = Buffer.alloc(0); +const zlib = require('zlib'); +const gz = zlib.Gzip(); +const emptyBuffer = Buffer.alloc(0); var received = 0; gz.on('data', function(c) { received += c.length; diff --git a/test/parallel/test-zlib.js b/test/parallel/test-zlib.js index cd2503b86859d0..044b71db1bddd0 100644 --- a/test/parallel/test-zlib.js +++ b/test/parallel/test-zlib.js @@ -1,8 +1,8 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var zlib = require('zlib'); -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const zlib = require('zlib'); +const path = require('path'); var zlibPairs = [[zlib.Deflate, zlib.Inflate], From 6fb8ebd98c06eba6882180ac390cdfdb67a2d241 Mon Sep 17 00:00:00 2001 From: Rachel Date: Sat, 17 Sep 2016 10:28:45 +0100 Subject: [PATCH 051/216] test: cleanup cluster-disconnect-unshared-tcp test Replaced var with const PR-URL: https://github.com/nodejs/node/pull/8598 Reviewed-By: Colin Ihrig Reviewed-By: Ilkka Myller Reviewed-By: Luigi Pinca --- test/parallel/test-cluster-disconnect-unshared-tcp.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-cluster-disconnect-unshared-tcp.js b/test/parallel/test-cluster-disconnect-unshared-tcp.js index e05cbf42cf1798..dc05d70c81f80e 100644 --- a/test/parallel/test-cluster-disconnect-unshared-tcp.js +++ b/test/parallel/test-cluster-disconnect-unshared-tcp.js @@ -2,11 +2,11 @@ require('../common'); process.env.NODE_CLUSTER_SCHED_POLICY = 'none'; -var cluster = require('cluster'); -var net = require('net'); +const cluster = require('cluster'); +const net = require('net'); if (cluster.isMaster) { - var unbound = cluster.fork().on('online', bind); + const unbound = cluster.fork().on('online', bind); function bind() { cluster.fork({BOUND: 'y'}).on('listening', disconnect); @@ -18,7 +18,7 @@ if (cluster.isMaster) { } } else { if (process.env.BOUND === 'y') { - var source = net.createServer(); + const source = net.createServer(); source.listen(0); } From d72a7b3d0cc9d52a0be6a11fe7d73c5c77dfe6f9 Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Tue, 13 Sep 2016 12:06:10 -0700 Subject: [PATCH 052/216] path: fix path.relative UNC path result When the result of a path.relative() is an absolute UNC path, it should include the leading backslashes. Fixes: https://github.com/nodejs/node/issues/8444 PR-URL: https://github.com/nodejs/node/pull/8523 Reviewed-By: Brian White Reviewed-By: James M Snell Reviewed-By: Bartosz Sosnowski --- lib/path.js | 6 +----- test/parallel/test-path.js | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/path.js b/lib/path.js index 5637b328c1da98..f2fb19edd9ecb1 100644 --- a/lib/path.js +++ b/lib/path.js @@ -619,12 +619,8 @@ const win32 = { // We found a mismatch before the first common path separator was seen, so // return the original `to`. - // TODO: do this just for device roots (and not UNC paths)? if (i !== length && lastCommonSep === -1) { - if (toStart > 0) - return toOrig.slice(toStart); - else - return toOrig; + return toOrig; } var out = ''; diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 5aa60eb7c66b0d..cc6b302df436b4 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -492,7 +492,9 @@ const relativeTests = [ ['C:\\baz-quux', 'C:\\baz', '..\\baz'], ['C:\\baz', 'C:\\baz-quux', '..\\baz-quux'], ['\\\\foo\\baz-quux', '\\\\foo\\baz', '..\\baz'], - ['\\\\foo\\baz', '\\\\foo\\baz-quux', '..\\baz-quux'] + ['\\\\foo\\baz', '\\\\foo\\baz-quux', '..\\baz-quux'], + ['C:\\baz', '\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz'], + ['\\\\foo\\bar\\baz', 'C:\\baz', 'C:\\baz'] ] ], [ path.posix.relative, From 52f0f64e790cec4f510cc27f329fd4df9b9575ed Mon Sep 17 00:00:00 2001 From: Paul Kiddie Date: Sat, 17 Sep 2016 10:45:00 +0100 Subject: [PATCH 053/216] src: use MaybeStackBuffer on DoSend/Writev instead of creating own buffer, use MaybeStackBuffer on DoSend to take advantage of its destructor to free up memory, so buffer never leaks memory - even if code in DoSend throws. Use MaybeStackBuffer in Writev to take advantage of destructor on MaybeStackBuffer to clear itself up, rather than Writev managing resources itself. PR-URL: https://github.com/nodejs/node/pull/8626 Reviewed-By: Anna Henningsen --- src/stream_base.cc | 12 ++---------- src/udp_wrap.cc | 14 ++------------ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/stream_base.cc b/src/stream_base.cc index 585b84885c77ea..a12a1efc73be11 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -102,8 +102,7 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { size_t count = chunks->Length() >> 1; - uv_buf_t bufs_[16]; - uv_buf_t* bufs = bufs_; + MaybeStackBuffer bufs(count); // Determine storage size first size_t storage_size = 0; @@ -132,9 +131,6 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { if (storage_size > INT_MAX) return UV_ENOBUFS; - if (arraysize(bufs_) < count) - bufs = new uv_buf_t[count]; - WriteWrap* req_wrap = WriteWrap::New(env, req_wrap_obj, this, @@ -174,11 +170,7 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { bytes += str_size; } - int err = DoWrite(req_wrap, bufs, count, nullptr); - - // Deallocate space - if (bufs != bufs_) - delete[] bufs; + int err = DoWrite(req_wrap, *bufs, count, nullptr); req_wrap->object()->Set(env->async(), True(env->isolate())); req_wrap->object()->Set(env->bytes_string(), diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index f191b3a75540c9..7fba279fca6a2f 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -275,13 +275,7 @@ void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { SendWrap* req_wrap = new SendWrap(env, req_wrap_obj, have_callback); size_t msg_size = 0; - // allocate uv_buf_t of the correct size - // if bigger than 16 elements - uv_buf_t bufs_[16]; - uv_buf_t* bufs = bufs_; - - if (arraysize(bufs_) < count) - bufs = new uv_buf_t[count]; + MaybeStackBuffer bufs(count); // construct uv_buf_t array for (size_t i = 0; i < count; i++) { @@ -313,16 +307,12 @@ void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { if (err == 0) { err = uv_udp_send(&req_wrap->req_, &wrap->handle_, - bufs, + *bufs, count, reinterpret_cast(&addr), OnSend); } - // Deallocate space - if (bufs != bufs_) - delete[] bufs; - req_wrap->Dispatched(); if (err) delete req_wrap; From 38be15549ead6a54f6facfdc5a5d60458e287d08 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Thu, 8 Sep 2016 13:52:32 -0700 Subject: [PATCH 054/216] util: don't init Debug if it's not needed yet Because any call to util.inspect() with an object results in inspectPromise() being called, Debug was being initialized even when it's not needed. Instead, the initialization is placed after the isPromise check. PR-URL: https://github.com/nodejs/node/pull/8452 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Evan Lucas --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index 2d7ba651639c20..caab2651f3532d 100644 --- a/lib/util.js +++ b/lib/util.js @@ -289,10 +289,10 @@ function ensureDebugIsInitialized() { function inspectPromise(p) { - ensureDebugIsInitialized(); // Only create a mirror if the object is a Promise. if (!binding.isPromise(p)) return null; + ensureDebugIsInitialized(); const mirror = Debug.MakeMirror(p, true); return {status: mirror.status(), value: mirror.promiseValue().value_}; } From 4492cc3e25c5520cfd8c4414e12e14529fc003dc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 17 Sep 2016 20:23:27 -0700 Subject: [PATCH 055/216] test,lib: align arguments in multiline calls An upcoming custom lint rule will provide slightly more strict enforcement of argument alignment for multiline function calls. Adjust existing code to conform. PR-URL: https://github.com/nodejs/node/pull/8642 Reviewed-By: Teddy Katz Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ilkka Myller Reviewed-By: Franziska Hinkelmann --- lib/repl.js | 2 +- test/parallel/test-assert.js | 10 +- test/parallel/test-buffer-alloc.js | 5 +- test/parallel/test-buffer-bytelength.js | 5 +- test/parallel/test-buffer-inheritance.js | 2 +- .../parallel/test-debugger-util-regression.js | 2 +- ...n-throw-from-uncaught-exception-handler.js | 6 +- ...domain-with-abort-on-uncaught-exception.js | 2 +- test/parallel/test-fs-write.js | 36 ++--- .../parallel/test-http-invalidheaderfield2.js | 8 +- .../test-timers-throw-when-cb-not-function.js | 36 ++--- test/parallel/test-util-inspect.js | 130 +++++++++--------- test/parallel/test-vm-symbols.js | 4 +- .../test-zlib-from-concatenated-gzip.js | 21 +-- .../test-zlib-unzip-one-byte-chunks.js | 2 +- 15 files changed, 139 insertions(+), 132 deletions(-) diff --git a/lib/repl.js b/lib/repl.js index 836f3d16215cb1..ce1fd0ffbcec1a 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -696,7 +696,7 @@ REPLServer.prototype.createContext = function() { return GLOBAL_OBJECT_PROPERTY_MAP[name] === undefined; }).forEach((name) => { Object.defineProperty(context, name, - Object.getOwnPropertyDescriptor(global, name)); + Object.getOwnPropertyDescriptor(global, name)); }); } diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 9767ecfe878c19..3564c3b5ec25c5 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -28,7 +28,7 @@ assert.doesNotThrow(makeBlock(a.ok, true), assert.doesNotThrow(makeBlock(a.ok, 'test'), 'ok(\'test\')'); assert.throws(makeBlock(a.equal, true, false), - a.AssertionError, 'equal(true, false)'); + a.AssertionError, 'equal(true, false)'); assert.doesNotThrow(makeBlock(a.equal, null, null), 'equal(null, null)'); @@ -71,10 +71,8 @@ assert.throws(makeBlock(a.deepEqual, new Date(), new Date(2000, 3, 14)), a.AssertionError, 'deepEqual(new Date(), new Date(2000, 3, 14))'); -assert.throws(makeBlock( - a.notDeepEqual, - new Date(2000, 3, 14), - new Date(2000, 3, 14)), +assert.throws( + makeBlock(a.notDeepEqual, new Date(2000, 3, 14), new Date(2000, 3, 14)), a.AssertionError, 'notDeepEqual(new Date(2000, 3, 14), new Date(2000, 3, 14))' ); @@ -465,7 +463,7 @@ function testAssertionMessage(actual, expected) { assert.equal(actual, ''); } catch (e) { assert.equal(e.toString(), - ['AssertionError:', expected, '==', '\'\''].join(' ')); + ['AssertionError:', expected, '==', '\'\''].join(' ')); assert.ok(e.generatedMessage, 'Message not marked as generated'); } } diff --git a/test/parallel/test-buffer-alloc.js b/test/parallel/test-buffer-alloc.js index dabee43321bcb9..389cde017b0dff 100644 --- a/test/parallel/test-buffer-alloc.js +++ b/test/parallel/test-buffer-alloc.js @@ -243,8 +243,9 @@ assert.doesNotThrow(() => Buffer.alloc(1).write('', 1, 0)); { // Length should be 12 const f = Buffer.from('привет', encoding); - assert.deepStrictEqual(f, - Buffer.from([63, 4, 64, 4, 56, 4, 50, 4, 53, 4, 66, 4])); + assert.deepStrictEqual( + f, Buffer.from([63, 4, 64, 4, 56, 4, 50, 4, 53, 4, 66, 4]) + ); assert.strictEqual(f.toString(encoding), 'привет'); } diff --git a/test/parallel/test-buffer-bytelength.js b/test/parallel/test-buffer-bytelength.js index 14d7c95dd231aa..c88eb352842e5f 100644 --- a/test/parallel/test-buffer-bytelength.js +++ b/test/parallel/test-buffer-bytelength.js @@ -74,8 +74,9 @@ assert.strictEqual(Buffer.byteLength('ßœ∑≈', 'unkn0wn enc0ding'), 10); assert.strictEqual(Buffer.byteLength('aGVsbG8gd29ybGQ=', 'base64'), 11); assert.strictEqual(Buffer.byteLength('bm9kZS5qcyByb2NrcyE=', 'base64'), 14); assert.strictEqual(Buffer.byteLength('aGkk', 'base64'), 3); -assert.strictEqual(Buffer.byteLength('bHNrZGZsa3NqZmtsc2xrZmFqc2RsZmtqcw==', - 'base64'), 25); +assert.strictEqual( + Buffer.byteLength('bHNrZGZsa3NqZmtsc2xrZmFqc2RsZmtqcw==', 'base64'), 25 +); // special padding assert.strictEqual(Buffer.byteLength('aaa=', 'base64'), 2); assert.strictEqual(Buffer.byteLength('aaaa==', 'base64'), 3); diff --git a/test/parallel/test-buffer-inheritance.js b/test/parallel/test-buffer-inheritance.js index 7849caab911ec8..0798fe4a177c14 100644 --- a/test/parallel/test-buffer-inheritance.js +++ b/test/parallel/test-buffer-inheritance.js @@ -26,7 +26,7 @@ vals.forEach(function(t) { assert.strictEqual(t.constructor, T); assert.strictEqual(Object.getPrototypeOf(t), T.prototype); assert.strictEqual(Object.getPrototypeOf(Object.getPrototypeOf(t)), - Buffer.prototype); + Buffer.prototype); t.fill(5); let cntr = 0; diff --git a/test/parallel/test-debugger-util-regression.js b/test/parallel/test-debugger-util-regression.js index 069fb061c9ac0c..6425312b426f7d 100644 --- a/test/parallel/test-debugger-util-regression.js +++ b/test/parallel/test-debugger-util-regression.js @@ -62,6 +62,6 @@ proc.stdin.on('error', (err) => { process.on('exit', (code) => { assert.equal(code, 0, 'the program should exit cleanly'); assert.equal(stdout.includes('{ a: \'b\' }'), true, - 'the debugger should print the result of util.inspect'); + 'the debugger should print the result of util.inspect'); assert.equal(stderr, '', 'stderr should be empty'); }); diff --git a/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js b/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js index b490a30b52d39f..fc6a93ccdca8ef 100644 --- a/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js +++ b/test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js @@ -56,8 +56,8 @@ function runTestWithoutAbortOnUncaughtException() { // message must include only the message of the error thrown from the // process' uncaughtException handler. assert(stderr.includes(uncaughtExceptionHandlerErrMsg), - 'stderr output must include proper uncaughtException handler\'s ' + - 'error\'s message'); + 'stderr output must include proper uncaughtException ' + + 'handler\'s error\'s message'); assert(!stderr.includes(domainErrMsg), 'stderr output must not ' + 'include domain\'s error\'s message'); @@ -75,7 +75,7 @@ function runTestWithAbortOnUncaughtException() { 'child process should not have run its uncaughtException ' + 'event handler'); assert(common.nodeProcessAborted(err.code, err.signal), - 'process should have aborted, but did not'); + 'process should have aborted, but did not'); }); } diff --git a/test/parallel/test-domain-with-abort-on-uncaught-exception.js b/test/parallel/test-domain-with-abort-on-uncaught-exception.js index 455acc7804b230..eae1d28e846ce2 100644 --- a/test/parallel/test-domain-with-abort-on-uncaught-exception.js +++ b/test/parallel/test-domain-with-abort-on-uncaught-exception.js @@ -121,7 +121,7 @@ if (process.argv[2] === 'child') { if (!options.useTryCatch && options.throwInDomainErrHandler) { if (cmdLineOption === '--abort_on_uncaught_exception') { assert(common.nodeProcessAborted(exitCode, signal), - 'process should have aborted, but did not'); + 'process should have aborted, but did not'); } else { // By default, uncaught exceptions make node exit with an exit // code of 7. diff --git a/test/parallel/test-fs-write.js b/test/parallel/test-fs-write.js index d69f81d848891d..766cb0b2cea1d2 100644 --- a/test/parallel/test-fs-write.js +++ b/test/parallel/test-fs-write.js @@ -32,21 +32,21 @@ fs.open(fn, 'w', 0o644, common.mustCall(function(err, fd) { fs.open(fn2, constants.O_CREAT | constants.O_WRONLY | constants.O_TRUNC, 0o644, - common.mustCall(function(err, fd) { - if (err) throw err; - console.log('open done'); - fs.write(fd, '', 0, 'utf8', function(err, written) { - assert.equal(0, written); - }); - fs.write(fd, expected, 0, 'utf8', common.mustCall(function(err, written) { - console.log('write done'); - if (err) throw err; - assert.equal(Buffer.byteLength(expected), written); - fs.closeSync(fd); - const found = fs.readFileSync(fn2, 'utf8'); - console.log('expected: "%s"', expected); - console.log('found: "%s"', found); - fs.unlinkSync(fn2); - assert.strictEqual(expected, found); - })); - })); + common.mustCall((err, fd) => { + if (err) throw err; + console.log('open done'); + fs.write(fd, '', 0, 'utf8', (err, written) => { + assert.equal(0, written); + }); + fs.write(fd, expected, 0, 'utf8', common.mustCall((err, written) => { + console.log('write done'); + if (err) throw err; + assert.equal(Buffer.byteLength(expected), written); + fs.closeSync(fd); + const found = fs.readFileSync(fn2, 'utf8'); + console.log('expected: "%s"', expected); + console.log('found: "%s"', found); + fs.unlinkSync(fn2); + assert.strictEqual(expected, found); + })); + })); diff --git a/test/parallel/test-http-invalidheaderfield2.js b/test/parallel/test-http-invalidheaderfield2.js index 727c600d5d79a3..e7e8013c37c170 100644 --- a/test/parallel/test-http-invalidheaderfield2.js +++ b/test/parallel/test-http-invalidheaderfield2.js @@ -90,8 +90,8 @@ const checkInvalidHeaderChar = require('_http_common')._checkInvalidHeaderChar; 'Ding!\x07' ].forEach(function(str) { assert.strictEqual(checkInvalidHeaderChar(str), - true, - 'checkInvalidHeaderChar(' + - inspect(str) + - ') unexpectedly succeeded'); + true, + 'checkInvalidHeaderChar(' + + inspect(str) + + ') unexpectedly succeeded'); }); diff --git a/test/parallel/test-timers-throw-when-cb-not-function.js b/test/parallel/test-timers-throw-when-cb-not-function.js index 13533107934bd6..2aff904f06a500 100644 --- a/test/parallel/test-timers-throw-when-cb-not-function.js +++ b/test/parallel/test-timers-throw-when-cb-not-function.js @@ -9,17 +9,17 @@ function doSetTimeout(callback, after) { } assert.throws(doSetTimeout('foo'), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetTimeout({foo: 'bar'}), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetTimeout(), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetTimeout(undefined, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetTimeout(null, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetTimeout(false, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); function doSetInterval(callback, after) { @@ -29,17 +29,17 @@ function doSetInterval(callback, after) { } assert.throws(doSetInterval('foo'), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetInterval({foo: 'bar'}), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetInterval(), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetInterval(undefined, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetInterval(null, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetInterval(false, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); function doSetImmediate(callback, after) { @@ -49,14 +49,14 @@ function doSetImmediate(callback, after) { } assert.throws(doSetImmediate('foo'), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetImmediate({foo: 'bar'}), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetImmediate(), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetImmediate(undefined, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetImmediate(null, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); assert.throws(doSetImmediate(false, 0), - /"callback" argument must be a function/); + /"callback" argument must be a function/); diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js index b2d23d32557a6d..f730ec1c98303e 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -12,8 +12,10 @@ assert.strictEqual(util.inspect(function() {}), '[Function]'); assert.strictEqual(util.inspect(undefined), 'undefined'); assert.strictEqual(util.inspect(null), 'null'); assert.strictEqual(util.inspect(/foo(bar\n)?/gi), '/foo(bar\\n)?/gi'); -assert.strictEqual(util.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT')), - new Date('2010-02-14T12:48:40+01:00').toISOString()); +assert.strictEqual( + util.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT')), + new Date('2010-02-14T12:48:40+01:00').toISOString() +); assert.strictEqual(util.inspect(new Date('')), (new Date('')).toString()); assert.strictEqual(util.inspect('\n\u0001'), "'\\n\\u0001'"); @@ -30,14 +32,14 @@ assert.strictEqual(util.inspect({a: 1, b: 2}), '{ a: 1, b: 2 }'); assert.strictEqual(util.inspect({'a': {}}), '{ a: {} }'); assert.strictEqual(util.inspect({'a': {'b': 2}}), '{ a: { b: 2 } }'); assert.strictEqual(util.inspect({'a': {'b': { 'c': { 'd': 2 }}}}), - '{ a: { b: { c: [Object] } } }'); + '{ a: { b: { c: [Object] } } }'); assert.strictEqual(util.inspect({'a': {'b': { 'c': { 'd': 2 }}}}, false, null), - '{ a: { b: { c: { d: 2 } } } }'); + '{ a: { b: { c: { d: 2 } } } }'); assert.strictEqual(util.inspect([1, 2, 3], true), '[ 1, 2, 3, [length]: 3 ]'); assert.strictEqual(util.inspect({'a': {'b': { 'c': 2}}}, false, 0), - '{ a: [Object] }'); + '{ a: [Object] }'); assert.strictEqual(util.inspect({'a': {'b': { 'c': 2}}}, false, 1), - '{ a: { b: [Object] } }'); + '{ a: { b: [Object] } }'); assert.strictEqual(util.inspect(Object.create({}, {visible: {value: 1, enumerable: true}, hidden: {value: 2}})), '{ visible: 1 }' @@ -64,29 +66,29 @@ for (const showHidden of [true, false]) { 'ArrayBuffer { byteLength: 4 }' ); assert.strictEqual(util.inspect(new DataView(ab, 1, 2), showHidden), - 'DataView {\n' + - ' byteLength: 2,\n' + - ' byteOffset: 1,\n' + - ' buffer: ArrayBuffer { byteLength: 4 } }'); + 'DataView {\n' + + ' byteLength: 2,\n' + + ' byteOffset: 1,\n' + + ' buffer: ArrayBuffer { byteLength: 4 } }'); assert.strictEqual( util.inspect(ab, showHidden), 'ArrayBuffer { byteLength: 4 }' ); assert.strictEqual(util.inspect(dv, showHidden), - 'DataView {\n' + - ' byteLength: 2,\n' + - ' byteOffset: 1,\n' + - ' buffer: ArrayBuffer { byteLength: 4 } }'); + 'DataView {\n' + + ' byteLength: 2,\n' + + ' byteOffset: 1,\n' + + ' buffer: ArrayBuffer { byteLength: 4 } }'); ab.x = 42; dv.y = 1337; assert.strictEqual(util.inspect(ab, showHidden), - 'ArrayBuffer { byteLength: 4, x: 42 }'); + 'ArrayBuffer { byteLength: 4, x: 42 }'); assert.strictEqual(util.inspect(dv, showHidden), - 'DataView {\n' + - ' byteLength: 2,\n' + - ' byteOffset: 1,\n' + - ' buffer: ArrayBuffer { byteLength: 4, x: 42 },\n' + - ' y: 1337 }'); + 'DataView {\n' + + ' byteLength: 2,\n' + + ' byteOffset: 1,\n' + + ' buffer: ArrayBuffer { byteLength: 4, x: 42 },\n' + + ' y: 1337 }'); } // Now do the same checks but from a different context @@ -98,29 +100,29 @@ for (const showHidden of [true, false]) { 'ArrayBuffer { byteLength: 4 }' ); assert.strictEqual(util.inspect(new DataView(ab, 1, 2), showHidden), - 'DataView {\n' + - ' byteLength: 2,\n' + - ' byteOffset: 1,\n' + - ' buffer: ArrayBuffer { byteLength: 4 } }'); + 'DataView {\n' + + ' byteLength: 2,\n' + + ' byteOffset: 1,\n' + + ' buffer: ArrayBuffer { byteLength: 4 } }'); assert.strictEqual( util.inspect(ab, showHidden), 'ArrayBuffer { byteLength: 4 }' ); assert.strictEqual(util.inspect(dv, showHidden), - 'DataView {\n' + - ' byteLength: 2,\n' + - ' byteOffset: 1,\n' + - ' buffer: ArrayBuffer { byteLength: 4 } }'); + 'DataView {\n' + + ' byteLength: 2,\n' + + ' byteOffset: 1,\n' + + ' buffer: ArrayBuffer { byteLength: 4 } }'); ab.x = 42; dv.y = 1337; assert.strictEqual(util.inspect(ab, showHidden), - 'ArrayBuffer { byteLength: 4, x: 42 }'); + 'ArrayBuffer { byteLength: 4, x: 42 }'); assert.strictEqual(util.inspect(dv, showHidden), - 'DataView {\n' + - ' byteLength: 2,\n' + - ' byteOffset: 1,\n' + - ' buffer: ArrayBuffer { byteLength: 4, x: 42 },\n' + - ' y: 1337 }'); + 'DataView {\n' + + ' byteLength: 2,\n' + + ' byteOffset: 1,\n' + + ' buffer: ArrayBuffer { byteLength: 4, x: 42 },\n' + + ' y: 1337 }'); } @@ -138,15 +140,16 @@ for (const showHidden of [true, false]) { const array = new constructor(new ArrayBuffer(byteLength), 0, length); array[0] = 65; array[1] = 97; - assert.strictEqual(util.inspect(array, true), - `${constructor.name} [\n` + - ` 65,\n` + - ` 97,\n` + - ` [BYTES_PER_ELEMENT]: ${constructor.BYTES_PER_ELEMENT},\n` + - ` [length]: ${length},\n` + - ` [byteLength]: ${byteLength},\n` + - ` [byteOffset]: 0,\n` + - ` [buffer]: ArrayBuffer { byteLength: ${byteLength} } ]`); + assert.strictEqual( + util.inspect(array, true), + `${constructor.name} [\n` + + ` 65,\n` + + ` 97,\n` + + ` [BYTES_PER_ELEMENT]: ${constructor.BYTES_PER_ELEMENT},\n` + + ` [length]: ${length},\n` + + ` [byteLength]: ${byteLength},\n` + + ` [byteOffset]: 0,\n` + + ` [buffer]: ArrayBuffer { byteLength: ${byteLength} } ]`); assert.strictEqual( util.inspect(array, false), `${constructor.name} [ 65, 97 ]` @@ -173,15 +176,16 @@ for (const showHidden of [true, false]) { }); array[0] = 65; array[1] = 97; - assert.strictEqual(util.inspect(array, true), - `${constructor.name} [\n` + - ` 65,\n` + - ` 97,\n` + - ` [BYTES_PER_ELEMENT]: ${constructor.BYTES_PER_ELEMENT},\n` + - ` [length]: ${length},\n` + - ` [byteLength]: ${byteLength},\n` + - ` [byteOffset]: 0,\n` + - ` [buffer]: ArrayBuffer { byteLength: ${byteLength} } ]`); + assert.strictEqual( + util.inspect(array, true), + `${constructor.name} [\n` + + ` 65,\n` + + ` 97,\n` + + ` [BYTES_PER_ELEMENT]: ${constructor.BYTES_PER_ELEMENT},\n` + + ` [length]: ${length},\n` + + ` [byteLength]: ${byteLength},\n` + + ` [byteOffset]: 0,\n` + + ` [buffer]: ArrayBuffer { byteLength: ${byteLength} } ]`); assert.strictEqual( util.inspect(array, false), `${constructor.name} [ 65, 97 ]` @@ -222,13 +226,13 @@ assert.strictEqual( // Dynamic properties assert.strictEqual(util.inspect({get readonly() {}}), - '{ readonly: [Getter] }'); + '{ readonly: [Getter] }'); assert.strictEqual(util.inspect({get readwrite() {}, set readwrite(val) {}}), - '{ readwrite: [Getter/Setter] }'); + '{ readwrite: [Getter/Setter] }'); assert.strictEqual(util.inspect({set writeonly(val) {}}), - '{ writeonly: [Setter] }'); + '{ writeonly: [Setter] }'); var value = {}; value['a'] = value; @@ -666,7 +670,7 @@ if (typeof Symbol !== 'undefined') { assert.strictEqual(util.inspect(subject), '[ 1, 2, 3 ]'); assert.strictEqual(util.inspect(subject, options), - '[ 1, 2, 3, [length]: 3, [Symbol(symbol)]: 42 ]'); + '[ 1, 2, 3, [length]: 3, [Symbol(symbol)]: 42 ]'); } // test Set @@ -683,11 +687,11 @@ assert.strictEqual( { assert.strictEqual(util.inspect(new Map()), 'Map {}'); assert.strictEqual(util.inspect(new Map([[1, 'a'], [2, 'b'], [3, 'c']])), - 'Map { 1 => \'a\', 2 => \'b\', 3 => \'c\' }'); + 'Map { 1 => \'a\', 2 => \'b\', 3 => \'c\' }'); const map = new Map([['foo', null]]); map.bar = 42; assert.strictEqual(util.inspect(map, true), - 'Map { \'foo\' => null, [size]: 1, bar: 42 }'); + 'Map { \'foo\' => null, [size]: 1, bar: 42 }'); } // test Promise @@ -774,15 +778,15 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; }))); const x = new ObjectSubclass(); x.foo = 42; assert.strictEqual(util.inspect(x), - 'ObjectSubclass { foo: 42 }'); + 'ObjectSubclass { foo: 42 }'); assert.strictEqual(util.inspect(new ArraySubclass(1, 2, 3)), - 'ArraySubclass [ 1, 2, 3 ]'); + 'ArraySubclass [ 1, 2, 3 ]'); assert.strictEqual(util.inspect(new SetSubclass([1, 2, 3])), - 'SetSubclass { 1, 2, 3 }'); + 'SetSubclass { 1, 2, 3 }'); assert.strictEqual(util.inspect(new MapSubclass([['foo', 42]])), - 'MapSubclass { \'foo\' => 42 }'); + 'MapSubclass { \'foo\' => 42 }'); assert.strictEqual(util.inspect(new PromiseSubclass(function() {})), - 'PromiseSubclass { }'); + 'PromiseSubclass { }'); } // Corner cases. diff --git a/test/parallel/test-vm-symbols.js b/test/parallel/test-vm-symbols.js index d3419af559a2f2..f80609c0101d51 100644 --- a/test/parallel/test-vm-symbols.js +++ b/test/parallel/test-vm-symbols.js @@ -19,7 +19,7 @@ var context = new Document(); vm.createContext(context); assert.equal(context.getSymbolValue(), 'foo', - 'should return symbol-keyed value from the outside'); + 'should return symbol-keyed value from the outside'); assert.equal(vm.runInContext('this.getSymbolValue()', context), 'foo', - 'should return symbol-keyed value from the inside'); + 'should return symbol-keyed value from the inside'); diff --git a/test/parallel/test-zlib-from-concatenated-gzip.js b/test/parallel/test-zlib-from-concatenated-gzip.js index b5007820c8d0d7..998a086eb76514 100644 --- a/test/parallel/test-zlib-from-concatenated-gzip.js +++ b/test/parallel/test-zlib-from-concatenated-gzip.js @@ -53,7 +53,7 @@ fs.createReadStream(pmmFileGz) .on('data', (data) => pmmResultBuffers.push(data)) .on('finish', common.mustCall(() => { assert.deepStrictEqual(Buffer.concat(pmmResultBuffers), pmmExpected, - 'result should match original random garbage'); + 'result should match original random garbage'); })); // test that the next gzip member can wrap around the input buffer boundary @@ -61,14 +61,17 @@ fs.createReadStream(pmmFileGz) const resultBuffers = []; const unzip = zlib.createGunzip() - .on('error', (err) => { - assert.ifError(err); - }) - .on('data', (data) => resultBuffers.push(data)) - .on('finish', common.mustCall(() => { - assert.strictEqual(Buffer.concat(resultBuffers).toString(), 'abcdef', - `result should match original input (offset = ${offset})`); - })); + .on('error', (err) => { + assert.ifError(err); + }) + .on('data', (data) => resultBuffers.push(data)) + .on('finish', common.mustCall(() => { + assert.strictEqual( + Buffer.concat(resultBuffers).toString(), + 'abcdef', + `result should match original input (offset = ${offset})` + ); + })); // first write: write "abc" + the first bytes of "def" unzip.write(Buffer.concat([ diff --git a/test/parallel/test-zlib-unzip-one-byte-chunks.js b/test/parallel/test-zlib-unzip-one-byte-chunks.js index f1b1c0f5084be9..50a383af18329d 100644 --- a/test/parallel/test-zlib-unzip-one-byte-chunks.js +++ b/test/parallel/test-zlib-unzip-one-byte-chunks.js @@ -17,7 +17,7 @@ const unzip = zlib.createUnzip() .on('data', (data) => resultBuffers.push(data)) .on('finish', common.mustCall(() => { assert.deepStrictEqual(Buffer.concat(resultBuffers).toString(), 'abcdef', - 'result should match original string'); + 'result should match original string'); })); for (let i = 0; i < data.length; i++) { From ac6927f549819459a2c54e5c861edbf917129952 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 17 Sep 2016 20:24:47 -0700 Subject: [PATCH 056/216] tools: make argument alignment linting more strict A few nits in recent PR comments suggest that we can have slightly more strict linting for argument alignment in multiline function calls. This enables the existing linting requirements to apply when one or more of the arguments themselves are function calls. Previously, that situation had been excluded from linting. Refs: https://github.com/nodejs/node/pull/8628#issuecomment-247797311 PR-URL: https://github.com/nodejs/node/pull/8642 Reviewed-By: Teddy Katz Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Ilkka Myller Reviewed-By: Franziska Hinkelmann --- .../eslint-rules/align-function-arguments.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools/eslint-rules/align-function-arguments.js b/tools/eslint-rules/align-function-arguments.js index 55ce5a4fdbb7c9..015552489a9d44 100644 --- a/tools/eslint-rules/align-function-arguments.js +++ b/tools/eslint-rules/align-function-arguments.js @@ -30,7 +30,6 @@ function checkArgumentAlignment(context, node) { const ignoreTypes = [ 'ArrowFunctionExpression', - 'CallExpression', 'FunctionExpression', 'ObjectExpression', ]; @@ -48,18 +47,26 @@ function checkArgumentAlignment(context, node) { return; } + var misaligned; + args.slice(1).forEach((argument) => { - if (argument.loc.start.line === currentLine + 1) { - if (argument.loc.start.column !== firstColumn) { - msg = 'Function called with argument in column ' + - `${argument.loc.start.column}, expected in ${firstColumn}`; + if (!misaligned) { + if (argument.loc.start.line === currentLine + 1) { + if (argument.loc.start.column !== firstColumn) { + if (isNodeFirstInLine(argument)) { + msg = 'Function argument in column ' + + `${argument.loc.start.column + 1}, ` + + `expected in ${firstColumn + 1}`; + misaligned = argument; + } + } } } currentLine = argument.loc.start.line; }); if (msg) - context.report(node, msg); + context.report(misaligned, msg); } module.exports = function(context) { From 34f24e559d461fc3fbf1274924e5d5599f2490b9 Mon Sep 17 00:00:00 2001 From: scott stern Date: Sat, 17 Sep 2016 14:59:25 -0700 Subject: [PATCH 057/216] test: refactor parallel/test-tcp-wrap-listen PR-URL: https://github.com/nodejs/node/pull/8640 Reviewed-By: Anna Henningsen Reviewed-By: Ilkka Myller Reviewed-By: Rich Trott Reviewed-By: James M Snell --- test/parallel/test-tcp-wrap-listen.js | 77 +++++++++++++-------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/test/parallel/test-tcp-wrap-listen.js b/test/parallel/test-tcp-wrap-listen.js index 15f3c7f717ce98..7200dac59f990e 100644 --- a/test/parallel/test-tcp-wrap-listen.js +++ b/test/parallel/test-tcp-wrap-listen.js @@ -1,53 +1,53 @@ 'use strict'; -require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var TCP = process.binding('tcp_wrap').TCP; -var WriteWrap = process.binding('stream_wrap').WriteWrap; +const TCP = process.binding('tcp_wrap').TCP; +const WriteWrap = process.binding('stream_wrap').WriteWrap; -var server = new TCP(); +const server = new TCP(); -var r = server.bind('0.0.0.0', 0); -assert.equal(0, r); -var port = {}; +const r = server.bind('0.0.0.0', 0); +assert.strictEqual(0, r); +let port = {}; server.getsockname(port); port = port.port; server.listen(128); -var sliceCount = 0, eofCount = 0; +let sliceCount = 0, eofCount = 0; -var writeCount = 0; -var recvCount = 0; +let writeCount = 0; +let recvCount = 0; -server.onconnection = function(err, client) { - assert.equal(0, client.writeQueueSize); +server.onconnection = (err, client) => { + assert.strictEqual(0, client.writeQueueSize); console.log('got connection'); - function maybeCloseClient() { - if (client.pendingWrites.length == 0 && client.gotEOF) { + const maybeCloseClient = () => { + if (client.pendingWrites.length === 0 && client.gotEOF) { console.log('close client'); client.close(); } - } + }; client.readStart(); client.pendingWrites = []; - client.onread = function(err, buffer) { + client.onread = (err, buffer) => { if (buffer) { assert.ok(buffer.length > 0); - assert.equal(0, client.writeQueueSize); + assert.strictEqual(0, client.writeQueueSize); - var req = new WriteWrap(); + const req = new WriteWrap(); req.async = false; const returnCode = client.writeBuffer(req, buffer); - assert.equal(returnCode, 0); + assert.strictEqual(returnCode, 0); client.pendingWrites.push(req); console.log('client.writeQueueSize: ' + client.writeQueueSize); // 11 bytes should flush - assert.equal(0, client.writeQueueSize); + assert.strictEqual(0, client.writeQueueSize); if (req.async) req.oncomplete = done; @@ -55,15 +55,15 @@ server.onconnection = function(err, client) { process.nextTick(done.bind(null, 0, client, req)); function done(status, client_, req_) { - assert.equal(req, client.pendingWrites.shift()); + assert.strictEqual(req, client.pendingWrites.shift()); // Check parameters. - assert.equal(0, status); - assert.equal(client, client_); - assert.equal(req, req_); + assert.strictEqual(0, status); + assert.strictEqual(client, client_); + assert.strictEqual(req, req_); console.log('client.writeQueueSize: ' + client.writeQueueSize); - assert.equal(0, client.writeQueueSize); + assert.strictEqual(0, client.writeQueueSize); writeCount++; console.log('write ' + writeCount); @@ -81,26 +81,25 @@ server.onconnection = function(err, client) { }; }; -var net = require('net'); +const net = require('net'); -var c = net.createConnection(port); -c.on('connect', function() { - c.end('hello world'); -}); +const c = net.createConnection(port); + +c.on('connect', common.mustCall(() => { c.end('hello world'); })); c.setEncoding('utf8'); -c.on('data', function(d) { - assert.equal('hello world', d); +c.on('data', (d) => { + assert.strictEqual('hello world', d); recvCount++; }); -c.on('close', function() { +c.on('close', () => { console.error('client closed'); }); -process.on('exit', function() { - assert.equal(1, sliceCount); - assert.equal(1, eofCount); - assert.equal(1, writeCount); - assert.equal(1, recvCount); +process.on('exit', () => { + assert.strictEqual(1, sliceCount); + assert.strictEqual(1, eofCount); + assert.strictEqual(1, writeCount); + assert.strictEqual(1, recvCount); }); From 3ddf77fc249e458c0242550c862f372539defcb4 Mon Sep 17 00:00:00 2001 From: Pavol Otcenas Date: Sat, 17 Sep 2016 12:50:33 +0200 Subject: [PATCH 058/216] test: modernize js and tighten equality checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed var --> const and let. Changed assert.notEqual --> assert.notStrictEqual Fixed comment spelling PR-URL: https://github.com/nodejs/node/pull/8618 Reviewed-By: James M Snell Reviewed-By: Myles Borins Reviewed-By: Michaël Zasso Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- test/parallel/test-child-process-cwd.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/parallel/test-child-process-cwd.js b/test/parallel/test-child-process-cwd.js index acba57939f0afe..8d0a28135ebf70 100644 --- a/test/parallel/test-child-process-cwd.js +++ b/test/parallel/test-child-process-cwd.js @@ -1,19 +1,19 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); +const common = require('../common'); +const assert = require('assert'); -var returns = 0; +let returns = 0; /* Spawns 'pwd' with given options, then test - whether the exit code equals forCode, - optionally whether the stdout result matches forData - (after removing traling whitespace) + (after removing trailing whitespace) */ function testCwd(options, forCode, forData) { - var data = ''; + let data = ''; - var child = common.spawnPwd(options); + const child = common.spawnPwd(options); child.stdout.setEncoding('utf8'); @@ -46,7 +46,7 @@ if (common.isWindows) { // Assume does-not-exist doesn't exist, expect exitCode=-1 and errno=ENOENT { testCwd({cwd: 'does-not-exist'}, -1).on('error', common.mustCall(function(e) { - assert.equal(e.code, 'ENOENT'); + assert.strictEqual(e.code, 'ENOENT'); })); } @@ -58,7 +58,7 @@ testCwd({cwd: undefined}, 0); testCwd({cwd: null}, 0); // Check whether all tests actually returned -assert.notEqual(0, returns); +assert.notStrictEqual(returns, 0); process.on('exit', function() { - assert.equal(0, returns); + assert.strictEqual(returns, 0); }); From 858a7bbacfa2a156c1803ecd6bd1bbbfaac4b6ab Mon Sep 17 00:00:00 2001 From: Adri Van Houdt Date: Sat, 17 Sep 2016 11:07:23 +0200 Subject: [PATCH 059/216] lib: changed var to const in bootstrap_node.js PR-URL: https://github.com/nodejs/node/pull/8588 Reviewed-By: Yosuke Furukawa Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Teddy Katz Reviewed-By: Colin Ihrig Reviewed-By: Jeremiah Senkpiel --- lib/internal/bootstrap_node.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 140816aac08cc1..7a4144f9749a69 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -10,7 +10,7 @@ (function(process) { function startup() { - var EventEmitter = NativeModule.require('events'); + const EventEmitter = NativeModule.require('events'); process._eventsCount = 0; Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, { @@ -104,7 +104,7 @@ // channel. This needs to be done before any user code gets executed // (including preload modules). if (process.argv[1] && process.env.NODE_UNIQUE_ID) { - var cluster = NativeModule.require('cluster'); + const cluster = NativeModule.require('cluster'); cluster._setupWorker(); // Make sure it's not accidentally inherited by child processes. @@ -123,18 +123,18 @@ }); } else if (process.argv[1]) { // make process.argv[1] into a full path - var path = NativeModule.require('path'); + const path = NativeModule.require('path'); process.argv[1] = path.resolve(process.argv[1]); - var Module = NativeModule.require('module'); + const Module = NativeModule.require('module'); // check if user passed `-c` or `--check` arguments to Node. if (process._syntax_check_only != null) { - var vm = NativeModule.require('vm'); - var fs = NativeModule.require('fs'); - var internalModule = NativeModule.require('internal/module'); + const vm = NativeModule.require('vm'); + const fs = NativeModule.require('fs'); + const internalModule = NativeModule.require('internal/module'); // read the source - var filename = Module._resolveFilename(process.argv[1]); + const filename = Module._resolveFilename(process.argv[1]); var source = fs.readFileSync(filename, 'utf-8'); // remove shebang and BOM source = internalModule.stripBOM(source.replace(/^\#\!.*/, '')); @@ -152,7 +152,7 @@ // If -i or --interactive were passed, or stdin is a TTY. if (process._forceRepl || NativeModule.require('tty').isatty(0)) { // REPL - var cliRepl = NativeModule.require('internal/repl'); + const cliRepl = NativeModule.require('internal/repl'); cliRepl.createInternalRepl(process.env, function(err, repl) { if (err) { throw err; @@ -266,7 +266,7 @@ wrapConsoleCall) { if (!inspectorConsole) return; - var config = {}; + const config = {}; for (const key of Object.keys(console)) { if (!inspectorConsole.hasOwnProperty(key)) continue; @@ -386,7 +386,7 @@ // V8 debug object about a connection, and runMain when // that occurs. --isaacs - var debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50; + const debugTimeout = +process.env.NODE_DEBUG_TIMEOUT || 50; setTimeout(entryFunction, debugTimeout); } else { @@ -399,9 +399,9 @@ // core modules found in lib/*.js. All core modules are compiled into the // node binary, so they can be loaded faster. - var ContextifyScript = process.binding('contextify').ContextifyScript; + const ContextifyScript = process.binding('contextify').ContextifyScript; function runInThisContext(code, options) { - var script = new ContextifyScript(code, options); + const script = new ContextifyScript(code, options); return script.runInThisContext(); } @@ -421,7 +421,7 @@ return NativeModule; } - var cached = NativeModule.getCached(id); + const cached = NativeModule.getCached(id); if (cached && (cached.loaded || cached.loading)) { return cached.exports; } @@ -432,7 +432,7 @@ process.moduleLoadList.push(`NativeModule ${id}`); - var nativeModule = new NativeModule(id); + const nativeModule = new NativeModule(id); nativeModule.cache(); nativeModule.compile(); @@ -489,7 +489,7 @@ this.loading = true; try { - var fn = runInThisContext(source, { + const fn = runInThisContext(source, { filename: this.filename, lineOffset: 0, displayErrors: true From 5dd6229aeb29b215f24b02d35677842b547ab557 Mon Sep 17 00:00:00 2001 From: Danny Guo Date: Sun, 18 Sep 2016 15:47:27 -0400 Subject: [PATCH 060/216] doc: clarify fs.utimes() arguments Make it clear that atime and mtime should be in seconds. PR-URL: https://github.com/nodejs/node/pull/8651 Reviewed-By: James M Snell Reviewed-By: Benjamin Gruenbaum Reviewed-By: Anna Henningsen Reviewed-By: Teddy Katz Reviewed-By: Ilkka Myller --- doc/api/fs.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 2b9369ffa3b04c..99e23e7a5a0f53 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1438,7 +1438,7 @@ added: v0.1.31 Asynchronous realpath(3). The `callback` gets two arguments `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths. -Only paths that can be converted to UTF8 strings are supported. +Only paths that can be converted to UTF8 strings are supported. The optional `options` argument can be a string specifying an encoding, or an object with an `encoding` property specifying the character encoding to use for @@ -1637,13 +1637,15 @@ added: v0.4.2 Change file timestamps of the file referenced by the supplied path. -Note: the arguments `atime` and `mtime` of the following related functions does -follow the below rules: +Note: the arguments `atime` and `mtime` of the following related functions +follow these rules: -- If the value is a numberable string like `'123456789'`, the value would get - converted to corresponding number. -- If the value is `NaN` or `Infinity`, the value would get converted to - `Date.now()`. +- The value should be a Unix timestamp in seconds. For example, `Date.now()` + returns milliseconds, so it should be divided by 1000 before passing it in. +- If the value is a numeric string like `'123456789'`, the value will get + converted to the corresponding number. +- If the value is `NaN` or `Infinity`, the value will get converted to + `Date.now() / 1000`. ## fs.utimesSync(path, atime, mtime) -- [ ] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes +- [ ] `make -j8 test` (UNIX), or `vcbuild test nosign` (Windows) passes - [ ] tests and/or benchmarks are included - [ ] documentation is changed or added - [ ] commit message follows commit guidelines From a9491f16046a9281fe2265513b5011378879b9e3 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Sun, 24 Jul 2016 05:13:19 +0200 Subject: [PATCH 095/216] src: make ReqWrap req_ member private This commit attempts to address one of the items in https://github.com/nodejs/node/issues/4641 which is related to src/req-wrap.h and making the req_ member private. PR-URL: https://github.com/nodejs/node/pull/8532 Reviewed-By: Ben Noordhuis Reviewed-By: Anna Henningsen --- src/cares_wrap.cc | 4 ++-- src/node_file.cc | 18 +++++++++--------- src/pipe_wrap.cc | 2 +- src/req-wrap.h | 10 ++++++++-- src/stream_base.h | 9 +++++++++ src/stream_wrap.cc | 12 +++++++----- src/tcp_wrap.cc | 4 ++-- src/udp_wrap.cc | 2 +- 8 files changed, 39 insertions(+), 22 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 8ceec9d5af7ed1..44048c5dc73ddf 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -1146,7 +1146,7 @@ static void GetAddrInfo(const FunctionCallbackInfo& args) { hints.ai_flags = flags; int err = uv_getaddrinfo(env->event_loop(), - &req_wrap->req_, + req_wrap->req(), AfterGetAddrInfo, *hostname, nullptr, @@ -1176,7 +1176,7 @@ static void GetNameInfo(const FunctionCallbackInfo& args) { GetNameInfoReqWrap* req_wrap = new GetNameInfoReqWrap(env, req_wrap_obj); int err = uv_getnameinfo(env->event_loop(), - &req_wrap->req_, + req_wrap->req(), AfterGetNameInfo, (struct sockaddr*)&addr, NI_NAMEREQD); diff --git a/src/node_file.cc b/src/node_file.cc index 4238a69664b548..70f99c09f6f23a 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -137,7 +137,7 @@ static inline bool IsInt64(double x) { static void After(uv_fs_t *req) { FSReqWrap* req_wrap = static_cast(req->data); - CHECK_EQ(&req_wrap->req_, req); + CHECK_EQ(req_wrap->req(), req); req_wrap->ReleaseEarly(); // Free memory that's no longer used now. Environment* env = req_wrap->env(); @@ -320,7 +320,7 @@ static void After(uv_fs_t *req) { req_wrap->MakeCallback(env->oncomplete_string(), argc, argv); - uv_fs_req_cleanup(&req_wrap->req_); + uv_fs_req_cleanup(req_wrap->req()); req_wrap->Dispose(); } @@ -337,18 +337,18 @@ class fs_req_wrap { }; -#define ASYNC_DEST_CALL(func, req, dest, encoding, ...) \ +#define ASYNC_DEST_CALL(func, request, dest, encoding, ...) \ Environment* env = Environment::GetCurrent(args); \ - CHECK(req->IsObject()); \ - FSReqWrap* req_wrap = FSReqWrap::New(env, req.As(), \ + CHECK(request->IsObject()); \ + FSReqWrap* req_wrap = FSReqWrap::New(env, request.As(), \ #func, dest, encoding); \ int err = uv_fs_ ## func(env->event_loop(), \ - &req_wrap->req_, \ + req_wrap->req(), \ __VA_ARGS__, \ After); \ req_wrap->Dispatched(); \ if (err < 0) { \ - uv_fs_t* uv_req = &req_wrap->req_; \ + uv_fs_t* uv_req = req_wrap->req(); \ uv_req->result = err; \ uv_req->path = nullptr; \ After(uv_req); \ @@ -1164,7 +1164,7 @@ static void WriteString(const FunctionCallbackInfo& args) { FSReqWrap* req_wrap = FSReqWrap::New(env, req.As(), "write", buf, UTF8, ownership); int err = uv_fs_write(env->event_loop(), - &req_wrap->req_, + req_wrap->req(), fd, &uvbuf, 1, @@ -1172,7 +1172,7 @@ static void WriteString(const FunctionCallbackInfo& args) { After); req_wrap->Dispatched(); if (err < 0) { - uv_fs_t* uv_req = &req_wrap->req_; + uv_fs_t* uv_req = req_wrap->req(); uv_req->result = err; uv_req->path = nullptr; After(uv_req); diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 77476d52db5a0b..8fd2f8f5f3bbce 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -168,7 +168,7 @@ void PipeWrap::Connect(const FunctionCallbackInfo& args) { ConnectWrap* req_wrap = new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_PIPECONNECTWRAP); - uv_pipe_connect(&req_wrap->req_, + uv_pipe_connect(req_wrap->req(), &wrap->handle_, *name, AfterConnect); diff --git a/src/req-wrap.h b/src/req-wrap.h index e226dc63952623..0fddae67460d6f 100644 --- a/src/req-wrap.h +++ b/src/req-wrap.h @@ -18,13 +18,19 @@ class ReqWrap : public AsyncWrap { AsyncWrap::ProviderType provider); inline ~ReqWrap() override; inline void Dispatched(); // Call this after the req has been dispatched. + T* req() { return &req_; } private: friend class Environment; ListNode req_wrap_queue_; - public: - T req_; // Must be last. TODO(bnoordhuis) Make private. + protected: + // req_wrap_queue_ needs to be at a fixed offset from the start of the class + // because it is used by ContainerOf to calculate the address of the embedding + // ReqWrap. ContainerOf compiles down to simple, fixed pointer arithmetic. + // sizeof(req_) depends on the type of T, so req_wrap_queue_ would + // no longer be at a fixed offset if it came after req_. + T req_; }; } // namespace node diff --git a/src/stream_base.h b/src/stream_base.h index f3ad51ded26bf2..faddee88c82786 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -8,6 +8,7 @@ #include "req-wrap.h" #include "req-wrap-inl.h" #include "node.h" +#include "util.h" #include "v8.h" @@ -56,6 +57,10 @@ class ShutdownWrap : public ReqWrap, CHECK(args.IsConstructCall()); } + static ShutdownWrap* from_req(uv_shutdown_t* req) { + return ContainerOf(&ShutdownWrap::req_, req); + } + inline StreamBase* wrap() const { return wrap_; } size_t self_size() const override { return sizeof(*this); } @@ -82,6 +87,10 @@ class WriteWrap: public ReqWrap, CHECK(args.IsConstructCall()); } + static WriteWrap* from_req(uv_write_t* req) { + return ContainerOf(&WriteWrap::req_, req); + } + static const size_t kAlignSize = 16; protected: diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 2b50895c9f9c92..d294b641ffa444 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -276,14 +276,15 @@ void StreamWrap::SetBlocking(const FunctionCallbackInfo& args) { int StreamWrap::DoShutdown(ShutdownWrap* req_wrap) { int err; - err = uv_shutdown(&req_wrap->req_, stream(), AfterShutdown); + err = uv_shutdown(req_wrap->req(), stream(), AfterShutdown); req_wrap->Dispatched(); return err; } void StreamWrap::AfterShutdown(uv_shutdown_t* req, int status) { - ShutdownWrap* req_wrap = ContainerOf(&ShutdownWrap::req_, req); + ShutdownWrap* req_wrap = ShutdownWrap::from_req(req); + CHECK_NE(req_wrap, nullptr); HandleScope scope(req_wrap->env()->isolate()); Context::Scope context_scope(req_wrap->env()->context()); req_wrap->Done(status); @@ -336,9 +337,9 @@ int StreamWrap::DoWrite(WriteWrap* w, uv_stream_t* send_handle) { int r; if (send_handle == nullptr) { - r = uv_write(&w->req_, stream(), bufs, count, AfterWrite); + r = uv_write(w->req(), stream(), bufs, count, AfterWrite); } else { - r = uv_write2(&w->req_, stream(), bufs, count, send_handle, AfterWrite); + r = uv_write2(w->req(), stream(), bufs, count, send_handle, AfterWrite); } if (!r) { @@ -360,7 +361,8 @@ int StreamWrap::DoWrite(WriteWrap* w, void StreamWrap::AfterWrite(uv_write_t* req, int status) { - WriteWrap* req_wrap = ContainerOf(&WriteWrap::req_, req); + WriteWrap* req_wrap = WriteWrap::from_req(req); + CHECK_NE(req_wrap, nullptr); HandleScope scope(req_wrap->env()->isolate()); Context::Scope context_scope(req_wrap->env()->context()); req_wrap->Done(status); diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index f2e972970be852..b2617a5695719e 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -257,7 +257,7 @@ void TCPWrap::Connect(const FunctionCallbackInfo& args) { if (err == 0) { ConnectWrap* req_wrap = new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_TCPCONNECTWRAP); - err = uv_tcp_connect(&req_wrap->req_, + err = uv_tcp_connect(req_wrap->req(), &wrap->handle_, reinterpret_cast(&addr), AfterConnect); @@ -292,7 +292,7 @@ void TCPWrap::Connect6(const FunctionCallbackInfo& args) { if (err == 0) { ConnectWrap* req_wrap = new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_TCPCONNECTWRAP); - err = uv_tcp_connect(&req_wrap->req_, + err = uv_tcp_connect(req_wrap->req(), &wrap->handle_, reinterpret_cast(&addr), AfterConnect); diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 7fba279fca6a2f..c8009a5276e228 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -305,7 +305,7 @@ void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { } if (err == 0) { - err = uv_udp_send(&req_wrap->req_, + err = uv_udp_send(req_wrap->req(), &wrap->handle_, *bufs, count, From b62735a3023678df89e257bf4057490786898b57 Mon Sep 17 00:00:00 2001 From: Alfred Cepeda Date: Tue, 20 Sep 2016 23:16:36 -0400 Subject: [PATCH 096/216] test: remove call to `net.Socket.resume()` In test parallel/child-process-fork-net2 `net.Socket.resume()` is not necessary since `net.Socket.pause()` is never called. PR-URL: https://github.com/nodejs/node/pull/8679 Refs: https://github.com/nodejs/node/issues/4640 Reviewed-By: James M Snell Reviewed-By: Gibson Fahnestock Reviewed-By: Ilkka Myller --- test/parallel/test-child-process-fork-net2.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/parallel/test-child-process-fork-net2.js b/test/parallel/test-child-process-fork-net2.js index 9489ed8cc03dfd..be1ee5d3a4145a 100644 --- a/test/parallel/test-child-process-fork-net2.js +++ b/test/parallel/test-child-process-fork-net2.js @@ -109,10 +109,6 @@ if (process.argv[2] === 'child') { console.error('[m] CLIENT: close event'); disconnected += 1; }); - // XXX This resume() should be unnecessary. - // a stream high water mark should be enough to keep - // consuming the input. - client.resume(); } }); From e9d14260803a3b0174ccb1b619e6b4a866541b79 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 21 Sep 2016 03:46:27 +0200 Subject: [PATCH 097/216] test: enable cyrillic punycode test case The test from RFC 3492 contains a bug: the uppercase D in the input should be lowercased. Fix that and enable the test. Fixes: https://github.com/nodejs/node/issues/8691 PR-URL: https://github.com/nodejs/node/pull/8695 Reviewed-By: Colin Ihrig Reviewed-By: Gibson Fahnestock Reviewed-By: Ilkka Myller Reviewed-By: James M Snell --- test/parallel/test-punycode.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/parallel/test-punycode.js b/test/parallel/test-punycode.js index 42927549eae395..abd495e4a9957b 100644 --- a/test/parallel/test-punycode.js +++ b/test/parallel/test-punycode.js @@ -62,12 +62,10 @@ var tests = { '\uC744\uAE4C', // (I) Russian (Cyrillic) - /* XXX disabled, fails - possibly a bug in the RFC - 'b1abfaaepdrnnbgefbaDotcwatmq2g4l': + 'b1abfaaepdrnnbgefbadotcwatmq2g4l': '\u043F\u043E\u0447\u0435\u043C\u0443\u0436\u0435\u043E\u043D\u0438' + '\u043D\u0435\u0433\u043E\u0432\u043E\u0440\u044F\u0442\u043F\u043E' + '\u0440\u0443\u0441\u0441\u043A\u0438', - */ // (J) Spanish: PorqunopuedensimplementehablarenEspaol 'PorqunopuedensimplementehablarenEspaol-fmd56a': From 6ddfe89fdf597970201a6016ae8c4fb71fb9c8da Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 11 Aug 2016 16:14:28 +0200 Subject: [PATCH 098/216] src: remove VS 2013 compatibility hacks We can remove some Visual Studio 2013-specific workarounds now that support for that compiler has officially been dropped. PR-URL: https://github.com/nodejs/node/pull/8067 Refs: https://github.com/nodejs/node/issues/7484 Refs: https://github.com/nodejs/node/pull/8049 Reviewed-By: James M Snell Reviewed-By: Joao Reis --- src/node_internals.h | 21 --------------------- src/util-inl.h | 24 ++++++++++++------------ src/util.h | 16 +++------------- 3 files changed, 15 insertions(+), 46 deletions(-) diff --git a/src/node_internals.h b/src/node_internals.h index 0170798638922e..b6f5f61c9ccb0a 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -106,29 +106,8 @@ void RegisterSignalHandler(int signal, bool reset_handler = false); #endif -#ifdef _WIN32 -// emulate snprintf() on windows, _snprintf() doesn't zero-terminate the buffer -// on overflow... -// VS 2015 added a standard conform snprintf -#if defined( _MSC_VER ) && (_MSC_VER < 1900) -#include -inline static int snprintf(char *buffer, size_t n, const char *format, ...) { - va_list argp; - va_start(argp, format); - int ret = _vscprintf(format, argp); - vsnprintf_s(buffer, n, _TRUNCATE, format, argp); - va_end(argp); - return ret; -} -#endif -#endif - -#if defined(_MSC_VER) && _MSC_VER < 1900 -#define arraysize(a) (sizeof(a) / sizeof(*a)) // Workaround for VS 2013. -#else template constexpr size_t arraysize(const T(&)[N]) { return N; } -#endif #ifndef ROUND_UP # define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a)) diff --git a/src/util-inl.h b/src/util-inl.h index 31411bb47967e4..9357f675021367 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -28,33 +28,33 @@ bool ListNode::IsEmpty() const { return prev_ == this; } -template +template (T::*M)> ListHead::Iterator::Iterator(ListNode* node) : node_(node) {} -template +template (T::*M)> T* ListHead::Iterator::operator*() const { return ContainerOf(M, node_); } -template +template (T::*M)> const typename ListHead::Iterator& ListHead::Iterator::operator++() { node_ = node_->next_; return *this; } -template +template (T::*M)> bool ListHead::Iterator::operator!=(const Iterator& that) const { return node_ != that.node_; } -template +template (T::*M)> ListHead::~ListHead() { while (IsEmpty() == false) head_.next_->Remove(); } -template +template (T::*M)> void ListHead::MoveBack(ListHead* that) { if (IsEmpty()) return; @@ -67,7 +67,7 @@ void ListHead::MoveBack(ListHead* that) { head_.next_ = &head_; } -template +template (T::*M)> void ListHead::PushBack(T* element) { ListNode* that = &(element->*M); head_.prev_->next_ = that; @@ -76,7 +76,7 @@ void ListHead::PushBack(T* element) { head_.prev_ = that; } -template +template (T::*M)> void ListHead::PushFront(T* element) { ListNode* that = &(element->*M); head_.next_->prev_ = that; @@ -85,12 +85,12 @@ void ListHead::PushFront(T* element) { head_.next_ = that; } -template +template (T::*M)> bool ListHead::IsEmpty() const { return head_.IsEmpty(); } -template +template (T::*M)> T* ListHead::PopFront() { if (IsEmpty()) return nullptr; @@ -99,12 +99,12 @@ T* ListHead::PopFront() { return ContainerOf(M, node); } -template +template (T::*M)> typename ListHead::Iterator ListHead::begin() const { return Iterator(head_.next_); } -template +template (T::*M)> typename ListHead::Iterator ListHead::end() const { return Iterator(const_cast*>(&head_)); } diff --git a/src/util.h b/src/util.h index e74980d72f8e63..9460bb96d5f824 100644 --- a/src/util.h +++ b/src/util.h @@ -135,18 +135,8 @@ template using remove_reference = std::remove_reference; template class ListNode; -template -using ListNodeMember = ListNode T::*; - -// VS 2013 doesn't understand dependent templates. -#ifdef _MSC_VER -#define ListNodeMember(T) ListNodeMember -#else -#define ListNodeMember(T) ListNodeMember -#endif - // TAILQ-style intrusive list head. -template +template (T::*M)> class ListHead; template @@ -158,13 +148,13 @@ class ListNode { inline bool IsEmpty() const; private: - template friend class ListHead; + template (U::*M)> friend class ListHead; ListNode* prev_; ListNode* next_; DISALLOW_COPY_AND_ASSIGN(ListNode); }; -template +template (T::*M)> class ListHead { public: class Iterator { From 296254f141aa72fb62b699b4ef32dc16a576ba00 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 11 Aug 2016 19:10:23 +0200 Subject: [PATCH 099/216] build: remove VS 2013 switch from vcbuild.bat Support for Visual Studio 2013 has officially been dropped, remove the build option for that compiler. PR-URL: https://github.com/nodejs/node/pull/8067 Refs: https://github.com/nodejs/node/issues/7484 Refs: https://github.com/nodejs/node/pull/8049 Reviewed-By: James M Snell Reviewed-By: Joao Reis --- vcbuild.bat | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/vcbuild.bat b/vcbuild.bat index fafa5491d0b570..6235ea69db4605 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -47,7 +47,6 @@ if /i "%1"=="clean" set target=Clean&goto arg-ok if /i "%1"=="ia32" set target_arch=x86&goto arg-ok if /i "%1"=="x86" set target_arch=x86&goto arg-ok if /i "%1"=="x64" set target_arch=x64&goto arg-ok -if /i "%1"=="vc2013" set target_env=vc2013&goto arg-ok if /i "%1"=="vc2015" set target_env=vc2015&goto arg-ok if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok if /i "%1"=="nobuild" set nobuild=1&goto arg-ok @@ -133,53 +132,28 @@ if defined noprojgen if defined nobuild if defined nosign if not defined msi got @rem Set environment for msbuild -if defined target_env if "%target_env%" NEQ "vc2015" goto vc-set-2013 @rem Look for Visual Studio 2015 echo Looking for Visual Studio 2015 -if not defined VS140COMNTOOLS goto vc-set-2013 -if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2013 +if not defined VS140COMNTOOLS goto msbuild-not-found +if not exist "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found echo Found Visual Studio 2015 if defined msi ( echo Looking for WiX installation for Visual Studio 2015... if not exist "%WIX%\SDK\VS2015" ( echo Failed to find WiX install for Visual Studio 2015 echo VS2015 support for WiX is only present starting at version 3.10 - goto vc-set-2013 + goto wix-not-found ) ) if "%VCVARS_VER%" NEQ "140" ( call "%VS140COMNTOOLS%\..\..\vc\vcvarsall.bat" SET VCVARS_VER=140 ) -if not defined VCINSTALLDIR goto vc-set-2013 +if not defined VCINSTALLDIR goto msbuild-not-found set GYP_MSVS_VERSION=2015 set PLATFORM_TOOLSET=v140 goto msbuild-found -:vc-set-2013 -if defined target_env if "%target_env%" NEQ "vc2013" goto msbuild-not-found -@rem Look for Visual Studio 2013 -echo Looking for Visual Studio 2013 -if not defined VS120COMNTOOLS goto msbuild-not-found -if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found -echo Found Visual Studio 2013 -if defined msi ( - echo Looking for WiX installation for Visual Studio 2013... - if not exist "%WIX%\SDK\VS2013" ( - echo Failed to find WiX install for Visual Studio 2013 - echo VS2013 support for WiX is only present starting at version 3.8 - goto wix-not-found - ) -) -if "%VCVARS_VER%" NEQ "120" ( - call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" - SET VCVARS_VER=120 -) -if not defined VCINSTALLDIR goto msbuild-not-found -set GYP_MSVS_VERSION=2013 -set PLATFORM_TOOLSET=v120 -goto msbuild-found - :msbuild-not-found echo Failed to find Visual Studio installation. goto exit @@ -388,7 +362,7 @@ echo Failed to create vc project files. goto exit :help -echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosign] [x86/x64] [vc2013/vc2015] [download-all] [enable-vtune] +echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [nosign] [x86/x64] [vc2015] [download-all] [enable-vtune] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build From ed625fefd24013b04d2b49db4ea4f4575669cb46 Mon Sep 17 00:00:00 2001 From: Niklas Ingholt Date: Tue, 20 Sep 2016 15:22:16 +0200 Subject: [PATCH 100/216] test: add tests for add/remove header after sent This change adds tests to make sure an Error is thrown if a header is added or removed after they are sent. PR-URL: https://github.com/nodejs/node/pull/8682 Reviewed-By: Santiago Gimeno Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Ilkka Myller --- ...est-http-response-add-header-after-sent.js | 21 +++++++++++++++++++ ...-http-response-remove-header-after-sent.js | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 test/parallel/test-http-response-add-header-after-sent.js create mode 100644 test/parallel/test-http-response-remove-header-after-sent.js diff --git a/test/parallel/test-http-response-add-header-after-sent.js b/test/parallel/test-http-response-add-header-after-sent.js new file mode 100644 index 00000000000000..4261bb61ec2957 --- /dev/null +++ b/test/parallel/test-http-response-add-header-after-sent.js @@ -0,0 +1,21 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer((req, res) => { + assert.doesNotThrow(() => { + res.setHeader('header1', 1); + }); + res.write('abc'); + assert.throws(() => { + res.setHeader('header2', 2); + }, /Can't set headers after they are sent\./); + res.end(); +}); + +server.listen(0, () => { + http.get({port: server.address().port}, () => { + server.close(); + }); +}); diff --git a/test/parallel/test-http-response-remove-header-after-sent.js b/test/parallel/test-http-response-remove-header-after-sent.js new file mode 100644 index 00000000000000..972ccfeb8c70cc --- /dev/null +++ b/test/parallel/test-http-response-remove-header-after-sent.js @@ -0,0 +1,21 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const http = require('http'); + +const server = http.createServer((req, res) => { + assert.doesNotThrow(() => { + res.removeHeader('header1', 1); + }); + res.write('abc'); + assert.throws(() => { + res.removeHeader('header2', 2); + }, /Can't remove headers after they are sent/); + res.end(); +}); + +server.listen(0, () => { + http.get({port: server.address().port}, () => { + server.close(); + }); +}); From 9205edc35c113756907af9a0e508e25b7514fb31 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 22 Sep 2016 10:45:36 +0200 Subject: [PATCH 101/216] src: don't abort when c-ares initialization fails Throw a JS exception instead of aborting so the user at least has a fighting chance of understanding what went wrong. Fixes: https://github.com/nodejs/node/issues/8699 PR-URL: https://github.com/nodejs/node/pull/8710 Reviewed-By: Colin Ihrig Reviewed-By: Franziska Hinkelmann Reviewed-By: Ilkka Myller --- src/cares_wrap.cc | 77 ++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 44048c5dc73ddf..3aab61e1b360fc 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -47,6 +47,38 @@ using v8::String; using v8::Value; +inline const char* ToErrorCodeString(int status) { + switch (status) { +#define V(code) case ARES_##code: return #code; + V(EADDRGETNETWORKPARAMS) + V(EBADFAMILY) + V(EBADFLAGS) + V(EBADHINTS) + V(EBADNAME) + V(EBADQUERY) + V(EBADRESP) + V(EBADSTR) + V(ECANCELLED) + V(ECONNREFUSED) + V(EDESTRUCTION) + V(EFILE) + V(EFORMERR) + V(ELOADIPHLPAPI) + V(ENODATA) + V(ENOMEM) + V(ENONAME) + V(ENOTFOUND) + V(ENOTIMP) + V(ENOTINITIALIZED) + V(EOF) + V(EREFUSED) + V(ESERVFAIL) + V(ETIMEOUT) +#undef V + } + return "UNKNOWN_ARES_ERROR"; +} + class GetAddrInfoReqWrap : public ReqWrap { public: GetAddrInfoReqWrap(Environment* env, Local req_wrap_obj); @@ -330,41 +362,8 @@ class QueryWrap : public AsyncWrap { CHECK_NE(status, ARES_SUCCESS); HandleScope handle_scope(env()->isolate()); Context::Scope context_scope(env()->context()); - Local arg; - switch (status) { -#define V(code) \ - case ARES_ ## code: \ - arg = FIXED_ONE_BYTE_STRING(env()->isolate(), #code); \ - break; - V(ENODATA) - V(EFORMERR) - V(ESERVFAIL) - V(ENOTFOUND) - V(ENOTIMP) - V(EREFUSED) - V(EBADQUERY) - V(EBADNAME) - V(EBADFAMILY) - V(EBADRESP) - V(ECONNREFUSED) - V(ETIMEOUT) - V(EOF) - V(EFILE) - V(ENOMEM) - V(EDESTRUCTION) - V(EBADSTR) - V(EBADFLAGS) - V(ENONAME) - V(EBADHINTS) - V(ENOTINITIALIZED) - V(ELOADIPHLPAPI) - V(EADDRGETNETWORKPARAMS) - V(ECANCELLED) -#undef V - default: - arg = FIXED_ONE_BYTE_STRING(env()->isolate(), "UNKNOWN_ARES_ERROR"); - break; - } + const char* code = ToErrorCodeString(status); + Local arg = OneByteString(env()->isolate(), code); MakeCallback(env()->oncomplete_string(), 1, &arg); } @@ -1311,7 +1310,8 @@ static void Initialize(Local target, Environment* env = Environment::GetCurrent(context); int r = ares_library_init(ARES_LIB_INIT_ALL); - CHECK_EQ(r, ARES_SUCCESS); + if (r != ARES_SUCCESS) + return env->ThrowError(ToErrorCodeString(r)); struct ares_options options; memset(&options, 0, sizeof(options)); @@ -1323,7 +1323,10 @@ static void Initialize(Local target, r = ares_init_options(env->cares_channel_ptr(), &options, ARES_OPT_FLAGS | ARES_OPT_SOCK_STATE_CB); - CHECK_EQ(r, ARES_SUCCESS); + if (r != ARES_SUCCESS) { + ares_library_cleanup(); + return env->ThrowError(ToErrorCodeString(r)); + } /* Initialize the timeout timer. The timer won't be started until the */ /* first socket is opened. */ From 0eaf3ff53c48970ef8aac36a6072b4c33a39ecda Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Wed, 14 Sep 2016 15:07:49 -0700 Subject: [PATCH 102/216] path: fallback to process cwd when resolving drive cwd The `path.resolve()` function when given just a drive letter such as "C:" tries to get a drive-specific CWD, but that isn't available in cases when the process is not launched via cmd.exe and the process CWD has not been explicitly set on that drive. This change adds a fallback to the process CWD, if the process CWD happens to be on the resolved drive letter. If the process CWD is on another drive, then a drive-specific CWD cannot be resolved and defaults to the drive's root as before. Based on experimentation, the fixed behavior matches that of other similar path resolution implementations on Windows I checked: .NET's `System.IO.Path.GetFullPath()` and Python's `os.path.abspath()`. In the automated path test cases the issue doesn't occur when the tests are run normally from cmd.exe. But it did cause an assertion when running the tests from PowerShell, that is fixed by this change. PR-URL: https://github.com/nodejs/node/pull/8541 Fixes: https://github.com/nodejs/node/issues/7215 Reviewed-By: Bartosz Sosnowski Reviewed-By: James M Snell --- lib/path.js | 8 +++++--- test/fixtures/path-resolve.js | 4 ++++ test/parallel/test-path.js | 12 ++++++++++++ 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 test/fixtures/path-resolve.js diff --git a/lib/path.js b/lib/path.js index f2fb19edd9ecb1..3ed587e0e0e167 100644 --- a/lib/path.js +++ b/lib/path.js @@ -169,10 +169,12 @@ const win32 = { } else { // Windows has the concept of drive-specific current working // directories. If we've resolved a drive letter but not yet an - // absolute path, get cwd for that drive. We're sure the device is not + // absolute path, get cwd for that drive, or the process cwd if + // the drive cwd is not available. We're sure the device is not // a UNC path at this points, because UNC paths are always absolute. - path = process.env['=' + resolvedDevice]; - // Verify that a drive-local cwd was found and that it actually points + path = process.env['=' + resolvedDevice] || process.cwd(); + + // Verify that a cwd was found and that it actually points // to our drive. If not, default to the drive's root. if (path === undefined || path.slice(0, 3).toLowerCase() !== diff --git a/test/fixtures/path-resolve.js b/test/fixtures/path-resolve.js new file mode 100644 index 00000000000000..00eb3d3691ea3c --- /dev/null +++ b/test/fixtures/path-resolve.js @@ -0,0 +1,4 @@ +// Tests resolving a path in the context of a spawned process. +// See https://github.com/nodejs/node/issues/7215 +var path = require('path'); +console.log(path.resolve(process.argv[2])); diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 2c6d1e8f024752..0a12b5ce92ca75 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -1,6 +1,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); +const child = require('child_process'); const path = require('path'); const f = __filename; @@ -444,6 +445,17 @@ resolveTests.forEach(function(test) { }); assert.strictEqual(failures.length, 0, failures.join('')); +if (common.isWindows) { + // Test resolving the current Windows drive letter from a spawned process. + // See https://github.com/nodejs/node/issues/7215 + const currentDriveLetter = path.parse(process.cwd()).root.substring(0, 2); + const resolveFixture = path.join(common.fixturesDir, 'path-resolve.js'); + var spawnResult = child.spawnSync( + process.argv[0], [resolveFixture, currentDriveLetter]); + var resolvedPath = spawnResult.stdout.toString().trim(); + assert.equal(resolvedPath.toLowerCase(), process.cwd().toLowerCase()); +} + // path.isAbsolute tests assert.strictEqual(path.win32.isAbsolute('/'), true); From 5540e3d4889b46b56754547f1a9f6f133132610d Mon Sep 17 00:00:00 2001 From: Ilkka Myller Date: Thu, 22 Sep 2016 00:49:47 +0300 Subject: [PATCH 103/216] test: fix test-cluster-worker-init.js flakyness Update test to match current test guidelines and use common.mustCall instead of unref'd timer. PR-URL: https://github.com/nodejs/node/pull/8703 Fixes: https://github.com/nodejs/node/issues/8700 Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: Santiago Gimeno --- test/parallel/test-cluster-worker-init.js | 25 +++++++++-------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/test/parallel/test-cluster-worker-init.js b/test/parallel/test-cluster-worker-init.js index 41f73e1255a7c5..3b82866d1b14eb 100644 --- a/test/parallel/test-cluster-worker-init.js +++ b/test/parallel/test-cluster-worker-init.js @@ -3,30 +3,25 @@ // verifies that, when a child process is forked, the cluster.worker // object can receive messages as expected -require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var msg = 'foo'; +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const msg = 'foo'; if (cluster.isMaster) { - var worker = cluster.fork(); - var timer = setTimeout(function() { - assert(false, 'message not received'); - }, 5000); + const worker = cluster.fork(); - timer.unref(); - - worker.on('message', function(message) { - assert(message, 'did not receive expected message'); + worker.on('message', common.mustCall((message) => { + assert.strictEqual(message, true, 'did not receive expected message'); worker.disconnect(); - }); + })); - worker.on('online', function() { + worker.on('online', () => { worker.send(msg); }); } else { // GH #7998 - cluster.worker.on('message', function(message) { + cluster.worker.on('message', (message) => { process.send(message === msg); }); } From f13089b834f1a93f478f6aff163b6ae1b7a95dc2 Mon Sep 17 00:00:00 2001 From: rainabba Date: Wed, 21 Sep 2016 15:37:26 -0700 Subject: [PATCH 104/216] doc: update BUILDING.md Added note about vcbuild being included as batch to clarify that it's not needed from msbuild tools or visual studio. PR-URL: https://github.com/nodejs/node/pull/8704 Reviewed-By: James M Snell Reviewed-By: Franziska Hinkelmann Reviewed-By: Rich Trott Reviewed-By: Ilkka Myller Reviewed-By: Luigi Pinca --- BUILDING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index a9d806727e59bb..16663d60acc69e 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -105,13 +105,13 @@ Prerequisites: and tools which can be included in the global `PATH`. ```console -> vcbuild nosign +> .\vcbuild nosign ``` To run the tests: ```console -> vcbuild test +> .\vcbuild test ``` To test if Node.js was built correctly: @@ -169,7 +169,7 @@ $ ./configure --with-intl=full-icu --download=all ##### Windows: ```console -> vcbuild full-icu download-all +> .\vcbuild full-icu download-all ``` #### Building without Intl support @@ -186,7 +186,7 @@ $ ./configure --without-intl ##### Windows: ```console -> vcbuild without-intl +> .\vcbuild without-intl ``` #### Use existing installed ICU (Unix / OS X only): @@ -229,7 +229,7 @@ First unpack latest ICU to `deps/icu` as `deps/icu` (You'll have: `deps/icu/source/...`) ```console -> vcbuild full-icu +> .\vcbuild full-icu ``` ## Building Node.js with FIPS-compliant OpenSSL From b46d8cdcde8d5a8b4ba127da65610eb1cf0193c8 Mon Sep 17 00:00:00 2001 From: oogz Date: Wed, 21 Sep 2016 14:56:10 -0700 Subject: [PATCH 105/216] test: cleanup vars to const and '==' to '===' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified test-http-upgrade-client.js Line 29: Changed var port to const port Line 30: Changed var headers to const headers Line 57: Changed assert.equal to assert.strictEqual Line 61: Changed var expectedHeaders to const Line 69: Changed '==' to '===' comparison PR-URL: https://github.com/nodejs/node/pull/8705 Reviewed-By: James M Snell Reviewed-By: Teddy Katz Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Michaël Zasso Reviewed-By: Ilkka Myller --- test/parallel/test-http-upgrade-client.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-http-upgrade-client.js b/test/parallel/test-http-upgrade-client.js index 6543e7dc2223e1..51c70122b99d87 100644 --- a/test/parallel/test-http-upgrade-client.js +++ b/test/parallel/test-http-upgrade-client.js @@ -26,8 +26,8 @@ var srv = net.createServer(function(c) { }); srv.listen(0, '127.0.0.1', common.mustCall(function() { - var port = this.address().port; - var headers = [ + const port = this.address().port; + const headers = [ { connection: 'upgrade', upgrade: 'websocket' @@ -54,11 +54,11 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { }); socket.on('close', common.mustCall(function() { - assert.equal(recvData, 'nurtzo'); + assert.strictEqual(recvData.toString(), 'nurtzo'); })); console.log(res.headers); - var expectedHeaders = { + const expectedHeaders = { hello: 'world', connection: 'upgrade', upgrade: 'websocket' @@ -66,7 +66,7 @@ srv.listen(0, '127.0.0.1', common.mustCall(function() { assert.deepStrictEqual(expectedHeaders, res.headers); socket.end(); - if (--left == 0) + if (--left === 0) srv.close(); })); req.on('close', common.mustCall(function() { From aa5a16a8ae19001b5153c133ec5d4a48cb5b1e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Sat, 17 Sep 2016 18:25:03 +0200 Subject: [PATCH 106/216] test: add expectWarning to common There are multiple tests that use the same boilerplate to test that warnings are correctly emitted. This adds a new common function to do that and changes the tests to use it. PR-URL: https://github.com/nodejs/node/pull/8662 Reviewed-By: Anna Henningsen Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Conflicts: test/parallel/test-buffer-deprecated.js test/parallel/test-repl-deprecated.js --- test/common.js | 13 +++++++++++++ test/parallel/test-crypto-deprecated.js | 13 ++----------- test/parallel/test-util.js | 13 ++----------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/test/common.js b/test/common.js index 5d226e29c5b6ff..69296c5e899f44 100644 --- a/test/common.js +++ b/test/common.js @@ -508,3 +508,16 @@ exports.isAlive = function isAlive(pid) { return false; } }; + +exports.expectWarning = function(name, expected) { + if (typeof expected === 'string') + expected = [expected]; + process.on('warning', exports.mustCall((warning) => { + assert.strictEqual(warning.name, name); + assert.ok(expected.includes(warning.message), + `unexpected error message: "${warning.message}"`); + // Remove a warning message after it is seen so that we guarantee that we + // get each message only once. + expected.splice(expected.indexOf(warning.message), 1); + }, expected.length)); +}; diff --git a/test/parallel/test-crypto-deprecated.js b/test/parallel/test-crypto-deprecated.js index a471b192e1ff45..903862d6c8ed27 100644 --- a/test/parallel/test-crypto-deprecated.js +++ b/test/parallel/test-crypto-deprecated.js @@ -9,19 +9,10 @@ if (!common.hasCrypto) { const crypto = require('crypto'); const tls = require('tls'); -const expected = [ +common.expectWarning('DeprecationWarning', [ 'crypto.Credentials is deprecated. Use tls.SecureContext instead.', 'crypto.createCredentials is deprecated. Use tls.createSecureContext instead.' -]; - -process.on('warning', common.mustCall((warning) => { - assert.strictEqual(warning.name, 'DeprecationWarning'); - assert.notStrictEqual(expected.indexOf(warning.message), -1, - `unexpected error message: "${warning.message}"`); - // Remove a warning message after it is seen so that we guarantee that we get - // each message only once. - expected.splice(expected.indexOf(warning.message), 1); -}, expected.length)); +]); // Accessing the deprecated function is enough to trigger the warning event. // It does not need to be called. So the assert serves the purpose of both diff --git a/test/parallel/test-util.js b/test/parallel/test-util.js index 6072f9ae9a249e..0f5ee28e37b59c 100644 --- a/test/parallel/test-util.js +++ b/test/parallel/test-util.js @@ -121,21 +121,12 @@ assert.strictEqual(util.isFunction(function() {}), true); assert.strictEqual(util.isFunction(), false); assert.strictEqual(util.isFunction('string'), false); -const expected = [ +common.expectWarning('DeprecationWarning', [ 'util.print is deprecated. Use console.log instead.', 'util.puts is deprecated. Use console.log instead.', 'util.debug is deprecated. Use console.error instead.', 'util.error is deprecated. Use console.error instead.' -]; - -process.on('warning', common.mustCall((warning) => { - assert.strictEqual(warning.name, 'DeprecationWarning'); - assert.notStrictEqual(expected.indexOf(warning.message), -1, - `unexpected error message: "${warning.message}"`); - // Remove a warning message after it is seen so that we guarantee that we get - // each message only once. - expected.splice(expected.indexOf(warning.message), 1); -}, expected.length)); +]); util.print('test'); util.puts('test'); From 999f727bb57090b7ac1073184f101658b4e811a0 Mon Sep 17 00:00:00 2001 From: "Fangdun Cai (Fundon)" Date: Wed, 21 Sep 2016 11:47:26 +0800 Subject: [PATCH 107/216] benchmark: add benchmark for destructuring object PR-URL: https://github.com/nodejs/node/pull/8680 Reviewed-By: Brian White Reviewed-By: James M Snell Reviewed-By: Ilkka Myller --- benchmark/es/destructuring-object-bench.js | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 benchmark/es/destructuring-object-bench.js diff --git a/benchmark/es/destructuring-object-bench.js b/benchmark/es/destructuring-object-bench.js new file mode 100644 index 00000000000000..a3277aa6bfb99f --- /dev/null +++ b/benchmark/es/destructuring-object-bench.js @@ -0,0 +1,49 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + method: ['normal', 'destructureObject'], + millions: [100] +}); + +function runNormal(n) { + var i = 0; + var o = { x: 0, y: 1 }; + bench.start(); + for (; i < n; i++) { + /* eslint-disable no-unused-vars */ + var x = o.x; + var y = o.y; + var r = o.r || 2; + /* eslint-enable no-unused-vars */ + } + bench.end(n / 1e6); +} + +function runDestructured(n) { + var i = 0; + var o = { x: 0, y: 1 }; + bench.start(); + for (; i < n; i++) { + /* eslint-disable no-unused-vars */ + var { x, y, r = 2 } = o; + /* eslint-enable no-unused-vars */ + } + bench.end(n / 1e6); +} + +function main(conf) { + const n = +conf.millions * 1e6; + + switch (conf.method) { + case 'normal': + runNormal(n); + break; + case 'destructureObject': + runDestructured(n); + break; + default: + throw new Error('Unexpected method'); + } +} From 41ad6e3965609ef9025a0a2d93622b65848f369b Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Thu, 22 Sep 2016 10:36:13 +0200 Subject: [PATCH 108/216] src: rename handle__ to handle_ in HandleWrap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 46633934fed7dfce289298cf16ea0f4161b77bb7 (src: pull OnConnection from pipe_wrap and tcp_wrap) removed the private handle_ member from TCPWrap which should allow us to rename the private handle__ member in HandleWrap. PR-URL: https://github.com/nodejs/node/pull/8712 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Michaël Zasso Reviewed-By: James M Snell Reviewed-By: Ilkka Myller --- src/handle_wrap.cc | 6 +++--- src/handle_wrap.h | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index daf821e1d2a197..317fb48b1d28e3 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -56,7 +56,7 @@ void HandleWrap::Close(const FunctionCallbackInfo& args) { return; CHECK_EQ(false, wrap->persistent().IsEmpty()); - uv_close(wrap->handle__, OnClose); + uv_close(wrap->handle_, OnClose); wrap->state_ = kClosing; if (args[0]->IsFunction()) { @@ -73,8 +73,8 @@ HandleWrap::HandleWrap(Environment* env, AsyncWrap* parent) : AsyncWrap(env, object, provider, parent), state_(kInitialized), - handle__(handle) { - handle__->data = this; + handle_(handle) { + handle_->data = this; HandleScope scope(env->isolate()); Wrap(object, this); env->handle_wrap_queue()->PushBack(this); diff --git a/src/handle_wrap.h b/src/handle_wrap.h index 60f30fbd10575b..2a128dd8b1679d 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -47,7 +47,7 @@ class HandleWrap : public AsyncWrap { return IsAlive(wrap) && uv_has_ref(wrap->GetHandle()); } - inline uv_handle_t* GetHandle() const { return handle__; } + inline uv_handle_t* GetHandle() const { return handle_; } protected: HandleWrap(Environment* env, @@ -63,9 +63,7 @@ class HandleWrap : public AsyncWrap { static void OnClose(uv_handle_t* handle); ListNode handle_wrap_queue_; enum { kInitialized, kClosing, kClosingWithCallback, kClosed } state_; - // Using double underscore due to handle_ member in tcp_wrap. Probably - // tcp_wrap should rename it's member to 'handle'. - uv_handle_t* const handle__; + uv_handle_t* const handle_; }; From 8be818eb07da8ede40b24d83ae5dea686be14d62 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 23 Sep 2016 14:13:44 +0200 Subject: [PATCH 109/216] src: fix minor typo in comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correcting a couple of minor spelling typos in comments. PR-URL: https://github.com/nodejs/node/pull/8736 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Michaël Zasso Reviewed-By: Ilkka Myller --- src/node_contextify.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index c17ca6ef992c39..8933946ff1b425 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -351,7 +351,7 @@ class ContextifyContext { ContextifyContext* ctx; ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Data().As()); - // Stil initializing + // Still initializing if (ctx->context_.IsEmpty()) return; @@ -381,7 +381,7 @@ class ContextifyContext { ContextifyContext* ctx; ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Data().As()); - // Stil initializing + // Still initializing if (ctx->context_.IsEmpty()) return; @@ -407,7 +407,7 @@ class ContextifyContext { ContextifyContext* ctx; ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Data().As()); - // Stil initializing + // Still initializing if (ctx->context_.IsEmpty()) return; @@ -434,7 +434,7 @@ class ContextifyContext { ContextifyContext* ctx; ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Data().As()); - // Stil initializing + // Still initializing if (ctx->context_.IsEmpty()) return; @@ -450,7 +450,7 @@ class ContextifyContext { ContextifyContext* ctx; ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Data().As()); - // Stil initializing + // Still initializing if (ctx->context_.IsEmpty()) return; From 6fab334a73c0d20ab6043648b0518af6e81c27ff Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 2 Sep 2016 11:47:27 +0200 Subject: [PATCH 110/216] doc: fix example in stream doc Fix cases where `chunk` is a buffer. PR-URL: https://github.com/nodejs/node/pull/8378 Fixes: https://github.com/nodejs/node/issues/8085 Reviewed-By: Ilkka Myller Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- doc/api/stream.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index e9e0af7f04ef3a..a44d6eb643e1bc 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1643,8 +1643,8 @@ class MyDuplex extends Duplex { _write(chunk, encoding, callback) { // The underlying source only deals with strings if (Buffer.isBuffer(chunk)) - chunk = chunk.toString(encoding); - this[kSource].writeSomeData(chunk, encoding); + chunk = chunk.toString(); + this[kSource].writeSomeData(chunk); callback(); } From 906283837f86ebc36551c26825ae5578ed32a832 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 18 Sep 2016 18:24:44 -0700 Subject: [PATCH 111/216] test: skip cpu-intensive tests on slow hosts The `test-tick-processor-*` tests are now passing everywhere except for the single-processor 700MHz Raspberry Pi 1 devices. The tests are CPU-intensive. Skip the tests if there is only one CPU and it runs at a speed not more than 700 MHz. PR-URL: https://github.com/nodejs/node/pull/8652 Reviewed-By: Matthew Loring --- test/common.js | 4 ++++ test/parallel/parallel.status | 4 ---- test/parallel/test-tick-processor-builtin.js | 19 +++++++------------ test/parallel/test-tick-processor-cpp-core.js | 19 +++++++------------ test/parallel/test-tick-processor-unknown.js | 5 +++++ 5 files changed, 23 insertions(+), 28 deletions(-) diff --git a/test/common.js b/test/common.js index 69296c5e899f44..ce5df5794e2832 100644 --- a/test/common.js +++ b/test/common.js @@ -31,6 +31,10 @@ exports.isLinux = process.platform === 'linux'; exports.isOSX = process.platform === 'darwin'; exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */ + +const cpus = os.cpus(); +exports.enoughTestCpu = cpus.length > 1 || cpus[0].speed > 999; + exports.rootDir = exports.isWindows ? 'c:\\' : '/'; function rimrafSync(p) { diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 02fb2983c6669e..b3183a6815f9a4 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -9,14 +9,10 @@ prefix parallel [$system==win32] [$system==linux] -test-tick-processor : PASS,FLAKY [$system==macos] [$arch==arm || $arch==arm64] -test-tick-processor-builtin : PASS,FLAKY -test-tick-processor-cpp-core : PASS,FLAKY -test-tick-processor-unknown : PASS,FLAKY [$system==solaris] # Also applies to SmartOS test-debug-signal-cluster : PASS,FLAKY diff --git a/test/parallel/test-tick-processor-builtin.js b/test/parallel/test-tick-processor-builtin.js index 9097a832fff60f..8e6a5313deafaa 100644 --- a/test/parallel/test-tick-processor-builtin.js +++ b/test/parallel/test-tick-processor-builtin.js @@ -2,18 +2,6 @@ const common = require('../common'); const path = require('path'); -// TODO(mhdawson) Currently the test-tick-processor functionality in V8 -// depends on addresses being smaller than a full 64 bits. Aix supports -// the full 64 bits and the result is that it does not process the -// addresses correctly and runs out of memory -// Disabling until we get a fix upstreamed into V8 -if (common.isAix) { - common.skip('Aix address range too big for scripts.'); - return; -} - -const base = require(path.join(common.fixturesDir, 'tick-processor-base.js')); - if (common.isWindows || common.isSunOS || common.isAix || @@ -23,6 +11,13 @@ if (common.isWindows || return; } +if (!common.enoughTestCpu) { + common.skip('test is CPU-intensive'); + return; +} + +const base = require(path.join(common.fixturesDir, 'tick-processor-base.js')); + base.runTest({ pattern: /Builtin_DateNow/, code: `function f() { diff --git a/test/parallel/test-tick-processor-cpp-core.js b/test/parallel/test-tick-processor-cpp-core.js index 10e3fd35fd60c9..6223808da0c4d9 100644 --- a/test/parallel/test-tick-processor-cpp-core.js +++ b/test/parallel/test-tick-processor-cpp-core.js @@ -2,18 +2,6 @@ const common = require('../common'); const path = require('path'); -// TODO(mhdawson) Currently the test-tick-processor functionality in V8 -// depends on addresses being smaller than a full 64 bits. Aix supports -// the full 64 bits and the result is that it does not process the -// addresses correctly and runs out of memory -// Disabling until we get a fix upstreamed into V8 -if (common.isAix) { - common.skip('Aix address range too big for scripts.'); - return; -} - -const base = require(path.join(common.fixturesDir, 'tick-processor-base.js')); - if (common.isWindows || common.isSunOS || common.isAix || @@ -23,6 +11,13 @@ if (common.isWindows || return; } +if (!common.enoughTestCpu) { + common.skip('test is CPU-intensive'); + return; +} + +const base = require(path.join(common.fixturesDir, 'tick-processor-base.js')); + base.runTest({ pattern: /RunInDebugContext/, code: `function f() { diff --git a/test/parallel/test-tick-processor-unknown.js b/test/parallel/test-tick-processor-unknown.js index 15fc2d283f4063..d1d1f4e63258f4 100644 --- a/test/parallel/test-tick-processor-unknown.js +++ b/test/parallel/test-tick-processor-unknown.js @@ -12,6 +12,11 @@ if (common.isAix) { return; } +if (!common.enoughTestCpu) { + common.skip('test is CPU-intensive'); + return; +} + const base = require(path.join(common.fixturesDir, 'tick-processor-base.js')); // Unknown checked for to prevent flakiness, if pattern is not found, From 336d505dd9ec84eb3d876ac74366329c428a3f44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 20 Sep 2016 07:44:22 +0300 Subject: [PATCH 112/216] tools: enable more remark-lint rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New rules: 1. rule-style 2. strong-marker 3. no-shell-dollars 4. no-inline-padding 5. code-block-style 6. no-multiple-toplevel-headings Fixes to the existing files applied. PR-URL: https://github.com/nodejs/node/pull/8708 Reviewed-By: Anna Henningsen Reviewed-By: Ilkka Myller Reviewed-By: Johan Bergström Reviewed-By: James M Snell --- .remarkrc | 12 +- ROADMAP.md | 12 +- doc/api/addons.md | 2 +- doc/api/debugger.md | 2 +- doc/api/dns.md | 4 +- doc/api/net.md | 8 +- doc/api/process.md | 14 +- doc/api/util.md | 2 +- doc/changelogs/CHANGELOG_ARCHIVE.md | 9 +- doc/changelogs/CHANGELOG_V4.md | 10 +- doc/changelogs/CHANGELOG_V5.md | 2 +- doc/ctc-meetings/2016-06-15.md | 4 +- doc/guides/timers-in-node.md | 2 +- doc/releases.md | 12 +- .../the-event-loop-timers-and-nexttick.md | 66 +++++---- doc/tsc-meetings/2015-08-26.md | 4 +- doc/tsc-meetings/2015-10-14.md | 2 +- tools/doc/README.md | 131 +++++++++--------- 18 files changed, 154 insertions(+), 144 deletions(-) diff --git a/.remarkrc b/.remarkrc index 3bcb50d7c67a3a..143e9cdaaa8330 100644 --- a/.remarkrc +++ b/.remarkrc @@ -4,7 +4,7 @@ "blockquote-indentation": 2, "checkbox-character-style": { "checked": "x", "unchecked": " " }, "checkbox-content-indent": true, - "code-block-style": false, + "code-block-style": "fenced", "definition-case": false, "definition-spacing": true, "emphasis-marker": false, @@ -39,11 +39,11 @@ "no-heading-indent": true, "no-heading-punctuation": false, "no-html": false, - "no-inline-padding": false, + "no-inline-padding": true, "no-literal-urls": false, "no-missing-blank-lines": false, - "no-multiple-toplevel-headings": false, - "no-shell-dollars": false, + "no-multiple-toplevel-headings": true, + "no-shell-dollars": true, "no-shortcut-reference-image": true, "no-shortcut-reference-link": false, "no-table-indentation": true, @@ -52,8 +52,8 @@ "no-unused-definitions": true, "ordered-list-marker-style": false, "ordered-list-marker-value": false, - "rule-style": false, - "strong-marker": false, + "rule-style": true, + "strong-marker": "*", "table-cell-padding": "padded", "table-pipe-alignment": false, "table-pipes": true, diff --git a/ROADMAP.md b/ROADMAP.md index c85576c670e788..da8e47941916cc 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -38,9 +38,9 @@ In order for Node.js to stay competitive we need to work on the next generation While this constitutes a great leap forward for the platform we will be making this leap without breaking backwards compatibility with the existing ecosystem of modules. -# Immediate Priorities +## Immediate Priorities -## Debugging and Tracing +### Debugging and Tracing Debugging is one of the first things from everyone's mouth, both developer and enterprise, when describing trouble they've had with Node.js. @@ -55,7 +55,7 @@ The [Tracing WG](https://github.com/nodejs/tracing-wg) is driving this effort: * [Unify the Tracing endpoint](https://github.com/nodejs/node/issues/729). * New Chrome Debugger - Google is working on a version of Chrome's debugger that is without Chrome and can be used with Node.js. -## Ecosystem Automation +### Ecosystem Automation In order to maintain a good release cadence without harming compatibility we must do a better job of understanding exactly what impact a particular change or release will have on the ecosystem. This requires new automation. @@ -65,19 +65,19 @@ The initial goals for this automation are relatively simple but will create a ba * Produce a list of modules that use a particular core API. * Produce detailed code coverage data for the tests in core. -## Improve Installation and Upgrades +### Improve Installation and Upgrades * Host and maintain registry endpoints (Homebrew, apt, etc). * Document installation and upgrade procedures with an emphasis on using nvm or nave for development and our registry endpoints for traditional package managers and production. -## Streams +### Streams * Fix all existing compatibility issues. * Simplify stream creation to avoid user error. * Explore and identify compatibility issues with [WHATWG Streams](https://github.com/whatwg/streams). * Improve stream performance. -## Internationalization / Localization +### Internationalization / Localization * Build documentation tooling with localization support built in. * Reduce size of ICU and ship with it by default. diff --git a/doc/api/addons.md b/doc/api/addons.md index a239e15de651a8..1dfdf8e3bb057a 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -243,7 +243,7 @@ filename to the `sources` array. For example: Once the `binding.gyp` file is ready, the example Addons can be configured and built using `node-gyp`: -```sh +```console $ node-gyp configure build ``` diff --git a/doc/api/debugger.md b/doc/api/debugger.md index b0d4e9897d45ad..9f7b352a1b5234 100644 --- a/doc/api/debugger.md +++ b/doc/api/debugger.md @@ -181,7 +181,7 @@ localhost:5858 ## V8 Inspector Integration for Node.js -__NOTE: This is an experimental feature.__ +**NOTE: This is an experimental feature.** V8 Inspector integration allows attaching Chrome DevTools to Node.js instances for debugging and profiling. diff --git a/doc/api/dns.md b/doc/api/dns.md index 5d5354c3ef5b01..95592f9cc3f144 100644 --- a/doc/api/dns.md +++ b/doc/api/dns.md @@ -6,9 +6,9 @@ The `dns` module contains functions belonging to two different categories: 1) Functions that use the underlying operating system facilities to perform name resolution, and that do not necessarily perform any network communication. -This category contains only one function: [`dns.lookup()`][]. __Developers +This category contains only one function: [`dns.lookup()`][]. **Developers looking to perform name resolution in the same way that other applications on -the same operating system behave should use [`dns.lookup()`][].__ +the same operating system behave should use [`dns.lookup()`][].** For example, looking up `nodejs.org`. diff --git a/doc/api/net.md b/doc/api/net.md index 491e74fc611ba1..f1b206308ce3f8 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -207,8 +207,10 @@ persist*, they are removed when the last reference to them is closed. Do not forget JavaScript string escaping requires paths to be specified with double-backslashes, such as: - net.createServer().listen( - path.join('\\\\?\\pipe', process.cwd(), 'myctl')) +```js +net.createServer().listen( + path.join('\\\\?\\pipe', process.cwd(), 'myctl')) +``` The parameter `backlog` behaves the same as in [`server.listen([port][, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`]. @@ -363,7 +365,7 @@ Emitted when data is received. The argument `data` will be a `Buffer` or `String`. Encoding of data is set by `socket.setEncoding()`. (See the [Readable Stream][] section for more information.) -Note that the __data will be lost__ if there is no listener when a `Socket` +Note that the **data will be lost** if there is no listener when a `Socket` emits a `'data'` event. ### Event: 'drain' diff --git a/doc/api/process.md b/doc/api/process.md index 94c5f2dc919002..dc311872fa8629 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -478,7 +478,7 @@ process.argv.forEach((val, index) => { Launching the Node.js process as: -```sh +```console $ node process-2.js one two=three four ``` @@ -500,7 +500,7 @@ added: 6.4.0 The `process.argv0` property stores a read-only copy of the original value of `argv[0]` passed when Node.js starts. -```js +```console $ bash -c 'exec -a customArgv0 ./node' > process.argv[0] '/Volumes/code/external/node/out/Release/node' @@ -672,7 +672,7 @@ It is possible to modify this object, but such modifications will not be reflected outside the Node.js process. In other words, the following example would not work: -```sh +```console $ node -e 'process.env.foo = "bar"' && echo $foo ``` @@ -811,7 +811,7 @@ the same execution environment as the parent. For example: -```sh +```console $ node --harmony script.js --version ``` @@ -1461,7 +1461,7 @@ in several ways: 3. Writes _can_ block when output is redirected to a file. - Note that disks are fast and operating systems normally employ write-back caching so this is very uncommon. -4. Writes on UNIX __will__ block by default if output is going to a TTY +4. Writes on UNIX **will** block by default if output is going to a TTY (a terminal). 5. Windows functionality differs. Writes block except when output is going to a TTY. @@ -1519,7 +1519,7 @@ in several ways: 3. Writes _can_ block when output is redirected to a file. - Note that disks are fast and operating systems normally employ write-back caching so this is very uncommon. -4. Writes on UNIX __will__ block by default if output is going to a TTY +4. Writes on UNIX **will** block by default if output is going to a TTY (a terminal). 5. Windows functionality differs. Writes block except when output is going to a TTY. @@ -1537,7 +1537,7 @@ To check if Node.js is being run in a [TTY][] context, check the `isTTY` property on `process.stderr`, `process.stdout`, or `process.stdin`. For instance: -```sh +```console $ node -p "Boolean(process.stdin.isTTY)" true $ echo "foo" | node -p "Boolean(process.stdin.isTTY)" diff --git a/doc/api/util.md b/doc/api/util.md index 3cd80cb5dc2941..3ffefa3f87fe31 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -626,7 +626,7 @@ deprecated: v4.0.0 * `object` {any} -Returns `true` if the given `object` is strictly an `Object` __and__ not a +Returns `true` if the given `object` is strictly an `Object` **and** not a `Function`. Otherwise, returns `false`. ```js diff --git a/doc/changelogs/CHANGELOG_ARCHIVE.md b/doc/changelogs/CHANGELOG_ARCHIVE.md index eb32a8287e7ea8..8936902f4997d1 100644 --- a/doc/changelogs/CHANGELOG_ARCHIVE.md +++ b/doc/changelogs/CHANGELOG_ARCHIVE.md @@ -2175,7 +2175,7 @@ https://github.com/nodejs/node/commit/cfba1f59224ff8602c3fe9145181cad4c6df89a9 --use-http1 * Fixes https host header default port handling. (Mikeal Rogers) -* [#1440](https://github.com/joyent/node/issues/1440) strip byte order marker when loading *.js and *.json files +* [#1440](https://github.com/joyent/node/issues/1440) strip byte order marker when loading `*.js` and `*.json` files (Ben Noordhuis) * [#1434](https://github.com/joyent/node/issues/1434) Improve util.format() compatibility with browser. (Koichi Kobayashi) @@ -3089,8 +3089,9 @@ https://github.com/nodejs/node/commit/61c801413544a50000faa7f58376e9b33ba6254f https://github.com/nodejs/node/commit/39b63dfe1737d46a8c8818c92773ef181fd174b3 - * API: - Move process.watchFile into fs module - - Move process.inherits to sys + * API: + - Move process.watchFile into fs module + - Move process.inherits to sys * Improve Solaris port * tcp.Connection.prototype.write now returns boolean to indicate if @@ -3424,7 +3425,7 @@ https://github.com/nodejs/node/commit/726865af7bbafe58435986f4a193ff11c84e4bfe - __module becomes module * API: Many namespacing changes - - Move node.* into process.* + - Move node.\* into process.\* - Move node.dns into module "dns" - Move node.fs into module "posix" - process is no longer the global object. GLOBAL is. diff --git a/doc/changelogs/CHANGELOG_V4.md b/doc/changelogs/CHANGELOG_V4.md index 09ce887e2552ae..4290d3be4eb2cc 100644 --- a/doc/changelogs/CHANGELOG_V4.md +++ b/doc/changelogs/CHANGELOG_V4.md @@ -1186,11 +1186,11 @@ Maintenance update. * Roughly 78% of the commits are documentation and test improvements * **domains**: -** Fix handling of uncaught exceptions (Julien Gilli) [#3884](https://github.com/nodejs/node/pull/3884) + * Fix handling of uncaught exceptions (Julien Gilli) [#3884](https://github.com/nodejs/node/pull/3884) * **deps**: -** Upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) -** Backport 819b40a from V8 upstream (Michaël Zasso) [#3938](https://github.com/nodejs/node/pull/3938) -** Updated node LICENSE file with new npm license (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) + * Upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) + * Backport 819b40a from V8 upstream (Michaël Zasso) [#3938](https://github.com/nodejs/node/pull/3938) + * Updated node LICENSE file with new npm license (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) ### Known issues @@ -1290,7 +1290,7 @@ Maintenance update. * [[`fe3ae3cea4`](https://github.com/nodejs/node/commit/fe3ae3cea4)] - **doc**: add LTS info to COLLABORATOR_GUIDE.md (Myles Borins) [#3442](https://github.com/nodejs/node/pull/3442) * [[`daa10a345e`](https://github.com/nodejs/node/commit/daa10a345e)] - **doc**: typo fix in readme.md (Sam P Gallagher-Bishop) [#3649](https://github.com/nodejs/node/pull/3649) * [[`eca5720761`](https://github.com/nodejs/node/commit/eca5720761)] - **doc**: fix wrong date and known issue in changelog.md (James M Snell) [#3650](https://github.com/nodejs/node/pull/3650) -* [[`83494f8f3e`](https://github.com/nodejs/node/commit/83494f8f3e)] - **doc**: rename iojs-* groups to nodejs-* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) +* [[`83494f8f3e`](https://github.com/nodejs/node/commit/83494f8f3e)] - **doc**: rename iojs-\* groups to nodejs-\* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) * [[`347fb65aee`](https://github.com/nodejs/node/commit/347fb65aee)] - **doc**: fix crypto spkac function descriptions (Jason Gerfen) [#3614](https://github.com/nodejs/node/pull/3614) * [[`11d2050d63`](https://github.com/nodejs/node/commit/11d2050d63)] - **doc**: Updated streams simplified constructor API (Tom Gallacher) [#3602](https://github.com/nodejs/node/pull/3602) * [[`6db4392bfb`](https://github.com/nodejs/node/commit/6db4392bfb)] - **doc**: made code spans more visible in the API docs (phijohns) [#3573](https://github.com/nodejs/node/pull/3573) diff --git a/doc/changelogs/CHANGELOG_V5.md b/doc/changelogs/CHANGELOG_V5.md index 06ce6a35e0dde4..59a9e7949f409b 100644 --- a/doc/changelogs/CHANGELOG_V5.md +++ b/doc/changelogs/CHANGELOG_V5.md @@ -1477,7 +1477,7 @@ This is an important security release. All Node.js users should consult the secu * [[`b14d9c5f16`](https://github.com/nodejs/node/commit/b14d9c5f16)] - **doc**: add method links in events.markdown (Alejandro Oviedo) [#3187](https://github.com/nodejs/node/pull/3187) * [[`44f779b112`](https://github.com/nodejs/node/commit/44f779b112)] - **doc**: add caveats of algs and key size in crypto (Shigeki Ohtsu) [#3479](https://github.com/nodejs/node/pull/3479) * [[`a0db5fb355`](https://github.com/nodejs/node/commit/a0db5fb355)] - **doc**: stdout/stderr can block when directed to file (Ben Noordhuis) [#3170](https://github.com/nodejs/node/pull/3170) -* [[`409f29972e`](https://github.com/nodejs/node/commit/409f29972e)] - **doc**: rename iojs-* groups to nodejs-* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) +* [[`409f29972e`](https://github.com/nodejs/node/commit/409f29972e)] - **doc**: rename iojs-\* groups to nodejs-\* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) * [[`801866280e`](https://github.com/nodejs/node/commit/801866280e)] - **doc**: fix wrong date and known issue in changelog.md (James M Snell) [#3650](https://github.com/nodejs/node/pull/3650) * [[`325c4c7af5`](https://github.com/nodejs/node/commit/325c4c7af5)] - **doc**: fix function param order in assert doc (David Woods) [#3533](https://github.com/nodejs/node/pull/3533) * [[`045e04e531`](https://github.com/nodejs/node/commit/045e04e531)] - **doc**: typo fix in readme.md (Sam P Gallagher-Bishop) [#3649](https://github.com/nodejs/node/pull/3649) diff --git a/doc/ctc-meetings/2016-06-15.md b/doc/ctc-meetings/2016-06-15.md index 9046cdee2ba830..6fce3b0d4d72e4 100644 --- a/doc/ctc-meetings/2016-06-15.md +++ b/doc/ctc-meetings/2016-06-15.md @@ -42,8 +42,8 @@ Extracted from **ctc-agenda** labelled issues and pull requests from the **nodej * some issue/PRs reviews * Chris Dickinson @chrisdickinson (CTC) - * NodeConf - * modules.guide + * NodeConf + * modules.guide * Evan Lucas @evanlucas (CTC) * Preparing for security release diff --git a/doc/guides/timers-in-node.md b/doc/guides/timers-in-node.md index f9e9c3bcc41f0f..d6a594e150feff 100644 --- a/doc/guides/timers-in-node.md +++ b/doc/guides/timers-in-node.md @@ -82,7 +82,7 @@ console.log('after immediate'); The above function passed to `setImmediate()` will execute after all runnable code has executed, and the console output will be: -```shell +```console before immediate after immediate executing immediate: so immediate diff --git a/doc/releases.md b/doc/releases.md index d09f326f6add55..8e87221ba66d6e 100644 --- a/doc/releases.md +++ b/doc/releases.md @@ -34,7 +34,7 @@ A SHASUMS256.txt file is produced for every promoted build, nightly, and release The GPG keys should be fetchable from a known third-party keyserver. The SKS Keyservers at are recommended. Use the [submission](https://sks-keyservers.net/i/#submit) form to submit a new GPG key. Keys should be fetchable via: -```sh +```console $ gpg --keyserver pool.sks-keyservers.net --recv-keys ``` @@ -55,7 +55,7 @@ Create a new branch named _"vx.y.z-proposal"_, or something similar. Using `git For a list of commits that could be landed in a patch release on v5.x -```sh +```console $ branch-diff v5.x master --exclude-label=semver-major,semver-minor,dont-land-on-v5.x --filter-release --format=simple ``` @@ -94,13 +94,13 @@ The general rule is to bump this version when there are _breaking ABI_ changes a Collect a formatted list of commits since the last release. Use [`changelog-maker`](https://github.com/rvagg/changelog-maker) to do this. -```sh +```console $ changelog-maker --group ``` Note that changelog-maker counts commits since the last tag and if the last tag in the repository was not on the current branch you may have to supply a `--start-ref` argument: -```sh +```console $ changelog-maker --group --start-ref v2.3.1 ``` @@ -224,7 +224,7 @@ $ npm install -g git-secure-tag Create a tag using the following command: -```sh +```console $ git secure-tag -sm 'YYYY-MM-DD Node.js vx.y.z (Release Type) Release' ``` @@ -232,7 +232,7 @@ The tag **must** be signed using the GPG key that's listed for you on the projec Push the tag to the repo before you promote the builds. If you haven't pushed your tag first, then build promotion won't work properly. Push the tag using the following command: -```sh +```console $ git push ``` diff --git a/doc/topics/the-event-loop-timers-and-nexttick.md b/doc/topics/the-event-loop-timers-and-nexttick.md index e38dd00dead8fc..ca2e1b555981c7 100644 --- a/doc/topics/the-event-loop-timers-and-nexttick.md +++ b/doc/topics/the-event-loop-timers-and-nexttick.md @@ -22,24 +22,26 @@ this document) which may make async API calls, schedule timers, or call The following diagram shows a simplified overview of the event loop's order of operations. - ┌───────────────────────┐ - ┌─>│ timers │ - │ └──────────┬────────────┘ - │ ┌──────────┴────────────┐ - │ │ I/O callbacks │ - │ └──────────┬────────────┘ - │ ┌──────────┴────────────┐ - │ │ idle, prepare │ - │ └──────────┬────────────┘ ┌───────────────┐ - │ ┌──────────┴────────────┐ │ incoming: │ - │ │ poll │<─────┤ connections, │ - │ └──────────┬────────────┘ │ data, etc. │ - │ ┌──────────┴────────────┐ └───────────────┘ - │ │ check │ - │ └──────────┬────────────┘ - │ ┌──────────┴────────────┐ - └──┤ close callbacks │ - └───────────────────────┘ +```txt + ┌───────────────────────┐ +┌─>│ timers │ +│ └──────────┬────────────┘ +│ ┌──────────┴────────────┐ +│ │ I/O callbacks │ +│ └──────────┬────────────┘ +│ ┌──────────┴────────────┐ +│ │ idle, prepare │ +│ └──────────┬────────────┘ ┌───────────────┐ +│ ┌──────────┴────────────┐ │ incoming: │ +│ │ poll │<─────┤ connections, │ +│ └──────────┬────────────┘ │ data, etc. │ +│ ┌──────────┴────────────┐ └───────────────┘ +│ │ check │ +│ └──────────┬────────────┘ +│ ┌──────────┴────────────┐ +└──┤ close callbacks │ + └───────────────────────┘ +``` *note: each box will be referred to as a "phase" of the event loop.* @@ -238,13 +240,15 @@ setImmediate(function immediate () { }); ``` - $ node timeout_vs_immediate.js - timeout - immediate +```console +$ node timeout_vs_immediate.js +timeout +immediate - $ node timeout_vs_immediate.js - immediate - timeout +$ node timeout_vs_immediate.js +immediate +timeout +``` However, if you move the two calls within an I/O cycle, the immediate callback is always executed first: @@ -263,13 +267,15 @@ fs.readFile(__filename, () => { }) ``` - $ node timeout_vs_immediate.js - immediate - timeout +```console +$ node timeout_vs_immediate.js +immediate +timeout - $ node timeout_vs_immediate.js - immediate - timeout +$ node timeout_vs_immediate.js +immediate +timeout +``` The main advantage to using `setImmediate()` over `setTimeout()` is `setImmediate()` will always be executed before any timers if scheduled diff --git a/doc/tsc-meetings/2015-08-26.md b/doc/tsc-meetings/2015-08-26.md index 54cf3377865e08..dfe1e7bcce2fd0 100644 --- a/doc/tsc-meetings/2015-08-26.md +++ b/doc/tsc-meetings/2015-08-26.md @@ -18,7 +18,7 @@ Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs or ### nodejs/node * doc: merge CHANGELOG.md with joyent/node ChangeLog [#2536](https://github.com/nodejs/node/pull/2536) -* (guidance on) rename of "language groups" from iojs-* to nodejs-*? [#2525](https://github.com/nodejs/node/issues/2525) +* (guidance on) rename of "language groups" from iojs-\* to nodejs-\*? [#2525](https://github.com/nodejs/node/issues/2525) * Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522) ### nodejs/collaboration @@ -76,7 +76,7 @@ Target ETA for transition: Monday. * Rod seeking confirmation from this group that this was _not a bad idea_. * Discussion about documentation for people upgrading from older versions of Node and having a linear history. Jeremiah has been working on 0.10 -> v4 documentation. -### (guidance on) rename of "language groups" from iojs-* to nodejs-*? [#2525](https://github.com/nodejs/node/issues/2525) +### (guidance on) rename of "language groups" from iojs-\* to nodejs-\*? [#2525](https://github.com/nodejs/node/issues/2525) * Steven discussed renaming the language groups * Mikeal: some groups are not in a position to make decisions because they are not active but the ones that are should be given the opportunity to agree or disagree to the move rather than us imposing a move on them. We should post an issue in their repos. diff --git a/doc/tsc-meetings/2015-10-14.md b/doc/tsc-meetings/2015-10-14.md index 65a0f467cdffb3..85859075eb824e 100644 --- a/doc/tsc-meetings/2015-10-14.md +++ b/doc/tsc-meetings/2015-10-14.md @@ -45,7 +45,7 @@ Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs or * Rod Vagg: Not quite as involved, took a bit of time off. Getting back up to speed on build * Domenic: Nothing this week * Brian: PRs & Issues -* Steven: Worked on getting ICU 56.1 out and into v4.2.0 LTS, working on making the ICU [install better](https://github.com/nodejs/node-v0.x-archive/issues/8996#issuecomment-89411193). Also shepherding iojs-* rename to nodejs-* [#2525](https://github.com/nodejs/node/issues/2525) +* Steven: Worked on getting ICU 56.1 out and into v4.2.0 LTS, working on making the ICU [install better](https://github.com/nodejs/node-v0.x-archive/issues/8996#issuecomment-89411193). Also shepherding iojs-\* rename to nodejs-\* [#2525](https://github.com/nodejs/node/issues/2525) * James: Worked on the 4.2.0 and 4.2.1 releases. Working on the cgitm smoke-testing tool and http WG. * Michael: Worked on adding pLinux to the CI. Looking into running the tests on fips-compliant mode. Investigated some AIX issues. * Ben: PRs & Issues, doing some work on the debugger and memory bugs in libuv diff --git a/tools/doc/README.md b/tools/doc/README.md index e472c712dc0a52..6985bc130d62c5 100644 --- a/tools/doc/README.md +++ b/tools/doc/README.md @@ -4,98 +4,99 @@ Here's how the node docs work. Each type of heading has a description block. +```md +## module + - ## module - +> Stability: 3 - Stable - > Stability: 3 - Stable +description and examples. - description and examples. +### module.property + - ### module.property - +* Type - * Type +description of the property. - description of the property. +### module.someFunction(x, y, [z=100]) + - ### module.someFunction(x, y, [z=100]) - +* `x` {String} the description of the string +* `y` {Boolean} Should I stay or should I go? +* `z` {Number} How many zebras to bring. - * `x` {String} the description of the string - * `y` {Boolean} Should I stay or should I go? - * `z` {Number} How many zebras to bring. +A description of the function. - A description of the function. +### module.someNewFunction(x) + - ### module.someNewFunction(x) - +* `x` {String} the description of the string - * `x` {String} the description of the string +This feature is not in a release yet. - This feature is not in a release yet. +### Event: 'blerg' + - ### Event: 'blerg' - +* Argument: SomeClass object. - * Argument: SomeClass object. +Modules don't usually raise events on themselves. `cluster` is the +only exception. - Modules don't usually raise events on themselves. `cluster` is the - only exception. +## Class: SomeClass + - ## Class: SomeClass - +description of the class. - description of the class. +### Class Method: SomeClass.classMethod(anArg) + - ### Class Method: SomeClass.classMethod(anArg) - +* `anArg` {Object} Just an argument + * `field` {String} anArg can have this field. + * `field2` {Boolean} Another field. Default: `false`. +* Return: {Boolean} `true` if it worked. - * `anArg` {Object} Just an argument - * `field` {String} anArg can have this field. - * `field2` {Boolean} Another field. Default: `false`. - * Return: {Boolean} `true` if it worked. +Description of the method for humans. - Description of the method for humans. +### someClass.nextSibling() + - ### someClass.nextSibling() - +* Return: {SomeClass object | null} The next someClass in line. - * Return: {SomeClass object | null} The next someClass in line. +### someClass.someProperty + - ### someClass.someProperty - +* String - * String +The indication of what someProperty is. - The indication of what someProperty is. +### Event: 'grelb' + - ### Event: 'grelb' - +* `isBlerg` {Boolean} - * `isBlerg` {Boolean} - - This event is emitted on instances of SomeClass, not on the module itself. +This event is emitted on instances of SomeClass, not on the module itself. +``` * Modules have (description, Properties, Functions, Classes, Examples) From ee7af01b93cc46f1848f6962ad2d6c93f319341a Mon Sep 17 00:00:00 2001 From: Rene Weber Date: Wed, 31 Aug 2016 01:00:41 +0100 Subject: [PATCH 113/216] http: socket connection timeout for http request This allows passing the socket connection timeout to http#request such that it will be set before the socket is connecting PR-URL: https://github.com/nodejs/node/pull/8101 Fixes: https://github.com/nodejs/node/issues/7580 Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Ilkka Myller --- doc/api/http.md | 2 ++ doc/api/net.md | 4 ++- lib/_http_client.js | 8 ++++- lib/net.js | 5 +++ .../test-http-client-timeout-event.js | 24 +++++--------- .../test-http-client-timeout-option.js | 33 +++++++++++++++++++ 6 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 test/parallel/test-http-client-timeout-option.js diff --git a/doc/api/http.md b/doc/api/http.md index ebd4fae7f36aba..d4c15f6c4ee01a 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1430,6 +1430,8 @@ Options: request when the `agent` option is not used. This can be used to avoid creating a custom Agent class just to override the default `createConnection` function. See [`agent.createConnection()`][] for more details. +- `timeout`: A number specifying the socket timeout in milliseconds. + This will set the timeout before the socket is connected. The optional `callback` parameter will be added as a one time listener for the [`'response'`][] event. diff --git a/doc/api/net.md b/doc/api/net.md index f1b206308ce3f8..394e6fb86ea1e6 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -765,7 +765,9 @@ A factory function, which returns a new [`net.Socket`][] and automatically connects with the supplied `options`. The options are passed to both the [`net.Socket`][] constructor and the -[`socket.connect`][] method. +[`socket.connect`][] method. + +Passing `timeout` as an option will call [`socket.setTimeout()`][] after the socket is created, but before it is connecting. The `connectListener` parameter will be added as a listener for the [`'connect'`][] event once. diff --git a/lib/_http_client.js b/lib/_http_client.js index 91855e5b87ac3e..423445d6a6f091 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -67,6 +67,7 @@ function ClientRequest(options, cb) { } self.socketPath = options.socketPath; + self.timeout = options.timeout; var method = self.method = (options.method || 'GET').toUpperCase(); if (!common._checkIsHttpToken(method)) { @@ -134,7 +135,8 @@ function ClientRequest(options, cb) { self._last = true; self.shouldKeepAlive = false; const optionsPath = { - path: self.socketPath + path: self.socketPath, + timeout: self.timeout }; const newSocket = self.agent.createConnection(optionsPath, oncreate); if (newSocket && !called) { @@ -559,6 +561,10 @@ function tickOnSocket(req, socket) { socket.on('data', socketOnData); socket.on('end', socketOnEnd); socket.on('close', socketCloseListener); + + if (req.timeout) { + socket.once('timeout', () => req.emit('timeout')); + } req.emit('socket', socket); } diff --git a/lib/net.js b/lib/net.js index 298e7186aa6d60..5caf7747194bc5 100644 --- a/lib/net.js +++ b/lib/net.js @@ -66,6 +66,11 @@ exports.connect = exports.createConnection = function() { args = normalizeConnectArgs(args); debug('createConnection', args); var s = new Socket(args[0]); + + if (args[0].timeout) { + s.setTimeout(args[0].timeout); + } + return Socket.prototype.connect.apply(s, args); }; diff --git a/test/parallel/test-http-client-timeout-event.js b/test/parallel/test-http-client-timeout-event.js index 03aa847a80b45a..8e3d034c31d857 100644 --- a/test/parallel/test-http-client-timeout-event.js +++ b/test/parallel/test-http-client-timeout-event.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var http = require('http'); +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); var options = { method: 'GET', @@ -10,30 +10,22 @@ var options = { path: '/' }; -var server = http.createServer(function(req, res) { - // this space intentionally left blank -}); +var server = http.createServer(); server.listen(0, options.host, function() { options.port = this.address().port; - var req = http.request(options, function(res) { - // this space intentionally left blank - }); + var req = http.request(options); req.on('error', function() { // this space is intentionally left blank }); - req.on('close', function() { - server.close(); - }); + req.on('close', common.mustCall(() => server.close())); var timeout_events = 0; req.setTimeout(1); - req.on('timeout', function() { - timeout_events += 1; - }); + req.on('timeout', common.mustCall(() => timeout_events += 1)); setTimeout(function() { req.destroy(); - assert.equal(timeout_events, 1); + assert.strictEqual(timeout_events, 1); }, common.platformTimeout(100)); setTimeout(function() { req.end(); diff --git a/test/parallel/test-http-client-timeout-option.js b/test/parallel/test-http-client-timeout-option.js new file mode 100644 index 00000000000000..79aa6ba46b6579 --- /dev/null +++ b/test/parallel/test-http-client-timeout-option.js @@ -0,0 +1,33 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +var options = { + method: 'GET', + port: undefined, + host: '127.0.0.1', + path: '/', + timeout: 1 +}; + +var server = http.createServer(); + +server.listen(0, options.host, function() { + options.port = this.address().port; + var req = http.request(options); + req.on('error', function() { + // this space is intentionally left blank + }); + req.on('close', common.mustCall(() => server.close())); + + var timeout_events = 0; + req.on('timeout', common.mustCall(() => timeout_events += 1)); + setTimeout(function() { + req.destroy(); + assert.strictEqual(timeout_events, 1); + }, common.platformTimeout(100)); + setTimeout(function() { + req.end(); + }, common.platformTimeout(10)); +}); From d69570d5fc413278f64c81413b986b82f7e555ff Mon Sep 17 00:00:00 2001 From: yorkie Date: Fri, 23 Sep 2016 13:36:22 +0800 Subject: [PATCH 114/216] doc,tool: add ref to Integer We documented most types as Integer, but we don't have link for that. PR-URL: https://github.com/nodejs/node/pull/8740 Reviewed-By: Luigi Pinca Reviewed-By: Anna Henningsen --- tools/doc/type-parser.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 652b87add5e12c..405d3a869d2c03 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -4,11 +4,16 @@ const jsDocUrl = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/' + 'Reference/Global_Objects/'; const jsPrimitiveUrl = 'https://developer.mozilla.org/en-US/docs/Web/' + 'JavaScript/Data_structures'; -const jsPrimitives = [ - 'Number', 'String', 'Boolean', 'Null', 'Symbol' -]; +const jsPrimitives = { + 'Integer': 'Number', // this is for extending + 'Number': 'Number', + 'String': 'String', + 'Boolean': 'Boolean', + 'Null': 'Null', + 'Symbol': 'Symbol' +}; const jsGlobalTypes = [ - 'Error', 'Object', 'Function', 'Array', 'Uint8Array', + 'Error', 'Object', 'Function', 'Array', 'TypedArray', 'Uint8Array', 'Uint16Array', 'Uint32Array', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8ClampedArray', 'Float32Array', 'Float64Array', 'Date', 'RegExp', 'ArrayBuffer', 'DataView', 'Promise', 'EvalError', 'RangeError', @@ -38,8 +43,9 @@ module.exports = { typeText = typeText.trim(); if (typeText) { let typeUrl = null; - if (jsPrimitives.indexOf(typeText) !== -1) { - typeUrl = jsPrimitiveUrl + '#' + typeText + '_type'; + const primitive = jsPrimitives[typeText]; + if (primitive !== undefined) { + typeUrl = `${jsPrimitiveUrl}#${primitive}_type`; } else if (jsGlobalTypes.indexOf(typeText) !== -1) { typeUrl = jsDocUrl + typeText; } else if (typeMap[typeText]) { From 5e4d8984b4822badf75b700a09d8a7afc63653e4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 23 Sep 2016 16:41:21 -0700 Subject: [PATCH 115/216] test: accept expected AIX result test-stdio-closed AIX handles closed stdio differently (but still compliant with spec as far as I can tell) than other POSIX variants we test. Test results are different than Linux and others because AIX takes measures to not re-use the file descriptors for stdio if one of the stdio streams is closed. Fixes: https://github.com/nodejs/node/issues/8375 PR-URL: https://github.com/nodejs/node/pull/8755 Reviewed-By: James M Snell Reviewed-By: Gibson Fahnestock Reviewed-By: Ilkka Myller Conflicts: test/parallel/parallel.status --- test/parallel/parallel.status | 3 --- test/parallel/test-stdio-closed.js | 30 ++++++++++++++++++++---------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index b3183a6815f9a4..11d99066e337d5 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -27,9 +27,6 @@ test-debug-signal-cluster : PASS,FLAKY test-fs-watch-enoent : FAIL, PASS test-fs-watch-encoding : FAIL, PASS -#being worked under https://github.com/nodejs/node/issues/7973 -test-stdio-closed : PASS, FLAKY - #covered by https://github.com/nodejs/node/issues/3796 # but more frequent on AIX ? test-debug-signal-cluster : PASS, FLAKY diff --git a/test/parallel/test-stdio-closed.js b/test/parallel/test-stdio-closed.js index 0f94289ee96534..a85467f76a6d0f 100644 --- a/test/parallel/test-stdio-closed.js +++ b/test/parallel/test-stdio-closed.js @@ -1,7 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var spawn = require('child_process').spawn; +const common = require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; if (common.isWindows) { common.skip('platform not supported.'); @@ -9,18 +9,28 @@ if (common.isWindows) { } if (process.argv[2] === 'child') { - process.stdout.write('stdout', function() { - process.stderr.write('stderr', function() { - process.exit(42); + try { + process.stdout.write('stdout', function() { + try { + process.stderr.write('stderr', function() { + process.exit(42); + }); + } catch (e) { + process.exit(84); + } }); - }); + } catch (e) { + assert.strictEqual(e.code, 'EBADF'); + assert.strictEqual(e.message, 'EBADF: bad file descriptor, write'); + process.exit(126); + } return; } // Run the script in a shell but close stdout and stderr. -var cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`; -var proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' }); +const cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`; +const proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' }); proc.on('exit', common.mustCall(function(exitCode) { - assert.equal(exitCode, 42); + assert.strictEqual(exitCode, common.isAix ? 126 : 42); })); From fc68b12bc3654cbe5382ded52e8dd1bd74cce765 Mon Sep 17 00:00:00 2001 From: Yosuke Furukawa Date: Sat, 17 Sep 2016 11:01:39 +0200 Subject: [PATCH 116/216] util: Add format for SharedArrayBuffer PR-URL: https://github.com/nodejs/node/pull/8587 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- lib/util.js | 10 ++++++---- src/node_util.cc | 2 +- test/parallel/test-util-format-shared-arraybuffer.js | 10 ++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 test/parallel/test-util-format-shared-arraybuffer.js diff --git a/lib/util.js b/lib/util.js index caab2651f3532d..f742e38433927f 100644 --- a/lib/util.js +++ b/lib/util.js @@ -435,9 +435,10 @@ function formatValue(ctx, value, recurseTimes) { formatted = formatPrimitiveNoColor(ctx, raw); return ctx.stylize('[Boolean: ' + formatted + ']', 'boolean'); } - // Fast path for ArrayBuffer. Can't do the same for DataView because it - // has a non-primitive .buffer property that we need to recurse for. - if (binding.isArrayBuffer(value)) { + // Fast path for ArrayBuffer and SharedArrayBuffer. + // Can't do the same for DataView because it has a non-primitive + // .buffer property that we need to recurse for. + if (binding.isArrayBuffer(value) || binding.isSharedArrayBuffer(value)) { return `${getConstructorOf(value).name}` + ` { byteLength: ${formatNumber(ctx, value.byteLength)} }`; } @@ -475,7 +476,8 @@ function formatValue(ctx, value, recurseTimes) { keys.unshift('size'); empty = value.size === 0; formatter = formatMap; - } else if (binding.isArrayBuffer(value)) { + } else if (binding.isArrayBuffer(value) || + binding.isSharedArrayBuffer(value)) { braces = ['{', '}']; keys.unshift('byteLength'); visibleKeys.byteLength = true; diff --git a/src/node_util.cc b/src/node_util.cc index 000d1e6a410292..0db7ab40fbf609 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -20,7 +20,6 @@ using v8::Value; #define VALUE_METHOD_MAP(V) \ V(isArrayBuffer, IsArrayBuffer) \ - V(isSharedArrayBuffer, IsSharedArrayBuffer) \ V(isDataView, IsDataView) \ V(isDate, IsDate) \ V(isMap, IsMap) \ @@ -29,6 +28,7 @@ using v8::Value; V(isRegExp, IsRegExp) \ V(isSet, IsSet) \ V(isSetIterator, IsSetIterator) \ + V(isSharedArrayBuffer, IsSharedArrayBuffer) \ V(isTypedArray, IsTypedArray) diff --git a/test/parallel/test-util-format-shared-arraybuffer.js b/test/parallel/test-util-format-shared-arraybuffer.js new file mode 100644 index 00000000000000..d0c7dfe8c4c7f2 --- /dev/null +++ b/test/parallel/test-util-format-shared-arraybuffer.js @@ -0,0 +1,10 @@ +// Flags: --harmony_sharedarraybuffer + +'use strict'; +require('../common'); +const assert = require('assert'); +const util = require('util'); + +/* global SharedArrayBuffer */ +const sab = new SharedArrayBuffer(4); +assert.strictEqual(util.format(sab), 'SharedArrayBuffer { byteLength: 4 }'); From 882f8b3d6cb597c932c24e059a838a231545cce7 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Thu, 22 Sep 2016 13:00:27 +0200 Subject: [PATCH 117/216] benchmark: use 'yes' instead of echo in a loop This changes child-process-exec-stdout benchmark to use 'yes' instead of echo in a while loop. This makes this benchmark consistent with child-process-read which already uses `yes` and allows this benchmark to be executed on Windows. Reviewed-By: Ben Noordhuis PR-URL: https://github.com/nodejs/node/pull/8721 --- benchmark/child_process/child-process-exec-stdout.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index 6194f66b55d987..7b93aacff8532d 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -20,8 +20,7 @@ function main(conf) { const msg = `"${'.'.repeat(len)}"`; msg.match(/./); const options = {'stdio': ['ignore', 'pipe', 'ignore']}; - // NOTE: Command below assumes bash shell. - const child = exec(`while\n echo ${msg}\ndo :; done\n`, options); + const child = exec(`yes ${msg}`, options); var bytes = 0; child.stdout.on('data', function(msg) { From 3aec6a68bf0d8695d2a96588916f163265ab3a39 Mon Sep 17 00:00:00 2001 From: yorkie Date: Fri, 23 Sep 2016 22:55:39 +0800 Subject: [PATCH 118/216] doc: improve child_process doc types PR-URL: https://github.com/nodejs/node/pull/8741 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- doc/api/child_process.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 33027468eaf543..ae3d18fd080886 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -1046,7 +1046,7 @@ this occurs. added: v0.1.90 --> -* {Stream} +* {Stream.Readable} A `Readable Stream` that represents the child process's `stderr`. @@ -1061,7 +1061,7 @@ the same value. added: v0.1.90 --> -* {Stream} +* {Stream.Writable} A `Writable Stream` that represents the child process's `stdin`. @@ -1119,7 +1119,7 @@ assert.equal(child.stdio[2], child.stderr); added: v0.1.90 --> -* {Stream} +* {Stream.Readable} A `Readable Stream` that represents the child process's `stdout`. From b2aea505df9f1c477b2a400df0bb993fe49842d6 Mon Sep 17 00:00:00 2001 From: Eugene Ostroukhov Date: Fri, 23 Sep 2016 11:47:59 -0700 Subject: [PATCH 119/216] test: use Buffer.alloc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-By: James M Snell Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Ilkka Myller Reviewed-By: Brian White Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig PR-URL: https://github.com/nodejs/node/pull/8748 --- test/inspector/inspector-helper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/inspector/inspector-helper.js b/test/inspector/inspector-helper.js index cf1c7f7afb179e..a4e1094340993e 100644 --- a/test/inspector/inspector-helper.js +++ b/test/inspector/inspector-helper.js @@ -90,13 +90,13 @@ function checkHttpResponse(port, path, callback) { } function makeBufferingDataCallback(dataCallback) { - let buffer = new Buffer(0); + let buffer = Buffer.alloc(0); return (data) => { const newData = Buffer.concat([buffer, data]); const str = newData.toString('utf8'); const lines = str.split('\n'); if (str.endsWith('\n')) - buffer = new Buffer(0); + buffer = Buffer.alloc(0); else buffer = Buffer.from(lines.pop(), 'utf8'); for (var line of lines) @@ -123,7 +123,7 @@ const TestSession = function(socket, harness) { this.expectedId_ = 1; this.lastMessageResponseCallback_ = null; - let buffer = new Buffer(0); + let buffer = Buffer.alloc(0); socket.on('data', (data) => { buffer = Buffer.concat([buffer, data]); let consumed; From d6dcbc212b3a20fa68a09cbaae5b2570c4e014ae Mon Sep 17 00:00:00 2001 From: yorkie Date: Fri, 23 Sep 2016 23:02:25 +0800 Subject: [PATCH 120/216] doc,tool: add tls.TLSSocket to typeMap We use tls.TLSSocket type in tls.md, so that needs to be added to doctool's typeMap PR-URL: https://github.com/nodejs/node/pull/8742 Reviewed-By: Luigi Pinca --- tools/doc/type-parser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js index 405d3a869d2c03..d8141dc4fd5edf 100644 --- a/tools/doc/type-parser.js +++ b/tools/doc/type-parser.js @@ -29,6 +29,7 @@ const typeMap = { 'cluster.Worker': 'cluster.html#cluster_class_worker', 'dgram.Socket': 'dgram.html#dgram_class_dgram_socket', 'net.Socket': 'net.html#net_class_net_socket', + 'tls.TLSSocket': 'tls.html#tls_class_tls_tlssocket', 'EventEmitter': 'events.html#events_class_eventemitter', 'Timer': 'timers.html#timers_timers' }; From b9c2270502cdaf31daf7699924aec318de1e6de8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 26 Sep 2016 20:14:32 +0200 Subject: [PATCH 121/216] buffer: fix performance regression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit V8 5.4 changed the way that the default constructor of derived classes is called. It introduced a significant performance regression in the buffer module for the creation of pooled buffers. This commit forces the definition back to how it was implicitly before. Ref: https://bugs.chromium.org/p/v8/issues/detail?id=4890 PR-URL: https://github.com/nodejs/node/pull/8754 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Trevor Norris Reviewed-By: Ilkka Myller Reviewed-By: Fedor Indutny Reviewed-By: Johan Bergström --- lib/buffer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/buffer.js b/lib/buffer.js index 2b7134206da21b..75b13eec968938 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -6,7 +6,11 @@ const { isArrayBuffer, isSharedArrayBuffer } = process.binding('util'); const bindingObj = {}; const internalUtil = require('internal/util'); -class FastBuffer extends Uint8Array {} +class FastBuffer extends Uint8Array { + constructor(arg1, arg2, arg3) { + super(arg1, arg2, arg3); + } +} FastBuffer.prototype.constructor = Buffer; Buffer.prototype = FastBuffer.prototype; From 1a6e8983a6e3791e5dc8613a64389dc495cf9c13 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Fri, 23 Sep 2016 15:55:24 +0200 Subject: [PATCH 122/216] benchmark: add benchmarks for `Buffer.from()` Adds benchmarks for `Buffer.from()` and its various argument combinations. Ref: https://github.com/nodejs/node/issues/8733 PR-URL: https://github.com/nodejs/node/pull/8738 Reviewed-By: Ilkka Myller Reviewed-By: Luigi Pinca --- benchmark/buffers/buffer-from.js | 86 ++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 benchmark/buffers/buffer-from.js diff --git a/benchmark/buffers/buffer-from.js b/benchmark/buffers/buffer-from.js new file mode 100644 index 00000000000000..c35a0f23e06958 --- /dev/null +++ b/benchmark/buffers/buffer-from.js @@ -0,0 +1,86 @@ +'use strict'; + +const common = require('../common.js'); +const assert = require('assert'); +const bench = common.createBenchmark(main, { + source: [ + 'array', + 'arraybuffer', + 'arraybuffer-middle', + 'buffer', + 'uint8array', + 'string', + 'string-base64' + ], + len: [10, 2048], + n: [1024] +}); + +function main(conf) { + const len = +conf.len; + const n = +conf.n; + + const array = new Array(len).fill(42); + const arrayBuf = new ArrayBuffer(len); + const str = 'a'.repeat(len); + const buffer = Buffer.allocUnsafe(len); + const uint8array = new Uint8Array(len); + + var i; + + switch (conf.source) { + case 'array': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(array); + } + bench.end(n); + break; + case 'arraybuffer': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(arrayBuf); + } + bench.end(n); + break; + case 'arraybuffer-middle': + const offset = ~~(len / 4); + const length = ~~(len / 2); + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(arrayBuf, offset, length); + } + bench.end(n); + break; + case 'buffer': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(buffer); + } + bench.end(n); + break; + case 'uint8array': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(uint8array); + } + bench.end(n); + break; + case 'string': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(str); + } + bench.end(n); + break; + case 'string-base64': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(str, 'base64'); + } + bench.end(n); + break; + default: + assert.fail(null, null, 'Should not get here'); + } +} From 81ed50c5dad7ba821bbf1b51e638fff7fad6e052 Mon Sep 17 00:00:00 2001 From: Lauren Spiegel Date: Thu, 22 Sep 2016 20:13:00 -0700 Subject: [PATCH 123/216] test: add assertions to zero length buffer test 1) Add missing assertion that slicing a 0 length buffer does not throw 2) Add assertion that slicing a 0 length buffer has a length of 0 PR-URL: https://github.com/nodejs/node/pull/8729 Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Ilkka Myller Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- test/parallel/test-buffer-slice.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-buffer-slice.js b/test/parallel/test-buffer-slice.js index 4cd5feb6885138..133d056b17b0c7 100644 --- a/test/parallel/test-buffer-slice.js +++ b/test/parallel/test-buffer-slice.js @@ -52,7 +52,8 @@ assert.equal(buf.slice('0', '-111'), ''); // try to slice a zero length Buffer // see https://github.com/joyent/node/issues/5881 -Buffer.alloc(0).slice(0, 1); +assert.doesNotThrow(() => Buffer.alloc(0).slice(0, 1)); +assert.strictEqual(Buffer.alloc(0).slice(0, 1).length, 0); { // Single argument slice From 6ba8aa963e63a415d3d349c357b56da80d0b13da Mon Sep 17 00:00:00 2001 From: Lydia Katsamberis Date: Sat, 24 Sep 2016 13:58:24 -0700 Subject: [PATCH 124/216] test: changed var to const, added strict equal checks Changed var to const where appropriate. Substituted assert.strictEqual for assert.equal for better type checks. PR-URL: https://github.com/nodejs/node/pull/8762 Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Myles Borins Reviewed-By: Rich Trott Reviewed-By: James M Snell --- test/parallel/test-fs-read-stream-fd-leak.js | 33 +++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/test/parallel/test-fs-read-stream-fd-leak.js b/test/parallel/test-fs-read-stream-fd-leak.js index bac7d5c12166e7..45847270097348 100644 --- a/test/parallel/test-fs-read-stream-fd-leak.js +++ b/test/parallel/test-fs-read-stream-fd-leak.js @@ -1,17 +1,17 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); var openCount = 0; -var _fsopen = fs.open; -var _fsclose = fs.close; +const _fsopen = fs.open; +const _fsclose = fs.close; -var loopCount = 50; -var totalCheck = 50; -var emptyTxt = path.join(common.fixturesDir, 'empty.txt'); +const loopCount = 50; +const totalCheck = 50; +const emptyTxt = path.join(common.fixturesDir, 'empty.txt'); fs.open = function() { openCount++; @@ -29,20 +29,25 @@ function testLeak(endFn, callback) { var i = 0; var check = 0; - var checkFunction = function() { - if (openCount != 0 && check < totalCheck) { + const checkFunction = function() { + if (openCount !== 0 && check < totalCheck) { check++; setTimeout(checkFunction, 100); return; } - assert.equal(0, openCount, 'no leaked file descriptors using ' + - endFn + '() (got ' + openCount + ')'); + + assert.strictEqual( + 0, + openCount, + `no leaked file descriptors using ${endFn}() (got ${openCount})` + ); + openCount = 0; callback && setTimeout(callback, 100); }; setInterval(function() { - var s = fs.createReadStream(emptyTxt); + const s = fs.createReadStream(emptyTxt); s[endFn](); if (++i === loopCount) { From 9252e7a52d94d80e43fc23bc7293df6dd52cb8ce Mon Sep 17 00:00:00 2001 From: mpmckenna8 Date: Sat, 24 Sep 2016 15:46:26 -0700 Subject: [PATCH 125/216] test: cleanup parallel/test-fs-realpath.js Replaced .indexOf() with .includes() for more clarity as to what it is doing. Many of the instances of var changed to const. Instances of assert.equal() refactored to assert.strictEqual() or assert.ifError() Removed the unlinkSync() call in the exit event handler because it probably only handles files in the testing tmp directory so there is no need to unlink them. PR-URL: https://github.com/nodejs/node/pull/8769 Reviewed-By: Rich Trott Reviewed-By: Ilkka Myller --- test/parallel/test-fs-realpath.js | 121 +++++++++++++++--------------- 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js index 976ad92a6ea560..250837467d84eb 100644 --- a/test/parallel/test-fs-realpath.js +++ b/test/parallel/test-fs-realpath.js @@ -1,28 +1,29 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); -var exec = require('child_process').exec; +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const exec = require('child_process').exec; var async_completed = 0, async_expected = 0, unlink = []; var skipSymlinks = false; common.refreshTmpDir(); var root = '/'; -var assertEqualPath = assert.equal; +var assertEqualPath = assert.strictEqual; if (common.isWindows) { // something like "C:\\" root = process.cwd().substr(0, 3); assertEqualPath = function(path_left, path_right, message) { - assert.equal(path_left.toLowerCase(), path_right.toLowerCase(), message); + assert + .strictEqual(path_left.toLowerCase(), path_right.toLowerCase(), message); }; // On Windows, creating symlinks requires admin privileges. // We'll only try to run symlink test if we have enough privileges. try { exec('whoami /priv', function(err, o) { - if (err || o.indexOf('SeCreateSymbolicLinkPrivilege') == -1) { + if (err || !o.includes('SeCreateSymbolicLinkPrivilege')) { skipSymlinks = true; } runTest(); @@ -41,8 +42,8 @@ function tmp(p) { return path.join(common.tmpDir, p); } -var targetsAbsDir = path.join(common.tmpDir, 'targets'); -var tmpAbsDir = common.tmpDir; +const targetsAbsDir = path.join(common.tmpDir, 'targets'); +const tmpAbsDir = common.tmpDir; // Set up targetsAbsDir and expected subdirectories fs.mkdirSync(targetsAbsDir); @@ -91,7 +92,7 @@ function test_simple_relative_symlink(callback) { fs.symlinkSync(t[1], t[0], 'file'); unlink.push(t[0]); }); - var result = fs.realpathSync(entry); + const result = fs.realpathSync(entry); assertEqualPath(result, path.resolve(expected)); asynctest(fs.realpath, [entry], callback, function(err, result) { assertEqualPath(result, path.resolve(expected)); @@ -103,7 +104,7 @@ function test_simple_absolute_symlink(callback) { // this one should still run, even if skipSymlinks is set, // because it uses a junction. - var type = skipSymlinks ? 'junction' : 'dir'; + const type = skipSymlinks ? 'junction' : 'dir'; console.log('using type=%s', type); @@ -117,7 +118,7 @@ function test_simple_absolute_symlink(callback) { fs.symlinkSync(t[1], t[0], type); unlink.push(t[0]); }); - var result = fs.realpathSync(entry); + const result = fs.realpathSync(entry); assertEqualPath(result, path.resolve(expected)); asynctest(fs.realpath, [entry], callback, function(err, result) { assertEqualPath(result, path.resolve(expected)); @@ -131,16 +132,17 @@ function test_deep_relative_file_symlink(callback) { return runNextTest(); } - var expected = path.join(common.fixturesDir, 'cycles', 'root.js'); - var linkData1 = path.relative(path.join(targetsAbsDir, 'nested-index', 'one'), - expected); - var linkPath1 = path.join(targetsAbsDir, + const expected = path.join(common.fixturesDir, 'cycles', 'root.js'); + const linkData1 = path + .relative(path.join(targetsAbsDir, 'nested-index', 'one'), + expected); + const linkPath1 = path.join(targetsAbsDir, 'nested-index', 'one', 'symlink1.js'); try {fs.unlinkSync(linkPath1);} catch (e) {} fs.symlinkSync(linkData1, linkPath1, 'file'); - var linkData2 = '../one/symlink1.js'; - var entry = path.join(targetsAbsDir, + const linkData2 = '../one/symlink1.js'; + const entry = path.join(targetsAbsDir, 'nested-index', 'two', 'symlink1-b.js'); try {fs.unlinkSync(entry);} catch (e) {} fs.symlinkSync(linkData2, entry, 'file'); @@ -159,15 +161,15 @@ function test_deep_relative_dir_symlink(callback) { common.skip('symlink test (no privs)'); return runNextTest(); } - var expected = path.join(common.fixturesDir, 'cycles', 'folder'); - var path1b = path.join(targetsAbsDir, 'nested-index', 'one'); - var linkPath1b = path.join(path1b, 'symlink1-dir'); - var linkData1b = path.relative(path1b, expected); + const expected = path.join(common.fixturesDir, 'cycles', 'folder'); + const path1b = path.join(targetsAbsDir, 'nested-index', 'one'); + const linkPath1b = path.join(path1b, 'symlink1-dir'); + const linkData1b = path.relative(path1b, expected); try {fs.unlinkSync(linkPath1b);} catch (e) {} fs.symlinkSync(linkData1b, linkPath1b, 'dir'); - var linkData2b = '../one/symlink1-dir'; - var entry = path.join(targetsAbsDir, + const linkData2b = '../one/symlink1-dir'; + const entry = path.join(targetsAbsDir, 'nested-index', 'two', 'symlink12-dir'); try {fs.unlinkSync(entry);} catch (e) {} fs.symlinkSync(linkData2b, entry, 'dir'); @@ -187,7 +189,7 @@ function test_cyclic_link_protection(callback) { common.skip('symlink test (no privs)'); return runNextTest(); } - var entry = common.tmpDir + '/cycles/realpath-3a'; + const entry = common.tmpDir + '/cycles/realpath-3a'; [ [entry, '../cycles/realpath-3b'], [common.tmpDir + '/cycles/realpath-3b', '../cycles/realpath-3c'], @@ -210,10 +212,10 @@ function test_cyclic_link_overprotection(callback) { common.skip('symlink test (no privs)'); return runNextTest(); } - var cycles = common.tmpDir + '/cycles'; - var expected = fs.realpathSync(cycles); - var folder = cycles + '/folder'; - var link = folder + '/cycles'; + const cycles = common.tmpDir + '/cycles'; + const expected = fs.realpathSync(cycles); + const folder = cycles + '/folder'; + const link = folder + '/cycles'; var testPath = cycles; testPath += '/folder/cycles'.repeat(10); try {fs.unlinkSync(link);} catch (ex) {} @@ -233,26 +235,26 @@ function test_relative_input_cwd(callback) { } // we need to calculate the relative path to the tmp dir from cwd - var entrydir = process.cwd(); - var entry = path.relative(entrydir, + const entrydir = process.cwd(); + const entry = path.relative(entrydir, path.join(common.tmpDir + '/cycles/realpath-3a')); - var expected = common.tmpDir + '/cycles/root.js'; + const expected = common.tmpDir + '/cycles/root.js'; [ [entry, '../cycles/realpath-3b'], [common.tmpDir + '/cycles/realpath-3b', '../cycles/realpath-3c'], [common.tmpDir + '/cycles/realpath-3c', 'root.js'] ].forEach(function(t) { - var fn = t[0]; + const fn = t[0]; console.error('fn=%j', fn); try {fs.unlinkSync(fn);} catch (e) {} - var b = path.basename(t[1]); - var type = (b === 'root.js' ? 'file' : 'dir'); + const b = path.basename(t[1]); + const type = (b === 'root.js' ? 'file' : 'dir'); console.log('fs.symlinkSync(%j, %j, %j)', t[1], fn, type); fs.symlinkSync(t[1], fn, 'file'); unlink.push(fn); }); - var origcwd = process.cwd(); + const origcwd = process.cwd(); process.chdir(entrydir); assertEqualPath(fs.realpathSync(entry), path.resolve(expected)); asynctest(fs.realpath, [entry], callback, function(err, result) { @@ -282,7 +284,7 @@ function test_deep_symlink_mix(callback) { $tmpDir/targets/nested-index/two/realpath-c -> $tmpDir/cycles/root.js $tmpDir/targets/cycles/root.js (hard) */ - var entry = tmp('node-test-realpath-f1'); + const entry = tmp('node-test-realpath-f1'); try { fs.unlinkSync(tmp('node-test-realpath-d2/foo')); } catch (e) {} try { fs.rmdirSync(tmp('node-test-realpath-d2')); } catch (e) {} fs.mkdirSync(tmp('node-test-realpath-d2'), 0o700); @@ -306,7 +308,7 @@ function test_deep_symlink_mix(callback) { } finally { unlink.push(tmp('node-test-realpath-d2')); } - var expected = tmpAbsDir + '/cycles/root.js'; + const expected = tmpAbsDir + '/cycles/root.js'; assertEqualPath(fs.realpathSync(entry), path.resolve(expected)); asynctest(fs.realpath, [entry], callback, function(err, result) { assertEqualPath(result, path.resolve(expected)); @@ -316,10 +318,10 @@ function test_deep_symlink_mix(callback) { function test_non_symlinks(callback) { console.log('test_non_symlinks'); - var entrydir = path.dirname(tmpAbsDir); - var entry = tmpAbsDir.substr(entrydir.length + 1) + '/cycles/root.js'; - var expected = tmpAbsDir + '/cycles/root.js'; - var origcwd = process.cwd(); + const entrydir = path.dirname(tmpAbsDir); + const entry = tmpAbsDir.substr(entrydir.length + 1) + '/cycles/root.js'; + const expected = tmpAbsDir + '/cycles/root.js'; + const origcwd = process.cwd(); process.chdir(entrydir); assertEqualPath(fs.realpathSync(entry), path.resolve(expected)); asynctest(fs.realpath, [entry], callback, function(err, result) { @@ -329,7 +331,7 @@ function test_non_symlinks(callback) { }); } -var upone = path.join(process.cwd(), '..'); +const upone = path.join(process.cwd(), '..'); function test_escape_cwd(cb) { console.log('test_escape_cwd'); asynctest(fs.realpath, ['..'], cb, function(er, uponeActual) { @@ -338,7 +340,7 @@ function test_escape_cwd(cb) { ' actual:' + uponeActual); }); } -var uponeActual = fs.realpathSync('..'); +const uponeActual = fs.realpathSync('..'); assertEqualPath(upone, uponeActual, 'realpathSync("..") expected: ' + path.resolve(upone) + ' actual:' + uponeActual); @@ -375,11 +377,11 @@ function test_up_multiple(cb) { fs.symlinkSync('..', tmp('a/b/e'), 'dir'); unlink.push(tmp('a/b/e')); - var abedabed = tmp('abedabed'.split('').join('/')); - var abedabed_real = tmp(''); + const abedabed = tmp('abedabed'.split('').join('/')); + const abedabed_real = tmp(''); - var abedabeda = tmp('abedabeda'.split('').join('/')); - var abedabeda_real = tmp('a'); + const abedabeda = tmp('abedabeda'.split('').join('/')); + const abedabeda_real = tmp('a'); assertEqualPath(fs.realpathSync(abedabeda), abedabeda_real); assertEqualPath(fs.realpathSync(abedabed), abedabed_real); @@ -409,11 +411,11 @@ function test_abs_with_kids(cb) { // this one should still run, even if skipSymlinks is set, // because it uses a junction. - var type = skipSymlinks ? 'junction' : 'dir'; + const type = skipSymlinks ? 'junction' : 'dir'; console.log('using type=%s', type); - var root = tmpAbsDir + '/node-test-realpath-abs-kids'; + const root = tmpAbsDir + '/node-test-realpath-abs-kids'; function cleanup() { ['/a/b/c/x.txt', '/a/link' @@ -442,9 +444,9 @@ function test_abs_with_kids(cb) { fs.symlinkSync(root + '/a/b', root + '/a/link', type); } setup(); - var linkPath = root + '/a/link/c/x.txt'; - var expectPath = root + '/a/b/c/x.txt'; - var actual = fs.realpathSync(linkPath); + const linkPath = root + '/a/link/c/x.txt'; + const expectPath = root + '/a/b/c/x.txt'; + const actual = fs.realpathSync(linkPath); // console.log({link:linkPath,expect:expectPath,actual:actual},'sync'); assertEqualPath(actual, path.resolve(expectPath)); asynctest(fs.realpath, [linkPath], cb, function(er, actual) { @@ -456,7 +458,7 @@ function test_abs_with_kids(cb) { // ---------------------------------------------------------------------------- -var tests = [ +const tests = [ test_simple_error_callback, test_simple_relative_symlink, test_simple_absolute_symlink, @@ -471,11 +473,11 @@ var tests = [ test_abs_with_kids, test_up_multiple ]; -var numtests = tests.length; +const numtests = tests.length; var testsRun = 0; function runNextTest(err) { if (err) throw err; - var test = tests.shift(); + const test = tests.shift(); if (!test) { return console.log(numtests + ' subtests completed OK for fs.realpath'); @@ -487,13 +489,13 @@ function runNextTest(err) { assertEqualPath(root, fs.realpathSync('/')); fs.realpath('/', function(err, result) { - assert.equal(null, err); + assert.ifError(err); assertEqualPath(root, result); }); function runTest() { - var tmpDirs = ['cycles', 'cycles/folder']; + const tmpDirs = ['cycles', 'cycles/folder']; tmpDirs.forEach(function(t) { t = tmp(t); fs.mkdirSync(t, 0o700); @@ -506,6 +508,5 @@ function runTest() { process.on('exit', function() { assert.equal(numtests, testsRun); - unlink.forEach(function(path) { try {fs.unlinkSync(path);} catch (e) {} }); assert.equal(async_completed, async_expected); }); From f523b82c7b4e1b0199d632ee4e9ba0a87eca1a36 Mon Sep 17 00:00:00 2001 From: Jenna Vuong Date: Sat, 24 Sep 2016 20:44:36 -0700 Subject: [PATCH 126/216] test: cleanup parallel/test-file-write-stream2.js replace ==, !=, some instances of var, and assert.equal() PR-URL: https://github.com/nodejs/node/pull/8770 Reviewed-By: Colin Ihrig Reviewed-By: Teddy Katz Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Ilkka Myller --- test/parallel/test-file-write-stream2.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/parallel/test-file-write-stream2.js b/test/parallel/test-file-write-stream2.js index 6f0ccedb07aea1..69fdb7051ff11c 100644 --- a/test/parallel/test-file-write-stream2.js +++ b/test/parallel/test-file-write-stream2.js @@ -9,9 +9,9 @@ var fs = require('fs'); var filepath = path.join(common.tmpDir, 'write.txt'); var file; -var EXPECTED = '012345678910'; +const EXPECTED = '012345678910'; -var cb_expected = 'write open drain write drain close error '; +const cb_expected = 'write open drain write drain close error '; var cb_occurred = ''; var countDrains = 0; @@ -48,7 +48,7 @@ file = fs.createWriteStream(filepath, { file.on('open', function(fd) { console.error('open'); cb_occurred += 'open '; - assert.equal(typeof fd, 'number'); + assert.strictEqual(typeof fd, 'number'); }); file.on('drain', function() { @@ -57,12 +57,12 @@ file.on('drain', function() { ++countDrains; if (countDrains === 1) { console.error('drain=1, write again'); - assert.equal(fs.readFileSync(filepath, 'utf8'), EXPECTED); + assert.strictEqual(fs.readFileSync(filepath, 'utf8'), EXPECTED); console.error('ondrain write ret=%j', file.write(EXPECTED)); cb_occurred += 'write '; - } else if (countDrains == 2) { + } else if (countDrains === 2) { console.error('second drain, end'); - assert.equal(fs.readFileSync(filepath, 'utf8'), EXPECTED + EXPECTED); + assert.strictEqual(fs.readFileSync(filepath, 'utf8'), EXPECTED + EXPECTED); file.end(); } }); @@ -85,6 +85,6 @@ for (var i = 0; i < 11; i++) { console.error('%d %j', i, ret); // return false when i hits 10 - assert.strictEqual(ret, i != 10); + assert.strictEqual(ret, i !== 10); } cb_occurred += 'write '; From 5bd13a3d6cfeed0a08fd81faf85e6cdae446c045 Mon Sep 17 00:00:00 2001 From: nohmapp Date: Sat, 24 Sep 2016 14:09:26 -0700 Subject: [PATCH 127/216] test: cleanup parallel/test-fs-readfile-unlink.js Changes var to const, != to !==, and assert.equal() to assert.strict Equal() PR-URL: https://github.com/nodejs/node/pull/8764 Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Ilkka Myller --- test/parallel/test-fs-readfile-unlink.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-fs-readfile-unlink.js b/test/parallel/test-fs-readfile-unlink.js index 1be81b824c5468..5b1cbd14f9c4a4 100644 --- a/test/parallel/test-fs-readfile-unlink.js +++ b/test/parallel/test-fs-readfile-unlink.js @@ -5,21 +5,20 @@ const fs = require('fs'); const path = require('path'); const dirName = path.resolve(common.fixturesDir, 'test-readfile-unlink'); const fileName = path.resolve(dirName, 'test.bin'); - -var buf = Buffer.alloc(512 * 1024, 42); +const buf = Buffer.alloc(512 * 1024, 42); try { fs.mkdirSync(dirName); } catch (e) { // Ignore if the directory already exists. - if (e.code != 'EEXIST') throw e; + if (e.code !== 'EEXIST') throw e; } fs.writeFileSync(fileName, buf); fs.readFile(fileName, function(err, data) { assert.ifError(err); - assert.equal(data.length, buf.length); + assert.strictEqual(data.length, buf.length); assert.strictEqual(buf[0], 42); fs.unlinkSync(fileName); From 4699e3022b4ebaa980ee47f577904ca01420dd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 20 Sep 2016 07:54:35 +0300 Subject: [PATCH 128/216] doc: enable first-heading-level remark-lint rule This makes sure that the first heading in all markdown files is h1. Only three files needed to be changed to conform: 1. BUILDING.md 2. CODE_OF_CONDUCT.md 3. doc/onboarding-extras.md Also, .remarkrc is updated to include the `first-heading-level: 1` rule in order to catch similar issues in the future. PR-URL: https://github.com/nodejs/node/pull/8716 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- .remarkrc | 2 +- BUILDING.md | 2 +- CODE_OF_CONDUCT.md | 10 +++++----- doc/onboarding-extras.md | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.remarkrc b/.remarkrc index 143e9cdaaa8330..5244bd758c8363 100644 --- a/.remarkrc +++ b/.remarkrc @@ -13,7 +13,7 @@ "file-extension": "md", "final-definition": true, "final-newline": true, - "first-heading-level": false, + "first-heading-level": 1, "hard-break-spaces": true, "heading-increment": false, "heading-style": "atx", diff --git a/BUILDING.md b/BUILDING.md index 16663d60acc69e..3ffb2b51b29884 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,4 +1,4 @@ -## Building Node.js +# Building Node.js Depending on what platform or features you require, the build process may differ slightly. After you've successfully built a binary, running the diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c250585b816f48..4249ae1ca3ba47 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,6 +1,6 @@ -## Code of Conduct +# Code of Conduct -### Conduct +## Conduct * We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender @@ -38,17 +38,17 @@ documentation. There is no need to address persons when explaining code (e.g. "When the developer"). -### Contact +## Contact Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by: * Emailing [report@nodejs.org](mailto:report@nodejs.org) (this will email all TSC members) * Contacting [individual TSC members](https://nodejs.org/en/foundation/tsc/#current-members-of-the-technical-steering-committee). -### Moderation +## Moderation See the TSC's [moderation policy](https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md) for details about moderation. -### Attribution +## Attribution This Code of Conduct is adapted from [Rust's wonderful CoC](http://www.rust-lang.org/conduct.html) as well as the diff --git a/doc/onboarding-extras.md b/doc/onboarding-extras.md index 279bb386381755..30bc3226bb4ea1 100644 --- a/doc/onboarding-extras.md +++ b/doc/onboarding-extras.md @@ -1,3 +1,5 @@ +# Additional Onboarding Information + ## Who to CC in issues | subsystem | maintainers | From 76fd7db521f3eb3138f313cb5304b894362cdd34 Mon Sep 17 00:00:00 2001 From: Matt Lang Date: Sat, 17 Sep 2016 11:24:05 +0200 Subject: [PATCH 129/216] test: update var to const, use arrow functions PR-URL: https://github.com/nodejs/node/pull/8595 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-cluster-disconnect-idle-worker.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-cluster-disconnect-idle-worker.js b/test/parallel/test-cluster-disconnect-idle-worker.js index abb8f6710007f0..e3ad91ad10238e 100644 --- a/test/parallel/test-cluster-disconnect-idle-worker.js +++ b/test/parallel/test-cluster-disconnect-idle-worker.js @@ -1,13 +1,13 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var cluster = require('cluster'); -var fork = cluster.fork; +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); +const fork = cluster.fork; if (cluster.isMaster) { fork(); // it is intentionally called `fork` instead of fork(); // `cluster.fork` to test that `this` is not used - cluster.disconnect(common.mustCall(function() { + cluster.disconnect(common.mustCall(() => { assert.deepStrictEqual(Object.keys(cluster.workers), []); })); } From 2e95b0e24b9e409474733c7fbd63e720d19205a5 Mon Sep 17 00:00:00 2001 From: Alfred Cepeda Date: Sat, 24 Sep 2016 04:13:56 -0400 Subject: [PATCH 130/216] test: fixed FIXME in test-repl-persistent-history When NODE_REPL_HISTORY isn't defined `repl` defaults to temporary file This prevents the temporary file from being cleared and removes check on fixture Refs: https://github.com/nodejs/node/issues/4640 PR-URL: https://github.com/nodejs/node/pull/8756 Reviewed-By: Ilkka Myller Reviewed-By: Jeremiah Senkpiel --- test/parallel/test-repl-persistent-history.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/test/parallel/test-repl-persistent-history.js b/test/parallel/test-repl-persistent-history.js index 0a38cfc480c1ad..08ad7e965429d2 100644 --- a/test/parallel/test-repl-persistent-history.js +++ b/test/parallel/test-repl-persistent-history.js @@ -139,17 +139,7 @@ const tests = [ test: [UP, CLEAR, '\'42\'', ENTER], expected: [prompt, convertMsg, prompt, prompt + '\'=^.^=\'', prompt, '\'', '4', '2', '\'', '\'42\'\n', prompt, prompt], - after: function ensureHistoryFixture() { - // XXX(Fishrock123) Make sure nothing weird happened to our fixture - // or it's temporary copy. - // Sometimes this test used to erase the fixture and I'm not sure why. - const history = fs.readFileSync(historyFixturePath, 'utf8'); - assert.strictEqual(history, - '\'you look fabulous today\'\n\'Stay Fresh~\'\n'); - const historyCopy = fs.readFileSync(historyPath, 'utf8'); - assert.strictEqual(historyCopy, '\'you look fabulous today\'' + os.EOL + - '\'Stay Fresh~\'' + os.EOL); - } + clean: false }, { // Requires the above testcase env: {}, @@ -229,7 +219,7 @@ function runTest(assertCleaned) { const env = opts.env; const test = opts.test; const expected = opts.expected; - const after = opts.after; + const clean = opts.clean; const before = opts.before; if (before) before(); @@ -275,7 +265,7 @@ function runTest(assertCleaned) { }); function onClose() { - const cleaned = after ? after() : cleanupTmpFile(); + const cleaned = clean === false ? false : cleanupTmpFile(); try { // Ensure everything that we expected was output From 4fb051426ced206e65af288f01f91a24ce0e3734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Tue, 20 Sep 2016 15:12:23 +0300 Subject: [PATCH 131/216] doc: enable no-file-name-articles remark-lint rule This renames doc/topics/the-event-loop-timers-and-nexttick.md to doc/topics/event-loop-timers-and-nexttick.md, which looks like a better name for that file and enables no-file-name-articles remark-lint rule to prevent such names in the future. PR-URL: https://github.com/nodejs/node/pull/8713 Reviewed-By: Matteo Collina Reviewed-By: Ben Noordhuis Reviewed-By: Ilkka Myller Reviewed-By: James M Snell --- .remarkrc | 2 +- doc/api/timers.md | 2 +- doc/guides/timers-in-node.md | 6 +++--- ...rs-and-nexttick.md => event-loop-timers-and-nexttick.md} | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename doc/topics/{the-event-loop-timers-and-nexttick.md => event-loop-timers-and-nexttick.md} (100%) diff --git a/.remarkrc b/.remarkrc index 5244bd758c8363..b8cee4c2bb8651 100644 --- a/.remarkrc +++ b/.remarkrc @@ -30,7 +30,7 @@ "no-duplicate-definitions": true, "no-duplicate-headings": false, "no-emphasis-as-heading": false, - "no-file-name-articles": false, + "no-file-name-articles": true, "no-file-name-consecutive-dashes": true, "no-file-name-irregular-characters": false, "no-file-name-mixed-case": false, diff --git a/doc/api/timers.md b/doc/api/timers.md index 729a134171f7e4..75d6a36737b7d9 100644 --- a/doc/api/timers.md +++ b/doc/api/timers.md @@ -163,7 +163,7 @@ added: v0.0.1 Cancels a `Timeout` object created by [`setTimeout()`][]. -[the Node.js Event Loop]: https://github.com/nodejs/node/blob/master/doc/topics/the-event-loop-timers-and-nexttick.md +[the Node.js Event Loop]: https://github.com/nodejs/node/blob/master/doc/topics/event-loop-timers-and-nexttick.md [`TypeError`]: errors.html#errors_class_typeerror [`clearImmediate()`]: timers.html#timers_clearimmediate_immediate [`clearInterval()`]: timers.html#timers_clearinterval_timeout diff --git a/doc/guides/timers-in-node.md b/doc/guides/timers-in-node.md index d6a594e150feff..6cdbd35b21ffa7 100644 --- a/doc/guides/timers-in-node.md +++ b/doc/guides/timers-in-node.md @@ -10,7 +10,7 @@ period of time. Timers do not need to be imported via `require()`, since all the methods are available globally to emulate the browser JavaScript API. To fully understand when timer functions will be executed, it's a good idea to read up on the the Node.js -[Event Loop](../topics/the-event-loop-timers-and-nexttick). +[Event Loop](../topics/event-loop-timers-and-nexttick). ## Controlling the Time Continuum with Node.js @@ -96,7 +96,7 @@ some major ways they differ. The first is that `process.nextTick()` will run *before* any `Immediate`s that are set as well as before any scheduled I/O. The second is that `process.nextTick()` is non-clearable, meaning once code has been scheduled to execute with `process.nextTick()`, the execution -cannot be stopped, just like with a normal function. Refer to [this guide](../topics/the-event-loop-timers-and-nexttick#processnexttick) +cannot be stopped, just like with a normal function. Refer to [this guide](../topics/event-loop-timers-and-nexttick#processnexttick) to better understand the operation of `process.nextTick()`. ### "Infinite Loop" Execution ~ *`setInterval()`* @@ -189,4 +189,4 @@ There's much more to the Event Loop and Timers than this guide has covered. To learn more about the internals of the Node.js Event Loop and how Timers operate during execution, check out this Node.js guide: [The Node.js Event Loop, Timers, and -process.nextTick()](../topics/the-event-loop-timers-and-nexttick.md). +process.nextTick()](../topics/event-loop-timers-and-nexttick.md). diff --git a/doc/topics/the-event-loop-timers-and-nexttick.md b/doc/topics/event-loop-timers-and-nexttick.md similarity index 100% rename from doc/topics/the-event-loop-timers-and-nexttick.md rename to doc/topics/event-loop-timers-and-nexttick.md From e7c0f34f20b400791c7d27f12da1b4b6abaadc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Aur=C3=A8le=20DARCHE?= Date: Mon, 26 Sep 2016 21:01:24 +0200 Subject: [PATCH 132/216] doc: add added: info for crypto.timingSafeEqual() crypto.timingSafeEqual() has been added in v6.6.0 cf. #8304 This commit adds the metadata that will display "Added in: v6.6.0" and that can later be checked on https://nodejs.org/api/crypto.html#crypto_crypto_timingsafeequal_a_b PR-URL: https://github.com/nodejs/node/pull/8796 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Teddy Katz Reviewed-By: Anna Henningsen --- doc/api/crypto.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 133903ff4b0fe8..8b99eed1e27e0b 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1418,6 +1418,9 @@ keys: All paddings are defined in `crypto.constants`. ### crypto.timingSafeEqual(a, b) + Returns true if `a` is equal to `b`, without leaking timing information that would allow an attacker to guess one of the values. This is suitable for From 98e425eed43ec6268ea51f4a821a0ec59219918c Mon Sep 17 00:00:00 2001 From: yorkie Date: Mon, 26 Sep 2016 12:49:50 +0800 Subject: [PATCH 133/216] doc: fix title level at tls.md PR-URL: https://github.com/nodejs/node/pull/8782 Reviewed-By: James M Snell Reviewed-By: Teddy Katz Reviewed-By: Gibson Fahnestock --- doc/api/tls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/tls.md b/doc/api/tls.md index 3cacfeef64b8cd..c7daa8f181820e 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1191,7 +1191,7 @@ As with checking for the server [`secureConnection`](#tls_event_secureconnection event, `pair.cleartext.authorized` should be inspected to confirm whether the certificate used is properly authorized. -## tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) +### tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options]) -> Stability: 0 - Deprecated: Use [`fs.statSync()`][] or [`fs.accessSync()`][] -> instead. - * `path` {String | Buffer} Synchronous version of [`fs.exists()`][]. Returns `true` if the file exists, `false` otherwise. +Note that `fs.exists()` is deprecated, but `fs.existsSync()` is not. +(The `callback` parameter to `fs.exists()` accepts parameters that are +inconsistent with other Node.js callbacks. `fs.existsSync()` does not use +a callback.) + ## fs.fchmod(fd, mode, callback) @@ -18,6 +21,9 @@ also globally accessible. Used to handle binary data. See the [buffer section][]. ## \_\_dirname + @@ -45,6 +51,9 @@ References to `__dirname` within `b.js` will return will return `/Users/mjr/app`. ## \_\_filename + @@ -65,24 +74,36 @@ console.log(__filename); `__filename` isn't actually a global but rather local to each module. ## clearImmediate(immediateObject) + [`clearImmediate`] is described in the [timers][] section. ## clearInterval(intervalObject) + [`clearInterval`] is described in the [timers][] section. ## clearTimeout(timeoutObject) + [`clearTimeout`] is described in the [timers][] section. ## console + @@ -91,6 +112,9 @@ console.log(__filename); Used to print to stdout and stderr. See the [`console`][] section. ## exports + @@ -103,6 +127,9 @@ when to use `module.exports`. See the [module system documentation][] for more information. ## global + @@ -114,6 +141,9 @@ variable. In Node.js this is different. The top-level scope is not the global scope; `var something` inside an Node.js module will be local to that module. ## module + @@ -128,6 +158,9 @@ available through `require()`. See the [module system documentation][] for more information. ## process + @@ -136,6 +169,9 @@ See the [module system documentation][] for more information. The process object. See the [`process` object][] section. ## require() + @@ -145,6 +181,9 @@ To require modules. See the [Modules][] section. `require` isn't actually a global but rather local to each module. ### require.cache + * {Object} @@ -154,6 +193,10 @@ this does not apply to [native addons][], for which reloading will result in an Error. ### require.extensions + > Stability: 0 - Deprecated @@ -178,23 +221,35 @@ away. However, it may have subtle bugs and complexities that are best left untouched. ### require.resolve() + Use the internal `require()` machinery to look up the location of a module, but rather than loading the module, just return the resolved filename. ## setImmediate(callback[, ...args]) + [`setImmediate`] is described in the [timers][] section. ## setInterval(callback, delay[, ...args]) + [`setInterval`] is described in the [timers][] section. ## setTimeout(callback, delay[, ...args]) + From 9b0733fd49e3b226f1e62b049ca98ac4ee6a91aa Mon Sep 17 00:00:00 2001 From: Wyatt Preul Date: Thu, 29 Sep 2016 10:56:15 -0500 Subject: [PATCH 194/216] test: run faster and cleanup after run PR-URL: https://github.com/nodejs/node/pull/8848 Reviewed-By: James M Snell Reviewed-By: Fedor Indutny Reviewed-By: Matthew Loring Reviewed-By: Ilkka Myller --- test/fixtures/tick-processor-base.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/test/fixtures/tick-processor-base.js b/test/fixtures/tick-processor-base.js index 8e0005ff7d8b99..ca67a0f7e967b4 100644 --- a/test/fixtures/tick-processor-base.js +++ b/test/fixtures/tick-processor-base.js @@ -7,7 +7,7 @@ const path = require('path'); common.refreshTmpDir(); const LOG_FILE = path.join(common.tmpDir, 'tick-processor.log'); -const RETRY_TIMEOUT = 750; +const RETRY_TIMEOUT = 150; function runTest(test) { const proc = cp.spawn(process.execPath, [ @@ -16,7 +16,7 @@ function runTest(test) { '--prof', '-pe', test.code ], { - stdio: [ null, 'pipe', 'inherit' ] + stdio: [ 'ignore', 'pipe', 'inherit' ] }); let ticks = ''; @@ -37,19 +37,25 @@ function match(pattern, parent, ticks) { '--call-graph-size=10', LOG_FILE ], { - stdio: [ null, 'pipe', 'inherit' ] + stdio: [ 'ignore', 'pipe', 'inherit' ] }); let out = ''; proc.stdout.on('data', chunk => out += chunk); - proc.stdout.on('end', () => { - // Retry after timeout - if (!pattern.test(out)) - return setTimeout(() => match(pattern, parent, ticks), RETRY_TIMEOUT); + proc.stdout.once('end', () => { + proc.once('exit', () => { + fs.unlinkSync(LOG_FILE); - parent.kill('SIGTERM'); + // Retry after timeout + if (!pattern.test(out)) + return setTimeout(() => match(pattern, parent, ticks), RETRY_TIMEOUT); - fs.unlinkSync(LOG_FILE); + parent.stdout.removeAllListeners(); + parent.kill(); + }); + + proc.stdout.removeAllListeners(); + proc.kill(); }); } From c4d9b54f75dc8bd492354a0880714f7a8a8b4ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=BA=D0=BE=D0=B2=D0=BE=D1=80=D0=BE=D0=B4=D0=B0=20?= =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=90=D0=BD=D0=B4=D1=80?= =?UTF-8?q?=D0=B5=D0=B5=D0=B2=D0=B8=D1=87?= Date: Fri, 23 Sep 2016 23:55:53 +0300 Subject: [PATCH 195/216] dgram: use Buffer.alloc(0) for zero-size buffers There is no difference between alloc(0) and allocUnsafe(0), so there is no reason to confuse anyone reading the code with an additional call to allocUnsafe. PR-URL: https://github.com/nodejs/node/pull/8751 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Ilkka Myller Reviewed-By: Anna Henningsen --- lib/dgram.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dgram.js b/lib/dgram.js index c088bffa7ff477..31be3ce881ed22 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -353,7 +353,7 @@ Socket.prototype.send = function(buffer, self.bind({port: 0, exclusive: true}, null); if (list.length === 0) - list.push(Buffer.allocUnsafe(0)); + list.push(Buffer.alloc(0)); // If the socket hasn't been bound yet, push the outbound packet onto the // send queue and send after binding is complete. From b579fcab45ca466aaa41cfac9f7754074f19fd5f Mon Sep 17 00:00:00 2001 From: Alfred Cepeda Date: Sat, 24 Sep 2016 07:26:05 -0400 Subject: [PATCH 196/216] test: remove FIXME pummel/test-tls-securepair-client Reverts: 85827bd Using `common.PORT` no longer causes other tests to fail Refs: https://github.com/nodejs/node/issues/4640 PR-URL: https://github.com/nodejs/node/pull/8757 Reviewed-By: James M Snell Reviewed-By: Ilkka Myller Reviewed-By: Luigi Pinca --- test/pummel/test-tls-securepair-client.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/pummel/test-tls-securepair-client.js b/test/pummel/test-tls-securepair-client.js index 5dd2af65b2ba5f..7a1b8770132e96 100644 --- a/test/pummel/test-tls-securepair-client.js +++ b/test/pummel/test-tls-securepair-client.js @@ -39,12 +39,6 @@ function test2() { } function test(keyfn, certfn, check, next) { - // FIXME: Avoid the common PORT as this test currently hits a C-level - // assertion error with node_g. The program aborts without HUPing - // the openssl s_server thus causing many tests to fail with - // EADDRINUSE. - var PORT = common.PORT + 5; - keyfn = join(common.fixturesDir, keyfn); var key = fs.readFileSync(keyfn).toString(); @@ -52,7 +46,7 @@ function test(keyfn, certfn, check, next) { var cert = fs.readFileSync(certfn).toString(); var server = spawn(common.opensslCli, ['s_server', - '-accept', PORT, + '-accept', common.PORT, '-cert', certfn, '-key', keyfn]); server.stdout.pipe(process.stdout); @@ -121,7 +115,7 @@ function test(keyfn, certfn, check, next) { pair.encrypted.pipe(s); s.pipe(pair.encrypted); - s.connect(PORT); + s.connect(common.PORT); s.on('connect', function() { console.log('client connected'); From 5c10898e313dfe39d101e2bd0b522df2beb3f452 Mon Sep 17 00:00:00 2001 From: Ojas Shirekar Date: Fri, 23 Sep 2016 20:01:04 +0530 Subject: [PATCH 197/216] buffer: fix check for `.buffer` property isSharedArrayBuffer in fromObject was missing obj.buffer moved the 'length' in obj check so that it is checked first making the code slightly more performant and able to handle SharedArrayBuffer without relying on an explicit check. Ref: https://github.com/nodejs/node/pull/8510 PR-URL: https://github.com/nodejs/node/pull/8739 Reviewed-By: Ilkka Myller Reviewed-By: Anna Henningsen --- lib/buffer.js | 4 ++-- test/parallel/test-buffer-sharedarraybuffer.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/buffer.js b/lib/buffer.js index 75b13eec968938..f4dfba860feaad 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -246,8 +246,8 @@ function fromObject(obj) { } if (obj) { - if (isArrayBuffer(obj.buffer) || 'length' in obj || - isSharedArrayBuffer(obj)) { + if ('length' in obj || isArrayBuffer(obj.buffer) || + isSharedArrayBuffer(obj.buffer)) { if (typeof obj.length !== 'number' || obj.length !== obj.length) { return new FastBuffer(); } diff --git a/test/parallel/test-buffer-sharedarraybuffer.js b/test/parallel/test-buffer-sharedarraybuffer.js index 47b3a59b8653d0..f1bac72079b313 100644 --- a/test/parallel/test-buffer-sharedarraybuffer.js +++ b/test/parallel/test-buffer-sharedarraybuffer.js @@ -27,3 +27,5 @@ assert.deepStrictEqual(arr_buf, ar_buf, 0); // Checks for calling Buffer.byteLength on a SharedArrayBuffer assert.strictEqual(Buffer.byteLength(sab), sab.byteLength, 0); + +assert.doesNotThrow(() => Buffer.from({buffer: sab})); From 313a45da24854b1903054d268d871c11ae704db9 Mon Sep 17 00:00:00 2001 From: Adri Van Houdt Date: Sat, 17 Sep 2016 11:55:51 +0200 Subject: [PATCH 198/216] lib: changed var to const in linkedlist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/8609 Reviewed-By: Brian White Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Michaël Zasso --- lib/internal/linkedlist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/linkedlist.js b/lib/internal/linkedlist.js index d50e3415aa4b54..15f06c0efe8f05 100644 --- a/lib/internal/linkedlist.js +++ b/lib/internal/linkedlist.js @@ -24,7 +24,7 @@ exports.peek = peek; // remove the most idle item from the list function shift(list) { - var first = list._idlePrev; + const first = list._idlePrev; remove(first); return first; } From 2fad4d29b094adbe3a31b3867029bdcaa74a1ff9 Mon Sep 17 00:00:00 2001 From: Christopn Noelke Date: Sat, 17 Sep 2016 11:03:04 +0200 Subject: [PATCH 199/216] doc: add example for file existence with fs.stat Add an example on how to test if a file exists with fs.stat. Also add a link to the Common System Errors. Fixes: https://github.com/nodejs/issues/6752 PR-URL: https://github.com/nodejs/node/pull/8585 Reviewed-By: James M Snell Reviewed-By: Ilkka Myller --- doc/api/fs.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index fef4516958df5b..5cb4b9f422e9fb 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1524,6 +1524,16 @@ Asynchronous stat(2). The callback gets two arguments `(err, stats)` where `stats` is a [`fs.Stats`][] object. See the [`fs.Stats`][] section for more information. +In case of an error, the `err.code` will be one of [Common System Errors][]. + +Using `fs.stat()` to check for the existence of a file before calling +`fs.open()`, `fs.readFile()` or `fs.writeFile()` is not recommended. +Instead, user code should open/read/write the file directly and handle the +error raised if the file is not available. + +To check if a file exists without manipulating it afterwards, [`fs.access()`] +is recommended. + ## fs.statSync(path)