summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request')
-rw-r--r--deps/npm/node_modules/request/.travis.yml10
-rw-r--r--deps/npm/node_modules/request/CHANGELOG.md34
-rw-r--r--deps/npm/node_modules/request/CONTRIBUTING.md45
-rw-r--r--deps/npm/node_modules/request/README.md10
-rwxr-xr-xdeps/npm/node_modules/request/index.js11
-rw-r--r--deps/npm/node_modules/request/lib/helpers.js6
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/.npmignore3
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/README.md4
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/aws4.js11
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/example.js371
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore1
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml8
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS14
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md55
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js533
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE15
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md60
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js9
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json77
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js113
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js86
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore4
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml7
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md4
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE15
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md204
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json77
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js188
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js360
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json61
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js396
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js120
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js51
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js215
-rw-r--r--deps/npm/node_modules/request/node_modules/aws4/package.json104
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/.travis.yml5
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/README.md6
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/bl.js90
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore5
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml52
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml1
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE18
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md36
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown1760
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md58
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js75
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js26
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js880
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js180
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js516
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE19
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md3
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch604
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js107
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json88
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js68
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore1
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml4
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile5
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md60
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json19
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js5
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json98
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js19
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml12
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js20
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md19
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json73
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md18
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js24
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore2
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE20
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md7
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js221
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json81
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md16
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE24
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md53
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js67
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js6
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json83
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json105
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js12
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/package.json52
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/test/basic-test.js557
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/test/sauce.js38
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/test/test.js643
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/.dockerignore7
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/.editorconfig10
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/.eslintignore1
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/Readme.md10
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/lib/browser.js3
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js305
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/lib/populate.js9
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/package.json150
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/wercker.yml36
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json103
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json44
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json149
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md4
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js21
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json38
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json36
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js18
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js2
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js6
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json32
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md2
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json36
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js3
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js2
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS6
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md14
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md162
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js211
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json107
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json46
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md53
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt9
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md66
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js74
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js4
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js72
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js2
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json67
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json36
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md8
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/README.md2
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md14
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json29
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json69
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/package.json49
-rw-r--r--deps/npm/node_modules/request/node_modules/oauth-sign/index.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/oauth-sign/package.json98
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md5
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/bower.json1
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/component.json2
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/dist/qs.js9
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/lib/stringify.js9
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/package.json50
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/test/stringify.js24
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js4
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/package.json42
-rw-r--r--deps/npm/node_modules/request/package.json67
-rw-r--r--deps/npm/node_modules/request/request.js69
149 files changed, 9813 insertions, 2942 deletions
diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml
index c24c59b5d5..e5d9bde262 100644
--- a/deps/npm/node_modules/request/.travis.yml
+++ b/deps/npm/node_modules/request/.travis.yml
@@ -1,15 +1,19 @@
language: node_js
+
node_js:
- node
- - io.js
- 0.12
- 0.10
-sudo: false
-after_script: "npm run test-cov && cat ./coverage/lcov.info | codecov && cat ./coverage/lcov.info | coveralls"
+after_script:
+ - npm run test-cov
+ - cat ./coverage/lcov.info | codecov
+ - cat ./coverage/lcov.info | coveralls
webhooks:
urls: https://webhooks.gitter.im/e/237280ed4796c19cc626
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
+
+sudo: false
diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md
index 86386a9ae5..ce6826f2f6 100644
--- a/deps/npm/node_modules/request/CHANGELOG.md
+++ b/deps/npm/node_modules/request/CHANGELOG.md
@@ -1,5 +1,34 @@
## Change Log
+### 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)
+- [#2172](https://github.com/request/request/pull/2172) Add support for deflate content encoding (@czardoz)
+- [#2169](https://github.com/request/request/pull/2169) Add callback option (@simov)
+- [#2165](https://github.com/request/request/pull/2165) Check for self.req existence inside the write method (@simov)
+- [#2167](https://github.com/request/request/pull/2167) Fix TravisCI badge reference master branch (@a0viedo)
+
+### v2.71.0 (2016/04/12)
+- [#2164](https://github.com/request/request/pull/2164) Catch errors from the underlying http module (@simov)
+
+### v2.70.0 (2016/04/05)
+- [#2147](https://github.com/request/request/pull/2147) Update eslint to version 2.5.3 🚀 (@simov, @greenkeeperio-bot)
+- [#2009](https://github.com/request/request/pull/2009) Support JSON stringify replacer argument. (@elyobo)
+- [#2142](https://github.com/request/request/pull/2142) Update eslint to version 2.5.1 🚀 (@greenkeeperio-bot)
+- [#2128](https://github.com/request/request/pull/2128) Update browserify-istanbul to version 2.0.0 🚀 (@greenkeeperio-bot)
+- [#2115](https://github.com/request/request/pull/2115) Update eslint to version 2.3.0 🚀 (@simov, @greenkeeperio-bot)
+- [#2089](https://github.com/request/request/pull/2089) Fix badges (@simov)
+- [#2092](https://github.com/request/request/pull/2092) Update browserify-istanbul to version 1.0.0 🚀 (@greenkeeperio-bot)
+- [#2079](https://github.com/request/request/pull/2079) Accept read stream as body option (@simov)
+- [#2070](https://github.com/request/request/pull/2070) Update bl to version 1.1.2 🚀 (@greenkeeperio-bot)
+- [#2063](https://github.com/request/request/pull/2063) Up bluebird and oauth-sign (@simov)
+- [#2058](https://github.com/request/request/pull/2058) Karma fixes for latest versions (@eiriksm)
+- [#2057](https://github.com/request/request/pull/2057) Update contributing guidelines (@simov)
+- [#2054](https://github.com/request/request/pull/2054) Update qs to version 6.1.0 🚀 (@greenkeeperio-bot)
+
+### v2.69.0 (2016/01/27)
+- [#2041](https://github.com/request/request/pull/2041) restore aws4 as regular dependency (@rmg)
+
### v2.68.0 (2016/01/27)
- [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods)
- [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross)
@@ -85,7 +114,8 @@
- [#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)
@@ -470,7 +500,7 @@
- [#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.18.0 (2013/04/22)
+### 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/CONTRIBUTING.md b/deps/npm/node_modules/request/CONTRIBUTING.md
index 06b1968d97..8aa6999acd 100644
--- a/deps/npm/node_modules/request/CONTRIBUTING.md
+++ b/deps/npm/node_modules/request/CONTRIBUTING.md
@@ -1,19 +1,57 @@
-# This is an OPEN Open Source Project
+
+# Contributing to Request
+
+:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
+
+The following is a set of guidelines for contributing to Request and its packages, which are hosted in the [Request Organization](https://github.com/request) on GitHub.
+These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
+
+
+## Submitting an Issue
+
+1. Provide a small self **sufficient** code example to **reproduce** the issue.
+2. Run your test code using [request-debug](https://github.com/request/request-debug) and copy/paste the results inside the issue.
+3. You should **always** use fenced code blocks when submitting code examples or any other formatted output:
+ <pre>
+ ```js
+ put your javascript code here
+ ```
+
+ ```
+ put any other formatted output here,
+ like for example the one returned from using request-debug
+ ```
+ </pre>
+
+If the problem cannot be reliably reproduced, the issue will be marked as `Not enough info (see CONTRIBUTING.md)`.
+
+If the problem is not related to request the issue will be marked as `Help (please use Stackoverflow)`.
+
+
+## Submitting a Pull Request
+
+1. In almost all of the cases your PR **needs tests**. Make sure you have any.
+2. Run `npm test` locally. Fix any errors before pushing to GitHub.
+3. After submitting the PR a build will be triggered on TravisCI. Wait for it to ends and make sure all jobs are passing.
+
-----------------------------------------
-## What?
+
+## Becoming a Contributor
Individuals making significant and valuable contributions are given
commit-access to the project to contribute as they see fit. This project is
more like an open wiki than a standard guarded open source project.
+
## Rules
There are a few basic ground-rules for contributors:
1. **No `--force` pushes** or modifying the Git history in any way.
1. **Non-master branches** ought to be used for ongoing work.
+1. **Any** change should be added through Pull Request.
1. **External API changes and significant modifications** ought to be subject
to an **internal pull-request** to solicit feedback from other contributors.
1. Internal pull-requests to solicit feedback are *encouraged* for any other
@@ -35,10 +73,9 @@ There are a few basic ground-rules for contributors:
Declaring formal releases remains the prerogative of the project maintainer.
+
## Changes to this arrangement
This is an experiment and feedback is welcome! This document may also be
subject to pull-requests or changes by contributors where you believe you have
something valuable to add or change.
-
------------------------------------------
diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md
index 6ee45b205d..cf9072a21a 100644
--- a/deps/npm/node_modules/request/README.md
+++ b/deps/npm/node_modules/request/README.md
@@ -3,10 +3,11 @@
[![npm package](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/)
-[![Build status](https://img.shields.io/travis/request/request.svg?style=flat-square)](https://travis-ci.org/request/request)
+[![Build status](https://img.shields.io/travis/request/request/master.svg?style=flat-square)](https://travis-ci.org/request/request)
[![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master)
[![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request)
[![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request)
+[![Known Vulnerabilities](https://snyk.io/test/npm/request/badge.svg?style=flat-square)](https://snyk.io/test/npm/request)
[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge)
@@ -733,7 +734,7 @@ The first argument can be either a `url` or an `options` object. The only requir
---
-- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object.
+- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.
- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above.
- `formData` - Data to pass for a `multipart/form-data` request. See
[Forms](#forms) section above.
@@ -748,6 +749,7 @@ The first argument can be either a `url` or an `options` object. The only requir
- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.
- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.
- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.
+- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.
---
@@ -812,6 +814,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]).
- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's `elapsedTime` property.
- `har` - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)*
+- `callback` - alternatively pass the request's callback in the options object
The callback argument gets 3 arguments:
@@ -886,12 +889,13 @@ Same as `request()`, but defaults to `method: "HEAD"`.
request.head(url)
```
-### request.del
+### request.del / request.delete
Same as `request()`, but defaults to `method: "DELETE"`.
```js
request.del(url)
+request.delete(url)
```
### request.get
diff --git a/deps/npm/node_modules/request/index.js b/deps/npm/node_modules/request/index.js
index 4d0c748da5..911a90dbb5 100755
--- a/deps/npm/node_modules/request/index.js
+++ b/deps/npm/node_modules/request/index.js
@@ -37,7 +37,7 @@ function initParams(uri, options, callback) {
extend(params, uri)
}
- params.callback = callback
+ params.callback = callback || params.callback
return params
}
@@ -56,7 +56,7 @@ function request (uri, options, callback) {
}
function verbFunc (verb) {
- var method = verb === 'del' ? 'DELETE' : verb.toUpperCase()
+ var method = verb.toUpperCase()
return function (uri, options, callback) {
var params = initParams(uri, options, callback)
params.method = method
@@ -70,7 +70,8 @@ request.head = verbFunc('head')
request.post = verbFunc('post')
request.put = verbFunc('put')
request.patch = verbFunc('patch')
-request.del = verbFunc('del')
+request.del = verbFunc('delete')
+request['delete'] = verbFunc('delete')
request.jar = function (store) {
return cookies.jar(store)
@@ -91,7 +92,7 @@ function wrapRequestMethod (method, options, requester, verb) {
target.pool = params.pool || options.pool
if (verb) {
- target.method = (verb === 'del' ? 'DELETE' : verb.toUpperCase())
+ target.method = verb.toUpperCase()
}
if (isFunction(requester)) {
@@ -114,7 +115,7 @@ request.defaults = function (options, requester) {
var defaults = wrapRequestMethod(self, options, requester)
- var verbs = ['get', 'head', 'post', 'put', 'patch', 'del']
+ var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
verbs.forEach(function(verb) {
defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
})
diff --git a/deps/npm/node_modules/request/lib/helpers.js b/deps/npm/node_modules/request/lib/helpers.js
index 5e8594606f..356ff748e2 100644
--- a/deps/npm/node_modules/request/lib/helpers.js
+++ b/deps/npm/node_modules/request/lib/helpers.js
@@ -24,12 +24,12 @@ function paramsHaveRequestBody(params) {
)
}
-function safeStringify (obj) {
+function safeStringify (obj, replacer) {
var ret
try {
- ret = JSON.stringify(obj)
+ ret = JSON.stringify(obj, replacer)
} catch (e) {
- ret = jsonSafeStringify(obj)
+ ret = jsonSafeStringify(obj, replacer)
}
return ret
}
diff --git a/deps/npm/node_modules/request/node_modules/aws4/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/.npmignore
index ccafa6b412..6c6ade6ff0 100644
--- a/deps/npm/node_modules/request/node_modules/aws4/.npmignore
+++ b/deps/npm/node_modules/request/node_modules/aws4/.npmignore
@@ -1,3 +1,4 @@
test
-coverage
examples
+example.js
+browser
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 068a07a835..ec663e9237 100644
--- a/deps/npm/node_modules/request/node_modules/aws4/README.md
+++ b/deps/npm/node_modules/request/node_modules/aws4/README.md
@@ -6,6 +6,8 @@ aws4
A small utility to sign vanilla node.js http(s) request options using Amazon's
[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).
+Can also be used [in the browser](./browser).
+
This signature is supported by nearly all Amazon services, including
[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),
[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
@@ -497,6 +499,8 @@ With [npm](http://npmjs.org/) do:
npm install aws4
```
+Can also be used [in the browser](./browser).
+
Thanks
------
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 3ef54a468f..71e08bbc17 100644
--- a/deps/npm/node_modules/request/node_modules/aws4/aws4.js
+++ b/deps/npm/node_modules/request/node_modules/aws4/aws4.js
@@ -43,8 +43,13 @@ function RequestSigner(request, credentials) {
if (!request.method && request.body)
request.method = 'POST'
- if (!headers.Host && !headers.host)
+ if (!headers.Host && !headers.host) {
headers.Host = request.hostname || request.host || this.createHost()
+
+ // If a port is specified explicitly, use it as is
+ if (request.port)
+ headers.Host += ':' + request.port
+ }
if (!request.hostname && !request.host)
request.hostname = headers.Host || headers.host
}
@@ -210,8 +215,7 @@ RequestSigner.prototype.canonicalString = function() {
}
if (pathStr !== '/') {
if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
- if (pathStr[0] === '/') pathStr = pathStr.slice(1)
- pathStr = '/' + pathStr.split('/').reduce(function(path, piece) {
+ pathStr = pathStr.split('/').reduce(function(path, piece) {
if (normalizePath && piece === '..') {
path.pop()
} else if (!normalizePath || piece !== '.') {
@@ -220,6 +224,7 @@ RequestSigner.prototype.canonicalString = function() {
}
return path
}, []).join('/')
+ if (pathStr[0] !== '/') pathStr = '/' + pathStr
if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
}
diff --git a/deps/npm/node_modules/request/node_modules/aws4/example.js b/deps/npm/node_modules/request/node_modules/aws4/example.js
deleted file mode 100644
index 5d075409d5..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/example.js
+++ /dev/null
@@ -1,371 +0,0 @@
-var http = require('http'),
- https = require('https'),
- aws4 = require('aws4')
-
-// given an options object you could pass to http.request
-var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
-
-// alternatively (as aws4 can infer the host):
-opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
-
-// alternatively (as us-east-1 is default):
-opts = {service: 'sqs', path: '/?Action=ListQueues'}
-
-aws4.sign(opts) // assumes AWS credentials are available in process.env
-
-console.log(opts)
-/*
-{
- host: 'sqs.us-east-1.amazonaws.com',
- path: '/?Action=ListQueues',
- headers: {
- Host: 'sqs.us-east-1.amazonaws.com',
- 'X-Amz-Date': '20121226T061030Z',
- Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
- }
-}
-*/
-
-// we can now use this to query AWS using the standard node.js http API
-http.request(opts, function(res) { res.pipe(process.stdout) }).end()
-/*
-<?xml version="1.0"?>
-<ListQueuesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
-...
-*/
-
-// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
-aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
-
-// can also add the signature to query strings
-aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
-
-// create a utility function to pipe to stdout (with https this time)
-function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
-
-// aws4 can infer the HTTP method if a body is passed in
-// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
-request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
-/*
-<ListGroupsResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
-...
-*/
-
-// can specify any custom option or header as per usual
-request(aws4.sign({
- service: 'dynamodb',
- region: 'ap-southeast-2',
- method: 'POST',
- path: '/',
- headers: {
- 'Content-Type': 'application/x-amz-json-1.0',
- 'X-Amz-Target': 'DynamoDB_20120810.ListTables'
- },
- body: '{}'
-}))
-/*
-{"TableNames":[]}
-...
-*/
-
-// works with all other services that support Signature Version 4
-
-request(aws4.sign({service: 's3', path: '/', signQuery: true}))
-/*
-<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
-...
-*/
-
-request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
-/*
-<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
-...
-*/
-
-request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
-/*
-<ListTopicsResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
-...
-*/
-
-request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
-/*
-<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
-...
-*/
-
-request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
-/*
-<ListDomainNamesResponse xmlns="http://cloudsearch.amazonaws.com/doc/2013-01-01/">
-...
-*/
-
-request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
-/*
-<ListIdentitiesResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
-...
-*/
-
-request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
-/*
-<DescribeAutoScalingInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/">
-...
-*/
-
-request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
-/*
-<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
-...
-*/
-
-request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
-/*
-<ListStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
-...
-*/
-
-request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
-/*
-<ListAvailableSolutionStacksResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
-...
-*/
-
-request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
-/*
-<DescribeDBInstancesResponse xmlns="http://rds.amazonaws.com/doc/2012-09-17/">
-...
-*/
-
-request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
-/*
-<ListMetricsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
-...
-*/
-
-request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
-/*
-<DescribeClustersResponse xmlns="http://redshift.amazonaws.com/doc/2012-12-01/">
-...
-*/
-
-request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
-/*
-<DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2014-05-31/">
-...
-*/
-
-request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
-/*
-<DescribeCacheClustersResponse xmlns="http://elasticache.amazonaws.com/doc/2014-07-15/">
-...
-*/
-
-request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
-/*
-<DescribeJobFlowsResponse xmlns="http://elasticmapreduce.amazonaws.com/doc/2009-03-31">
-...
-*/
-
-request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
-/*
-<ListHostedZonesResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
-...
-*/
-
-request(aws4.sign({service: 'appstream', path: '/applications'}))
-/*
-{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
-...
-*/
-
-request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
-/*
-{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
-...
-*/
-
-request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
-/*
-{"NextPageToken":null,"Pipelines":[]}
-...
-*/
-
-request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
-/*
-{"Functions":[],"NextMarker":null}
-...
-*/
-
-request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
-/*
-<ListClustersResponse xmlns="http://ecs.amazonaws.com/doc/2014-11-13/">
-...
-*/
-
-request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
-/*
-{"Marker":null,"VaultList":[]}
-...
-*/
-
-request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
-}}))
-/*
-{"Gateways":[]}
-...
-*/
-
-request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'DataPipeline.ListPipelines'
-}}))
-/*
-{"hasMoreResults":false,"pipelineIdList":[]}
-...
-*/
-
-request(aws4.sign({service: 'opsworks', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
-}}))
-/*
-{"Stacks":[]}
-...
-*/
-
-request(aws4.sign({service: 'route53domains', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
-}}))
-/*
-{"Domains":[]}
-...
-*/
-
-request(aws4.sign({service: 'kinesis', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'Kinesis_20131202.ListStreams'
-}}))
-/*
-{"HasMoreStreams":false,"StreamNames":[]}
-...
-*/
-
-request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
-}}))
-/*
-{"trailList":[]}
-...
-*/
-
-request(aws4.sign({service: 'logs', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
-}}))
-/*
-{"logGroups":[]}
-...
-*/
-
-request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
-}}))
-/*
-{"applications":[]}
-...
-*/
-
-request(aws4.sign({service: 'directconnect', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'OvertureService.DescribeConnections'
-}}))
-/*
-{"connections":[]}
-...
-*/
-
-request(aws4.sign({service: 'kms', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'TrentService.ListKeys'
-}}))
-/*
-{"Keys":[],"Truncated":false}
-...
-*/
-
-request(aws4.sign({service: 'config', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
-}}))
-/*
-{"DeliveryChannels":[]}
-...
-*/
-
-request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
-}}))
-/*
-{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
-...
-*/
-
-request(aws4.sign({
- service: 'swf',
- body: '{"registrationStatus":"REGISTERED"}',
- headers: {
- 'Content-Type': 'application/x-amz-json-1.0',
- 'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
- }
-}))
-/*
-{"domainInfos":[]}
-...
-*/
-
-request(aws4.sign({
- service: 'cognito-identity',
- body: '{"MaxResults": 1}',
- headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
- }
-}))
-/*
-{"IdentityPools":[]}
-...
-*/
-
-request(aws4.sign({
- service: 'mobileanalytics',
- path: '/2014-06-05/events',
- body: JSON.stringify({events:[{
- eventType: 'a',
- timestamp: new Date().toISOString(),
- session: {},
- }]}),
- headers: {
- 'Content-Type': 'application/json',
- 'X-Amz-Client-Context': JSON.stringify({
- client: {client_id: 'a', app_title: 'a'},
- custom: {},
- env: {platform: 'a'},
- services: {},
- }),
- }
-}))
-/*
-(HTTP 202, empty response)
-*/
-
-// Still not updated to v4...
-
-//request(aws4.sign({service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01'}))
-
-//request(aws4.sign({service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15'}))
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore
deleted file mode 100644
index 07e6e472cc..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-/node_modules
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml
deleted file mode 100644
index 4af02b3d17..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/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/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS
deleted file mode 100644
index 4a0bc5033a..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS
+++ /dev/null
@@ -1,14 +0,0 @@
-# Authors, sorted by whether or not they are me
-Isaac Z. Schlueter <i@izs.me>
-Brian Cottingham <spiffytech@gmail.com>
-Carlos Brito Lage <carlos@carloslage.net>
-Jesse Dailey <jesse.dailey@gmail.com>
-Kevin O'Hara <kevinohara80@gmail.com>
-Marco Rogers <marco.rogers@gmail.com>
-Mark Cavage <mcavage@gmail.com>
-Marko Mikulicic <marko.mikulicic@isti.cnr.it>
-Nathan Rajlich <nathan@tootallnate.net>
-Satheesh Natesan <snateshan@myspace-inc.com>
-Trent Mick <trentm@gmail.com>
-ashleybrener <ashley@starlogik.com>
-n4kz <n4kz@n4kz.com>
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
index c06814e041..1bc7b03f3e 100644
--- 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
@@ -2,12 +2,14 @@
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) { return n * 2 }
+ , length: function (n, key) { return n * 2 + key.length }
, dispose: function (key, n) { n.close() }
, maxAge: 1000 * 60 * 60 }
, cache = LRU(options)
@@ -16,6 +18,12 @@ var LRU = require("lru-cache")
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
```
@@ -24,24 +32,6 @@ 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
@@ -53,9 +43,10 @@ console.log(cache.get(a)) // prints: 'this is b'
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.
+ 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
@@ -76,8 +67,12 @@ console.log(cache.get(a)) // prints: 'this is b'
* `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.
+ 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)`
@@ -107,6 +102,12 @@ console.log(cache.get(a)) // prints: 'this is b'
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.
@@ -115,7 +116,7 @@ console.log(cache.get(a)) // prints: 'this is b'
Return an array of the values in the cache.
-* `length()`
+* `length`
Return total length of objects in cache taking into account
`length` options function.
@@ -135,3 +136,7 @@ console.log(cache.get(a)) // prints: 'this is b'
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
index 2bbe653be8..e98ef78a53 100644
--- 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
@@ -1,225 +1,353 @@
-;(function () { // closure for web browsers
-
-if (typeof module === 'object' && module.exports) {
- module.exports = LRUCache
+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 {
- // just set the global for non-node platforms.
- this.LRUCache = LRUCache
+ makeSymbol = function (key) {
+ return '_' + key
+ }
}
-function hOP (obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, 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 }
-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)
- }
-}
-
+// 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))
+ if (!(this instanceof LRUCache)) {
return new LRUCache(options)
+ }
- if (typeof options === 'number')
+ if (typeof options === 'number') {
options = { max: options }
+ }
- if (!options)
+ if (!options) {
options = {}
+ }
- this._max = options.max
+ var max = priv(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
+ if (!max ||
+ !(typeof max === 'number') ||
+ max <= 0) {
+ priv(this, 'max', Infinity)
+ }
- this._lengthCalculator = options.length || naiveLength
- if (typeof this._lengthCalculator !== "function")
- this._lengthCalculator = naiveLength
+ var lc = options.length || naiveLength
+ if (typeof lc !== 'function') {
+ lc = naiveLength
+ }
+ priv(this, 'lengthCalculator', lc)
- this._allowStale = options.stale || false
- this._maxAge = options.maxAge || null
- this._dispose = options.dispose
+ 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
- this._max = mL
- if (this._length > this._max) trim(this)
+Object.defineProperty(LRUCache.prototype, 'max', {
+ set: function (mL) {
+ if (!mL || !(typeof mL === 'number') || mL <= 0) {
+ mL = Infinity
}
- , get : function () { return this._max }
- , enumerable : true
- })
+ 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") {
- 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)
+Object.defineProperty(LRUCache.prototype, 'lengthCalculator', {
+ set: function (lC) {
+ if (typeof lC !== 'function') {
+ lC = naiveLength
}
- , get : function () { return this._lengthCalculator }
- , enumerable : true
- })
-
-Object.defineProperty(LRUCache.prototype, "length",
- { get : function () { return this._length }
- , enumerable : true
- })
-
+ 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
+ }
+}
-Object.defineProperty(LRUCache.prototype, "itemCount",
- { get : function () { return this._itemCount }
- , enumerable : true
- })
+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
- 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)
- }
+ for (var walker = priv(this, 'lruList').head; walker !== null;) {
+ var next = walker.next
+ forEachStep(this, fn, walker, thisp)
+ walker = next
}
}
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
+ return priv(this, 'lruList').toArray().map(function (k) {
+ return k.key
+ }, this)
}
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
+ return priv(this, 'lruList').toArray().map(function (k) {
+ return k.value
+ }, this)
}
LRUCache.prototype.reset = function () {
- if (this._dispose && this._cache) {
- for (var k in this._cache) {
- this._dispose(k, this._cache[k].value)
- }
+ 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)
}
- 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
+ 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 () {
- 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]
+ return priv(this, 'lruList').map(function (hit) {
if (!isStale(this, hit)) {
- //Do not store staled hits
- ++i
- arr.push({
+ return {
k: hit.key,
v: hit.value,
e: hit.now + (hit.maxAge || 0)
- });
+ }
}
- }
- //arr has the most read first
- return arr
+ }, this).toArray().filter(function (h) {
+ return h
+ })
}
LRUCache.prototype.dumpLru = function () {
- return this._lruList
+ 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 || this._maxAge
- typeCheckKey(key)
+ maxAge = maxAge || priv(this, 'maxAge')
var now = maxAge ? Date.now() : 0
- var len = this._lengthCalculator(value)
+ var len = priv(this, 'lengthCalculator').call(this, value, key)
- if (hOP(this._cache, key)) {
- if (len > this._max) {
- del(this, this._cache[key])
+ if (priv(this, 'cache').has(key)) {
+ if (len > priv(this, 'max')) {
+ del(this, priv(this, 'cache').get(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)
+ 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, this._mru++, len, now, maxAge)
+ var hit = new Entry(key, value, len, now, maxAge)
// oversized objects fall out of cache automatically.
- if (hit.length > this._max) {
- if (this._dispose) this._dispose(key, value)
+ if (hit.length > priv(this, 'max')) {
+ if (priv(this, 'dispose')) {
+ priv(this, 'dispose').call(this, 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)
-
+ 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) {
- typeCheckKey(key)
- if (!hOP(this._cache, key)) return false
- var hit = this._cache[key]
+ if (!priv(this, 'cache').has(key)) return false
+ var hit = priv(this, 'cache').get(key).value
if (isStale(this, hit)) {
return false
}
@@ -227,108 +355,115 @@ LRUCache.prototype.has = function (key) {
}
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
+ var node = priv(this, 'lruList').tail
+ if (!node) return null
+ del(this, node)
+ return node.value
}
LRUCache.prototype.del = function (key) {
- typeCheckKey(key)
- del(this, this._cache[key])
+ del(this, priv(this, 'cache').get(key))
}
LRUCache.prototype.load = function (arr) {
- //reset the cache
- this.reset();
+ // 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-- ) {
+ // 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
+ // 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)
+ // 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) {
- typeCheckKey(key)
- var hit = self._cache[key]
- if (hit) {
+ var node = priv(self, 'cache').get(key)
+ if (node) {
+ var hit = node.value
if (isStale(self, hit)) {
- del(self, hit)
- if (!self._allowStale) hit = undefined
+ del(self, node)
+ if (!priv(self, 'allowStale')) hit = undefined
} else {
- if (doUse) use(self, hit)
+ if (doUse) {
+ priv(self, 'lruList').unshiftNode(node)
+ }
}
if (hit) hit = hit.value
}
return hit
}
-function isStale(self, hit) {
- if (!hit || (!hit.maxAge && !self._maxAge)) return false
- var stale = false;
+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 = self._maxAge && (diff > self._maxAge)
+ stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge'))
}
- return stale;
-}
-
-function use (self, hit) {
- shiftLU(self, hit)
- hit.lu = self._mru ++
- self._lruList[hit.lu] = hit
+ return stale
}
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 ++
+ 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, 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)
+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, lu, length, now, maxAge) {
+function Entry (key, value, length, now, maxAge) {
this.key = key
this.value = value
- this.lu = lu
this.length = length
this.now = now
- if (maxAge) this.maxAge = maxAge
+ 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
new file mode 100644
index 0000000000..19129e315f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE
@@ -0,0 +1,15 @@
+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
new file mode 100644
index 0000000000..778bf01dfa
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md
@@ -0,0 +1,60 @@
+# 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
new file mode 100644
index 0000000000..7db1599461
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js
@@ -0,0 +1,9 @@
+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
new file mode 100644
index 0000000000..8e1129b8d3
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json
@@ -0,0 +1,77 @@
+{
+ "_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
new file mode 100644
index 0000000000..25a21d829e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js
@@ -0,0 +1,113 @@
+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
new file mode 100644
index 0000000000..4378e4541e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js
@@ -0,0 +1,86 @@
+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
new file mode 100644
index 0000000000..534108e3f4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..9c1a7b6ccd
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml
@@ -0,0 +1,7 @@
+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
new file mode 100644
index 0000000000..5f51e6f1e5
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 0000000000..19129e315f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE
@@ -0,0 +1,15 @@
+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
new file mode 100644
index 0000000000..f586101869
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md
@@ -0,0 +1,204 @@
+# 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
new file mode 100644
index 0000000000..a1c290b52f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json
@@ -0,0 +1,77 @@
+{
+ "_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
new file mode 100644
index 0000000000..3c8d1f48d9
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js
@@ -0,0 +1,188 @@
+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
new file mode 100644
index 0000000000..fb60fc2878
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js
@@ -0,0 +1,360 @@
+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
index 501c3e735f..fafc088e72 100644
--- 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
@@ -1,37 +1,41 @@
{
"_args": [
[
- "lru-cache@^2.6.5",
+ "lru-cache@^4.0.0",
"/Users/rebecca/code/npm/node_modules/request/node_modules/aws4"
]
],
- "_from": "lru-cache@>=2.6.5 <3.0.0",
- "_id": "lru-cache@2.7.3",
+ "_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": "4.0.0",
+ "_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.3.2",
+ "_npmVersion": "3.7.3",
"_phantomChildren": {},
"_requested": {
"name": "lru-cache",
- "raw": "lru-cache@^2.6.5",
- "rawSpec": "^2.6.5",
+ "raw": "lru-cache@^4.0.0",
+ "rawSpec": "^4.0.0",
"scope": null,
- "spec": ">=2.6.5 <3.0.0",
+ "spec": ">=4.0.0 <5.0.0",
"type": "range"
},
"_requiredBy": [
"/request/aws4"
],
- "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
- "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
+ "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz",
+ "_shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be",
"_shrinkwrap": null,
- "_spec": "lru-cache@^2.6.5",
+ "_spec": "lru-cache@^4.0.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4",
"author": {
"email": "i@izs.me",
@@ -40,34 +44,40 @@
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
- "dependencies": {},
+ "dependencies": {
+ "pseudomap": "^1.0.1",
+ "yallist": "^2.0.0"
+ },
"description": "A cache object that deletes the least-recently-used items.",
"devDependencies": {
- "tap": "^1.2.0",
- "weak": ""
+ "standard": "^5.4.1",
+ "tap": "^5.1.1"
},
"directories": {},
"dist": {
- "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
- "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
+ "shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be",
+ "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz"
},
- "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714",
+ "files": [
+ "lib/lru-cache.js"
+ ],
+ "gitHead": "6cd8c8a43cf56c585bdb696faae94f9836cb9e28",
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
"keywords": [
- "cache",
+ "mru",
"lru",
- "mru"
+ "cache"
],
"license": "ISC",
"main": "lib/lru-cache.js",
"maintainers": [
{
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
+ "email": "isaacs@npmjs.com",
+ "name": "isaacs"
},
{
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
+ "email": "ogd@aoaioxxysz.net",
+ "name": "othiym23"
}
],
"name": "lru-cache",
@@ -78,7 +88,8 @@
"url": "git://github.com/isaacs/node-lru-cache.git"
},
"scripts": {
- "test": "tap test --gc"
+ "posttest": "standard test/*.js lib/*.js",
+ "test": "tap test --branches=100 --functions=100 --lines=100 --statements=100"
},
- "version": "2.7.3"
+ "version": "4.0.1"
}
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js
deleted file mode 100644
index b47225f109..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/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/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js
deleted file mode 100644
index 4190417cbc..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/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/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js
deleted file mode 100644
index b5912f6f16..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/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/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js
deleted file mode 100644
index 5fe5dc3d37..0000000000
--- a/deps/npm/node_modules/request/node_modules/aws4/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/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json
index 31de63b47c..5e7ae9de2d 100644
--- a/deps/npm/node_modules/request/node_modules/aws4/package.json
+++ b/deps/npm/node_modules/request/node_modules/aws4/package.json
@@ -6,16 +6,20 @@
]
],
"_from": "aws4@>=1.2.1 <2.0.0",
- "_id": "aws4@1.2.1",
+ "_id": "aws4@1.3.2",
"_inCache": true,
"_installable": true,
"_location": "/request/aws4",
- "_nodeVersion": "4.2.4",
+ "_nodeVersion": "4.3.1",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/aws4-1.3.2.tgz_1456871543899_0.13955276948399842"
+ },
"_npmUser": {
"email": "michael.hart.au@gmail.com",
"name": "hichaelmart"
},
- "_npmVersion": "2.14.15",
+ "_npmVersion": "2.14.21",
"_phantomChildren": {},
"_requested": {
"name": "aws4",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz",
- "_shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
+ "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz",
+ "_shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1",
"_shrinkwrap": null,
"_spec": "aws4@^1.2.1",
"_where": "/Users/rebecca/code/npm/node_modules/request",
@@ -42,78 +46,78 @@
"url": "https://github.com/mhart/aws4/issues"
},
"dependencies": {
- "lru-cache": "^2.6.5"
+ "lru-cache": "^4.0.0"
},
"description": "Signs and prepares requests using AWS Signature Version 4",
"devDependencies": {
- "mocha": "^2.2.5",
- "should": "^7.0.1"
+ "mocha": "^2.4.5",
+ "should": "^8.2.2"
},
"directories": {},
"dist": {
- "shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
- "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz"
+ "shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1",
+ "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz"
},
- "gitHead": "3d8a3a06a8415bd5255b4f60eb91576952e97f5c",
+ "gitHead": "e899db3aacbf2a034398f7dd483345dc793e8d72",
"homepage": "https://github.com/mhart/aws4#readme",
"keywords": [
"amazon",
- "appstream",
- "autoscaling",
"aws",
+ "signature",
+ "s3",
+ "ec2",
+ "autoscaling",
"cloudformation",
- "cloudfront",
- "cloudhsm",
+ "elasticloadbalancing",
+ "elb",
+ "elasticbeanstalk",
"cloudsearch",
- "cloudtrail",
- "cloudwatch",
- "codedeploy",
- "cognito",
- "cognitoidentity",
- "cognitosync",
- "config",
- "containerservice",
+ "dynamodb",
+ "kinesis",
+ "lambda",
+ "glacier",
+ "sqs",
+ "sns",
+ "iam",
+ "sts",
+ "ses",
+ "swf",
+ "storagegateway",
"datapipeline",
"directconnect",
- "dynamodb",
- "ec2",
- "ecs",
+ "redshift",
+ "opsworks",
+ "rds",
+ "monitoring",
+ "cloudtrail",
+ "cloudfront",
+ "codedeploy",
"elasticache",
- "elasticbeanstalk",
- "elasticloadbalancing",
"elasticmapreduce",
"elastictranscoder",
- "elb",
"emr",
- "glacier",
- "iam",
+ "cloudwatch",
+ "mobileanalytics",
+ "cognitoidentity",
+ "cognitosync",
+ "cognito",
+ "containerservice",
+ "ecs",
+ "appstream",
"keymanagementservice",
- "kinesis",
"kms",
- "lambda",
- "logs",
- "mobileanalytics",
- "monitoring",
- "opsworks",
- "rds",
- "redshift",
+ "config",
+ "cloudhsm",
"route53",
"route53domains",
- "s3",
- "ses",
- "signature",
- "sns",
- "sqs",
- "storagegateway",
- "sts",
- "swf"
+ "logs"
],
"license": "MIT",
"main": "aws4.js",
"maintainers": [
{
- "name": "hichaelmart",
- "email": "michael.hart.au@gmail.com"
+ "email": "michael.hart.au@gmail.com",
+ "name": "hichaelmart"
}
],
"name": "aws4",
@@ -126,5 +130,5 @@
"scripts": {
"test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list"
},
- "version": "1.2.1"
+ "version": "1.3.2"
}
diff --git a/deps/npm/node_modules/request/node_modules/bl/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/.travis.yml
index e431a1bd0c..5cb0480b45 100644
--- a/deps/npm/node_modules/request/node_modules/bl/.travis.yml
+++ b/deps/npm/node_modules/request/node_modules/bl/.travis.yml
@@ -2,8 +2,9 @@ sudo: false
language: node_js
node_js:
- '0.10'
- - node
- - iojs
+ - '0.12'
+ - '4'
+ - '5'
branches:
only:
- master
diff --git a/deps/npm/node_modules/request/node_modules/bl/README.md b/deps/npm/node_modules/request/node_modules/bl/README.md
index 4d87866aa1..f7044db26e 100644
--- a/deps/npm/node_modules/request/node_modules/bl/README.md
+++ b/deps/npm/node_modules/request/node_modules/bl/README.md
@@ -96,7 +96,7 @@ bl.pipe(fs.createWriteStream('gibberish.txt'))
--------------------------------------------------------
<a name="ctor"></a>
-### new BufferList([ callback | buffer | buffer array ])
+### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
@@ -120,8 +120,8 @@ Get the length of the list in bytes. This is the sum of the lengths of all of th
--------------------------------------------------------
<a name="append"></a>
-### bl.append(buffer)
-`append(buffer)` adds an additional buffer or BufferList to the internal list.
+### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
+`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
--------------------------------------------------------
<a name="get"></a>
diff --git a/deps/npm/node_modules/request/node_modules/bl/bl.js b/deps/npm/node_modules/request/node_modules/bl/bl.js
index b979ba82e4..f585df1721 100644
--- a/deps/npm/node_modules/request/node_modules/bl/bl.js
+++ b/deps/npm/node_modules/request/node_modules/bl/bl.js
@@ -1,6 +1,7 @@
var DuplexStream = require('readable-stream/duplex')
, util = require('util')
+
function BufferList (callback) {
if (!(this instanceof BufferList))
return new BufferList(callback)
@@ -11,34 +12,31 @@ function BufferList (callback) {
if (typeof callback == 'function') {
this._callback = callback
- var piper = function (err) {
+ var piper = function piper (err) {
if (this._callback) {
this._callback(err)
this._callback = null
}
}.bind(this)
- this.on('pipe', function (src) {
+ this.on('pipe', function onPipe (src) {
src.on('error', piper)
})
- this.on('unpipe', function (src) {
+ this.on('unpipe', function onUnpipe (src) {
src.removeListener('error', piper)
})
- }
- else if (Buffer.isBuffer(callback))
+ } else {
this.append(callback)
- else if (Array.isArray(callback)) {
- callback.forEach(function (b) {
- Buffer.isBuffer(b) && this.append(b)
- }.bind(this))
}
DuplexStream.call(this)
}
+
util.inherits(BufferList, DuplexStream)
-BufferList.prototype._offset = function (offset) {
+
+BufferList.prototype._offset = function _offset (offset) {
var tot = 0, i = 0, _t
for (; i < this._bufs.length; i++) {
_t = tot + this._bufs[i].length
@@ -48,35 +46,52 @@ BufferList.prototype._offset = function (offset) {
}
}
-BufferList.prototype.append = function (buf) {
- var isBuffer = Buffer.isBuffer(buf) ||
- buf instanceof BufferList
- // coerce number arguments to strings, since Buffer(number) does
- // uninitialized memory allocation
- if (typeof buf == 'number')
- buf = buf.toString()
+BufferList.prototype.append = function append (buf) {
+ var i = 0
+ , newBuf
+
+ if (Array.isArray(buf)) {
+ for (; i < buf.length; i++)
+ this.append(buf[i])
+ } else if (buf instanceof BufferList) {
+ // unwrap argument into individual BufferLists
+ for (; i < buf._bufs.length; i++)
+ this.append(buf._bufs[i])
+ } else if (buf != null) {
+ // coerce number arguments to strings, since Buffer(number) does
+ // uninitialized memory allocation
+ if (typeof buf == 'number')
+ buf = buf.toString()
+
+ newBuf = Buffer.isBuffer(buf) ? buf : new Buffer(buf)
+ this._bufs.push(newBuf)
+ this.length += newBuf.length
+ }
- this._bufs.push(isBuffer ? buf : new Buffer(buf))
- this.length += buf.length
return this
}
-BufferList.prototype._write = function (buf, encoding, callback) {
+
+BufferList.prototype._write = function _write (buf, encoding, callback) {
this.append(buf)
- if (callback)
+
+ if (typeof callback == 'function')
callback()
}
-BufferList.prototype._read = function (size) {
+
+BufferList.prototype._read = function _read (size) {
if (!this.length)
return this.push(null)
+
size = Math.min(size, this.length)
this.push(this.slice(0, size))
this.consume(size)
}
-BufferList.prototype.end = function (chunk) {
+
+BufferList.prototype.end = function end (chunk) {
DuplexStream.prototype.end.call(this, chunk)
if (this._callback) {
@@ -85,15 +100,18 @@ BufferList.prototype.end = function (chunk) {
}
}
-BufferList.prototype.get = function (index) {
+
+BufferList.prototype.get = function get (index) {
return this.slice(index, index + 1)[0]
}
-BufferList.prototype.slice = function (start, end) {
+
+BufferList.prototype.slice = function slice (start, end) {
return this.copy(null, 0, start, end)
}
-BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
+
+BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
if (typeof srcStart != 'number' || srcStart < 0)
srcStart = 0
if (typeof srcEnd != 'number' || srcEnd > this.length)
@@ -156,13 +174,13 @@ BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
return dst
}
-BufferList.prototype.toString = function (encoding, start, end) {
+BufferList.prototype.toString = function toString (encoding, start, end) {
return this.slice(start, end).toString(encoding)
}
-BufferList.prototype.consume = function (bytes) {
+BufferList.prototype.consume = function consume (bytes) {
while (this._bufs.length) {
- if (bytes > this._bufs[0].length) {
+ if (bytes >= this._bufs[0].length) {
bytes -= this._bufs[0].length
this.length -= this._bufs[0].length
this._bufs.shift()
@@ -175,7 +193,8 @@ BufferList.prototype.consume = function (bytes) {
return this
}
-BufferList.prototype.duplicate = function () {
+
+BufferList.prototype.duplicate = function duplicate () {
var i = 0
, copy = new BufferList()
@@ -185,12 +204,14 @@ BufferList.prototype.duplicate = function () {
return copy
}
-BufferList.prototype.destroy = function () {
- this._bufs.length = 0;
- this.length = 0;
- this.push(null);
+
+BufferList.prototype.destroy = function destroy () {
+ this._bufs.length = 0
+ this.length = 0
+ this.push(null)
}
+
;(function () {
var methods = {
'readDoubleBE' : 8
@@ -218,4 +239,5 @@ BufferList.prototype.destroy = function () {
}
}())
+
module.exports = BufferList
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore
new file mode 100644
index 0000000000..38344f87a6
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore
@@ -0,0 +1,5 @@
+build/
+test/
+examples/
+fs.js
+zlib.js \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml
new file mode 100644
index 0000000000..1b82118460
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml
@@ -0,0 +1,52 @@
+sudo: false
+language: node_js
+before_install:
+ - npm install -g npm@2
+ - npm install -g npm
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ allow_failures:
+ - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest"
+ - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest"
+ include:
+ - node_js: '0.8'
+ env: TASK=test
+ - node_js: '0.10'
+ env: TASK=test
+ - node_js: '0.11'
+ env: TASK=test
+ - node_js: '0.12'
+ env: TASK=test
+ - node_js: 1
+ env: TASK=test
+ - node_js: 2
+ env: TASK=test
+ - node_js: 3
+ env: TASK=test
+ - node_js: 4
+ env: TASK=test
+ - node_js: 5
+ env: TASK=test
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest"
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest"
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest"
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest"
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest"
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest"
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest"
+ - node_js: 5
+ env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest"
+script: "npm run $TASK"
+env:
+ global:
+ - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
+ - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml
new file mode 100644
index 0000000000..96d9cfbd38
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml
@@ -0,0 +1 @@
+ui: tape
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
new file mode 100644
index 0000000000..e3d4e695a4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
@@ -0,0 +1,18 @@
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..1a67c48cd0
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md
@@ -0,0 +1,36 @@
+# readable-stream
+
+***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
+
+
+[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
+
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
+
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core, including [documentation](doc/stream.markdown).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+# Streams WG Team Members
+
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;
+ - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;
+ - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;
+ - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
new file mode 100644
index 0000000000..0bc3819e63
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
@@ -0,0 +1,1760 @@
+# Stream
+
+ Stability: 2 - Stable
+
+A stream is an abstract interface implemented by various objects in
+Node.js. For example a [request to an HTTP server][http-incoming-message] is a
+stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All
+streams are instances of [`EventEmitter`][].
+
+You can load the Stream base classes by doing `require('stream')`.
+There are base classes provided for [Readable][] streams, [Writable][]
+streams, [Duplex][] streams, and [Transform][] streams.
+
+This document is split up into 3 sections:
+
+1. The first section explains the parts of the API that you need to be
+ aware of to use streams in your programs.
+2. The second section explains the parts of the API that you need to
+ use if you implement your own custom streams yourself. The API is designed to
+ make this easy for you to do.
+3. The third section goes into more depth about how streams work,
+ including some of the internal mechanisms and functions that you
+ should probably not modify unless you definitely know what you are
+ doing.
+
+
+## API for Stream Consumers
+
+<!--type=misc-->
+
+Streams can be either [Readable][], [Writable][], or both ([Duplex][]).
+
+All streams are EventEmitters, but they also have other custom methods
+and properties depending on whether they are Readable, Writable, or
+Duplex.
+
+If a stream is both Readable and Writable, then it implements all of
+the methods and events. So, a [Duplex][] or [Transform][] stream is
+fully described by this API, though their implementation may be
+somewhat different.
+
+It is not necessary to implement Stream interfaces in order to consume
+streams in your programs. If you **are** implementing streaming
+interfaces in your own program, please also refer to
+[API for Stream Implementors][].
+
+Almost all Node.js programs, no matter how simple, use Streams in some
+way. Here is an example of using Streams in an Node.js program:
+
+```js
+const http = require('http');
+
+var server = http.createServer( (req, res) => {
+ // req is an http.IncomingMessage, which is a Readable Stream
+ // res is an http.ServerResponse, which is a Writable Stream
+
+ var body = '';
+ // we want to get the data as utf8 strings
+ // If you don't set an encoding, then you'll get Buffer objects
+ req.setEncoding('utf8');
+
+ // Readable streams emit 'data' events once a listener is added
+ req.on('data', (chunk) => {
+ body += chunk;
+ });
+
+ // the end event tells you that you have entire body
+ req.on('end', () => {
+ try {
+ var data = JSON.parse(body);
+ } catch (er) {
+ // uh oh! bad json!
+ res.statusCode = 400;
+ return res.end(`error: ${er.message}`);
+ }
+
+ // write back something interesting to the user:
+ res.write(typeof data);
+ res.end();
+ });
+});
+
+server.listen(1337);
+
+// $ curl localhost:1337 -d '{}'
+// object
+// $ curl localhost:1337 -d '"foo"'
+// string
+// $ curl localhost:1337 -d 'not json'
+// error: Unexpected token o
+```
+
+### Class: stream.Duplex
+
+Duplex streams are streams that implement both the [Readable][] and
+[Writable][] interfaces.
+
+Examples of Duplex streams include:
+
+* [TCP sockets][]
+* [zlib streams][zlib]
+* [crypto streams][crypto]
+
+### Class: stream.Readable
+
+<!--type=class-->
+
+The Readable stream interface is the abstraction for a *source* of
+data that you are reading from. In other words, data comes *out* of a
+Readable stream.
+
+A Readable stream will not start emitting data until you indicate that
+you are ready to receive it.
+
+Readable streams have two "modes": a **flowing mode** and a **paused
+mode**. When in flowing mode, data is read from the underlying system
+and provided to your program as fast as possible. In paused mode, you
+must explicitly call [`stream.read()`][stream-read] to get chunks of data out.
+Streams start out in paused mode.
+
+**Note**: If no data event handlers are attached, and there are no
+[`stream.pipe()`][] destinations, and the stream is switched into flowing
+mode, then data will be lost.
+
+You can switch to flowing mode by doing any of the following:
+
+* Adding a [`'data'`][] event handler to listen for data.
+* Calling the [`stream.resume()`][stream-resume] method to explicitly open the
+ flow.
+* Calling the [`stream.pipe()`][] method to send the data to a [Writable][].
+
+You can switch back to paused mode by doing either of the following:
+
+* If there are no pipe destinations, by calling the
+ [`stream.pause()`][stream-pause] method.
+* If there are pipe destinations, by removing any [`'data'`][] event
+ handlers, and removing all pipe destinations by calling the
+ [`stream.unpipe()`][] method.
+
+Note that, for backwards compatibility reasons, removing [`'data'`][]
+event handlers will **not** automatically pause the stream. Also, if
+there are piped destinations, then calling [`stream.pause()`][stream-pause] will
+not guarantee that the stream will *remain* paused once those
+destinations drain and ask for more data.
+
+Examples of readable streams include:
+
+* [HTTP responses, on the client][http-incoming-message]
+* [HTTP requests, on the server][http-incoming-message]
+* [fs read streams][]
+* [zlib streams][zlib]
+* [crypto streams][crypto]
+* [TCP sockets][]
+* [child process stdout and stderr][]
+* [`process.stdin`][]
+
+#### Event: 'close'
+
+Emitted when the stream and any of its underlying resources (a file
+descriptor, for example) have been closed. The event indicates that
+no more events will be emitted, and no further computation will occur.
+
+Not all streams will emit the `'close'` event.
+
+#### Event: 'data'
+
+* `chunk` {Buffer|String} The chunk of data.
+
+Attaching a `'data'` event listener to a stream that has not been
+explicitly paused will switch the stream into flowing mode. Data will
+then be passed as soon as it is available.
+
+If you just want to get all the data out of the stream as fast as
+possible, this is the best way to do so.
+
+```js
+var readable = getReadableStreamSomehow();
+readable.on('data', (chunk) => {
+ console.log('got %d bytes of data', chunk.length);
+});
+```
+
+#### Event: 'end'
+
+This event fires when there will be no more data to read.
+
+Note that the `'end'` event **will not fire** unless the data is
+completely consumed. This can be done by switching into flowing mode,
+or by calling [`stream.read()`][stream-read] repeatedly until you get to the
+end.
+
+```js
+var readable = getReadableStreamSomehow();
+readable.on('data', (chunk) => {
+ console.log('got %d bytes of data', chunk.length);
+});
+readable.on('end', () => {
+ console.log('there will be no more data.');
+});
+```
+
+#### Event: 'error'
+
+* {Error Object}
+
+Emitted if there was an error receiving data.
+
+#### Event: 'readable'
+
+When a chunk of data can be read from the stream, it will emit a
+`'readable'` event.
+
+In some cases, listening for a `'readable'` event will cause some data
+to be read into the internal buffer from the underlying system, if it
+hadn't already.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.on('readable', () => {
+ // there is some data to read now
+});
+```
+
+Once the internal buffer is drained, a `'readable'` event will fire
+again when more data is available.
+
+The `'readable'` event is not emitted in the "flowing" mode with the
+sole exception of the last one, on end-of-stream.
+
+The `'readable'` event indicates that the stream has new information:
+either new data is available or the end of the stream has been reached.
+In the former case, [`stream.read()`][stream-read] will return that data. In the
+latter case, [`stream.read()`][stream-read] will return null. For instance, in
+the following example, `foo.txt` is an empty file:
+
+```js
+const fs = require('fs');
+var rr = fs.createReadStream('foo.txt');
+rr.on('readable', () => {
+ console.log('readable:', rr.read());
+});
+rr.on('end', () => {
+ console.log('end');
+});
+```
+
+The output of running this script is:
+
+```
+$ node test.js
+readable: null
+end
+```
+
+#### readable.isPaused()
+
+* Return: {Boolean}
+
+This method returns whether or not the `readable` has been **explicitly**
+paused by client code (using [`stream.pause()`][stream-pause] without a
+corresponding [`stream.resume()`][stream-resume]).
+
+```js
+var readable = new stream.Readable
+
+readable.isPaused() // === false
+readable.pause()
+readable.isPaused() // === true
+readable.resume()
+readable.isPaused() // === false
+```
+
+#### readable.pause()
+
+* Return: `this`
+
+This method will cause a stream in flowing mode to stop emitting
+[`'data'`][] events, switching out of flowing mode. Any data that becomes
+available will remain in the internal buffer.
+
+```js
+var readable = getReadableStreamSomehow();
+readable.on('data', (chunk) => {
+ console.log('got %d bytes of data', chunk.length);
+ readable.pause();
+ console.log('there will be no more data for 1 second');
+ setTimeout(() => {
+ console.log('now data will start flowing again');
+ readable.resume();
+ }, 1000);
+});
+```
+
+#### readable.pipe(destination[, options])
+
+* `destination` {stream.Writable} The destination for writing data
+* `options` {Object} Pipe options
+ * `end` {Boolean} End the writer when the reader ends. Default = `true`
+
+This method pulls all the data out of a readable stream, and writes it
+to the supplied destination, automatically managing the flow so that
+the destination is not overwhelmed by a fast readable stream.
+
+Multiple destinations can be piped to safely.
+
+```js
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt'
+readable.pipe(writable);
+```
+
+This function returns the destination stream, so you can set up pipe
+chains like so:
+
+```js
+var r = fs.createReadStream('file.txt');
+var z = zlib.createGzip();
+var w = fs.createWriteStream('file.txt.gz');
+r.pipe(z).pipe(w);
+```
+
+For example, emulating the Unix `cat` command:
+
+```js
+process.stdin.pipe(process.stdout);
+```
+
+By default [`stream.end()`][stream-end] is called on the destination when the
+source stream emits [`'end'`][], so that `destination` is no longer writable.
+Pass `{ end: false }` as `options` to keep the destination stream open.
+
+This keeps `writer` open so that "Goodbye" can be written at the
+end.
+
+```js
+reader.pipe(writer, { end: false });
+reader.on('end', () => {
+ writer.end('Goodbye\n');
+});
+```
+
+Note that [`process.stderr`][] and [`process.stdout`][] are never closed until
+the process exits, regardless of the specified options.
+
+#### readable.read([size])
+
+* `size` {Number} Optional argument to specify how much data to read.
+* Return {String|Buffer|Null}
+
+The `read()` method pulls some data out of the internal buffer and
+returns it. If there is no data available, then it will return
+`null`.
+
+If you pass in a `size` argument, then it will return that many
+bytes. If `size` bytes are not available, then it will return `null`,
+unless we've ended, in which case it will return the data remaining
+in the buffer.
+
+If you do not specify a `size` argument, then it will return all the
+data in the internal buffer.
+
+This method should only be called in paused mode. In flowing mode,
+this method is called automatically until the internal buffer is
+drained.
+
+```js
+var readable = getReadableStreamSomehow();
+readable.on('readable', () => {
+ var chunk;
+ while (null !== (chunk = readable.read())) {
+ console.log('got %d bytes of data', chunk.length);
+ }
+});
+```
+
+If this method returns a data chunk, then it will also trigger the
+emission of a [`'data'`][] event.
+
+Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][]
+event has been triggered will return `null`. No runtime error will be raised.
+
+#### readable.resume()
+
+* Return: `this`
+
+This method will cause the readable stream to resume emitting [`'data'`][]
+events.
+
+This method will switch the stream into flowing mode. If you do *not*
+want to consume the data from a stream, but you *do* want to get to
+its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open
+the flow of data.
+
+```js
+var readable = getReadableStreamSomehow();
+readable.resume();
+readable.on('end', () => {
+ console.log('got to the end, but did not read anything');
+});
+```
+
+#### readable.setEncoding(encoding)
+
+* `encoding` {String} The encoding to use.
+* Return: `this`
+
+Call this function to cause the stream to return strings of the specified
+encoding instead of Buffer objects. For example, if you do
+`readable.setEncoding('utf8')`, then the output data will be interpreted as
+UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`,
+then the data will be encoded in hexadecimal string format.
+
+This properly handles multi-byte characters that would otherwise be
+potentially mangled if you simply pulled the Buffers directly and
+called [`buf.toString(encoding)`][] on them. If you want to read the data
+as strings, always use this method.
+
+Also you can disable any encoding at all with `readable.setEncoding(null)`.
+This approach is very useful if you deal with binary data or with large
+multi-byte strings spread out over multiple chunks.
+
+```js
+var readable = getReadableStreamSomehow();
+readable.setEncoding('utf8');
+readable.on('data', (chunk) => {
+ assert.equal(typeof chunk, 'string');
+ console.log('got %d characters of string data', chunk.length);
+});
+```
+
+#### readable.unpipe([destination])
+
+* `destination` {stream.Writable} Optional specific stream to unpipe
+
+This method will remove the hooks set up for a previous [`stream.pipe()`][]
+call.
+
+If the destination is not specified, then all pipes are removed.
+
+If the destination is specified, but no pipe is set up for it, then
+this is a no-op.
+
+```js
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt',
+// but only for the first second
+readable.pipe(writable);
+setTimeout(() => {
+ console.log('stop writing to file.txt');
+ readable.unpipe(writable);
+ console.log('manually close the file stream');
+ writable.end();
+}, 1000);
+```
+
+#### readable.unshift(chunk)
+
+* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue
+
+This is useful in certain cases where a stream is being consumed by a
+parser, which needs to "un-consume" some data that it has
+optimistically pulled out of the source, so that the stream can be
+passed on to some other party.
+
+Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event
+has been triggered; a runtime error will be raised.
+
+If you find that you must often call `stream.unshift(chunk)` in your
+programs, consider implementing a [Transform][] stream instead. (See [API
+for Stream Implementors][].)
+
+```js
+// Pull off a header delimited by \n\n
+// use unshift() if we get too much
+// Call the callback with (error, header, stream)
+const StringDecoder = require('string_decoder').StringDecoder;
+function parseHeader(stream, callback) {
+ stream.on('error', callback);
+ stream.on('readable', onReadable);
+ var decoder = new StringDecoder('utf8');
+ var header = '';
+ function onReadable() {
+ var chunk;
+ while (null !== (chunk = stream.read())) {
+ var str = decoder.write(chunk);
+ if (str.match(/\n\n/)) {
+ // found the header boundary
+ var split = str.split(/\n\n/);
+ header += split.shift();
+ var remaining = split.join('\n\n');
+ var buf = new Buffer(remaining, 'utf8');
+ if (buf.length)
+ stream.unshift(buf);
+ stream.removeListener('error', callback);
+ stream.removeListener('readable', onReadable);
+ // now the body of the message can be read from the stream.
+ callback(null, header, stream);
+ } else {
+ // still reading the header.
+ header += str;
+ }
+ }
+ }
+}
+```
+
+Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)`
+will not end the reading process by resetting the internal reading state of the
+stream. This can cause unexpected results if `unshift()` is called during a
+read (i.e. from within a [`stream._read()`][stream-_read] implementation on a
+custom stream). Following the call to `unshift()` with an immediate
+[`stream.push('')`][stream-push] will reset the reading state appropriately,
+however it is best to simply avoid calling `unshift()` while in the process of
+performing a read.
+
+#### readable.wrap(stream)
+
+* `stream` {Stream} An "old style" readable stream
+
+Versions of Node.js prior to v0.10 had streams that did not implement the
+entire Streams API as it is today. (See [Compatibility][] for
+more information.)
+
+If you are using an older Node.js library that emits [`'data'`][] events and
+has a [`stream.pause()`][stream-pause] method that is advisory only, then you
+can use the `wrap()` method to create a [Readable][] stream that uses the old
+stream as its data source.
+
+You will very rarely ever need to call this function, but it exists
+as a convenience for interacting with old Node.js programs and libraries.
+
+For example:
+
+```js
+const OldReader = require('./old-api-module.js').OldReader;
+const Readable = require('stream').Readable;
+const oreader = new OldReader;
+const myReader = new Readable().wrap(oreader);
+
+myReader.on('readable', () => {
+ myReader.read(); // etc.
+});
+```
+
+### Class: stream.Transform
+
+Transform streams are [Duplex][] streams where the output is in some way
+computed from the input. They implement both the [Readable][] and
+[Writable][] interfaces.
+
+Examples of Transform streams include:
+
+* [zlib streams][zlib]
+* [crypto streams][crypto]
+
+### Class: stream.Writable
+
+<!--type=class-->
+
+The Writable stream interface is an abstraction for a *destination*
+that you are writing data *to*.
+
+Examples of writable streams include:
+
+* [HTTP requests, on the client][]
+* [HTTP responses, on the server][]
+* [fs write streams][]
+* [zlib streams][zlib]
+* [crypto streams][crypto]
+* [TCP sockets][]
+* [child process stdin][]
+* [`process.stdout`][], [`process.stderr`][]
+
+#### Event: 'drain'
+
+If a [`stream.write(chunk)`][stream-write] call returns `false`, then the
+`'drain'` event will indicate when it is appropriate to begin writing more data
+to the stream.
+
+```js
+// Write the data to the supplied writable stream one million times.
+// Be attentive to back-pressure.
+function writeOneMillionTimes(writer, data, encoding, callback) {
+ var i = 1000000;
+ write();
+ function write() {
+ var ok = true;
+ do {
+ i -= 1;
+ if (i === 0) {
+ // last time!
+ writer.write(data, encoding, callback);
+ } else {
+ // see if we should continue, or wait
+ // don't pass the callback, because we're not done yet.
+ ok = writer.write(data, encoding);
+ }
+ } while (i > 0 && ok);
+ if (i > 0) {
+ // had to stop early!
+ // write some more once it drains
+ writer.once('drain', write);
+ }
+ }
+}
+```
+
+#### Event: 'error'
+
+* {Error}
+
+Emitted if there was an error when writing or piping data.
+
+#### Event: 'finish'
+
+When the [`stream.end()`][stream-end] method has been called, and all data has
+been flushed to the underlying system, this event is emitted.
+
+```javascript
+var writer = getWritableStreamSomehow();
+for (var i = 0; i < 100; i ++) {
+ writer.write('hello, #${i}!\n');
+}
+writer.end('this is the end\n');
+writer.on('finish', () => {
+ console.error('all writes are now complete.');
+});
+```
+
+#### Event: 'pipe'
+
+* `src` {stream.Readable} source stream that is piping to this writable
+
+This is emitted whenever the [`stream.pipe()`][] method is called on a readable
+stream, adding this writable to its set of destinations.
+
+```js
+var writer = getWritableStreamSomehow();
+var reader = getReadableStreamSomehow();
+writer.on('pipe', (src) => {
+ console.error('something is piping into the writer');
+ assert.equal(src, reader);
+});
+reader.pipe(writer);
+```
+
+#### Event: 'unpipe'
+
+* `src` {[Readable][] Stream} The source stream that
+ [unpiped][`stream.unpipe()`] this writable
+
+This is emitted whenever the [`stream.unpipe()`][] method is called on a
+readable stream, removing this writable from its set of destinations.
+
+```js
+var writer = getWritableStreamSomehow();
+var reader = getReadableStreamSomehow();
+writer.on('unpipe', (src) => {
+ console.error('something has stopped piping into the writer');
+ assert.equal(src, reader);
+});
+reader.pipe(writer);
+reader.unpipe(writer);
+```
+
+#### writable.cork()
+
+Forces buffering of all writes.
+
+Buffered data will be flushed either at [`stream.uncork()`][] or at
+[`stream.end()`][stream-end] call.
+
+#### writable.end([chunk][, encoding][, callback])
+
+* `chunk` {String|Buffer} Optional data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Optional callback for when the stream is finished
+
+Call this method when no more data will be written to the stream. If supplied,
+the callback is attached as a listener on the [`'finish'`][] event.
+
+Calling [`stream.write()`][stream-write] after calling
+[`stream.end()`][stream-end] will raise an error.
+
+```js
+// write 'hello, ' and then end with 'world!'
+var file = fs.createWriteStream('example.txt');
+file.write('hello, ');
+file.end('world!');
+// writing more now is not allowed!
+```
+
+#### writable.setDefaultEncoding(encoding)
+
+* `encoding` {String} The new default encoding
+
+Sets the default encoding for a writable stream.
+
+#### writable.uncork()
+
+Flush all data, buffered since [`stream.cork()`][] call.
+
+#### writable.write(chunk[, encoding][, callback])
+
+* `chunk` {String|Buffer} The data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Callback for when this chunk of data is flushed
+* Returns: {Boolean} `true` if the data was handled completely.
+
+This method writes some data to the underlying system, and calls the
+supplied callback once the data has been fully handled.
+
+The return value indicates if you should continue writing right now.
+If the data had to be buffered internally, then it will return
+`false`. Otherwise, it will return `true`.
+
+This return value is strictly advisory. You MAY continue to write,
+even if it returns `false`. However, writes will be buffered in
+memory, so it is best not to do this excessively. Instead, wait for
+the [`'drain'`][] event before writing more data.
+
+
+## API for Stream Implementors
+
+<!--type=misc-->
+
+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:
+
+<table>
+ <thead>
+ <tr>
+ <th>
+ <p>Use-case</p>
+ </th>
+ <th>
+ <p>Class</p>
+ </th>
+ <th>
+ <p>Method(s) to implement</p>
+ </th>
+ </tr>
+ </thead>
+ <tr>
+ <td>
+ <p>Reading only</p>
+ </td>
+ <td>
+ <p>[Readable](#stream_class_stream_readable_1)</p>
+ </td>
+ <td>
+ <p><code>[_read][stream-_read]</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Writing only</p>
+ </td>
+ <td>
+ <p>[Writable](#stream_class_stream_writable_1)</p>
+ </td>
+ <td>
+ <p><code>[_write][stream-_write]</code>, <code>[_writev][stream-_writev]</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Reading and writing</p>
+ </td>
+ <td>
+ <p>[Duplex](#stream_class_stream_duplex_1)</p>
+ </td>
+ <td>
+ <p><code>[_read][stream-_read]</code>, <code>[_write][stream-_write]</code>, <code>[_writev][stream-_writev]</code></p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>Operate on written data, then read the result</p>
+ </td>
+ <td>
+ <p>[Transform](#stream_class_stream_transform_1)</p>
+ </td>
+ <td>
+ <p><code>[_transform][stream-_transform]</code>, <code>[_flush][stream-_flush]</code></p>
+ </td>
+ </tr>
+</table>
+
+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
+
+<!--type=class-->
+
+A "duplex" stream is one that is both Readable and Writable, such as a TCP
+socket connection.
+
+Note that `stream.Duplex` is an abstract class designed to be extended
+with an underlying implementation of the [`stream._read(size)`][stream-_read]
+and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you
+would with a Readable or Writable stream class.
+
+Since JavaScript doesn't have multiple prototypal inheritance, this class
+prototypally inherits from Readable, and then parasitically from Writable. It is
+thus up to the user to implement both the low-level
+[`stream._read(n)`][stream-_read] method as well as the low-level
+[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension
+duplex classes.
+
+#### new stream.Duplex(options)
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors. Also has the following fields:
+ * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then
+ the stream will automatically end the readable side when the
+ writable side ends and vice versa.
+ * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode`
+ for readable side of the stream. Has no effect if `objectMode`
+ is `true`.
+ * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode`
+ for writable side of the stream. Has no effect if `objectMode`
+ is `true`.
+
+In classes that extend the Duplex class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+### Class: stream.PassThrough
+
+This is a trivial implementation of a [Transform][] stream that simply
+passes the input bytes across to the output. Its purpose is mainly
+for examples and testing, but there are occasionally use cases where
+it can come in handy as a building block for novel sorts of streams.
+
+### Class: stream.Readable
+
+<!--type=class-->
+
+`stream.Readable` is an abstract class designed to be extended with an
+underlying implementation of the [`stream._read(size)`][stream-_read] method.
+
+Please see [API for Stream Consumers][] for how to consume
+streams in your programs. What follows is an explanation of how to
+implement Readable streams in your programs.
+
+#### new stream.Readable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} The maximum number of bytes to store in
+ the internal buffer before ceasing to read from the underlying
+ resource. Default = `16384` (16kb), or `16` for `objectMode` streams
+ * `encoding` {String} If specified, then buffers will be decoded to
+ strings using the specified encoding. Default = `null`
+ * `objectMode` {Boolean} Whether this stream should behave
+ as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns
+ a single value instead of a Buffer of size n. Default = `false`
+ * `read` {Function} Implementation for the [`stream._read()`][stream-_read]
+ method.
+
+In classes that extend the Readable class, make sure to call the
+Readable constructor so that the buffering settings can be properly
+initialized.
+
+#### readable.\_read(size)
+
+* `size` {Number} Number of bytes to read asynchronously
+
+Note: **Implement this method, but do NOT call it directly.**
+
+This method is prefixed with an underscore because it is internal to the
+class that defines it and should only be called by the internal Readable
+class methods. All Readable stream implementations must provide a \_read
+method to fetch data from the underlying resource.
+
+When `_read()` is called, if data is available from the resource, the `_read()`
+implementation should start pushing that data into the read queue by calling
+[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from
+the resource and pushing data until push returns `false`, at which point it
+should stop reading from the resource. Only when `_read()` is called again after
+it has stopped should it start reading more data from the resource and pushing
+that data onto the queue.
+
+Note: once the `_read()` method is called, it will not be called again until
+the [`stream.push()`][stream-push] method is called.
+
+The `size` argument is advisory. Implementations where a "read" is a
+single call that returns data can use this to know how much data to
+fetch. Implementations where that is not relevant, such as TCP or
+TLS, may ignore this argument, and simply provide data whenever it
+becomes available. There is no need, for example to "wait" until
+`size` bytes are available before calling [`stream.push(chunk)`][stream-push].
+
+#### readable.push(chunk[, encoding])
+
+
+* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue
+* `encoding` {String} Encoding of String chunks. Must be a valid
+ Buffer encoding, such as `'utf8'` or `'ascii'`
+* return {Boolean} Whether or not more pushes should be performed
+
+Note: **This method should be called by Readable implementors, NOT
+by consumers of Readable streams.**
+
+If a value other than null is passed, The `push()` method adds a chunk of data
+into the queue for subsequent stream processors to consume. If `null` is
+passed, it signals the end of the stream (EOF), after which no more data
+can be written.
+
+The data added with `push()` can be pulled out by calling the
+[`stream.read()`][stream-read] method when the [`'readable'`][] event fires.
+
+This API is designed to be as flexible as possible. For example,
+you may be wrapping a lower-level source which has some sort of
+pause/resume mechanism, and a data callback. In those cases, you
+could wrap the low-level source object by doing something like this:
+
+```js
+// source is an object with readStop() and readStart() methods,
+// and an `ondata` member that gets called when it has data, and
+// an `onend` member that gets called when the data is over.
+
+util.inherits(SourceWrapper, Readable);
+
+function SourceWrapper(options) {
+ Readable.call(this, options);
+
+ this._source = getLowlevelSourceObject();
+
+ // Every time there's data, we push it into the internal buffer.
+ this._source.ondata = (chunk) => {
+ // if push() returns false, then we need to stop reading from source
+ if (!this.push(chunk))
+ this._source.readStop();
+ };
+
+ // When the source ends, we push the EOF-signaling `null` chunk
+ this._source.onend = () => {
+ this.push(null);
+ };
+}
+
+// _read will be called when the stream wants to pull more data in
+// the advisory size argument is ignored in this case.
+SourceWrapper.prototype._read = function(size) {
+ this._source.readStart();
+};
+```
+
+#### Example: A Counting Stream
+
+<!--type=example-->
+
+This is a basic example of a Readable stream. It emits the numerals
+from 1 to 1,000,000 in ascending order, and then ends.
+
+```js
+const Readable = require('stream').Readable;
+const util = require('util');
+util.inherits(Counter, Readable);
+
+function Counter(opt) {
+ Readable.call(this, opt);
+ this._max = 1000000;
+ this._index = 1;
+}
+
+Counter.prototype._read = function() {
+ var i = this._index++;
+ if (i > this._max)
+ this.push(null);
+ else {
+ var str = '' + i;
+ var buf = new Buffer(str, 'ascii');
+ this.push(buf);
+ }
+};
+```
+
+#### Example: SimpleProtocol v1 (Sub-optimal)
+
+This is similar to the `parseHeader` function described
+[here](#stream_readable_unshift_chunk), but implemented as a custom stream.
+Also, note that this implementation does not convert the incoming data to a
+string.
+
+However, this would be better implemented as a [Transform][] stream. See
+[SimpleProtocol v2][] for a better implementation.
+
+```js
+// A parser for a simple data protocol.
+// The "header" is a JSON object, followed by 2 \n characters, and
+// then a message body.
+//
+// NOTE: This can be done more simply as a Transform stream!
+// Using Readable directly for this is sub-optimal. See the
+// alternative example below under the Transform section.
+
+const Readable = require('stream').Readable;
+const util = require('util');
+
+util.inherits(SimpleProtocol, Readable);
+
+function SimpleProtocol(source, options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(source, options);
+
+ Readable.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+
+ // source is a readable stream, such as a socket or file
+ this._source = source;
+
+ var self = this;
+ source.on('end', () => {
+ self.push(null);
+ });
+
+ // give it a kick whenever the source is readable
+ // read(0) will not consume any bytes
+ source.on('readable', () => {
+ self.read(0);
+ });
+
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype._read = function(n) {
+ if (!this._inBody) {
+ var chunk = this._source.read();
+
+ // if the source doesn't have data, we don't have data yet.
+ if (chunk === null)
+ return this.push('');
+
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ this.push('');
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // now, because we got some extra data, unshift the rest
+ // back into the read queue so that our consumer will see it.
+ var b = chunk.slice(split);
+ this.unshift(b);
+ // calling unshift by itself does not reset the reading state
+ // of the stream; since we're inside _read, doing an additional
+ // push('') will reset the state appropriately.
+ this.push('');
+
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+ }
+ } else {
+ // from there on, just provide the data to our consumer.
+ // careful not to push(null), since that would indicate EOF.
+ var chunk = this._source.read();
+ if (chunk) this.push(chunk);
+ }
+};
+
+// Usage:
+// var parser = new SimpleProtocol(source);
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+### Class: stream.Transform
+
+A "transform" stream is a duplex stream where the output is causally
+connected in some way to the input, such as a [zlib][] stream or a
+[crypto][] stream.
+
+There is no requirement that the output be the same size as the input,
+the same number of chunks, or arrive at the same time. For example, a
+Hash stream will only ever have a single chunk of output which is
+provided when the input is ended. A zlib stream will produce output
+that is either much smaller or much larger than its input.
+
+Rather than implement the [`stream._read()`][stream-_read] and
+[`stream._write()`][stream-_write] methods, Transform classes must implement the
+[`stream._transform()`][stream-_transform] method, and may optionally
+also implement the [`stream._flush()`][stream-_flush] method. (See below.)
+
+#### new stream.Transform([options])
+
+* `options` {Object} Passed to both Writable and Readable
+ constructors. Also has the following fields:
+ * `transform` {Function} Implementation for the
+ [`stream._transform()`][stream-_transform] method.
+ * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush]
+ method.
+
+In classes that extend the Transform class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### Events: 'finish' and 'end'
+
+The [`'finish'`][] and [`'end'`][] events are from the parent Writable
+and Readable classes respectively. The `'finish'` event is fired after
+[`stream.end()`][stream-end] is called and all chunks have been processed by
+[`stream._transform()`][stream-_transform], `'end'` is fired after all data has
+been output which is after the callback in [`stream._flush()`][stream-_flush]
+has been called.
+
+#### transform.\_flush(callback)
+
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done flushing any remaining data.
+
+Note: **This function MUST NOT be called directly.** It MAY be implemented
+by child classes, and if so, will be called by the internal Transform
+class methods only.
+
+In some cases, your transform operation may need to emit a bit more
+data at the end of the stream. For example, a `Zlib` compression
+stream will store up some internal state so that it can optimally
+compress the output. At the end, however, it needs to do the best it
+can with what is left, so that the data will be complete.
+
+In those cases, you can implement a `_flush()` method, which will be
+called at the very end, after all the written data is consumed, but
+before emitting [`'end'`][] to signal the end of the readable side. Just
+like with [`stream._transform()`][stream-_transform], call
+`transform.push(chunk)` zero or more times, as appropriate, and call `callback`
+when the flush operation is complete.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### transform.\_transform(chunk, encoding, callback)
+
+* `chunk` {Buffer|String} The chunk to be transformed. Will **always**
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. If chunk is a buffer, then this is the special
+ value - 'buffer', ignore it in this case.
+* `callback` {Function} Call this function (optionally with an error
+ argument and data) when you are done processing the supplied chunk.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Transform
+class methods only.
+
+All Transform stream implementations must provide a `_transform()`
+method to accept input and produce output.
+
+`_transform()` should do whatever has to be done in this specific
+Transform class, to handle the bytes being written, and pass them off
+to the readable portion of the interface. Do asynchronous I/O,
+process things, and so on.
+
+Call `transform.push(outputChunk)` 0 or more times to generate output
+from this input chunk, depending on how much data you want to output
+as a result of this chunk.
+
+Call the callback function only when the current chunk is completely
+consumed. Note that there may or may not be output as a result of any
+particular input chunk. If you supply a second argument to the callback
+it will be passed to the push method. In other words the following are
+equivalent:
+
+```js
+transform.prototype._transform = function (data, encoding, callback) {
+ this.push(data);
+ callback();
+};
+
+transform.prototype._transform = function (data, encoding, callback) {
+ callback(null, data);
+};
+```
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### Example: `SimpleProtocol` parser v2
+
+The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple
+protocol parser can be implemented simply by using the higher level
+[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol
+v1` examples.
+
+In this example, rather than providing the input as an argument, it
+would be piped into the parser, which is a more idiomatic Node.js stream
+approach.
+
+```javascript
+const util = require('util');
+const Transform = require('stream').Transform;
+util.inherits(SimpleProtocol, Transform);
+
+function SimpleProtocol(options) {
+ if (!(this instanceof SimpleProtocol))
+ return new SimpleProtocol(options);
+
+ Transform.call(this, options);
+ this._inBody = false;
+ this._sawFirstCr = false;
+ this._rawHeader = [];
+ this.header = null;
+}
+
+SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
+ if (!this._inBody) {
+ // check if the chunk has a \n\n
+ var split = -1;
+ for (var i = 0; i < chunk.length; i++) {
+ if (chunk[i] === 10) { // '\n'
+ if (this._sawFirstCr) {
+ split = i;
+ break;
+ } else {
+ this._sawFirstCr = true;
+ }
+ } else {
+ this._sawFirstCr = false;
+ }
+ }
+
+ if (split === -1) {
+ // still waiting for the \n\n
+ // stash the chunk, and try again.
+ this._rawHeader.push(chunk);
+ } else {
+ this._inBody = true;
+ var h = chunk.slice(0, split);
+ this._rawHeader.push(h);
+ var header = Buffer.concat(this._rawHeader).toString();
+ try {
+ this.header = JSON.parse(header);
+ } catch (er) {
+ this.emit('error', new Error('invalid simple protocol data'));
+ return;
+ }
+ // and let them know that we are done parsing the header.
+ this.emit('header', this.header);
+
+ // now, because we got some extra data, emit this first.
+ this.push(chunk.slice(split));
+ }
+ } else {
+ // from there on, just provide the data to our consumer as-is.
+ this.push(chunk);
+ }
+ done();
+};
+
+// Usage:
+// var parser = new SimpleProtocol();
+// source.pipe(parser)
+// Now parser is a readable stream that will emit 'header'
+// with the parsed header data.
+```
+
+### Class: stream.Writable
+
+<!--type=class-->
+
+`stream.Writable` is an abstract class designed to be extended with an
+underlying implementation of the
+[`stream._write(chunk, encoding, callback)`][stream-_write] method.
+
+Please see [API for Stream Consumers][] for how to consume
+writable streams in your programs. What follows is an explanation of
+how to implement Writable streams in your programs.
+
+#### new stream.Writable([options])
+
+* `options` {Object}
+ * `highWaterMark` {Number} Buffer level when
+ [`stream.write()`][stream-write] starts returning `false`. Default = `16384`
+ (16kb), or `16` for `objectMode` streams.
+ * `decodeStrings` {Boolean} Whether or not to decode strings into
+ Buffers before passing them to [`stream._write()`][stream-_write].
+ Default = `true`
+ * `objectMode` {Boolean} Whether or not the
+ [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can
+ write arbitrary data instead of only `Buffer` / `String` data.
+ Default = `false`
+ * `write` {Function} Implementation for the
+ [`stream._write()`][stream-_write] method.
+ * `writev` {Function} Implementation for the
+ [`stream._writev()`][stream-_writev] method.
+
+In classes that extend the Writable class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### writable.\_write(chunk, encoding, callback)
+
+* `chunk` {Buffer|String} The chunk to be written. Will **always**
+ be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+ encoding type. If chunk is a buffer, then this is the special
+ value - 'buffer', ignore it in this case.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunk.
+
+All Writable stream implementations must provide a
+[`stream._write()`][stream-_write] method to send data to the underlying
+resource.
+
+Note: **This function MUST NOT be called directly.** It should be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+Call the callback using the standard `callback(error)` pattern to
+signal that the write completed successfully or with an error.
+
+If the `decodeStrings` flag is set in the constructor options, then
+`chunk` may be a string rather than a Buffer, and `encoding` will
+indicate the sort of string that it is. This is to support
+implementations that have an optimized handling for certain string
+data encodings. If you do not explicitly set the `decodeStrings`
+option to `false`, then you can safely ignore the `encoding` argument,
+and assume that `chunk` will always be a Buffer.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs. However, you **are** expected to override this method in
+your own extension classes.
+
+#### writable.\_writev(chunks, callback)
+
+* `chunks` {Array} The chunks to be written. Each chunk has following
+ format: `{ chunk: ..., encoding: ... }`.
+* `callback` {Function} Call this function (optionally with an error
+ argument) when you are done processing the supplied chunks.
+
+Note: **This function MUST NOT be called directly.** It may be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+This function is completely optional to implement. In most cases it is
+unnecessary. If implemented, it will be called with all the chunks
+that are buffered in the write queue.
+
+
+## Simplified Constructor API
+
+<!--type=misc-->
+
+In simple cases there is now the added benefit of being able to construct a
+stream without inheritance.
+
+This can be done by passing the appropriate methods as constructor options:
+
+Examples:
+
+### Duplex
+
+```js
+var duplex = new stream.Duplex({
+ read: function(n) {
+ // sets this._read under the hood
+
+ // push data onto the read queue, passing null
+ // will signal the end of the stream (EOF)
+ this.push(chunk);
+ },
+ write: function(chunk, encoding, next) {
+ // sets this._write under the hood
+
+ // An optional error can be passed as the first argument
+ next()
+ }
+});
+
+// or
+
+var duplex = new stream.Duplex({
+ read: function(n) {
+ // sets this._read under the hood
+
+ // push data onto the read queue, passing null
+ // will signal the end of the stream (EOF)
+ this.push(chunk);
+ },
+ writev: function(chunks, next) {
+ // sets this._writev under the hood
+
+ // An optional error can be passed as the first argument
+ next()
+ }
+});
+```
+
+### Readable
+
+```js
+var readable = new stream.Readable({
+ read: function(n) {
+ // sets this._read under the hood
+
+ // push data onto the read queue, passing null
+ // will signal the end of the stream (EOF)
+ this.push(chunk);
+ }
+});
+```
+
+### Transform
+
+```js
+var transform = new stream.Transform({
+ transform: function(chunk, encoding, next) {
+ // sets this._transform under the hood
+
+ // generate output as many times as needed
+ // this.push(chunk);
+
+ // call when the current chunk is consumed
+ next();
+ },
+ flush: function(done) {
+ // sets this._flush under the hood
+
+ // generate output as many times as needed
+ // this.push(chunk);
+
+ done();
+ }
+});
+```
+
+### Writable
+
+```js
+var writable = new stream.Writable({
+ write: function(chunk, encoding, next) {
+ // sets this._write under the hood
+
+ // An optional error can be passed as the first argument
+ next()
+ }
+});
+
+// or
+
+var writable = new stream.Writable({
+ writev: function(chunks, next) {
+ // sets this._writev under the hood
+
+ // An optional error can be passed as the first argument
+ next()
+ }
+});
+```
+
+## Streams: Under the Hood
+
+<!--type=misc-->
+
+### Buffering
+
+<!--type=misc-->
+
+Both Writable and Readable streams will buffer data on an internal
+object which can be retrieved from `_writableState.getBuffer()` or
+`_readableState.buffer`, respectively.
+
+The amount of data that will potentially be buffered depends on the
+`highWaterMark` option which is passed into the constructor.
+
+Buffering in Readable streams happens when the implementation calls
+[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not
+call [`stream.read()`][stream-read], then the data will sit in the internal
+queue until it is consumed.
+
+Buffering in Writable streams happens when the user calls
+[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`.
+
+The purpose of streams, especially with the [`stream.pipe()`][] method, is to
+limit the buffering of data to acceptable levels, so that sources and
+destinations of varying speed will not overwhelm the available memory.
+
+### Compatibility with Older Node.js Versions
+
+<!--type=misc-->
+
+In versions of Node.js prior to v0.10, the Readable stream interface was
+simpler, but also less powerful and less useful.
+
+* Rather than waiting for you to call the [`stream.read()`][stream-read] method,
+ [`'data'`][] events would start emitting immediately. If you needed to do
+ some I/O to decide how to handle data, then you had to store the chunks
+ in some kind of buffer so that they would not be lost.
+* The [`stream.pause()`][stream-pause] method was advisory, rather than
+ guaranteed. This meant that you still had to be prepared to receive
+ [`'data'`][] events even when the stream was in a paused state.
+
+In Node.js v0.10, the [Readable][] class was added.
+For backwards compatibility with older Node.js programs, Readable streams
+switch into "flowing mode" when a [`'data'`][] event handler is added, or
+when the [`stream.resume()`][stream-resume] method is called. The effect is
+that, even if you are not using the new [`stream.read()`][stream-read] method
+and [`'readable'`][] event, you no longer have to worry about losing
+[`'data'`][] chunks.
+
+Most programs will continue to function normally. However, this
+introduces an edge case in the following conditions:
+
+* No [`'data'`][] event handler is added.
+* The [`stream.resume()`][stream-resume] method is never called.
+* The stream is not piped to any writable destination.
+
+For example, consider the following code:
+
+```js
+// WARNING! BROKEN!
+net.createServer((socket) => {
+
+ // we add an 'end' method, but never consume the data
+ socket.on('end', () => {
+ // It will never get here.
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+}).listen(1337);
+```
+
+In versions of Node.js prior to v0.10, the incoming message data would be
+simply discarded. However, in Node.js v0.10 and beyond,
+the socket will remain paused forever.
+
+The workaround in this situation is to call the
+[`stream.resume()`][stream-resume] method to start the flow of data:
+
+```js
+// Workaround
+net.createServer((socket) => {
+
+ socket.on('end', () => {
+ socket.end('I got your message (but didnt read it)\n');
+ });
+
+ // start the flow of data, discarding it.
+ socket.resume();
+
+}).listen(1337);
+```
+
+In addition to new Readable streams switching into flowing mode,
+pre-v0.10 style streams can be wrapped in a Readable class using the
+[`stream.wrap()`][] method.
+
+
+### Object Mode
+
+<!--type=misc-->
+
+Normally, Streams operate on Strings and Buffers exclusively.
+
+Streams that are in **object mode** can emit generic JavaScript values
+other than Buffers and Strings.
+
+A Readable stream in object mode will always return a single item from
+a call to [`stream.read(size)`][stream-read], regardless of what the size
+argument is.
+
+A Writable stream in object mode will always ignore the `encoding`
+argument to [`stream.write(data, encoding)`][stream-write].
+
+The special value `null` still retains its special value for object
+mode streams. That is, for object mode readable streams, `null` as a
+return value from [`stream.read()`][stream-read] indicates that there is no more
+data, and [`stream.push(null)`][stream-push] will signal the end of stream data
+(`EOF`).
+
+No streams in Node.js core are object mode streams. This pattern is only
+used by userland streaming libraries.
+
+You should set `objectMode` in your stream child class constructor on
+the options object. Setting `objectMode` mid-stream is not safe.
+
+For Duplex streams `objectMode` can be set exclusively for readable or
+writable side with `readableObjectMode` and `writableObjectMode`
+respectively. These options can be used to implement parsers and
+serializers with Transform streams.
+
+```js
+const util = require('util');
+const StringDecoder = require('string_decoder').StringDecoder;
+const Transform = require('stream').Transform;
+util.inherits(JSONParseStream, Transform);
+
+// Gets \n-delimited JSON string data, and emits the parsed objects
+function JSONParseStream() {
+ if (!(this instanceof JSONParseStream))
+ return new JSONParseStream();
+
+ Transform.call(this, { readableObjectMode : true });
+
+ this._buffer = '';
+ this._decoder = new StringDecoder('utf8');
+}
+
+JSONParseStream.prototype._transform = function(chunk, encoding, cb) {
+ this._buffer += this._decoder.write(chunk);
+ // split on newlines
+ var lines = this._buffer.split(/\r?\n/);
+ // keep the last partial line buffered
+ this._buffer = lines.pop();
+ for (var l = 0; l < lines.length; l++) {
+ var line = lines[l];
+ try {
+ var obj = JSON.parse(line);
+ } catch (er) {
+ this.emit('error', er);
+ return;
+ }
+ // push the parsed object out to the readable consumer
+ this.push(obj);
+ }
+ cb();
+};
+
+JSONParseStream.prototype._flush = function(cb) {
+ // Just handle any leftover
+ var rem = this._buffer.trim();
+ if (rem) {
+ try {
+ var obj = JSON.parse(rem);
+ } catch (er) {
+ this.emit('error', er);
+ return;
+ }
+ // push the parsed object out to the readable consumer
+ this.push(obj);
+ }
+ cb();
+};
+```
+
+### `stream.read(0)`
+
+There are some cases where you want to trigger a refresh of the
+underlying readable stream mechanisms, without actually consuming any
+data. In that case, you can call `stream.read(0)`, which will always
+return null.
+
+If the internal read buffer is below the `highWaterMark`, and the
+stream is not currently reading, then calling `stream.read(0)` will trigger
+a low-level [`stream._read()`][stream-_read] call.
+
+There is almost never a need to do this. However, you will see some
+cases in Node.js's internals where this is done, particularly in the
+Readable stream class internals.
+
+### `stream.push('')`
+
+Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an
+interesting side effect. Because it *is* a call to
+[`stream.push()`][stream-push], it will end the `reading` process. However, it
+does *not* add any data to the readable buffer, so there's nothing for
+a user to consume.
+
+Very rarely, there are cases where you have no data to provide now,
+but the consumer of your stream (or, perhaps, another bit of your own
+code) will know when to check again, by calling [`stream.read(0)`][stream-read].
+In those cases, you *may* call `stream.push('')`.
+
+So far, the only use case for this functionality is in the
+[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you
+find that you have to use `stream.push('')`, please consider another
+approach, because it almost certainly indicates that something is
+horribly wrong.
+
+[`'data'`]: #stream_event_data
+[`'drain'`]: #stream_event_drain
+[`'end'`]: #stream_event_end
+[`'finish'`]: #stream_event_finish
+[`'readable'`]: #stream_event_readable
+[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end
+[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter
+[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr
+[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin
+[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout
+[`stream.cork()`]: #stream_writable_cork
+[`stream.pipe()`]: #stream_readable_pipe_destination_options
+[`stream.uncork()`]: #stream_writable_uncork
+[`stream.unpipe()`]: #stream_readable_unpipe_destination
+[`stream.wrap()`]: #stream_readable_wrap_stream
+[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream
+[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor
+[API for Stream Consumers]: #stream_api_for_stream_consumers
+[API for Stream Implementors]: #stream_api_for_stream_implementors
+[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin
+[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout
+[Compatibility]: #stream_compatibility_with_older_node_js_versions
+[crypto]: crypto.html
+[Duplex]: #stream_class_stream_duplex
+[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream
+[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream
+[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest
+[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse
+[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage
+[Object mode]: #stream_object_mode
+[Readable]: #stream_class_stream_readable
+[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2
+[stream-_flush]: #stream_transform_flush_callback
+[stream-_read]: #stream_readable_read_size_1
+[stream-_transform]: #stream_transform_transform_chunk_encoding_callback
+[stream-_write]: #stream_writable_write_chunk_encoding_callback_1
+[stream-_writev]: #stream_writable_writev_chunks_callback
+[stream-end]: #stream_writable_end_chunk_encoding_callback
+[stream-pause]: #stream_readable_pause
+[stream-push]: #stream_readable_push_chunk_encoding
+[stream-read]: #stream_readable_read_size
+[stream-resume]: #stream_readable_resume
+[stream-write]: #stream_writable_write_chunk_encoding_callback
+[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket
+[Transform]: #stream_class_stream_transform
+[Writable]: #stream_class_stream_writable
+[zlib]: zlib.html
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..c141a99c26
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
@@ -0,0 +1,58 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+ but, we lose the opportunity to change the model
+ may not be backwards incompatible (double check keys)
+
+ **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+ * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js
new file mode 100644
index 0000000000..ca807af876
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_duplex.js")
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000000..736693b840
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,75 @@
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/*<replacement>*/
+
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) {
+ keys.push(key);
+ }return keys;
+};
+/*</replacement>*/
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+var keys = objectKeys(Writable.prototype);
+for (var v = 0; v < keys.length; v++) {
+ var method = keys[v];
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
+}
+
+function Duplex(options) {
+ if (!(this instanceof Duplex)) return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false) this.readable = false;
+
+ if (options && options.writable === false) this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended) return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ processNextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+ self.end();
+}
+
+function forEach(xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000000..d06f71f186
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,26 @@
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough)) return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+ cb(null, chunk);
+}; \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000000..54a9d5c553
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,880 @@
+'use strict';
+
+module.exports = Readable;
+
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+var EE = require('events');
+
+/*<replacement>*/
+var EElistenerCount = function (emitter, type) {
+ return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+/*<replacement>*/
+var Stream;
+(function () {
+ try {
+ Stream = require('st' + 'ream');
+ } catch (_) {} finally {
+ if (!Stream) Stream = require('events').EventEmitter;
+ }
+})();
+/*</replacement>*/
+
+var Buffer = require('buffer').Buffer;
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+/*<replacement>*/
+var debugUtil = require('util');
+var debug = undefined;
+if (debugUtil && debugUtil.debuglog) {
+ debug = debugUtil.debuglog('stream');
+} else {
+ debug = function () {};
+}
+/*</replacement>*/
+
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+var Duplex;
+function ReadableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = ~ ~this.highWaterMark;
+
+ this.buffer = [];
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = null;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+ this.resumeScheduled = false;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // when piping, we only care about 'readable' events that happen
+ // after read()ing all the bytes and not getting any pushback.
+ this.ranOut = false;
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+
+var Duplex;
+function Readable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ if (!(this instanceof Readable)) return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ if (options && typeof options.read === 'function') this._read = options.read;
+
+ Stream.call(this);
+}
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+ var state = this._readableState;
+
+ if (!state.objectMode && typeof chunk === 'string') {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = new Buffer(chunk, encoding);
+ encoding = '';
+ }
+ }
+
+ return readableAddChunk(this, state, chunk, encoding, false);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function (chunk) {
+ var state = this._readableState;
+ return readableAddChunk(this, state, chunk, '', true);
+};
+
+Readable.prototype.isPaused = function () {
+ return this._readableState.flowing === false;
+};
+
+function readableAddChunk(stream, state, chunk, encoding, addToFront) {
+ var er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (chunk === null) {
+ state.reading = false;
+ onEofChunk(stream, state);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (state.ended && !addToFront) {
+ var e = new Error('stream.push() after EOF');
+ stream.emit('error', e);
+ } else if (state.endEmitted && addToFront) {
+ var e = new Error('stream.unshift() after end event');
+ stream.emit('error', e);
+ } else {
+ var skipAdd;
+ if (state.decoder && !addToFront && !encoding) {
+ chunk = state.decoder.write(chunk);
+ skipAdd = !state.objectMode && chunk.length === 0;
+ }
+
+ if (!addToFront) state.reading = false;
+
+ // Don't add to the buffer if we've decoded to an empty string chunk and
+ // we're not in object mode
+ if (!skipAdd) {
+ // if we want the data now, just emit it.
+ if (state.flowing && state.length === 0 && !state.sync) {
+ stream.emit('data', chunk);
+ stream.read(0);
+ } else {
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+
+ if (state.needReadable) emitReadable(stream);
+ }
+ }
+
+ maybeReadMore(stream, state);
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ }
+
+ return needMoreData(state);
+}
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+}
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+ this._readableState.encoding = enc;
+ return this;
+};
+
+// Don't raise the hwm > 8MB
+var MAX_HWM = 0x800000;
+function computeNewHighWaterMark(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2
+ n--;
+ n |= n >>> 1;
+ n |= n >>> 2;
+ n |= n >>> 4;
+ n |= n >>> 8;
+ n |= n >>> 16;
+ n++;
+ }
+ return n;
+}
+
+function howMuchToRead(n, state) {
+ if (state.length === 0 && state.ended) return 0;
+
+ if (state.objectMode) return n === 0 ? 0 : 1;
+
+ if (n === null || isNaN(n)) {
+ // only flow one buffer at a time
+ if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length;
+ }
+
+ if (n <= 0) return 0;
+
+ // If we're asking for more than the target buffer level,
+ // then raise the water mark. Bump up to the next highest
+ // power of 2, to prevent increasing it excessively in tiny
+ // amounts.
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
+
+ // don't have that much. return null, unless we've ended.
+ if (n > state.length) {
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ } else {
+ return state.length;
+ }
+ }
+
+ return n;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function (n) {
+ debug('read', n);
+ var state = this._readableState;
+ var nOrig = n;
+
+ if (typeof n !== 'number' || n > 0) state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
+ debug('read: emitReadable', state.length, state.ended);
+ if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0) endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+ debug('need readable', doRead);
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
+ doRead = true;
+ debug('length less than watermark', doRead);
+ }
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading) {
+ doRead = false;
+ debug('reading or ended', doRead);
+ }
+
+ if (doRead) {
+ debug('do read');
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0) state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ }
+
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (doRead && !state.reading) n = howMuchToRead(nOrig, state);
+
+ var ret;
+ if (n > 0) ret = fromList(n, state);else ret = null;
+
+ if (ret === null) {
+ state.needReadable = true;
+ n = 0;
+ }
+
+ state.length -= n;
+
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (state.length === 0 && !state.ended) state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended && state.length === 0) endReadable(this);
+
+ if (ret !== null) this.emit('data', ret);
+
+ return ret;
+};
+
+function chunkInvalid(state, chunk) {
+ var er = null;
+ if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+function onEofChunk(stream, state) {
+ if (state.ended) return;
+ if (state.decoder) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // emit 'readable' now to make sure it gets picked up.
+ emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ debug('emitReadable', state.flowing);
+ state.emittedReadable = true;
+ if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
+ }
+}
+
+function emitReadable_(stream) {
+ debug('emit readable');
+ stream.emit('readable');
+ flow(stream);
+}
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ processNextTick(maybeReadMore_, stream, state);
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
+ debug('maybeReadMore read 0');
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;else len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function (n) {
+ this.emit('error', new Error('not implemented'));
+};
+
+Readable.prototype.pipe = function (dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+
+ var endFn = doEnd ? onend : cleanup;
+ if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable) {
+ debug('onunpipe');
+ if (readable === src) {
+ cleanup();
+ }
+ }
+
+ function onend() {
+ debug('onend');
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ var cleanedUp = false;
+ function cleanup() {
+ debug('cleanup');
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', cleanup);
+ src.removeListener('data', ondata);
+
+ cleanedUp = true;
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+ }
+
+ src.on('data', ondata);
+ function ondata(chunk) {
+ debug('ondata');
+ var ret = dest.write(chunk);
+ if (false === ret) {
+ // If the user unpiped during `dest.write()`, it is possible
+ // to get stuck in a permanently paused state if that write
+ // also returned false.
+ if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) {
+ debug('false write response, pause', src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
+ }
+ src.pause();
+ }
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ debug('onerror', er);
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
+ }
+ // This is a brutally ugly hack to make sure that our error handler
+ // is attached before any userland ones. NEVER DO THIS.
+ if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error];
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ debug('onfinish');
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ debug('unpipe');
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ debug('pipe resume');
+ src.resume();
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function () {
+ var state = src._readableState;
+ debug('pipeOnDrain', state.awaitDrain);
+ if (state.awaitDrain) state.awaitDrain--;
+ if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+ state.flowing = true;
+ flow(src);
+ }
+ };
+}
+
+Readable.prototype.unpipe = function (dest) {
+ var state = this._readableState;
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0) return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes) return this;
+
+ if (!dest) dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ if (dest) dest.emit('unpipe', this);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+
+ for (var _i = 0; _i < len; _i++) {
+ dests[_i].emit('unpipe', this);
+ }return this;
+ }
+
+ // try to find the right one.
+ var i = indexOf(state.pipes, dest);
+ if (i === -1) return this;
+
+ state.pipes.splice(i, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ // If listening to data, and it has not explicitly been paused,
+ // then call resume to start the flow of data on the next tick.
+ if (ev === 'data' && false !== this._readableState.flowing) {
+ this.resume();
+ }
+
+ if (ev === 'readable' && !this._readableState.endEmitted) {
+ var state = this._readableState;
+ if (!state.readableListening) {
+ state.readableListening = true;
+ state.emittedReadable = false;
+ state.needReadable = true;
+ if (!state.reading) {
+ processNextTick(nReadingNextTick, this);
+ } else if (state.length) {
+ emitReadable(this, state);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+function nReadingNextTick(self) {
+ debug('readable nexttick read 0');
+ self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+ var state = this._readableState;
+ if (!state.flowing) {
+ debug('resume');
+ state.flowing = true;
+ resume(this, state);
+ }
+ return this;
+};
+
+function resume(stream, state) {
+ if (!state.resumeScheduled) {
+ state.resumeScheduled = true;
+ processNextTick(resume_, stream, state);
+ }
+}
+
+function resume_(stream, state) {
+ if (!state.reading) {
+ debug('resume read 0');
+ stream.read(0);
+ }
+
+ state.resumeScheduled = false;
+ stream.emit('resume');
+ flow(stream);
+ if (state.flowing && !state.reading) stream.read(0);
+}
+
+Readable.prototype.pause = function () {
+ debug('call pause flowing=%j', this._readableState.flowing);
+ if (false !== this._readableState.flowing) {
+ debug('pause');
+ this._readableState.flowing = false;
+ this.emit('pause');
+ }
+ return this;
+};
+
+function flow(stream) {
+ var state = stream._readableState;
+ debug('flow', state.flowing);
+ if (state.flowing) {
+ do {
+ var chunk = stream.read();
+ } while (null !== chunk && state.flowing);
+ }
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+ var state = this._readableState;
+ var paused = false;
+
+ var self = this;
+ stream.on('end', function () {
+ debug('wrapped end');
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) self.push(chunk);
+ }
+
+ self.push(null);
+ });
+
+ stream.on('data', function (chunk) {
+ debug('wrapped data');
+ if (state.decoder) chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+
+ var ret = self.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (this[i] === undefined && typeof stream[i] === 'function') {
+ this[i] = function (method) {
+ return function () {
+ return stream[method].apply(stream, arguments);
+ };
+ }(i);
+ }
+ }
+
+ // proxy certain important events.
+ var events = ['error', 'close', 'destroy', 'pause', 'resume'];
+ forEach(events, function (ev) {
+ stream.on(ev, self.emit.bind(self, ev));
+ });
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ self._read = function (n) {
+ debug('wrapped _read', n);
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+
+ return self;
+};
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+function fromList(n, state) {
+ var list = state.buffer;
+ var length = state.length;
+ var stringMode = !!state.decoder;
+ var objectMode = !!state.objectMode;
+ var ret;
+
+ // nothing in the list, definitely empty.
+ if (list.length === 0) return null;
+
+ if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) {
+ // read it all, truncate the array.
+ if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length);
+ list.length = 0;
+ } else {
+ // read just some of it.
+ if (n < list[0].length) {
+ // just take a part of the first list item.
+ // slice is the same for buffers and strings.
+ var buf = list[0];
+ ret = buf.slice(0, n);
+ list[0] = buf.slice(n);
+ } else if (n === list[0].length) {
+ // first list is a perfect match
+ ret = list.shift();
+ } else {
+ // complex case.
+ // we have enough to cover it, but it spans past the first buffer.
+ if (stringMode) ret = '';else ret = new Buffer(n);
+
+ var c = 0;
+ for (var i = 0, l = list.length; i < l && c < n; i++) {
+ var buf = list[0];
+ var cpy = Math.min(n - c, buf.length);
+
+ if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy);
+
+ if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift();
+
+ c += cpy;
+ }
+ }
+ }
+
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0) throw new Error('endReadable called on non-empty stream');
+
+ if (!state.endEmitted) {
+ state.ended = true;
+ processNextTick(endReadableNT, state, stream);
+ }
+}
+
+function endReadableNT(state, stream) {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+}
+
+function forEach(xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
+
+function indexOf(xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000000..625cdc1769
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,180 @@
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(Transform, Duplex);
+
+function TransformState(stream) {
+ this.afterTransform = function (er, data) {
+ return afterTransform(stream, er, data);
+ };
+
+ this.needTransform = false;
+ this.transforming = false;
+ this.writecb = null;
+ this.writechunk = null;
+ this.writeencoding = null;
+}
+
+function afterTransform(stream, er, data) {
+ var ts = stream._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (data !== null && data !== undefined) stream.push(data);
+
+ cb(er);
+
+ var rs = stream._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ stream._read(rs.highWaterMark);
+ }
+}
+
+function Transform(options) {
+ if (!(this instanceof Transform)) return new Transform(options);
+
+ Duplex.call(this, options);
+
+ this._transformState = new TransformState(this);
+
+ // when the writable side finishes, then flush out anything remaining.
+ var stream = this;
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ if (options) {
+ if (typeof options.transform === 'function') this._transform = options.transform;
+
+ if (typeof options.flush === 'function') this._flush = options.flush;
+ }
+
+ this.once('prefinish', function () {
+ if (typeof this._flush === 'function') this._flush(function (er) {
+ done(stream, er);
+ });else done(stream);
+ });
+}
+
+Transform.prototype.push = function (chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function (chunk, encoding, cb) {
+ throw new Error('not implemented');
+};
+
+Transform.prototype._write = function (chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function (n) {
+ var ts = this._transformState;
+
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+function done(stream, er) {
+ if (er) return stream.emit('error', er);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ var ws = stream._writableState;
+ var ts = stream._transformState;
+
+ if (ws.length) throw new Error('calling transform done when ws.length != 0');
+
+ if (ts.transforming) throw new Error('calling transform done when still transforming');
+
+ return stream.push(null);
+} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000000..95916c992a
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,516 @@
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+module.exports = Writable;
+
+/*<replacement>*/
+var processNextTick = require('process-nextick-args');
+/*</replacement>*/
+
+/*<replacement>*/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
+/*</replacement>*/
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+/*<replacement>*/
+var internalUtil = {
+ deprecate: require('util-deprecate')
+};
+/*</replacement>*/
+
+/*<replacement>*/
+var Stream;
+(function () {
+ try {
+ Stream = require('st' + 'ream');
+ } catch (_) {} finally {
+ if (!Stream) Stream = require('events').EventEmitter;
+ }
+})();
+/*</replacement>*/
+
+var Buffer = require('buffer').Buffer;
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+ this.next = null;
+}
+
+var Duplex;
+function WritableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = ~ ~this.highWaterMark;
+
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function (er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+
+ // count buffered requests
+ this.bufferedRequestCount = 0;
+
+ // create the two objects needed to store the corked requests
+ // they are not a linked list, as no new elements are inserted in there
+ this.corkedRequestsFree = new CorkedRequest(this);
+ this.corkedRequestsFree.next = new CorkedRequest(this);
+}
+
+WritableState.prototype.getBuffer = function writableStateGetBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+
+(function () {
+ try {
+ Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: internalUtil.deprecate(function () {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
+ });
+ } catch (_) {}
+})();
+
+var Duplex;
+function Writable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, though they're not
+ // instanceof Writable, they're instanceof Readable.
+ if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ if (options) {
+ if (typeof options.write === 'function') this._write = options.write;
+
+ if (typeof options.writev === 'function') this._writev = options.writev;
+ }
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+ this.emit('error', new Error('Cannot pipe. Not readable.'));
+};
+
+function writeAfterEnd(stream, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ processNextTick(cb, er);
+}
+
+// If we get something that is not a buffer, string, null, or undefined,
+// and we're not in objectMode, then that's an error.
+// Otherwise stream chunks are all considered to be of length=1, and the
+// watermarks determine how many objects to keep in the buffer, rather than
+// how many bytes or characters.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+
+ if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
+ var er = new TypeError('Invalid non-string/buffer chunk');
+ stream.emit('error', er);
+ processNextTick(cb, er);
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function (chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+
+ if (typeof cb !== 'function') cb = nop;
+
+ if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
+ }
+
+ return ret;
+};
+
+Writable.prototype.cork = function () {
+ var state = this._writableState;
+
+ state.corked++;
+};
+
+Writable.prototype.uncork = function () {
+ var state = this._writableState;
+
+ if (state.corked) {
+ state.corked--;
+
+ if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
+ this._writableState.defaultEncoding = encoding;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+ chunk = new Buffer(chunk, encoding);
+ }
+ return chunk;
+}
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+ chunk = decodeChunk(state, chunk, encoding);
+
+ if (Buffer.isBuffer(chunk)) encoding = 'buffer';
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret) state.needDrain = true;
+
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ state.bufferedRequestCount += 1;
+ } else {
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
+
+ return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
+ if (sync) processNextTick(cb, er);else cb(er);
+
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er) onwriteError(stream, state, sync, er, cb);else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(state);
+
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+ clearBuffer(stream, state);
+ }
+
+ if (sync) {
+ /*<replacement>*/
+ asyncWrite(afterWrite, stream, state, finished, cb);
+ /*</replacement>*/
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished) onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
+
+ if (stream._writev && entry && entry.next) {
+ // Fast case, write everything using _writev()
+ var l = state.bufferedRequestCount;
+ var buffer = new Array(l);
+ var holder = state.corkedRequestsFree;
+ holder.entry = entry;
+
+ var count = 0;
+ while (entry) {
+ buffer[count] = entry;
+ entry = entry.next;
+ count += 1;
+ }
+
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+ // doWrite is always async, defer these to save a bit of time
+ // as the hot path ends with doWrite
+ state.pendingcb++;
+ state.lastBufferedRequest = null;
+ state.corkedRequestsFree = holder.next;
+ holder.next = null;
+ } else {
+ // Slow case, write chunks one-by-one
+ while (entry) {
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ entry = entry.next;
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ break;
+ }
+ }
+
+ if (entry === null) state.lastBufferedRequest = null;
+ }
+
+ state.bufferedRequestCount = 0;
+ state.bufferedRequest = entry;
+ state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function (chunk, encoding, cb) {
+ cb(new Error('not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function (chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+
+function needFinish(state) {
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+
+function prefinish(stream, state) {
+ if (!state.prefinished) {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(state);
+ if (need) {
+ if (state.pendingcb === 0) {
+ prefinish(stream, state);
+ state.finished = true;
+ stream.emit('finish');
+ } else {
+ prefinish(stream, state);
+ }
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished) processNextTick(cb);else stream.once('finish', cb);
+ }
+ state.ended = true;
+ stream.writable = false;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+ var _this = this;
+
+ this.next = null;
+ this.entry = null;
+
+ this.finish = function (err) {
+ var entry = _this.entry;
+ _this.entry = null;
+ while (entry) {
+ var cb = entry.callback;
+ state.pendingcb--;
+ cb(err);
+ entry = entry.next;
+ }
+ if (state.corkedRequestsFree) {
+ state.corkedRequestsFree.next = _this;
+ } else {
+ state.corkedRequestsFree = _this;
+ }
+ };
+} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE
new file mode 100644
index 0000000000..d8d7f9437d
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE
@@ -0,0 +1,19 @@
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md
new file mode 100644
index 0000000000..5a76b4149c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md
@@ -0,0 +1,3 @@
+# core-util-is
+
+The `util.is*` functions introduced in Node v0.12.
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch
new file mode 100644
index 0000000000..a06d5c05f7
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch
@@ -0,0 +1,604 @@
+diff --git a/lib/util.js b/lib/util.js
+index a03e874..9074e8e 100644
+--- a/lib/util.js
++++ b/lib/util.js
+@@ -19,430 +19,6 @@
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-var formatRegExp = /%[sdj%]/g;
+-exports.format = function(f) {
+- if (!isString(f)) {
+- var objects = [];
+- for (var i = 0; i < arguments.length; i++) {
+- objects.push(inspect(arguments[i]));
+- }
+- return objects.join(' ');
+- }
+-
+- var i = 1;
+- var args = arguments;
+- var len = args.length;
+- var str = String(f).replace(formatRegExp, function(x) {
+- if (x === '%%') return '%';
+- if (i >= len) return x;
+- switch (x) {
+- case '%s': return String(args[i++]);
+- case '%d': return Number(args[i++]);
+- case '%j':
+- try {
+- return JSON.stringify(args[i++]);
+- } catch (_) {
+- return '[Circular]';
+- }
+- default:
+- return x;
+- }
+- });
+- for (var x = args[i]; i < len; x = args[++i]) {
+- if (isNull(x) || !isObject(x)) {
+- str += ' ' + x;
+- } else {
+- str += ' ' + inspect(x);
+- }
+- }
+- return str;
+-};
+-
+-
+-// Mark that a method should not be used.
+-// Returns a modified function which warns once by default.
+-// If --no-deprecation is set, then it is a no-op.
+-exports.deprecate = function(fn, msg) {
+- // Allow for deprecating things in the process of starting up.
+- if (isUndefined(global.process)) {
+- return function() {
+- return exports.deprecate(fn, msg).apply(this, arguments);
+- };
+- }
+-
+- if (process.noDeprecation === true) {
+- return fn;
+- }
+-
+- var warned = false;
+- function deprecated() {
+- if (!warned) {
+- if (process.throwDeprecation) {
+- throw new Error(msg);
+- } else if (process.traceDeprecation) {
+- console.trace(msg);
+- } else {
+- console.error(msg);
+- }
+- warned = true;
+- }
+- return fn.apply(this, arguments);
+- }
+-
+- return deprecated;
+-};
+-
+-
+-var debugs = {};
+-var debugEnviron;
+-exports.debuglog = function(set) {
+- if (isUndefined(debugEnviron))
+- debugEnviron = process.env.NODE_DEBUG || '';
+- set = set.toUpperCase();
+- if (!debugs[set]) {
+- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
+- var pid = process.pid;
+- debugs[set] = function() {
+- var msg = exports.format.apply(exports, arguments);
+- console.error('%s %d: %s', set, pid, msg);
+- };
+- } else {
+- debugs[set] = function() {};
+- }
+- }
+- return debugs[set];
+-};
+-
+-
+-/**
+- * Echos the value of a value. Trys to print the value out
+- * in the best way possible given the different types.
+- *
+- * @param {Object} obj The object to print out.
+- * @param {Object} opts Optional options object that alters the output.
+- */
+-/* legacy: obj, showHidden, depth, colors*/
+-function inspect(obj, opts) {
+- // default options
+- var ctx = {
+- seen: [],
+- stylize: stylizeNoColor
+- };
+- // legacy...
+- if (arguments.length >= 3) ctx.depth = arguments[2];
+- if (arguments.length >= 4) ctx.colors = arguments[3];
+- if (isBoolean(opts)) {
+- // legacy...
+- ctx.showHidden = opts;
+- } else if (opts) {
+- // got an "options" object
+- exports._extend(ctx, opts);
+- }
+- // set default options
+- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
+- if (isUndefined(ctx.depth)) ctx.depth = 2;
+- if (isUndefined(ctx.colors)) ctx.colors = false;
+- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
+- if (ctx.colors) ctx.stylize = stylizeWithColor;
+- return formatValue(ctx, obj, ctx.depth);
+-}
+-exports.inspect = inspect;
+-
+-
+-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+-inspect.colors = {
+- 'bold' : [1, 22],
+- 'italic' : [3, 23],
+- 'underline' : [4, 24],
+- 'inverse' : [7, 27],
+- 'white' : [37, 39],
+- 'grey' : [90, 39],
+- 'black' : [30, 39],
+- 'blue' : [34, 39],
+- 'cyan' : [36, 39],
+- 'green' : [32, 39],
+- 'magenta' : [35, 39],
+- 'red' : [31, 39],
+- 'yellow' : [33, 39]
+-};
+-
+-// Don't use 'blue' not visible on cmd.exe
+-inspect.styles = {
+- 'special': 'cyan',
+- 'number': 'yellow',
+- 'boolean': 'yellow',
+- 'undefined': 'grey',
+- 'null': 'bold',
+- 'string': 'green',
+- 'date': 'magenta',
+- // "name": intentionally not styling
+- 'regexp': 'red'
+-};
+-
+-
+-function stylizeWithColor(str, styleType) {
+- var style = inspect.styles[styleType];
+-
+- if (style) {
+- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
+- '\u001b[' + inspect.colors[style][1] + 'm';
+- } else {
+- return str;
+- }
+-}
+-
+-
+-function stylizeNoColor(str, styleType) {
+- return str;
+-}
+-
+-
+-function arrayToHash(array) {
+- var hash = {};
+-
+- array.forEach(function(val, idx) {
+- hash[val] = true;
+- });
+-
+- return hash;
+-}
+-
+-
+-function formatValue(ctx, value, recurseTimes) {
+- // Provide a hook for user-specified inspect functions.
+- // Check that value is an object with an inspect function on it
+- if (ctx.customInspect &&
+- value &&
+- isFunction(value.inspect) &&
+- // Filter out the util module, it's inspect function is special
+- value.inspect !== exports.inspect &&
+- // Also filter out any prototype objects using the circular check.
+- !(value.constructor && value.constructor.prototype === value)) {
+- var ret = value.inspect(recurseTimes, ctx);
+- if (!isString(ret)) {
+- ret = formatValue(ctx, ret, recurseTimes);
+- }
+- return ret;
+- }
+-
+- // Primitive types cannot have properties
+- var primitive = formatPrimitive(ctx, value);
+- if (primitive) {
+- return primitive;
+- }
+-
+- // Look up the keys of the object.
+- var keys = Object.keys(value);
+- var visibleKeys = arrayToHash(keys);
+-
+- if (ctx.showHidden) {
+- keys = Object.getOwnPropertyNames(value);
+- }
+-
+- // Some type of object without properties can be shortcutted.
+- if (keys.length === 0) {
+- if (isFunction(value)) {
+- var name = value.name ? ': ' + value.name : '';
+- return ctx.stylize('[Function' + name + ']', 'special');
+- }
+- if (isRegExp(value)) {
+- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+- }
+- if (isDate(value)) {
+- return ctx.stylize(Date.prototype.toString.call(value), 'date');
+- }
+- if (isError(value)) {
+- return formatError(value);
+- }
+- }
+-
+- var base = '', array = false, braces = ['{', '}'];
+-
+- // Make Array say that they are Array
+- if (isArray(value)) {
+- array = true;
+- braces = ['[', ']'];
+- }
+-
+- // Make functions say that they are functions
+- if (isFunction(value)) {
+- var n = value.name ? ': ' + value.name : '';
+- base = ' [Function' + n + ']';
+- }
+-
+- // Make RegExps say that they are RegExps
+- if (isRegExp(value)) {
+- base = ' ' + RegExp.prototype.toString.call(value);
+- }
+-
+- // Make dates with properties first say the date
+- if (isDate(value)) {
+- base = ' ' + Date.prototype.toUTCString.call(value);
+- }
+-
+- // Make error with message first say the error
+- if (isError(value)) {
+- base = ' ' + formatError(value);
+- }
+-
+- if (keys.length === 0 && (!array || value.length == 0)) {
+- return braces[0] + base + braces[1];
+- }
+-
+- if (recurseTimes < 0) {
+- if (isRegExp(value)) {
+- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+- } else {
+- return ctx.stylize('[Object]', 'special');
+- }
+- }
+-
+- ctx.seen.push(value);
+-
+- var output;
+- if (array) {
+- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
+- } else {
+- output = keys.map(function(key) {
+- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
+- });
+- }
+-
+- ctx.seen.pop();
+-
+- return reduceToSingleString(output, base, braces);
+-}
+-
+-
+-function formatPrimitive(ctx, value) {
+- if (isUndefined(value))
+- return ctx.stylize('undefined', 'undefined');
+- if (isString(value)) {
+- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
+- .replace(/'/g, "\\'")
+- .replace(/\\"/g, '"') + '\'';
+- return ctx.stylize(simple, 'string');
+- }
+- if (isNumber(value)) {
+- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
+- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
+- if (value === 0 && 1 / value < 0)
+- return ctx.stylize('-0', 'number');
+- return ctx.stylize('' + value, 'number');
+- }
+- if (isBoolean(value))
+- return ctx.stylize('' + value, 'boolean');
+- // For some reason typeof null is "object", so special case here.
+- if (isNull(value))
+- return ctx.stylize('null', 'null');
+-}
+-
+-
+-function formatError(value) {
+- return '[' + Error.prototype.toString.call(value) + ']';
+-}
+-
+-
+-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
+- var output = [];
+- for (var i = 0, l = value.length; i < l; ++i) {
+- if (hasOwnProperty(value, String(i))) {
+- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+- String(i), true));
+- } else {
+- output.push('');
+- }
+- }
+- keys.forEach(function(key) {
+- if (!key.match(/^\d+$/)) {
+- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+- key, true));
+- }
+- });
+- return output;
+-}
+-
+-
+-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
+- var name, str, desc;
+- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
+- if (desc.get) {
+- if (desc.set) {
+- str = ctx.stylize('[Getter/Setter]', 'special');
+- } else {
+- str = ctx.stylize('[Getter]', 'special');
+- }
+- } else {
+- if (desc.set) {
+- str = ctx.stylize('[Setter]', 'special');
+- }
+- }
+- if (!hasOwnProperty(visibleKeys, key)) {
+- name = '[' + key + ']';
+- }
+- if (!str) {
+- if (ctx.seen.indexOf(desc.value) < 0) {
+- if (isNull(recurseTimes)) {
+- str = formatValue(ctx, desc.value, null);
+- } else {
+- str = formatValue(ctx, desc.value, recurseTimes - 1);
+- }
+- if (str.indexOf('\n') > -1) {
+- if (array) {
+- str = str.split('\n').map(function(line) {
+- return ' ' + line;
+- }).join('\n').substr(2);
+- } else {
+- str = '\n' + str.split('\n').map(function(line) {
+- return ' ' + line;
+- }).join('\n');
+- }
+- }
+- } else {
+- str = ctx.stylize('[Circular]', 'special');
+- }
+- }
+- if (isUndefined(name)) {
+- if (array && key.match(/^\d+$/)) {
+- return str;
+- }
+- name = JSON.stringify('' + key);
+- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
+- name = name.substr(1, name.length - 2);
+- name = ctx.stylize(name, 'name');
+- } else {
+- name = name.replace(/'/g, "\\'")
+- .replace(/\\"/g, '"')
+- .replace(/(^"|"$)/g, "'");
+- name = ctx.stylize(name, 'string');
+- }
+- }
+-
+- return name + ': ' + str;
+-}
+-
+-
+-function reduceToSingleString(output, base, braces) {
+- var numLinesEst = 0;
+- var length = output.reduce(function(prev, cur) {
+- numLinesEst++;
+- if (cur.indexOf('\n') >= 0) numLinesEst++;
+- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
+- }, 0);
+-
+- if (length > 60) {
+- return braces[0] +
+- (base === '' ? '' : base + '\n ') +
+- ' ' +
+- output.join(',\n ') +
+- ' ' +
+- braces[1];
+- }
+-
+- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
+-}
+-
+-
+ // NOTE: These type checking functions intentionally don't use `instanceof`
+ // because it is fragile and can be easily faked with `Object.create()`.
+ function isArray(ar) {
+@@ -522,166 +98,10 @@ function isPrimitive(arg) {
+ exports.isPrimitive = isPrimitive;
+
+ function isBuffer(arg) {
+- return arg instanceof Buffer;
++ return Buffer.isBuffer(arg);
+ }
+ exports.isBuffer = isBuffer;
+
+ function objectToString(o) {
+ return Object.prototype.toString.call(o);
+-}
+-
+-
+-function pad(n) {
+- return n < 10 ? '0' + n.toString(10) : n.toString(10);
+-}
+-
+-
+-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+- 'Oct', 'Nov', 'Dec'];
+-
+-// 26 Feb 16:19:34
+-function timestamp() {
+- var d = new Date();
+- var time = [pad(d.getHours()),
+- pad(d.getMinutes()),
+- pad(d.getSeconds())].join(':');
+- return [d.getDate(), months[d.getMonth()], time].join(' ');
+-}
+-
+-
+-// log is just a thin wrapper to console.log that prepends a timestamp
+-exports.log = function() {
+- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
+-};
+-
+-
+-/**
+- * Inherit the prototype methods from one constructor into another.
+- *
+- * The Function.prototype.inherits from lang.js rewritten as a standalone
+- * function (not on Function.prototype). NOTE: If this file is to be loaded
+- * during bootstrapping this function needs to be rewritten using some native
+- * functions as prototype setup using normal JavaScript does not work as
+- * expected during bootstrapping (see mirror.js in r114903).
+- *
+- * @param {function} ctor Constructor function which needs to inherit the
+- * prototype.
+- * @param {function} superCtor Constructor function to inherit prototype from.
+- */
+-exports.inherits = function(ctor, superCtor) {
+- ctor.super_ = superCtor;
+- ctor.prototype = Object.create(superCtor.prototype, {
+- constructor: {
+- value: ctor,
+- enumerable: false,
+- writable: true,
+- configurable: true
+- }
+- });
+-};
+-
+-exports._extend = function(origin, add) {
+- // Don't do anything if add isn't an object
+- if (!add || !isObject(add)) return origin;
+-
+- var keys = Object.keys(add);
+- var i = keys.length;
+- while (i--) {
+- origin[keys[i]] = add[keys[i]];
+- }
+- return origin;
+-};
+-
+-function hasOwnProperty(obj, prop) {
+- return Object.prototype.hasOwnProperty.call(obj, prop);
+-}
+-
+-
+-// Deprecated old stuff.
+-
+-exports.p = exports.deprecate(function() {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- console.error(exports.inspect(arguments[i]));
+- }
+-}, 'util.p: Use console.error() instead');
+-
+-
+-exports.exec = exports.deprecate(function() {
+- return require('child_process').exec.apply(this, arguments);
+-}, 'util.exec is now called `child_process.exec`.');
+-
+-
+-exports.print = exports.deprecate(function() {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- process.stdout.write(String(arguments[i]));
+- }
+-}, 'util.print: Use console.log instead');
+-
+-
+-exports.puts = exports.deprecate(function() {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- process.stdout.write(arguments[i] + '\n');
+- }
+-}, 'util.puts: Use console.log instead');
+-
+-
+-exports.debug = exports.deprecate(function(x) {
+- process.stderr.write('DEBUG: ' + x + '\n');
+-}, 'util.debug: Use console.error instead');
+-
+-
+-exports.error = exports.deprecate(function(x) {
+- for (var i = 0, len = arguments.length; i < len; ++i) {
+- process.stderr.write(arguments[i] + '\n');
+- }
+-}, 'util.error: Use console.error instead');
+-
+-
+-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
+- var callbackCalled = false;
+-
+- function call(a, b, c) {
+- if (callback && !callbackCalled) {
+- callback(a, b, c);
+- callbackCalled = true;
+- }
+- }
+-
+- readStream.addListener('data', function(chunk) {
+- if (writeStream.write(chunk) === false) readStream.pause();
+- });
+-
+- writeStream.addListener('drain', function() {
+- readStream.resume();
+- });
+-
+- readStream.addListener('end', function() {
+- writeStream.end();
+- });
+-
+- readStream.addListener('close', function() {
+- call();
+- });
+-
+- readStream.addListener('error', function(err) {
+- writeStream.end();
+- call(err);
+- });
+-
+- writeStream.addListener('error', function(err) {
+- readStream.destroy();
+- call(err);
+- });
+-}, 'util.pump(): Use readableStream.pipe() instead');
+-
+-
+-var uv;
+-exports._errnoException = function(err, syscall) {
+- if (isUndefined(uv)) uv = process.binding('uv');
+- var errname = uv.errname(err);
+- var e = new Error(syscall + ' ' + errname);
+- e.code = errname;
+- e.errno = errname;
+- e.syscall = syscall;
+- return e;
+-};
++} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
new file mode 100644
index 0000000000..ff4c851c07
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js
@@ -0,0 +1,107 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// NOTE: These type checking functions intentionally don't use `instanceof`
+// because it is fragile and can be easily faked with `Object.create()`.
+
+function isArray(arg) {
+ if (Array.isArray) {
+ return Array.isArray(arg);
+ }
+ return objectToString(arg) === '[object Array]';
+}
+exports.isArray = isArray;
+
+function isBoolean(arg) {
+ return typeof arg === 'boolean';
+}
+exports.isBoolean = isBoolean;
+
+function isNull(arg) {
+ return arg === null;
+}
+exports.isNull = isNull;
+
+function isNullOrUndefined(arg) {
+ return arg == null;
+}
+exports.isNullOrUndefined = isNullOrUndefined;
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+exports.isNumber = isNumber;
+
+function isString(arg) {
+ return typeof arg === 'string';
+}
+exports.isString = isString;
+
+function isSymbol(arg) {
+ return typeof arg === 'symbol';
+}
+exports.isSymbol = isSymbol;
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+exports.isUndefined = isUndefined;
+
+function isRegExp(re) {
+ return objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+ return objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+ return (objectToString(e) === '[object Error]' || e instanceof Error);
+}
+exports.isError = isError;
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+exports.isFunction = isFunction;
+
+function isPrimitive(arg) {
+ return arg === null ||
+ typeof arg === 'boolean' ||
+ typeof arg === 'number' ||
+ typeof arg === 'string' ||
+ typeof arg === 'symbol' || // ES6 symbol
+ typeof arg === 'undefined';
+}
+exports.isPrimitive = isPrimitive;
+
+exports.isBuffer = Buffer.isBuffer;
+
+function objectToString(o) {
+ return Object.prototype.toString.call(o);
+}
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..1be49d90f5
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
@@ -0,0 +1,88 @@
+{
+ "_args": [
+ [
+ "core-util-is@~1.0.0",
+ "/Users/rebecca/code/npm/node_modules/readable-stream"
+ ],
+ [
+ "core-util-is@~1.0.0",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream"
+ ]
+ ],
+ "_from": "core-util-is@>=1.0.0 <1.1.0",
+ "_id": "core-util-is@1.0.2",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/bl/readable-stream/core-util-is",
+ "_nodeVersion": "4.0.0",
+ "_npmUser": {
+ "email": "i@izs.me",
+ "name": "isaacs"
+ },
+ "_npmVersion": "3.3.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "core-util-is",
+ "raw": "core-util-is@~1.0.0",
+ "rawSpec": "~1.0.0",
+ "scope": null,
+ "spec": ">=1.0.0 <1.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/bl/readable-stream"
+ ],
+ "_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",
+ "url": "http://blog.izs.me/"
+ },
+ "bugs": {
+ "url": "https://github.com/isaacs/core-util-is/issues"
+ },
+ "dependencies": {},
+ "description": "The `util.is*` functions introduced in Node v0.12.",
+ "devDependencies": {
+ "tap": "^2.3.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
+ "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
+ },
+ "gitHead": "a177da234df5638b363ddc15fa324619a38577c8",
+ "homepage": "https://github.com/isaacs/core-util-is#readme",
+ "keywords": [
+ "util",
+ "isBuffer",
+ "isArray",
+ "isNumber",
+ "isString",
+ "isRegExp",
+ "isThis",
+ "isThat",
+ "polyfill"
+ ],
+ "license": "MIT",
+ "main": "lib/util.js",
+ "maintainers": [
+ {
+ "email": "i@izs.me",
+ "name": "isaacs"
+ }
+ ],
+ "name": "core-util-is",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/core-util-is.git"
+ },
+ "scripts": {
+ "test": "tap test.js"
+ },
+ "version": "1.0.2"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js
new file mode 100644
index 0000000000..1a490c65ac
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js
@@ -0,0 +1,68 @@
+var assert = require('tap');
+
+var t = require('./lib/util');
+
+assert.equal(t.isArray([]), true);
+assert.equal(t.isArray({}), false);
+
+assert.equal(t.isBoolean(null), false);
+assert.equal(t.isBoolean(true), true);
+assert.equal(t.isBoolean(false), true);
+
+assert.equal(t.isNull(null), true);
+assert.equal(t.isNull(undefined), false);
+assert.equal(t.isNull(false), false);
+assert.equal(t.isNull(), false);
+
+assert.equal(t.isNullOrUndefined(null), true);
+assert.equal(t.isNullOrUndefined(undefined), true);
+assert.equal(t.isNullOrUndefined(false), false);
+assert.equal(t.isNullOrUndefined(), true);
+
+assert.equal(t.isNumber(null), false);
+assert.equal(t.isNumber('1'), false);
+assert.equal(t.isNumber(1), true);
+
+assert.equal(t.isString(null), false);
+assert.equal(t.isString('1'), true);
+assert.equal(t.isString(1), false);
+
+assert.equal(t.isSymbol(null), false);
+assert.equal(t.isSymbol('1'), false);
+assert.equal(t.isSymbol(1), false);
+assert.equal(t.isSymbol(Symbol()), true);
+
+assert.equal(t.isUndefined(null), false);
+assert.equal(t.isUndefined(undefined), true);
+assert.equal(t.isUndefined(false), false);
+assert.equal(t.isUndefined(), true);
+
+assert.equal(t.isRegExp(null), false);
+assert.equal(t.isRegExp('1'), false);
+assert.equal(t.isRegExp(new RegExp()), true);
+
+assert.equal(t.isObject({}), true);
+assert.equal(t.isObject([]), true);
+assert.equal(t.isObject(new RegExp()), true);
+assert.equal(t.isObject(new Date()), true);
+
+assert.equal(t.isDate(null), false);
+assert.equal(t.isDate('1'), false);
+assert.equal(t.isDate(new Date()), true);
+
+assert.equal(t.isError(null), false);
+assert.equal(t.isError({ err: true }), false);
+assert.equal(t.isError(new Error()), true);
+
+assert.equal(t.isFunction(null), false);
+assert.equal(t.isFunction({ }), false);
+assert.equal(t.isFunction(function() {}), true);
+
+assert.equal(t.isPrimitive(null), true);
+assert.equal(t.isPrimitive(''), true);
+assert.equal(t.isPrimitive(0), true);
+assert.equal(t.isPrimitive(new Date()), false);
+
+assert.equal(t.isBuffer(null), false);
+assert.equal(t.isBuffer({}), false);
+assert.equal(t.isBuffer(new Buffer(0)), true);
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore
new file mode 100644
index 0000000000..3c3629e647
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml
new file mode 100644
index 0000000000..cc4dba29d9
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
diff --git a/deps/npm/node_modules/request/node_modules/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
new file mode 100644
index 0000000000..0ecc29c402
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile
@@ -0,0 +1,5 @@
+
+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/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
new file mode 100644
index 0000000000..16d2c59c61
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
@@ -0,0 +1,60 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
+[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
+
+[![browser support](https://ci.testling.com/juliangruber/isarray.png)
+](https://ci.testling.com/juliangruber/isarray)
+
+## Usage
+
+```js
+var isArray = require('isarray');
+
+console.log(isArray([])); // => true
+console.log(isArray({})); // => false
+```
+
+## Installation
+
+With [npm](http://npmjs.org) do
+
+```bash
+$ npm install isarray
+```
+
+Then bundle for the browser with
+[browserify](https://github.com/substack/browserify).
+
+With [component](http://component.io) do
+
+```bash
+$ component install juliangruber/isarray
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+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/bl/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json
new file mode 100644
index 0000000000..9e31b68388
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json
@@ -0,0 +1,19 @@
+{
+ "name" : "isarray",
+ "description" : "Array#isArray for older browsers",
+ "version" : "0.0.1",
+ "repository" : "juliangruber/isarray",
+ "homepage": "https://github.com/juliangruber/isarray",
+ "main" : "index.js",
+ "scripts" : [
+ "index.js"
+ ],
+ "dependencies" : {},
+ "keywords": ["browser","isarray","array"],
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "license": "MIT"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
new file mode 100644
index 0000000000..a57f634959
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
@@ -0,0 +1,5 @@
+var toString = {}.toString;
+
+module.exports = Array.isArray || function (arr) {
+ return toString.call(arr) == '[object Array]';
+};
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
new file mode 100644
index 0000000000..b8f76c40e4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json
@@ -0,0 +1,98 @@
+{
+ "_args": [
+ [
+ "isarray@~1.0.0",
+ "/Users/rebecca/code/npm/node_modules/readable-stream"
+ ],
+ [
+ "isarray@~1.0.0",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream"
+ ]
+ ],
+ "_from": "isarray@>=1.0.0 <1.1.0",
+ "_id": "isarray@1.0.0",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/bl/readable-stream/isarray",
+ "_nodeVersion": "5.1.0",
+ "_npmUser": {
+ "email": "julian@juliangruber.com",
+ "name": "juliangruber"
+ },
+ "_npmVersion": "3.3.12",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "isarray",
+ "raw": "isarray@~1.0.0",
+ "rawSpec": "~1.0.0",
+ "scope": null,
+ "spec": ">=1.0.0 <1.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/bl/readable-stream"
+ ],
+ "_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",
+ "url": "http://juliangruber.com"
+ },
+ "bugs": {
+ "url": "https://github.com/juliangruber/isarray/issues"
+ },
+ "dependencies": {},
+ "description": "Array#isArray for older browsers",
+ "devDependencies": {
+ "tape": "~2.13.4"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "bb935d48582cba168c06834957a54a3e07124f11",
+ "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz"
+ },
+ "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33",
+ "homepage": "https://github.com/juliangruber/isarray",
+ "keywords": [
+ "browser",
+ "isarray",
+ "array"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "email": "julian@juliangruber.com",
+ "name": "juliangruber"
+ }
+ ],
+ "name": "isarray",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/isarray.git"
+ },
+ "scripts": {
+ "test": "tape test.js"
+ },
+ "testling": {
+ "browsers": [
+ "ie/8..latest",
+ "firefox/17..latest",
+ "firefox/nightly",
+ "chrome/22..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ],
+ "files": "test.js"
+ },
+ "version": "1.0.0"
+}
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..f7f7bcd19f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js
@@ -0,0 +1,19 @@
+var isArray = require('./');
+var test = require('tape');
+
+test('is array', function(t){
+ t.ok(isArray([]));
+ t.notOk(isArray({}));
+ t.notOk(isArray(null));
+ t.notOk(isArray(false));
+
+ var obj = {};
+ obj[0] = true;
+ t.notOk(isArray(obj));
+
+ var arr = [];
+ arr.foo = 'bar';
+ t.ok(isArray(arr));
+
+ t.end();
+});
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
new file mode 100644
index 0000000000..36201b1001
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml
@@ -0,0 +1,12 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.11"
+ - "0.12"
+ - "1.7.1"
+ - 1
+ - 2
+ - 3
+ - 4
+ - 5
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..571c276783
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js
@@ -0,0 +1,20 @@
+'use strict';
+
+if (!process.version ||
+ process.version.indexOf('v0.') === 0 ||
+ process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
+ module.exports = nextTick;
+} else {
+ module.exports = process.nextTick;
+}
+
+function nextTick(fn) {
+ var args = new Array(arguments.length - 1);
+ var i = 0;
+ while (i < args.length) {
+ args[i++] = arguments[i];
+ }
+ 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/license.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md
new file mode 100644
index 0000000000..c67e3532b5
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md
@@ -0,0 +1,19 @@
+# Copyright (c) 2015 Calvin Metcalf
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.**
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..bae43acf21
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json
@@ -0,0 +1,73 @@
+{
+ "_args": [
+ [
+ "process-nextick-args@~1.0.6",
+ "/Users/rebecca/code/npm/node_modules/readable-stream"
+ ],
+ [
+ "process-nextick-args@~1.0.6",
+ "/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",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/bl/readable-stream/process-nextick-args",
+ "_nodeVersion": "4.1.1",
+ "_npmUser": {
+ "email": "calvin.metcalf@gmail.com",
+ "name": "cwmma"
+ },
+ "_npmVersion": "2.14.4",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "process-nextick-args",
+ "raw": "process-nextick-args@~1.0.6",
+ "rawSpec": "~1.0.6",
+ "scope": null,
+ "spec": ">=1.0.6 <1.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/bl/readable-stream"
+ ],
+ "_shrinkwrap": null,
+ "_spec": "process-nextick-args@~1.0.6",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream",
+ "author": "",
+ "bugs": {
+ "url": "https://github.com/calvinmetcalf/process-nextick-args/issues"
+ },
+ "dependencies": {},
+ "description": "process.nextTick but always with args",
+ "devDependencies": {
+ "tap": "~0.2.6"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05",
+ "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz"
+ },
+ "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78",
+ "homepage": "https://github.com/calvinmetcalf/process-nextick-args",
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "email": "calvin.metcalf@gmail.com",
+ "name": "cwmma"
+ }
+ ],
+ "name": "process-nextick-args",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "version": "1.0.6"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md
new file mode 100644
index 0000000000..78e7cfaeb7
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md
@@ -0,0 +1,18 @@
+process-nextick-args
+=====
+
+[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)
+
+```bash
+npm install --save process-nextick-args
+```
+
+Always be able to pass arguments to process.nextTick, no matter the platform
+
+```js
+var nextTick = require('process-nextick-args');
+
+nextTick(function (a, b, c) {
+ console.log(a, b, c);
+}, 'step', 3, 'profit');
+```
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js
new file mode 100644
index 0000000000..ef15721584
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js
@@ -0,0 +1,24 @@
+var test = require("tap").test;
+var nextTick = require('./');
+
+test('should work', function (t) {
+ t.plan(5);
+ nextTick(function (a) {
+ t.ok(a);
+ nextTick(function (thing) {
+ t.equals(thing, 7);
+ }, 7);
+ }, true);
+ nextTick(function (a, b, c) {
+ t.equals(a, 'step');
+ t.equals(b, 3);
+ t.equals(c, 'profit');
+ }, 'step', 3, 'profit');
+});
+
+test('correct number of arguments', function (t) {
+ t.plan(1);
+ nextTick(function () {
+ t.equals(2, arguments.length, 'correct number');
+ }, 1, 2);
+});
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore
new file mode 100644
index 0000000000..206320cc1d
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore
@@ -0,0 +1,2 @@
+build
+test
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE
new file mode 100644
index 0000000000..6de584a48f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE
@@ -0,0 +1,20 @@
+Copyright Joyent, Inc. and other Node contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md
new file mode 100644
index 0000000000..4d2aa00150
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md
@@ -0,0 +1,7 @@
+**string_decoder.js** (`require('string_decoder')`) from Node.js core
+
+Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
+
+Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
+
+The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js
new file mode 100644
index 0000000000..b00e54fb79
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js
@@ -0,0 +1,221 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+var Buffer = require('buffer').Buffer;
+
+var isBufferEncoding = Buffer.isEncoding
+ || function(encoding) {
+ switch (encoding && encoding.toLowerCase()) {
+ case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
+ default: return false;
+ }
+ }
+
+
+function assertEncoding(encoding) {
+ if (encoding && !isBufferEncoding(encoding)) {
+ throw new Error('Unknown encoding: ' + encoding);
+ }
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters. CESU-8 is handled as part of the UTF-8 encoding.
+//
+// @TODO Handling all encodings inside a single object makes it very difficult
+// to reason about this code, so it should be split up in the future.
+// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
+// points as used by CESU-8.
+var StringDecoder = exports.StringDecoder = function(encoding) {
+ this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
+ assertEncoding(encoding);
+ switch (this.encoding) {
+ case 'utf8':
+ // CESU-8 represents each of Surrogate Pair by 3-bytes
+ this.surrogateSize = 3;
+ break;
+ case 'ucs2':
+ case 'utf16le':
+ // UTF-16 represents each of Surrogate Pair by 2-bytes
+ this.surrogateSize = 2;
+ this.detectIncompleteChar = utf16DetectIncompleteChar;
+ break;
+ case 'base64':
+ // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
+ this.surrogateSize = 3;
+ this.detectIncompleteChar = base64DetectIncompleteChar;
+ break;
+ default:
+ this.write = passThroughWrite;
+ return;
+ }
+
+ // Enough space to store all bytes of a single character. UTF-8 needs 4
+ // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
+ this.charBuffer = new Buffer(6);
+ // Number of bytes received for the current incomplete multi-byte character.
+ this.charReceived = 0;
+ // Number of bytes expected for the current incomplete multi-byte character.
+ this.charLength = 0;
+};
+
+
+// write decodes the given buffer and returns it as JS string that is
+// guaranteed to not contain any partial multi-byte characters. Any partial
+// character found at the end of the buffer is buffered up, and will be
+// returned when calling write again with the remaining bytes.
+//
+// Note: Converting a Buffer containing an orphan surrogate to a String
+// currently works, but converting a String to a Buffer (via `new Buffer`, or
+// Buffer#write) will replace incomplete surrogates with the unicode
+// replacement character. See https://codereview.chromium.org/121173009/ .
+StringDecoder.prototype.write = function(buffer) {
+ var charStr = '';
+ // if our last write ended with an incomplete multibyte character
+ while (this.charLength) {
+ // determine how many remaining bytes this buffer has to offer for this char
+ var available = (buffer.length >= this.charLength - this.charReceived) ?
+ this.charLength - this.charReceived :
+ buffer.length;
+
+ // add the new bytes to the char buffer
+ buffer.copy(this.charBuffer, this.charReceived, 0, available);
+ this.charReceived += available;
+
+ if (this.charReceived < this.charLength) {
+ // still not enough chars in this buffer? wait for more ...
+ return '';
+ }
+
+ // remove bytes belonging to the current character from the buffer
+ buffer = buffer.slice(available, buffer.length);
+
+ // get the character that was split
+ charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
+
+ // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
+ var charCode = charStr.charCodeAt(charStr.length - 1);
+ if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+ this.charLength += this.surrogateSize;
+ charStr = '';
+ continue;
+ }
+ this.charReceived = this.charLength = 0;
+
+ // if there are no more bytes in this buffer, just emit our char
+ if (buffer.length === 0) {
+ return charStr;
+ }
+ break;
+ }
+
+ // determine and set charLength / charReceived
+ this.detectIncompleteChar(buffer);
+
+ var end = buffer.length;
+ if (this.charLength) {
+ // buffer the incomplete character bytes we got
+ buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
+ end -= this.charReceived;
+ }
+
+ charStr += buffer.toString(this.encoding, 0, end);
+
+ var end = charStr.length - 1;
+ var charCode = charStr.charCodeAt(end);
+ // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
+ if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+ var size = this.surrogateSize;
+ this.charLength += size;
+ this.charReceived += size;
+ this.charBuffer.copy(this.charBuffer, size, 0, size);
+ buffer.copy(this.charBuffer, 0, 0, size);
+ return charStr.substring(0, end);
+ }
+
+ // or just emit the charStr
+ return charStr;
+};
+
+// detectIncompleteChar determines if there is an incomplete UTF-8 character at
+// the end of the given buffer. If so, it sets this.charLength to the byte
+// length that character, and sets this.charReceived to the number of bytes
+// that are available for this character.
+StringDecoder.prototype.detectIncompleteChar = function(buffer) {
+ // determine how many bytes we have to check at the end of this buffer
+ var i = (buffer.length >= 3) ? 3 : buffer.length;
+
+ // Figure out if one of the last i bytes of our buffer announces an
+ // incomplete char.
+ for (; i > 0; i--) {
+ var c = buffer[buffer.length - i];
+
+ // See http://en.wikipedia.org/wiki/UTF-8#Description
+
+ // 110XXXXX
+ if (i == 1 && c >> 5 == 0x06) {
+ this.charLength = 2;
+ break;
+ }
+
+ // 1110XXXX
+ if (i <= 2 && c >> 4 == 0x0E) {
+ this.charLength = 3;
+ break;
+ }
+
+ // 11110XXX
+ if (i <= 3 && c >> 3 == 0x1E) {
+ this.charLength = 4;
+ break;
+ }
+ }
+ this.charReceived = i;
+};
+
+StringDecoder.prototype.end = function(buffer) {
+ var res = '';
+ if (buffer && buffer.length)
+ res = this.write(buffer);
+
+ if (this.charReceived) {
+ var cr = this.charReceived;
+ var buf = this.charBuffer;
+ var enc = this.encoding;
+ res += buf.slice(0, cr).toString(enc);
+ }
+
+ return res;
+};
+
+function passThroughWrite(buffer) {
+ return buffer.toString(this.encoding);
+}
+
+function utf16DetectIncompleteChar(buffer) {
+ this.charReceived = buffer.length % 2;
+ this.charLength = this.charReceived ? 2 : 0;
+}
+
+function base64DetectIncompleteChar(buffer) {
+ this.charReceived = buffer.length % 3;
+ this.charLength = this.charReceived ? 3 : 0;
+}
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..977e5976d6
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
@@ -0,0 +1,81 @@
+{
+ "_args": [
+ [
+ "string_decoder@~0.10.x",
+ "/Users/rebecca/code/npm/node_modules/readable-stream"
+ ],
+ [
+ "string_decoder@~0.10.x",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream"
+ ]
+ ],
+ "_from": "string_decoder@>=0.10.0 <0.11.0",
+ "_id": "string_decoder@0.10.31",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/bl/readable-stream/string_decoder",
+ "_npmUser": {
+ "email": "rod@vagg.org",
+ "name": "rvagg"
+ },
+ "_npmVersion": "1.4.23",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "string_decoder",
+ "raw": "string_decoder@~0.10.x",
+ "rawSpec": "~0.10.x",
+ "scope": null,
+ "spec": ">=0.10.0 <0.11.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/bl/readable-stream"
+ ],
+ "_shrinkwrap": null,
+ "_spec": "string_decoder@~0.10.x",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream",
+ "bugs": {
+ "url": "https://github.com/rvagg/string_decoder/issues"
+ },
+ "dependencies": {},
+ "description": "The string_decoder module from Node core",
+ "devDependencies": {
+ "tap": "~0.4.8"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+ "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
+ },
+ "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
+ "homepage": "https://github.com/rvagg/string_decoder",
+ "keywords": [
+ "string",
+ "decoder",
+ "browser",
+ "browserify"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "email": "mail@substack.net",
+ "name": "substack"
+ },
+ {
+ "email": "rod@vagg.org",
+ "name": "rvagg"
+ }
+ ],
+ "name": "string_decoder",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/rvagg/string_decoder.git"
+ },
+ "scripts": {
+ "test": "tap test/simple/*.js"
+ },
+ "version": "0.10.31"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md
new file mode 100644
index 0000000000..acc8675372
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md
@@ -0,0 +1,16 @@
+
+1.0.2 / 2015-10-07
+==================
+
+ * use try/catch when checking `localStorage` (#3, @kumavis)
+
+1.0.1 / 2014-11-25
+==================
+
+ * browser: use `console.warn()` for deprecation calls
+ * browser: more jsdocs
+
+1.0.0 / 2014-04-30
+==================
+
+ * initial commit
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE
new file mode 100644
index 0000000000..6a60e8c225
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2014 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/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md
new file mode 100644
index 0000000000..75622fa7c2
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md
@@ -0,0 +1,53 @@
+util-deprecate
+==============
+### The Node.js `util.deprecate()` function with browser support
+
+In Node.js, this module simply re-exports the `util.deprecate()` function.
+
+In the web browser (i.e. via browserify), a browser-specific implementation
+of the `util.deprecate()` function is used.
+
+
+## API
+
+A `deprecate()` function is the only thing exposed by this module.
+
+``` javascript
+// setup:
+exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
+
+
+// users see:
+foo();
+// foo() is deprecated, use bar() instead
+foo();
+foo();
+```
+
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <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/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js
new file mode 100644
index 0000000000..549ae2f065
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js
@@ -0,0 +1,67 @@
+
+/**
+ * Module exports.
+ */
+
+module.exports = deprecate;
+
+/**
+ * Mark that a method should not be used.
+ * Returns a modified function which warns once by default.
+ *
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
+ *
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
+ * will throw an Error when invoked.
+ *
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
+ * will invoke `console.trace()` instead of `console.error()`.
+ *
+ * @param {Function} fn - the function to deprecate
+ * @param {String} msg - the string to print to the console when `fn` is invoked
+ * @returns {Function} a new "deprecated" version of `fn`
+ * @api public
+ */
+
+function deprecate (fn, msg) {
+ if (config('noDeprecation')) {
+ return fn;
+ }
+
+ var warned = false;
+ function deprecated() {
+ if (!warned) {
+ if (config('throwDeprecation')) {
+ throw new Error(msg);
+ } else if (config('traceDeprecation')) {
+ console.trace(msg);
+ } else {
+ console.warn(msg);
+ }
+ warned = true;
+ }
+ return fn.apply(this, arguments);
+ }
+
+ return deprecated;
+}
+
+/**
+ * Checks `localStorage` for boolean values for the given `name`.
+ *
+ * @param {String} name
+ * @returns {Boolean}
+ * @api private
+ */
+
+function config (name) {
+ // accessing global.localStorage can trigger a DOMException in sandboxed iframes
+ try {
+ if (!global.localStorage) return false;
+ } catch (_) {
+ return false;
+ }
+ var val = global.localStorage[name];
+ if (null == val) return false;
+ return String(val).toLowerCase() === 'true';
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js
new file mode 100644
index 0000000000..5e6fcff5dd
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js
@@ -0,0 +1,6 @@
+
+/**
+ * For Node.js, simply re-export the core `util.deprecate` function.
+ */
+
+module.exports = require('util').deprecate;
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
new file mode 100644
index 0000000000..63869c0e04
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json
@@ -0,0 +1,83 @@
+{
+ "_args": [
+ [
+ "util-deprecate@~1.0.1",
+ "/Users/rebecca/code/npm/node_modules/readable-stream"
+ ],
+ [
+ "util-deprecate@~1.0.1",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream"
+ ]
+ ],
+ "_from": "util-deprecate@>=1.0.1 <1.1.0",
+ "_id": "util-deprecate@1.0.2",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/bl/readable-stream/util-deprecate",
+ "_nodeVersion": "4.1.2",
+ "_npmUser": {
+ "email": "nathan@tootallnate.net",
+ "name": "tootallnate"
+ },
+ "_npmVersion": "2.14.4",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "util-deprecate",
+ "raw": "util-deprecate@~1.0.1",
+ "rawSpec": "~1.0.1",
+ "scope": null,
+ "spec": ">=1.0.1 <1.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/bl/readable-stream"
+ ],
+ "_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",
+ "url": "http://n8.io/"
+ },
+ "browser": "browser.js",
+ "bugs": {
+ "url": "https://github.com/TooTallNate/util-deprecate/issues"
+ },
+ "dependencies": {},
+ "description": "The Node.js `util.deprecate()` function with browser support",
+ "devDependencies": {},
+ "directories": {},
+ "dist": {
+ "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
+ "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
+ },
+ "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4",
+ "homepage": "https://github.com/TooTallNate/util-deprecate",
+ "keywords": [
+ "util",
+ "deprecate",
+ "browserify",
+ "browser",
+ "node"
+ ],
+ "license": "MIT",
+ "main": "node.js",
+ "maintainers": [
+ {
+ "email": "nathan@tootallnate.net",
+ "name": "tootallnate"
+ }
+ ],
+ "name": "util-deprecate",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/util-deprecate.git"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "version": "1.0.2"
+}
diff --git a/deps/npm/node_modules/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
new file mode 100644
index 0000000000..f818ebf1b6
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
@@ -0,0 +1,105 @@
+{
+ "_args": [
+ [
+ "readable-stream@~2.0.5",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/bl"
+ ]
+ ],
+ "_from": "readable-stream@>=2.0.5 <2.1.0",
+ "_id": "readable-stream@2.0.6",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/bl/readable-stream",
+ "_nodeVersion": "5.7.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445"
+ },
+ "_npmUser": {
+ "email": "calvin.metcalf@gmail.com",
+ "name": "cwmma"
+ },
+ "_npmVersion": "3.6.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "readable-stream",
+ "raw": "readable-stream@~2.0.5",
+ "rawSpec": "~2.0.5",
+ "scope": null,
+ "spec": ">=2.0.5 <2.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/bl"
+ ],
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz",
+ "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e",
+ "_shrinkwrap": null,
+ "_spec": "readable-stream@~2.0.5",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl",
+ "browser": {
+ "util": false
+ },
+ "bugs": {
+ "url": "https://github.com/nodejs/readable-stream/issues"
+ },
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.1",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~1.0.6",
+ "string_decoder": "~0.10.x",
+ "util-deprecate": "~1.0.1"
+ },
+ "description": "Streams3, a user-land copy of the stream library from Node.js",
+ "devDependencies": {
+ "tap": "~0.2.6",
+ "tape": "~4.5.1",
+ "zuul": "~3.9.0"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e",
+ "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz"
+ },
+ "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e",
+ "homepage": "https://github.com/nodejs/readable-stream#readme",
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "license": "MIT",
+ "main": "readable.js",
+ "maintainers": [
+ {
+ "email": "isaacs@npmjs.com",
+ "name": "isaacs"
+ },
+ {
+ "email": "nathan@tootallnate.net",
+ "name": "tootallnate"
+ },
+ {
+ "email": "rod@vagg.org",
+ "name": "rvagg"
+ },
+ {
+ "email": "calvin.metcalf@gmail.com",
+ "name": "cwmma"
+ }
+ ],
+ "name": "readable-stream",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/readable-stream.git"
+ },
+ "scripts": {
+ "browser": "npm run write-zuul && zuul -- test/browser.js",
+ "test": "tap test/parallel/*.js test/ours/*.js",
+ "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml"
+ },
+ "version": "2.0.6"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js
new file mode 100644
index 0000000000..27e8d8a551
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_passthrough.js")
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
new file mode 100644
index 0000000000..6222a57986
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
@@ -0,0 +1,12 @@
+var Stream = (function (){
+ try {
+ return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
+ } catch(_){}
+}());
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = Stream || exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js
new file mode 100644
index 0000000000..5d482f0780
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_transform.js")
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js
new file mode 100644
index 0000000000..e1e9efdf3c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_writable.js")
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 61b85c1393..09ebb7b741 100644
--- a/deps/npm/node_modules/request/node_modules/bl/package.json
+++ b/deps/npm/node_modules/request/node_modules/bl/package.json
@@ -1,16 +1,20 @@
{
"_args": [
[
- "bl@~1.0.0",
+ "bl@~1.1.2",
"/Users/rebecca/code/npm/node_modules/request"
]
],
- "_from": "bl@>=1.0.0 <1.1.0",
- "_id": "bl@1.0.1",
+ "_from": "bl@>=1.1.2 <1.2.0",
+ "_id": "bl@1.1.2",
"_inCache": true,
"_installable": true,
"_location": "/request/bl",
- "_nodeVersion": "6.0.0-nightly2016011666b9c0d8bd",
+ "_nodeVersion": "5.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/bl-1.1.2.tgz_1455246621698_0.6300242957659066"
+ },
"_npmUser": {
"email": "rod@vagg.org",
"name": "rvagg"
@@ -19,24 +23,24 @@
"_phantomChildren": {},
"_requested": {
"name": "bl",
- "raw": "bl@~1.0.0",
- "rawSpec": "~1.0.0",
+ "raw": "bl@~1.1.2",
+ "rawSpec": "~1.1.2",
"scope": null,
- "spec": ">=1.0.0 <1.1.0",
+ "spec": ">=1.1.2 <1.2.0",
"type": "range"
},
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.1.tgz",
- "_shasum": "0e6df7330308c46515751676cafa7334dc9852fd",
+ "_resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz",
+ "_shasum": "fdca871a99713aa00d19e3bbba41c44787a65398",
"_shrinkwrap": null,
- "_spec": "bl@~1.0.0",
+ "_spec": "bl@~1.1.2",
"_where": "/Users/rebecca/code/npm/node_modules/request",
"authors": [
- "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)",
+ "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
- "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)"
+ "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)"
],
"bugs": {
"url": "https://github.com/rvagg/bl/issues"
@@ -46,30 +50,29 @@
},
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
"devDependencies": {
- "brtapsauce": "~0.3.0",
- "faucet": "~0.0.1",
+ "faucet": "0.0.1",
"hash_file": "~0.1.1",
- "tape": "~2.12.3"
+ "tape": "~4.4.0"
},
"directories": {},
"dist": {
- "shasum": "0e6df7330308c46515751676cafa7334dc9852fd",
- "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.1.tgz"
+ "shasum": "fdca871a99713aa00d19e3bbba41c44787a65398",
+ "tarball": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz"
},
- "gitHead": "9eced07e8c4f4b44b42e6e99ac33d4c390b4e74a",
+ "gitHead": "ea42021059dc65fc60d7f4b9217c73431f09d23d",
"homepage": "https://github.com/rvagg/bl",
"keywords": [
- "awesomesauce",
"buffer",
"buffers",
- "stream"
+ "stream",
+ "awesomesauce"
],
"license": "MIT",
"main": "bl.js",
"maintainers": [
{
- "name": "rvagg",
- "email": "rod@vagg.org"
+ "email": "rod@vagg.org",
+ "name": "rvagg"
}
],
"name": "bl",
@@ -80,8 +83,7 @@
"url": "git+https://github.com/rvagg/bl.git"
},
"scripts": {
- "test": "node test/test.js | faucet",
- "test-local": "brtapsauce-local test/basic-test.js"
+ "test": "node test/test.js | faucet"
},
- "version": "1.0.1"
+ "version": "1.1.2"
}
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js b/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js
deleted file mode 100644
index 92572642ff..0000000000
--- a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js
+++ /dev/null
@@ -1,557 +0,0 @@
-var tape = require('tape')
- , crypto = require('crypto')
- , fs = require('fs')
- , hash = require('hash_file')
- , BufferList = require('../')
-
- , encodings =
- ('hex utf8 utf-8 ascii binary base64'
- + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-
-tape('single bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
-
- t.end()
-})
-
-tape('single bytes from multiple buffers', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
- t.equal(bl.get(4), 101)
- t.equal(bl.get(5), 102)
- t.equal(bl.get(6), 103)
- t.equal(bl.get(7), 104)
- t.equal(bl.get(8), 105)
- t.equal(bl.get(9), 106)
- t.end()
-})
-
-tape('multi bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
- t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
- t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffer lists', function (t) {
- var bl = new BufferList()
-
- bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
- bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('consuming from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- bl.consume(3)
- t.equal(bl.length, 7)
- t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
-
- bl.consume(2)
- t.equal(bl.length, 5)
- t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
-
- bl.consume(1)
- t.equal(bl.length, 4)
- t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
-
- bl.consume(1)
- t.equal(bl.length, 3)
- t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
-
- bl.consume(2)
- t.equal(bl.length, 1)
- t.equal(bl.slice(0, 1).toString('ascii'), 'j')
-
- t.end()
-})
-
-tape('test readUInt8 / readInt8', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt8(2), 0x3)
- t.equal(bl.readInt8(2), 0x3)
- t.equal(bl.readUInt8(3), 0x4)
- t.equal(bl.readInt8(3), 0x4)
- t.equal(bl.readUInt8(4), 0x23)
- t.equal(bl.readInt8(4), 0x23)
- t.equal(bl.readUInt8(5), 0x42)
- t.equal(bl.readInt8(5), 0x42)
- t.end()
-})
-
-tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt16BE(2), 0x0304)
- t.equal(bl.readUInt16LE(2), 0x0403)
- t.equal(bl.readInt16BE(2), 0x0304)
- t.equal(bl.readInt16LE(2), 0x0403)
- t.equal(bl.readUInt16BE(3), 0x0423)
- t.equal(bl.readUInt16LE(3), 0x2304)
- t.equal(bl.readInt16BE(3), 0x0423)
- t.equal(bl.readInt16LE(3), 0x2304)
- t.equal(bl.readUInt16BE(4), 0x2342)
- t.equal(bl.readUInt16LE(4), 0x4223)
- t.equal(bl.readInt16BE(4), 0x2342)
- t.equal(bl.readInt16LE(4), 0x4223)
- t.end()
-})
-
-tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt32BE(2), 0x03042342)
- t.equal(bl.readUInt32LE(2), 0x42230403)
- t.equal(bl.readInt32BE(2), 0x03042342)
- t.equal(bl.readInt32LE(2), 0x42230403)
- t.end()
-})
-
-tape('test readFloatLE / readFloatBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x00
- buf2[2] = 0x00
- buf3[0] = 0x80
- buf3[1] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readFloatLE(2), 0x01)
- t.end()
-})
-
-tape('test readDoubleLE / readDoubleBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(10)
- , bl = new BufferList()
-
- buf2[1] = 0x55
- buf2[2] = 0x55
- buf3[0] = 0x55
- buf3[1] = 0x55
- buf3[2] = 0x55
- buf3[3] = 0x55
- buf3[4] = 0xd5
- buf3[5] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readDoubleLE(2), 0.3333333333333333)
- t.end()
-})
-
-tape('test toString', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
- t.equal(bl.toString('ascii', 3, 10), 'defghij')
- t.equal(bl.toString('ascii', 3, 6), 'def')
- t.equal(bl.toString('ascii', 3, 8), 'defgh')
- t.equal(bl.toString('ascii', 5, 10), 'fghij')
-
- t.end()
-})
-
-tape('test toString encoding', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
- bl.append(new Buffer('\xff\x00'))
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc), enc)
- })
-
- t.end()
-})
-
-!process.browser && tape('test stream', function (t) {
- var random = crypto.randomBytes(65534)
- , rndhash = hash(random, 'md5')
- , md5sum = crypto.createHash('md5')
- , bl = new BufferList(function (err, buf) {
- t.ok(Buffer.isBuffer(buf))
- t.ok(err === null)
- t.equal(rndhash, hash(bl.slice(), 'md5'))
- t.equal(rndhash, hash(buf, 'md5'))
-
- bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
- .on('close', function () {
- var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
- s.on('data', md5sum.update.bind(md5sum))
- s.on('end', function() {
- t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
- t.end()
- })
- })
-
- })
-
- fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
- fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
-})
-
-tape('instantiation with Buffer', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = crypto.randomBytes(1024)
- , b = BufferList(buf)
-
- t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
- b = BufferList([ buf, buf2 ])
- t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('test String appendage', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append('abcd')
- bl.append('efg')
- bl.append('hi')
- bl.append('j')
- bl.append('\xff\x00')
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('test Number appendage', function (t) {
- var bl = new BufferList()
- , b = new Buffer('1234567890')
-
- bl.append(1234)
- bl.append(567)
- bl.append(89)
- bl.append(0)
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('write nothing, should get empty buffer', function (t) {
- t.plan(3)
- BufferList(function (err, data) {
- t.notOk(err, 'no error')
- t.ok(Buffer.isBuffer(data), 'got a buffer')
- t.equal(0, data.length, 'got a zero-length buffer')
- t.end()
- }).end()
-})
-
-tape('unicode string', function (t) {
- t.plan(2)
- var inp1 = '\u2600'
- , inp2 = '\u2603'
- , exp = inp1 + ' and ' + inp2
- , bl = BufferList()
- bl.write(inp1)
- bl.write(' and ')
- bl.write(inp2)
- t.equal(exp, bl.toString())
- t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
-})
-
-tape('should emit finish', function (t) {
- var source = BufferList()
- , dest = BufferList()
-
- source.write('hello')
- source.pipe(dest)
-
- dest.on('finish', function () {
- t.equal(dest.toString('utf8'), 'hello')
- t.end()
- })
-})
-
-tape('basic copy', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy after many appends', function (t) {
- var buf = crypto.randomBytes(512)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy at a precise position', function (t) {
- var buf = crypto.randomBytes(1004)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2, 20)
- t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy starting from a precise location', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(5)
- , b = BufferList(buf)
-
- b.copy(buf2, 0, 5)
- t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy in an interval', function (t) {
- var rnd = crypto.randomBytes(10)
- , b = BufferList(rnd) // put the random bytes there
- , actual = new Buffer(3)
- , expected = new Buffer(3)
-
- rnd.copy(expected, 0, 5, 8)
- b.copy(actual, 0, 5, 8)
-
- t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy an interval between two buffers', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(10)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2, 0, 5, 15)
-
- t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('duplicate', function (t) {
- t.plan(2)
-
- var bl = new BufferList('abcdefghij\xff\x00')
- , dup = bl.duplicate()
-
- t.equal(bl.prototype, dup.prototype)
- t.equal(bl.toString('hex'), dup.toString('hex'))
-})
-
-tape('destroy no pipe', function (t) {
- t.plan(2)
-
- var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-
-})
-
-!process.browser && tape('destroy with pipe before read end with race', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- setTimeout(function () {
- bl.destroy()
- setTimeout(function () {
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }, 500)
- }, 500)
-})
-
-!process.browser && tape('destroy with pipe after read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }
-})
-
-!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
- t.plan(4)
-
- var bl = new BufferList()
- , ds = new BufferList()
-
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.pipe(ds)
-
- setTimeout(function () {
- bl.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- ds.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- }, 100)
- }
-})
-
-!process.browser && tape('handle error', function (t) {
- t.plan(2)
- fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
- t.ok(err instanceof Error, 'has error')
- t.notOk(data, 'no data')
- }))
-})
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/sauce.js b/deps/npm/node_modules/request/node_modules/bl/test/sauce.js
deleted file mode 100644
index a6d28625fb..0000000000
--- a/deps/npm/node_modules/request/node_modules/bl/test/sauce.js
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-const user = process.env.SAUCE_USER
- , key = process.env.SAUCE_KEY
- , path = require('path')
- , brtapsauce = require('brtapsauce')
- , testFile = path.join(__dirname, 'basic-test.js')
-
- , capabilities = [
- { browserName: 'chrome' , platform: 'Windows XP', version: '' }
- , { browserName: 'firefox' , platform: 'Windows 8' , version: '' }
- , { browserName: 'firefox' , platform: 'Windows XP', version: '4' }
- , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' }
- , { browserName: 'safari' , platform: 'Windows 7' , version: '5' }
- , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '11' }
- , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' }
- ]
-
-if (!user)
- throw new Error('Must set a SAUCE_USER env var')
-if (!key)
- throw new Error('Must set a SAUCE_KEY env var')
-
-brtapsauce({
- name : 'Traversty'
- , user : user
- , key : key
- , brsrc : testFile
- , capabilities : capabilities
- , options : { timeout: 60 * 6 }
-}) \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/test.js b/deps/npm/node_modules/request/node_modules/bl/test/test.js
index aa9b48771a..c95b1ba484 100644
--- a/deps/npm/node_modules/request/node_modules/bl/test/test.js
+++ b/deps/npm/node_modules/request/node_modules/bl/test/test.js
@@ -1,9 +1,640 @@
-require('./basic-test')
+var tape = require('tape')
+ , crypto = require('crypto')
+ , fs = require('fs')
+ , hash = require('hash_file')
+ , BufferList = require('../')
-if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
- return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
+ , encodings =
+ ('hex utf8 utf-8 ascii binary base64'
+ + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-if (!/v0\.10/.test(process.version))
- return console.log('Not Node v0.10.x, not running sauce tests')
+tape('single bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
-require('./sauce.js') \ No newline at end of file
+ t.equal(bl.length, 4)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+
+ t.end()
+})
+
+tape('single bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+ t.equal(bl.get(4), 101)
+ t.equal(bl.get(5), 102)
+ t.equal(bl.get(6), 103)
+ t.equal(bl.get(7), 104)
+ t.equal(bl.get(8), 105)
+ t.equal(bl.get(9), 106)
+ t.end()
+})
+
+tape('multi bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+
+ t.equal(bl.length, 4)
+
+ t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
+ t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
+ t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([ new Buffer('abcd'), new Buffer('efg') ]))
+ bl.append(new BufferList([ new Buffer('hi'), new Buffer('j') ]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+// same data as previous test, just using nested constructors
+tape('multiple bytes from crazy nested buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([
+ new BufferList([
+ new BufferList(new Buffer('abc'))
+ , new Buffer('d')
+ , new BufferList(new Buffer('efg'))
+ ])
+ , new BufferList([ new Buffer('hi') ])
+ , new BufferList(new Buffer('j'))
+ ]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('append accepts arrays of Buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abc'))
+ bl.append([ new Buffer('def') ])
+ bl.append([ new Buffer('ghi'), new Buffer('jkl') ])
+ bl.append([ new Buffer('mnop'), new Buffer('qrstu'), new Buffer('vwxyz') ])
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('append accepts arrays of BufferLists', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abc'))
+ bl.append([ new BufferList('def') ])
+ bl.append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ]))
+ bl.append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ])
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('append chainable', function (t) {
+ var bl = new BufferList()
+ t.ok(bl.append(new Buffer('abcd')) === bl)
+ t.ok(bl.append([ new Buffer('abcd') ]) === bl)
+ t.ok(bl.append(new BufferList(new Buffer('abcd'))) === bl)
+ t.ok(bl.append([ new BufferList(new Buffer('abcd')) ]) === bl)
+ t.end()
+})
+
+tape('append chainable (test results)', function (t) {
+ var bl = new BufferList('abc')
+ .append([ new BufferList('def') ])
+ .append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ]))
+ .append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ])
+
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('consuming from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ bl.consume(3)
+ t.equal(bl.length, 7)
+ t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
+
+ bl.consume(2)
+ t.equal(bl.length, 5)
+ t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 4)
+ t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 3)
+ t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
+
+ bl.consume(2)
+ t.equal(bl.length, 1)
+ t.equal(bl.slice(0, 1).toString('ascii'), 'j')
+
+ t.end()
+})
+
+tape('complete consumption', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('a'))
+ bl.append(new Buffer('b'))
+
+ bl.consume(2)
+
+ t.equal(bl.length, 0)
+ t.equal(bl._bufs.length, 0)
+
+ t.end()
+})
+
+tape('test readUInt8 / readInt8', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt8(2), 0x3)
+ t.equal(bl.readInt8(2), 0x3)
+ t.equal(bl.readUInt8(3), 0x4)
+ t.equal(bl.readInt8(3), 0x4)
+ t.equal(bl.readUInt8(4), 0x23)
+ t.equal(bl.readInt8(4), 0x23)
+ t.equal(bl.readUInt8(5), 0x42)
+ t.equal(bl.readInt8(5), 0x42)
+ t.end()
+})
+
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt16BE(2), 0x0304)
+ t.equal(bl.readUInt16LE(2), 0x0403)
+ t.equal(bl.readInt16BE(2), 0x0304)
+ t.equal(bl.readInt16LE(2), 0x0403)
+ t.equal(bl.readUInt16BE(3), 0x0423)
+ t.equal(bl.readUInt16LE(3), 0x2304)
+ t.equal(bl.readInt16BE(3), 0x0423)
+ t.equal(bl.readInt16LE(3), 0x2304)
+ t.equal(bl.readUInt16BE(4), 0x2342)
+ t.equal(bl.readUInt16LE(4), 0x4223)
+ t.equal(bl.readInt16BE(4), 0x2342)
+ t.equal(bl.readInt16LE(4), 0x4223)
+ t.end()
+})
+
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt32BE(2), 0x03042342)
+ t.equal(bl.readUInt32LE(2), 0x42230403)
+ t.equal(bl.readInt32BE(2), 0x03042342)
+ t.equal(bl.readInt32LE(2), 0x42230403)
+ t.end()
+})
+
+tape('test readFloatLE / readFloatBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x00
+ buf2[2] = 0x00
+ buf3[0] = 0x80
+ buf3[1] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readFloatLE(2), 0x01)
+ t.end()
+})
+
+tape('test readDoubleLE / readDoubleBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(10)
+ , bl = new BufferList()
+
+ buf2[1] = 0x55
+ buf2[2] = 0x55
+ buf3[0] = 0x55
+ buf3[1] = 0x55
+ buf3[2] = 0x55
+ buf3[3] = 0x55
+ buf3[4] = 0xd5
+ buf3[5] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readDoubleLE(2), 0.3333333333333333)
+ t.end()
+})
+
+tape('test toString', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
+ t.equal(bl.toString('ascii', 3, 10), 'defghij')
+ t.equal(bl.toString('ascii', 3, 6), 'def')
+ t.equal(bl.toString('ascii', 3, 8), 'defgh')
+ t.equal(bl.toString('ascii', 5, 10), 'fghij')
+
+ t.end()
+})
+
+tape('test toString encoding', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+ bl.append(new Buffer('\xff\x00'))
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc), enc)
+ })
+
+ t.end()
+})
+
+!process.browser && tape('test stream', function (t) {
+ var random = crypto.randomBytes(65534)
+ , rndhash = hash(random, 'md5')
+ , md5sum = crypto.createHash('md5')
+ , bl = new BufferList(function (err, buf) {
+ t.ok(Buffer.isBuffer(buf))
+ t.ok(err === null)
+ t.equal(rndhash, hash(bl.slice(), 'md5'))
+ t.equal(rndhash, hash(buf, 'md5'))
+
+ bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
+ .on('close', function () {
+ var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
+ s.on('data', md5sum.update.bind(md5sum))
+ s.on('end', function() {
+ t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
+ t.end()
+ })
+ })
+
+ })
+
+ fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
+ fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
+})
+
+tape('instantiation with Buffer', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = crypto.randomBytes(1024)
+ , b = BufferList(buf)
+
+ t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
+ b = BufferList([ buf, buf2 ])
+ t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('test String appendage', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append('abcd')
+ bl.append('efg')
+ bl.append('hi')
+ bl.append('j')
+ bl.append('\xff\x00')
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('test Number appendage', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('1234567890')
+
+ bl.append(1234)
+ bl.append(567)
+ bl.append(89)
+ bl.append(0)
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('write nothing, should get empty buffer', function (t) {
+ t.plan(3)
+ BufferList(function (err, data) {
+ t.notOk(err, 'no error')
+ t.ok(Buffer.isBuffer(data), 'got a buffer')
+ t.equal(0, data.length, 'got a zero-length buffer')
+ t.end()
+ }).end()
+})
+
+tape('unicode string', function (t) {
+ t.plan(2)
+ var inp1 = '\u2600'
+ , inp2 = '\u2603'
+ , exp = inp1 + ' and ' + inp2
+ , bl = BufferList()
+ bl.write(inp1)
+ bl.write(' and ')
+ bl.write(inp2)
+ t.equal(exp, bl.toString())
+ t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
+})
+
+tape('should emit finish', function (t) {
+ var source = BufferList()
+ , dest = BufferList()
+
+ source.write('hello')
+ source.pipe(dest)
+
+ dest.on('finish', function () {
+ t.equal(dest.toString('utf8'), 'hello')
+ t.end()
+ })
+})
+
+tape('basic copy', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy after many appends', function (t) {
+ var buf = crypto.randomBytes(512)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy at a precise position', function (t) {
+ var buf = crypto.randomBytes(1004)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 20)
+ t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy starting from a precise location', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(5)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 0, 5)
+ t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy in an interval', function (t) {
+ var rnd = crypto.randomBytes(10)
+ , b = BufferList(rnd) // put the random bytes there
+ , actual = new Buffer(3)
+ , expected = new Buffer(3)
+
+ rnd.copy(expected, 0, 5, 8)
+ b.copy(actual, 0, 5, 8)
+
+ t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy an interval between two buffers', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(10)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2, 0, 5, 15)
+
+ t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('duplicate', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('abcdefghij\xff\x00')
+ , dup = bl.duplicate()
+
+ t.equal(bl.prototype, dup.prototype)
+ t.equal(bl.toString('hex'), dup.toString('hex'))
+})
+
+tape('destroy no pipe', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+})
+
+!process.browser && tape('destroy with pipe before read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+
+})
+
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ setTimeout(function () {
+ bl.destroy()
+ setTimeout(function () {
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }, 500)
+ }, 500)
+})
+
+!process.browser && tape('destroy with pipe after read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }
+})
+
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
+ t.plan(4)
+
+ var bl = new BufferList()
+ , ds = new BufferList()
+
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.pipe(ds)
+
+ setTimeout(function () {
+ bl.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ ds.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ }, 100)
+ }
+})
+
+!process.browser && tape('handle error', function (t) {
+ t.plan(2)
+ fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
+ t.ok(err instanceof Error, 'has error')
+ t.notOk(data, 'no data')
+ }))
+})
diff --git a/deps/npm/node_modules/request/node_modules/form-data/.dockerignore b/deps/npm/node_modules/request/node_modules/form-data/.dockerignore
new file mode 100644
index 0000000000..c67305cf96
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/.dockerignore
@@ -0,0 +1,7 @@
+*.iml
+*.sublime-*
+*.un~
+.idea
+sftp-config.json
+node_modules/
+test/tmp/
diff --git a/deps/npm/node_modules/request/node_modules/form-data/.editorconfig b/deps/npm/node_modules/request/node_modules/form-data/.editorconfig
new file mode 100644
index 0000000000..0f099897b1
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/.editorconfig
@@ -0,0 +1,10 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
diff --git a/deps/npm/node_modules/request/node_modules/form-data/.eslintignore b/deps/npm/node_modules/request/node_modules/form-data/.eslintignore
new file mode 100644
index 0000000000..8d87b1d267
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/.eslintignore
@@ -0,0 +1 @@
+node_modules/*
diff --git a/deps/npm/node_modules/request/node_modules/form-data/Readme.md b/deps/npm/node_modules/request/node_modules/form-data/Readme.md
index 492773231f..e857db6e2e 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/Readme.md
+++ b/deps/npm/node_modules/request/node_modules/form-data/Readme.md
@@ -1,4 +1,4 @@
-# Form-Data [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) [![Build Status](https://img.shields.io/travis/form-data/form-data/master.svg)](https://travis-ci.org/form-data/form-data) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
+# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data)
A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
@@ -7,6 +7,14 @@ The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface]
[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions
+[![Linux Build](https://img.shields.io/travis/form-data/form-data/master.svg?label=linux:0.10-5.x)](https://travis-ci.org/form-data/form-data)
+[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/master.svg?label=windows:0.10-5.x)](https://ci.appveyor.com/project/alexindigo/form-data)
+[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/master.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master)
+
+[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
+[![Codacy Badge](https://img.shields.io/codacy/43ece80331c246179695e41f81eeffe2.svg)](https://www.codacy.com/app/form-data/form-data)
+[![bitHound Overall Score](https://www.bithound.io/github/form-data/form-data/badges/score.svg)](https://www.bithound.io/github/form-data/form-data)
+
## Install
```
diff --git a/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js b/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js
index 1e7717d564..8141d6589d 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js
@@ -1 +1,2 @@
-module.exports = FormData; \ No newline at end of file
+/* eslint-env browser */
+module.exports = FormData;
diff --git a/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js
index 0cbb2e8331..55328b463b 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js
@@ -7,29 +7,51 @@ var parseUrl = require('url').parse;
var fs = require('fs');
var mime = require('mime-types');
var async = require('async');
+var populate = require('./populate.js');
+// Public API
module.exports = FormData;
+
+// make it a Stream
+util.inherits(FormData, CombinedStream);
+
+/**
+ * Create readable "multipart/form-data" streams.
+ * Can be used to submit forms
+ * and file uploads to other web applications.
+ *
+ * @constructor
+ */
function FormData() {
+ if (!(this instanceof FormData)) {
+ throw new TypeError('Failed to construct FormData: Please use the _new_ operator, this object constructor cannot be called as a function.');
+ }
+
this._overheadLength = 0;
this._valueLength = 0;
this._lengthRetrievers = [];
CombinedStream.call(this);
}
-util.inherits(FormData, CombinedStream);
FormData.LINE_BREAK = '\r\n';
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
FormData.prototype.append = function(field, value, options) {
- options = (typeof options === 'string')
- ? { filename: options }
- : options || {};
+
+ options = options || {};
+
+ // allow filename as single option
+ if (typeof options == 'string') {
+ options = {filename: options};
+ }
var append = CombinedStream.prototype.append.bind(this);
// all that streamy business can't handle numbers
- if (typeof value == 'number') value = ''+value;
+ if (typeof value == 'number') {
+ value = '' + value;
+ }
// https://github.com/felixge/node-form-data/issues/38
if (util.isArray(value)) {
@@ -40,7 +62,7 @@ FormData.prototype.append = function(field, value, options) {
}
var header = this._multiPartHeader(field, value, options);
- var footer = this._multiPartFooter(field, value, options);
+ var footer = this._multiPartFooter();
append(header);
append(value);
@@ -78,108 +100,83 @@ FormData.prototype._trackLength = function(header, value, options) {
}
// no need to bother with the length
- if (!options.knownLength)
- this._lengthRetrievers.push(function(next) {
-
- if (value.hasOwnProperty('fd')) {
-
- // take read range into a account
- // `end` = Infinity –> read file till the end
- //
- // TODO: Looks like there is bug in Node fs.createReadStream
- // it doesn't respect `end` options without `start` options
- // Fix it when node fixes it.
- // https://github.com/joyent/node/issues/7819
- if (value.end != undefined && value.end != Infinity && value.start != undefined) {
-
- // when end specified
- // no need to calculate range
- // inclusive, starts with 0
- next(null, value.end+1 - (value.start ? value.start : 0));
-
- // not that fast snoopy
- } else {
- // still need to fetch file size from fs
- fs.stat(value.path, function(err, stat) {
-
- var fileSize;
-
- if (err) {
- next(err);
- return;
- }
-
- // update final size based on the range options
- fileSize = stat.size - (value.start ? value.start : 0);
- next(null, fileSize);
+ if (!options.knownLength) {
+ this._lengthRetrievers.push(function(next) {
+
+ if (value.hasOwnProperty('fd')) {
+
+ // take read range into a account
+ // `end` = Infinity –> read file till the end
+ //
+ // TODO: Looks like there is bug in Node fs.createReadStream
+ // it doesn't respect `end` options without `start` options
+ // Fix it when node fixes it.
+ // https://github.com/joyent/node/issues/7819
+ if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+
+ // when end specified
+ // no need to calculate range
+ // inclusive, starts with 0
+ next(null, value.end + 1 - (value.start ? value.start : 0));
+
+ // not that fast snoopy
+ } else {
+ // still need to fetch file size from fs
+ fs.stat(value.path, function(err, stat) {
+
+ var fileSize;
+
+ if (err) {
+ next(err);
+ return;
+ }
+
+ // update final size based on the range options
+ fileSize = stat.size - (value.start ? value.start : 0);
+ next(null, fileSize);
+ });
+ }
+
+ // or http response
+ } else if (value.hasOwnProperty('httpVersion')) {
+ next(null, +value.headers['content-length']);
+
+ // or request stream http://github.com/mikeal/request
+ } else if (value.hasOwnProperty('httpModule')) {
+ // wait till response come back
+ value.on('response', function(response) {
+ value.pause();
+ next(null, +response.headers['content-length']);
});
- }
+ value.resume();
- // or http response
- } else if (value.hasOwnProperty('httpVersion')) {
- next(null, +value.headers['content-length']);
-
- // or request stream http://github.com/mikeal/request
- } else if (value.hasOwnProperty('httpModule')) {
- // wait till response come back
- value.on('response', function(response) {
- value.pause();
- next(null, +response.headers['content-length']);
- });
- value.resume();
-
- // something else
- } else {
- next('Unknown stream');
- }
- });
+ // something else
+ } else {
+ next('Unknown stream');
+ }
+ });
+ }
};
FormData.prototype._multiPartHeader = function(field, value, options) {
// custom header specified (as string)?
// it becomes responsible for boundary
// (e.g. to handle extra CRLFs on .NET servers)
- if (options.header != null) {
+ if (options.header) {
return options.header;
}
+ var contentDisposition = this._getContentDisposition(value, options);
+ var contentType = this._getContentType(value, options);
+
var contents = '';
var headers = {
- 'Content-Disposition': ['form-data', 'name="' + field + '"'],
- 'Content-Type': []
+ // add custom disposition as third element or keep it two elements if not
+ 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
+ // if no content type. allow it to be empty array
+ 'Content-Type': [].concat(contentType || [])
};
- // fs- and request- streams have path property
- // or use custom filename and/or contentType
- // TODO: Use request's response mime-type
- if (options.filename || value.path) {
- headers['Content-Disposition'].push(
- 'filename="' + path.basename(options.filename || value.path) + '"'
- );
- headers['Content-Type'].push(
- options.contentType ||
- mime.lookup(options.filename || value.path) ||
- FormData.DEFAULT_CONTENT_TYPE
- );
- // http response has not
- } else if (value.readable && value.hasOwnProperty('httpVersion')) {
- headers['Content-Disposition'].push(
- 'filename="' + path.basename(value.client._httpMessage.path) + '"'
- );
- headers['Content-Type'].push(
- options.contentType ||
- value.headers['content-type'] ||
- FormData.DEFAULT_CONTENT_TYPE
- );
- } else if (Buffer.isBuffer(value)) {
- headers['Content-Type'].push(
- options.contentType ||
- FormData.DEFAULT_CONTENT_TYPE
- );
- } else if (options.contentType) {
- headers['Content-Type'].push(options.contentType);
- }
-
for (var prop in headers) {
if (headers[prop].length) {
contents += prop + ': ' + headers[prop].join('; ') + FormData.LINE_BREAK;
@@ -189,7 +186,55 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
};
-FormData.prototype._multiPartFooter = function(field, value, options) {
+FormData.prototype._getContentDisposition = function(value, options) {
+
+ var contentDisposition;
+
+ // custom filename takes precedence
+ // fs- and request- streams have path property
+ var filename = options.filename || value.path;
+
+ // or try http response
+ if (!filename && value.readable && value.hasOwnProperty('httpVersion')) {
+ filename = value.client._httpMessage.path;
+ }
+
+ if (filename) {
+ contentDisposition = 'filename="' + path.basename(filename) + '"';
+ }
+
+ return contentDisposition;
+};
+
+FormData.prototype._getContentType = function(value, options) {
+
+ // use custom content-type above all
+ var contentType = options.contentType;
+
+ // or try `path` from fs-, request- streams
+ if (!contentType && value.path) {
+ contentType = mime.lookup(value.path);
+ }
+
+ // or if it's http-reponse
+ if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
+ contentType = value.headers['content-type'];
+ }
+
+ // or guess it from the filename
+ if (!contentType && options.filename) {
+ contentType = mime.lookup(options.filename);
+ }
+
+ // fallback to the default content type if `value` is not simple value
+ if (!contentType && typeof value == 'object') {
+ contentType = FormData.DEFAULT_CONTENT_TYPE;
+ }
+
+ return contentType;
+};
+
+FormData.prototype._multiPartFooter = function() {
return function(next) {
var footer = FormData.LINE_BREAK;
@@ -207,27 +252,30 @@ FormData.prototype._lastBoundary = function() {
};
FormData.prototype.getHeaders = function(userHeaders) {
+ var header;
var formHeaders = {
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
};
- for (var header in userHeaders) {
- formHeaders[header.toLowerCase()] = userHeaders[header];
+ for (header in userHeaders) {
+ if (userHeaders.hasOwnProperty(header)) {
+ formHeaders[header.toLowerCase()] = userHeaders[header];
+ }
}
return formHeaders;
-}
+};
FormData.prototype.getCustomHeaders = function(contentType) {
- contentType = contentType ? contentType : 'multipart/form-data';
+ contentType = contentType ? contentType : 'multipart/form-data';
- var formHeaders = {
- 'content-type': contentType + '; boundary=' + this.getBoundary(),
- 'content-length': this.getLengthSync()
- };
+ var formHeaders = {
+ 'content-type': contentType + '; boundary=' + this.getBoundary(),
+ 'content-length': this.getLengthSync()
+ };
- return formHeaders;
-}
+ return formHeaders;
+};
FormData.prototype.getBoundary = function() {
if (!this._boundary) {
@@ -251,7 +299,7 @@ FormData.prototype._generateBoundary = function() {
// Note: getLengthSync DOESN'T calculate streams length
// As workaround one can calculate file size manually
// and add it as knownLength option
-FormData.prototype.getLengthSync = function(debug) {
+FormData.prototype.getLengthSync = function() {
var knownLength = this._overheadLength + this._valueLength;
// Don't get confused, there are 3 "internal" streams for each keyval pair
@@ -260,9 +308,9 @@ FormData.prototype.getLengthSync = function(debug) {
knownLength += this._lastBoundary().length;
}
- // https://github.com/felixge/node-form-data/issues/40
+ // https://github.com/form-data/form-data/issues/40
if (this._lengthRetrievers.length) {
- // Some async length retrivers are present
+ // Some async length retrievers are present
// therefore synchronous length calculation is false.
// Please use getLength(callback) to get proper length
this._error(new Error('Cannot calculate proper length in synchronous way.'));
@@ -298,26 +346,25 @@ FormData.prototype.getLength = function(cb) {
};
FormData.prototype.submit = function(params, cb) {
-
var request
, options
- , defaults = {
- method : 'post'
- };
+ , defaults = {method: 'post'}
+ ;
// parse provided url if it's string
// or treat it as options object
if (typeof params == 'string') {
- params = parseUrl(params);
+ params = parseUrl(params);
options = populate({
port: params.port,
path: params.pathname,
host: params.hostname
}, defaults);
- }
- else // use custom params
- {
+
+ // use custom params
+ } else {
+
options = populate(params, defaults);
// if no port provided use default one
if (!options.port) {
@@ -337,8 +384,10 @@ FormData.prototype.submit = function(params, cb) {
// get content length and fire away
this.getLength(function(err, length) {
-
- // TODO: Add chunked encoding when no length (if err)
+ if (err) {
+ this._error(err);
+ return;
+ }
// add content length
request.setHeader('Content-Length', length);
@@ -354,21 +403,9 @@ FormData.prototype.submit = function(params, cb) {
};
FormData.prototype._error = function(err) {
- if (this.error) return;
-
- this.error = err;
- this.pause();
- this.emit('error', err);
-};
-
-/*
- * Santa's little helpers
- */
-
-// populates missing values
-function populate(dst, src) {
- for (var prop in src) {
- if (!dst[prop]) dst[prop] = src[prop];
+ if (!this.error) {
+ this.error = err;
+ this.pause();
+ this.emit('error', err);
}
- return dst;
-}
+};
diff --git a/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js b/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js
new file mode 100644
index 0000000000..6f64a6d32c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js
@@ -0,0 +1,9 @@
+// populates missing values
+module.exports = function(dst, src) {
+ for (var prop in src) {
+ if (src.hasOwnProperty(prop) && !dst[prop]) {
+ dst[prop] = src[prop];
+ }
+ }
+ return dst;
+};
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 662e628b20..8977f984e8 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,85 +1,129 @@
{
+ "_args": [
+ [
+ "form-data@~1.0.0-rc3",
+ "/Users/rebecca/code/npm/node_modules/request"
+ ]
+ ],
+ "_from": "form-data@>=1.0.0-rc3 <1.1.0",
+ "_id": "form-data@1.0.0-rc4",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/form-data",
+ "_nodeVersion": "0.12.11",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/form-data-1.0.0-rc4.tgz_1458059747097_0.14101114077493548"
+ },
+ "_npmUser": {
+ "email": "iam@alexindigo.com",
+ "name": "alexindigo"
+ },
+ "_npmVersion": "2.14.9",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "form-data",
+ "raw": "form-data@~1.0.0-rc3",
+ "rawSpec": "~1.0.0-rc3",
+ "scope": null,
+ "spec": ">=1.0.0-rc3 <1.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request"
+ ],
+ "_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",
+ "_where": "/Users/rebecca/code/npm/node_modules/request",
"author": {
- "name": "Felix Geisendörfer",
"email": "felix@debuggable.com",
+ "name": "Felix Geisendörfer",
"url": "http://debuggable.com/"
},
- "name": "form-data",
- "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
- "version": "1.0.0-rc3",
- "repository": {
- "type": "git",
- "url": "git://github.com/form-data/form-data.git"
- },
- "main": "./lib/form_data",
"browser": "./lib/browser",
- "scripts": {
- "test": "./test/run.js"
- },
- "pre-commit": [
- "test"
- ],
- "engines": {
- "node": ">= 0.10"
+ "bugs": {
+ "url": "https://github.com/form-data/form-data/issues"
},
"dependencies": {
- "async": "^1.4.0",
+ "async": "^1.5.2",
"combined-stream": "^1.0.5",
- "mime-types": "^2.1.3"
+ "mime-types": "^2.1.10"
},
- "license": "MIT",
+ "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
"devDependencies": {
+ "codacy-coverage": "^1.1.3",
+ "coveralls": "^2.11.8",
+ "cross-spawn": "^2.1.5",
+ "eslint": "^2.4.0",
"fake": "^0.2.2",
"far": "^0.0.7",
"formidable": "^1.0.17",
- "pre-commit": "^1.0.10",
- "request": "^2.60.0"
- },
- "gitHead": "c174f1b7f3a78a00ec5af0360469280445e37804",
- "bugs": {
- "url": "https://github.com/form-data/form-data/issues"
- },
- "homepage": "https://github.com/form-data/form-data#readme",
- "_id": "form-data@1.0.0-rc3",
- "_shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
- "_from": "form-data@>=1.0.0-rc3 <1.1.0",
- "_npmVersion": "2.11.0",
- "_nodeVersion": "2.2.1",
- "_npmUser": {
- "name": "dylanpiercey",
- "email": "pierceydylan@gmail.com"
+ "istanbul": "^0.4.2",
+ "pre-commit": "^1.1.2",
+ "request": "^2.69.0",
+ "rimraf": "^2.5.2"
},
+ "directories": {},
"dist": {
- "shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
- "tarball": "http://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz"
+ "shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e",
+ "tarball": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz"
+ },
+ "engines": {
+ "node": ">= 0.10"
},
+ "gitHead": "f73996e0508ee2d4b2b376276adfac1de4188ac2",
+ "homepage": "https://github.com/form-data/form-data#readme",
+ "license": "MIT",
+ "main": "./lib/form_data",
"maintainers": [
{
- "name": "felixge",
- "email": "felix@debuggable.com"
+ "email": "felix@debuggable.com",
+ "name": "felixge"
},
{
- "name": "idralyuk",
- "email": "igor@buran.us"
+ "email": "igor@buran.us",
+ "name": "idralyuk"
},
{
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
+ "email": "iam@alexindigo.com",
+ "name": "alexindigo"
},
{
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
+ "email": "mikeal.rogers@gmail.com",
+ "name": "mikeal"
},
{
- "name": "celer",
- "email": "dtyree77@gmail.com"
+ "email": "dtyree77@gmail.com",
+ "name": "celer"
},
{
- "name": "dylanpiercey",
- "email": "pierceydylan@gmail.com"
+ "email": "pierceydylan@gmail.com",
+ "name": "dylanpiercey"
}
],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz",
- "readme": "ERROR: No README data found!"
+ "name": "form-data",
+ "optionalDependencies": {},
+ "pre-commit": [
+ "lint",
+ "test",
+ "check"
+ ],
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/form-data/form-data.git"
+ },
+ "scripts": {
+ "check": "istanbul check-coverage coverage/coverage*.json",
+ "coverage": "codacy-coverage < ./coverage/lcov.info; true",
+ "debug": "verbose=1 ./test/run.js",
+ "lint": "eslint lib/*.js test/*.js test/**/*.js",
+ "posttest": "istanbul report",
+ "predebug": "rimraf coverage test/tmp",
+ "pretest": "rimraf coverage test/tmp",
+ "test": "istanbul cover --report none test/run.js"
+ },
+ "version": "1.0.0-rc4"
}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/wercker.yml b/deps/npm/node_modules/request/node_modules/form-data/wercker.yml
new file mode 100644
index 0000000000..6b118d1e31
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/wercker.yml
@@ -0,0 +1,36 @@
+# This references the default nodejs container from
+# the Docker Hub: https://registry.hub.docker.com/_/node/
+# If you want Nodesource's container you would reference nodesource/node
+# Read more about containers on our dev center
+# http://devcenter.wercker.com/docs/containers/index.html
+box: node
+# This is the build pipeline. Pipelines are the core of wercker
+# Read more about pipelines on our dev center
+# http://devcenter.wercker.com/docs/pipelines/index.html
+
+# You can also use services such as databases. Read more on our dev center:
+# http://devcenter.wercker.com/docs/services/index.html
+# services:
+ # - postgres
+ # http://devcenter.wercker.com/docs/services/postgresql.html
+
+ # - mongodb
+ # http://devcenter.wercker.com/docs/services/mongodb.html
+build:
+ # The steps that will be executed on build
+ # Steps make up the actions in your pipeline
+ # Read more about steps on our dev center:
+ # http://devcenter.wercker.com/docs/steps/index.html
+ steps:
+ # A step that executes `npm install` command
+ - npm-install
+ # A step that executes `npm test` command
+ - npm-test
+
+ # A custom script step, name value is used in the UI
+ # and the code value contains the command that get executed
+ - script:
+ name: echo nodejs information
+ code: |
+ echo "node version $(node -v) running"
+ echo "npm version $(npm -v) running"
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 f2e9595b8b..98f4580388 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,38 +1,68 @@
{
- "name": "ansi-styles",
- "version": "2.1.0",
- "description": "ANSI escape codes for styling strings in the terminal",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/chalk/ansi-styles.git"
+ "_args": [
+ [
+ "ansi-styles@^2.2.1",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk"
+ ]
+ ],
+ "_from": "ansi-styles@>=2.2.1 <3.0.0",
+ "_id": "ansi-styles@2.2.1",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/har-validator/chalk/ansi-styles",
+ "_nodeVersion": "4.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176"
+ },
+ "_npmUser": {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
},
+ "_npmVersion": "3.8.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "ansi-styles",
+ "raw": "ansi-styles@^2.2.1",
+ "rawSpec": "^2.2.1",
+ "scope": null,
+ "spec": ">=2.2.1 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/har-validator/chalk"
+ ],
+ "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
+ "_shrinkwrap": null,
+ "_spec": "ansi-styles@^2.2.1",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk",
"author": {
- "name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
"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/ansi-styles/issues"
+ },
+ "dependencies": {},
+ "description": "ANSI escape codes for styling strings in the terminal",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
+ "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz"
+ },
"engines": {
"node": ">=0.10.0"
},
- "scripts": {
- "test": "mocha"
- },
"files": [
"index.js"
],
+ "gitHead": "95c59b23be760108b6530ca1c89477c21b258032",
+ "homepage": "https://github.com/chalk/ansi-styles#readme",
"keywords": [
"ansi",
"styles",
@@ -55,17 +85,22 @@
"command-line",
"text"
],
- "devDependencies": {
- "mocha": "*"
+ "license": "MIT",
+ "maintainers": [
+ {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ }
+ ],
+ "name": "ansi-styles",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/ansi-styles.git"
},
- "readme": "# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n![](screenshot.png)\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## Advanced usage\n\nBy default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
- "bugs": {
- "url": "https://github.com/chalk/ansi-styles/issues"
+ "scripts": {
+ "test": "mocha"
},
- "homepage": "https://github.com/chalk/ansi-styles#readme",
- "_id": "ansi-styles@2.1.0",
- "_shasum": "990f747146927b559a932bf92959163d60c0d0e2",
- "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz",
- "_from": "ansi-styles@>=2.1.0 <3.0.0"
+ "version": "2.2.1"
}
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 5811067aca..1399933541 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
@@ -6,16 +6,20 @@
]
],
"_from": "escape-string-regexp@>=1.0.2 <2.0.0",
- "_id": "escape-string-regexp@1.0.4",
+ "_id": "escape-string-regexp@1.0.5",
"_inCache": true,
"_installable": true,
"_location": "/request/har-validator/chalk/escape-string-regexp",
- "_nodeVersion": "4.2.1",
+ "_nodeVersion": "4.2.6",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477"
+ },
"_npmUser": {
- "email": "sindresorhus@gmail.com",
- "name": "sindresorhus"
+ "email": "jappelman@xebia.com",
+ "name": "jbnicolai"
},
- "_npmVersion": "2.14.7",
+ "_npmVersion": "2.14.12",
"_phantomChildren": {},
"_requested": {
"name": "escape-string-regexp",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/har-validator/chalk"
],
- "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz",
- "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
+ "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
"_shrinkwrap": null,
"_spec": "escape-string-regexp@^1.0.2",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk",
@@ -49,8 +53,8 @@
},
"directories": {},
"dist": {
- "shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
- "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz"
+ "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
+ "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
},
"engines": {
"node": ">=0.8.0"
@@ -58,29 +62,29 @@
"files": [
"index.js"
],
- "gitHead": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97",
+ "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20",
"homepage": "https://github.com/sindresorhus/escape-string-regexp",
"keywords": [
- "characters",
"escape",
- "expression",
- "re",
"regex",
"regexp",
+ "re",
"regular",
- "special",
+ "expression",
+ "string",
"str",
- "string"
+ "special",
+ "characters"
],
"license": "MIT",
"maintainers": [
{
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
},
{
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
+ "email": "jappelman@xebia.com",
+ "name": "jbnicolai"
}
],
"name": "escape-string-regexp",
@@ -93,5 +97,5 @@
"scripts": {
"test": "xo && ava"
},
- "version": "1.0.4"
+ "version": "1.0.5"
}
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 2ad36d4d98..cf2ae5bd38 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,41 +1,78 @@
{
- "name": "chalk",
- "version": "1.1.1",
- "description": "Terminal string styling done right. Much color.",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/chalk/chalk.git"
+ "_args": [
+ [
+ "chalk@^1.1.1",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator"
+ ]
+ ],
+ "_from": "chalk@>=1.1.1 <2.0.0",
+ "_id": "chalk@1.1.3",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/har-validator/chalk",
+ "_nodeVersion": "0.10.32",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276"
},
- "maintainers": [
- {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- {
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "jbnicolai.com"
- },
- {
- "name": "JD Ballard",
- "email": "i.am.qix@gmail.com",
- "url": "github.com/qix-"
- }
+ "_npmUser": {
+ "email": "i.am.qix@gmail.com",
+ "name": "qix"
+ },
+ "_npmVersion": "2.14.2",
+ "_phantomChildren": {
+ "ansi-regex": "2.0.0"
+ },
+ "_requested": {
+ "name": "chalk",
+ "raw": "chalk@^1.1.1",
+ "rawSpec": "^1.1.1",
+ "scope": null,
+ "spec": ">=1.1.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/har-validator"
],
+ "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98",
+ "_shrinkwrap": null,
+ "_spec": "chalk@^1.1.1",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator",
+ "bugs": {
+ "url": "https://github.com/chalk/chalk/issues"
+ },
+ "dependencies": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "description": "Terminal string styling done right. Much color.",
+ "devDependencies": {
+ "coveralls": "^2.11.2",
+ "matcha": "^0.6.0",
+ "mocha": "*",
+ "nyc": "^3.0.0",
+ "require-uncached": "^1.0.2",
+ "resolve-from": "^1.0.0",
+ "semver": "^4.3.3",
+ "xo": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98",
+ "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz"
+ },
"engines": {
"node": ">=0.10.0"
},
- "scripts": {
- "test": "xo && mocha",
- "bench": "matcha benchmark.js",
- "coverage": "nyc npm test && nyc report",
- "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
- },
"files": [
"index.js"
],
+ "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24",
+ "homepage": "https://github.com/chalk/chalk#readme",
"keywords": [
"color",
"colour",
@@ -59,37 +96,39 @@
"command-line",
"text"
],
- "dependencies": {
- "ansi-styles": "^2.1.0",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
+ "license": "MIT",
+ "maintainers": [
+ {
+ "email": "i.am.qix@gmail.com",
+ "name": "qix"
+ },
+ {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ },
+ {
+ "email": "sindresorhus+unicorn@gmail.com",
+ "name": "unicorn"
+ }
+ ],
+ "name": "chalk",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/chalk.git"
},
- "devDependencies": {
- "coveralls": "^2.11.2",
- "matcha": "^0.6.0",
- "mocha": "*",
- "nyc": "^3.0.0",
- "require-uncached": "^1.0.2",
- "resolve-from": "^1.0.0",
- "semver": "^4.3.3",
- "xo": "*"
+ "scripts": {
+ "bench": "matcha benchmark.js",
+ "coverage": "nyc npm test && nyc report",
+ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
+ "test": "xo && mocha"
},
+ "version": "1.1.3",
"xo": {
"envs": [
"node",
"mocha"
]
- },
- "readme": "<h1 align=\"center\">\n\t<br>\n\t<br>\n\t<img width=\"360\" src=\"https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg\" alt=\"chalk\">\n\t<br>\n\t<br>\n\t<br>\n</h1>\n\n> Terminal string styling done right\n\n[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)\n[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)\n[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)\n\n\n[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\n\n## Why\n\n- Highly performant\n- Doesn't extend `String.prototype`\n- Expressive API\n- Ability to nest styles\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015\n\n\n## Install\n\n```\n$ npm install --save chalk\n```\n\n\n## Usage\n\nChalk comes with an easy to use composable API where you just chain and nest the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nchalk.blue('Hello world!');\n\n// combine styled and normal strings\nchalk.blue('Hello') + 'World' + chalk.red('!');\n\n// compose multiple styles using the chainable API\nchalk.blue.bgRed.bold('Hello world!');\n\n// pass in multiple arguments\nchalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');\n\n// nest styles\nchalk.red('Hello', chalk.underline.bgBlue('world') + '!');\n\n// nest styles of the same type even (color, underline, background)\nchalk.green(\n\t'I am a green line ' +\n\tchalk.blue.underline.bold('with a blue substring') +\n\t' that becomes green again!'\n);\n```\n\nEasily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\nTake advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).\n\n```js\nvar name = 'Sindre';\nconsole.log(chalk.green('Hello %s'), name);\n//=> Hello Sindre\n```\n\n\n## API\n\n### chalk.`<style>[.<style>...](string, [string...])`\n\nExample: `chalk.red.bold.underline('Hello', 'world');`\n\nChain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.\n\nMultiple arguments will be separated by space.\n\n### chalk.enabled\n\nColor support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.\n\nIf you need to change this in a reusable module create a new instance:\n\n```js\nvar ctx = new chalk.constructor({enabled: false});\n```\n\n### chalk.supportsColor\n\nDetect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.\n\nCan be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n### chalk.styles\n\nExposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).\n\nGenerally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.\n\n```js\nvar chalk = require('chalk');\n\nconsole.log(chalk.styles.red);\n//=> {open: '\\u001b[31m', close: '\\u001b[39m'}\n\nconsole.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);\n```\n\n### chalk.hasColor(string)\n\nCheck whether a string [has color](https://github.com/chalk/has-ansi).\n\n### chalk.stripColor(string)\n\n[Strip color](https://github.com/chalk/strip-ansi) from a string.\n\nCan be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.\n\nExample:\n\n```js\nvar chalk = require('chalk');\nvar styledString = getText();\n\nif (!chalk.supportsColor) {\n\tstyledString = chalk.stripColor(styledString);\n}\n```\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue` *(on Windows the bright version is used as normal blue is illegible)*\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## 256-colors\n\nChalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.\n\n\n## Windows\n\nIf you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.\n\n\n## Related\n\n- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module\n- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal\n- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color\n- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes\n- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes\n- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes\n- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
- "bugs": {
- "url": "https://github.com/chalk/chalk/issues"
- },
- "homepage": "https://github.com/chalk/chalk#readme",
- "_id": "chalk@1.1.1",
- "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019",
- "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz",
- "_from": "chalk@>=1.1.1 <2.0.0"
+ }
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
index cbf2b20d33..104a425ad2 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
@@ -40,7 +40,7 @@ console.log(validate.errors)
You can also pass the schema as a string
``` js
-var validate = validate('{"type": ... }')
+var validate = validator('{"type": ... }')
```
Optionally you can use the require submodule to load a schema from `__dirname`
@@ -128,7 +128,7 @@ var validate = validator({
})
validate({hello: 100});
-console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100}
+console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100, type: 'string'}
```
## Greedy mode tries to validate as much as possible
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
index f24db9b1c9..f929bb7539 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
@@ -5,7 +5,6 @@ var xtend = require('xtend')
var formats = require('./formats')
var get = function(obj, additionalSchemas, ptr) {
- if (/^https?:\/\//.test(ptr)) return null
var visit = function(sub) {
if (sub && sub.id === ptr) return sub
@@ -98,13 +97,25 @@ var unique = function(array) {
return true
}
+var isMultipleOf = function(name, multipleOf) {
+ var res;
+ var factor = ((multipleOf | 0) !== multipleOf) ? Math.pow(10, multipleOf.toString().split('.').pop().length) : 1
+ if (factor > 1) {
+ var factorName = ((name | 0) !== name) ? Math.pow(10, name.toString().split('.').pop().length) : 1
+ if (factorName > factor) res = true
+ else res = Math.round(factor * name) % (factor * multipleOf)
+ }
+ else res = name % multipleOf;
+ return !res;
+}
+
var toType = function(node) {
return node.type
}
var compile = function(schema, cache, root, reporter, opts) {
var fmts = opts ? xtend(formats, opts.formats) : formats
- var scope = {unique:unique, formats:fmts}
+ var scope = {unique:unique, formats:fmts, isMultipleOf:isMultipleOf}
var verbose = opts ? !!opts.verbose : false;
var greedy = opts && opts.greedy !== undefined ?
opts.greedy : false;
@@ -150,7 +161,7 @@ var compile = function(schema, cache, root, reporter, opts) {
if (reporter === true) {
validate('if (validate.errors === null) validate.errors = []')
if (verbose) {
- validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name)
+ validate('validate.errors.push({field:%s,message:%s,value:%s,type:%s})', formatName(prop || name), JSON.stringify(msg), value || name, JSON.stringify(type))
} else {
validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg))
}
@@ -434,9 +445,7 @@ var compile = function(schema, cache, root, reporter, opts) {
if (node.multipleOf !== undefined) {
if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name))
- var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1
- if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf)
- else validate('if (%s % %d) {', name, node.multipleOf)
+ validate('if (!isMultipleOf(%s, %d)) {', name, node.multipleOf)
error('has a remainder')
validate('}')
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 5a7c288321..97fba32e74 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
@@ -6,11 +6,15 @@
]
],
"_from": "is-my-json-valid@>=2.12.4 <3.0.0",
- "_id": "is-my-json-valid@2.12.4",
+ "_id": "is-my-json-valid@2.13.1",
"_inCache": true,
"_installable": true,
"_location": "/request/har-validator/is-my-json-valid",
"_nodeVersion": "4.2.3",
+ "_npmOperationalInternal": {
+ "host": "packages-5-east.internal.npmjs.com",
+ "tmp": "tmp/is-my-json-valid-2.13.1.tgz_1456180270224_0.17748022079467773"
+ },
"_npmUser": {
"email": "mathiasbuus@gmail.com",
"name": "mafintosh"
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/har-validator"
],
- "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz",
- "_shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880",
+ "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz",
+ "_shasum": "d55778a82feb6b0963ff4be111d5d1684e890707",
"_shrinkwrap": null,
"_spec": "is-my-json-valid@^2.12.4",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator",
@@ -51,35 +55,35 @@
},
"directories": {},
"dist": {
- "shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880",
- "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz"
+ "shasum": "d55778a82feb6b0963ff4be111d5d1684e890707",
+ "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz"
},
- "gitHead": "8978aa8f40eef4ac47a5d18270c13abd48927ddb",
+ "gitHead": "5bacc71441750bc6e79829abcfc21d4f2f0c4396",
"homepage": "https://github.com/mafintosh/is-my-json-valid",
"keywords": [
"json",
- "jsonschema",
+ "schema",
"orderly",
- "schema"
+ "jsonschema"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
- "name": "freeall",
- "email": "freeall@gmail.com"
+ "email": "freeall@gmail.com",
+ "name": "freeall"
},
{
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
+ "email": "mathiasbuus@gmail.com",
+ "name": "mafintosh"
},
{
- "name": "watson",
- "email": "w@tson.dk"
+ "email": "w@tson.dk",
+ "name": "watson"
},
{
- "name": "yoshuawuyts",
- "email": "i@yoshuawuyts.com"
+ "email": "i@yoshuawuyts.com",
+ "name": "yoshuawuyts"
}
],
"name": "is-my-json-valid",
@@ -92,5 +96,5 @@
"scripts": {
"test": "tape test/*.js"
},
- "version": "2.12.4"
+ "version": "2.13.1"
}
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
index ca3b761805..c13b2670b9 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
@@ -56,5 +56,41 @@
"valid": false
}
]
+ },
+ {
+ "description": "by decimal number where floating point precision is wrong",
+ "schema": {"multipleOf": 0.01},
+ "tests": [
+ {
+ "description": "Number 2 is multiple of 0.01",
+ "data": 2,
+ "valid": true
+ },
+ {
+ "description": "Number 2.1 is multiple of 0.01",
+ "data": 2.1,
+ "valid": true
+ },
+ {
+ "description": "Number 2.2 is multiple of 0.01",
+ "data": 2.2,
+ "valid": true
+ },
+ {
+ "description": "Number 2.3 is multiple of 0.01",
+ "data": 2.3,
+ "valid": true
+ },
+ {
+ "description": "Number 2.4 is multiple of 0.01",
+ "data": 2.4,
+ "valid": true
+ },
+ {
+ "description": "Number 1.211 is not multiple of 0.01",
+ "data": 1.211,
+ "valid": false
+ }
+ ]
}
]
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
index b5109e576f..275f2ac72f 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
@@ -98,6 +98,7 @@ tape('additional props', function(t) {
t.ok(validate({}))
t.notOk(validate({foo:'bar'}))
t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode')
+ t.strictEqual(validate.errors[0].type, 'object', 'error object should contain the type')
t.end()
})
@@ -278,6 +279,22 @@ tape('external schemas', function(t) {
t.end()
})
+tape('external schema URIs', function(t) {
+ var ext = {type: 'string'}
+ var schema = {
+ required: true,
+ $ref: 'http://example.com/schemas/schemaURIs'
+ }
+
+ var opts = {schemas:{}};
+ opts.schemas['http://example.com/schemas/schemaURIs'] = ext;
+ var validate = validator(schema, opts)
+
+ t.ok(validate('hello string'), 'is a string')
+ t.notOk(validate(42), 'not a string')
+ t.end()
+})
+
tape('top-level external schema', function(t) {
var defs = {
"string": {
@@ -354,6 +371,7 @@ tape('verbose mode', function(t) {
t.ok(validate({hello: 'string'}), 'should be valid')
t.notOk(validate({hello: 100}), 'should not be valid')
t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value')
+ t.strictEqual(validate.errors[0].type, 'string', 'error object should contain the type')
t.end()
})
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js
index cc64b902c8..777377a1f7 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/index.js
@@ -1,3 +1,3 @@
'use strict';
-module.exports = global.Promise || require('pinkie');
+module.exports = typeof Promise === 'function' ? Promise : require('pinkie');
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
index fb36c2a454..14ce1bfe3d 100644
--- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
@@ -5,7 +5,7 @@ var SETTLED = 'settled';
var FULFILLED = 'fulfilled';
var REJECTED = 'rejected';
var NOOP = function () {};
-var isNode = typeof process !== 'undefined' && typeof process.emit === 'function';
+var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
var asyncQueue = [];
@@ -156,12 +156,12 @@ function publishRejection(promise) {
promise._state = REJECTED;
publish(promise);
if (!promise._handled && isNode) {
- process.emit('unhandledRejection', promise._data, promise);
+ global.process.emit('unhandledRejection', promise._data, promise);
}
}
function notifyRejectionHandled(promise) {
- process.emit('rejectionHandled', promise);
+ global.process.emit('rejectionHandled', promise);
}
/**
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 2c263f29fa..8cebb11e4c 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
@@ -2,20 +2,20 @@
"_args": [
[
"pinkie@^2.0.0",
- "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise"
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise"
]
],
"_from": "pinkie@>=2.0.0 <3.0.0",
- "_id": "pinkie@2.0.1",
+ "_id": "pinkie@2.0.4",
"_inCache": true,
"_installable": true,
"_location": "/request/har-validator/pinkie-promise/pinkie",
- "_nodeVersion": "4.2.0",
+ "_nodeVersion": "4.2.4",
"_npmUser": {
"email": "floatdrop@gmail.com",
"name": "floatdrop"
},
- "_npmVersion": "2.14.7",
+ "_npmVersion": "2.14.12",
"_phantomChildren": {},
"_requested": {
"name": "pinkie",
@@ -28,11 +28,11 @@
"_requiredBy": [
"/request/har-validator/pinkie-promise"
],
- "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.1.tgz",
- "_shasum": "4236c86fc29f261c2045bbe81f78cbb2a5e8306c",
+ "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+ "_shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870",
"_shrinkwrap": null,
"_spec": "pinkie@^2.0.0",
- "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise",
"author": {
"email": "floatdrop@gmail.com",
"name": "Vsevolod Strukchinsky",
@@ -53,8 +53,8 @@
},
"directories": {},
"dist": {
- "shasum": "4236c86fc29f261c2045bbe81f78cbb2a5e8306c",
- "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.1.tgz"
+ "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870",
+ "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -62,19 +62,19 @@
"files": [
"index.js"
],
- "gitHead": "11d969408e6004f50c3b442fe330f2ead7eb3619",
+ "gitHead": "8d4a92447a5c62bff9f89756caeb4c9c8770579b",
"homepage": "https://github.com/floatdrop/pinkie",
"keywords": [
- "es2015",
- "es6",
"promise",
- "promises"
+ "promises",
+ "es2015",
+ "es6"
],
"license": "MIT",
"maintainers": [
{
- "name": "floatdrop",
- "email": "floatdrop@gmail.com"
+ "email": "floatdrop@gmail.com",
+ "name": "floatdrop"
}
],
"name": "pinkie",
@@ -88,5 +88,5 @@
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "xo && nyc mocha"
},
- "version": "2.0.1"
+ "version": "2.0.4"
}
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 4d76909c5f..54747f60cc 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
@@ -7,7 +7,7 @@
> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation
-[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)
+[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)
There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality.
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 82ca19807d..438996b7ea 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
@@ -2,20 +2,24 @@
"_args": [
[
"pinkie-promise@^2.0.0",
- "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator"
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator"
]
],
"_from": "pinkie-promise@>=2.0.0 <3.0.0",
- "_id": "pinkie-promise@2.0.0",
+ "_id": "pinkie-promise@2.0.1",
"_inCache": true,
"_installable": true,
"_location": "/request/har-validator/pinkie-promise",
- "_nodeVersion": "4.2.0",
+ "_nodeVersion": "4.4.1",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/pinkie-promise-2.0.1.tgz_1460309839126_0.3422858319245279"
+ },
"_npmUser": {
"email": "floatdrop@gmail.com",
"name": "floatdrop"
},
- "_npmVersion": "2.14.7",
+ "_npmVersion": "2.14.20",
"_phantomChildren": {},
"_requested": {
"name": "pinkie-promise",
@@ -28,11 +32,11 @@
"_requiredBy": [
"/request/har-validator"
],
- "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz",
- "_shasum": "4c83538de1f6e660c29e0a13446844f7a7e88259",
+ "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
+ "_shasum": "2135d6dfa7a358c069ac9b178776288228450ffa",
"_shrinkwrap": null,
"_spec": "pinkie-promise@^2.0.0",
- "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator",
"author": {
"email": "floatdrop@gmail.com",
"name": "Vsevolod Strukchinsky",
@@ -50,8 +54,8 @@
},
"directories": {},
"dist": {
- "shasum": "4c83538de1f6e660c29e0a13446844f7a7e88259",
- "tarball": "http://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz"
+ "shasum": "2135d6dfa7a358c069ac9b178776288228450ffa",
+ "tarball": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -59,21 +63,21 @@
"files": [
"index.js"
],
- "gitHead": "f90fcae9838bcae7ae1ae4ebc9b29f11e5db4980",
+ "gitHead": "4a936c09c34ad591a25db93f1216d242de0d6184",
"homepage": "https://github.com/floatdrop/pinkie-promise",
"keywords": [
+ "promise",
+ "promises",
"es2015",
"es6",
"polyfill",
- "ponyfill",
- "promise",
- "promises"
+ "ponyfill"
],
"license": "MIT",
"maintainers": [
{
- "name": "floatdrop",
- "email": "floatdrop@gmail.com"
+ "email": "floatdrop@gmail.com",
+ "name": "floatdrop"
}
],
"name": "pinkie-promise",
@@ -86,5 +90,5 @@
"scripts": {
"test": "mocha"
},
- "version": "2.0.0"
+ "version": "2.0.1"
}
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 94e6a907d4..3e0e286cde 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
@@ -137,7 +137,8 @@ function write(key) {
for (i = 0; i < parts.length; ++i) {
var data = key.part[parts[i]].data;
- data = utils.mpNormalize(data);
+ if (algInfo.normalize !== false)
+ data = utils.mpNormalize(data);
buf.writeBuffer(data);
}
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 d57285aeb7..572b00edee 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
@@ -139,7 +139,7 @@ function parseInteger(option, optstr, arg) {
function parsePositiveInteger(option, optstr, arg) {
assert.string(arg, 'arg');
var num = Number(arg);
- if (!/^[0-9]+$/.test(arg) || isNaN(num)) {
+ if (!/^[0-9]+$/.test(arg) || isNaN(num) || num === 0) {
throw new Error(format('arg for "%s" is not a positive integer: "%s"',
optstr, arg));
}
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/dashdash/node_modules/assert-plus/AUTHORS
new file mode 100644
index 0000000000..1923524fe4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS
@@ -0,0 +1,6 @@
+Dave Eddy <dave@daveeddy.com>
+Fred Kuo <fred.kuo@joyent.com>
+Lars-Magnus Skog <ralphtheninja@riseup.net>
+Mark Cavage <mcavage@gmail.com>
+Patrick Mooney <pmooney@pfmooney.com>
+Rob Gulewich <robert.gulewich@joyent.com>
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/dashdash/node_modules/assert-plus/CHANGES.md
new file mode 100644
index 0000000000..57d92bfdb9
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md
@@ -0,0 +1,14 @@
+# assert-plus Changelog
+
+## 1.0.0
+
+- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input
+- Add assert.finite check. Previous assert.number callers should use this if
+ they expect Infinity inputs to throw.
+
+## 0.2.0
+
+- Fix `assert.object(null)` so it throws
+- Fix optional/arrayOf exports for non-type-of asserts
+- Add optiona/arrayOf exports for Stream/Date/Regex/uuid
+- Add basic unit test coverage
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/dashdash/node_modules/assert-plus/README.md
new file mode 100644
index 0000000000..ec200d161e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md
@@ -0,0 +1,162 @@
+# assert-plus
+
+This library is a super small wrapper over node's assert module that has two
+things: (1) the ability to disable assertions with the environment variable
+NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like
+`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks
+like this:
+
+```javascript
+ var assert = require('assert-plus');
+
+ function fooAccount(options, callback) {
+ assert.object(options, 'options');
+ assert.number(options.id, 'options.id');
+ assert.bool(options.isManager, 'options.isManager');
+ assert.string(options.name, 'options.name');
+ assert.arrayOfString(options.email, 'options.email');
+ assert.func(callback, 'callback');
+
+ // Do stuff
+ callback(null, {});
+ }
+```
+
+# API
+
+All methods that *aren't* part of node's core assert API are simply assumed to
+take an argument, and then a string 'name' that's not a message; `AssertionError`
+will be thrown if the assertion fails with a message like:
+
+ AssertionError: foo (string) is required
+ at test (/home/mark/work/foo/foo.js:3:9)
+ at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
+ at Module._compile (module.js:446:26)
+ at Object..js (module.js:464:10)
+ at Module.load (module.js:353:31)
+ at Function._load (module.js:311:12)
+ at Array.0 (module.js:484:10)
+ at EventEmitter._tickCallback (node.js:190:38)
+
+from:
+
+```javascript
+ function test(foo) {
+ assert.string(foo, 'foo');
+ }
+```
+
+There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`:
+
+```javascript
+ function test(foo) {
+ assert.arrayOfString(foo, 'foo');
+ }
+```
+
+You can assert IFF an argument is not `undefined` (i.e., an optional arg):
+
+```javascript
+ assert.optionalString(foo, 'foo');
+```
+
+Lastly, you can opt-out of assertion checking altogether by setting the
+environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have
+lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
+production. Be advised: The standard functions re-exported from `assert` are
+also disabled in assert-plus if NDEBUG is specified. Using them directly from
+the `assert` module avoids this behavior.
+
+The complete list of APIs is:
+
+* assert.array
+* assert.bool
+* assert.buffer
+* assert.func
+* assert.number
+* assert.finite
+* assert.object
+* assert.string
+* assert.stream
+* assert.date
+* assert.regexp
+* assert.uuid
+* assert.arrayOfArray
+* assert.arrayOfBool
+* assert.arrayOfBuffer
+* assert.arrayOfFunc
+* assert.arrayOfNumber
+* assert.arrayOfFinite
+* assert.arrayOfObject
+* assert.arrayOfString
+* assert.arrayOfStream
+* assert.arrayOfDate
+* assert.arrayOfRegexp
+* assert.arrayOfUuid
+* assert.optionalArray
+* assert.optionalBool
+* assert.optionalBuffer
+* assert.optionalFunc
+* assert.optionalNumber
+* assert.optionalFinite
+* assert.optionalObject
+* assert.optionalString
+* assert.optionalStream
+* assert.optionalDate
+* assert.optionalRegexp
+* assert.optionalUuid
+* assert.optionalArrayOfArray
+* assert.optionalArrayOfBool
+* assert.optionalArrayOfBuffer
+* assert.optionalArrayOfFunc
+* assert.optionalArrayOfNumber
+* assert.optionalArrayOfFinite
+* assert.optionalArrayOfObject
+* assert.optionalArrayOfString
+* assert.optionalArrayOfStream
+* assert.optionalArrayOfDate
+* assert.optionalArrayOfRegexp
+* assert.optionalArrayOfUuid
+* assert.AssertionError
+* assert.fail
+* assert.ok
+* assert.equal
+* assert.notEqual
+* assert.deepEqual
+* assert.notDeepEqual
+* assert.strictEqual
+* assert.notStrictEqual
+* assert.throws
+* assert.doesNotThrow
+* assert.ifError
+
+# Installation
+
+ npm install assert-plus
+
+## License
+
+The MIT License (MIT)
+Copyright (c) 2012 Mark Cavage
+
+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.
+
+## Bugs
+
+See <https://github.com/mcavage/node-assert-plus/issues>.
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/dashdash/node_modules/assert-plus/assert.js
new file mode 100644
index 0000000000..26f944eec3
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js
@@ -0,0 +1,211 @@
+// Copyright (c) 2012, Mark Cavage. All rights reserved.
+// Copyright 2015 Joyent, Inc.
+
+var assert = require('assert');
+var Stream = require('stream').Stream;
+var util = require('util');
+
+
+///--- Globals
+
+/* JSSTYLED */
+var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
+
+
+///--- Internal
+
+function _capitalize(str) {
+ return (str.charAt(0).toUpperCase() + str.slice(1));
+}
+
+function _toss(name, expected, oper, arg, actual) {
+ throw new assert.AssertionError({
+ message: util.format('%s (%s) is required', name, expected),
+ actual: (actual === undefined) ? typeof (arg) : actual(arg),
+ expected: expected,
+ operator: oper || '===',
+ stackStartFunction: _toss.caller
+ });
+}
+
+function _getClass(arg) {
+ return (Object.prototype.toString.call(arg).slice(8, -1));
+}
+
+function noop() {
+ // Why even bother with asserts?
+}
+
+
+///--- Exports
+
+var types = {
+ bool: {
+ check: function (arg) { return typeof (arg) === 'boolean'; }
+ },
+ func: {
+ check: function (arg) { return typeof (arg) === 'function'; }
+ },
+ string: {
+ check: function (arg) { return typeof (arg) === 'string'; }
+ },
+ object: {
+ check: function (arg) {
+ return typeof (arg) === 'object' && arg !== null;
+ }
+ },
+ number: {
+ check: function (arg) {
+ return typeof (arg) === 'number' && !isNaN(arg);
+ }
+ },
+ finite: {
+ check: function (arg) {
+ return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
+ }
+ },
+ buffer: {
+ check: function (arg) { return Buffer.isBuffer(arg); },
+ operator: 'Buffer.isBuffer'
+ },
+ array: {
+ check: function (arg) { return Array.isArray(arg); },
+ operator: 'Array.isArray'
+ },
+ stream: {
+ check: function (arg) { return arg instanceof Stream; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ date: {
+ check: function (arg) { return arg instanceof Date; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ regexp: {
+ check: function (arg) { return arg instanceof RegExp; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ uuid: {
+ check: function (arg) {
+ return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
+ },
+ operator: 'isUUID'
+ }
+};
+
+function _setExports(ndebug) {
+ var keys = Object.keys(types);
+ var out;
+
+ /* re-export standard assert */
+ if (process.env.NODE_NDEBUG) {
+ out = noop;
+ } else {
+ out = function (arg, msg) {
+ if (!arg) {
+ _toss(msg, 'true', arg);
+ }
+ };
+ }
+
+ /* standard checks */
+ keys.forEach(function (k) {
+ if (ndebug) {
+ out[k] = noop;
+ return;
+ }
+ var type = types[k];
+ out[k] = function (arg, msg) {
+ if (!type.check(arg)) {
+ _toss(msg, k, type.operator, arg, type.actual);
+ }
+ };
+ });
+
+ /* optional checks */
+ keys.forEach(function (k) {
+ var name = 'optional' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ out[name] = function (arg, msg) {
+ if (arg === undefined || arg === null) {
+ return;
+ }
+ if (!type.check(arg)) {
+ _toss(msg, k, type.operator, arg, type.actual);
+ }
+ };
+ });
+
+ /* arrayOf checks */
+ keys.forEach(function (k) {
+ var name = 'arrayOf' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ var expected = '[' + k + ']';
+ out[name] = function (arg, msg) {
+ if (!Array.isArray(arg)) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ var i;
+ for (i = 0; i < arg.length; i++) {
+ if (!type.check(arg[i])) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ }
+ };
+ });
+
+ /* optionalArrayOf checks */
+ keys.forEach(function (k) {
+ var name = 'optionalArrayOf' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ var expected = '[' + k + ']';
+ out[name] = function (arg, msg) {
+ if (arg === undefined || arg === null) {
+ return;
+ }
+ if (!Array.isArray(arg)) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ var i;
+ for (i = 0; i < arg.length; i++) {
+ if (!type.check(arg[i])) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ }
+ };
+ });
+
+ /* re-export built-in assertions */
+ Object.keys(assert).forEach(function (k) {
+ if (k === 'AssertionError') {
+ out[k] = assert[k];
+ return;
+ }
+ if (ndebug) {
+ out[k] = noop;
+ return;
+ }
+ out[k] = assert[k];
+ });
+
+ /* export ourselves (for unit tests _only_) */
+ out._setExports = _setExports;
+
+ return out;
+}
+
+module.exports = _setExports(process.env.NODE_NDEBUG);
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/dashdash/node_modules/assert-plus/package.json
new file mode 100644
index 0000000000..5e7cfaadf2
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json
@@ -0,0 +1,107 @@
+{
+ "_args": [
+ [
+ "assert-plus@^1.0.0",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash"
+ ]
+ ],
+ "_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",
+ "_nodeVersion": "0.10.40",
+ "_npmUser": {
+ "email": "patrick.f.mooney@gmail.com",
+ "name": "pfmooney"
+ },
+ "_npmVersion": "3.3.9",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "assert-plus",
+ "raw": "assert-plus@^1.0.0",
+ "rawSpec": "^1.0.0",
+ "scope": null,
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/http-signature/sshpk/dashdash"
+ ],
+ "_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",
+ "author": {
+ "email": "mcavage@gmail.com",
+ "name": "Mark Cavage"
+ },
+ "bugs": {
+ "url": "https://github.com/mcavage/node-assert-plus/issues"
+ },
+ "contributors": [
+ {
+ "email": "dave@daveeddy.com",
+ "name": "Dave Eddy"
+ },
+ {
+ "email": "fred.kuo@joyent.com",
+ "name": "Fred Kuo"
+ },
+ {
+ "email": "ralphtheninja@riseup.net",
+ "name": "Lars-Magnus Skog"
+ },
+ {
+ "email": "mcavage@gmail.com",
+ "name": "Mark Cavage"
+ },
+ {
+ "email": "pmooney@pfmooney.com",
+ "name": "Patrick Mooney"
+ },
+ {
+ "email": "robert.gulewich@joyent.com",
+ "name": "Rob Gulewich"
+ }
+ ],
+ "dependencies": {},
+ "description": "Extra assertions on top of node's assert module",
+ "devDependencies": {
+ "faucet": "0.0.1",
+ "tape": "4.2.2"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
+ "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.8"
+ },
+ "homepage": "https://github.com/mcavage/node-assert-plus#readme",
+ "license": "MIT",
+ "main": "./assert.js",
+ "maintainers": [
+ {
+ "email": "mcavage@gmail.com",
+ "name": "mcavage"
+ },
+ {
+ "email": "patrick.f.mooney@gmail.com",
+ "name": "pfmooney"
+ }
+ ],
+ "name": "assert-plus",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mcavage/node-assert-plus.git"
+ },
+ "scripts": {
+ "test": "tape tests/*.js | ./node_modules/.bin/faucet"
+ },
+ "version": "1.0.0"
+}
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 75331bae2b..81f871030f 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
@@ -6,15 +6,19 @@
]
],
"_from": "dashdash@>=1.10.1 <2.0.0",
- "_id": "dashdash@1.12.2",
+ "_id": "dashdash@1.13.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"
+ },
"_npmUser": {
"email": "trentm@gmail.com",
"name": "trentm"
},
- "_npmVersion": "1.4.28",
+ "_npmVersion": "1.4.29",
"_phantomChildren": {},
"_requested": {
"name": "dashdash",
@@ -27,8 +31,8 @@
"_requiredBy": [
"/request/http-signature/sshpk"
],
- "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.12.2.tgz",
- "_shasum": "1c6f70588498d047b8cd5777b32ba85a5e25be36",
+ "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz",
+ "_shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a",
"_shrinkwrap": null,
"_spec": "dashdash@>=1.10.1 <2.0.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk",
@@ -42,8 +46,8 @@
},
"contributors": [
{
- "name": "Trent Mick",
"email": "trentm@gmail.com",
+ "name": "Trent Mick",
"url": "http://trentm.com"
},
{
@@ -57,10 +61,14 @@
{
"name": "Patrick Mooney",
"url": "https://github.com/pfmooney"
+ },
+ {
+ "name": "Dave Pacheco",
+ "url": "https://github.com/davepacheco"
}
],
"dependencies": {
- "assert-plus": "^0.2.0"
+ "assert-plus": "^1.0.0"
},
"description": "A light, featureful and explicit option parsing library.",
"devDependencies": {
@@ -68,30 +76,30 @@
},
"directories": {},
"dist": {
- "shasum": "1c6f70588498d047b8cd5777b32ba85a5e25be36",
- "tarball": "http://registry.npmjs.org/dashdash/-/dashdash-1.12.2.tgz"
+ "shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a",
+ "tarball": "http://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz"
},
"engines": {
- "node": ">=0.8"
+ "node": ">=0.10"
},
- "gitHead": "d4248f21da0b30bd89c88ccee9bf6eac0e59f9f6",
+ "gitHead": "69425c9d9000d72c95e78ca43e3f84675f8f73ff",
"homepage": "https://github.com/trentm/node-dashdash",
"keywords": [
- "args",
- "bash",
- "cli",
- "command",
- "completion",
"option",
"parser",
- "parsing"
+ "parsing",
+ "cli",
+ "command",
+ "args",
+ "bash",
+ "completion"
],
"license": "MIT",
"main": "./lib/dashdash.js",
"maintainers": [
{
- "name": "trentm",
- "email": "trentm@gmail.com"
+ "email": "trentm@gmail.com",
+ "name": "trentm"
}
],
"name": "dashdash",
@@ -104,5 +112,5 @@
"scripts": {
"test": "nodeunit test/*.test.js"
},
- "version": "1.12.2"
+ "version": "1.13.0"
}
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 a75b45f9c4..3ebc0affaa 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,6 +2,59 @@ 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
+ <https://github.com/dchest/tweetnacl-util-js> package:
+
+ <script src="nacl.min.js"></script>
+ <script src="nacl-util.min.js"></script>
+
+ 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
-------
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
new file mode 100644
index 0000000000..c2bd1e5b7e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt
@@ -0,0 +1,9 @@
+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 11bd3472c2..c80bbed8d8 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](https://dchest.github.io/tweetnacl-js/)
+Demo: <https://tweetnacl.js.org>
**: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,8 +26,6 @@ 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)
@@ -67,10 +65,20 @@ 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 `nacl.util` namespace.
+encode or decode strings, use functions from
+<https://github.com/dchest/tweetnacl-util-js> 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.
+
### Public-key authenticated encryption (box)
@@ -287,12 +295,6 @@ 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:
@@ -326,30 +328,6 @@ 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
-------------------
@@ -364,7 +342,7 @@ of:
Other systems:
-* Node.js (we test on 0.10 and later)
+* Node.js
Development and testing
@@ -385,32 +363,36 @@ Tests use minified version, so make sure to rebuild it every time you change
To run tests in Node.js:
- $ npm test
+ $ npm run test-node
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 test
+ $ NACL_SRC=nacl-fast.min.js npm run test-node
To run full suite of tests in Node.js, including comparing outputs of
JavaScript port to outputs of the original C version:
- $ npm run testall
+ $ npm run test-node-all
To prepare tests for browsers:
- $ npm run browser
+ $ npm run build-test-browser
and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to
run them.
-To run headless browser tests with `testling`:
+To run headless browser tests with `tape-run` (powered by Electron):
- $ npm run testling
+ $ npm run test-browser
(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 6c4995848c..5e4562fe89 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 = (g[9] >>> ((2 * 8) - 1)) - 1;
+ mask = (c ^ 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,39 +2157,13 @@ function cleanup(arr) {
for (var i = 0; i < arr.length; i++) arr[i] = 0;
}
-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;
- }
-};
+// 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.randomBytes = function(n) {
var b = new Uint8Array(n);
@@ -2386,26 +2360,22 @@ nacl.setPRNG = function(fn) {
(function() {
// Initialize PRNG if environment provides CSPRNG.
// If not, methods calling randombytes will throw.
- 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);
- });
- }
+ 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);
+ });
} else if (typeof require !== 'undefined') {
// Node.js.
crypto = require('crypto');
- if (crypto) {
+ if (crypto && crypto.randomBytes) {
nacl.setPRNG(function(x, n) {
var i, v = crypto.randomBytes(n);
for (i = 0; i < n; i++) x[i] = v[i];
@@ -2415,4 +2385,4 @@ nacl.setPRNG = function(fn) {
}
})();
-})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {}));
+})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.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 7072c2af44..624fbbe91e 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,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<arguments.length;t++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[t])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function W(r){for(var t=0;t<r.length;t++)r[t]=0}var $=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},rr=function(){throw new Error("no PRNG")},tr=new Uint8Array(16),nr=new Uint8Array(32);nr[0]=9;var er=$(),or=$([1]),ir=$([56129,1]),hr=$([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),ar=$([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),fr=$([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),sr=$([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ur=$([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),cr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),yr=function(r){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t,n,e,o,i,h,a,f;t=255&r[0]|(255&r[1])<<8,this.r[0]=8191&t,n=255&r[2]|(255&r[3])<<8,this.r[1]=8191&(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;t<n.length;t++)e[t]=n.charCodeAt(t);return e},r.util.encodeUTF8=function(r){var t,n=[];for(t=0;t<r.length;t++)n.push(String.fromCharCode(r[t]));return decodeURIComponent(escape(n.join("")))},r.util.encodeBase64=function(r){if("undefined"==typeof btoa)return new Buffer(r).toString("base64");var t,n=[],e=r.length;for(t=0;e>t;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;t<n.length;t++)e[t]=n.charCodeAt(t);return e},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(dr+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+dr]=r[i];return p(o,e,e.length,t,n),o.subarray(Ar)},r.secretbox.open=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(Ar+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+Ar]=r[i];return e.length<32?!1:0!==g(o,e,e.length,t,n)?!1:o.subarray(dr)},r.secretbox.keyLength=vr,r.secretbox.nonceLength=br,r.secretbox.overheadLength=Ar,r.scalarMult=function(r,t){if(Q(r,t),r.length!==Ur)throw new Error("bad n size");if(t.length!==_r)throw new Error("bad p size");var n=new Uint8Array(_r);return T(n,r,t),n},r.scalarMult.base=function(r){if(Q(r),r.length!==Ur)throw new Error("bad n size");var t=new Uint8Array(_r);return Y(t,r),t},r.scalarMult.scalarLength=Ur,r.scalarMult.groupElementLength=_r,r.box=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox(t,n,i)},r.box.before=function(r,t){Q(r,t),J(r,t);var n=new Uint8Array(Mr);return L(n,r,t),n},r.box.after=r.secretbox,r.box.open=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox.open(t,n,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Er),t=new Uint8Array(xr);return k(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==xr)throw new Error("bad secret key size");var t=new Uint8Array(Er);return Y(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Er,r.box.secretKeyLength=xr,r.box.sharedKeyLength=Mr,r.box.nonceLength=mr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(Q(r,t),t.length!==Yr)throw new Error("bad secret key size");var n=new Uint8Array(Kr+r.length);return q(n,r,r.length,t),n},r.sign.open=function(r,t){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Q(r,t),t.length!==Tr)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=D(n,r,r.length,t);if(0>e)return null;for(var o=new Uint8Array(e),i=0;i<o.length;i++)o[i]=n[i];return o},r.sign.detached=function(t,n){for(var e=r.sign(t,n),o=new Uint8Array(Kr),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(Q(r,t,n),t.length!==Kr)throw new Error("bad signature size");if(n.length!==Tr)throw new Error("bad public key size");var e,o=new Uint8Array(Kr+r.length),i=new Uint8Array(Kr+r.length);for(e=0;Kr>e;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+Kr]=r[e];return D(i,o,o.length,n)>=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;n<t.length;n++)t[n]=r[32+n];return{publicKey:t,secretKey:new Uint8Array(r)
-}},r.sign.keyPair.fromSeed=function(r){if(Q(r),r.length!==kr)throw new Error("bad seed size");for(var t=new Uint8Array(Tr),n=new Uint8Array(Yr),e=0;32>e;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
+!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<arguments.length;t++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[t])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function W(r){for(var t=0;t<r.length;t++)r[t]=0}var $=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},rr=function(){throw new Error("no PRNG")},tr=new Uint8Array(16),nr=new Uint8Array(32);nr[0]=9;var er=$(),or=$([1]),ir=$([56129,1]),hr=$([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),ar=$([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),fr=$([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),sr=$([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ur=$([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),cr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),yr=function(r){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t,n,e,o,i,h,a,f;t=255&r[0]|(255&r[1])<<8,this.r[0]=8191&t,n=255&r[2]|(255&r[3])<<8,this.r[1]=8191&(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;i<r.length;i++)e[i+_r]=r[i];return p(o,e,e.length,t,n),o.subarray(Ar)},r.secretbox.open=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(Ar+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+Ar]=r[i];return e.length<32?!1:0!==v(o,e,e.length,t,n)?!1:o.subarray(_r)},r.secretbox.keyLength=br,r.secretbox.nonceLength=gr,r.secretbox.overheadLength=Ar,r.scalarMult=function(r,t){if(Q(r,t),r.length!==Ur)throw new Error("bad n size");if(t.length!==dr)throw new Error("bad p size");var n=new Uint8Array(dr);return T(n,r,t),n},r.scalarMult.base=function(r){if(Q(r),r.length!==Ur)throw new Error("bad n size");var t=new Uint8Array(dr);return Y(t,r),t},r.scalarMult.scalarLength=Ur,r.scalarMult.groupElementLength=dr,r.box=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox(t,n,i)},r.box.before=function(r,t){Q(r,t),J(r,t);var n=new Uint8Array(Mr);return L(n,r,t),n},r.box.after=r.secretbox,r.box.open=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox.open(t,n,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Er),t=new Uint8Array(xr);return k(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==xr)throw new Error("bad secret key size");var t=new Uint8Array(Er);return Y(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Er,r.box.secretKeyLength=xr,r.box.sharedKeyLength=Mr,r.box.nonceLength=mr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(Q(r,t),t.length!==Yr)throw new Error("bad secret key size");var n=new Uint8Array(Kr+r.length);return V(n,r,r.length,t),n},r.sign.open=function(r,t){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Q(r,t),t.length!==Tr)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=D(n,r,r.length,t);if(0>e)return null;for(var o=new Uint8Array(e),i=0;i<o.length;i++)o[i]=n[i];return o},r.sign.detached=function(t,n){for(var e=r.sign(t,n),o=new Uint8Array(Kr),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(Q(r,t,n),t.length!==Kr)throw new Error("bad signature size");if(n.length!==Tr)throw new Error("bad public key size");var e,o=new Uint8Array(Kr+r.length),i=new Uint8Array(Kr+r.length);for(e=0;Kr>e;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+Kr]=r[e];return D(i,o,o.length,n)>=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;n<t.length;n++)t[n]=r[32+n];return{publicKey:t,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(Q(r),r.length!==kr)throw new Error("bad seed size");for(var t=new Uint8Array(Tr),n=new Uint8Array(Yr),e=0;32>e;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
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 b8edbbee69..f72dd78d12 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,39 +944,13 @@ function cleanup(arr) {
for (var i = 0; i < arr.length; i++) arr[i] = 0;
}
-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;
- }
-};
+// 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.randomBytes = function(n) {
var b = new Uint8Array(n);
@@ -1173,26 +1147,22 @@ nacl.setPRNG = function(fn) {
(function() {
// Initialize PRNG if environment provides CSPRNG.
// If not, methods calling randombytes will throw.
- 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);
- });
- }
+ 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);
+ });
} else if (typeof require !== 'undefined') {
// Node.js.
crypto = require('crypto');
- if (crypto) {
+ if (crypto && crypto.randomBytes) {
nacl.setPRNG(function(x, n) {
var i, v = crypto.randomBytes(n);
for (i = 0; i < n; i++) x[i] = v[i];
@@ -1202,4 +1172,4 @@ nacl.setPRNG = function(fn) {
}
})();
-})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {}));
+})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.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 95d869502e..eed3854153 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<<n|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<arguments.length;e++)r=arguments[e].lo,n=arguments[e].hi,t+=r&f,o+=r>>>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;r<arguments.length;r++)n^=arguments[r].lo,e^=arguments[r].hi;return new lr(e,n)}function I(r,n){var e,t,o=32-n;return 32>n?(e=r.hi>>>n|r.lo<<o,t=r.lo>>>n|r.hi<<o):64>n&&(e=r.lo>>>n|r.hi<<o,t=r.hi>>>n|r.lo<<o),new lr(e,t)}function Z(r,n,e){var t=r.hi&n.hi^~r.hi&e.hi,o=r.lo&n.lo^~r.lo&e.lo;return new lr(t,o)}function V(r,n,e){var t=r.hi&n.hi^r.hi&e.hi^n.hi&e.hi,o=r.lo&n.lo^r.lo&e.lo^n.lo&e.lo;return new lr(t,o)}function q(r){return G(I(r,28),I(r,34),I(r,39))}function X(r){return G(I(r,14),I(r,18),I(r,41))}function D(r){return G(I(r,1),I(r,8),j(r,7))}function H(r){return G(I(r,19),I(r,61),j(r,6))}function J(r,n,e){var o,a,f,u=[],c=[],w=[],y=[];for(a=0;8>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;n<arguments.length;n++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[n])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function sr(r){for(var n=0;n<r.length;n++)r[n]=0}var lr=function(r,n){this.hi=0|r,this.lo=0|n},hr=function(r){var n,e=new Float64Array(16);if(r)for(n=0;n<r.length;n++)e[n]=r[n];return e},gr=function(){throw new Error("no PRNG")},pr=new Uint8Array(16),vr=new Uint8Array(32);vr[0]=9;var br=hr(),Ar=hr([1]),Ur=hr([56129,1]),_r=hr([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),dr=hr([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Er=hr([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),xr=hr([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),mr=hr([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),Br=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),Sr=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]),Kr=A,Tr=U,Yr=[new lr(1116352408,3609767458),new lr(1899447441,602891725),new lr(3049323471,3964484399),new lr(3921009573,2173295548),new lr(961987163,4081628472),new lr(1508970993,3053834265),new lr(2453635748,2937671579),new lr(2870763221,3664609560),new lr(3624381080,2734883394),new lr(310598401,1164996542),new lr(607225278,1323610764),new lr(1426881987,3590304994),new lr(1925078388,4068182383),new lr(2162078206,991336113),new lr(2614888103,633803317),new lr(3248222580,3479774868),new lr(3835390401,2666613458),new lr(4022224774,944711139),new lr(264347078,2341262773),new lr(604807628,2007800933),new lr(770255983,1495990901),new lr(1249150122,1856431235),new lr(1555081692,3175218132),new lr(1996064986,2198950837),new lr(2554220882,3999719339),new lr(2821834349,766784016),new lr(2952996808,2566594879),new lr(3210313671,3203337956),new lr(3336571891,1034457026),new lr(3584528711,2466948901),new lr(113926993,3758326383),new lr(338241895,168717936),new lr(666307205,1188179964),new lr(773529912,1546045734),new lr(1294757372,1522805485),new lr(1396182291,2643833823),new lr(1695183700,2343527390),new lr(1986661051,1014477480),new lr(2177026350,1206759142),new lr(2456956037,344077627),new lr(2730485921,1290863460),new lr(2820302411,3158454273),new lr(3259730800,3505952657),new lr(3345764771,106217008),new lr(3516065817,3606008344),new lr(3600352804,1432725776),new lr(4094571909,1467031594),new lr(275423344,851169720),new lr(430227734,3100823752),new lr(506948616,1363258195),new lr(659060556,3750685593),new lr(883997877,3785050280),new lr(958139571,3318307427),new lr(1322822218,3812723403),new lr(1537002063,2003034995),new lr(1747873779,3602036899),new lr(1955562222,1575990012),new lr(2024104815,1125592928),new lr(2227730452,2716904306),new lr(2361852424,442776044),new lr(2428436474,593698344),new lr(2756734187,3733110249),new lr(3204031479,2999351573),new lr(3329325298,3815920427),new lr(3391569614,3928383900),new lr(3515267271,566280711),new lr(3940187606,3454069534),new lr(4118630271,4000239992),new lr(116418474,1914138554),new lr(174292421,2731055270),new lr(289380356,3203993006),new lr(460393269,320620315),new lr(685471733,587496836),new lr(852142971,1086792851),new lr(1017036298,365543100),new lr(1126000580,2618297676),new lr(1288033470,3409855158),new lr(1501505948,4234509866),new lr(1607167915,987167468),new lr(1816402316,1246189591)],Lr=new Uint8Array([106,9,230,103,243,188,201,8,187,103,174,133,132,202,167,59,60,110,243,114,254,148,248,43,165,79,245,58,95,29,54,241,81,14,82,127,173,230,130,209,155,5,104,140,43,62,108,31,31,131,217,171,251,65,189,107,91,224,205,25,19,126,33,121]),Cr=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]),Rr=32,kr=24,zr=32,Pr=16,Or=32,Fr=32,Nr=32,Mr=32,jr=32,Gr=kr,Ir=zr,Zr=Pr,Vr=64,qr=32,Xr=64,Dr=32,Hr=64;r.lowlevel={crypto_core_hsalsa20:y,crypto_stream_xor:g,crypto_stream:h,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:l,crypto_onetimeauth:v,crypto_onetimeauth_verify:b,crypto_verify_16:f,crypto_verify_32:u,crypto_secretbox:A,crypto_secretbox_open:U,crypto_scalarmult:k,crypto_scalarmult_base:z,crypto_box_beforenm:O,crypto_box_afternm:Kr,crypto_box:F,crypto_box_open:N,crypto_box_keypair:P,crypto_hash:Q,crypto_sign:ar,crypto_sign_keypair:tr,crypto_sign_open:ur,crypto_secretbox_KEYBYTES:Rr,crypto_secretbox_NONCEBYTES:kr,crypto_secretbox_ZEROBYTES:zr,crypto_secretbox_BOXZEROBYTES:Pr,crypto_scalarmult_BYTES:Or,crypto_scalarmult_SCALARBYTES:Fr,crypto_box_PUBLICKEYBYTES:Nr,crypto_box_SECRETKEYBYTES:Mr,crypto_box_BEFORENMBYTES:jr,crypto_box_NONCEBYTES:Gr,crypto_box_ZEROBYTES:Ir,crypto_box_BOXZEROBYTES:Zr,crypto_sign_BYTES:Vr,crypto_sign_PUBLICKEYBYTES:qr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:Dr,crypto_hash_BYTES:Hr},r.util={},r.util.decodeUTF8=function(r){var n,e=unescape(encodeURIComponent(r)),t=new Uint8Array(e.length);for(n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},r.util.encodeUTF8=function(r){var n,e=[];for(n=0;n<r.length;n++)e.push(String.fromCharCode(r[n]));return decodeURIComponent(escape(e.join("")))},r.util.encodeBase64=function(r){if("undefined"==typeof btoa)return new Buffer(r).toString("base64");var n,e=[],t=r.length;for(n=0;t>n;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;n<e.length;n++)t[n]=e.charCodeAt(n);return t},r.randomBytes=function(r){var n=new Uint8Array(r);return gr(n,r),n},r.secretbox=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(zr+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+zr]=r[i];return A(o,t,t.length,n,e),o.subarray(Pr)},r.secretbox.open=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(Pr+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+Pr]=r[i];return t.length<32?!1:0!==U(o,t,t.length,n,e)?!1:o.subarray(zr)},r.secretbox.keyLength=Rr,r.secretbox.nonceLength=kr,r.secretbox.overheadLength=Pr,r.scalarMult=function(r,n){if(yr(r,n),r.length!==Fr)throw new Error("bad n size");if(n.length!==Or)throw new Error("bad p size");var e=new Uint8Array(Or);return k(e,r,n),e},r.scalarMult.base=function(r){if(yr(r),r.length!==Fr)throw new Error("bad n size");var n=new Uint8Array(Or);return z(n,r),n},r.scalarMult.scalarLength=Fr,r.scalarMult.groupElementLength=Or,r.box=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox(n,e,i)},r.box.before=function(r,n){yr(r,n),wr(r,n);var e=new Uint8Array(jr);return O(e,r,n),e},r.box.after=r.secretbox,r.box.open=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox.open(n,e,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Nr),n=new Uint8Array(Mr);return P(r,n),{publicKey:r,secretKey:n}},r.box.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Mr)throw new Error("bad secret key size");var n=new Uint8Array(Nr);return z(n,r),{publicKey:n,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Nr,r.box.secretKeyLength=Mr,r.box.sharedKeyLength=jr,r.box.nonceLength=Gr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,n){if(yr(r,n),n.length!==Xr)throw new Error("bad secret key size");var e=new Uint8Array(Vr+r.length);return ar(e,r,r.length,n),e},r.sign.open=function(r,n){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(yr(r,n),n.length!==qr)throw new Error("bad public key size");var e=new Uint8Array(r.length),t=ur(e,r,r.length,n);if(0>t)return null;for(var o=new Uint8Array(t),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached=function(n,e){for(var t=r.sign(n,e),o=new Uint8Array(Vr),i=0;i<o.length;i++)o[i]=t[i];return o},r.sign.detached.verify=function(r,n,e){if(yr(r,n,e),n.length!==Vr)throw new Error("bad signature size");if(e.length!==qr)throw new Error("bad public key size");var t,o=new Uint8Array(Vr+r.length),i=new Uint8Array(Vr+r.length);for(t=0;Vr>t;t++)o[t]=n[t];for(t=0;t<r.length;t++)o[t+Vr]=r[t];return ur(i,o,o.length,e)>=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;e<n.length;e++)n[e]=r[32+e];return{publicKey:n,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(yr(r),r.length!==Dr)throw new Error("bad seed size");for(var n=new Uint8Array(qr),e=new Uint8Array(Xr),t=0;32>t;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
+!function(r){"use strict";function n(r,n){return r<<n|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<arguments.length;e++)r=arguments[e].lo,n=arguments[e].hi,t+=r&f,o+=r>>>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;r<arguments.length;r++)n^=arguments[r].lo,e^=arguments[r].hi;return new lr(e,n)}function j(r,n){var e,t,o=32-n;return 32>n?(e=r.hi>>>n|r.lo<<o,t=r.lo>>>n|r.hi<<o):64>n&&(e=r.lo>>>n|r.hi<<o,t=r.hi>>>n|r.lo<<o),new lr(e,t)}function q(r,n,e){var t=r.hi&n.hi^~r.hi&e.hi,o=r.lo&n.lo^~r.lo&e.lo;return new lr(t,o)}function I(r,n,e){var t=r.hi&n.hi^r.hi&e.hi^n.hi&e.hi,o=r.lo&n.lo^r.lo&e.lo^n.lo&e.lo;return new lr(t,o)}function V(r){return Z(j(r,28),j(r,34),j(r,39))}function X(r){return Z(j(r,14),j(r,18),j(r,41))}function D(r){return Z(j(r,1),j(r,8),G(r,7))}function H(r){return Z(j(r,19),j(r,61),G(r,6))}function J(r,n,e){var o,a,f,u=[],c=[],w=[],y=[];for(a=0;8>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;n<arguments.length;n++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[n])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function sr(r){for(var n=0;n<r.length;n++)r[n]=0}var lr=function(r,n){this.hi=0|r,this.lo=0|n},hr=function(r){var n,e=new Float64Array(16);if(r)for(n=0;n<r.length;n++)e[n]=r[n];return e},gr=function(){throw new Error("no PRNG")},vr=new Uint8Array(16),br=new Uint8Array(32);br[0]=9;var pr=hr(),_r=hr([1]),Ar=hr([56129,1]),Ur=hr([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),Er=hr([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),dr=hr([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),xr=hr([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),mr=hr([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),Br=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),Sr=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]),Kr=_,Tr=A,Yr=[new lr(1116352408,3609767458),new lr(1899447441,602891725),new lr(3049323471,3964484399),new lr(3921009573,2173295548),new lr(961987163,4081628472),new lr(1508970993,3053834265),new lr(2453635748,2937671579),new lr(2870763221,3664609560),new lr(3624381080,2734883394),new lr(310598401,1164996542),new lr(607225278,1323610764),new lr(1426881987,3590304994),new lr(1925078388,4068182383),new lr(2162078206,991336113),new lr(2614888103,633803317),new lr(3248222580,3479774868),new lr(3835390401,2666613458),new lr(4022224774,944711139),new lr(264347078,2341262773),new lr(604807628,2007800933),new lr(770255983,1495990901),new lr(1249150122,1856431235),new lr(1555081692,3175218132),new lr(1996064986,2198950837),new lr(2554220882,3999719339),new lr(2821834349,766784016),new lr(2952996808,2566594879),new lr(3210313671,3203337956),new lr(3336571891,1034457026),new lr(3584528711,2466948901),new lr(113926993,3758326383),new lr(338241895,168717936),new lr(666307205,1188179964),new lr(773529912,1546045734),new lr(1294757372,1522805485),new lr(1396182291,2643833823),new lr(1695183700,2343527390),new lr(1986661051,1014477480),new lr(2177026350,1206759142),new lr(2456956037,344077627),new lr(2730485921,1290863460),new lr(2820302411,3158454273),new lr(3259730800,3505952657),new lr(3345764771,106217008),new lr(3516065817,3606008344),new lr(3600352804,1432725776),new lr(4094571909,1467031594),new lr(275423344,851169720),new lr(430227734,3100823752),new lr(506948616,1363258195),new lr(659060556,3750685593),new lr(883997877,3785050280),new lr(958139571,3318307427),new lr(1322822218,3812723403),new lr(1537002063,2003034995),new lr(1747873779,3602036899),new lr(1955562222,1575990012),new lr(2024104815,1125592928),new lr(2227730452,2716904306),new lr(2361852424,442776044),new lr(2428436474,593698344),new lr(2756734187,3733110249),new lr(3204031479,2999351573),new lr(3329325298,3815920427),new lr(3391569614,3928383900),new lr(3515267271,566280711),new lr(3940187606,3454069534),new lr(4118630271,4000239992),new lr(116418474,1914138554),new lr(174292421,2731055270),new lr(289380356,3203993006),new lr(460393269,320620315),new lr(685471733,587496836),new lr(852142971,1086792851),new lr(1017036298,365543100),new lr(1126000580,2618297676),new lr(1288033470,3409855158),new lr(1501505948,4234509866),new lr(1607167915,987167468),new lr(1816402316,1246189591)],Lr=new Uint8Array([106,9,230,103,243,188,201,8,187,103,174,133,132,202,167,59,60,110,243,114,254,148,248,43,165,79,245,58,95,29,54,241,81,14,82,127,173,230,130,209,155,5,104,140,43,62,108,31,31,131,217,171,251,65,189,107,91,224,205,25,19,126,33,121]),kr=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]),zr=32,Rr=24,Pr=32,Or=16,Fr=32,Nr=32,Cr=32,Mr=32,Gr=32,Zr=Rr,jr=Pr,qr=Or,Ir=64,Vr=32,Xr=64,Dr=32,Hr=64;r.lowlevel={crypto_core_hsalsa20:y,crypto_stream_xor:g,crypto_stream:h,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:l,crypto_onetimeauth:b,crypto_onetimeauth_verify:p,crypto_verify_16:f,crypto_verify_32:u,crypto_secretbox:_,crypto_secretbox_open:A,crypto_scalarmult:R,crypto_scalarmult_base:P,crypto_box_beforenm:F,crypto_box_afternm:Kr,crypto_box:N,crypto_box_open:C,crypto_box_keypair:O,crypto_hash:Q,crypto_sign:ar,crypto_sign_keypair:tr,crypto_sign_open:ur,crypto_secretbox_KEYBYTES:zr,crypto_secretbox_NONCEBYTES:Rr,crypto_secretbox_ZEROBYTES:Pr,crypto_secretbox_BOXZEROBYTES:Or,crypto_scalarmult_BYTES:Fr,crypto_scalarmult_SCALARBYTES:Nr,crypto_box_PUBLICKEYBYTES:Cr,crypto_box_SECRETKEYBYTES:Mr,crypto_box_BEFORENMBYTES:Gr,crypto_box_NONCEBYTES:Zr,crypto_box_ZEROBYTES:jr,crypto_box_BOXZEROBYTES:qr,crypto_sign_BYTES:Ir,crypto_sign_PUBLICKEYBYTES:Vr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:Dr,crypto_hash_BYTES:Hr},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 n=new Uint8Array(r);return gr(n,r),n},r.secretbox=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(Pr+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+Pr]=r[i];return _(o,t,t.length,n,e),o.subarray(Or)},r.secretbox.open=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(Or+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+Or]=r[i];return t.length<32?!1:0!==A(o,t,t.length,n,e)?!1:o.subarray(Pr)},r.secretbox.keyLength=zr,r.secretbox.nonceLength=Rr,r.secretbox.overheadLength=Or,r.scalarMult=function(r,n){if(yr(r,n),r.length!==Nr)throw new Error("bad n size");if(n.length!==Fr)throw new Error("bad p size");var e=new Uint8Array(Fr);return R(e,r,n),e},r.scalarMult.base=function(r){if(yr(r),r.length!==Nr)throw new Error("bad n size");var n=new Uint8Array(Fr);return P(n,r),n},r.scalarMult.scalarLength=Nr,r.scalarMult.groupElementLength=Fr,r.box=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox(n,e,i)},r.box.before=function(r,n){yr(r,n),wr(r,n);var e=new Uint8Array(Gr);return F(e,r,n),e},r.box.after=r.secretbox,r.box.open=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox.open(n,e,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Cr),n=new Uint8Array(Mr);return O(r,n),{publicKey:r,secretKey:n}},r.box.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Mr)throw new Error("bad secret key size");var n=new Uint8Array(Cr);return P(n,r),{publicKey:n,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Cr,r.box.secretKeyLength=Mr,r.box.sharedKeyLength=Gr,r.box.nonceLength=Zr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,n){if(yr(r,n),n.length!==Xr)throw new Error("bad secret key size");var e=new Uint8Array(Ir+r.length);return ar(e,r,r.length,n),e},r.sign.open=function(r,n){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(yr(r,n),n.length!==Vr)throw new Error("bad public key size");var e=new Uint8Array(r.length),t=ur(e,r,r.length,n);if(0>t)return null;for(var o=new Uint8Array(t),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached=function(n,e){for(var t=r.sign(n,e),o=new Uint8Array(Ir),i=0;i<o.length;i++)o[i]=t[i];return o},r.sign.detached.verify=function(r,n,e){if(yr(r,n,e),n.length!==Ir)throw new Error("bad signature size");if(e.length!==Vr)throw new Error("bad public key size");var t,o=new Uint8Array(Ir+r.length),i=new Uint8Array(Ir+r.length);for(t=0;Ir>t;t++)o[t]=n[t];for(t=0;t<r.length;t++)o[t+Ir]=r[t];return ur(i,o,o.length,e)>=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;e<n.length;e++)n[e]=r[32+e];return{publicKey:n,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(yr(r),r.length!==Dr)throw new Error("bad seed size");for(var n=new Uint8Array(Vr),e=new Uint8Array(Xr),t=0;32>t;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
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 7cca76eb58..0903b54ccf 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
@@ -6,16 +6,20 @@
]
],
"_from": "tweetnacl@>=0.13.0 <1.0.0",
- "_id": "tweetnacl@0.13.3",
+ "_id": "tweetnacl@0.14.3",
"_inCache": true,
"_installable": true,
"_location": "/request/http-signature/sshpk/tweetnacl",
- "_nodeVersion": "4.2.3",
+ "_nodeVersion": "5.6.0",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/tweetnacl-0.14.3.tgz_1459224951636_0.7403244483284652"
+ },
"_npmUser": {
"email": "dmitry@codingrobots.com",
"name": "dchest"
},
- "_npmVersion": "2.14.7",
+ "_npmVersion": "3.7.3",
"_phantomChildren": {},
"_requested": {
"name": "tweetnacl",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/http-signature/sshpk"
],
- "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz",
- "_shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56",
+ "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz",
+ "_shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d",
"_shrinkwrap": null,
"_spec": "tweetnacl@>=0.13.0 <1.0.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk",
@@ -46,23 +50,24 @@
"dependencies": {},
"description": "Port of TweetNaCl cryptographic library to JavaScript",
"devDependencies": {
- "browserify": "^10.1.3",
- "eslint": "^1.4.3",
- "faucet": "0.0.1",
+ "browserify": "^13.0.0",
+ "eslint": "^2.2.0",
+ "faucet": "^0.0.1",
"tap-browser-color": "^0.1.2",
- "tape": "^4.0.0",
- "testling": "^1.7.1",
- "uglify-js": "^2.4.21"
+ "tape": "^4.4.0",
+ "tape-run": "^2.1.3",
+ "tweetnacl-util": "^0.13.3",
+ "uglify-js": "^2.6.1"
},
"directories": {
"test": "test"
},
"dist": {
- "shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56",
- "tarball": "http://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz"
+ "shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d",
+ "tarball": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz"
},
- "gitHead": "2bb422cb707fba4a5ec9654688564a4fb861b068",
- "homepage": "https://dchest.github.io/tweetnacl-js",
+ "gitHead": "3eb4fc544a2a1d6c0a41b98b9906288ca8b087e4",
+ "homepage": "https://tweetnacl.js.org",
"keywords": [
"crypto",
"cryptography",
@@ -77,12 +82,12 @@
"salsa20",
"signatures"
],
- "license": "Public domain",
+ "license": "SEE LICENSE IN COPYING.txt",
"main": "nacl-fast.js",
"maintainers": [
{
- "name": "dchest",
- "email": "dmitry@codingrobots.com"
+ "email": "dmitry@codingrobots.com",
+ "name": "dchest"
}
],
"name": "tweetnacl",
@@ -94,27 +99,13 @@
},
"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",
- "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",
+ "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",
"lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js",
- "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": {
- "browsers": [
- "android-browser/latest",
- "chrome/22..latest",
- "firefox/16..latest",
- "ipad/6..latest",
- "iphone/6..latest",
- "opera/11.0..latest",
- "safari/latest"
- ],
- "files": "test/*.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"
},
- "version": "0.13.3"
+ "version": "0.14.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 6fce0e3201..fc995b42cd 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
@@ -6,16 +6,20 @@
]
],
"_from": "sshpk@>=1.7.0 <2.0.0",
- "_id": "sshpk@1.7.3",
+ "_id": "sshpk@1.7.4",
"_inCache": true,
"_installable": true,
"_location": "/request/http-signature/sshpk",
"_nodeVersion": "0.12.9",
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/sshpk-1.7.4.tgz_1455236064846_0.4782760036177933"
+ },
"_npmUser": {
"email": "alex@cooperi.net",
"name": "arekinath"
},
- "_npmVersion": "2.14.9",
+ "_npmVersion": "2.14.4",
"_phantomChildren": {},
"_requested": {
"name": "sshpk",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/http-signature"
],
- "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz",
- "_shasum": "caa8ef95e30765d856698b7025f9f211ab65962f",
+ "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz",
+ "_shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38",
"_shrinkwrap": null,
"_spec": "sshpk@^1.7.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature",
@@ -46,16 +50,16 @@
},
"contributors": [
{
- "name": "Dave Eddy",
- "email": "dave@daveeddy.com"
+ "email": "dave@daveeddy.com",
+ "name": "Dave Eddy"
},
{
- "name": "Mark Cavage",
- "email": "mcavage@gmail.com"
+ "email": "mcavage@gmail.com",
+ "name": "Mark Cavage"
},
{
- "name": "Alex Wilson",
- "email": "alex@cooperi.net"
+ "email": "alex@cooperi.net",
+ "name": "Alex Wilson"
}
],
"dependencies": {
@@ -80,20 +84,20 @@
"man": "./man/man1"
},
"dist": {
- "shasum": "caa8ef95e30765d856698b7025f9f211ab65962f",
- "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz"
+ "shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38",
+ "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz"
},
"engines": {
"node": ">=0.8.0"
},
- "gitHead": "3d98bfc22bb1c09f0747244acbb408f3ca9448b5",
+ "gitHead": "9b86d45d512c97f6ea10b98a2970828dfb290310",
"homepage": "https://github.com/arekinath/node-sshpk#readme",
"license": "MIT",
"main": "lib/index.js",
"maintainers": [
{
- "name": "arekinath",
- "email": "alex@cooperi.net"
+ "email": "alex@cooperi.net",
+ "name": "arekinath"
}
],
"man": [
@@ -116,5 +120,5 @@
"scripts": {
"test": "tape test/*.js"
},
- "version": "1.7.3"
+ "version": "1.7.4"
}
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 61b54b4201..1d86a5cb15 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,11 @@
+2.1.10 / 2016-02-15
+===================
+
+ * deps: mime-db@~1.22.0
+ - Add new mime types
+ - Fix extension of `application/dash+xml`
+ - Update primary extension for `audio/mp4`
+
2.1.9 / 2016-01-06
==================
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/README.md b/deps/npm/node_modules/request/node_modules/mime-types/README.md
index e26295d047..e77d615d3e 100644
--- a/deps/npm/node_modules/request/node_modules/mime-types/README.md
+++ b/deps/npm/node_modules/request/node_modules/mime-types/README.md
@@ -94,7 +94,7 @@ A map of extensions by content-type.
[npm-image]: https://img.shields.io/npm/v/mime-types.svg
[npm-url]: https://npmjs.org/package/mime-types
[node-version-image]: https://img.shields.io/node/v/mime-types.svg
-[node-version-url]: http://nodejs.org/download/
+[node-version-url]: https://nodejs.org/en/download/
[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
[travis-url]: https://travis-ci.org/jshttp/mime-types
[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
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 41a667af5c..44f9f6465e 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,17 @@
+1.22.0 / 2016-02-15
+===================
+
+ * Add `application/ppsp-tracker+json`
+ * Add `application/problem+json`
+ * Add `application/problem+xml`
+ * Add `application/vnd.hdt`
+ * Add `application/vnd.ms-printschematicket+xml`
+ * Add `model/vnd.rosette.annotated-data-model`
+ * Add `text/slim`
+ * Add extension `.rng` to `application/xml`
+ * Fix extension of `application/dash+xml` to be `.mpd`
+ * Update primary extension to `.m4a` for `audio/mp4`
+
1.21.0 / 2016-01-06
===================
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 412ba9ed65..863deb4f0a 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
@@ -217,7 +217,7 @@
},
"application/dash+xml": {
"source": "iana",
- "extensions": ["mdp"]
+ "extensions": ["mpd"]
},
"application/dashdelta": {
"source": "iana"
@@ -837,6 +837,17 @@
"compressible": true,
"extensions": ["ai","eps","ps"]
},
+ "application/ppsp-tracker+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/problem+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/problem+xml": {
+ "source": "iana"
+ },
"application/provenance+xml": {
"source": "iana"
},
@@ -2093,6 +2104,9 @@
"application/vnd.hcl-bireports": {
"source": "iana"
},
+ "application/vnd.hdt": {
+ "source": "iana"
+ },
"application/vnd.heroku+json": {
"source": "iana",
"compressible": true
@@ -2687,6 +2701,9 @@
"application/vnd.ms-printing.printticket+xml": {
"source": "apache"
},
+ "application/vnd.ms-printschematicket+xml": {
+ "source": "iana"
+ },
"application/vnd.ms-project": {
"source": "iana",
"extensions": ["mpp","mpt"]
@@ -4749,7 +4766,7 @@
"application/xml": {
"source": "iana",
"compressible": true,
- "extensions": ["xml","xsl","xsd"]
+ "extensions": ["xml","xsl","xsd","rng"]
},
"application/xml-dtd": {
"source": "iana",
@@ -5023,7 +5040,7 @@
"audio/mp4": {
"source": "iana",
"compressible": false,
- "extensions": ["mp4a","m4a"]
+ "extensions": ["m4a","mp4a"]
},
"audio/mp4a-latm": {
"source": "iana"
@@ -5774,6 +5791,9 @@
"model/vnd.parasolid.transmit.text": {
"source": "iana"
},
+ "model/vnd.rosette.annotated-data-model": {
+ "source": "iana"
+ },
"model/vnd.valve.source.compiled-map": {
"source": "iana"
},
@@ -6003,6 +6023,9 @@
"source": "iana",
"extensions": ["sgml","sgm"]
},
+ "text/slim": {
+ "extensions": ["slim","slm"]
+ },
"text/stylus": {
"extensions": ["stylus","styl"]
},
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 bb48d8cf5f..1abcdca6c7 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,73 +1,78 @@
{
"_args": [
[
- "mime-db@~1.21.0",
+ "mime-db@~1.22.0",
"/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types"
]
],
- "_from": "mime-db@>=1.21.0 <1.22.0",
- "_id": "mime-db@1.21.0",
+ "_from": "mime-db@>=1.22.0 <1.23.0",
+ "_id": "mime-db@1.22.0",
"_inCache": true,
"_installable": true,
"_location": "/request/mime-types/mime-db",
+ "_nodeVersion": "4.2.3",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/mime-db-1.22.0.tgz_1455558813990_0.7830642955377698"
+ },
"_npmUser": {
"email": "doug@somethingdoug.com",
"name": "dougwilson"
},
- "_npmVersion": "1.4.28",
+ "_npmVersion": "2.14.7",
"_phantomChildren": {},
"_requested": {
"name": "mime-db",
- "raw": "mime-db@~1.21.0",
- "rawSpec": "~1.21.0",
+ "raw": "mime-db@~1.22.0",
+ "rawSpec": "~1.22.0",
"scope": null,
- "spec": ">=1.21.0 <1.22.0",
+ "spec": ">=1.22.0 <1.23.0",
"type": "range"
},
"_requiredBy": [
"/request/mime-types"
],
- "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz",
- "_shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac",
+ "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz",
+ "_shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a",
"_shrinkwrap": null,
- "_spec": "mime-db@~1.21.0",
+ "_spec": "mime-db@~1.22.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types",
"bugs": {
"url": "https://github.com/jshttp/mime-db/issues"
},
"contributors": [
{
- "name": "Douglas Christopher Wilson",
- "email": "doug@somethingdoug.com"
+ "email": "doug@somethingdoug.com",
+ "name": "Douglas Christopher Wilson"
},
{
- "name": "Jonathan Ong",
"email": "me@jongleberry.com",
+ "name": "Jonathan Ong",
"url": "http://jongleberry.com"
},
{
- "name": "Robert Kieffer",
"email": "robert@broofa.com",
+ "name": "Robert Kieffer",
"url": "http://github.com/broofa"
}
],
"dependencies": {},
"description": "Media Type Database",
"devDependencies": {
- "bluebird": "3.1.1",
+ "bluebird": "3.3.1",
"co": "4.6.0",
"cogent": "1.0.1",
"csv-parse": "1.0.1",
- "gnode": "0.1.1",
- "istanbul": "0.4.1",
+ "gnode": "0.1.2",
+ "istanbul": "0.4.2",
"mocha": "1.21.5",
"raw-body": "2.1.5",
- "stream-to-array": "2.2.0"
+ "stream-to-array": "2.2.1"
},
"directories": {},
"dist": {
- "shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac",
- "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz"
+ "shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a",
+ "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz"
},
"engines": {
"node": ">= 0.6"
@@ -79,26 +84,26 @@
"db.json",
"index.js"
],
- "gitHead": "9ab92f0a912a602408a64db5741dfef6f82c597f",
- "homepage": "https://github.com/jshttp/mime-db",
+ "gitHead": "ed88d32405582a5aaff6225d1210005d6be2623e",
+ "homepage": "https://github.com/jshttp/mime-db#readme",
"keywords": [
- "charset",
- "charsets",
- "database",
- "db",
"mime",
+ "db",
"type",
- "types"
+ "types",
+ "database",
+ "charset",
+ "charsets"
],
"license": "MIT",
"maintainers": [
{
- "name": "jongleberry",
- "email": "jonathanrichardong@gmail.com"
+ "email": "doug@somethingdoug.com",
+ "name": "dougwilson"
},
{
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
+ "email": "jonathanrichardong@gmail.com",
+ "name": "jongleberry"
}
],
"name": "mime-db",
@@ -116,5 +121,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.21.0"
+ "version": "1.22.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 aba63f70e3..8e7b5f62ba 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
@@ -6,15 +6,20 @@
]
],
"_from": "mime-types@>=2.1.7 <2.2.0",
- "_id": "mime-types@2.1.9",
+ "_id": "mime-types@2.1.10",
"_inCache": true,
"_installable": true,
"_location": "/request/mime-types",
+ "_nodeVersion": "4.2.3",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/mime-types-2.1.10.tgz_1455575237256_0.9163766100537032"
+ },
"_npmUser": {
"email": "doug@somethingdoug.com",
"name": "dougwilson"
},
- "_npmVersion": "1.4.28",
+ "_npmVersion": "2.14.7",
"_phantomChildren": {},
"_requested": {
"name": "mime-types",
@@ -28,8 +33,8 @@
"/request",
"/request/form-data"
],
- "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz",
- "_shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8",
+ "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz",
+ "_shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837",
"_shrinkwrap": null,
"_spec": "mime-types@~2.1.7",
"_where": "/Users/rebecca/code/npm/node_modules/request",
@@ -38,32 +43,32 @@
},
"contributors": [
{
- "name": "Douglas Christopher Wilson",
- "email": "doug@somethingdoug.com"
+ "email": "doug@somethingdoug.com",
+ "name": "Douglas Christopher Wilson"
},
{
- "name": "Jeremiah Senkpiel",
"email": "fishrock123@rocketmail.com",
+ "name": "Jeremiah Senkpiel",
"url": "https://searchbeam.jit.su"
},
{
- "name": "Jonathan Ong",
"email": "me@jongleberry.com",
+ "name": "Jonathan Ong",
"url": "http://jongleberry.com"
}
],
"dependencies": {
- "mime-db": "~1.21.0"
+ "mime-db": "~1.22.0"
},
"description": "The ultimate javascript content-type utility.",
"devDependencies": {
- "istanbul": "0.4.1",
- "mocha": "~1.21.5"
+ "istanbul": "0.4.2",
+ "mocha": "1.21.5"
},
"directories": {},
"dist": {
- "shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8",
- "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz"
+ "shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837",
+ "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz"
},
"engines": {
"node": ">= 0.6"
@@ -73,8 +78,8 @@
"LICENSE",
"index.js"
],
- "gitHead": "329f1c77e1a77c8fac59b15038e3808e9e314d96",
- "homepage": "https://github.com/jshttp/mime-types",
+ "gitHead": "70785d38e9cc251137b00f73ab3d3257c4aea203",
+ "homepage": "https://github.com/jshttp/mime-types#readme",
"keywords": [
"mime",
"types"
@@ -82,16 +87,16 @@
"license": "MIT",
"maintainers": [
{
- "name": "jongleberry",
- "email": "jonathanrichardong@gmail.com"
+ "email": "doug@somethingdoug.com",
+ "name": "dougwilson"
},
{
- "name": "fishrock123",
- "email": "fishrock123@rocketmail.com"
+ "email": "fishrock123@rocketmail.com",
+ "name": "fishrock123"
},
{
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
+ "email": "jonathanrichardong@gmail.com",
+ "name": "jongleberry"
}
],
"name": "mime-types",
@@ -106,5 +111,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.9"
+ "version": "2.1.10"
}
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 5a70f3f8cd..4c20674c79 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
@@ -132,3 +132,4 @@ exports.rsasign = rsasign
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 eeaaa68d35..788eebb0c2 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,59 +1,83 @@
{
+ "_args": [
+ [
+ "oauth-sign@~0.8.0",
+ "/Users/rebecca/code/npm/node_modules/request"
+ ]
+ ],
+ "_from": "oauth-sign@>=0.8.0 <0.9.0",
+ "_id": "oauth-sign@0.8.1",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/oauth-sign",
+ "_nodeVersion": "5.5.0",
+ "_npmUser": {
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
+ },
+ "_npmVersion": "3.6.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "oauth-sign",
+ "raw": "oauth-sign@~0.8.0",
+ "rawSpec": "~0.8.0",
+ "scope": null,
+ "spec": ">=0.8.0 <0.9.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request"
+ ],
+ "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz",
+ "_shasum": "182439bdb91378bf7460e75c64ea43e6448def06",
+ "_shrinkwrap": null,
+ "_spec": "oauth-sign@~0.8.0",
+ "_where": "/Users/rebecca/code/npm/node_modules/request",
"author": {
- "name": "Mikeal Rogers",
"email": "mikeal.rogers@gmail.com",
+ "name": "Mikeal Rogers",
"url": "http://www.futurealoof.com"
},
- "name": "oauth-sign",
- "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
- "version": "0.8.0",
- "license": "Apache-2.0",
- "repository": {
- "url": "git+https://github.com/mikeal/oauth-sign.git"
+ "bugs": {
+ "url": "https://github.com/mikeal/oauth-sign/issues"
},
- "main": "index.js",
"dependencies": {},
+ "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
"devDependencies": {},
- "optionalDependencies": {},
+ "directories": {},
+ "dist": {
+ "shasum": "182439bdb91378bf7460e75c64ea43e6448def06",
+ "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz"
+ },
"engines": {
"node": "*"
},
- "scripts": {
- "test": "node test.js"
- },
- "gitHead": "e1f2b42ff039901ce977f8e81918767d97d496b5",
- "bugs": {
- "url": "https://github.com/mikeal/oauth-sign/issues"
- },
+ "gitHead": "9c7229a336c9face98b83f93b72cb7c80dbba08d",
"homepage": "https://github.com/mikeal/oauth-sign#readme",
- "_id": "oauth-sign@0.8.0",
- "_shasum": "938fdc875765ba527137d8aec9d178e24debc553",
- "_from": "oauth-sign@>=0.8.0 <0.9.0",
- "_npmVersion": "2.10.1",
- "_nodeVersion": "0.12.4",
- "_npmUser": {
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
- },
+ "license": "Apache-2.0",
+ "main": "index.js",
"maintainers": [
{
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
+ "email": "mikeal.rogers@gmail.com",
+ "name": "mikeal"
},
{
- "name": "nylen",
- "email": "jnylen@gmail.com"
+ "email": "jnylen@gmail.com",
+ "name": "nylen"
},
{
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
}
],
- "dist": {
- "shasum": "938fdc875765ba527137d8aec9d178e24debc553",
- "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz"
+ "name": "oauth-sign",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "url": "git+https://github.com/mikeal/oauth-sign.git"
},
- "directories": {},
- "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz",
- "readme": "ERROR: No README data found!"
+ "scripts": {
+ "test": "node test.js"
+ },
+ "version": "0.8.1"
}
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 2df5e9d378..5c66ea4446 100644
--- a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md
+++ b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md
@@ -1,3 +1,8 @@
+## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=34&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)
+
## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
- Revert ES6 requirement and restore support for node down to v0.8.
diff --git a/deps/npm/node_modules/request/node_modules/qs/bower.json b/deps/npm/node_modules/request/node_modules/qs/bower.json
index 8b21420a64..44f050642d 100644
--- a/deps/npm/node_modules/request/node_modules/qs/bower.json
+++ b/deps/npm/node_modules/request/node_modules/qs/bower.json
@@ -1,7 +1,6 @@
{
"name": "qs",
"main": "dist/qs.js",
- "version": "5.2.0",
"homepage": "https://github.com/hapijs/qs",
"authors": [
"Nathan LaFreniere <quitlahok@gmail.com>"
diff --git a/deps/npm/node_modules/request/node_modules/qs/component.json b/deps/npm/node_modules/request/node_modules/qs/component.json
index fca856a631..cb8d93fb1f 100644
--- a/deps/npm/node_modules/request/node_modules/qs/component.json
+++ b/deps/npm/node_modules/request/node_modules/qs/component.json
@@ -2,7 +2,7 @@
"name": "qs",
"repository": "hapijs/qs",
"description": "query-string parser / stringifier with nesting support",
- "version": "5.2.0",
+ "version": "6.1.0",
"keywords": ["querystring", "query", "parser"],
"main": "lib/index.js",
"scripts": [
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 68433d45a8..bb8ea31a95 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
@@ -198,7 +198,7 @@ var internals = {
encode: true
};
-internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) {
var obj = object;
if (typeof filter === 'function') {
obj = filter(prefix, obj);
@@ -243,9 +243,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));
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
} else {
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
}
@@ -260,6 +260,7 @@ module.exports = function (object, opts) {
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
var sort = typeof options.sort === 'function' ? options.sort : null;
+ var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
var objKeys;
var filter;
if (typeof options.filter === 'function') {
@@ -301,7 +302,7 @@ module.exports = function (object, opts) {
continue;
}
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
return keys.join(delimiter);
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 e7b669d3d5..892dad45a9 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
@@ -20,7 +20,7 @@ var internals = {
encode: true
};
-internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) {
var obj = object;
if (typeof filter === 'function') {
obj = filter(prefix, obj);
@@ -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));
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
} else {
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
}
@@ -82,6 +82,7 @@ module.exports = function (object, opts) {
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
var sort = typeof options.sort === 'function' ? options.sort : null;
+ var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
var objKeys;
var filter;
if (typeof options.filter === 'function') {
@@ -123,7 +124,7 @@ module.exports = function (object, opts) {
continue;
}
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
return keys.join(delimiter);
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 ed0815b5b7..33318a7253 100644
--- a/deps/npm/node_modules/request/node_modules/qs/package.json
+++ b/deps/npm/node_modules/request/node_modules/qs/package.json
@@ -1,16 +1,20 @@
{
"_args": [
[
- "qs@~6.0.2",
+ "qs@~6.1.0",
"/Users/rebecca/code/npm/node_modules/request"
]
],
- "_from": "qs@>=6.0.2 <6.1.0",
- "_id": "qs@6.0.2",
+ "_from": "qs@>=6.1.0 <6.2.0",
+ "_id": "qs@6.1.0",
"_inCache": true,
"_installable": true,
"_location": "/request/qs",
- "_nodeVersion": "5.4.1",
+ "_nodeVersion": "5.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-5-east.internal.npmjs.com",
+ "tmp": "tmp/qs-6.1.0.tgz_1454565583082_0.44599376199766994"
+ },
"_npmUser": {
"email": "ljharb@gmail.com",
"name": "ljharb"
@@ -19,27 +23,27 @@
"_phantomChildren": {},
"_requested": {
"name": "qs",
- "raw": "qs@~6.0.2",
- "rawSpec": "~6.0.2",
+ "raw": "qs@~6.1.0",
+ "rawSpec": "~6.1.0",
"scope": null,
- "spec": ">=6.0.2 <6.1.0",
+ "spec": ">=6.1.0 <6.2.0",
"type": "range"
},
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/qs/-/qs-6.0.2.tgz",
- "_shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
+ "_resolved": "https://registry.npmjs.org/qs/-/qs-6.1.0.tgz",
+ "_shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26",
"_shrinkwrap": null,
- "_spec": "qs@~6.0.2",
+ "_spec": "qs@~6.1.0",
"_where": "/Users/rebecca/code/npm/node_modules/request",
"bugs": {
"url": "https://github.com/ljharb/qs/issues"
},
"contributors": [
{
- "name": "Jordan Harband",
"email": "ljharb@gmail.com",
+ "name": "Jordan Harband",
"url": "http://ljharb.codes"
}
],
@@ -57,32 +61,32 @@
},
"directories": {},
"dist": {
- "shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
- "tarball": "http://registry.npmjs.org/qs/-/qs-6.0.2.tgz"
+ "shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26",
+ "tarball": "http://registry.npmjs.org/qs/-/qs-6.1.0.tgz"
},
"engines": {
"node": ">=0.6"
},
- "gitHead": "47dfbd6740b3cc1593847825701c8aa136f636e3",
+ "gitHead": "5bd79545edb33d6a43398fec7df9ecef2da005ea",
"homepage": "https://github.com/ljharb/qs",
"keywords": [
- "qs",
- "querystring"
+ "querystring",
+ "qs"
],
"license": "BSD-3-Clause",
"main": "lib/index.js",
"maintainers": [
{
- "name": "hueniverse",
- "email": "eran@hammer.io"
+ "email": "eran@hammer.io",
+ "name": "hueniverse"
},
{
- "name": "ljharb",
- "email": "ljharb@gmail.com"
+ "email": "ljharb@gmail.com",
+ "name": "ljharb"
},
{
- "name": "nlf",
- "email": "quitlahok@gmail.com"
+ "email": "quitlahok@gmail.com",
+ "name": "nlf"
}
],
"name": "qs",
@@ -101,5 +105,5 @@
"test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'",
"tests-only": "node test"
},
- "version": "6.0.2"
+ "version": "6.1.0"
}
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 88d22f25e9..508c2460b6 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
@@ -22,6 +22,12 @@ test('stringify()', function (t) {
st.end();
});
+ t.test('stringifies a nested object with dots notation', function (st) {
+ st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');
+ st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');
+ st.end();
+ });
+
t.test('stringifies an array value', function (st) {
st.equal(qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
st.end();
@@ -48,12 +54,23 @@ test('stringify()', function (t) {
st.end();
});
+ t.test('stringifies a nested array value with dots notation', function (st) {
+ st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encode: false }), 'a.b[0]=c&a.b[1]=d');
+ st.end();
+ });
+
t.test('stringifies an object inside an array', function (st) {
st.equal(qs.stringify({ a: [{ b: 'c' }] }), 'a%5B0%5D%5Bb%5D=c');
st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }), 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
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');
+ st.end();
+ });
+
t.test('does not omit object keys when indices = false', function (st) {
st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
st.end();
@@ -232,4 +249,11 @@ test('stringify()', function (t) {
st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
st.end();
});
+
+ t.test('can sort the keys at depth 3 or more too', function (st) {
+ var sort = function (a, b) { return a.localeCompare(b); };
+ st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: sort, encode: false }), 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb');
+ 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();
+ });
});
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 0afe4a2a96..12da297ac4 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
@@ -58,11 +58,11 @@ var CONTROL_CHARS = /[\x00-\x1F]/;
// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60)
// '=' and ';' are attribute/values separators
// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64)
-var COOKIE_PAIR = /^(([^=;]+))\s*=\s*(("?)[^\n\r\0]*\3)/
+var COOKIE_PAIR = /^(([^=;]+))\s*=\s*([^\n\r\0]*)/;
// Used to parse non-RFC-compliant cookies like '=abc' when given the `loose`
// option in Cookie.parse:
-var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?(("?)[^\n\r\0]*\3)/;
+var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?([^\n\r\0]*)/;
// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
// Note ';' is \x3B
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 24c18e2ecb..565dbe1914 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
@@ -2,20 +2,24 @@
"_args": [
[
"tough-cookie@~2.2.0",
- "/Users/ogd/Documents/projects/npm/npm/node_modules/request"
+ "/Users/rebecca/code/npm/node_modules/request"
]
],
"_from": "tough-cookie@>=2.2.0 <2.3.0",
- "_id": "tough-cookie@2.2.1",
+ "_id": "tough-cookie@2.2.2",
"_inCache": true,
"_installable": true,
"_location": "/request/tough-cookie",
- "_nodeVersion": "0.12.5",
+ "_nodeVersion": "5.1.1",
+ "_npmOperationalInternal": {
+ "host": "packages-13-west.internal.npmjs.com",
+ "tmp": "tmp/tough-cookie-2.2.2.tgz_1457564639182_0.5129188685677946"
+ },
"_npmUser": {
"email": "jstash@gmail.com",
"name": "jstash"
},
- "_npmVersion": "2.11.2",
+ "_npmVersion": "3.3.12",
"_phantomChildren": {},
"_requested": {
"name": "tough-cookie",
@@ -28,11 +32,11 @@
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz",
- "_shasum": "3b0516b799e70e8164436a1446e7e5877fda118e",
+ "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz",
+ "_shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7",
"_shrinkwrap": null,
"_spec": "tough-cookie@~2.2.0",
- "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request",
+ "_where": "/Users/rebecca/code/npm/node_modules/request",
"author": {
"email": "jstashewsky@salesforce.com",
"name": "Jeremy Stashewsky"
@@ -68,8 +72,8 @@
},
"directories": {},
"dist": {
- "shasum": "3b0516b799e70e8164436a1446e7e5877fda118e",
- "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz"
+ "shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7",
+ "tarball": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -77,28 +81,28 @@
"files": [
"lib"
],
- "gitHead": "f1055655ea56c85bd384aaf7d5b740b916700b6f",
+ "gitHead": "cc46628c4d7d2e8c372ecba29293ca8a207ec192",
"homepage": "https://github.com/SalesforceEng/tough-cookie",
"keywords": [
"HTTP",
- "RFC2965",
- "RFC6265",
"cookie",
- "cookiejar",
"cookies",
+ "set-cookie",
+ "cookiejar",
"jar",
- "set-cookie"
+ "RFC6265",
+ "RFC2965"
],
"license": "BSD-3-Clause",
"main": "./lib/cookie",
"maintainers": [
{
- "name": "jstash",
- "email": "jeremy@goinstant.com"
+ "email": "jeremy@goinstant.com",
+ "name": "jstash"
},
{
- "name": "goinstant",
- "email": "services@goinstant.com"
+ "email": "services@goinstant.com",
+ "name": "goinstant"
}
],
"name": "tough-cookie",
@@ -112,5 +116,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.1"
+ "version": "2.2.2"
}
diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json
index f3f8cf4907..6c9fa0ec83 100644
--- a/deps/npm/node_modules/request/package.json
+++ b/deps/npm/node_modules/request/package.json
@@ -6,20 +6,24 @@
]
],
"_from": "request@latest",
- "_id": "request@2.69.0",
+ "_id": "request@2.72.0",
"_inCache": true,
"_installable": true,
"_location": "/request",
- "_nodeVersion": "4.1.2",
+ "_nodeVersion": "5.9.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/request-2.72.0.tgz_1460901215210_0.9173020373564214"
+ },
"_npmUser": {
- "email": "mikeal.rogers@gmail.com",
- "name": "mikeal"
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
},
- "_npmVersion": "2.14.4",
+ "_npmVersion": "3.8.5",
"_phantomChildren": {
"ansi-regex": "2.0.0",
- "readable-stream": "2.0.5",
- "strip-ansi": "3.0.0"
+ "inherits": "2.0.1",
+ "strip-ansi": "3.0.1"
},
"_requested": {
"name": "request",
@@ -34,8 +38,8 @@
"/node-gyp",
"/npm-registry-client"
],
- "_resolved": "https://registry.npmjs.org/request/-/request-2.69.0.tgz",
- "_shasum": "cf91d2e000752b1217155c005241911991a2346a",
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.72.0.tgz",
+ "_shasum": "0ce3a179512620b10441f14c82e21c12c0ddb4e1",
"_shrinkwrap": null,
"_spec": "request@latest",
"_where": "/Users/rebecca/code/npm",
@@ -49,43 +53,44 @@
"dependencies": {
"aws-sign2": "~0.6.0",
"aws4": "^1.2.1",
- "bl": "~1.0.0",
+ "bl": "~1.1.2",
"caseless": "~0.11.0",
"combined-stream": "~1.0.5",
"extend": "~3.0.0",
"forever-agent": "~0.6.1",
"form-data": "~1.0.0-rc3",
"har-validator": "~2.0.6",
- "hawk": "~3.1.0",
+ "hawk": "~3.1.3",
"http-signature": "~1.1.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.7",
"node-uuid": "~1.4.7",
- "oauth-sign": "~0.8.0",
- "qs": "~6.0.2",
+ "oauth-sign": "~0.8.1",
+ "qs": "~6.1.0",
"stringstream": "~0.0.4",
"tough-cookie": "~2.2.0",
"tunnel-agent": "~0.4.1"
},
"description": "Simplified HTTP request client.",
"devDependencies": {
- "bluebird": "^3.0.2",
- "browserify": "^13.0.0",
- "browserify-istanbul": "^0.1.5",
+ "bluebird": "^3.2.1",
+ "browserify": "^12.0.2",
+ "browserify-istanbul": "^2.0.0",
"buffer-equal": "^1.0.0",
"codecov.io": "^0.1.6",
"coveralls": "^2.11.4",
- "eslint": "1.10.3",
+ "eslint": "^2.5.3",
"function-bind": "^1.0.2",
"istanbul": "^0.4.0",
"karma": "^0.13.10",
- "karma-browserify": "^4.4.0",
+ "karma-browserify": "^5.0.1",
"karma-cli": "^0.1.1",
"karma-coverage": "^0.5.3",
- "karma-phantomjs-launcher": "^0.1.4",
+ "karma-phantomjs-launcher": "^1.0.0",
"karma-tap": "^1.0.3",
+ "phantomjs-prebuilt": "^2.1.3",
"rimraf": "^2.2.8",
"server-destroy": "^1.0.1",
"tape": "^4.2.0",
@@ -93,32 +98,32 @@
},
"directories": {},
"dist": {
- "shasum": "cf91d2e000752b1217155c005241911991a2346a",
- "tarball": "http://registry.npmjs.org/request/-/request-2.69.0.tgz"
+ "shasum": "0ce3a179512620b10441f14c82e21c12c0ddb4e1",
+ "tarball": "https://registry.npmjs.org/request/-/request-2.72.0.tgz"
},
"engines": {
"node": ">=0.8.0"
},
- "gitHead": "1c2fb40c74efb4f706f350a78dbd5e58fe913af3",
+ "gitHead": "6dcac13642955577592fdafb5ff3cdc8a6ff1b1b",
"homepage": "https://github.com/request/request#readme",
"license": "Apache-2.0",
"main": "index.js",
"maintainers": [
{
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
+ "email": "mikeal.rogers@gmail.com",
+ "name": "mikeal"
},
{
- "name": "nylen",
- "email": "jnylen@gmail.com"
+ "email": "jnylen@gmail.com",
+ "name": "nylen"
},
{
- "name": "fredkschott",
- "email": "fkschott@gmail.com"
+ "email": "fkschott@gmail.com",
+ "name": "fredkschott"
},
{
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
}
],
"name": "request",
@@ -141,5 +146,5 @@
"util",
"utility"
],
- "version": "2.69.0"
+ "version": "2.72.0"
}
diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js
index 441db80f5a..ac2cd8098f 100644
--- a/deps/npm/node_modules/request/request.js
+++ b/deps/npm/node_modules/request/request.js
@@ -16,6 +16,7 @@ var http = require('http')
, ForeverAgent = require('forever-agent')
, FormData = require('form-data')
, extend = require('extend')
+ , isstream = require('isstream')
, isTypedArray = require('is-typedarray').strict
, helpers = require('./lib/helpers')
, cookies = require('./lib/cookies')
@@ -398,7 +399,7 @@ Request.prototype.init = function (options) {
}
if (self.gzip && !self.hasHeader('accept-encoding')) {
- self.setHeader('accept-encoding', 'gzip')
+ self.setHeader('accept-encoding', 'gzip, deflate')
}
if (self.uri.auth && !self.hasHeader('authorization')) {
@@ -452,7 +453,7 @@ Request.prototype.init = function (options) {
}
}
}
- if (self.body) {
+ if (self.body && !isstream(self.body)) {
setContentLength()
}
@@ -552,15 +553,19 @@ Request.prototype.init = function (options) {
self._multipart.body.pipe(self)
}
if (self.body) {
- setContentLength()
- if (Array.isArray(self.body)) {
- self.body.forEach(function (part) {
- self.write(part)
- })
+ if (isstream(self.body)) {
+ self.body.pipe(self)
} else {
- self.write(self.body)
+ setContentLength()
+ if (Array.isArray(self.body)) {
+ self.body.forEach(function (part) {
+ self.write(part)
+ })
+ } else {
+ self.write(self.body)
+ }
+ self.end()
}
- self.end()
} else if (self.requestBodyStream) {
console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
self.requestBodyStream.pipe(self)
@@ -744,7 +749,12 @@ Request.prototype.start = function () {
debug('make request', self.uri.href)
- self.req = self.httpModule.request(reqOptions)
+ try {
+ self.req = self.httpModule.request(reqOptions)
+ } catch (err) {
+ self.emit('error', err)
+ return
+ }
if (self.timing) {
self.startTime = new Date().getTime()
@@ -910,14 +920,29 @@ Request.prototype.onRequestResponse = function (response) {
self._ended = true
})
+ var noBody = function (code) {
+ return (
+ self.method === 'HEAD'
+ // Informational
+ || (code >= 100 && code < 200)
+ // No Content
+ || code === 204
+ // Not Modified
+ || code === 304
+ )
+ }
+
var responseContent
- if (self.gzip) {
+ if (self.gzip && !noBody(response.statusCode)) {
var contentEncoding = response.headers['content-encoding'] || 'identity'
contentEncoding = contentEncoding.trim().toLowerCase()
if (contentEncoding === 'gzip') {
responseContent = zlib.createGunzip()
response.pipe(responseContent)
+ } else if (contentEncoding === 'deflate') {
+ responseContent = zlib.createInflate()
+ response.pipe(responseContent)
} else {
// Since previous versions didn't check for Content-Encoding header,
// ignore any invalid values to preserve backwards-compatibility
@@ -1001,6 +1026,9 @@ Request.prototype.readResponseBody = function (response) {
debug('end event', self.uri.href)
if (self._aborted) {
debug('aborted', self.uri.href)
+ // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request.
+ // This can lead to leaky behavior if the user retains a reference to the request object.
+ buffer.destroy()
return
}
@@ -1013,6 +1041,9 @@ Request.prototype.readResponseBody = function (response) {
} else {
response.body = buffer.toString(self.encoding)
}
+ // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request.
+ // This can lead to leaky behavior if the user retains a reference to the request object.
+ buffer.destroy()
} else if (strings.length) {
// The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
// Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
@@ -1157,11 +1188,15 @@ Request.prototype.json = function (val) {
self.setHeader('accept', 'application/json')
}
+ if (typeof self.jsonReplacer === 'function') {
+ self._jsonReplacer = self.jsonReplacer
+ }
+
self._json = true
if (typeof val === 'boolean') {
if (self.body !== undefined) {
if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
- self.body = safeStringify(self.body)
+ self.body = safeStringify(self.body, self._jsonReplacer)
} else {
self.body = self._qs.rfc3986(self.body)
}
@@ -1170,7 +1205,7 @@ Request.prototype.json = function (val) {
}
}
} else {
- self.body = safeStringify(val)
+ self.body = safeStringify(val, self._jsonReplacer)
if (!self.hasHeader('content-type')) {
self.setHeader('content-type', 'application/json')
}
@@ -1368,7 +1403,9 @@ Request.prototype.write = function () {
if (!self._started) {
self.start()
}
- return self.req.write.apply(self.req, arguments)
+ if (self.req) {
+ return self.req.write.apply(self.req, arguments)
+ }
}
Request.prototype.end = function (chunk) {
var self = this
@@ -1380,7 +1417,9 @@ Request.prototype.end = function (chunk) {
if (!self._started) {
self.start()
}
- self.req.end()
+ if (self.req) {
+ self.req.end()
+ }
}
Request.prototype.pause = function () {
var self = this