summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/request/node_modules')
-rw-r--r--deps/npm/node_modules/request/node_modules/aws-sign2/package.json22
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/.jshintrc59
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/.npmignore1
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/.travis.yml11
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/LICENSE39
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/README.md196
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/bl.js216
-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/LICENSE27
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md15
-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.js89
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js46
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js982
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js210
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js386
-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.json53
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js106
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md54
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js209
-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.js3
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json54
-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.json54
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json69
-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.js6
-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.json60
-rw-r--r--deps/npm/node_modules/request/node_modules/bl/test/basic-test.js541
-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.js9
-rw-r--r--deps/npm/node_modules/request/node_modules/caseless/README.md45
-rw-r--r--deps/npm/node_modules/request/node_modules/caseless/index.js65
-rw-r--r--deps/npm/node_modules/request/node_modules/caseless/package.json52
-rw-r--r--deps/npm/node_modules/request/node_modules/caseless/test.js33
-rw-r--r--deps/npm/node_modules/request/node_modules/forever-agent/index.js2
-rw-r--r--deps/npm/node_modules/request/node_modules/forever-agent/package.json27
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/Readme.md12
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js44
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml3
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE2
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md950
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js260
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json27
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore3
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile7
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md8
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js1
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json19
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json43
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js23
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt256
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt256
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js27
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js34
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js38
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js35
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js39
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js17
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js24
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js30
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js7
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE (renamed from deps/npm/node_modules/request/node_modules/mime/LICENSE)0
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/README.md (renamed from deps/npm/node_modules/request/node_modules/mime/README.md)0
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/mime.js (renamed from deps/npm/node_modules/request/node_modules/mime/mime.js)0
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json (renamed from deps/npm/node_modules/request/node_modules/mime/package.json)26
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/test.js (renamed from deps/npm/node_modules/request/node_modules/mime/test.js)0
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types (renamed from deps/npm/node_modules/request/node_modules/mime/types/mime.types)0
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types (renamed from deps/npm/node_modules/request/node_modules/mime/types/node.types)0
-rw-r--r--deps/npm/node_modules/request/node_modules/form-data/package.json50
-rw-r--r--deps/npm/node_modules/request/node_modules/hawk/.npmignore36
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/.travis.yml10
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/README.md8
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/lib/browser.js34
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/lib/client.js6
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/lib/crypto.js7
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/lib/index.js2
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/lib/server.js5
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json27
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json25
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json31
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json27
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/package.json29
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/hawk/test/browser.js46
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json32
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json21
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json23
-rw-r--r--deps/npm/node_modules/request/node_modules/http-signature/package.json26
-rw-r--r--deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json22
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/.npmignore14
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/.travis.yml12
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/LICENSE22
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/Makefile9
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/README.md101
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/SOURCES.md17
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/component.json16
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/lib/custom.json27
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/lib/index.js75
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/lib/mime.json3317
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/lib/node.json55
-rw-r--r--deps/npm/node_modules/request/node_modules/mime-types/package.json69
-rw-r--r--deps/npm/node_modules/request/node_modules/node-uuid/package.json22
-rw-r--r--deps/npm/node_modules/request/node_modules/oauth-sign/index.js52
-rw-r--r--deps/npm/node_modules/request/node_modules/oauth-sign/package.json26
-rw-r--r--deps/npm/node_modules/request/node_modules/oauth-sign/test.js14
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/.gitmodules6
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/.jshintignore1
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/.jshintrc10
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/.npmignore25
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/.travis.yml4
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md1
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/LICENSE28
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/Makefile8
-rwxr-xr-x[-rw-r--r--]deps/npm/node_modules/request/node_modules/qs/Readme.md208
-rw-r--r--deps/npm/node_modules/request/node_modules/qs/index.js367
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/lib/index.js15
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/lib/parse.js155
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/lib/stringify.js55
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/lib/utils.js133
-rwxr-xr-x[-rw-r--r--]deps/npm/node_modules/request/node_modules/qs/package.json77
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/test/parse.js301
-rwxr-xr-xdeps/npm/node_modules/request/node_modules/qs/test/stringify.js129
-rw-r--r--deps/npm/node_modules/request/node_modules/stringstream/.npmignore15
-rw-r--r--deps/npm/node_modules/request/node_modules/stringstream/.travis.yml4
-rw-r--r--deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt4
-rw-r--r--deps/npm/node_modules/request/node_modules/stringstream/README.md38
-rw-r--r--deps/npm/node_modules/request/node_modules/stringstream/example.js27
-rw-r--r--deps/npm/node_modules/request/node_modules/stringstream/package.json48
-rw-r--r--deps/npm/node_modules/request/node_modules/stringstream/stringstream.js102
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc110
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/.travis.yml8
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/README.md54
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js27
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js376
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js49
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js37
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt278
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md176
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json62
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js84
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.min.js2
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/LICENSE.txt20
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/README.md35
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/README.md69
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/parse.php35
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/docdown.php38
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Alias.php226
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Entry.php442
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Generator.php563
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/package.json43
-rw-r--r--deps/npm/node_modules/request/node_modules/tough-cookie/test.js323
-rw-r--r--deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc5
-rw-r--r--deps/npm/node_modules/request/node_modules/tunnel-agent/index.js15
-rw-r--r--deps/npm/node_modules/request/node_modules/tunnel-agent/package.json27
163 files changed, 12356 insertions, 3786 deletions
diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json
index 8fc3ff350..719d48870 100644
--- a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json
+++ b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json
@@ -22,7 +22,25 @@
"bugs": {
"url": "https://github.com/mikeal/aws-sign/issues"
},
- "homepage": "https://github.com/mikeal/aws-sign",
"_id": "aws-sign2@0.5.0",
- "_from": "aws-sign2@~0.5.0"
+ "dist": {
+ "shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63",
+ "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz"
+ },
+ "_from": "aws-sign2@~0.5.0",
+ "_npmVersion": "1.3.2",
+ "_npmUser": {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63",
+ "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz",
+ "homepage": "https://github.com/mikeal/aws-sign"
}
diff --git a/deps/npm/node_modules/request/node_modules/bl/.jshintrc b/deps/npm/node_modules/request/node_modules/bl/.jshintrc
new file mode 100644
index 000000000..c8ef3ca40
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/.jshintrc
@@ -0,0 +1,59 @@
+{
+ "predef": [ ]
+ , "bitwise": false
+ , "camelcase": false
+ , "curly": false
+ , "eqeqeq": false
+ , "forin": false
+ , "immed": false
+ , "latedef": false
+ , "noarg": true
+ , "noempty": true
+ , "nonew": true
+ , "plusplus": false
+ , "quotmark": true
+ , "regexp": false
+ , "undef": true
+ , "unused": true
+ , "strict": false
+ , "trailing": true
+ , "maxlen": 120
+ , "asi": true
+ , "boss": true
+ , "debug": true
+ , "eqnull": true
+ , "esnext": true
+ , "evil": true
+ , "expr": true
+ , "funcscope": false
+ , "globalstrict": false
+ , "iterator": false
+ , "lastsemic": true
+ , "laxbreak": true
+ , "laxcomma": true
+ , "loopfunc": true
+ , "multistr": false
+ , "onecase": false
+ , "proto": false
+ , "regexdash": false
+ , "scripturl": true
+ , "smarttabs": false
+ , "shadow": false
+ , "sub": true
+ , "supernew": false
+ , "validthis": true
+ , "browser": true
+ , "couch": false
+ , "devel": false
+ , "dojo": false
+ , "mootools": false
+ , "node": true
+ , "nonstandard": true
+ , "prototypejs": false
+ , "rhino": false
+ , "worker": true
+ , "wsh": false
+ , "nomen": false
+ , "onevar": false
+ , "passfail": false
+} \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/.npmignore b/deps/npm/node_modules/request/node_modules/bl/.npmignore
new file mode 100644
index 000000000..40b878db5
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/.npmignore
@@ -0,0 +1 @@
+node_modules/ \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/.travis.yml b/deps/npm/node_modules/request/node_modules/bl/.travis.yml
new file mode 100644
index 000000000..7ddb9c975
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/.travis.yml
@@ -0,0 +1,11 @@
+language: node_js
+node_js:
+ - 0.8
+ - "0.10"
+branches:
+ only:
+ - master
+notifications:
+ email:
+ - rod@vagg.org
+script: npm test \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/LICENSE b/deps/npm/node_modules/request/node_modules/bl/LICENSE
new file mode 100644
index 000000000..f6a0029de
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/LICENSE
@@ -0,0 +1,39 @@
+Copyright 2013, Rod Vagg (the "Original Author")
+All rights reserved.
+
+MIT +no-false-attribs License
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+Distributions of all or part of the Software intended to be used
+by the recipients as they would use the unmodified Software,
+containing modifications that substantially alter, remove, or
+disable functionality of the Software, outside of the documented
+configuration mechanisms provided by the Software, shall be
+modified such that the Original Author's bug reporting email
+addresses and urls are either replaced with the contact information
+of the parties responsible for the changes, or removed entirely.
+
+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.
+
+
+Except where noted, this license applies to any and all software
+programs and associated documentation files created by the
+Original Author, when distributed with the Software. \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/bl/README.md b/deps/npm/node_modules/request/node_modules/bl/README.md
new file mode 100644
index 000000000..386fbd5f6
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/README.md
@@ -0,0 +1,196 @@
+# bl *(BufferList)*
+
+[![Build Status](https://secure.travis-ci.org/rvagg/bl.png)](http://travis-ci.org/rvagg/bl)
+
+**A Node.js Buffer list collector, reader and streamer thingy.**
+
+[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/)
+[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/)
+
+**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
+
+The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
+
+```js
+const BufferList = require('bl')
+
+var bl = new BufferList()
+bl.append(new Buffer('abcd'))
+bl.append(new Buffer('efg'))
+bl.append('hi') // bl will also accept & convert Strings
+bl.append(new Buffer('j'))
+bl.append(new Buffer([ 0x3, 0x4 ]))
+
+console.log(bl.length) // 12
+
+console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
+console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
+console.log(bl.slice(3, 6).toString('ascii')) // 'def'
+console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
+console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
+
+// or just use toString!
+console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
+console.log(bl.toString('ascii', 3, 8)) // 'defgh'
+console.log(bl.toString('ascii', 5, 10)) // 'fghij'
+
+// other standard Buffer readables
+console.log(bl.readUInt16BE(10)) // 0x0304
+console.log(bl.readUInt16LE(10)) // 0x0403
+```
+
+Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
+
+```js
+const bl = require('bl')
+ , fs = require('fs')
+
+fs.createReadStream('README.md')
+ .pipe(bl(function (err, data) { // note 'new' isn't strictly required
+ // `data` is a complete Buffer object containing the full data
+ console.log(data.toString())
+ }))
+```
+
+Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
+
+Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
+```js
+const hyperquest = require('hyperquest')
+ , bl = require('bl')
+ , url = 'https://raw.github.com/rvagg/bl/master/README.md'
+
+hyperquest(url).pipe(bl(function (err, data) {
+ console.log(data.toString())
+}))
+```
+
+Or, use it as a readable stream to recompose a list of Buffers to an output source:
+
+```js
+const BufferList = require('bl')
+ , fs = require('fs')
+
+var bl = new BufferList()
+bl.append(new Buffer('abcd'))
+bl.append(new Buffer('efg'))
+bl.append(new Buffer('hi'))
+bl.append(new Buffer('j'))
+
+bl.pipe(fs.createWriteStream('gibberish.txt'))
+```
+
+## API
+
+ * <a href="#ctor"><code><b>new BufferList([ callback ])</b></code></a>
+ * <a href="#length"><code>bl.<b>length</b></code></a>
+ * <a href="#append"><code>bl.<b>append(buffer)</b></code></a>
+ * <a href="#get"><code>bl.<b>get(index)</b></code></a>
+ * <a href="#slice"><code>bl.<b>slice([ start[, end ] ])</b></code></a>
+ * <a href="#copy"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>
+ * <a href="#duplicate"><code>bl.<b>duplicate()</b></code></a>
+ * <a href="#consume"><code>bl.<b>consume(bytes)</b></code></a>
+ * <a href="#toString"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>
+ * <a href="#readXX"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>
+ * <a href="#streams">Streams</a>
+
+--------------------------------------------------------
+<a name="ctor"></a>
+### new BufferList([ callback | buffer | buffer array ])
+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.
+
+`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
+
+```js
+var bl = require('bl')
+var myinstance = bl()
+
+// equivilant to:
+
+var BufferList = require('bl')
+var myinstance = new BufferList()
+```
+
+--------------------------------------------------------
+<a name="length"></a>
+### bl.length
+Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
+
+--------------------------------------------------------
+<a name="append"></a>
+### bl.append(buffer)
+`append(buffer)` adds an additional buffer or BufferList to the internal list.
+
+--------------------------------------------------------
+<a name="get"></a>
+### bl.get(index)
+`get()` will return the byte at the specified index.
+
+--------------------------------------------------------
+<a name="slice"></a>
+### bl.slice([ start, [ end ] ])
+`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
+
+If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
+
+--------------------------------------------------------
+<a name="copy"></a>
+### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
+`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
+
+--------------------------------------------------------
+<a name="duplicate"></a>
+### bl.duplicate()
+`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
+
+```js
+var bl = new BufferList()
+
+bl.append('hello')
+bl.append(' world')
+bl.append('\n')
+
+bl.duplicate().pipe(process.stdout, { end: false })
+
+console.log(bl.toString())
+```
+
+--------------------------------------------------------
+<a name="consume"></a>
+### bl.consume(bytes)
+`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers&mdash;initial offsets will be calculated accordingly in order to give you a consistent view of the data.
+
+--------------------------------------------------------
+<a name="toString"></a>
+### bl.toString([encoding, [ start, [ end ]]])
+`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
+
+--------------------------------------------------------
+<a name="readXX"></a>
+### <code>bl.readDoubleBE()</code>, <code>bl.readDoubleLE()</code>, <code>bl.readFloatBE()</code>, <code>bl.readFloatLE()</code>, <code>bl.readInt32BE()</code>, <code>bl.readInt32LE()</code>, <code>bl.readUInt32BE()</code>, <code>bl.readUInt32LE()</code>, <code>bl.readInt16BE()</code>, <code>bl.readInt16LE()</code>, <code>bl.readUInt16BE()</code>, <code>bl.readUInt16LE()</code>, <code>bl.readInt8()</code>, <code>bl.readUInt8()</code>
+
+All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
+
+See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.
+
+--------------------------------------------------------
+<a name="streams"></a>
+### Streams
+**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.
+
+--------------------------------------------------------
+
+## Contributors
+
+**bl** is brought to you by the following hackers:
+
+ * [Rod Vagg](https://github.com/rvagg)
+ * [Matteo Collina](https://github.com/mcollina)
+
+=======
+
+## License
+
+**bl** is Copyright (c) 2013 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
diff --git a/deps/npm/node_modules/request/node_modules/bl/bl.js b/deps/npm/node_modules/request/node_modules/bl/bl.js
new file mode 100644
index 000000000..d1ea3b5c2
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/bl.js
@@ -0,0 +1,216 @@
+var DuplexStream = require('readable-stream').Duplex
+ , util = require('util')
+
+function BufferList (callback) {
+ if (!(this instanceof BufferList))
+ return new BufferList(callback)
+
+ this._bufs = []
+ this.length = 0
+
+ if (typeof callback == 'function') {
+ this._callback = callback
+
+ var piper = function (err) {
+ if (this._callback) {
+ this._callback(err)
+ this._callback = null
+ }
+ }.bind(this)
+
+ this.on('pipe', function (src) {
+ src.on('error', piper)
+ })
+ this.on('unpipe', function (src) {
+ src.removeListener('error', piper)
+ })
+ }
+ else if (Buffer.isBuffer(callback))
+ 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) {
+ var tot = 0, i = 0, _t
+ for (; i < this._bufs.length; i++) {
+ _t = tot + this._bufs[i].length
+ if (offset < _t)
+ return [ i, offset - tot ]
+ tot = _t
+ }
+}
+
+BufferList.prototype.append = function (buf) {
+ var isBuffer = Buffer.isBuffer(buf) ||
+ buf instanceof BufferList
+
+ this._bufs.push(isBuffer ? buf : new Buffer(buf))
+ this.length += buf.length
+ return this
+}
+
+BufferList.prototype._write = function (buf, encoding, callback) {
+ this.append(buf)
+ if (callback)
+ callback()
+}
+
+BufferList.prototype._read = function (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) {
+ DuplexStream.prototype.end.call(this, chunk)
+
+ if (this._callback) {
+ this._callback(null, this.slice())
+ this._callback = null
+ }
+}
+
+BufferList.prototype.get = function (index) {
+ return this.slice(index, index + 1)[0]
+}
+
+BufferList.prototype.slice = function (start, end) {
+ return this.copy(null, 0, start, end)
+}
+
+BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
+ if (typeof srcStart != 'number' || srcStart < 0)
+ srcStart = 0
+ if (typeof srcEnd != 'number' || srcEnd > this.length)
+ srcEnd = this.length
+ if (srcStart >= this.length)
+ return dst || new Buffer(0)
+ if (srcEnd <= 0)
+ return dst || new Buffer(0)
+
+ var copy = !!dst
+ , off = this._offset(srcStart)
+ , len = srcEnd - srcStart
+ , bytes = len
+ , bufoff = (copy && dstStart) || 0
+ , start = off[1]
+ , l
+ , i
+
+ // copy/slice everything
+ if (srcStart === 0 && srcEnd == this.length) {
+ if (!copy) // slice, just return a full concat
+ return Buffer.concat(this._bufs)
+
+ // copy, need to copy individual buffers
+ for (i = 0; i < this._bufs.length; i++) {
+ this._bufs[i].copy(dst, bufoff)
+ bufoff += this._bufs[i].length
+ }
+
+ return dst
+ }
+
+ // easy, cheap case where it's a subset of one of the buffers
+ if (bytes <= this._bufs[off[0]].length - start) {
+ return copy
+ ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
+ : this._bufs[off[0]].slice(start, start + bytes)
+ }
+
+ if (!copy) // a slice, we need something to copy in to
+ dst = new Buffer(len)
+
+ for (i = off[0]; i < this._bufs.length; i++) {
+ l = this._bufs[i].length - start
+
+ if (bytes > l) {
+ this._bufs[i].copy(dst, bufoff, start)
+ } else {
+ this._bufs[i].copy(dst, bufoff, start, start + bytes)
+ break
+ }
+
+ bufoff += l
+ bytes -= l
+
+ if (start)
+ start = 0
+ }
+
+ return dst
+}
+
+BufferList.prototype.toString = function (encoding, start, end) {
+ return this.slice(start, end).toString(encoding)
+}
+
+BufferList.prototype.consume = function (bytes) {
+ while (this._bufs.length) {
+ if (bytes > this._bufs[0].length) {
+ bytes -= this._bufs[0].length
+ this.length -= this._bufs[0].length
+ this._bufs.shift()
+ } else {
+ this._bufs[0] = this._bufs[0].slice(bytes)
+ this.length -= bytes
+ break
+ }
+ }
+ return this
+}
+
+BufferList.prototype.duplicate = function () {
+ var i = 0
+ , copy = new BufferList()
+
+ for (; i < this._bufs.length; i++)
+ copy.append(this._bufs[i])
+
+ return copy
+}
+
+BufferList.prototype.destroy = function () {
+ this._bufs.length = 0;
+ this.length = 0;
+ this.push(null);
+}
+
+;(function () {
+ var methods = {
+ 'readDoubleBE' : 8
+ , 'readDoubleLE' : 8
+ , 'readFloatBE' : 4
+ , 'readFloatLE' : 4
+ , 'readInt32BE' : 4
+ , 'readInt32LE' : 4
+ , 'readUInt32BE' : 4
+ , 'readUInt32LE' : 4
+ , 'readInt16BE' : 2
+ , 'readInt16LE' : 2
+ , 'readUInt16BE' : 2
+ , 'readUInt16LE' : 2
+ , 'readInt8' : 1
+ , 'readUInt8' : 1
+ }
+
+ for (var m in methods) {
+ (function (m) {
+ BufferList.prototype[m] = function (offset) {
+ return this.slice(offset, offset + methods[m])[m](0)
+ }
+ }(m))
+ }
+}())
+
+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 000000000..38344f87a
--- /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/LICENSE b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
new file mode 100644
index 000000000..0c44ae716
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/deps/npm/node_modules/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 000000000..34c118979
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md
@@ -0,0 +1,15 @@
+# readable-stream
+
+***Node-core streams for userland***
+
+[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png)](https://nodei.co/npm/readable-stream/)
+
+This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
+
+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.
+
+**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
+
+**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
+
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 000000000..ca807af87
--- /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 000000000..b513d61a9
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,89 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ return keys;
+}
+/*</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);
+
+forEach(objectKeys(Writable.prototype), function(method) {
+ 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.
+ process.nextTick(this.end.bind(this));
+}
+
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
+ }
+}
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 000000000..895ca50a1
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,46 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+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);
+};
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 000000000..630722099
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,982 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module.exports = Readable;
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+var EE = require('events').EventEmitter;
+
+/*<replacement>*/
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
+ return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+var Stream = require('stream');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+function ReadableState(options, stream) {
+ options = options || {};
+
+ // 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;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
+
+ this.buffer = [];
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = false;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // In streams that never have any data, and do push(null) right away,
+ // the consumer can miss the 'end' event if they do some I/O before
+ // consuming the stream. So, we don't emit('end') until some reading
+ // happens.
+ this.calledRead = 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, becuase 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;
+
+
+ // 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;
+
+ // 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;
+ }
+}
+
+function Readable(options) {
+ if (!(this instanceof Readable))
+ return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ 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 (typeof chunk === 'string' && !state.objectMode) {
+ 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);
+};
+
+function readableAddChunk(stream, state, chunk, encoding, addToFront) {
+ var er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (chunk === null || chunk === undefined) {
+ state.reading = false;
+ if (!state.ended)
+ 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 {
+ if (state.decoder && !addToFront && !encoding)
+ chunk = state.decoder.write(chunk);
+
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront) {
+ state.buffer.unshift(chunk);
+ } else {
+ state.reading = false;
+ 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;
+};
+
+// Don't raise the hwm > 128MB
+var MAX_HWM = 0x800000;
+function roundUpToNextPowerOf2(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2
+ n--;
+ for (var p = 1; p < 32; p <<= 1) n |= n >> p;
+ 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 = roundUpToNextPowerOf2(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) {
+ var state = this._readableState;
+ state.calledRead = true;
+ var nOrig = n;
+ var ret;
+
+ 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)) {
+ 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) {
+ ret = null;
+
+ // In cases where the decoder did not receive enough data
+ // to produce a full chunk, then immediately received an
+ // EOF, state.buffer will contain [<Buffer >, <Buffer 00 ...>].
+ // howMuchToRead will see this and coerce the amount to
+ // read to zero (because it's looking at the length of the
+ // first <Buffer > in state.buffer), and we'll end up here.
+ //
+ // This can only happen via state.decoder -- no other venue
+ // exists for pushing a zero-length chunk into state.buffer
+ // and triggering this behavior. In this case, we return our
+ // remaining data and end the stream, if appropriate.
+ if (state.length > 0 && state.decoder) {
+ ret = fromList(n, state);
+ state.length -= ret.length;
+ }
+
+ if (state.length === 0)
+ endReadable(this);
+
+ return ret;
+ }
+
+ // 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;
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length - n <= state.highWaterMark)
+ doRead = true;
+
+ // 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;
+
+ if (doRead) {
+ 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 called its callback 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);
+
+ 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 happened to read() exactly the remaining amount in the
+ // buffer, and the EOF has been seen at this point, then make sure
+ // that we emit 'end' on the very next tick.
+ if (state.ended && !state.endEmitted && state.length === 0)
+ endReadable(this);
+
+ return ret;
+};
+
+function chunkInvalid(state, chunk) {
+ var er = null;
+ if (!Buffer.isBuffer(chunk) &&
+ 'string' !== typeof chunk &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+
+function onEofChunk(stream, state) {
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // if we've ended and we have some data left, then emit
+ // 'readable' now to make sure it gets picked up.
+ if (state.length > 0)
+ emitReadable(stream);
+ else
+ endReadable(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)
+ return;
+
+ state.emittedReadable = true;
+ if (state.sync)
+ process.nextTick(function() {
+ emitReadable_(stream);
+ });
+ else
+ emitReadable_(stream);
+}
+
+function emitReadable_(stream) {
+ stream.emit('readable');
+}
+
+
+// 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;
+ process.nextTick(function() {
+ maybeReadMore_(stream, state);
+ });
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended &&
+ state.length < state.highWaterMark) {
+ 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;
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
+ dest !== process.stdout &&
+ dest !== process.stderr;
+
+ var endFn = doEnd ? onend : cleanup;
+ if (state.endEmitted)
+ process.nextTick(endFn);
+ else
+ src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable) {
+ if (readable !== src) return;
+ cleanup();
+ }
+
+ function 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);
+
+ function 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);
+
+ // 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 (!dest._writableState || dest._writableState.needDrain)
+ ondrain();
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EE.listenerCount(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() {
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function 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) {
+ // the handler that waits for readable events after all
+ // the data gets sucked out in flow.
+ // This would be easier to follow with a .once() handler
+ // in flow(), but that is too slow.
+ this.on('readable', pipeOnReadable);
+
+ state.flowing = true;
+ process.nextTick(function() {
+ flow(src);
+ });
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function() {
+ var dest = this;
+ var state = src._readableState;
+ state.awaitDrain--;
+ if (state.awaitDrain === 0)
+ flow(src);
+ };
+}
+
+function flow(src) {
+ var state = src._readableState;
+ var chunk;
+ state.awaitDrain = 0;
+
+ function write(dest, i, list) {
+ var written = dest.write(chunk);
+ if (false === written) {
+ state.awaitDrain++;
+ }
+ }
+
+ while (state.pipesCount && null !== (chunk = src.read())) {
+
+ if (state.pipesCount === 1)
+ write(state.pipes, 0, null);
+ else
+ forEach(state.pipes, write);
+
+ src.emit('data', chunk);
+
+ // if anyone needs a drain, then we have to wait for that.
+ if (state.awaitDrain > 0)
+ return;
+ }
+
+ // if every destination was unpiped, either before entering this
+ // function, or in the while loop, then stop flowing.
+ //
+ // NB: This is a pretty rare edge case.
+ if (state.pipesCount === 0) {
+ state.flowing = false;
+
+ // if there were data event listeners added, then switch to old mode.
+ if (EE.listenerCount(src, 'data') > 0)
+ emitDataEvents(src);
+ return;
+ }
+
+ // at this point, no one needed a drain, so we just ran out of data
+ // on the next readable event, start it over again.
+ state.ranOut = true;
+}
+
+function pipeOnReadable() {
+ if (this._readableState.ranOut) {
+ this._readableState.ranOut = false;
+ flow(this);
+ }
+}
+
+
+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;
+ this.removeListener('readable', pipeOnReadable);
+ 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;
+ this.removeListener('readable', pipeOnReadable);
+ 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 (ev === 'data' && !this._readableState.flowing)
+ emitDataEvents(this);
+
+ if (ev === 'readable' && this.readable) {
+ var state = this._readableState;
+ if (!state.readableListening) {
+ state.readableListening = true;
+ state.emittedReadable = false;
+ state.needReadable = true;
+ if (!state.reading) {
+ this.read(0);
+ } else if (state.length) {
+ emitReadable(this, state);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+// 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() {
+ emitDataEvents(this);
+ this.read(0);
+ this.emit('resume');
+};
+
+Readable.prototype.pause = function() {
+ emitDataEvents(this, true);
+ this.emit('pause');
+};
+
+function emitDataEvents(stream, startPaused) {
+ var state = stream._readableState;
+
+ if (state.flowing) {
+ // https://github.com/isaacs/readable-stream/issues/16
+ throw new Error('Cannot switch to old mode now.');
+ }
+
+ var paused = startPaused || false;
+ var readable = false;
+
+ // convert to an old-style stream.
+ stream.readable = true;
+ stream.pipe = Stream.prototype.pipe;
+ stream.on = stream.addListener = Stream.prototype.on;
+
+ stream.on('readable', function() {
+ readable = true;
+
+ var c;
+ while (!paused && (null !== (c = stream.read())))
+ stream.emit('data', c);
+
+ if (c === null) {
+ readable = false;
+ stream._readableState.needReadable = true;
+ }
+ });
+
+ stream.pause = function() {
+ paused = true;
+ this.emit('pause');
+ };
+
+ stream.resume = function() {
+ paused = false;
+ if (readable)
+ process.nextTick(function() {
+ stream.emit('readable');
+ });
+ else
+ this.read(0);
+ this.emit('resume');
+ };
+
+ // now make it start, just in case it hadn't already.
+ stream.emit('readable');
+}
+
+// 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() {
+ 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) {
+ if (state.decoder)
+ chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ //if (state.objectMode && util.isNullOrUndefined(chunk))
+ 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 (typeof stream[i] === 'function' &&
+ typeof this[i] === 'undefined') {
+ 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) {
+ 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
+ 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.calledRead) {
+ state.ended = true;
+ process.nextTick(function() {
+ // 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;
+}
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 000000000..eb188df3e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,210 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+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(options, stream) {
+ this.afterTransform = function(er, data) {
+ return afterTransform(stream, er, data);
+ };
+
+ this.needTransform = false;
+ this.transforming = false;
+ this.writecb = null;
+ this.writechunk = 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);
+
+ if (cb)
+ 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);
+
+ var ts = this._transformState = new TransformState(options, 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;
+
+ this.once('finish', function() {
+ if ('function' === typeof this._flush)
+ 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 rs = stream._readableState;
+ 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);
+}
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 000000000..4bdaa4fa4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,386 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, cb), and it'll handle all
+// the drain event emission and buffering.
+
+module.exports = Writable;
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Stream = require('stream');
+
+util.inherits(Writable, Stream);
+
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+}
+
+function WritableState(options, stream) {
+ options = options || {};
+
+ // 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;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ // 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;
+
+ // 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, becuase 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.buffer = [];
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+}
+
+function Writable(options) {
+ var 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;
+
+ 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, state, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ process.nextTick(function() {
+ 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) &&
+ 'string' !== typeof chunk &&
+ chunk !== null &&
+ chunk !== undefined &&
+ !state.objectMode) {
+ var er = new TypeError('Invalid non-string/buffer chunk');
+ stream.emit('error', er);
+ process.nextTick(function() {
+ 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 = function() {};
+
+ if (state.ended)
+ writeAfterEnd(this, state, cb);
+ else if (validChunk(this, state, chunk, cb))
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
+
+ return ret;
+};
+
+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.buffer.push(new WriteReq(chunk, encoding, cb));
+ else
+ doWrite(stream, state, len, chunk, encoding, cb);
+
+ return ret;
+}
+
+function doWrite(stream, state, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ if (sync)
+ process.nextTick(function() {
+ 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(stream, state);
+
+ if (!finished && !state.bufferProcessing && state.buffer.length)
+ clearBuffer(stream, state);
+
+ if (sync) {
+ process.nextTick(function() {
+ afterWrite(stream, state, finished, cb);
+ });
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished)
+ onwriteDrain(stream, state);
+ cb();
+ if (finished)
+ 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;
+
+ for (var c = 0; c < state.buffer.length; c++) {
+ var entry = state.buffer[c];
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, len, chunk, encoding, cb);
+
+ // 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) {
+ c++;
+ break;
+ }
+ }
+
+ state.bufferProcessing = false;
+ if (c < state.buffer.length)
+ state.buffer = state.buffer.slice(c);
+ else
+ state.buffer.length = 0;
+}
+
+Writable.prototype._write = function(chunk, encoding, cb) {
+ cb(new Error('not implemented'));
+};
+
+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 (typeof chunk !== 'undefined' && chunk !== null)
+ this.write(chunk, encoding);
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished)
+ endWritable(this, state, cb);
+};
+
+
+function needFinish(stream, state) {
+ return (state.ending &&
+ state.length === 0 &&
+ !state.finished &&
+ !state.writing);
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(stream, state);
+ if (need) {
+ state.finished = true;
+ stream.emit('finish');
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished)
+ process.nextTick(cb);
+ else
+ stream.once('finish', cb);
+ }
+ state.ended = true;
+}
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 000000000..5a76b4149
--- /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 000000000..a06d5c05f
--- /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 000000000..9074e8ebc
--- /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(ar) {
+ return Array.isArray(ar);
+}
+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 isObject(re) && objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+ return isObject(d) && objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+ return isObject(e) &&
+ (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;
+
+function isBuffer(arg) {
+ return Buffer.isBuffer(arg);
+}
+exports.isBuffer = isBuffer;
+
+function objectToString(o) {
+ return Object.prototype.toString.call(o);
+} \ 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/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 000000000..add87edf5
--- /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,53 @@
+{
+ "name": "core-util-is",
+ "version": "1.0.1",
+ "description": "The `util.is*` functions introduced in Node v0.12.",
+ "main": "lib/util.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/core-util-is"
+ },
+ "keywords": [
+ "util",
+ "isBuffer",
+ "isArray",
+ "isNumber",
+ "isString",
+ "isRegExp",
+ "isThis",
+ "isThat",
+ "polyfill"
+ ],
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/isaacs/core-util-is/issues"
+ },
+ "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/isaacs/core-util-is",
+ "_id": "core-util-is@1.0.1",
+ "dist": {
+ "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
+ "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
+ },
+ "_from": "core-util-is@~1.0.0",
+ "_npmVersion": "1.3.23",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "directories": {},
+ "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
+ "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
new file mode 100644
index 000000000..007fa1057
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/util.js
@@ -0,0 +1,106 @@
+// 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(ar) {
+ return Array.isArray(ar);
+}
+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 isObject(re) && objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+ return isObject(d) && objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+ return isObject(e) && objectToString(e) === '[object 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;
+
+function isBuffer(arg) {
+ return arg instanceof Buffer;
+}
+exports.isBuffer = 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/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 000000000..052a62b8d
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md
@@ -0,0 +1,54 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+## 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/build/build.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js
new file mode 100644
index 000000000..ec58596ae
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js
@@ -0,0 +1,209 @@
+
+/**
+ * Require the given path.
+ *
+ * @param {String} path
+ * @return {Object} exports
+ * @api public
+ */
+
+function require(path, parent, orig) {
+ var resolved = require.resolve(path);
+
+ // lookup failed
+ if (null == resolved) {
+ orig = orig || path;
+ parent = parent || 'root';
+ var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
+ err.path = orig;
+ err.parent = parent;
+ err.require = true;
+ throw err;
+ }
+
+ var module = require.modules[resolved];
+
+ // perform real require()
+ // by invoking the module's
+ // registered function
+ if (!module.exports) {
+ module.exports = {};
+ module.client = module.component = true;
+ module.call(this, module.exports, require.relative(resolved), module);
+ }
+
+ return module.exports;
+}
+
+/**
+ * Registered modules.
+ */
+
+require.modules = {};
+
+/**
+ * Registered aliases.
+ */
+
+require.aliases = {};
+
+/**
+ * Resolve `path`.
+ *
+ * Lookup:
+ *
+ * - PATH/index.js
+ * - PATH.js
+ * - PATH
+ *
+ * @param {String} path
+ * @return {String} path or null
+ * @api private
+ */
+
+require.resolve = function(path) {
+ if (path.charAt(0) === '/') path = path.slice(1);
+ var index = path + '/index.js';
+
+ var paths = [
+ path,
+ path + '.js',
+ path + '.json',
+ path + '/index.js',
+ path + '/index.json'
+ ];
+
+ for (var i = 0; i < paths.length; i++) {
+ var path = paths[i];
+ if (require.modules.hasOwnProperty(path)) return path;
+ }
+
+ if (require.aliases.hasOwnProperty(index)) {
+ return require.aliases[index];
+ }
+};
+
+/**
+ * Normalize `path` relative to the current path.
+ *
+ * @param {String} curr
+ * @param {String} path
+ * @return {String}
+ * @api private
+ */
+
+require.normalize = function(curr, path) {
+ var segs = [];
+
+ if ('.' != path.charAt(0)) return path;
+
+ curr = curr.split('/');
+ path = path.split('/');
+
+ for (var i = 0; i < path.length; ++i) {
+ if ('..' == path[i]) {
+ curr.pop();
+ } else if ('.' != path[i] && '' != path[i]) {
+ segs.push(path[i]);
+ }
+ }
+
+ return curr.concat(segs).join('/');
+};
+
+/**
+ * Register module at `path` with callback `definition`.
+ *
+ * @param {String} path
+ * @param {Function} definition
+ * @api private
+ */
+
+require.register = function(path, definition) {
+ require.modules[path] = definition;
+};
+
+/**
+ * Alias a module definition.
+ *
+ * @param {String} from
+ * @param {String} to
+ * @api private
+ */
+
+require.alias = function(from, to) {
+ if (!require.modules.hasOwnProperty(from)) {
+ throw new Error('Failed to alias "' + from + '", it does not exist');
+ }
+ require.aliases[to] = from;
+};
+
+/**
+ * Return a require function relative to the `parent` path.
+ *
+ * @param {String} parent
+ * @return {Function}
+ * @api private
+ */
+
+require.relative = function(parent) {
+ var p = require.normalize(parent, '..');
+
+ /**
+ * lastIndexOf helper.
+ */
+
+ function lastIndexOf(arr, obj) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === obj) return i;
+ }
+ return -1;
+ }
+
+ /**
+ * The relative require() itself.
+ */
+
+ function localRequire(path) {
+ var resolved = localRequire.resolve(path);
+ return require(resolved, parent, path);
+ }
+
+ /**
+ * Resolve relative to the parent.
+ */
+
+ localRequire.resolve = function(path) {
+ var c = path.charAt(0);
+ if ('/' == c) return path.slice(1);
+ if ('.' == c) return require.normalize(p, path);
+
+ // resolve deps by returning
+ // the dep in the nearest "deps"
+ // directory
+ var segs = parent.split('/');
+ var i = lastIndexOf(segs, 'deps') + 1;
+ if (!i) i = 0;
+ path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
+ return path;
+ };
+
+ /**
+ * Check if module is defined at `path`.
+ */
+
+ localRequire.exists = function(path) {
+ return require.modules.hasOwnProperty(localRequire.resolve(path));
+ };
+
+ return localRequire;
+};
+require.register("isarray/index.js", function(exports, require, module){
+module.exports = Array.isArray || function (arr) {
+ return Object.prototype.toString.call(arr) == '[object Array]';
+};
+
+});
+require.alias("isarray/index.js", "isarray/index.js");
+
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 000000000..9e31b6838
--- /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 000000000..5f5ad45d4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js
@@ -0,0 +1,3 @@
+module.exports = Array.isArray || function (arr) {
+ return Object.prototype.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 000000000..fc7904b67
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "isarray",
+ "description": "Array#isArray for older browsers",
+ "version": "0.0.1",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/isarray.git"
+ },
+ "homepage": "https://github.com/juliangruber/isarray",
+ "main": "index.js",
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "*"
+ },
+ "keywords": [
+ "browser",
+ "isarray",
+ "array"
+ ],
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "license": "MIT",
+ "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+ "readmeFilename": "README.md",
+ "_id": "isarray@0.0.1",
+ "dist": {
+ "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
+ "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
+ },
+ "_from": "isarray@0.0.1",
+ "_npmVersion": "1.2.18",
+ "_npmUser": {
+ "name": "juliangruber",
+ "email": "julian@juliangruber.com"
+ },
+ "maintainers": [
+ {
+ "name": "juliangruber",
+ "email": "julian@juliangruber.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
+ "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "bugs": {
+ "url": "https://github.com/juliangruber/isarray/issues"
+ }
+}
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 000000000..206320cc1
--- /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 000000000..6de584a48
--- /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 000000000..4d2aa0015
--- /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 000000000..b00e54fb7
--- /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 000000000..a8c586bfb
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "string_decoder",
+ "version": "0.10.31",
+ "description": "The string_decoder module from Node core",
+ "main": "index.js",
+ "dependencies": {},
+ "devDependencies": {
+ "tap": "~0.4.8"
+ },
+ "scripts": {
+ "test": "tap test/simple/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/rvagg/string_decoder.git"
+ },
+ "homepage": "https://github.com/rvagg/string_decoder",
+ "keywords": [
+ "string",
+ "decoder",
+ "browser",
+ "browserify"
+ ],
+ "license": "MIT",
+ "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
+ "bugs": {
+ "url": "https://github.com/rvagg/string_decoder/issues"
+ },
+ "_id": "string_decoder@0.10.31",
+ "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+ "_from": "string_decoder@~0.10.x",
+ "_npmVersion": "1.4.23",
+ "_npmUser": {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ },
+ "maintainers": [
+ {
+ "name": "substack",
+ "email": "mail@substack.net"
+ },
+ {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ }
+ ],
+ "dist": {
+ "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+ "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+ "readme": "ERROR: No README data found!"
+}
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 000000000..144858701
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
@@ -0,0 +1,69 @@
+{
+ "name": "readable-stream",
+ "version": "1.0.31",
+ "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x",
+ "main": "readable.js",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "isarray": "0.0.1",
+ "string_decoder": "~0.10.x",
+ "inherits": "~2.0.1"
+ },
+ "devDependencies": {
+ "tap": "~0.2.6"
+ },
+ "scripts": {
+ "test": "tap test/simple/*.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/readable-stream"
+ },
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "browser": {
+ "util": false
+ },
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/isaacs/readable-stream/issues"
+ },
+ "homepage": "https://github.com/isaacs/readable-stream",
+ "_id": "readable-stream@1.0.31",
+ "_shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae",
+ "_from": "readable-stream@~1.0.26",
+ "_npmVersion": "1.4.9",
+ "_npmUser": {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ {
+ "name": "tootallnate",
+ "email": "nathan@tootallnate.net"
+ },
+ {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ }
+ ],
+ "dist": {
+ "shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae",
+ "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz",
+ "readme": "ERROR: No README data found!"
+}
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 000000000..27e8d8a55
--- /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 000000000..4d1ddfc73
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js
@@ -0,0 +1,6 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+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 000000000..5d482f078
--- /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 000000000..e1e9efdf3
--- /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
new file mode 100644
index 000000000..19c4ac079
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "bl",
+ "version": "0.9.1",
+ "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
+ "main": "bl.js",
+ "scripts": {
+ "test": "node test/test.js | faucet",
+ "test-local": "brtapsauce-local test/basic-test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/rvagg/bl.git"
+ },
+ "homepage": "https://github.com/rvagg/bl",
+ "authors": [
+ "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
+ "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)"
+ ],
+ "keywords": [
+ "buffer",
+ "buffers",
+ "stream",
+ "awesomesauce"
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "readable-stream": "~1.0.26"
+ },
+ "devDependencies": {
+ "tape": "~2.12.3",
+ "hash_file": "~0.1.1",
+ "faucet": "~0.0.1",
+ "brtapsauce": "~0.3.0"
+ },
+ "gitHead": "53d3d10e39be326feb049ab27437173b3ce47ec4",
+ "bugs": {
+ "url": "https://github.com/rvagg/bl/issues"
+ },
+ "_id": "bl@0.9.1",
+ "_shasum": "d262c5b83aa5cf4386cea1d998c82b36d7ae2942",
+ "_from": "bl@~0.9.0",
+ "_npmVersion": "1.4.21",
+ "_npmUser": {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ },
+ "maintainers": [
+ {
+ "name": "rvagg",
+ "email": "rod@vagg.org"
+ }
+ ],
+ "dist": {
+ "shasum": "d262c5b83aa5cf4386cea1d998c82b36d7ae2942",
+ "tarball": "http://registry.npmjs.org/bl/-/bl-0.9.1.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/bl/-/bl-0.9.1.tgz",
+ "readme": "ERROR: No README data found!"
+}
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
new file mode 100644
index 000000000..75116a30f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js
@@ -0,0 +1,541 @@
+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('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
new file mode 100644
index 000000000..a6d28625f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/test/sauce.js
@@ -0,0 +1,38 @@
+#!/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
new file mode 100644
index 000000000..aa9b48771
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/bl/test/test.js
@@ -0,0 +1,9 @@
+require('./basic-test')
+
+if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
+ return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
+
+if (!/v0\.10/.test(process.version))
+ return console.log('Not Node v0.10.x, not running sauce tests')
+
+require('./sauce.js') \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/caseless/README.md b/deps/npm/node_modules/request/node_modules/caseless/README.md
new file mode 100644
index 000000000..719584c85
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/caseless/README.md
@@ -0,0 +1,45 @@
+## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing.
+
+This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manor while also preserving the caseing of headers the first time they are set.
+
+## Usage
+
+```javascript
+var headers = {}
+ , c = caseless(headers)
+ ;
+c.set('a-Header', 'asdf')
+c.get('a-header') === 'asdf'
+```
+
+## has(key)
+
+Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with.
+
+```javascript
+c.has('a-header') === 'a-Header'
+```
+
+## set(key, value[, clobber=true])
+
+Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header.
+
+```javascript
+c.set('a-Header', 'fdas')
+c.set('a-HEADER', 'more', false)
+c.get('a-header') === 'fdsa,more'
+```
+
+## swap(key)
+
+Swaps the casing of a header with the new one that is passed in.
+
+```javascript
+var headers = {}
+ , c = caseless(headers)
+ ;
+c.set('a-Header', 'fdas')
+c.swap('a-HEADER')
+c.has('a-header') === 'a-HEADER'
+headers === {'a-HEADER': 'fdas'}
+```
diff --git a/deps/npm/node_modules/request/node_modules/caseless/index.js b/deps/npm/node_modules/request/node_modules/caseless/index.js
new file mode 100644
index 000000000..231a997e0
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/caseless/index.js
@@ -0,0 +1,65 @@
+function Caseless (dict) {
+ this.dict = dict
+}
+Caseless.prototype.set = function (name, value, clobber) {
+ if (typeof name === 'object') {
+ for (var i in name) {
+ this.set(i, name[i], value)
+ }
+ } else {
+ if (typeof clobber === 'undefined') clobber = true
+ var has = this.has(name)
+
+ if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value
+ else this.dict[has || name] = value
+ return has
+ }
+}
+Caseless.prototype.has = function (name) {
+ var keys = Object.keys(this.dict)
+ , name = name.toLowerCase()
+ ;
+ for (var i=0;i<keys.length;i++) {
+ if (keys[i].toLowerCase() === name) return keys[i]
+ }
+ return false
+}
+Caseless.prototype.get = function (name) {
+ var result, re, match
+ var headers = this.dict
+ Object.keys(headers).forEach(function (key) {
+ re = new RegExp(name, 'i')
+ match = key.match(re)
+ if (match) result = headers[key]
+ })
+ return result
+}
+Caseless.prototype.swap = function (name) {
+ var has = this.has(name)
+ if (!has) throw new Error('There is no header than matches "'+name+'"')
+ this.dict[name] = this.dict[has]
+ delete this.dict[has]
+}
+Caseless.prototype.del = function (name) {
+ var has = this.has(name)
+ return delete this.dict[has || name]
+}
+
+module.exports = function (dict) {return new Caseless(dict)}
+module.exports.httpify = function (resp, headers) {
+ var c = new Caseless(headers)
+ resp.setHeader = function (key, value, clobber) {
+ return c.set(key, value, clobber)
+ }
+ resp.hasHeader = function (key) {
+ return c.has(key)
+ }
+ resp.getHeader = function (key) {
+ return c.get(key)
+ }
+ resp.removeHeader = function (key) {
+ return c.del(key)
+ }
+ resp.headers = c.dict
+ return c
+}
diff --git a/deps/npm/node_modules/request/node_modules/caseless/package.json b/deps/npm/node_modules/request/node_modules/caseless/package.json
new file mode 100644
index 000000000..62d467544
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/caseless/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "caseless",
+ "version": "0.6.0",
+ "description": "Caseless object set/get/has, very useful when working with HTTP headers.",
+ "main": "index.js",
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/mikeal/caseless"
+ },
+ "keywords": [
+ "headers",
+ "http",
+ "caseless"
+ ],
+ "test": "node test.js",
+ "author": {
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "license": "BSD",
+ "bugs": {
+ "url": "https://github.com/mikeal/caseless/issues"
+ },
+ "devDependencies": {
+ "tape": "^2.10.2"
+ },
+ "homepage": "https://github.com/mikeal/caseless",
+ "_id": "caseless@0.6.0",
+ "_shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4",
+ "_from": "caseless@~0.6.0",
+ "_npmVersion": "1.4.9",
+ "_npmUser": {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4",
+ "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.6.0.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/request/node_modules/caseless/test.js b/deps/npm/node_modules/request/node_modules/caseless/test.js
new file mode 100644
index 000000000..5604fa075
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/caseless/test.js
@@ -0,0 +1,33 @@
+var tape = require('tape')
+ , caseless = require('./')
+ ;
+
+tape('set get has', function (t) {
+ var headers = {}
+ , c = caseless(headers)
+ ;
+ t.plan(14)
+ c.set('a-Header', 'asdf')
+ t.equal(c.get('a-header'), 'asdf')
+ t.equal(c.has('a-header'), 'a-Header')
+ t.ok(!c.has('nothing'))
+ // old bug where we used the wrong regex
+ t.ok(!c.has('a-hea'))
+ c.set('a-header', 'fdsa')
+ t.equal(c.get('a-header'), 'fdsa')
+ t.equal(c.get('a-Header'), 'fdsa')
+ c.set('a-HEADER', 'more', false)
+ t.equal(c.get('a-header'), 'fdsa,more')
+
+ t.deepEqual(headers, {'a-Header': 'fdsa,more'})
+ c.swap('a-HEADER')
+ t.deepEqual(headers, {'a-HEADER': 'fdsa,more'})
+
+ c.set('deleteme', 'foobar')
+ t.ok(c.has('deleteme'))
+ t.ok(c.del('deleteme'))
+ t.notOk(c.has('deleteme'))
+ t.notOk(c.has('idonotexist'))
+ t.ok(c.del('idonotexist'))
+
+})
diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/index.js b/deps/npm/node_modules/request/node_modules/forever-agent/index.js
index 5c07928ae..1e8efcdf2 100644
--- a/deps/npm/node_modules/request/node_modules/forever-agent/index.js
+++ b/deps/npm/node_modules/request/node_modules/forever-agent/index.js
@@ -24,7 +24,7 @@ function ForeverAgent(options) {
self.freeSockets[name].push(socket)
// if an error happens while we don't use the socket anyway, meh, throw the socket away
- function onIdleError() {
+ var onIdleError = function() {
socket.destroy()
}
socket._onIdleError = onIdleError
diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/package.json b/deps/npm/node_modules/request/node_modules/forever-agent/package.json
index 3ef85a9d2..764ca1e2c 100644
--- a/deps/npm/node_modules/request/node_modules/forever-agent/package.json
+++ b/deps/npm/node_modules/request/node_modules/forever-agent/package.json
@@ -6,7 +6,7 @@
},
"name": "forever-agent",
"description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
- "version": "0.5.0",
+ "version": "0.5.2",
"repository": {
"url": "https://github.com/mikeal/forever-agent"
},
@@ -17,12 +17,29 @@
"engines": {
"node": "*"
},
- "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/mikeal/forever-agent/issues"
},
"homepage": "https://github.com/mikeal/forever-agent",
- "_id": "forever-agent@0.5.0",
- "_from": "forever-agent@~0.5.0"
+ "_id": "forever-agent@0.5.2",
+ "dist": {
+ "shasum": "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130",
+ "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
+ },
+ "_from": "forever-agent@~0.5.0",
+ "_npmVersion": "1.3.21",
+ "_npmUser": {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130",
+ "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz",
+ "readme": "ERROR: No README data found!"
}
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 dc73c463d..c8a1a55db 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
@@ -149,6 +149,18 @@ form.submit({
});
```
+In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
+
+``` javascript
+form.submit({
+ host: 'example.com',
+ path: '/surelynot.php',
+ headers: {'x-test-header': 'test-header-value'}
+}, function(err, res) {
+ console.log(res.statusCode);
+});
+```
+
## Notes
- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
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 d1064748b..b8bd15848 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
@@ -79,14 +79,38 @@ FormData.prototype._trackLength = function(header, value, options) {
this._lengthRetrievers.push(function(next) {
if (value.hasOwnProperty('fd')) {
- fs.stat(value.path, function(err, stat) {
- if (err) {
- next(err);
- return;
- }
- next(null, stat.size);
- });
+ // 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')) {
@@ -255,8 +279,7 @@ FormData.prototype.submit = function(params, cb) {
var request
, options
, defaults = {
- method : 'post',
- headers: this.getHeaders()
+ method : 'post'
};
// parse provided url if it's string
@@ -279,6 +302,9 @@ FormData.prototype.submit = function(params, cb) {
}
}
+ // put that good code in getHeaders to some use
+ options.headers = this.getHeaders(params.headers);
+
// https if specified, fallback to http in any other case
if (params.protocol == 'https:') {
request = https.request(options);
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
new file mode 100644
index 000000000..6e5919de3
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - "0.10"
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
index b7f9d5001..8f2969858 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2010 Caolan McMahon
+Copyright (c) 2010-2014 Caolan McMahon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
index 9ff1acfdf..0bea5311a 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
@@ -1,15 +1,18 @@
# Async.js
+[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)
+
+
Async is a utility module which provides straight-forward, powerful functions
for working with asynchronous JavaScript. Although originally designed for
-use with [node.js](http://nodejs.org), it can also be used directly in the
+use with [Node.js](http://nodejs.org), it can also be used directly in the
browser. Also supports [component](https://github.com/component/component).
Async provides around 20 functions that include the usual 'functional'
-suspects (map, reduce, filter, each…) as well as some common patterns
-for asynchronous control flow (parallel, series, waterfall…). All these
-functions assume you follow the node.js convention of providing a single
-callback as the last argument of your async function.
+suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns
+for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these
+functions assume you follow the Node.js convention of providing a single
+callback as the last argument of your `async` function.
## Quick Examples
@@ -42,8 +45,8 @@ missing please create a GitHub issue for it.
### Binding a context to an iterator
-This section is really about bind, not about async. If you are wondering how to
-make async execute your iterators in a given context, or are confused as to why
+This section is really about `bind`, not about `async`. If you are wondering how to
+make `async` execute your iterators in a given context, or are confused as to why
a method of another library isn't working as an iterator, study this example:
```js
@@ -78,7 +81,7 @@ async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), fun
The source is available for download from
[GitHub](http://github.com/caolan/async).
-Alternatively, you can install using Node Package Manager (npm):
+Alternatively, you can install using Node Package Manager (`npm`):
npm install async
@@ -86,7 +89,9 @@ __Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async
## In the Browser
-So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
+
+Usage:
```html
<script type="text/javascript" src="async.js"></script>
@@ -103,45 +108,59 @@ So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
### Collections
-* [each](#each)
-* [map](#map)
-* [filter](#filter)
-* [reject](#reject)
-* [reduce](#reduce)
-* [detect](#detect)
-* [sortBy](#sortBy)
-* [some](#some)
-* [every](#every)
-* [concat](#concat)
+* [`each`](#each)
+* [`eachSeries`](#eachSeries)
+* [`eachLimit`](#eachLimit)
+* [`map`](#map)
+* [`mapSeries`](#mapSeries)
+* [`mapLimit`](#mapLimit)
+* [`filter`](#filter)
+* [`filterSeries`](#filterSeries)
+* [`reject`](#reject)
+* [`rejectSeries`](#rejectSeries)
+* [`reduce`](#reduce)
+* [`reduceRight`](#reduceRight)
+* [`detect`](#detect)
+* [`detectSeries`](#detectSeries)
+* [`sortBy`](#sortBy)
+* [`some`](#some)
+* [`every`](#every)
+* [`concat`](#concat)
+* [`concatSeries`](#concatSeries)
### Control Flow
-* [series](#series)
-* [parallel](#parallel)
-* [whilst](#whilst)
-* [doWhilst](#doWhilst)
-* [until](#until)
-* [doUntil](#doUntil)
-* [forever](#forever)
-* [waterfall](#waterfall)
-* [compose](#compose)
-* [applyEach](#applyEach)
-* [queue](#queue)
-* [cargo](#cargo)
-* [auto](#auto)
-* [iterator](#iterator)
-* [apply](#apply)
-* [nextTick](#nextTick)
-* [times](#times)
-* [timesSeries](#timesSeries)
+* [`series`](#seriestasks-callback)
+* [`parallel`](#parallel)
+* [`parallelLimit`](#parallellimittasks-limit-callback)
+* [`whilst`](#whilst)
+* [`doWhilst`](#doWhilst)
+* [`until`](#until)
+* [`doUntil`](#doUntil)
+* [`forever`](#forever)
+* [`waterfall`](#waterfall)
+* [`compose`](#compose)
+* [`seq`](#seq)
+* [`applyEach`](#applyEach)
+* [`applyEachSeries`](#applyEachSeries)
+* [`queue`](#queue)
+* [`priorityQueue`](#priorityQueue)
+* [`cargo`](#cargo)
+* [`auto`](#auto)
+* [`retry`](#retry)
+* [`iterator`](#iterator)
+* [`apply`](#apply)
+* [`nextTick`](#nextTick)
+* [`times`](#times)
+* [`timesSeries`](#timesSeries)
### Utils
-* [memoize](#memoize)
-* [unmemoize](#unmemoize)
-* [log](#log)
-* [dir](#dir)
-* [noConflict](#noConflict)
+* [`memoize`](#memoize)
+* [`unmemoize`](#unmemoize)
+* [`log`](#log)
+* [`dir`](#dir)
+* [`noConflict`](#noConflict)
## Collections
@@ -150,25 +169,26 @@ So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
<a name="each" />
### each(arr, iterator, callback)
-Applies an iterator function to each item in an array, in parallel.
-The iterator is called with an item from the list and a callback for when it
-has finished. If the iterator passes an error to this callback, the main
-callback for the each function is immediately called with the error.
+Applies the function `iterator` to each item in `arr`, in parallel.
+The `iterator` is called with an item from the list, and a callback for when it
+has finished. If the `iterator` passes an error to its `callback`, the main
+`callback` (for the `each` function) is immediately called with the error.
-Note, that since this function applies the iterator to each item in parallel
+Note, that since this function applies `iterator` to each item in parallel,
there is no guarantee that the iterator functions will complete in order.
__Arguments__
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
- completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err)` which must be called once it has
+ completed. If no error has occured, the `callback` should be run without
+ arguments or with an explicit `null` argument.
+* `callback(err)` - A callback which is called when all `iterator` functions
+ have finished, or an error occurs.
+
+__Examples__
-__Example__
```js
// assuming openFiles is an array of file names and saveFile is a function
@@ -179,15 +199,43 @@ async.each(openFiles, saveFile, function(err){
});
```
+```js
+// assuming openFiles is an array of file names
+
+async.each(openFiles, function( file, callback) {
+
+ // Perform operation on file here.
+ console.log('Processing file ' + file);
+
+ if( file.length > 32 ) {
+ console.log('This file name is too long');
+ callback('File name too long');
+ } else {
+ // Do work to process file here
+ console.log('File processed');
+ callback();
+ }
+}, function(err){
+ // if any of the file processing produced an error, err would equal that error
+ if( err ) {
+ // One of the iterations produced an error.
+ // All processing will now stop.
+ console.log('A file failed to process');
+ } else {
+ console.log('All files have been processed successfully');
+ }
+});
+```
+
---------------------------------------
<a name="forEachSeries" />
<a name="eachSeries" />
### eachSeries(arr, iterator, callback)
-The same as each only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. This means the iterator functions will complete in order.
+The same as [`each`](#each), only `iterator` is applied to each item in `arr` in
+series. The next `iterator` is only called once the current one has completed.
+This means the `iterator` functions will complete in order.
---------------------------------------
@@ -196,23 +244,22 @@ processing. This means the iterator functions will complete in order.
<a name="eachLimit" />
### eachLimit(arr, limit, iterator, callback)
-The same as each only no more than "limit" iterators will be simultaneously
+The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously
running at any time.
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
+Note that the items in `arr` are not processed in batches, so there is no guarantee that
+the first `limit` `iterator` functions will complete before any others are started.
__Arguments__
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err) which must be called once it has
+* `arr` - An array to iterate over.
+* `limit` - The maximum number of `iterator`s to run at any time.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err)` which must be called once it has
completed. If no error has occured, the callback should be run without
- arguments or with an explicit null argument.
-* callback(err) - A callback which is called after all the iterator functions
- have finished, or an error has occurred.
+ arguments or with an explicit `null` argument.
+* `callback(err)` - A callback which is called when all `iterator` functions
+ have finished, or an error occurs.
__Example__
@@ -230,26 +277,25 @@ async.eachLimit(documents, 20, requestApi, function(err){
<a name="map" />
### map(arr, iterator, callback)
-Produces a new array of values by mapping each value in the given array through
-the iterator function. The iterator is called with an item from the array and a
-callback for when it has finished processing. The callback takes 2 arguments,
-an error and the transformed item from the array. If the iterator passes an
-error to this callback, the main callback for the map function is immediately
-called with the error.
+Produces a new array of values by mapping each value in `arr` through
+the `iterator` function. The `iterator` is called with an item from `arr` and a
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to this
+callback, the main `callback` (for the `map` function) is immediately called with the error.
-Note, that since this function applies the iterator to each item in parallel
-there is no guarantee that the iterator functions will complete in order, however
-the results array will be in the same order as the original array.
+Note, that since this function applies the `iterator` to each item in parallel,
+there is no guarantee that the `iterator` functions will complete in order.
+However, the results array will be in the same order as the original `arr`.
__Arguments__
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, transformed)` which must be called once
+ it has completed with an error (which can be `null`) and a transformed item.
+* `callback(err, results)` - A callback which is called when all `iterator`
+ functions have finished, or an error occurs. Results is an array of the
+ transformed items from the `arr`.
__Example__
@@ -264,9 +310,9 @@ async.map(['file1','file2','file3'], fs.stat, function(err, results){
<a name="mapSeries" />
### mapSeries(arr, iterator, callback)
-The same as map only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
+The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in
+series. The next `iterator` is only called once the current one has completed.
+The results array will be in the same order as the original.
---------------------------------------
@@ -274,53 +320,53 @@ processing. The results array will be in the same order as the original.
<a name="mapLimit" />
### mapLimit(arr, limit, iterator, callback)
-The same as map only no more than "limit" iterators will be simultaneously
+The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously
running at any time.
-Note that the items are not processed in batches, so there is no guarantee that
- the first "limit" iterator functions will complete before any others are
-started.
+Note that the items are not processed in batches, so there is no guarantee that
+the first `limit` `iterator` functions will complete before any others are started.
__Arguments__
-* arr - An array to iterate over.
-* limit - The maximum number of iterators to run at any time.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, transformed) which must be called once
- it has completed with an error (which can be null) and a transformed item.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array of the
- transformed items from the original array.
+* `arr` - An array to iterate over.
+* `limit` - The maximum number of `iterator`s to run at any time.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, transformed)` which must be called once
+ it has completed with an error (which can be `null`) and a transformed item.
+* `callback(err, results)` - A callback which is called when all `iterator`
+ calls have finished, or an error occurs. The result is an array of the
+ transformed items from the original `arr`.
__Example__
```js
-async.map(['file1','file2','file3'], 1, fs.stat, function(err, results){
+async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
// results is now an array of stats for each file
});
```
---------------------------------------
+<a name="select" />
<a name="filter" />
### filter(arr, iterator, callback)
-__Alias:__ select
+__Alias:__ `select`
-Returns a new array of all the values which pass an async truth test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. This operation is
+Returns a new array of all the values in `arr` which pass an async truth test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. This operation is
performed in parallel, but the results array will be in the same order as the
original.
__Arguments__
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
boolean argument once it has completed.
-* callback(results) - A callback which is called after all the iterator
+* `callback(results)` - A callback which is called after all the `iterator`
functions have finished.
__Example__
@@ -333,28 +379,29 @@ async.filter(['file1','file2','file3'], fs.exists, function(results){
---------------------------------------
+<a name="selectSeries" />
<a name="filterSeries" />
### filterSeries(arr, iterator, callback)
-__alias:__ selectSeries
+__Alias:__ `selectSeries`
-The same as filter only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
+The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in
+series. The next `iterator` is only called once the current one has completed.
+The results array will be in the same order as the original.
---------------------------------------
<a name="reject" />
### reject(arr, iterator, callback)
-The opposite of filter. Removes values that pass an async truth test.
+The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
---------------------------------------
<a name="rejectSeries" />
### rejectSeries(arr, iterator, callback)
-The same as reject, only the iterator is applied to each item in the array
+The same as [`reject`](#reject), only the `iterator` is applied to each item in `arr`
in series.
@@ -363,27 +410,28 @@ in series.
<a name="reduce" />
### reduce(arr, memo, iterator, callback)
-__aliases:__ inject, foldl
+__Aliases:__ `inject`, `foldl`
+
+Reduces `arr` into a single value using an async `iterator` to return
+each successive step. `memo` is the initial state of the reduction.
+This function only operates in series.
-Reduces a list of values into a single value using an async iterator to return
-each successive step. Memo is the initial state of the reduction. This
-function only operates in series. For performance reasons, it may make sense to
-split a call to this function into a parallel map, then use the normal
-Array.prototype.reduce on the results. This function is for situations where
-each step in the reduction needs to be async, if you can get the data before
-reducing it then it's probably a good idea to do so.
+For performance reasons, it may make sense to split a call to this function into
+a parallel map, and then use the normal `Array.prototype.reduce` on the results.
+This function is for situations where each step in the reduction needs to be async;
+if you can get the data before reducing it, then it's probably a good idea to do so.
__Arguments__
-* arr - An array to iterate over.
-* memo - The initial state of the reduction.
-* iterator(memo, item, callback) - A function applied to each item in the
- array to produce the next step in the reduction. The iterator is passed a
- callback(err, reduction) which accepts an optional error as its first
+* `arr` - An array to iterate over.
+* `memo` - The initial state of the reduction.
+* `iterator(memo, item, callback)` - A function applied to each item in the
+ array to produce the next step in the reduction. The `iterator` is passed a
+ `callback(err, reduction)` which accepts an optional error as its first
argument, and the state of the reduction as the second. If an error is
- passed to the callback, the reduction is stopped and the main callback is
+ passed to the callback, the reduction is stopped and the main `callback` is
immediately called with the error.
-* callback(err, result) - A callback which is called after all the iterator
+* `callback(err, result)` - A callback which is called after all the `iterator`
functions have finished. Result is the reduced value.
__Example__
@@ -404,9 +452,9 @@ async.reduce([1,2,3], 0, function(memo, item, callback){
<a name="reduceRight" />
### reduceRight(arr, memo, iterator, callback)
-__Alias:__ foldr
+__Alias:__ `foldr`
-Same as reduce, only operates on the items in the array in reverse order.
+Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
---------------------------------------
@@ -414,23 +462,23 @@ Same as reduce, only operates on the items in the array in reverse order.
<a name="detect" />
### detect(arr, iterator, callback)
-Returns the first value in a list that passes an async truth test. The
-iterator is applied in parallel, meaning the first iterator to return true will
-fire the detect callback with that result. That means the result might not be
-the first item in the original array (in terms of order) that passes the test.
+Returns the first value in `arr` that passes an async truth test. The
+`iterator` is applied in parallel, meaning the first iterator to return `true` will
+fire the detect `callback` with that result. That means the result might not be
+the first item in the original `arr` (in terms of order) that passes the test.
-If order within the original array is important then look at detectSeries.
+If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
__Arguments__
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The iterator is passed a `callback(truthValue)` which must be called with a
boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
+* `callback(result)` - A callback which is called as soon as any iterator returns
+ `true`, or after all the `iterator` functions have finished. Result will be
the first item in the array that passes the truth test (iterator) or the
- value undefined if none passed.
+ value `undefined` if none passed.
__Example__
@@ -445,8 +493,8 @@ async.detect(['file1','file2','file3'], fs.exists, function(result){
<a name="detectSeries" />
### detectSeries(arr, iterator, callback)
-The same as detect, only the iterator is applied to each item in the array
-in series. This means the result is always the first in the original array (in
+The same as [`detect`](#detect), only the `iterator` is applied to each item in `arr`
+in series. This means the result is always the first in the original `arr` (in
terms of array order) that passes the truth test.
@@ -455,18 +503,18 @@ terms of array order) that passes the truth test.
<a name="sortBy" />
### sortBy(arr, iterator, callback)
-Sorts a list by the results of running each value through an async iterator.
+Sorts a list by the results of running each `arr` value through an async `iterator`.
__Arguments__
-* arr - An array to iterate over.
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, sortValue) which must be called once it
- has completed with an error (which can be null) and a value to use as the sort
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, sortValue)` which must be called once it
+ has completed with an error (which can be `null`) and a value to use as the sort
criteria.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is the items from
- the original array sorted by the values returned by the iterator calls.
+* `callback(err, results)` - A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is the items from
+ the original `arr` sorted by the values returned by the `iterator` calls.
__Example__
@@ -481,28 +529,48 @@ async.sortBy(['file1','file2','file3'], function(file, callback){
});
```
+__Sort Order__
+
+By modifying the callback parameter the sorting order can be influenced:
+
+```js
+//ascending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(err, x);
+}, function(err,result){
+ //result callback
+} );
+
+//descending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(err, x*-1); //<- x*-1 instead of x, turns the order around
+}, function(err,result){
+ //result callback
+} );
+```
+
---------------------------------------
<a name="some" />
### some(arr, iterator, callback)
-__Alias:__ any
+__Alias:__ `any`
-Returns true if at least one element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists. Once any iterator
-call returns true, the main callback is immediately called.
+Returns `true` if at least one element in the `arr` satisfies an async test.
+_The callback for each iterator call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. Once any iterator
+call returns `true`, the main `callback` is immediately called.
__Arguments__
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called as soon as any iterator returns
- true, or after all the iterator functions have finished. Result will be
- either true or false depending on the values of the async tests.
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a callback(truthValue) which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - A callback which is called as soon as any iterator returns
+ `true`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
__Example__
@@ -517,21 +585,21 @@ async.some(['file1','file2','file3'], fs.exists, function(result){
<a name="every" />
### every(arr, iterator, callback)
-__Alias:__ all
+__Alias:__ `all`
-Returns true if every element in the array satisfies an async test.
-_The callback for each iterator call only accepts a single argument of true or
-false, it does not accept an error argument first!_ This is in-line with the
-way node libraries work with truth tests like fs.exists.
+Returns `true` if every element in `arr` satisfies an async test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`.
__Arguments__
-* arr - An array to iterate over.
-* iterator(item, callback) - A truth test to apply to each item in the array.
- The iterator is passed a callback(truthValue) which must be called with a
- boolean argument once it has completed.
-* callback(result) - A callback which is called after all the iterator
- functions have finished. Result will be either true or false depending on
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a callback(truthValue) which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - A callback which is called after all the `iterator`
+ functions have finished. Result will be either `true` or `false` depending on
the values of the async tests.
__Example__
@@ -547,20 +615,20 @@ async.every(['file1','file2','file3'], fs.exists, function(result){
<a name="concat" />
### concat(arr, iterator, callback)
-Applies an iterator to each item in a list, concatenating the results. Returns the
-concatenated list. The iterators are called in parallel, and the results are
+Applies `iterator` to each item in `arr`, concatenating the results. Returns the
+concatenated list. The `iterator`s are called in parallel, and the results are
concatenated as they return. There is no guarantee that the results array will
-be returned in the original order of the arguments passed to the iterator function.
+be returned in the original order of `arr` passed to the `iterator` function.
__Arguments__
-* arr - An array to iterate over
-* iterator(item, callback) - A function to apply to each item in the array.
- The iterator is passed a callback(err, results) which must be called once it
- has completed with an error (which can be null) and an array of results.
-* callback(err, results) - A callback which is called after all the iterator
- functions have finished, or an error has occurred. Results is an array containing
- the concatenated results of the iterator function.
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, results)` which must be called once it
+ has completed with an error (which can be `null`) and an array of results.
+* `callback(err, results)` - A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is an array containing
+ the concatenated results of the `iterator` function.
__Example__
@@ -575,7 +643,7 @@ async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
<a name="concatSeries" />
### concatSeries(arr, iterator, callback)
-Same as async.concat, but executes in series instead of parallel.
+Same as [`concat`](#concat), but executes in series instead of parallel.
## Control Flow
@@ -583,26 +651,33 @@ Same as async.concat, but executes in series instead of parallel.
<a name="series" />
### series(tasks, [callback])
-Run an array of functions in series, each one running once the previous
+Run the functions in the `tasks` array in series, each one running once the previous
function has completed. If any functions in the series pass an error to its
-callback, no more functions are run and the callback for the series is
-immediately called with the value of the error. Once the tasks have completed,
-the results are passed to the final callback as an array.
+callback, no more functions are run, and `callback` is immediately called with the value of the error.
+Otherwise, `callback` receives an array of results when `tasks` have completed.
It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
+run as a function, and the results will be passed to the final `callback` as an object
instead of an array. This can be a more readable way of handling results from
-async.series.
+[`series`](#series).
+
+**Note** that while many implementations preserve the order of object properties, the
+[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+explicitly states that
+
+> The mechanics and order of enumerating the properties is not specified.
+So if you rely on the order in which your series of functions are executed, and want
+this to work on all platforms, consider using an array.
__Arguments__
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
+* `tasks` - An array or object containing functions to run, each function is passed
+ a `callback(err, result)` it must call on completion with an error `err` (which can
+ be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
+ the result arguments passed to the `task` callbacks.
__Example__
@@ -646,24 +721,24 @@ function(err, results) {
<a name="parallel" />
### parallel(tasks, [callback])
-Run an array of functions in parallel, without waiting until the previous
+Run the `tasks` array of functions in parallel, without waiting until the previous
function has completed. If any of the functions pass an error to its
-callback, the main callback is immediately called with the value of the error.
-Once the tasks have completed, the results are passed to the final callback as an
+callback, the main `callback` is immediately called with the value of the error.
+Once the `tasks` have completed, the results are passed to the final `callback` as an
array.
It is also possible to use an object instead of an array. Each property will be
-run as a function and the results will be passed to the final callback as an object
+run as a function and the results will be passed to the final `callback` as an object
instead of an array. This can be a more readable way of handling results from
-async.parallel.
+[`parallel`](#parallel).
__Arguments__
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* callback(err, results) - An optional callback to run once all the functions
+* `tasks` - An array or object containing functions to run. Each function is passed
+ a `callback(err, result)` which it must call on completion with an error `err`
+ (which can be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
have completed. This function gets a results array (or object) containing all
the result arguments passed to the task callbacks.
@@ -709,41 +784,41 @@ function(err, results) {
---------------------------------------
-<a name="parallel" />
+<a name="parallelLimit" />
### parallelLimit(tasks, limit, [callback])
-The same as parallel only the tasks are executed in parallel with a maximum of "limit"
-tasks executing at any time.
+The same as [`parallel`](#parallel), only `tasks` are executed in parallel
+with a maximum of `limit` tasks executing at any time.
-Note that the tasks are not executed in batches, so there is no guarantee that
-the first "limit" tasks will complete before any others are started.
+Note that the `tasks` are not executed in batches, so there is no guarantee that
+the first `limit` tasks will complete before any others are started.
__Arguments__
-* tasks - An array or object containing functions to run, each function is passed
- a callback(err, result) it must call on completion with an error (which can
- be null) and an optional result value.
-* limit - The maximum number of tasks to run at any time.
-* callback(err, results) - An optional callback to run once all the functions
+* `tasks` - An array or object containing functions to run, each function is passed
+ a `callback(err, result)` it must call on completion with an error `err` (which can
+ be `null`) and an optional `result` value.
+* `limit` - The maximum number of `tasks` to run at any time.
+* `callback(err, results)` - An optional callback to run once all the functions
have completed. This function gets a results array (or object) containing all
- the result arguments passed to the task callbacks.
+ the result arguments passed to the `task` callbacks.
---------------------------------------
<a name="whilst" />
### whilst(test, fn, callback)
-Repeatedly call fn, while test returns true. Calls the callback when stopped,
+Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
or an error occurs.
__Arguments__
-* test() - synchronous truth test to perform before each execution of fn.
-* fn(callback) - A function to call each time the test passes. The function is
- passed a callback(err) which must be called once it has completed with an
- optional error argument.
-* callback(err) - A callback which is called after the test fails and repeated
- execution of fn has stopped.
+* `test()` - synchronous truth test to perform before each execution of `fn`.
+* `fn(callback)` - A function which is called each time `test` passes. The function is
+ passed a `callback(err)`, which must be called once it has completed with an
+ optional `err` argument.
+* `callback(err)` - A callback which is called after the test fails and repeated
+ execution of `fn` has stopped.
__Example__
@@ -767,51 +842,69 @@ async.whilst(
<a name="doWhilst" />
### doWhilst(fn, test, callback)
-The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
---------------------------------------
<a name="until" />
### until(test, fn, callback)
-Repeatedly call fn, until test returns true. Calls the callback when stopped,
+Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
or an error occurs.
-The inverse of async.whilst.
+The inverse of [`whilst`](#whilst).
---------------------------------------
<a name="doUntil" />
### doUntil(fn, test, callback)
-Like doWhilst except the test is inverted. Note the argument ordering differs from `until`.
+Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
---------------------------------------
<a name="forever" />
-### forever(fn, callback)
+### forever(fn, errback)
+
+Calls the asynchronous function `fn` with a callback parameter that allows it to
+call itself again, in series, indefinitely.
-Calls the asynchronous function 'fn' repeatedly, in series, indefinitely.
-If an error is passed to fn's callback then 'callback' is called with the
-error, otherwise it will never be called.
+If an error is passed to the callback then `errback` is called with the
+error, and execution stops, otherwise it will never be called.
+
+```js
+async.forever(
+ function(next) {
+ // next is suitable for passing to things that need a callback(err [, whatever]);
+ // it will result in this function being called again.
+ },
+ function(err) {
+ // if next is called with a value in its first parameter, it will appear
+ // in here as 'err', and execution will stop.
+ }
+);
+```
---------------------------------------
<a name="waterfall" />
### waterfall(tasks, [callback])
-Runs an array of functions in series, each passing their results to the next in
-the array. However, if any of the functions pass an error to the callback, the
-next function is not executed and the main callback is immediately called with
+Runs the `tasks` array of functions in series, each passing their results to the next in
+the array. However, if any of the `tasks` pass an error to their own callback, the
+next function is not executed, and the main `callback` is immediately called with
the error.
__Arguments__
-* tasks - An array of functions to run, each function is passed a
- callback(err, result1, result2, ...) it must call on completion. The first
- argument is an error (which can be null) and any further arguments will be
+* `tasks` - An array of functions to run, each function is passed a
+ `callback(err, result1, result2, ...)` it must call on completion. The first
+ argument is an error (which can be `null`) and any further arguments will be
passed as arguments in order to the next task.
-* callback(err, [results]) - An optional callback to run once all the functions
+* `callback(err, [results])` - An optional callback to run once all the functions
have completed. This will be passed the results of the last task's callback.
@@ -824,6 +917,7 @@ async.waterfall([
callback(null, 'one', 'two');
},
function(arg1, arg2, callback){
+ // arg1 now equals 'one' and arg2 now equals 'two'
callback(null, 'three');
},
function(arg1, callback){
@@ -841,14 +935,14 @@ async.waterfall([
Creates a function which is a composition of the passed asynchronous
functions. Each function consumes the return value of the function that
-follows. Composing functions f(), g() and h() would produce the result of
-f(g(h())), only this version uses callbacks to obtain the return values.
+follows. Composing functions `f()`, `g()`, and `h()` would produce the result of
+`f(g(h()))`, only this version uses callbacks to obtain the return values.
Each function is executed with the `this` binding of the composed function.
__Arguments__
-* functions... - the asynchronous functions to compose
+* `functions...` - the asynchronous functions to compose
__Example__
@@ -874,19 +968,66 @@ add1mul3(4, function (err, result) {
```
---------------------------------------
+<a name="seq" />
+### seq(fn1, fn2...)
+
+Version of the compose function that is more natural to read.
+Each following function consumes the return value of the latter function.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* functions... - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+// Requires lodash (or underscore), express3 and dresende's orm2.
+// Part of an app, that fetches cats of the logged user.
+// This example uses `seq` function to avoid overnesting and error
+// handling clutter.
+app.get('/cats', function(request, response) {
+ function handleError(err, data, callback) {
+ if (err) {
+ console.error(err);
+ response.json({ status: 'error', message: err.message });
+ }
+ else {
+ callback(data);
+ }
+ }
+ var User = request.models.User;
+ async.seq(
+ _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
+ handleError,
+ function(user, fn) {
+ user.getCats(fn); // 'getCats' has signature (callback(err, data))
+ },
+ handleError,
+ function(cats) {
+ response.json({ status: 'ok', message: 'Cats found', data: cats });
+ }
+ )(req.session.user_id);
+ }
+});
+```
+
+---------------------------------------
<a name="applyEach" />
### applyEach(fns, args..., callback)
-Applies the provided arguments to each function in the array, calling the
-callback after all functions have completed. If you only provide the first
-argument then it will return a function which lets you pass in the
+Applies the provided arguments to each function in the array, calling
+`callback` after all functions have completed. If you only provide the first
+argument, then it will return a function which lets you pass in the
arguments as if it were a single function call.
__Arguments__
-* fns - the asynchronous functions to all call with the same arguments
-* args... - any number of separate arguments to pass to the function
-* callback - the final argument should be the callback, called when all
+* `fns` - the asynchronous functions to all call with the same arguments
+* `args...` - any number of separate arguments to pass to the function
+* `callback` - the final argument should be the callback, called when all
functions have completed processing
@@ -908,42 +1049,50 @@ async.each(
<a name="applyEachSeries" />
### applyEachSeries(arr, iterator, callback)
-The same as applyEach only the functions are applied in series.
+The same as [`applyEach`](#applyEach) only the functions are applied in series.
---------------------------------------
<a name="queue" />
### queue(worker, concurrency)
-Creates a queue object with the specified concurrency. Tasks added to the
-queue will be processed in parallel (up to the concurrency limit). If all
-workers are in progress, the task is queued until one is available. Once
-a worker has completed a task, the task's callback is called.
+Creates a `queue` object with the specified `concurrency`. Tasks added to the
+`queue` are processed in parallel (up to the `concurrency` limit). If all
+`worker`s are in progress, the task is queued until one becomes available.
+Once a `worker` completes a `task`, that `task`'s callback is called.
__Arguments__
-* worker(task, callback) - An asynchronous function for processing a queued
- task, which must call its callback(err) argument when finished, with an
- optional error as an argument.
-* concurrency - An integer for determining how many worker functions should be
+* `worker(task, callback)` - An asynchronous function for processing a queued
+ task, which must call its `callback(err)` argument when finished, with an
+ optional `error` as an argument.
+* `concurrency` - An `integer` for determining how many `worker` functions should be
run in parallel.
__Queue objects__
-The queue object returned by this function has the following properties and
+The `queue` object returned by this function has the following properties and
methods:
-* length() - a function returning the number of items waiting to be processed.
-* concurrency - an integer for determining how many worker functions should be
- run in parallel. This property can be changed after a queue is created to
+* `length()` - a function returning the number of items waiting to be processed.
+* `started` - a function returning whether or not any items have been pushed and processed by the queue
+* `running()` - a function returning the number of items currently being processed.
+* `idle()` - a function returning false if there are items waiting or being processed, or true if not.
+* `concurrency` - an integer for determining how many `worker` functions should be
+ run in parallel. This property can be changed after a `queue` is created to
alter the concurrency on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* unshift(task, [callback]) - add a new task to the front of the queue.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
+* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
+ the `worker` has finished processing the task. Instead of a single task, a `tasks` array
+ can be submitted. The respective callback is used for every task in the list.
+* `unshift(task, [callback])` - add a new task to the front of the `queue`.
+* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
+ and further tasks will be queued.
+* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
+* `paused` - a boolean for determining whether the queue is in a paused state
+* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
+* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
+* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle.
__Example__
@@ -983,39 +1132,56 @@ q.unshift({name: 'bar'}, function (err) {
});
```
+
+---------------------------------------
+
+<a name="priorityQueue" />
+### priorityQueue(worker, concurrency)
+
+The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
+
+* `push(task, priority, [callback])` - `priority` should be a number. If an array of
+ `tasks` is given, all tasks will be assigned the same priority.
+* The `unshift` method was removed.
+
---------------------------------------
<a name="cargo" />
### cargo(worker, [payload])
-Creates a cargo object with the specified payload. Tasks added to the
-cargo will be processed altogether (up to the payload limit). If the
-worker is in progress, the task is queued until it is available. Once
-the worker has completed some tasks, each callback of those tasks is called.
+Creates a `cargo` object with the specified payload. Tasks added to the
+cargo will be processed altogether (up to the `payload` limit). If the
+`worker` is in progress, the task is queued until it becomes available. Once
+the `worker` has completed some tasks, each callback of those tasks is called.
+Check out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work.
+
+While [queue](#queue) passes only one task to one of a group of workers
+at a time, cargo passes an array of tasks to a single worker, repeating
+when the worker is finished.
__Arguments__
-* worker(tasks, callback) - An asynchronous function for processing an array of
- queued tasks, which must call its callback(err) argument when finished, with
- an optional error as an argument.
-* payload - An optional integer for determining how many tasks should be
+* `worker(tasks, callback)` - An asynchronous function for processing an array of
+ queued tasks, which must call its `callback(err)` argument when finished, with
+ an optional `err` argument.
+* `payload` - An optional `integer` for determining how many tasks should be
processed per round; if omitted, the default is unlimited.
__Cargo objects__
-The cargo object returned by this function has the following properties and
+The `cargo` object returned by this function has the following properties and
methods:
-* length() - a function returning the number of items waiting to be processed.
-* payload - an integer for determining how many tasks should be
- process per round. This property can be changed after a cargo is created to
+* `length()` - A function returning the number of items waiting to be processed.
+* `payload` - An `integer` for determining how many tasks should be
+ process per round. This property can be changed after a `cargo` is created to
alter the payload on-the-fly.
-* push(task, [callback]) - add a new task to the queue, the callback is called
- once the worker has finished processing the task.
- instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
-* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
-* empty - a callback that is called when the last item from the queue is given to a worker
-* drain - a callback that is called when the last item from the queue has returned from the worker
+* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
+ once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
+ can be submitted. The respective callback is used for every task in the list.
+* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
+* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
__Example__
@@ -1048,33 +1214,36 @@ cargo.push({name: 'baz'}, function (err) {
<a name="auto" />
### auto(tasks, [callback])
-Determines the best order for running functions based on their requirements.
-Each function can optionally depend on other functions being completed first,
-and each function is run as soon as its requirements are satisfied. If any of
-the functions pass an error to their callback, that function will not complete
-(so any other functions depending on it will not run) and the main callback
-will be called immediately with the error. Functions also receive an object
-containing the results of functions which have completed so far.
+Determines the best order for running the functions in `tasks`, based on their
+requirements. Each function can optionally depend on other functions being completed
+first, and each function is run as soon as its requirements are satisfied.
+
+If any of the functions pass an error to their callback, it will not
+complete (so any other functions depending on it will not run), and the main
+`callback` is immediately called with the error. Functions also receive an
+object containing the results of functions which have completed so far.
+
+Note, all functions are called with a `results` object as a second argument,
+so it is unsafe to pass functions in the `tasks` object which cannot handle the
+extra argument.
-Note, all functions are called with a results object as a second argument,
-so it is unsafe to pass functions in the tasks object which cannot handle the
-extra argument. For example, this snippet of code:
+For example, this snippet of code:
```js
async.auto({
- readData: async.apply(fs.readFile, 'data.txt', 'utf-8');
+ readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
}, callback);
```
-will have the effect of calling readFile with the results object as the last
+will have the effect of calling `readFile` with the results object as the last
argument, which will fail:
```js
fs.readFile('data.txt', 'utf-8', cb, {});
```
-Instead, wrap the call to readFile in a function which does not forward the
-results object:
+Instead, wrap the call to `readFile` in a function which does not forward the
+`results` object:
```js
async.auto({
@@ -1086,40 +1255,51 @@ async.auto({
__Arguments__
-* tasks - An object literal containing named functions or an array of
- requirements, with the function itself the last item in the array. The key
- used for each function or array is used when specifying requirements. The
- function receives two arguments: (1) a callback(err, result) which must be
- called when finished, passing an error (which can be null) and the result of
- the function's execution, and (2) a results object, containing the results of
+* `tasks` - An object. Each of its properties is either a function or an array of
+ requirements, with the function itself the last item in the array. The object's key
+ of a property serves as the name of the task defined by that property,
+ i.e. can be used when specifying requirements for other tasks.
+ The function receives two arguments: (1) a `callback(err, result)` which must be
+ called when finished, passing an `error` (which can be `null`) and the result of
+ the function's execution, and (2) a `results` object, containing the results of
the previously executed functions.
-* callback(err, results) - An optional callback which is called when all the
- tasks have been completed. The callback will receive an error as an argument
- if any tasks pass an error to their callback. Results will always be passed
- but if an error occurred, no other tasks will be performed, and the results
- object will only contain partial results.
-
+* `callback(err, results)` - An optional callback which is called when all the
+ tasks have been completed. It receives the `err` argument if any `tasks`
+ pass an error to their callback. Results are always returned; however, if
+ an error occurs, no further `tasks` will be performed, and the results
+ object will only contain partial results.
+
__Example__
```js
async.auto({
get_data: function(callback){
+ console.log('in get_data');
// async code to get some data
+ callback(null, 'data', 'converted to array');
},
make_folder: function(callback){
+ console.log('in make_folder');
// async code to create a directory to store a file in
// this is run at the same time as getting the data
+ callback(null, 'folder');
},
- write_file: ['get_data', 'make_folder', function(callback){
+ write_file: ['get_data', 'make_folder', function(callback, results){
+ console.log('in write_file', JSON.stringify(results));
// once there is some data and the directory exists,
// write the data to a file in the directory
- callback(null, filename);
+ callback(null, 'filename');
}],
email_link: ['write_file', function(callback, results){
+ console.log('in email_link', JSON.stringify(results));
// once the file is written let's email a link to it...
// results.write_file contains the filename returned by write_file.
+ callback(null, {'file':results.write_file, 'email':'user@example.com'});
}]
+}, function(err, results) {
+ console.log('err = ', err);
+ console.log('results = ', results);
});
```
@@ -1129,28 +1309,79 @@ series functions would look like this:
```js
async.parallel([
function(callback){
+ console.log('in get_data');
// async code to get some data
+ callback(null, 'data', 'converted to array');
},
function(callback){
+ console.log('in make_folder');
// async code to create a directory to store a file in
// this is run at the same time as getting the data
+ callback(null, 'folder');
}
],
function(err, results){
async.series([
function(callback){
+ console.log('in write_file', JSON.stringify(results));
// once there is some data and the directory exists,
// write the data to a file in the directory
+ results.push('filename');
+ callback(null);
},
function(callback){
+ console.log('in email_link', JSON.stringify(results));
// once the file is written let's email a link to it...
+ callback(null, {'file':results.pop(), 'email':'user@example.com'});
}
]);
});
```
-For a complicated series of async tasks using the auto function makes adding
-new tasks much easier and makes the code more readable.
+For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
+new tasks much easier (and the code more readable).
+
+
+---------------------------------------
+
+<a name="retry" />
+### retry([times = 5], task, [callback])
+
+Attempts to get a successful response from `task` no more than `times` times before
+returning an error. If the task is successful, the `callback` will be passed the result
+of the successfull task. If all attemps fail, the callback will be passed the error and
+result (if any) of the final attempt.
+
+__Arguments__
+
+* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.
+* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
+ which must be called when finished, passing `err` (which can be `null`) and the `result` of
+ the function's execution, and (2) a `results` object, containing the results of
+ the previously executed functions (if nested inside another control flow).
+* `callback(err, results)` - An optional callback which is called when the
+ task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
+
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a
+callback, as shown below:
+
+```js
+async.retry(3, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+It can also be embeded within other control flow functions to retry individual methods
+that are not as reliable, like this:
+
+```js
+async.auto({
+ users: api.getUsers.bind(api),
+ payments: async.retry(3, api.getPayments.bind(api))
+}, function(err, results) {
+ // do something with the results
+});
+```
---------------------------------------
@@ -1158,16 +1389,16 @@ new tasks much easier and makes the code more readable.
<a name="iterator" />
### iterator(tasks)
-Creates an iterator function which calls the next function in the array,
+Creates an iterator function which calls the next function in the `tasks` array,
returning a continuation to call the next one after that. It's also possible to
-'peek' the next iterator by doing iterator.next().
+“peek” at the next iterator with `iterator.next()`.
-This function is used internally by the async module but can be useful when
+This function is used internally by the `async` module, but can be useful when
you want to manually control the flow of functions in series.
__Arguments__
-* tasks - An array of functions to run.
+* `tasks` - An array of functions to run.
__Example__
@@ -1194,15 +1425,16 @@ node> nextfn();
<a name="apply" />
### apply(function, arguments..)
-Creates a continuation function with some arguments already applied, a useful
-shorthand when combined with other control flow functions. Any arguments
+Creates a continuation function with some arguments already applied.
+
+Useful as a shorthand when combined with other control flow functions. Any arguments
passed to the returned function are added to the arguments originally passed
to apply.
__Arguments__
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to automatically apply when the
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to automatically apply when the
continuation is called.
__Example__
@@ -1244,16 +1476,16 @@ three
<a name="nextTick" />
### nextTick(callback)
-Calls the callback on a later loop around the event loop. In node.js this just
-calls process.nextTick, in the browser it falls back to setImmediate(callback)
-if available, otherwise setTimeout(callback, 0), which means other higher priority
-events may precede the execution of the callback.
+Calls `callback` on a later loop around the event loop. In Node.js this just
+calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
+if available, otherwise `setTimeout(callback, 0)`, which means other higher priority
+events may precede the execution of `callback`.
This is used internally for browser-compatibility purposes.
__Arguments__
-* callback - The function to call on a later loop around the event loop.
+* `callback` - The function to call on a later loop around the event loop.
__Example__
@@ -1269,13 +1501,13 @@ call_order.push('one')
<a name="times" />
### times(n, callback)
-Calls the callback n times and accumulates results in the same manner
-you would use with async.map.
+Calls the `callback` function `n` times, and accumulates results in the same manner
+you would use with [`map`](#map).
__Arguments__
-* n - The number of times to run the function.
-* callback - The function to call n times.
+* `n` - The number of times to run the function.
+* `callback` - The function to call `n` times.
__Example__
@@ -1299,9 +1531,9 @@ async.times(5, function(n, next){
<a name="timesSeries" />
### timesSeries(n, callback)
-The same as times only the iterator is applied to each item in the array in
-series. The next iterator is only called once the current one has completed
-processing. The results array will be in the same order as the original.
+The same as [`times`](#times), only the iterator is applied to each item in `arr` in
+series. The next `iterator` is only called once the current one has completed.
+The results array will be in the same order as the original.
## Utils
@@ -1309,7 +1541,7 @@ processing. The results array will be in the same order as the original.
<a name="memoize" />
### memoize(fn, [hasher])
-Caches the results of an async function. When creating a hash to store function
+Caches the results of an `async` function. When creating a hash to store function
results against, the callback is omitted from the hash and an optional hash
function can be used.
@@ -1318,9 +1550,9 @@ by `memoize`.
__Arguments__
-* fn - the function you to proxy and cache results from.
-* hasher - an optional function for generating a custom hash for storing
- results, it has all the arguments applied to it apart from the callback, and
+* `fn` - The function to proxy and cache results from.
+* `hasher` - Tn optional function for generating a custom hash for storing
+ results. It has all the arguments applied to it apart from the callback, and
must be synchronous.
__Example__
@@ -1341,25 +1573,25 @@ fn('some name', function () {
<a name="unmemoize" />
### unmemoize(fn)
-Undoes a memoized function, reverting it to the original, unmemoized
-form. Comes handy in tests.
+Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized
+form. Handy for testing.
__Arguments__
-* fn - the memoized function
+* `fn` - the memoized function
<a name="log" />
### log(function, arguments)
-Logs the result of an async function to the console. Only works in node.js or
-in browsers that support console.log and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.log is
+Logs the result of an `async` function to the `console`. Only works in Node.js or
+in browsers that support `console.log` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.log` is
called on each argument in order.
__Arguments__
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
__Example__
@@ -1380,16 +1612,16 @@ node> async.log(hello, 'world');
<a name="dir" />
### dir(function, arguments)
-Logs the result of an async function to the console using console.dir to
-display the properties of the resulting object. Only works in node.js or
-in browsers that support console.dir and console.error (such as FF and Chrome).
-If multiple arguments are returned from the async function, console.dir is
+Logs the result of an `async` function to the `console` using `console.dir` to
+display the properties of the resulting object. Only works in Node.js or
+in browsers that support `console.dir` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.dir` is
called on each argument in order.
__Arguments__
-* function - The function you want to eventually apply all arguments to.
-* arguments... - Any number of arguments to apply to the function.
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
__Example__
@@ -1410,5 +1642,5 @@ node> async.dir(hello, 'world');
<a name="noConflict" />
### noConflict()
-Changes the value of async back to its original value, returning a reference to the
-async object.
+Changes the value of `async` back to its original value, returning a reference to the
+`async` object.
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
index cb6320d6a..01e8afcc4 100755
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
@@ -1,3 +1,11 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+/*jshint onevar: false, indent:4 */
/*global setImmediate: false, setTimeout: false, console: false */
(function () {
@@ -27,6 +35,12 @@
//// cross-browser compatiblity functions ////
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
var _each = function (arr, iterator) {
if (arr.forEach) {
return arr.forEach(iterator);
@@ -91,7 +105,10 @@
else {
async.nextTick = process.nextTick;
if (typeof setImmediate !== 'undefined') {
- async.setImmediate = setImmediate;
+ async.setImmediate = function (fn) {
+ // not a direct alias for IE10 compatibility
+ setImmediate(fn);
+ };
}
else {
async.setImmediate = async.nextTick;
@@ -105,19 +122,20 @@
}
var completed = 0;
_each(arr, function (x) {
- iterator(x, only_once(function (err) {
- if (err) {
- callback(err);
- callback = function () {};
- }
- else {
- completed += 1;
- if (completed >= arr.length) {
- callback(null);
- }
- }
- }));
+ iterator(x, only_once(done) );
});
+ function done(err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed >= arr.length) {
+ callback();
+ }
+ }
+ }
};
async.forEach = async.each;
@@ -136,7 +154,7 @@
else {
completed += 1;
if (completed >= arr.length) {
- callback(null);
+ callback();
}
else {
iterate();
@@ -216,18 +234,26 @@
var _asyncMap = function (eachfn, arr, iterator, callback) {
- var results = [];
arr = _map(arr, function (x, i) {
return {index: i, value: x};
});
- eachfn(arr, function (x, callback) {
- iterator(x.value, function (err, v) {
- results[x.index] = v;
- callback(err);
+ if (!callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err) {
+ callback(err);
+ });
});
- }, function (err) {
- callback(err, results);
- });
+ } else {
+ var results = [];
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err, v) {
+ results[x.index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
};
async.map = doParallel(_asyncMap);
async.mapSeries = doSeries(_asyncMap);
@@ -393,8 +419,9 @@
async.auto = function (tasks, callback) {
callback = callback || function () {};
var keys = _keys(tasks);
- if (!keys.length) {
- return callback(null);
+ var remainingTasks = keys.length
+ if (!remainingTasks) {
+ return callback();
}
var results = {};
@@ -412,20 +439,24 @@
}
};
var taskComplete = function () {
+ remainingTasks--
_each(listeners.slice(0), function (fn) {
fn();
});
};
addListener(function () {
- if (_keys(results).length === keys.length) {
- callback(null, results);
+ if (!remainingTasks) {
+ var theCallback = callback;
+ // prevent final callback from calling itself if it errors
callback = function () {};
+
+ theCallback(null, results);
}
});
_each(keys, function (k) {
- var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
var taskCallback = function (err) {
var args = Array.prototype.slice.call(arguments, 1);
if (args.length <= 1) {
@@ -467,9 +498,40 @@
});
};
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var attempts = [];
+ // Use defaults if times not passed
+ if (typeof times === 'function') {
+ callback = task;
+ task = times;
+ times = DEFAULT_TIMES;
+ }
+ // Make sure times is a number
+ times = parseInt(times, 10) || DEFAULT_TIMES;
+ var wrappedTask = function(wrappedCallback, wrappedResults) {
+ var retryAttempt = function(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ };
+ while (times) {
+ attempts.push(retryAttempt(task, !(times-=1)));
+ }
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || callback)(data.err, data.result);
+ });
+ }
+ // If a callback is passed, run this as a controll flow
+ return callback ? wrappedTask() : wrappedTask
+ };
+
async.waterfall = function (tasks, callback) {
callback = callback || function () {};
- if (tasks.constructor !== Array) {
+ if (!_isArray(tasks)) {
var err = new Error('First argument to waterfall must be an array of functions');
return callback(err);
}
@@ -502,7 +564,7 @@
var _parallel = function(eachfn, tasks, callback) {
callback = callback || function () {};
- if (tasks.constructor === Array) {
+ if (_isArray(tasks)) {
eachfn.map(tasks, function (fn, callback) {
if (fn) {
fn(function (err) {
@@ -542,7 +604,7 @@
async.series = function (tasks, callback) {
callback = callback || function () {};
- if (tasks.constructor === Array) {
+ if (_isArray(tasks)) {
async.mapSeries(tasks, function (fn, callback) {
if (fn) {
fn(function (err) {
@@ -630,7 +692,8 @@
if (err) {
return callback(err);
}
- if (test()) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (test.apply(null, args)) {
async.doWhilst(iterator, test, callback);
}
else {
@@ -658,7 +721,8 @@
if (err) {
return callback(err);
}
- if (!test()) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (!test.apply(null, args)) {
async.doUntil(iterator, test, callback);
}
else {
@@ -672,9 +736,20 @@
concurrency = 1;
}
function _insert(q, data, pos, callback) {
- if(data.constructor !== Array) {
+ if (!q.started){
+ q.started = true;
+ }
+ if (!_isArray(data)) {
data = [data];
}
+ if(data.length == 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ if (q.drain) {
+ q.drain();
+ }
+ });
+ }
_each(data, function(task) {
var item = {
data: task,
@@ -687,7 +762,7 @@
q.tasks.push(item);
}
- if (q.saturated && q.tasks.length === concurrency) {
+ if (q.saturated && q.tasks.length === q.concurrency) {
q.saturated();
}
async.setImmediate(q.process);
@@ -701,14 +776,20 @@
saturated: null,
empty: null,
drain: null,
+ started: false,
+ paused: false,
push: function (data, callback) {
_insert(q, data, false, callback);
},
+ kill: function () {
+ q.drain = null;
+ q.tasks = [];
+ },
unshift: function (data, callback) {
_insert(q, data, true, callback);
},
process: function () {
- if (workers < q.concurrency && q.tasks.length) {
+ if (!q.paused && workers < q.concurrency && q.tasks.length) {
var task = q.tasks.shift();
if (q.empty && q.tasks.length === 0) {
q.empty();
@@ -733,10 +814,88 @@
},
running: function () {
return workers;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ if (q.paused === true) { return; }
+ q.paused = true;
+ q.process();
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ q.process();
}
};
return q;
};
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ };
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (!q.started){
+ q.started = true;
+ }
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length == 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ if (q.drain) {
+ q.drain();
+ }
+ });
+ }
+ _each(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : null
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.saturated && q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
async.cargo = function (worker, payload) {
var working = false,
@@ -748,8 +907,9 @@
saturated: null,
empty: null,
drain: null,
+ drained: true,
push: function (data, callback) {
- if(data.constructor !== Array) {
+ if (!_isArray(data)) {
data = [data];
}
_each(data, function(task) {
@@ -757,6 +917,7 @@
data: task,
callback: typeof callback === 'function' ? callback : null
});
+ cargo.drained = false;
if (cargo.saturated && tasks.length === payload) {
cargo.saturated();
}
@@ -766,13 +927,14 @@
process: function process() {
if (working) return;
if (tasks.length === 0) {
- if(cargo.drain) cargo.drain();
+ if(cargo.drain && !cargo.drained) cargo.drain();
+ cargo.drained = true;
return;
}
var ts = typeof payload === 'number'
? tasks.splice(0, payload)
- : tasks.splice(0);
+ : tasks.splice(0, tasks.length);
var ds = _map(ts, function (task) {
return task.data;
@@ -840,7 +1002,9 @@
var callback = args.pop();
var key = hasher.apply(null, args);
if (key in memo) {
- callback.apply(null, memo[key]);
+ async.nextTick(function () {
+ callback.apply(null, memo[key]);
+ });
}
else if (key in queues) {
queues[key].push(callback);
@@ -884,8 +1048,8 @@
return async.mapSeries(counter, iterator, callback);
};
- async.compose = function (/* functions... */) {
- var fns = Array.prototype.reverse.call(arguments);
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
return function () {
var that = this;
var args = Array.prototype.slice.call(arguments);
@@ -903,6 +1067,10 @@
};
};
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
var _applyEach = function (eachfn, fns /*args...*/) {
var go = function () {
var that = this;
@@ -937,16 +1105,16 @@
next();
};
+ // Node.js
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = async;
+ }
// AMD / RequireJS
- if (typeof define !== 'undefined' && define.amd) {
+ else if (typeof define !== 'undefined' && define.amd) {
define([], function () {
return async;
});
}
- // Node.js
- else if (typeof module !== 'undefined' && module.exports) {
- module.exports = async;
- }
// included directly via <script> tag
else {
root.async = async;
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
index 4ea129e1c..bdbe74010 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
@@ -5,7 +5,7 @@
"author": {
"name": "Caolan McMahon"
},
- "version": "0.2.9",
+ "version": "0.9.0",
"repository": {
"type": "git",
"url": "https://github.com/caolan/async.git"
@@ -35,9 +35,26 @@
"scripts": {
"test": "nodeunit test/test-async.js"
},
- "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser. Also supports [component](https://github.com/component/component).\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, each…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n```javascript\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n\nasync.parallel([\n function(){ ... },\n function(){ ... }\n], callback);\n\nasync.series([\n function(){ ... },\n function(){ ... }\n]);\n```\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n## Common Pitfalls\n\n### Binding a context to an iterator\n\nThis section is really about bind, not about async. If you are wondering how to\nmake async execute your iterators in a given context, or are confused as to why\na method of another library isn't working as an iterator, study this example:\n\n```js\n// Here is a simple object with an (unnecessarily roundabout) squaring method\nvar AsyncSquaringLibrary = {\n squareExponent: 2,\n square: function(number, callback){ \n var result = Math.pow(number, this.squareExponent);\n setTimeout(function(){\n callback(null, result);\n }, 200);\n }\n};\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){\n // result is [NaN, NaN, NaN]\n // This fails because the `this.squareExponent` expression in the square\n // function is not evaluated in the context of AsyncSquaringLibrary, and is\n // therefore undefined.\n});\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){\n // result is [1, 4, 9]\n // With the help of bind we can attach a context to the iterator before\n // passing it to async. Now the square function will be executed in its \n // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`\n // will be as expected.\n});\n```\n\n## Download\n\nThe source is available for download from\n[GitHub](http://github.com/caolan/async).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed\n\n## In the Browser\n\nSo far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n```html\n<script type=\"text/javascript\" src=\"async.js\"></script>\n<script type=\"text/javascript\">\n\n async.map(data, asyncProcess, function(err, results){\n alert(results);\n });\n\n</script>\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n<a name=\"forEach\" />\n<a name=\"each\" />\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n<a name=\"forEachSeries\" />\n<a name=\"eachSeries\" />\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n<a name=\"forEachLimit\" />\n<a name=\"eachLimit\" />\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n<a name=\"map\" />\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n<a name=\"mapSeries\" />\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n<a name=\"mapLimit\" />\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n<a name=\"filter\" />\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n<a name=\"filterSeries\" />\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n<a name=\"reject\" />\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n<a name=\"rejectSeries\" />\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n<a name=\"reduce\" />\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n<a name=\"reduceRight\" />\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n<a name=\"detect\" />\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n<a name=\"detectSeries\" />\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n<a name=\"sortBy\" />\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n<a name=\"some\" />\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n<a name=\"every\" />\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n<a name=\"concat\" />\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n<a name=\"concatSeries\" />\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n<a name=\"series\" />\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n<a name=\"parallel\" />\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n<a name=\"parallel\" />\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n<a name=\"whilst\" />\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n<a name=\"doWhilst\" />\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n<a name=\"until\" />\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n<a name=\"doUntil\" />\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n<a name=\"forever\" />\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n<a name=\"waterfall\" />\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n<a name=\"compose\" />\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n<a name=\"applyEach\" />\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n<a name=\"applyEachSeries\" />\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n<a name=\"queue\" />\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n<a name=\"cargo\" />\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n queued tasks, which must call its callback(err) argument when finished, with \n an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i<tasks.length; i++){\n console.log('hello ' + tasks[i].name);\n }\n callback();\n}, 2);\n\n\n// add some items\n\ncargo.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\ncargo.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\ncargo.push({name: 'baz'}, function (err) {\n console.log('finished processing baz');\n});\n```\n\n---------------------------------------\n\n<a name=\"auto\" />\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8');\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n<a name=\"iterator\" />\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n<a name=\"apply\" />\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n<a name=\"nextTick\" />\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n<a name=\"times\" />\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n<a name=\"timesSeries\" />\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n<a name=\"memoize\" />\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n<a name=\"unmemoize\" />\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n<a name=\"log\" />\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n<a name=\"dir\" />\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n<a name=\"noConflict\" />\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n",
- "readmeFilename": "README.md",
"homepage": "https://github.com/caolan/async",
- "_id": "async@0.2.9",
- "_from": "async@~0.2.9"
+ "_id": "async@0.9.0",
+ "dist": {
+ "shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
+ "tarball": "http://registry.npmjs.org/async/-/async-0.9.0.tgz"
+ },
+ "_from": "async@~0.9.0",
+ "_npmVersion": "1.4.3",
+ "_npmUser": {
+ "name": "caolan",
+ "email": "caolan.mcmahon@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "caolan",
+ "email": "caolan@caolanmcmahon.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
+ "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore
deleted file mode 100644
index aba34f012..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.un~
-/node_modules
-/test/tmp
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile
deleted file mode 100644
index b4ff85a33..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-SHELL := /bin/bash
-
-test:
- @./test/run.js
-
-.PHONY: test
-
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md
index 1a9999eb0..8043cb48a 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md
@@ -1,4 +1,4 @@
-# combined-stream
+# combined-stream [![Build Status](https://travis-ci.org/felixge/node-combined-stream.svg?branch=master)](https://travis-ci.org/felixge/node-combined-stream)
A stream that emits multiple other streams one after another.
@@ -70,19 +70,19 @@ Returns a new combined stream object. Available options are:
The effect of those options is described below.
-### combinedStream.pauseStreams = true
+### combinedStream.pauseStreams = `true`
Whether to apply back pressure to the underlaying streams. If set to `false`,
the underlaying streams will never be paused. If set to `true`, the
underlaying streams will be paused right after being appended, as well as when
`delayedStream.pipe()` wants to throttle.
-### combinedStream.maxDataSize = 2 * 1024 * 1024
+### combinedStream.maxDataSize = `2 * 1024 * 1024`
The maximum amount of bytes (or characters) to buffer for all source streams.
If this value is exceeded, `combinedStream` emits an `'error'` event.
-### combinedStream.dataSize = 0
+### combinedStream.dataSize = `0`
The amount of bytes (or characters) currently buffered by `combinedStream`.
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js
index 32849fd10..c18ad980d 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js
@@ -62,6 +62,7 @@ CombinedStream.prototype.append = function(stream) {
CombinedStream.prototype.pipe = function(dest, options) {
Stream.prototype.pipe.call(this, dest, options);
this.resume();
+ return dest;
};
CombinedStream.prototype._getNext = function() {
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
index 38341b8a0..cbafd00ee 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
@@ -21,11 +21,22 @@
"fake": "0.2.0",
"far": "0.0.1"
},
- "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n var delayed = DelayedStream.create(req);\n\n setTimeout(function() {\n res.writeHead(200);\n delayed.pipe(res);\n }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n // Emit all buffered events and resume underlaying source\n delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n",
- "readmeFilename": "Readme.md",
+ "_id": "delayed-stream@0.0.5",
+ "_engineSupported": true,
+ "_npmVersion": "1.0.3",
+ "_nodeVersion": "v0.4.9-pre",
+ "_defaultsLoaded": true,
+ "dist": {
+ "shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
+ "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
+ },
+ "scripts": {},
+ "directories": {},
+ "_shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
+ "_from": "delayed-stream@0.0.5",
+ "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz",
"bugs": {
"url": "https://github.com/felixge/node-delayed-stream/issues"
},
- "_id": "delayed-stream@0.0.5",
- "_from": "delayed-stream@0.0.5"
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
index 0dd414162..37c37314c 100644
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
@@ -6,27 +6,56 @@
},
"name": "combined-stream",
"description": "A stream that emits multiple other streams one after another.",
- "version": "0.0.4",
+ "version": "0.0.5",
"homepage": "https://github.com/felixge/node-combined-stream",
"repository": {
"type": "git",
"url": "git://github.com/felixge/node-combined-stream.git"
},
"main": "./lib/combined_stream",
+ "scripts": {
+ "test": "node test/run.js"
+ },
"engines": {
- "node": "*"
+ "node": ">= 0.8"
},
"dependencies": {
"delayed-stream": "0.0.5"
},
"devDependencies": {
- "far": "0.0.1"
+ "far": "~0.0.7"
},
- "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = true\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = 2 * 1024 * 1024\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = 0\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n",
- "readmeFilename": "Readme.md",
+ "gitHead": "19d9bdd4c20f6806c2ae8adb00a53fb6fd154740",
"bugs": {
"url": "https://github.com/felixge/node-combined-stream/issues"
},
- "_id": "combined-stream@0.0.4",
- "_from": "combined-stream@~0.0.4"
+ "_id": "combined-stream@0.0.5",
+ "_shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2",
+ "_from": "combined-stream@~0.0.4",
+ "_npmVersion": "1.4.14",
+ "_npmUser": {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ "maintainers": [
+ {
+ "name": "felixge",
+ "email": "felix@debuggable.com"
+ },
+ {
+ "name": "celer",
+ "email": "celer@scrypt.net"
+ },
+ {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ }
+ ],
+ "dist": {
+ "shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2",
+ "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.5.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js
deleted file mode 100644
index 81543485e..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var common = module.exports;
-
-var path = require('path');
-var fs = require('fs');
-var root = path.join(__dirname, '..');
-
-common.dir = {
- fixture: root + '/test/fixture',
- tmp: root + '/test/tmp',
-};
-
-// Create tmp directory if it does not exist
-// Not using fs.exists so as to be node 0.6.x compatible
-try {
- fs.statSync(common.dir.tmp);
-}
-catch (e) {
- // Dir does not exist
- fs.mkdirSync(common.dir.tmp);
-}
-
-common.CombinedStream = require(root);
-common.assert = require('assert');
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt
deleted file mode 100644
index 50e0218df..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt
+++ /dev/null
@@ -1,256 +0,0 @@
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
-10101010101010101010101010101010101010101010101010101010101010101010101010101010
-01010101010101010101010101010101010101010101010101010101010101010101010101010101
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt
deleted file mode 100644
index da1d821fe..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt
+++ /dev/null
@@ -1,256 +0,0 @@
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
-20202020202020202020202020202020202020202020202020202020202020202020202020202020
-02020202020202020202020202020202020202020202020202020202020202020202020202020202
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js
deleted file mode 100644
index 44ecabab6..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-var fs = require('fs');
-
-var FILE1 = common.dir.fixture + '/file1.txt';
-var FILE2 = common.dir.fixture + '/file2.txt';
-var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
-
-(function testDelayedStreams() {
- var combinedStream = CombinedStream.create();
- combinedStream.append(function(next) {
- next(fs.createReadStream(FILE1));
- });
- combinedStream.append(function(next) {
- next(fs.createReadStream(FILE2));
- });
-
- var tmpFile = common.dir.tmp + '/combined.txt';
- var dest = fs.createWriteStream(tmpFile);
- combinedStream.pipe(dest);
-
- dest.on('end', function() {
- var written = fs.readFileSync(tmpFile, 'utf8');
- assert.strictEqual(written, EXPECTED);
- });
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js
deleted file mode 100644
index e3fbd1842..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js
+++ /dev/null
@@ -1,34 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-
-(function testDataSizeGetter() {
- var combinedStream = CombinedStream.create();
-
- assert.strictEqual(combinedStream.dataSize, 0);
-
- // Test one stream
- combinedStream._streams.push({dataSize: 10});
- combinedStream._updateDataSize();
- assert.strictEqual(combinedStream.dataSize, 10);
-
- // Test two streams
- combinedStream._streams.push({dataSize: 23});
- combinedStream._updateDataSize();
- assert.strictEqual(combinedStream.dataSize, 33);
-
- // Test currentStream
- combinedStream._currentStream = {dataSize: 20};
- combinedStream._updateDataSize();
- assert.strictEqual(combinedStream.dataSize, 53);
-
- // Test currentStream without dataSize
- combinedStream._currentStream = {};
- combinedStream._updateDataSize();
- assert.strictEqual(combinedStream.dataSize, 33);
-
- // Test stream function
- combinedStream._streams.push(function() {});
- combinedStream._updateDataSize();
- assert.strictEqual(combinedStream.dataSize, 33);
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js
deleted file mode 100644
index c678575c0..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js
+++ /dev/null
@@ -1,38 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-var fs = require('fs');
-
-var FILE1 = common.dir.fixture + '/file1.txt';
-var BUFFER = new Buffer('Bacon is delicious');
-var FILE2 = common.dir.fixture + '/file2.txt';
-var STRING = 'The € kicks the $\'s ass!';
-
-var EXPECTED =
- fs.readFileSync(FILE1)
- + BUFFER
- + fs.readFileSync(FILE2)
- + STRING;
-var GOT;
-
-(function testDelayedStreams() {
- var combinedStream = CombinedStream.create();
- combinedStream.append(fs.createReadStream(FILE1));
- combinedStream.append(BUFFER);
- combinedStream.append(fs.createReadStream(FILE2));
- combinedStream.append(function(next) {
- next(STRING);
- });
-
- var tmpFile = common.dir.tmp + '/combined-file1-buffer-file2-string.txt';
- var dest = fs.createWriteStream(tmpFile);
- combinedStream.pipe(dest);
-
- dest.on('close', function() {
- GOT = fs.readFileSync(tmpFile, 'utf8');
- });
-})();
-
-process.on('exit', function() {
- assert.strictEqual(GOT, EXPECTED);
-});
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js
deleted file mode 100644
index 263cfdf72..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js
+++ /dev/null
@@ -1,35 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-var fs = require('fs');
-
-var FILE1 = common.dir.fixture + '/file1.txt';
-var FILE2 = common.dir.fixture + '/file2.txt';
-var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
-var GOT;
-
-(function testDelayedStreams() {
- var combinedStream = CombinedStream.create();
- combinedStream.append(fs.createReadStream(FILE1));
- combinedStream.append(fs.createReadStream(FILE2));
-
- var stream1 = combinedStream._streams[0];
- var stream2 = combinedStream._streams[1];
-
- stream1.on('end', function() {
- assert.equal(stream2.dataSize, 0);
- });
-
- var tmpFile = common.dir.tmp + '/combined.txt';
- var dest = fs.createWriteStream(tmpFile);
- combinedStream.pipe(dest);
-
- dest.on('close', function() {
- GOT = fs.readFileSync(tmpFile, 'utf8');
- });
-})();
-
-process.on('exit', function() {
- console.error(GOT.length, EXPECTED.length);
- assert.strictEqual(GOT, EXPECTED);
-});
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js
deleted file mode 100644
index c3d288d01..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js
+++ /dev/null
@@ -1,39 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-var util = require('util');
-var Stream = require('stream').Stream;
-
-var s = CombinedStream.create();
-
-
-function StringStream(){
- this.writable=true;
- this.str=""
-}
-util.inherits(StringStream,Stream);
-
-StringStream.prototype.write=function(chunk,encoding){
- this.str+=chunk.toString();
- this.emit('data',chunk);
-}
-
-StringStream.prototype.end=function(chunk,encoding){
- this.emit('end');
-}
-
-StringStream.prototype.toString=function(){
- return this.str;
-}
-
-
-s.append("foo.");
-s.append("");
-s.append("bar");
-
-var ss = new StringStream();
-
-s.pipe(ss);
-s.resume();
-
-assert.equal(ss.toString(),"foo.bar");
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js
deleted file mode 100644
index aefa36e6b..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var fs = require('fs');
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-var FILE1 = common.dir.fixture + '/file1.txt';
-var fileStream = fs.createReadStream(FILE1);
-
-var foo = function(){};
-
-(function testIsStreamLike() {
- assert(! CombinedStream.isStreamLike(true));
- assert(! CombinedStream.isStreamLike("I am a string"));
- assert(! CombinedStream.isStreamLike(7));
- assert(! CombinedStream.isStreamLike(foo));
-
- assert(CombinedStream.isStreamLike(fileStream));
-})(); \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js
deleted file mode 100644
index 25f47a47c..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js
+++ /dev/null
@@ -1,24 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-var fs = require('fs');
-
-var FILE1 = common.dir.fixture + '/file1.txt';
-var FILE2 = common.dir.fixture + '/file2.txt';
-var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
-
-(function testDelayedStreams() {
- var combinedStream = CombinedStream.create({pauseStreams: false, maxDataSize: 20736});
- combinedStream.append(fs.createReadStream(FILE1));
- combinedStream.append(fs.createReadStream(FILE2));
-
- var gotErr = null;
- combinedStream.on('error', function(err) {
- gotErr = err;
- });
-
- process.on('exit', function() {
- assert.ok(gotErr);
- assert.ok(gotErr.message.match(/bytes/));
- });
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js
deleted file mode 100644
index 30a3a6f84..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js
+++ /dev/null
@@ -1,30 +0,0 @@
-var common = require('../common');
-var assert = common.assert;
-var CombinedStream = common.CombinedStream;
-var fs = require('fs');
-
-var FILE1 = common.dir.fixture + '/file1.txt';
-var FILE2 = common.dir.fixture + '/file2.txt';
-var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
-
-(function testDelayedStreams() {
- var combinedStream = CombinedStream.create({pauseStreams: false});
- combinedStream.append(fs.createReadStream(FILE1));
- combinedStream.append(fs.createReadStream(FILE2));
-
- var stream1 = combinedStream._streams[0];
- var stream2 = combinedStream._streams[1];
-
- stream1.on('end', function() {
- assert.ok(stream2.dataSize > 0);
- });
-
- var tmpFile = common.dir.tmp + '/combined.txt';
- var dest = fs.createWriteStream(tmpFile);
- combinedStream.pipe(dest);
-
- dest.on('end', function() {
- var written = fs.readFileSync(tmpFile, 'utf8');
- assert.strictEqual(written, EXPECTED);
- });
-})();
diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js
deleted file mode 100755
index 0bb8e8224..000000000
--- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env node
-var far = require('far').create();
-
-far.add(__dirname);
-far.include(/test-.*\.js$/);
-
-far.execute();
diff --git a/deps/npm/node_modules/request/node_modules/mime/LICENSE b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE
index 451fc4550..451fc4550 100644
--- a/deps/npm/node_modules/request/node_modules/mime/LICENSE
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/LICENSE
diff --git a/deps/npm/node_modules/request/node_modules/mime/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/README.md
index 6ca19bd1e..6ca19bd1e 100644
--- a/deps/npm/node_modules/request/node_modules/mime/README.md
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/README.md
diff --git a/deps/npm/node_modules/request/node_modules/mime/mime.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/mime.js
index 48be0c5e4..48be0c5e4 100644
--- a/deps/npm/node_modules/request/node_modules/mime/mime.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/mime.js
diff --git a/deps/npm/node_modules/request/node_modules/mime/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json
index a97593921..259822b78 100644
--- a/deps/npm/node_modules/request/node_modules/mime/package.json
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json
@@ -30,7 +30,29 @@
"bugs": {
"url": "https://github.com/broofa/node-mime/issues"
},
- "homepage": "https://github.com/broofa/node-mime",
"_id": "mime@1.2.11",
- "_from": "mime@~1.2.9"
+ "dist": {
+ "shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10",
+ "tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz"
+ },
+ "_from": "mime@~1.2.11",
+ "_npmVersion": "1.3.6",
+ "_npmUser": {
+ "name": "broofa",
+ "email": "robert@broofa.com"
+ },
+ "maintainers": [
+ {
+ "name": "broofa",
+ "email": "robert@broofa.com"
+ },
+ {
+ "name": "bentomas",
+ "email": "benjamin@benjaminthomas.org"
+ }
+ ],
+ "directories": {},
+ "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10",
+ "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz",
+ "homepage": "https://github.com/broofa/node-mime"
}
diff --git a/deps/npm/node_modules/request/node_modules/mime/test.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/test.js
index 2cda1c7ad..2cda1c7ad 100644
--- a/deps/npm/node_modules/request/node_modules/mime/test.js
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/test.js
diff --git a/deps/npm/node_modules/request/node_modules/mime/types/mime.types b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types
index da8cd6918..da8cd6918 100644
--- a/deps/npm/node_modules/request/node_modules/mime/types/mime.types
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/mime.types
diff --git a/deps/npm/node_modules/request/node_modules/mime/types/node.types b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types
index 55b2cf794..55b2cf794 100644
--- a/deps/npm/node_modules/request/node_modules/mime/types/node.types
+++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/types/node.types
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 8e5d32562..afda8b6c3 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
@@ -6,7 +6,7 @@
},
"name": "form-data",
"description": "A module to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
- "version": "0.1.2",
+ "version": "0.1.4",
"repository": {
"type": "git",
"url": "git://github.com/felixge/node-form-data.git"
@@ -16,12 +16,12 @@
"test": "node test/run.js"
},
"engines": {
- "node": ">= 0.6"
+ "node": ">= 0.8"
},
"dependencies": {
"combined-stream": "~0.0.4",
"mime": "~1.2.11",
- "async": "~0.2.9"
+ "async": "~0.9.0"
},
"licenses": [
{
@@ -33,14 +33,48 @@
"fake": "~0.2.2",
"far": "~0.0.7",
"formidable": "~1.0.14",
- "request": "~2.27.0"
+ "request": "~2.36.0"
},
- "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n form.append('my_field', 'my value');\n form.append('my_buffer', new Buffer(10));\n form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n // res – response object (http.IncomingMessage) //\n res.resume(); // for node-0.10.x\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n method: 'post',\n host: 'example.org',\n path: '/upload',\n headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n if (err) throw err;\n\n var form = new FormData();\n\n form.append('file', stdout, {\n filename: 'unicycle.jpg',\n contentType: 'image/jpg',\n knownLength: 19806\n });\n\n form.submit('http://example.com/', function(err, res) {\n if (err) throw err;\n console.log('Done');\n });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n host: 'example.com',\n path: '/probably.php?extra=params',\n auth: 'username:password'\n}, function(err, res) {\n console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n",
- "readmeFilename": "Readme.md",
+ "gitHead": "5f5f4809ea685f32658809fa0f13d7eface0e45a",
"bugs": {
"url": "https://github.com/felixge/node-form-data/issues"
},
"homepage": "https://github.com/felixge/node-form-data",
- "_id": "form-data@0.1.2",
- "_from": "form-data@~0.1.0"
+ "_id": "form-data@0.1.4",
+ "_shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12",
+ "_from": "form-data@~0.1.0",
+ "_npmVersion": "1.4.14",
+ "_npmUser": {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ "maintainers": [
+ {
+ "name": "felixge",
+ "email": "felix@debuggable.com"
+ },
+ {
+ "name": "idralyuk",
+ "email": "igor@buran.us"
+ },
+ {
+ "name": "alexindigo",
+ "email": "iam@alexindigo.com"
+ },
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ {
+ "name": "celer",
+ "email": "dtyree77@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12",
+ "tarball": "http://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/form-data/-/form-data-0.1.4.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/.npmignore
index 77ba16cb0..b3bb51763 100644
--- a/deps/npm/node_modules/request/node_modules/hawk/.npmignore
+++ b/deps/npm/node_modules/request/node_modules/hawk/.npmignore
@@ -1,18 +1,18 @@
-.idea
-*.iml
-npm-debug.log
-dump.rdb
-node_modules
-results.tap
-results.xml
-npm-shrinkwrap.json
-config.json
-.DS_Store
-*/.DS_Store
-*/*/.DS_Store
-._*
-*/._*
-*/*/._*
-coverage.*
-lib-cov
-
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
diff --git a/deps/npm/node_modules/request/node_modules/hawk/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/.travis.yml
index 047f7e3d5..40ca59eee 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/.travis.yml
+++ b/deps/npm/node_modules/request/node_modules/hawk/.travis.yml
@@ -1,5 +1,5 @@
-language: node_js
-
-node_js:
- - 0.10
-
+language: node_js
+
+node_js:
+ - 0.10
+
diff --git a/deps/npm/node_modules/request/node_modules/hawk/README.md b/deps/npm/node_modules/request/node_modules/hawk/README.md
index 010bac6d0..36312f4fe 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/README.md
+++ b/deps/npm/node_modules/request/node_modules/hawk/README.md
@@ -548,11 +548,9 @@ and suggestions.
### Where can I find **Hawk** implementations in other languages?
-**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, others are actively porting it to other
-platforms. There is already a [PHP](https://github.com/alexbilbie/PHP-Hawk),
-[.NET](https://github.com/pcibraro/hawknet), and [JAVA](https://github.com/wealdtech/hawk) libraries available. The full list
-is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port). Please add an issue if you are working on another
-port. A cross-platform test-suite is in the works.
+**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, it has been ported to other languages.
+The full list is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port&state=closed). Please add an issue if you are
+working on another port. A cross-platform test-suite is in the works.
### Why isn't the algorithm part of the challenge or dynamically negotiated?
diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/browser.js b/deps/npm/node_modules/request/node_modules/hawk/lib/browser.js
index 27494f23f..1ff0cd328 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/lib/browser.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/lib/browser.js
@@ -24,17 +24,17 @@ hawk.client = {
uri: 'http://example.com/resource?a=b'
method: HTTP verb (e.g. 'GET', 'POST')
options: {
-
+
// Required
-
+
credentials: {
id: 'dh37fgj492je',
key: 'aoijedoaijsdlaksjdl',
algorithm: 'sha256' // 'sha1', 'sha256'
},
-
+
// Optional
-
+
ext: 'application-specific', // Application specific data sent via the ext attribute
timestamp: Date.now() / 1000, // A pre-calculated timestamp in seconds
nonce: '2334f34f', // A pre-generated nonce
@@ -60,6 +60,7 @@ hawk.client = {
!method || typeof method !== 'string' ||
!options || typeof options !== 'object') {
+ result.err = 'Invalid argument type';
return result;
}
@@ -75,11 +76,12 @@ hawk.client = {
!credentials.key ||
!credentials.algorithm) {
- // Invalid credential object
+ result.err = 'Invalid credential object';
return result;
}
if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
return result;
}
@@ -267,6 +269,20 @@ hawk.client = {
};
return result;
+ },
+
+ authenticateTimestamp: function (message, credentials, updateClock) { // updateClock defaults to true
+
+ var tsm = hawk.crypto.calculateTsMac(message.ts, credentials);
+ if (tsm !== message.tsm) {
+ return false;
+ }
+
+ if (updateClock !== false) {
+ hawk.utils.setNtpOffset(message.ts - Math.floor(Date.now() / 1000)); // Keep offset at 1 second precision
+ }
+
+ return true;
}
};
@@ -351,7 +367,13 @@ hawk.utils = {
setNtpOffset: function (offset) {
- hawk.utils.storage.setItem('hawk_ntp_offset', offset);
+ try {
+ hawk.utils.storage.setItem('hawk_ntp_offset', offset);
+ }
+ catch (err) {
+ console.error('[hawk] could not write to storage.');
+ console.error(err);
+ }
},
getNtpOffset: function () {
diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/client.js b/deps/npm/node_modules/request/node_modules/hawk/lib/client.js
index 41984582a..1002a9d51 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/lib/client.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/lib/client.js
@@ -54,6 +54,7 @@ exports.header = function (uri, method, options) {
!method || typeof method !== 'string' ||
!options || typeof options !== 'object') {
+ result.err = 'Invalid argument type';
return result;
}
@@ -69,11 +70,12 @@ exports.header = function (uri, method, options) {
!credentials.key ||
!credentials.algorithm) {
- // Invalid credential object
+ result.err = 'Invalid credential object';
return result;
}
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+ result.err = 'Unknown algorithm';
return result;
}
@@ -156,6 +158,8 @@ exports.authenticate = function (res, credentials, artifacts, options) {
return false;
}
+ // Validate server timestamp (not used to update clock since it is done via the SNPT client)
+
if (attributes.ts) {
var tsm = Crypto.calculateTsMac(attributes.ts, credentials);
if (tsm !== attributes.tsm) {
diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js b/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js
index 150340a33..9825c7d88 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/lib/crypto.js
@@ -109,3 +109,10 @@ exports.calculateTsMac = function (ts, credentials) {
return hmac.digest('base64');
};
+
+exports.timestampMessage = function (credentials, localtimeOffsetMsec) {
+
+ var now = Math.floor((Utils.now() + (localtimeOffsetMsec || 0)) / 1000);
+ var tsm = exports.calculateTsMac(now, credentials);
+ return { ts: now, tsm: tsm };
+};
diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/index.js b/deps/npm/node_modules/request/node_modules/hawk/lib/index.js
index 1d713cb61..a883882c8 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/lib/index.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/lib/index.js
@@ -2,6 +2,7 @@
exports.error = exports.Error = require('boom');
exports.sntp = require('sntp');
+
exports.server = require('./server');
exports.client = require('./client');
exports.crypto = require('./crypto');
@@ -12,4 +13,3 @@ exports.uri = {
getBewit: exports.client.getBewit
};
-
diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/server.js b/deps/npm/node_modules/request/node_modules/hawk/lib/server.js
index 478c47b39..59464ed02 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/lib/server.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/lib/server.js
@@ -191,9 +191,8 @@ exports.authenticate = function (req, credentialsFunc, options, callback) {
// Check timestamp staleness
if (Math.abs((attributes.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
- var fresh = Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000); // Get fresh now
- var tsm = Crypto.calculateTsMac(fresh, credentials);
- return callback(Boom.unauthorized('Stale timestamp', 'Hawk', { ts: fresh, tsm: tsm }), credentials, artifacts);
+ var tsm = Crypto.timestampMessage(credentials, options.localtimeOffsetMsec);
+ return callback(Boom.unauthorized('Stale timestamp', 'Hawk', tsm), credentials, artifacts);
}
// Successful authentication
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json
index c57a11a39..2406a49a5 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json
@@ -36,12 +36,29 @@
"url": "http://github.com/spumko/boom/raw/master/LICENSE"
}
],
- "readme": "<a href=\"https://github.com/spumko\"><img src=\"https://raw.github.com/spumko/spumko/master/images/from.png\" align=\"right\" /></a>\n![boom Logo](https://raw.github.com/spumko/boom/master/images/boom.png)\n\nHTTP-friendly error objects\n\n[![Build Status](https://secure.travis-ci.org/spumko/boom.png)](http://travis-ci.org/spumko/boom)\n",
- "readmeFilename": "README.md",
+ "_id": "boom@0.4.2",
+ "dist": {
+ "shasum": "7a636e9ded4efcefb19cef4947a3c67dfaee911b",
+ "tarball": "http://registry.npmjs.org/boom/-/boom-0.4.2.tgz"
+ },
+ "_from": "boom@0.4.x",
+ "_npmVersion": "1.2.18",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "7a636e9ded4efcefb19cef4947a3c67dfaee911b",
+ "_resolved": "https://registry.npmjs.org/boom/-/boom-0.4.2.tgz",
"bugs": {
"url": "https://github.com/spumko/boom/issues"
},
- "homepage": "https://github.com/spumko/boom",
- "_id": "boom@0.4.2",
- "_from": "boom@0.4.x"
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/spumko/boom"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
index cc1f73938..c4cd1b234 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
@@ -37,12 +37,29 @@
"url": "http://github.com/hueniverse/cryptiles/raw/master/LICENSE"
}
],
- "readme": "cryptiles\n=========\n\nGeneral purpose crypto utilities\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/cryptiles.png)](http://travis-ci.org/hueniverse/cryptiles)\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/hueniverse/cryptiles/issues"
},
- "homepage": "https://github.com/hueniverse/cryptiles",
"_id": "cryptiles@0.2.2",
- "_from": "cryptiles@0.2.x"
+ "dist": {
+ "shasum": "ed91ff1f17ad13d3748288594f8a48a0d26f325c",
+ "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
+ },
+ "_from": "cryptiles@0.2.x",
+ "_npmVersion": "1.2.24",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "ed91ff1f17ad13d3748288594f8a48a0d26f325c",
+ "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz",
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/hueniverse/cryptiles"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
index e18f14859..4e4eb74b7 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
@@ -38,12 +38,33 @@
"url": "http://github.com/spumko/hoek/raw/master/LICENSE"
}
],
- "readme": "<a href=\"https://github.com/spumko\"><img src=\"https://raw.github.com/spumko/spumko/master/images/from.png\" align=\"right\" /></a>\r\n![hoek Logo](https://raw.github.com/spumko/hoek/master/images/hoek.png)\r\n\r\nGeneral purpose node utilities\r\n\r\n[![Build Status](https://secure.travis-ci.org/spumko/hoek.png)](http://travis-ci.org/spumko/hoek)\r\n\r\n# Table of Contents\r\n\r\n* [Introduction](#introduction \"Introduction\")\r\n* [Object](#object \"Object\")\r\n * [clone](#cloneobj \"clone\")\r\n * [merge](#mergetarget-source-isnulloverride-ismergearrays \"merge\")\r\n * [applyToDefaults](#applytodefaultsdefaults-options \"applyToDefaults\")\r\n * [unique](#uniquearray-key \"unique\")\r\n * [mapToObject](#maptoobjectarray-key \"mapToObject\")\r\n * [intersect](#intersectarray1-array2 \"intersect\")\r\n * [matchKeys](#matchkeysobj-keys \"matchKeys\")\r\n * [flatten](#flattenarray-target \"flatten\")\r\n * [removeKeys](#removekeysobject-keys \"removeKeys\")\r\n * [reach](#reachobj-chain \"reach\")\r\n * [inheritAsync](#inheritasyncself-obj-keys \"inheritAsync\")\r\n * [rename](#renameobj-from-to \"rename\")\r\n* [Timer](#timer \"Timer\")\r\n* [Binary Encoding/Decoding](#binary \"Binary Encoding/Decoding\")\r\n * [base64urlEncode](#binary64urlEncodevalue \"binary64urlEncode\")\r\n * [base64urlDecode](#binary64urlDecodevalue \"binary64urlDecode\")\r\n* [Escaping Characters](#escaped \"Escaping Characters\")\r\n * [escapeHtml](#escapeHtmlstring \"escapeHtml\")\r\n * [escapeHeaderAttribute](#escapeHeaderAttributeattribute \"escapeHeaderAttribute\")\r\n * [escapeRegex](#escapeRegexstring \"escapeRegex\")\r\n* [Errors](#errors \"Errors\")\r\n * [assert](#assertmessage \"assert\")\r\n * [abort](#abortmessage \"abort\")\r\n * [displayStack](#displayStackslice \"displayStack\")\r\n * [callStack](#callStackslice \"callStack\")\r\n * [toss](#tosscondition \"toss\")\r\n* [Load files](#load-files \"Load Files\")\r\n * [loadPackage](#loadPackagedir \"loadpackage\")\r\n * [loadDirModules](#loadDirModulespath-excludefiles-target \"loaddirmodules\")\r\n\r\n\r\n\r\n# Introduction\r\n\r\nThe *Hoek* general purpose node utilities library is used to aid in a variety of manners. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more. \r\n\r\nFor example, to use Hoek to set configuration with default options:\r\n```javascript\r\nvar Hoek = require('hoek');\r\n\r\nvar default = {url : \"www.github.com\", port : \"8000\", debug : true}\r\n\r\nvar config = Hoek.applyToDefaults(default, {port : \"3000\", admin : true});\r\n\r\n// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }\r\n```\r\n\r\nUnder each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the var Hoek = require('hoek') is omitted for brevity.\r\n\r\n## Object\r\n\r\nHoek provides several helpful methods for objects and arrays.\r\n\r\n### clone(obj)\r\n\r\nThis method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects). \r\n\r\n```javascript\r\n\r\nvar nestedObj = {\r\n w: /^something$/ig,\r\n x: {\r\n a: [1, 2, 3],\r\n b: 123456,\r\n c: new Date()\r\n },\r\n y: 'y',\r\n z: new Date()\r\n };\r\n\r\nvar copy = Hoek.clone(nestedObj);\r\n\r\ncopy.x.b = 100;\r\n\r\nconsole.log(copy.y) // results in 'y'\r\nconsole.log(nestedObj.x.b) // results in 123456\r\nconsole.log(copy.x.b) // results in 100\r\n```\r\n\r\n### merge(target, source, isNullOverride, isMergeArrays)\r\nisNullOverride, isMergeArrays default to true\r\n\r\nMerge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied\r\n\r\n\r\n```javascript\r\n\r\nvar target = {a: 1, b : 2}\r\nvar source = {a: 0, c: 5}\r\nvar source2 = {a: null, c: 5}\r\n\r\nvar targetArray = [1, 2, 3];\r\nvar sourceArray = [4, 5];\r\n\r\nvar newTarget = Hoek.merge(target, source); // results in {a: 0, b: 2, c: 5}\r\nnewTarget = Hoek.merge(target, source2); // results in {a: null, b: 2, c: 5}\r\nnewTarget = Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}\r\n\r\nnewTarget = Hoek.merge(targetArray, sourceArray) // results in [1, 2, 3, 4, 5]\r\nnewTarget = Hoek.merge(targetArray, sourceArray, true, false) // results in [4, 5]\r\n\r\n\r\n\r\n\r\n```\r\n\r\n### applyToDefaults(defaults, options)\r\n\r\nApply options to a copy of the defaults\r\n\r\n```javascript\r\n\r\nvar defaults = {host: \"localhost\", port: 8000};\r\nvar options = {port: 8080};\r\n\r\nvar config = Hoek.applyToDefaults(defaults, options); // results in {host: \"localhost\", port: 8080};\r\n\r\n\r\n```\r\n\r\n### unique(array, key)\r\n\r\nRemove duplicate items from Array\r\n\r\n```javascript\r\n\r\nvar array = [1, 2, 2, 3, 3, 4, 5, 6];\r\n\r\nvar newArray = Hoek.unique(array); // results in [1,2,3,4,5,6];\r\n\r\narray = [{id: 1}, {id: 1}, {id: 2}];\r\n\r\nnewArray = Hoek.unique(array, \"id\") // results in [{id: 1}, {id: 2}]\r\n\r\n```\r\n\r\n### mapToObject(array, key)\r\n\r\nConvert an Array into an Object\r\n\r\n```javascript\r\n\r\nvar array = [1,2,3];\r\nvar newObject = Hoek.mapToObject(array); // results in [{\"1\": true}, {\"2\": true}, {\"3\": true}]\r\n\r\narray = [{id: 1}, {id: 2}];\r\nnewObject = Hoek.mapToObject(array, \"id\") // results in [{\"id\": 1}, {\"id\": 2}]\r\n\r\n```\r\n### intersect(array1, array2)\r\n\r\nFind the common unique items in two arrays\r\n\r\n```javascript\r\n\r\nvar array1 = [1, 2, 3];\r\nvar array2 = [1, 4, 5];\r\n\r\nvar newArray = Hoek.intersect(array1, array2) // results in [1]\r\n\r\n```\r\n\r\n### matchKeys(obj, keys) \r\n\r\nFind which keys are present\r\n\r\n```javascript\r\n\r\nvar obj = {a: 1, b: 2, c: 3};\r\nvar keys = [\"a\", \"e\"];\r\n\r\nHoek.matchKeys(obj, keys) // returns [\"a\"]\r\n\r\n```\r\n\r\n### flatten(array, target)\r\n\r\nFlatten an array\r\n\r\n```javascript\r\n\r\nvar array = [1, 2, 3];\r\nvar target = [4, 5]; \r\n\r\nvar flattenedArray = Hoek.flatten(array, target) // results in [4, 5, 1, 2, 3];\r\n\r\n```\r\n\r\n### removeKeys(object, keys)\r\n\r\nRemove keys\r\n\r\n```javascript\r\n\r\nvar object = {a: 1, b: 2, c: 3, d: 4};\r\n\r\nvar keys = [\"a\", \"b\"];\r\n\r\nHoek.removeKeys(object, keys) // object is now {c: 3, d: 4}\r\n\r\n```\r\n\r\n### reach(obj, chain)\r\n\r\nConverts an object key chain string to reference\r\n\r\n```javascript\r\n\r\nvar chain = 'a.b.c';\r\nvar obj = {a : {b : { c : 1}}};\r\n\r\nHoek.reach(obj, chain) // returns 1\r\n\r\n```\r\n\r\n### inheritAsync(self, obj, keys) \r\n\r\nInherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors\r\n\r\n```javascript\r\n\r\nvar targetFunc = function () { };\r\n\r\nvar proto = {\r\n a: function () {\r\n return 'a!';\r\n },\r\n b: function () {\r\n return 'b!';\r\n },\r\n c: function () {\r\n throw new Error('c!');\r\n }\r\n };\r\n\r\nvar keys = ['a', 'c'];\r\n\r\nHoek.inheritAsync(targetFunc, proto, ['a', 'c']);\r\n\r\nvar target = new targetFunc();\r\n\r\ntarget.a(function(err, result){console.log(result)} // returns 'a!' \r\n\r\ntarget.c(function(err, result){console.log(result)} // returns undefined\r\n\r\ntarget.b(function(err, result){console.log(result)} // gives error: Object [object Object] has no method 'b'\r\n\r\n```\r\n\r\n### rename(obj, from, to)\r\n\r\nRename a key of an object\r\n\r\n```javascript\r\n\r\nvar obj = {a : 1, b : 2};\r\n\r\nHoek.rename(obj, \"a\", \"c\"); // obj is now {c : 1, b : 2}\r\n\r\n```\r\n\r\n\r\n# Timer\r\n\r\nA Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\r\n\r\n```javascript\r\n\r\n\r\nexample : \r\n\r\n\r\nvar timerObj = new Hoek.Timer();\r\nconsole.log(\"Time is now: \" + timerObj.ts)\r\nconsole.log(\"Elapsed time from initialization: \" + timerObj.elapsed() + 'milliseconds')\r\n\r\n```\r\n\r\n# Binary Encoding/Decoding\r\n\r\n### base64urlEncode(value)\r\n\r\nEncodes value in Base64 or URL encoding\r\n\r\n### base64urlDecode(value)\r\n\r\nDecodes data in Base64 or URL encoding.\r\n# Escaping Characters\r\n\r\nHoek provides convenient methods for escaping html characters. The escaped characters are as followed:\r\n\r\n```javascript\r\n\r\ninternals.htmlEscaped = {\r\n '&': '&amp;',\r\n '<': '&lt;',\r\n '>': '&gt;',\r\n '\"': '&quot;',\r\n \"'\": '&#x27;',\r\n '`': '&#x60;'\r\n};\r\n\r\n```\r\n\r\n### escapeHtml(string)\r\n\r\n```javascript\r\n\r\nvar string = '<html> hey </html>';\r\nvar escapedString = Hoek.escapeHtml(string); // returns &lt;html&gt; hey &lt;/html&gt;\r\n\r\n```\r\n\r\n### escapeHeaderAttribute(attribute)\r\n\r\nEscape attribute value for use in HTTP header\r\n\r\n```javascript\r\n\r\nvar a = Hoek.escapeHeaderAttribute('I said \"go w\\\\o me\"'); //returns I said \\\"go w\\\\o me\\\"\r\n\r\n\r\n```\r\n\r\n\r\n### escapeRegex(string)\r\n\r\nEscape string for Regex construction\r\n\r\n```javascript\r\n\r\nvar a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\\\/`\"(>)[<]d{}s,'); // returns 4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`\"\\(>\\)\\[<\\]d\\{\\}s\\,\r\n\r\n\r\n\r\n```\r\n\r\n# Errors\r\n\r\n### assert(message)\r\n\r\n```javascript\r\n\r\nvar a = 1, b =2;\r\n\r\nHoek.assert(a === b, 'a should equal b'); // ABORT: a should equal b\r\n\r\n```\r\n\r\n### abort(message)\r\n\r\nFirst checks if process.env.NODE_ENV === 'test', and if so, throws error message. Otherwise,\r\ndisplays most recent stack and then exits process.\r\n\r\n\r\n\r\n### displayStack(slice)\r\n\r\nDisplays the trace stack\r\n\r\n```javascript\r\n\r\nvar stack = Hoek.displayStack();\r\nconsole.log(stack) // returns something like:\r\n\r\n[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',\r\n 'Module._compile (module.js:449:26)',\r\n 'Module._extensions..js (module.js:467:10)',\r\n 'Module.load (module.js:356:32)',\r\n 'Module._load (module.js:312:12)',\r\n 'Module.runMain (module.js:492:10)',\r\n 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]\r\n\r\n```\r\n\r\n### callStack(slice)\r\n\r\nReturns a trace stack array.\r\n\r\n```javascript\r\n\r\nvar stack = Hoek.callStack();\r\nconsole.log(stack) // returns something like:\r\n\r\n[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],\r\n [ 'module.js', 449, 26, 'Module._compile', false ],\r\n [ 'module.js', 467, 10, 'Module._extensions..js', false ],\r\n [ 'module.js', 356, 32, 'Module.load', false ],\r\n [ 'module.js', 312, 12, 'Module._load', false ],\r\n [ 'module.js', 492, 10, 'Module.runMain', false ],\r\n [ 'node.js',\r\n 244,\r\n 9,\r\n 'startup.processNextTick.process._tickCallback',\r\n false ] ]\r\n\r\n\r\n```\r\n\r\n### toss(condition)\r\n\r\ntoss(condition /*, [message], callback */)\r\n\r\nReturn an error as first argument of a callback\r\n\r\n\r\n# Load Files\r\n\r\n### loadPackage(dir)\r\n\r\nLoad and parse package.json process root or given directory\r\n\r\n```javascript\r\n\r\nvar pack = Hoek.loadPackage(); // pack.name === 'hoek'\r\n\r\n```\r\n\r\n### loadDirModules(path, excludeFiles, target) \r\n\r\nLoads modules from a given path; option to exclude files (array).\r\n\r\n\r\n\r\n\r\n",
- "readmeFilename": "README.md",
+ "_id": "hoek@0.9.1",
+ "dist": {
+ "shasum": "3d322462badf07716ea7eb85baf88079cddce505",
+ "tarball": "http://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz"
+ },
+ "_from": "hoek@0.9.x",
+ "_npmVersion": "1.2.18",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ {
+ "name": "thegoleffect",
+ "email": "thegoleffect@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "3d322462badf07716ea7eb85baf88079cddce505",
+ "_resolved": "https://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz",
"bugs": {
"url": "https://github.com/spumko/hoek/issues"
},
- "homepage": "https://github.com/spumko/hoek",
- "_id": "hoek@0.9.1",
- "_from": "hoek@0.9.x"
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/spumko/hoek"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
index 4c4b2f579..c96e8482a 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
+++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
@@ -37,12 +37,29 @@
"url": "http://github.com/hueniverse/sntp/raw/master/LICENSE"
}
],
- "readme": "# sntp\n\nAn SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time\nalong with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset\nto the local time.\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)\n\n# Usage\n\n```javascript\nvar Sntp = require('sntp');\n\n// All options are optional\n\nvar options = {\n host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org\n port: 123, // Defaults to 123 (NTP)\n resolveReference: true, // Default to false (not resolving)\n timeout: 1000 // Defaults to zero (no timeout)\n};\n\n// Request server time\n\nSntp.time(options, function (err, time) {\n\n if (err) {\n console.log('Failed: ' + err.message);\n process.exit(1);\n }\n\n console.log('Local clock is off by: ' + time.t + ' milliseconds');\n process.exit(0);\n});\n```\n\nIf an application needs to maintain continuous time synchronization, the module provides a stateful method for\nquerying the current offset only when the last one is too old (defaults to daily).\n\n```javascript\n// Request offset once\n\nSntp.offset(function (err, offset) {\n\n console.log(offset); // New (served fresh)\n\n // Request offset again\n\n Sntp.offset(function (err, offset) {\n\n console.log(offset); // Identical (served from cache)\n });\n});\n```\n\nTo set a background offset refresh, start the interval and use the provided now() method. If for any reason the\nclient fails to obtain an up-to-date offset, the current system clock is used.\n\n```javascript\nvar before = Sntp.now(); // System time without offset\n\nSntp.start(function () {\n\n var now = Sntp.now(); // With offset\n Sntp.stop();\n});\n```\n\n",
- "readmeFilename": "README.md",
+ "_id": "sntp@0.2.4",
+ "dist": {
+ "shasum": "fb885f18b0f3aad189f824862536bceeec750900",
+ "tarball": "http://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz"
+ },
+ "_from": "sntp@0.2.x",
+ "_npmVersion": "1.2.18",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "fb885f18b0f3aad189f824862536bceeec750900",
+ "_resolved": "https://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz",
"bugs": {
"url": "https://github.com/hueniverse/sntp/issues"
},
- "homepage": "https://github.com/hueniverse/sntp",
- "_id": "sntp@0.2.4",
- "_from": "sntp@0.2.x"
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/hueniverse/sntp"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/package.json b/deps/npm/node_modules/request/node_modules/hawk/package.json
index 16feb783c..fadd7a97f 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/package.json
+++ b/deps/npm/node_modules/request/node_modules/hawk/package.json
@@ -1,7 +1,7 @@
{
"name": "hawk",
"description": "HTTP Hawk Authentication Scheme",
- "version": "1.0.0",
+ "version": "1.1.1",
"author": {
"name": "Eran Hammer",
"email": "eran@hueniverse.com",
@@ -42,12 +42,29 @@
"url": "http://github.com/hueniverse/hawk/raw/master/LICENSE"
}
],
- "readme": "![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png)\n\n<img align=\"right\" src=\"https://raw.github.com/hueniverse/hawk/master/images/logo.png\" /> **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial\nHTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz).\n\nCurrent version: **1.0**\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk)\n\n# Table of Content\n\n- [**Introduction**](#introduction)\n - [Replay Protection](#replay-protection)\n - [Usage Example](#usage-example)\n - [Protocol Example](#protocol-example)\n - [Payload Validation](#payload-validation)\n - [Response Payload Validation](#response-payload-validation)\n - [Browser Support and Considerations](#browser-support-and-considerations)\n<p></p>\n- [**Single URI Authorization**](#single-uri-authorization)\n - [Usage Example](#bewit-usage-example)\n<p></p>\n- [**Security Considerations**](#security-considerations)\n - [MAC Keys Transmission](#mac-keys-transmission)\n - [Confidentiality of Requests](#confidentiality-of-requests)\n - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers)\n - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials)\n - [Entropy of Keys](#entropy-of-keys)\n - [Coverage Limitations](#coverage-limitations)\n - [Future Time Manipulation](#future-time-manipulation)\n - [Client Clock Poisoning](#client-clock-poisoning)\n - [Bewit Limitations](#bewit-limitations)\n - [Host Header Forgery](#host-header-forgery)\n<p></p>\n- [**Frequently Asked Questions**](#frequently-asked-questions)\n<p></p>\n- [**Acknowledgements**](#acknowledgements)\n\n# Introduction\n\n**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with\npartial cryptographic verification of the request and response, covering the HTTP method, request URI, host,\nand optionally the request payload.\n\nSimilar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of\nclient credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme,\nthe key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is\nincluded in its place.\n\nHowever, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of\nreplay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less\n\"chattiness\" (interaction with the server).\n\nAlso unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because\nthe client and server must both have access to the key material in the clear.\n\nThe primary design goals of this scheme are to:\n* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources,\n* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where\n to send an authenticated request), and\n* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client\n failure to validate the server's identity as part of its TLS handshake.\n\nIn addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using\na query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk).\n\nThe **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server,\nwhich is beyond the scope of this module. Typically, the shared credentials are established via an initial\nTLS-protected phase or derived from some other shared confidential information available to both the client\nand the server.\n\n\n## Replay Protection\n\nWithout replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more \nthan once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when \nmaking requests. This gives the server enough information to prevent replay attacks.\n\nThe nonce is generated by the client, and is a string unique across all requests with the same timestamp and\nkey identifier combination. \n\nThe timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards\nare rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks.\nBy default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in\npractice translates to a maximum of 2 minutes as the skew can be positive or negative).\n\nUsing a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client\nclock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types\n(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response\nto a bad timestamp.\n\nThere is no expectation that the client will adjust its system clock to match the server (in fact, this would be a\npotential attack vector). Instead, the client only uses the server's time to calculate an offset used only\nfor communications with that particular server. The protocol rewards clients with synchronized clocks by reducing\nthe number of round trips required to authenticate the first request.\n\n\n## Usage Example\n\nServer code:\n\n```javascript\nvar Http = require('http');\nvar Hawk = require('hawk');\n\n\n// Credentials lookup function\n\nvar credentialsFunc = function (id, callback) {\n\n var credentials = {\n key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n algorithm: 'sha256',\n user: 'Steve'\n };\n\n return callback(null, credentials);\n};\n\n// Create HTTP server\n\nvar handler = function (req, res) {\n\n // Authenticate incoming request\n\n Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {\n\n // Prepare response\n\n var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');\n var headers = { 'Content-Type': 'text/plain' };\n\n // Generate Server-Authorization response header\n\n var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] });\n headers['Server-Authorization'] = header;\n\n // Send the response back\n\n res.writeHead(!err ? 200 : 401, headers);\n res.end(payload);\n });\n};\n\n// Start server\n\nHttp.createServer(handler).listen(8000, 'example.com');\n```\n\nClient code:\n\n```javascript\nvar Request = require('request');\nvar Hawk = require('hawk');\n\n\n// Client credentials\n\nvar credentials = {\n id: 'dh37fgj492je',\n key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n algorithm: 'sha256'\n}\n\n// Request options\n\nvar requestOptions = {\n uri: 'http://example.com:8000/resource/1?b=1&a=2',\n method: 'GET',\n headers: {}\n};\n\n// Generate Authorization request header\n\nvar header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' });\nrequestOptions.headers.Authorization = header.field;\n\n// Send authenticated request\n\nRequest(requestOptions, function (error, response, body) {\n\n // Authenticate the server's response\n\n var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });\n\n // Output results\n\n console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));\n});\n```\n\n**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local\nmachine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method.\n\n```javascript\nHawk.sntp.start();\n```\n\n\n## Protocol Example\n\nThe client attempts to access a protected resource without authentication, sending the following HTTP request to\nthe resource server:\n\n```\nGET /resource/1?b=1&a=2 HTTP/1.1\nHost: example.com:8000\n```\n\nThe resource server returns an authentication challenge.\n\n```\nHTTP/1.1 401 Unauthorized\nWWW-Authenticate: Hawk\n```\n\nThe client has previously obtained a set of **Hawk** credentials for accessing resources on the \"http://example.com/\"\nserver. The **Hawk** credentials issued to the client include the following attributes:\n\n* Key identifier: dh37fgj492je\n* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn\n* Algorithm: sha256\n\nThe client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1,\n1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline\ncharacter):\n\n```\nhawk.1.header\n1353832234\nj4h3g2\nGET\n/resource/1?b=1&a=2\nexample.com\n8000\n\nsome-app-ext-data\n\n```\n\nThe request MAC is calculated using HMAC with the specified hash algorithm \"sha256\" and the key over the normalized request string.\nThe result is base64-encoded to produce the request MAC:\n\n```\n6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=\n```\n\nThe client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using\nthe HTTP `Authorization` request header field:\n\n```\nGET /resource/1?b=1&a=2 HTTP/1.1\nHost: example.com:8000\nAuthorization: Hawk id=\"dh37fgj492je\", ts=\"1353832234\", nonce=\"j4h3g2\", ext=\"some-app-ext-data\", mac=\"6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=\"\n```\n\nThe server validates the request by calculating the request MAC again based on the request received and verifies the validity\nand scope of the **Hawk** credentials. If valid, the server responds with the requested resource.\n\n\n### Payload Validation\n\n**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash\nusing the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character):\n* `hawk.1.payload`\n* the content-type in lowercase, without any parameters (e.g. `application/json`)\n* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability)\n\nFor example:\n\n* Payload: `Thank you for flying Hawk`\n* Content Type: `text/plain`\n* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=`\n\nResults in the following input to the payload hash function (newline terminated values):\n\n```\nhawk.1.payload\ntext/plain\nThank you for flying Hawk\n\n```\n\nWhich produces the following hash value:\n\n```\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\n```\n\nThe client constructs the normalized request string (newline terminated values):\n\n```\nhawk.1.header\n1353832234\nj4h3g2\nPOST\n/resource/1?a=1&b=2\nexample.com\n8000\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\nsome-app-ext-data\n\n```\n\nThen calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data,\nand request MAC, with the request using the HTTP `Authorization` request header field:\n\n```\nPOST /resource/1?a=1&b=2 HTTP/1.1\nHost: example.com:8000\nAuthorization: Hawk id=\"dh37fgj492je\", ts=\"1353832234\", nonce=\"j4h3g2\", hash=\"Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\", ext=\"some-app-ext-data\", mac=\"aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=\"\n```\n\nIt is up to the server if and when it validates the payload for any given request, based solely on it's security policy\nand the nature of the data included.\n\nIf the payload is available at the time of authentication, the server uses the hash value provided by the client to construct\nthe normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value\nwith the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash.\n\nHowever, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed\nat a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value\nprovided by the client after validating the MAC.\n\nIt is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value\nincluded in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided\nby the client, the payload may be modified by an attacker.\n\n\n## Response Payload Validation\n\n**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the\nclient to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header\nas a response header using the exact same syntax as the `Authorization` request header field.\n\nThe header is contructed using the same process as the client's request header. The server uses the same credentials and other\nartifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with\nnew values based on the server response. The rest as identical to those used by the client.\n\nThe result MAC digest is included with the optional `hash` and `ext` values:\n\n```\nServer-Authorization: Hawk mac=\"XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\", ext=\"response-specific\"\n```\n\n\n## Browser Support and Considerations\n\nA browser script is provided for including using a `<script>` tag in [lib/browser.js](/lib/browser.js).\n\n**Hawk** relies on the _Server-Authorization_ and _WWW-Authenticate_ headers in its response to communicate with the client.\nTherefore, in case of CORS requests, it is important to consider sending _Access-Control-Expose-Headers_ with the value\n_\"WWW-Authenticate, Server-Authorization\"_ on each response from your server. As explained in the\n[specifications](http://www.w3.org/TR/cors/#access-control-expose-headers-response-header), it will indicate that these headers\ncan safely be accessed by the client (using getResponseHeader() on the XmlHttpRequest object). Otherwise you will be met with a\n[\"simple response header\"](http://www.w3.org/TR/cors/#simple-response-header) which excludes these fields and would prevent the\nHawk client from authenticating the requests.You can read more about the why and how in this\n[article](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server)\n\n\n# Single URI Authorization\n\nThere are cases in which limited and short-term access to a protected resource is granted to a third party which does not\nhave access to the shared credentials. For example, displaying a protected image on a web page accessed by anyone. **Hawk**\nprovides limited support for such URIs in the form of a _bewit_ - a URI query parameter appended to the request URI which contains\nthe necessary credentials to authenticate the request.\n\nBecause of the significant security risks involved in issuing such access, bewit usage is purposely limited only to GET requests\nand for a finite period of time. Both the client and server can issue bewit credentials, however, the server should not use the same\ncredentials as the client to maintain clear traceability as to who issued which credentials.\n\nIn order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within\nthe granted access timeframe. \n\n\n## Bewit Usage Example\n\nServer code:\n\n```javascript\nvar Http = require('http');\nvar Hawk = require('hawk');\n\n\n// Credentials lookup function\n\nvar credentialsFunc = function (id, callback) {\n\n var credentials = {\n key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n algorithm: 'sha256'\n };\n\n return callback(null, credentials);\n};\n\n// Create HTTP server\n\nvar handler = function (req, res) {\n\n Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {\n\n res.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' });\n res.end(!err ? 'Access granted' : 'Shoosh!');\n });\n};\n\nHttp.createServer(handler).listen(8000, 'example.com');\n```\n\nBewit code generation:\n\n```javascript\nvar Request = require('request');\nvar Hawk = require('hawk');\n\n\n// Client credentials\n\nvar credentials = {\n id: 'dh37fgj492je',\n key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n algorithm: 'sha256'\n}\n\n// Generate bewit\n\nvar duration = 60 * 5; // 5 Minutes\nvar bewit = Hawk.uri.getBewit('http://example.com:8080/resource/1?b=1&a=2', { credentials: credentials, ttlSec: duration, ext: 'some-app-data' });\nvar uri = 'http://example.com:8000/resource/1?b=1&a=2' + '&bewit=' + bewit;\n```\n\n\n# Security Considerations\n\nThe greatest sources of security risks are usually found not in **Hawk** but in the policies and procedures surrounding its use.\nImplementers are strongly encouraged to assess how this module addresses their security requirements. This section includes\nan incomplete list of security considerations that must be reviewed and understood before deploying **Hawk** on the server.\nMany of the protections provided in **Hawk** depends on whether and how they are used.\n\n### MAC Keys Transmission\n\n**Hawk** does not provide any mechanism for obtaining or transmitting the set of shared credentials required. Any mechanism used\nto obtain **Hawk** credentials must ensure that these transmissions are protected using transport-layer mechanisms such as TLS.\n\n### Confidentiality of Requests\n\nWhile **Hawk** provides a mechanism for verifying the integrity of HTTP requests, it provides no guarantee of request\nconfidentiality. Unless other precautions are taken, eavesdroppers will have full access to the request content. Servers should\ncarefully consider the types of data likely to be sent as part of such requests, and employ transport-layer security mechanisms\nto protect sensitive resources.\n\n### Spoofing by Counterfeit Servers\n\n**Hawk** provides limited verification of the server authenticity. When receiving a response back from the server, the server\nmay choose to include a response `Server-Authorization` header which the client can use to verify the response. However, it is up to\nthe server to determine when such measure is included, to up to the client to enforce that policy.\n\nA hostile party could take advantage of this by intercepting the client's requests and returning misleading or otherwise\nincorrect responses. Service providers should consider such attacks when developing services using this protocol, and should\nrequire transport-layer security for any requests where the authenticity of the resource server or of server responses is an issue.\n\n### Plaintext Storage of Credentials\n\nThe **Hawk** key functions the same way passwords do in traditional authentication systems. In order to compute the request MAC,\nthe server must have access to the key in plaintext form. This is in contrast, for example, to modern operating systems, which\nstore only a one-way hash of user credentials.\n\nIf an attacker were to gain access to these keys - or worse, to the server's database of all such keys - he or she would be able\nto perform any action on behalf of any resource owner. Accordingly, it is critical that servers protect these keys from unauthorized\naccess.\n\n### Entropy of Keys\n\nUnless a transport-layer security protocol is used, eavesdroppers will have full access to authenticated requests and request\nMAC values, and will thus be able to mount offline brute-force attacks to recover the key used. Servers should be careful to\nassign keys which are long enough, and random enough, to resist such attacks for at least the length of time that the **Hawk**\ncredentials are valid.\n\nFor example, if the credentials are valid for two weeks, servers should ensure that it is not possible to mount a brute force\nattack that recovers the key in less than two weeks. Of course, servers are urged to err on the side of caution, and use the\nlongest key reasonable.\n\nIt is equally important that the pseudo-random number generator (PRNG) used to generate these keys be of sufficiently high\nquality. Many PRNG implementations generate number sequences that may appear to be random, but which nevertheless exhibit\npatterns or other weaknesses which make cryptanalysis or brute force attacks easier. Implementers should be careful to use\ncryptographically secure PRNGs to avoid these problems.\n\n### Coverage Limitations\n\nThe request MAC only covers the HTTP `Host` header and optionally the `Content-Type` header. It does not cover any other headers\nwhich can often affect how the request body is interpreted by the server. If the server behavior is influenced by the presence\nor value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the\n`ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC.\n\nThe response authentication, when performed, only covers the response payload, content-type, and the request information \nprovided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or\nany other response header field (e.g. Location) which can affect the client's behaviour.\n\n### Future Time Manipulation\n\nThe protocol relies on a clock sync between the client and server. To accomplish this, the server informs the client of its\ncurrent time when an invalid timestamp is received.\n\nIf an attacker is able to manipulate this information and cause the client to use an incorrect time, it would be able to cause\nthe client to generate authenticated requests using time in the future. Such requests will fail when sent by the client, and will\nnot likely leave a trace on the server (given the common implementation of nonce, if at all enforced). The attacker will then\nbe able to replay the request at the correct time without detection.\n\nThe client must only use the time information provided by the server if:\n* it was delivered over a TLS connection and the server identity has been verified, or\n* the `tsm` MAC digest calculated using the same client credentials over the timestamp has been verified.\n\n### Client Clock Poisoning\n\nWhen receiving a request with a bad timestamp, the server provides the client with its current time. The client must never use\nthe time received from the server to adjust its own clock, and must only use it to calculate an offset for communicating with\nthat particular server.\n\n### Bewit Limitations\n\nSpecial care must be taken when issuing bewit credentials to third parties. Bewit credentials are valid until expiration and cannot\nbe revoked or limited without using other means. Whatever resource they grant access to will be completely exposed to anyone with\naccess to the bewit credentials which act as bearer credentials for that particular resource. While bewit usage is limited to GET\nrequests only and therefore cannot be used to perform transactions or change server state, it can still be used to expose private\nand sensitive information.\n\n### Host Header Forgery\n\nHawk validates the incoming request MAC against the incoming HTTP Host header. However, unless the optional `host` and `port`\noptions are used with `server.authenticate()`, a malicous client can mint new host names pointing to the server's IP address and\nuse that to craft an attack by sending a valid request that's meant for another hostname than the one used by the server. Server\nimplementors must manually verify that the host header received matches their expectation (or use the options mentioned above).\n\n# Frequently Asked Questions\n\n### Where is the protocol specification?\n\nIf you are looking for some prose explaining how all this works, **this is it**. **Hawk** is being developed as an open source\nproject instead of a standard. In other words, the [code](/hueniverse/hawk/tree/master/lib) is the specification. Not sure about\nsomething? Open an issue!\n\n### Is it done?\n\nAt if version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental\nand is likely to change. This also means your feedback and contribution are very welcome. Feel free to open issues with questions\nand suggestions.\n\n### Where can I find **Hawk** implementations in other languages?\n\n**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, others are actively porting it to other\nplatforms. There is already a [PHP](https://github.com/alexbilbie/PHP-Hawk),\n[.NET](https://github.com/pcibraro/hawknet), and [JAVA](https://github.com/wealdtech/hawk) libraries available. The full list\nis maintained [here](https://github.com/hueniverse/hawk/issues?labels=port). Please add an issue if you are working on another\nport. A cross-platform test-suite is in the works.\n\n### Why isn't the algorithm part of the challenge or dynamically negotiated?\n\nThe algorithm used is closely related to the key issued as different algorithms require different key sizes (and other\nrequirements). While some keys can be used for multiple algorithm, the protocol is designed to closely bind the key and algorithm\ntogether as part of the issued credentials.\n\n### Why is Host and Content-Type the only headers covered by the request MAC?\n\nIt is really hard to include other headers. Headers can be changed by proxies and other intermediaries and there is no\nwell-established way to normalize them. Many platforms change the case of header field names and values. The only\nstraight-forward solution is to include the headers in some blob (say, base64 encoded JSON) and include that with the request,\nan approach taken by JWT and other such formats. However, that design violates the HTTP header boundaries, repeats information,\nand introduces other security issues because firewalls will not be aware of these \"hidden\" headers. In addition, any information\nrepeated must be compared to the duplicated information in the header and therefore only moves the problem elsewhere.\n\n### Why not just use HTTP Digest?\n\nDigest requires pre-negotiation to establish a nonce. This means you can't just make a request - you must first send\na protocol handshake to the server. This pattern has become unacceptable for most web services, especially mobile\nwhere extra round-trip are costly.\n\n### Why bother with all this nonce and timestamp business?\n\n**Hawk** is an attempt to find a reasonable, practical compromise between security and usability. OAuth 1.0 got timestamp\nand nonces halfway right but failed when it came to scalability and consistent developer experience. **Hawk** addresses\nit by requiring the client to sync its clock, but provides it with tools to accomplish it.\n\nIn general, replay protection is a matter of application-specific threat model. It is less of an issue on a TLS-protected\nsystem where the clients are implemented using best practices and are under the control of the server. Instead of dropping\nreplay protection, **Hawk** offers a required time window and an optional nonce verification. Together, it provides developers\nwith the ability to decide how to enforce their security policy without impacting the client's implementation.\n\n### What are `app` and `dlg` in the authorization header and normalized mac string?\n\nThe original motivation for **Hawk** was to replace the OAuth 1.0 use cases. This included both a simple client-server mode which\nthis module is specifically designed for, and a delegated access mode which is being developed separately in\n[Oz](https://github.com/hueniverse/oz). In addition to the **Hawk** use cases, Oz requires another attribute: the application id `app`.\nThis provides binding between the credentials and the application in a way that prevents an attacker from tricking an application\nto use credentials issued to someone else. It also has an optional 'delegated-by' attribute `dlg` which is the application id of the\napplication the credentials were directly issued to. The goal of these two additions is to allow Oz to utilize **Hawk** directly,\nbut with the additional security of delegated credentials.\n\n### What is the purpose of the static strings used in each normalized MAC input?\n\nWhen calculating a hash or MAC, a static prefix (tag) is added. The prefix is used to prevent MAC values from being\nused or reused for a purpose other than what they were created for (i.e. prevents switching MAC values between a request,\nresponse, and a bewit use cases). It also protects against expliots created after a potential change in how the protocol\ncreates the normalized string. For example, if a future version would switch the order of nonce and timestamp, it\ncan create an exploit opportunity for cases where the nonce is similar in format to a timestamp.\n\n### Does **Hawk** have anything to do with OAuth?\n\nShort answer: no.\n\n**Hawk** was originally proposed as the OAuth MAC Token specification. However, the OAuth working group in its consistent\nincompetence failed to produce a final, usable solution to address one of the most popular use cases of OAuth 1.0 - using it\nto authenticate simple client-server transactions (i.e. two-legged). As you can guess, the OAuth working group is still hard\nat work to produce more garbage.\n\n**Hawk** provides a simple HTTP authentication scheme for making client-server requests. It does not address the OAuth use case\nof delegating access to a third party. If you are looking for an OAuth alternative, check out [Oz](https://github.com/hueniverse/oz).\n\n\n# Acknowledgements\n\n**Hawk** is a derivative work of the [HTTP MAC Authentication Scheme](http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05) proposal\nco-authored by Ben Adida, Adam Barth, and Eran Hammer, which in turn was based on the OAuth 1.0 community specification.\n\nSpecial thanks to Ben Laurie for his always insightful feedback and advice.\n\nThe **Hawk** logo was created by [Chris Carrasco](http://chriscarrasco.com).\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/hueniverse/hawk/issues"
},
- "homepage": "https://github.com/hueniverse/hawk",
- "_id": "hawk@1.0.0",
- "_from": "hawk@~1.0.0"
+ "_id": "hawk@1.1.1",
+ "dist": {
+ "shasum": "87cd491f9b46e4e2aeaca335416766885d2d1ed9",
+ "tarball": "http://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz"
+ },
+ "_from": "hawk@1.1.1",
+ "_npmVersion": "1.3.8",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ "maintainers": [
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "87cd491f9b46e4e2aeaca335416766885d2d1ed9",
+ "_resolved": "https://registry.npmjs.org/hawk/-/hawk-1.1.1.tgz",
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/hueniverse/hawk"
}
diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/browser.js b/deps/npm/node_modules/request/node_modules/hawk/test/browser.js
index b25a10fd9..5bcb910c1 100755
--- a/deps/npm/node_modules/request/node_modules/hawk/test/browser.js
+++ b/deps/npm/node_modules/request/node_modules/hawk/test/browser.js
@@ -728,6 +728,30 @@ describe('Browser', function () {
});
});
});
+
+ describe('#authenticateTimestamp', function (done) {
+
+ it('should validate a timestamp', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var tsm = Hawk.crypto.timestampMessage(credentials);
+ expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(true);
+ done();
+ });
+ });
+
+ it('should detect a bad timestamp', function (done) {
+
+ credentialsFunc('123456', function (err, credentials) {
+
+ var tsm = Hawk.crypto.timestampMessage(credentials);
+ tsm.ts = 4;
+ expect(Browser.client.authenticateTimestamp(tsm, credentials)).to.equal(false);
+ done();
+ });
+ });
+ });
});
describe('#parseAuthorizationHeader', function (done) {
@@ -768,4 +792,26 @@ describe('Browser', function () {
done();
});
});
+
+ describe('#setNtpOffset', function (done) {
+
+ it('catches localStorage errors', function (done) {
+
+ var orig = Browser.utils.storage.setItem;
+ var error = console.error;
+ var count = 0;
+ console.error = function () { if (count++ === 2) { console.error.error; } };
+ Browser.utils.storage.setItem = function () {
+
+ Browser.utils.storage.setItem = orig;
+ throw new Error()
+ };
+
+ expect(function () {
+ Browser.utils.setNtpOffset(100);
+ }).not.to.throw();
+
+ done();
+ });
+ });
});
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
index 79f0b054f..ad8294e90 100644
--- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
@@ -30,14 +30,34 @@
},
"scripts": {
"pretest": "which gjslint; if [[ \"$?\" = 0 ]] ; then gjslint --nojsdoc -r lib -r tst; else echo \"Missing gjslint. Skipping lint\"; fi",
- "test": "./node_modules/.bin/tap ./tst"
+ "test": "tap ./tst"
},
- "readme": "node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.\nCurrently BER encoding is supported; at some point I'll likely have to do DER.\n\n## Usage\n\nMostly, if you're *actually* needing to read and write ASN.1, you probably don't\nneed this readme to explain what and why. If you have no idea what ASN.1 is,\nsee this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nThe source is pretty much self-explanatory, and has read/write methods for the\ncommon types out there.\n\n### Decoding\n\nThe following reads an ASN.1 sequence with a boolean.\n\n var Ber = require('asn1').Ber;\n\n var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));\n\n reader.readSequence();\n console.log('Sequence len: ' + reader.length);\n if (reader.peek() === Ber.Boolean)\n console.log(reader.readBoolean());\n\n### Encoding\n\nThe following generates the same payload as above.\n\n var Ber = require('asn1').Ber;\n\n var writer = new Ber.Writer();\n\n writer.startSequence();\n writer.writeBoolean(true);\n writer.endSequence();\n\n console.log(writer.buffer);\n\n## Installation\n\n npm install asn1\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-asn1/issues>.\n",
- "readmeFilename": "README.md",
+ "_npmUser": {
+ "name": "mcavage",
+ "email": "mcavage@gmail.com"
+ },
+ "_id": "asn1@0.1.11",
+ "_engineSupported": true,
+ "_npmVersion": "1.1.0-beta-4",
+ "_nodeVersion": "v0.6.6",
+ "_defaultsLoaded": true,
+ "dist": {
+ "shasum": "559be18376d08a4ec4dbe80877d27818639b2df7",
+ "tarball": "http://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
+ },
+ "maintainers": [
+ {
+ "name": "mcavage",
+ "email": "mcavage@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "559be18376d08a4ec4dbe80877d27818639b2df7",
+ "_from": "asn1@0.1.11",
+ "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz",
"bugs": {
"url": "https://github.com/mcavage/node-asn1/issues"
},
- "homepage": "https://github.com/mcavage/node-asn1",
- "_id": "asn1@0.1.11",
- "_from": "asn1@0.1.11"
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/mcavage/node-asn1"
}
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
index aaf2e9247..d55a6bd65 100644
--- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
@@ -14,7 +14,24 @@
"node": ">=0.6"
},
"readme": "# node-assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE_NDEBUG, and (2) some API wrappers for argument testing. Like\n`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks\nlike this:\n\n var assert = require('assert-plus');\n\n function fooAccount(options, callback) {\n\t assert.object(options, 'options');\n\t\tassert.number(options.id, 'options.id);\n\t\tassert.bool(options.isManager, 'options.isManager');\n\t\tassert.string(options.name, 'options.name');\n\t\tassert.arrayOfString(options.email, 'options.email');\n\t\tassert.func(callback, 'callback');\n\n // Do stuff\n\t\tcallback(null, {});\n }\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n AssertionError: foo (string) is required\n\tat test (/home/mark/work/foo/foo.js:3:9)\n\tat Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n\tat Module._compile (module.js:446:26)\n\tat Object..js (module.js:464:10)\n\tat Module.load (module.js:353:31)\n\tat Function._load (module.js:311:12)\n\tat Array.0 (module.js:484:10)\n\tat EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n function test(foo) {\n\t assert.string(foo, 'foo');\n }\n\nThere you go. You can check that arrays are of a homogenous type with `Arrayof$Type`:\n\n function test(foo) {\n\t assert.arrayOfString(foo, 'foo');\n }\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n assert.optionalString(foo, 'foo');\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.\n\nThe complete list of APIs is:\n\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.arrayOfBool\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
- "readmeFilename": "README.md",
"_id": "assert-plus@0.1.2",
- "_from": "assert-plus@0.1.2"
+ "dist": {
+ "shasum": "d93ffdbb67ac5507779be316a7d65146417beef8",
+ "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
+ },
+ "_npmVersion": "1.1.59",
+ "_npmUser": {
+ "name": "mcavage",
+ "email": "mcavage@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mcavage",
+ "email": "mcavage@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "d93ffdbb67ac5507779be316a7d65146417beef8",
+ "_from": "assert-plus@0.1.2",
+ "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
index edcc649a8..474e54daf 100644
--- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
+++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
@@ -11,8 +11,25 @@
"node": ">= 0.4"
},
"main": "ctype.js",
- "readme": "Node-CType is a way to read and write binary data in structured and easy to use\nformat. Its name comes from the C header file.\n\nTo get started, simply clone the repository or use npm to install it. Once it is\nthere, simply require it.\n\ngit clone git://github.com/rmustacc/node-ctype\nnpm install ctype\nvar mod_ctype = require('ctype')\n\n\nThere are two APIs that you can use, depending on what abstraction you'd like.\nThe low level API let's you read and write individual integers and floats from\nbuffers. The higher level API let's you read and write structures of these. To\nillustrate this, let's looks look at how we would read and write a binary\nencoded x,y point.\n\nIn C we would define this structure as follows:\n\ntypedef struct point {\n\tuint16_t\tp_x;\n\tuint16_t\tp_y;\n} point_t;\n\nTo read a binary encoded point from a Buffer, we first need to create a CType\nparser (where we specify the endian and other options) and add the typedef.\n\nvar parser = new mod_ctype.Parser({ endian: 'big' });\nparser.typedef('point_t', [\n\t{ x: { type: 'uint16_t' } },\n\t{ y: { type: 'uint16_t' } }\n]);\n\nFrom here, given a buffer buf and an offset into it, we can read a point.\n\nvar out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);\nconsole.log(out);\n{ point: { x: 23, y: 42 } }\n\nAnother way to get the same information would be to use the low level methods.\nNote that these require you to manually deal with the offset. Here's how we'd\nget the same values of x and y from the buffer.\n\nvar x = mod_ctype.ruint16(buf, 'big', 0);\nvar y = mod_ctype.ruint16(buf, 'big', 2);\nconsole.log(x + ', ' + y);\n23, 42\n\nThe true power of this API comes from the ability to define and nest typedefs,\njust as you would in C. By default, the following types are defined by default.\nNote that they return a Number, unless indicated otherwise.\n\n * int8_t\n * int16_t\n * int32_t\n * int64_t (returns an array where val[0] << 32 + val[1] would be the value)\n * uint8_t\n * uint16_t\n * uint32_t\n * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)\n * float\n * double\n * char (either returns a buffer with that character or a uint8_t)\n * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)\n\n\nctf2json integration:\n\nNode-CType supports consuming the output of ctf2json. Once you read in a JSON file,\nall you have to do to add all the definitions it contains is:\n\nvar data, parser;\ndata = JSON.parse(parsedJSONData);\nparser = mod_ctype.parseCTF(data, { endian: 'big' });\n\nFor more documentation, see the file README.old. Full documentation is in the\nprocess of being rewritten as a series of manual pages which will be available\nin the repository and online for viewing.\n\nTo read the ctio manual page simple run, from the root of the workspace:\n\nman -Mman -s 3ctype ctio\n",
- "readmeFilename": "README",
"_id": "ctype@0.5.2",
- "_from": "ctype@0.5.2"
+ "dist": {
+ "shasum": "fe8091d468a373a0b0c9ff8bbfb3425c00973a1d",
+ "tarball": "http://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
+ },
+ "_npmVersion": "1.1.59",
+ "_npmUser": {
+ "name": "rm",
+ "email": "rm@fingolfin.org"
+ },
+ "maintainers": [
+ {
+ "name": "rm",
+ "email": "rm@fingolfin.org"
+ }
+ ],
+ "directories": {},
+ "_shasum": "fe8091d468a373a0b0c9ff8bbfb3425c00973a1d",
+ "_from": "ctype@0.5.2",
+ "_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/package.json b/deps/npm/node_modules/request/node_modules/http-signature/package.json
index 94bd8e79f..6d646d4ad 100644
--- a/deps/npm/node_modules/request/node_modules/http-signature/package.json
+++ b/deps/npm/node_modules/request/node_modules/http-signature/package.json
@@ -14,7 +14,7 @@
},
"main": "lib/index.js",
"scripts": {
- "test": "./node_modules/.bin/tap tst/*.js"
+ "test": "tap tst/*.js"
},
"dependencies": {
"assert-plus": "0.1.2",
@@ -27,10 +27,28 @@
},
"readme": "# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actaully want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var key = fs.readFileSync('./key.pem', 'ascii');\n\n var options = {\n host: 'localhost',\n port: 8443,\n path: '/',\n method: 'GET',\n headers: {}\n };\n\n // Adds a 'Date' header in, signs it, and adds the\n // 'Authorization' header in.\n var req = https.request(options, function(res) {\n console.log(res.statusCode);\n });\n\n\n httpSignature.sign(req, {\n key: key,\n keyId: './cert.pem'\n });\n\n req.end();\n\n### Server\n\n var fs = require('fs');\n var https = require('https');\n var httpSignature = require('http-signature');\n\n var options = {\n key: fs.readFileSync('./key.pem'),\n cert: fs.readFileSync('./cert.pem')\n };\n\n https.createServer(options, function (req, res) {\n var rc = 200;\n var parsed = httpSignature.parseRequest(req);\n var pub = fs.readFileSync(parsed.keyId, 'ascii');\n if (!httpSignature.verifySignature(parsed, pub))\n rc = 401;\n\n res.writeHead(rc);\n res.end();\n }).listen(8443);\n\n## Installation\n\n npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/joyent/node-http-signature/issues>.\n",
"readmeFilename": "README.md",
+ "_id": "http-signature@0.10.0",
+ "dist": {
+ "shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582",
+ "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz"
+ },
+ "_from": "http-signature@~0.10.0",
+ "_npmVersion": "1.2.18",
+ "_npmUser": {
+ "name": "mcavage",
+ "email": "mcavage@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mcavage",
+ "email": "mcavage@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582",
+ "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz",
"bugs": {
"url": "https://github.com/joyent/node-http-signature/issues"
},
- "homepage": "https://github.com/joyent/node-http-signature",
- "_id": "http-signature@0.10.0",
- "_from": "http-signature@~0.10.0"
+ "homepage": "https://github.com/joyent/node-http-signature"
}
diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json
index 322c23a5a..3ddf83680 100644
--- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json
+++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json
@@ -27,7 +27,25 @@
"bugs": {
"url": "https://github.com/isaacs/json-stringify-safe/issues"
},
- "homepage": "https://github.com/isaacs/json-stringify-safe",
"_id": "json-stringify-safe@5.0.0",
- "_from": "json-stringify-safe@~5.0.0"
+ "dist": {
+ "shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e",
+ "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz"
+ },
+ "_from": "json-stringify-safe@~5.0.0",
+ "_npmVersion": "1.3.6",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ }
+ ],
+ "directories": {},
+ "_shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e",
+ "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz",
+ "homepage": "https://github.com/isaacs/json-stringify-safe"
}
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/.npmignore b/deps/npm/node_modules/request/node_modules/mime-types/.npmignore
new file mode 100644
index 000000000..919d51b41
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/.npmignore
@@ -0,0 +1,14 @@
+test
+build.js
+
+# OS generated files #
+######################
+.DS_Store*
+# Icon?
+ehthumbs.db
+Thumbs.db
+
+# Node.js #
+###########
+node_modules
+npm-debug.log
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/.travis.yml b/deps/npm/node_modules/request/node_modules/mime-types/.travis.yml
new file mode 100644
index 000000000..73c85c65e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/.travis.yml
@@ -0,0 +1,12 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.11"
+matrix:
+ allow_failures:
+ - node_js: "0.11"
+ fast_finish: true
+before_install:
+ # remove build script deps before install
+ - node -pe 'f="./package.json";p=require(f);d=p.devDependencies;for(k in d){if("co"===k.substr(0,2))delete d[k]}require("fs").writeFileSync(f,JSON.stringify(p,null,2))'
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/LICENSE b/deps/npm/node_modules/request/node_modules/mime-types/LICENSE
new file mode 100644
index 000000000..a7ae8ee9b
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/LICENSE
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/Makefile b/deps/npm/node_modules/request/node_modules/mime-types/Makefile
new file mode 100644
index 000000000..ceaf011fb
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/Makefile
@@ -0,0 +1,9 @@
+
+build:
+ node --harmony-generators build.js
+
+test:
+ node test/mime.js
+ mocha --require should --reporter spec test/test.js
+
+.PHONY: build test
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
new file mode 100644
index 000000000..8e21ee104
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/README.md
@@ -0,0 +1,101 @@
+# mime-types
+[![NPM version](https://badge.fury.io/js/mime-types.svg)](https://badge.fury.io/js/mime-types) [![Build Status](https://travis-ci.org/expressjs/mime-types.svg?branch=master)](https://travis-ci.org/expressjs/mime-types)
+
+The ultimate javascript content-type utility.
+
+### Install
+
+```sh
+$ npm install mime-types
+```
+
+#### Similar to [node-mime](https://github.com/broofa/node-mime), except:
+
+- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
+- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
+- Additional mime types are added such as jade and stylus. Feel free to add more!
+- Browser support via Browserify and Component by converting lists to JSON files.
+
+Otherwise, the API is compatible.
+
+### Adding Types
+
+If you'd like to add additional types,
+simply create a PR adding the type to `custom.json` and
+a reference link to the [sources](SOURCES.md).
+
+Do __NOT__ edit `mime.json` or `node.json`.
+Those are pulled using `build.js`.
+You should only touch `custom.json`.
+
+## API
+
+```js
+var mime = require('mime-types')
+```
+
+All functions return `false` if input is invalid or not found.
+
+### mime.lookup(path)
+
+Lookup the content-type associated with a file.
+
+```js
+mime.lookup('json') // 'application/json'
+mime.lookup('.md') // 'text/x-markdown'
+mime.lookup('file.html') // 'text/html'
+mime.lookup('folder/file.js') // 'application/javascript'
+
+mime.lookup('cats') // false
+```
+
+### mime.contentType(type)
+
+Create a full content-type header given a content-type or extension.
+
+```js
+mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
+mime.contentType('file.json') // 'application/json; charset=utf-8'
+```
+
+### mime.extension(type)
+
+Get the default extension for a content-type.
+
+```js
+mime.extension('application/octet-stream') // 'bin'
+```
+
+### mime.charset(type)
+
+Lookup the implied default charset of a content-type.
+
+```js
+mime.charset('text/x-markdown') // 'UTF-8'
+```
+
+### mime.types[extension] = type
+
+A map of content-types by extension.
+
+### mime.extensions[type] = [extensions]
+
+A map of extensions by content-type.
+
+### mime.define(types)
+
+Globally add definitions.
+`types` must be an object of the form:
+
+```js
+{
+ "<content-type>": [extensions...],
+ "<content-type>": [extensions...]
+}
+```
+
+See the `.json` files in `lib/` for examples.
+
+## License
+
+[MIT](LICENSE)
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/SOURCES.md b/deps/npm/node_modules/request/node_modules/mime-types/SOURCES.md
new file mode 100644
index 000000000..1d650123e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/SOURCES.md
@@ -0,0 +1,17 @@
+
+### Sources for custom types
+
+This is a list of sources for any custom mime types.
+When adding custom mime types, please link to where you found the mime type,
+even if it's from an unofficial source.
+
+- `text/coffeescript` - http://coffeescript.org/#scripts
+- `text/x-handlebars-template` - https://handlebarsjs.com/#getting-started
+- `text/x-sass` & `text/x-scss` - https://github.com/janlelis/rubybuntu-mime/blob/master/sass.xml
+- `text.jsx` - http://facebook.github.io/react/docs/getting-started.html [[2]](https://github.com/facebook/react/blob/f230e0a03154e6f8a616e0da1fb3d97ffa1a6472/vendor/browser-transforms.js#L210)
+
+[Sources for node.json types](https://github.com/broofa/node-mime/blob/master/types/node.types)
+
+### Notes on weird types
+
+- `font/opentype` - This type is technically invalid according to the spec. No valid types begin with `font/`. No-one uses the official type of `application/vnd.ms-opentype` as the community standardized `application/x-font-otf`. However, chrome logs nonsense warnings unless opentype fonts are served with `font/opentype`. [[1]](http://stackoverflow.com/questions/2871655/proper-mime-type-for-fonts)
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/component.json b/deps/npm/node_modules/request/node_modules/mime-types/component.json
new file mode 100644
index 000000000..fa67a6d23
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/component.json
@@ -0,0 +1,16 @@
+{
+ "name": "mime-types",
+ "description": "The ultimate javascript content-type utility.",
+ "version": "0.1.0",
+ "author": {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com",
+ "twitter": "https://twitter.com/jongleberry"
+ },
+ "repository": "expressjs/mime-types",
+ "license": "MIT",
+ "main": "lib/index.js",
+ "scripts": ["lib/index.js"],
+ "json": ["mime.json", "node.json", "custom.json"]
+}
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/lib/custom.json b/deps/npm/node_modules/request/node_modules/mime-types/lib/custom.json
new file mode 100644
index 000000000..6137da34e
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/lib/custom.json
@@ -0,0 +1,27 @@
+{
+ "text/jade": [
+ "jade"
+ ],
+ "text/stylus": [
+ "stylus",
+ "styl"
+ ],
+ "text/less": [
+ "less"
+ ],
+ "text/x-sass": [
+ "sass"
+ ],
+ "text/x-scss": [
+ "scss"
+ ],
+ "text/coffeescript": [
+ "coffee"
+ ],
+ "text/x-handlebars-template": [
+ "hbs"
+ ],
+ "text/jsx": [
+ "jsx"
+ ]
+}
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/lib/index.js b/deps/npm/node_modules/request/node_modules/mime-types/lib/index.js
new file mode 100644
index 000000000..cc2d15528
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/lib/index.js
@@ -0,0 +1,75 @@
+
+// types[extension] = type
+exports.types = Object.create(null)
+// extensions[type] = [extensions]
+exports.extensions = Object.create(null)
+// define more mime types
+exports.define = define
+
+// store the json files
+exports.json = {
+ mime: require('./mime.json'),
+ node: require('./node.json'),
+ custom: require('./custom.json'),
+}
+
+exports.lookup = function (string) {
+ if (!string || typeof string !== "string") return false
+ string = string.replace(/.*[\.\/\\]/, '').toLowerCase()
+ if (!string) return false
+ return exports.types[string] || false
+}
+
+exports.extension = function (type) {
+ if (!type || typeof type !== "string") return false
+ type = type.match(/^\s*([^;\s]*)(?:;|\s|$)/)
+ if (!type) return false
+ var exts = exports.extensions[type[1].toLowerCase()]
+ if (!exts || !exts.length) return false
+ return exts[0]
+}
+
+// type has to be an exact mime type
+exports.charset = function (type) {
+ // special cases
+ switch (type) {
+ case 'application/json': return 'UTF-8'
+ case 'application/javascript': return 'UTF-8'
+ }
+
+ // default text/* to utf-8
+ if (/^text\//.test(type)) return 'UTF-8'
+
+ return false
+}
+
+// backwards compatibility
+exports.charsets = {
+ lookup: exports.charset
+}
+
+exports.contentType = function (type) {
+ if (!type || typeof type !== "string") return false
+ if (!~type.indexOf('/')) type = exports.lookup(type)
+ if (!type) return false
+ if (!~type.indexOf('charset')) {
+ var charset = exports.charset(type)
+ if (charset) type += '; charset=' + charset.toLowerCase()
+ }
+ return type
+}
+
+define(exports.json.mime)
+define(exports.json.node)
+define(exports.json.custom)
+
+function define(json) {
+ Object.keys(json).forEach(function (type) {
+ var exts = json[type] || []
+ exports.extensions[type] = exports.extensions[type] || []
+ exts.forEach(function (ext) {
+ if (!~exports.extensions[type].indexOf(ext)) exports.extensions[type].push(ext)
+ exports.types[ext] = type
+ })
+ })
+}
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/lib/mime.json b/deps/npm/node_modules/request/node_modules/mime-types/lib/mime.json
new file mode 100644
index 000000000..f445a86eb
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/lib/mime.json
@@ -0,0 +1,3317 @@
+{
+ "application/1d-interleaved-parityfec": [],
+ "application/3gpp-ims+xml": [],
+ "application/activemessage": [],
+ "application/andrew-inset": [
+ "ez"
+ ],
+ "application/applefile": [],
+ "application/applixware": [
+ "aw"
+ ],
+ "application/atom+xml": [
+ "atom"
+ ],
+ "application/atomcat+xml": [
+ "atomcat"
+ ],
+ "application/atomicmail": [],
+ "application/atomsvc+xml": [
+ "atomsvc"
+ ],
+ "application/auth-policy+xml": [],
+ "application/batch-smtp": [],
+ "application/beep+xml": [],
+ "application/calendar+xml": [],
+ "application/cals-1840": [],
+ "application/ccmp+xml": [],
+ "application/ccxml+xml": [
+ "ccxml"
+ ],
+ "application/cdmi-capability": [
+ "cdmia"
+ ],
+ "application/cdmi-container": [
+ "cdmic"
+ ],
+ "application/cdmi-domain": [
+ "cdmid"
+ ],
+ "application/cdmi-object": [
+ "cdmio"
+ ],
+ "application/cdmi-queue": [
+ "cdmiq"
+ ],
+ "application/cea-2018+xml": [],
+ "application/cellml+xml": [],
+ "application/cfw": [],
+ "application/cnrp+xml": [],
+ "application/commonground": [],
+ "application/conference-info+xml": [],
+ "application/cpl+xml": [],
+ "application/csta+xml": [],
+ "application/cstadata+xml": [],
+ "application/cu-seeme": [
+ "cu"
+ ],
+ "application/cybercash": [],
+ "application/davmount+xml": [
+ "davmount"
+ ],
+ "application/dca-rft": [],
+ "application/dec-dx": [],
+ "application/dialog-info+xml": [],
+ "application/dicom": [],
+ "application/dns": [],
+ "application/docbook+xml": [
+ "dbk"
+ ],
+ "application/dskpp+xml": [],
+ "application/dssc+der": [
+ "dssc"
+ ],
+ "application/dssc+xml": [
+ "xdssc"
+ ],
+ "application/dvcs": [],
+ "application/ecmascript": [
+ "ecma"
+ ],
+ "application/edi-consent": [],
+ "application/edi-x12": [],
+ "application/edifact": [],
+ "application/emma+xml": [
+ "emma"
+ ],
+ "application/epp+xml": [],
+ "application/epub+zip": [
+ "epub"
+ ],
+ "application/eshop": [],
+ "application/example": [],
+ "application/exi": [
+ "exi"
+ ],
+ "application/fastinfoset": [],
+ "application/fastsoap": [],
+ "application/fits": [],
+ "application/font-tdpfr": [
+ "pfr"
+ ],
+ "application/framework-attributes+xml": [],
+ "application/gml+xml": [
+ "gml"
+ ],
+ "application/gpx+xml": [
+ "gpx"
+ ],
+ "application/gxf": [
+ "gxf"
+ ],
+ "application/h224": [],
+ "application/held+xml": [],
+ "application/http": [],
+ "application/hyperstudio": [
+ "stk"
+ ],
+ "application/ibe-key-request+xml": [],
+ "application/ibe-pkg-reply+xml": [],
+ "application/ibe-pp-data": [],
+ "application/iges": [],
+ "application/im-iscomposing+xml": [],
+ "application/index": [],
+ "application/index.cmd": [],
+ "application/index.obj": [],
+ "application/index.response": [],
+ "application/index.vnd": [],
+ "application/inkml+xml": [
+ "ink",
+ "inkml"
+ ],
+ "application/iotp": [],
+ "application/ipfix": [
+ "ipfix"
+ ],
+ "application/ipp": [],
+ "application/isup": [],
+ "application/java-archive": [
+ "jar"
+ ],
+ "application/java-serialized-object": [
+ "ser"
+ ],
+ "application/java-vm": [
+ "class"
+ ],
+ "application/javascript": [
+ "js"
+ ],
+ "application/json": [
+ "json"
+ ],
+ "application/jsonml+json": [
+ "jsonml"
+ ],
+ "application/kpml-request+xml": [],
+ "application/kpml-response+xml": [],
+ "application/lost+xml": [
+ "lostxml"
+ ],
+ "application/mac-binhex40": [
+ "hqx"
+ ],
+ "application/mac-compactpro": [
+ "cpt"
+ ],
+ "application/macwriteii": [],
+ "application/mads+xml": [
+ "mads"
+ ],
+ "application/marc": [
+ "mrc"
+ ],
+ "application/marcxml+xml": [
+ "mrcx"
+ ],
+ "application/mathematica": [
+ "ma",
+ "nb",
+ "mb"
+ ],
+ "application/mathml-content+xml": [],
+ "application/mathml-presentation+xml": [],
+ "application/mathml+xml": [
+ "mathml"
+ ],
+ "application/mbms-associated-procedure-description+xml": [],
+ "application/mbms-deregister+xml": [],
+ "application/mbms-envelope+xml": [],
+ "application/mbms-msk+xml": [],
+ "application/mbms-msk-response+xml": [],
+ "application/mbms-protection-description+xml": [],
+ "application/mbms-reception-report+xml": [],
+ "application/mbms-register+xml": [],
+ "application/mbms-register-response+xml": [],
+ "application/mbms-user-service-description+xml": [],
+ "application/mbox": [
+ "mbox"
+ ],
+ "application/media_control+xml": [],
+ "application/mediaservercontrol+xml": [
+ "mscml"
+ ],
+ "application/metalink+xml": [
+ "metalink"
+ ],
+ "application/metalink4+xml": [
+ "meta4"
+ ],
+ "application/mets+xml": [
+ "mets"
+ ],
+ "application/mikey": [],
+ "application/mods+xml": [
+ "mods"
+ ],
+ "application/moss-keys": [],
+ "application/moss-signature": [],
+ "application/mosskey-data": [],
+ "application/mosskey-request": [],
+ "application/mp21": [
+ "m21",
+ "mp21"
+ ],
+ "application/mp4": [
+ "mp4s"
+ ],
+ "application/mpeg4-generic": [],
+ "application/mpeg4-iod": [],
+ "application/mpeg4-iod-xmt": [],
+ "application/msc-ivr+xml": [],
+ "application/msc-mixer+xml": [],
+ "application/msword": [
+ "doc",
+ "dot"
+ ],
+ "application/mxf": [
+ "mxf"
+ ],
+ "application/nasdata": [],
+ "application/news-checkgroups": [],
+ "application/news-groupinfo": [],
+ "application/news-transmission": [],
+ "application/nss": [],
+ "application/ocsp-request": [],
+ "application/ocsp-response": [],
+ "application/octet-stream": [
+ "bin",
+ "dms",
+ "lrf",
+ "mar",
+ "so",
+ "dist",
+ "distz",
+ "pkg",
+ "bpk",
+ "dump",
+ "elc",
+ "deploy"
+ ],
+ "application/oda": [
+ "oda"
+ ],
+ "application/oebps-package+xml": [
+ "opf"
+ ],
+ "application/ogg": [
+ "ogx"
+ ],
+ "application/omdoc+xml": [
+ "omdoc"
+ ],
+ "application/onenote": [
+ "onetoc",
+ "onetoc2",
+ "onetmp",
+ "onepkg"
+ ],
+ "application/oxps": [
+ "oxps"
+ ],
+ "application/parityfec": [],
+ "application/patch-ops-error+xml": [
+ "xer"
+ ],
+ "application/pdf": [
+ "pdf"
+ ],
+ "application/pgp-encrypted": [
+ "pgp"
+ ],
+ "application/pgp-keys": [],
+ "application/pgp-signature": [
+ "asc",
+ "sig"
+ ],
+ "application/pics-rules": [
+ "prf"
+ ],
+ "application/pidf+xml": [],
+ "application/pidf-diff+xml": [],
+ "application/pkcs10": [
+ "p10"
+ ],
+ "application/pkcs7-mime": [
+ "p7m",
+ "p7c"
+ ],
+ "application/pkcs7-signature": [
+ "p7s"
+ ],
+ "application/pkcs8": [
+ "p8"
+ ],
+ "application/pkix-attr-cert": [
+ "ac"
+ ],
+ "application/pkix-cert": [
+ "cer"
+ ],
+ "application/pkix-crl": [
+ "crl"
+ ],
+ "application/pkix-pkipath": [
+ "pkipath"
+ ],
+ "application/pkixcmp": [
+ "pki"
+ ],
+ "application/pls+xml": [
+ "pls"
+ ],
+ "application/poc-settings+xml": [],
+ "application/postscript": [
+ "ai",
+ "eps",
+ "ps"
+ ],
+ "application/prs.alvestrand.titrax-sheet": [],
+ "application/prs.cww": [
+ "cww"
+ ],
+ "application/prs.nprend": [],
+ "application/prs.plucker": [],
+ "application/prs.rdf-xml-crypt": [],
+ "application/prs.xsf+xml": [],
+ "application/pskc+xml": [
+ "pskcxml"
+ ],
+ "application/qsig": [],
+ "application/rdf+xml": [
+ "rdf"
+ ],
+ "application/reginfo+xml": [
+ "rif"
+ ],
+ "application/relax-ng-compact-syntax": [
+ "rnc"
+ ],
+ "application/remote-printing": [],
+ "application/resource-lists+xml": [
+ "rl"
+ ],
+ "application/resource-lists-diff+xml": [
+ "rld"
+ ],
+ "application/riscos": [],
+ "application/rlmi+xml": [],
+ "application/rls-services+xml": [
+ "rs"
+ ],
+ "application/rpki-ghostbusters": [
+ "gbr"
+ ],
+ "application/rpki-manifest": [
+ "mft"
+ ],
+ "application/rpki-roa": [
+ "roa"
+ ],
+ "application/rpki-updown": [],
+ "application/rsd+xml": [
+ "rsd"
+ ],
+ "application/rss+xml": [
+ "rss"
+ ],
+ "application/rtf": [
+ "rtf"
+ ],
+ "application/rtx": [],
+ "application/samlassertion+xml": [],
+ "application/samlmetadata+xml": [],
+ "application/sbml+xml": [
+ "sbml"
+ ],
+ "application/scvp-cv-request": [
+ "scq"
+ ],
+ "application/scvp-cv-response": [
+ "scs"
+ ],
+ "application/scvp-vp-request": [
+ "spq"
+ ],
+ "application/scvp-vp-response": [
+ "spp"
+ ],
+ "application/sdp": [
+ "sdp"
+ ],
+ "application/set-payment": [],
+ "application/set-payment-initiation": [
+ "setpay"
+ ],
+ "application/set-registration": [],
+ "application/set-registration-initiation": [
+ "setreg"
+ ],
+ "application/sgml": [],
+ "application/sgml-open-catalog": [],
+ "application/shf+xml": [
+ "shf"
+ ],
+ "application/sieve": [],
+ "application/simple-filter+xml": [],
+ "application/simple-message-summary": [],
+ "application/simplesymbolcontainer": [],
+ "application/slate": [],
+ "application/smil": [],
+ "application/smil+xml": [
+ "smi",
+ "smil"
+ ],
+ "application/soap+fastinfoset": [],
+ "application/soap+xml": [],
+ "application/sparql-query": [
+ "rq"
+ ],
+ "application/sparql-results+xml": [
+ "srx"
+ ],
+ "application/spirits-event+xml": [],
+ "application/srgs": [
+ "gram"
+ ],
+ "application/srgs+xml": [
+ "grxml"
+ ],
+ "application/sru+xml": [
+ "sru"
+ ],
+ "application/ssdl+xml": [
+ "ssdl"
+ ],
+ "application/ssml+xml": [
+ "ssml"
+ ],
+ "application/tamp-apex-update": [],
+ "application/tamp-apex-update-confirm": [],
+ "application/tamp-community-update": [],
+ "application/tamp-community-update-confirm": [],
+ "application/tamp-error": [],
+ "application/tamp-sequence-adjust": [],
+ "application/tamp-sequence-adjust-confirm": [],
+ "application/tamp-status-query": [],
+ "application/tamp-status-response": [],
+ "application/tamp-update": [],
+ "application/tamp-update-confirm": [],
+ "application/tei+xml": [
+ "tei",
+ "teicorpus"
+ ],
+ "application/thraud+xml": [
+ "tfi"
+ ],
+ "application/timestamp-query": [],
+ "application/timestamp-reply": [],
+ "application/timestamped-data": [
+ "tsd"
+ ],
+ "application/tve-trigger": [],
+ "application/ulpfec": [],
+ "application/vcard+xml": [],
+ "application/vemmi": [],
+ "application/vividence.scriptfile": [],
+ "application/vnd.3gpp.bsf+xml": [],
+ "application/vnd.3gpp.pic-bw-large": [
+ "plb"
+ ],
+ "application/vnd.3gpp.pic-bw-small": [
+ "psb"
+ ],
+ "application/vnd.3gpp.pic-bw-var": [
+ "pvb"
+ ],
+ "application/vnd.3gpp.sms": [],
+ "application/vnd.3gpp2.bcmcsinfo+xml": [],
+ "application/vnd.3gpp2.sms": [],
+ "application/vnd.3gpp2.tcap": [
+ "tcap"
+ ],
+ "application/vnd.3m.post-it-notes": [
+ "pwn"
+ ],
+ "application/vnd.accpac.simply.aso": [
+ "aso"
+ ],
+ "application/vnd.accpac.simply.imp": [
+ "imp"
+ ],
+ "application/vnd.acucobol": [
+ "acu"
+ ],
+ "application/vnd.acucorp": [
+ "atc",
+ "acutc"
+ ],
+ "application/vnd.adobe.air-application-installer-package+zip": [
+ "air"
+ ],
+ "application/vnd.adobe.formscentral.fcdt": [
+ "fcdt"
+ ],
+ "application/vnd.adobe.fxp": [
+ "fxp",
+ "fxpl"
+ ],
+ "application/vnd.adobe.partial-upload": [],
+ "application/vnd.adobe.xdp+xml": [
+ "xdp"
+ ],
+ "application/vnd.adobe.xfdf": [
+ "xfdf"
+ ],
+ "application/vnd.aether.imp": [],
+ "application/vnd.ah-barcode": [],
+ "application/vnd.ahead.space": [
+ "ahead"
+ ],
+ "application/vnd.airzip.filesecure.azf": [
+ "azf"
+ ],
+ "application/vnd.airzip.filesecure.azs": [
+ "azs"
+ ],
+ "application/vnd.amazon.ebook": [
+ "azw"
+ ],
+ "application/vnd.americandynamics.acc": [
+ "acc"
+ ],
+ "application/vnd.amiga.ami": [
+ "ami"
+ ],
+ "application/vnd.amundsen.maze+xml": [],
+ "application/vnd.android.package-archive": [
+ "apk"
+ ],
+ "application/vnd.anser-web-certificate-issue-initiation": [
+ "cii"
+ ],
+ "application/vnd.anser-web-funds-transfer-initiation": [
+ "fti"
+ ],
+ "application/vnd.antix.game-component": [
+ "atx"
+ ],
+ "application/vnd.apple.installer+xml": [
+ "mpkg"
+ ],
+ "application/vnd.apple.mpegurl": [
+ "m3u8"
+ ],
+ "application/vnd.arastra.swi": [],
+ "application/vnd.aristanetworks.swi": [
+ "swi"
+ ],
+ "application/vnd.astraea-software.iota": [
+ "iota"
+ ],
+ "application/vnd.audiograph": [
+ "aep"
+ ],
+ "application/vnd.autopackage": [],
+ "application/vnd.avistar+xml": [],
+ "application/vnd.blueice.multipass": [
+ "mpm"
+ ],
+ "application/vnd.bluetooth.ep.oob": [],
+ "application/vnd.bmi": [
+ "bmi"
+ ],
+ "application/vnd.businessobjects": [
+ "rep"
+ ],
+ "application/vnd.cab-jscript": [],
+ "application/vnd.canon-cpdl": [],
+ "application/vnd.canon-lips": [],
+ "application/vnd.cendio.thinlinc.clientconf": [],
+ "application/vnd.chemdraw+xml": [
+ "cdxml"
+ ],
+ "application/vnd.chipnuts.karaoke-mmd": [
+ "mmd"
+ ],
+ "application/vnd.cinderella": [
+ "cdy"
+ ],
+ "application/vnd.cirpack.isdn-ext": [],
+ "application/vnd.claymore": [
+ "cla"
+ ],
+ "application/vnd.cloanto.rp9": [
+ "rp9"
+ ],
+ "application/vnd.clonk.c4group": [
+ "c4g",
+ "c4d",
+ "c4f",
+ "c4p",
+ "c4u"
+ ],
+ "application/vnd.cluetrust.cartomobile-config": [
+ "c11amc"
+ ],
+ "application/vnd.cluetrust.cartomobile-config-pkg": [
+ "c11amz"
+ ],
+ "application/vnd.collection+json": [],
+ "application/vnd.commerce-battelle": [],
+ "application/vnd.commonspace": [
+ "csp"
+ ],
+ "application/vnd.contact.cmsg": [
+ "cdbcmsg"
+ ],
+ "application/vnd.cosmocaller": [
+ "cmc"
+ ],
+ "application/vnd.crick.clicker": [
+ "clkx"
+ ],
+ "application/vnd.crick.clicker.keyboard": [
+ "clkk"
+ ],
+ "application/vnd.crick.clicker.palette": [
+ "clkp"
+ ],
+ "application/vnd.crick.clicker.template": [
+ "clkt"
+ ],
+ "application/vnd.crick.clicker.wordbank": [
+ "clkw"
+ ],
+ "application/vnd.criticaltools.wbs+xml": [
+ "wbs"
+ ],
+ "application/vnd.ctc-posml": [
+ "pml"
+ ],
+ "application/vnd.ctct.ws+xml": [],
+ "application/vnd.cups-pdf": [],
+ "application/vnd.cups-postscript": [],
+ "application/vnd.cups-ppd": [
+ "ppd"
+ ],
+ "application/vnd.cups-raster": [],
+ "application/vnd.cups-raw": [],
+ "application/vnd.curl": [],
+ "application/vnd.curl.car": [
+ "car"
+ ],
+ "application/vnd.curl.pcurl": [
+ "pcurl"
+ ],
+ "application/vnd.cybank": [],
+ "application/vnd.dart": [
+ "dart"
+ ],
+ "application/vnd.data-vision.rdz": [
+ "rdz"
+ ],
+ "application/vnd.dece.data": [
+ "uvf",
+ "uvvf",
+ "uvd",
+ "uvvd"
+ ],
+ "application/vnd.dece.ttml+xml": [
+ "uvt",
+ "uvvt"
+ ],
+ "application/vnd.dece.unspecified": [
+ "uvx",
+ "uvvx"
+ ],
+ "application/vnd.dece.zip": [
+ "uvz",
+ "uvvz"
+ ],
+ "application/vnd.denovo.fcselayout-link": [
+ "fe_launch"
+ ],
+ "application/vnd.dir-bi.plate-dl-nosuffix": [],
+ "application/vnd.dna": [
+ "dna"
+ ],
+ "application/vnd.dolby.mlp": [
+ "mlp"
+ ],
+ "application/vnd.dolby.mobile.1": [],
+ "application/vnd.dolby.mobile.2": [],
+ "application/vnd.dpgraph": [
+ "dpg"
+ ],
+ "application/vnd.dreamfactory": [
+ "dfac"
+ ],
+ "application/vnd.ds-keypoint": [
+ "kpxx"
+ ],
+ "application/vnd.dvb.ait": [
+ "ait"
+ ],
+ "application/vnd.dvb.dvbj": [],
+ "application/vnd.dvb.esgcontainer": [],
+ "application/vnd.dvb.ipdcdftnotifaccess": [],
+ "application/vnd.dvb.ipdcesgaccess": [],
+ "application/vnd.dvb.ipdcesgaccess2": [],
+ "application/vnd.dvb.ipdcesgpdd": [],
+ "application/vnd.dvb.ipdcroaming": [],
+ "application/vnd.dvb.iptv.alfec-base": [],
+ "application/vnd.dvb.iptv.alfec-enhancement": [],
+ "application/vnd.dvb.notif-aggregate-root+xml": [],
+ "application/vnd.dvb.notif-container+xml": [],
+ "application/vnd.dvb.notif-generic+xml": [],
+ "application/vnd.dvb.notif-ia-msglist+xml": [],
+ "application/vnd.dvb.notif-ia-registration-request+xml": [],
+ "application/vnd.dvb.notif-ia-registration-response+xml": [],
+ "application/vnd.dvb.notif-init+xml": [],
+ "application/vnd.dvb.pfr": [],
+ "application/vnd.dvb.service": [
+ "svc"
+ ],
+ "application/vnd.dxr": [],
+ "application/vnd.dynageo": [
+ "geo"
+ ],
+ "application/vnd.easykaraoke.cdgdownload": [],
+ "application/vnd.ecdis-update": [],
+ "application/vnd.ecowin.chart": [
+ "mag"
+ ],
+ "application/vnd.ecowin.filerequest": [],
+ "application/vnd.ecowin.fileupdate": [],
+ "application/vnd.ecowin.series": [],
+ "application/vnd.ecowin.seriesrequest": [],
+ "application/vnd.ecowin.seriesupdate": [],
+ "application/vnd.emclient.accessrequest+xml": [],
+ "application/vnd.enliven": [
+ "nml"
+ ],
+ "application/vnd.eprints.data+xml": [],
+ "application/vnd.epson.esf": [
+ "esf"
+ ],
+ "application/vnd.epson.msf": [
+ "msf"
+ ],
+ "application/vnd.epson.quickanime": [
+ "qam"
+ ],
+ "application/vnd.epson.salt": [
+ "slt"
+ ],
+ "application/vnd.epson.ssf": [
+ "ssf"
+ ],
+ "application/vnd.ericsson.quickcall": [],
+ "application/vnd.eszigno3+xml": [
+ "es3",
+ "et3"
+ ],
+ "application/vnd.etsi.aoc+xml": [],
+ "application/vnd.etsi.cug+xml": [],
+ "application/vnd.etsi.iptvcommand+xml": [],
+ "application/vnd.etsi.iptvdiscovery+xml": [],
+ "application/vnd.etsi.iptvprofile+xml": [],
+ "application/vnd.etsi.iptvsad-bc+xml": [],
+ "application/vnd.etsi.iptvsad-cod+xml": [],
+ "application/vnd.etsi.iptvsad-npvr+xml": [],
+ "application/vnd.etsi.iptvservice+xml": [],
+ "application/vnd.etsi.iptvsync+xml": [],
+ "application/vnd.etsi.iptvueprofile+xml": [],
+ "application/vnd.etsi.mcid+xml": [],
+ "application/vnd.etsi.overload-control-policy-dataset+xml": [],
+ "application/vnd.etsi.sci+xml": [],
+ "application/vnd.etsi.simservs+xml": [],
+ "application/vnd.etsi.tsl+xml": [],
+ "application/vnd.etsi.tsl.der": [],
+ "application/vnd.eudora.data": [],
+ "application/vnd.ezpix-album": [
+ "ez2"
+ ],
+ "application/vnd.ezpix-package": [
+ "ez3"
+ ],
+ "application/vnd.f-secure.mobile": [],
+ "application/vnd.fdf": [
+ "fdf"
+ ],
+ "application/vnd.fdsn.mseed": [
+ "mseed"
+ ],
+ "application/vnd.fdsn.seed": [
+ "seed",
+ "dataless"
+ ],
+ "application/vnd.ffsns": [],
+ "application/vnd.fints": [],
+ "application/vnd.flographit": [
+ "gph"
+ ],
+ "application/vnd.fluxtime.clip": [
+ "ftc"
+ ],
+ "application/vnd.font-fontforge-sfd": [],
+ "application/vnd.framemaker": [
+ "fm",
+ "frame",
+ "maker",
+ "book"
+ ],
+ "application/vnd.frogans.fnc": [
+ "fnc"
+ ],
+ "application/vnd.frogans.ltf": [
+ "ltf"
+ ],
+ "application/vnd.fsc.weblaunch": [
+ "fsc"
+ ],
+ "application/vnd.fujitsu.oasys": [
+ "oas"
+ ],
+ "application/vnd.fujitsu.oasys2": [
+ "oa2"
+ ],
+ "application/vnd.fujitsu.oasys3": [
+ "oa3"
+ ],
+ "application/vnd.fujitsu.oasysgp": [
+ "fg5"
+ ],
+ "application/vnd.fujitsu.oasysprs": [
+ "bh2"
+ ],
+ "application/vnd.fujixerox.art-ex": [],
+ "application/vnd.fujixerox.art4": [],
+ "application/vnd.fujixerox.hbpl": [],
+ "application/vnd.fujixerox.ddd": [
+ "ddd"
+ ],
+ "application/vnd.fujixerox.docuworks": [
+ "xdw"
+ ],
+ "application/vnd.fujixerox.docuworks.binder": [
+ "xbd"
+ ],
+ "application/vnd.fut-misnet": [],
+ "application/vnd.fuzzysheet": [
+ "fzs"
+ ],
+ "application/vnd.genomatix.tuxedo": [
+ "txd"
+ ],
+ "application/vnd.geocube+xml": [],
+ "application/vnd.geogebra.file": [
+ "ggb"
+ ],
+ "application/vnd.geogebra.tool": [
+ "ggt"
+ ],
+ "application/vnd.geometry-explorer": [
+ "gex",
+ "gre"
+ ],
+ "application/vnd.geonext": [
+ "gxt"
+ ],
+ "application/vnd.geoplan": [
+ "g2w"
+ ],
+ "application/vnd.geospace": [
+ "g3w"
+ ],
+ "application/vnd.globalplatform.card-content-mgt": [],
+ "application/vnd.globalplatform.card-content-mgt-response": [],
+ "application/vnd.gmx": [
+ "gmx"
+ ],
+ "application/vnd.google-earth.kml+xml": [
+ "kml"
+ ],
+ "application/vnd.google-earth.kmz": [
+ "kmz"
+ ],
+ "application/vnd.grafeq": [
+ "gqf",
+ "gqs"
+ ],
+ "application/vnd.gridmp": [],
+ "application/vnd.groove-account": [
+ "gac"
+ ],
+ "application/vnd.groove-help": [
+ "ghf"
+ ],
+ "application/vnd.groove-identity-message": [
+ "gim"
+ ],
+ "application/vnd.groove-injector": [
+ "grv"
+ ],
+ "application/vnd.groove-tool-message": [
+ "gtm"
+ ],
+ "application/vnd.groove-tool-template": [
+ "tpl"
+ ],
+ "application/vnd.groove-vcard": [
+ "vcg"
+ ],
+ "application/vnd.hal+json": [],
+ "application/vnd.hal+xml": [
+ "hal"
+ ],
+ "application/vnd.handheld-entertainment+xml": [
+ "zmm"
+ ],
+ "application/vnd.hbci": [
+ "hbci"
+ ],
+ "application/vnd.hcl-bireports": [],
+ "application/vnd.hhe.lesson-player": [
+ "les"
+ ],
+ "application/vnd.hp-hpgl": [
+ "hpgl"
+ ],
+ "application/vnd.hp-hpid": [
+ "hpid"
+ ],
+ "application/vnd.hp-hps": [
+ "hps"
+ ],
+ "application/vnd.hp-jlyt": [
+ "jlt"
+ ],
+ "application/vnd.hp-pcl": [
+ "pcl"
+ ],
+ "application/vnd.hp-pclxl": [
+ "pclxl"
+ ],
+ "application/vnd.httphone": [],
+ "application/vnd.hzn-3d-crossword": [],
+ "application/vnd.ibm.afplinedata": [],
+ "application/vnd.ibm.electronic-media": [],
+ "application/vnd.ibm.minipay": [
+ "mpy"
+ ],
+ "application/vnd.ibm.modcap": [
+ "afp",
+ "listafp",
+ "list3820"
+ ],
+ "application/vnd.ibm.rights-management": [
+ "irm"
+ ],
+ "application/vnd.ibm.secure-container": [
+ "sc"
+ ],
+ "application/vnd.iccprofile": [
+ "icc",
+ "icm"
+ ],
+ "application/vnd.igloader": [
+ "igl"
+ ],
+ "application/vnd.immervision-ivp": [
+ "ivp"
+ ],
+ "application/vnd.immervision-ivu": [
+ "ivu"
+ ],
+ "application/vnd.informedcontrol.rms+xml": [],
+ "application/vnd.informix-visionary": [],
+ "application/vnd.infotech.project": [],
+ "application/vnd.infotech.project+xml": [],
+ "application/vnd.innopath.wamp.notification": [],
+ "application/vnd.insors.igm": [
+ "igm"
+ ],
+ "application/vnd.intercon.formnet": [
+ "xpw",
+ "xpx"
+ ],
+ "application/vnd.intergeo": [
+ "i2g"
+ ],
+ "application/vnd.intertrust.digibox": [],
+ "application/vnd.intertrust.nncp": [],
+ "application/vnd.intu.qbo": [
+ "qbo"
+ ],
+ "application/vnd.intu.qfx": [
+ "qfx"
+ ],
+ "application/vnd.iptc.g2.conceptitem+xml": [],
+ "application/vnd.iptc.g2.knowledgeitem+xml": [],
+ "application/vnd.iptc.g2.newsitem+xml": [],
+ "application/vnd.iptc.g2.newsmessage+xml": [],
+ "application/vnd.iptc.g2.packageitem+xml": [],
+ "application/vnd.iptc.g2.planningitem+xml": [],
+ "application/vnd.ipunplugged.rcprofile": [
+ "rcprofile"
+ ],
+ "application/vnd.irepository.package+xml": [
+ "irp"
+ ],
+ "application/vnd.is-xpr": [
+ "xpr"
+ ],
+ "application/vnd.isac.fcs": [
+ "fcs"
+ ],
+ "application/vnd.jam": [
+ "jam"
+ ],
+ "application/vnd.japannet-directory-service": [],
+ "application/vnd.japannet-jpnstore-wakeup": [],
+ "application/vnd.japannet-payment-wakeup": [],
+ "application/vnd.japannet-registration": [],
+ "application/vnd.japannet-registration-wakeup": [],
+ "application/vnd.japannet-setstore-wakeup": [],
+ "application/vnd.japannet-verification": [],
+ "application/vnd.japannet-verification-wakeup": [],
+ "application/vnd.jcp.javame.midlet-rms": [
+ "rms"
+ ],
+ "application/vnd.jisp": [
+ "jisp"
+ ],
+ "application/vnd.joost.joda-archive": [
+ "joda"
+ ],
+ "application/vnd.kahootz": [
+ "ktz",
+ "ktr"
+ ],
+ "application/vnd.kde.karbon": [
+ "karbon"
+ ],
+ "application/vnd.kde.kchart": [
+ "chrt"
+ ],
+ "application/vnd.kde.kformula": [
+ "kfo"
+ ],
+ "application/vnd.kde.kivio": [
+ "flw"
+ ],
+ "application/vnd.kde.kontour": [
+ "kon"
+ ],
+ "application/vnd.kde.kpresenter": [
+ "kpr",
+ "kpt"
+ ],
+ "application/vnd.kde.kspread": [
+ "ksp"
+ ],
+ "application/vnd.kde.kword": [
+ "kwd",
+ "kwt"
+ ],
+ "application/vnd.kenameaapp": [
+ "htke"
+ ],
+ "application/vnd.kidspiration": [
+ "kia"
+ ],
+ "application/vnd.kinar": [
+ "kne",
+ "knp"
+ ],
+ "application/vnd.koan": [
+ "skp",
+ "skd",
+ "skt",
+ "skm"
+ ],
+ "application/vnd.kodak-descriptor": [
+ "sse"
+ ],
+ "application/vnd.las.las+xml": [
+ "lasxml"
+ ],
+ "application/vnd.liberty-request+xml": [],
+ "application/vnd.llamagraphics.life-balance.desktop": [
+ "lbd"
+ ],
+ "application/vnd.llamagraphics.life-balance.exchange+xml": [
+ "lbe"
+ ],
+ "application/vnd.lotus-1-2-3": [
+ "123"
+ ],
+ "application/vnd.lotus-approach": [
+ "apr"
+ ],
+ "application/vnd.lotus-freelance": [
+ "pre"
+ ],
+ "application/vnd.lotus-notes": [
+ "nsf"
+ ],
+ "application/vnd.lotus-organizer": [
+ "org"
+ ],
+ "application/vnd.lotus-screencam": [
+ "scm"
+ ],
+ "application/vnd.lotus-wordpro": [
+ "lwp"
+ ],
+ "application/vnd.macports.portpkg": [
+ "portpkg"
+ ],
+ "application/vnd.marlin.drm.actiontoken+xml": [],
+ "application/vnd.marlin.drm.conftoken+xml": [],
+ "application/vnd.marlin.drm.license+xml": [],
+ "application/vnd.marlin.drm.mdcf": [],
+ "application/vnd.mcd": [
+ "mcd"
+ ],
+ "application/vnd.medcalcdata": [
+ "mc1"
+ ],
+ "application/vnd.mediastation.cdkey": [
+ "cdkey"
+ ],
+ "application/vnd.meridian-slingshot": [],
+ "application/vnd.mfer": [
+ "mwf"
+ ],
+ "application/vnd.mfmp": [
+ "mfm"
+ ],
+ "application/vnd.micrografx.flo": [
+ "flo"
+ ],
+ "application/vnd.micrografx.igx": [
+ "igx"
+ ],
+ "application/vnd.mif": [
+ "mif"
+ ],
+ "application/vnd.minisoft-hp3000-save": [],
+ "application/vnd.mitsubishi.misty-guard.trustweb": [],
+ "application/vnd.mobius.daf": [
+ "daf"
+ ],
+ "application/vnd.mobius.dis": [
+ "dis"
+ ],
+ "application/vnd.mobius.mbk": [
+ "mbk"
+ ],
+ "application/vnd.mobius.mqy": [
+ "mqy"
+ ],
+ "application/vnd.mobius.msl": [
+ "msl"
+ ],
+ "application/vnd.mobius.plc": [
+ "plc"
+ ],
+ "application/vnd.mobius.txf": [
+ "txf"
+ ],
+ "application/vnd.mophun.application": [
+ "mpn"
+ ],
+ "application/vnd.mophun.certificate": [
+ "mpc"
+ ],
+ "application/vnd.motorola.flexsuite": [],
+ "application/vnd.motorola.flexsuite.adsi": [],
+ "application/vnd.motorola.flexsuite.fis": [],
+ "application/vnd.motorola.flexsuite.gotap": [],
+ "application/vnd.motorola.flexsuite.kmr": [],
+ "application/vnd.motorola.flexsuite.ttc": [],
+ "application/vnd.motorola.flexsuite.wem": [],
+ "application/vnd.motorola.iprm": [],
+ "application/vnd.mozilla.xul+xml": [
+ "xul"
+ ],
+ "application/vnd.ms-artgalry": [
+ "cil"
+ ],
+ "application/vnd.ms-asf": [],
+ "application/vnd.ms-cab-compressed": [
+ "cab"
+ ],
+ "application/vnd.ms-color.iccprofile": [],
+ "application/vnd.ms-excel": [
+ "xls",
+ "xlm",
+ "xla",
+ "xlc",
+ "xlt",
+ "xlw"
+ ],
+ "application/vnd.ms-excel.addin.macroenabled.12": [
+ "xlam"
+ ],
+ "application/vnd.ms-excel.sheet.binary.macroenabled.12": [
+ "xlsb"
+ ],
+ "application/vnd.ms-excel.sheet.macroenabled.12": [
+ "xlsm"
+ ],
+ "application/vnd.ms-excel.template.macroenabled.12": [
+ "xltm"
+ ],
+ "application/vnd.ms-fontobject": [
+ "eot"
+ ],
+ "application/vnd.ms-htmlhelp": [
+ "chm"
+ ],
+ "application/vnd.ms-ims": [
+ "ims"
+ ],
+ "application/vnd.ms-lrm": [
+ "lrm"
+ ],
+ "application/vnd.ms-office.activex+xml": [],
+ "application/vnd.ms-officetheme": [
+ "thmx"
+ ],
+ "application/vnd.ms-opentype": [],
+ "application/vnd.ms-package.obfuscated-opentype": [],
+ "application/vnd.ms-pki.seccat": [
+ "cat"
+ ],
+ "application/vnd.ms-pki.stl": [
+ "stl"
+ ],
+ "application/vnd.ms-playready.initiator+xml": [],
+ "application/vnd.ms-powerpoint": [
+ "ppt",
+ "pps",
+ "pot"
+ ],
+ "application/vnd.ms-powerpoint.addin.macroenabled.12": [
+ "ppam"
+ ],
+ "application/vnd.ms-powerpoint.presentation.macroenabled.12": [
+ "pptm"
+ ],
+ "application/vnd.ms-powerpoint.slide.macroenabled.12": [
+ "sldm"
+ ],
+ "application/vnd.ms-powerpoint.slideshow.macroenabled.12": [
+ "ppsm"
+ ],
+ "application/vnd.ms-powerpoint.template.macroenabled.12": [
+ "potm"
+ ],
+ "application/vnd.ms-printing.printticket+xml": [],
+ "application/vnd.ms-project": [
+ "mpp",
+ "mpt"
+ ],
+ "application/vnd.ms-tnef": [],
+ "application/vnd.ms-wmdrm.lic-chlg-req": [],
+ "application/vnd.ms-wmdrm.lic-resp": [],
+ "application/vnd.ms-wmdrm.meter-chlg-req": [],
+ "application/vnd.ms-wmdrm.meter-resp": [],
+ "application/vnd.ms-word.document.macroenabled.12": [
+ "docm"
+ ],
+ "application/vnd.ms-word.template.macroenabled.12": [
+ "dotm"
+ ],
+ "application/vnd.ms-works": [
+ "wps",
+ "wks",
+ "wcm",
+ "wdb"
+ ],
+ "application/vnd.ms-wpl": [
+ "wpl"
+ ],
+ "application/vnd.ms-xpsdocument": [
+ "xps"
+ ],
+ "application/vnd.mseq": [
+ "mseq"
+ ],
+ "application/vnd.msign": [],
+ "application/vnd.multiad.creator": [],
+ "application/vnd.multiad.creator.cif": [],
+ "application/vnd.music-niff": [],
+ "application/vnd.musician": [
+ "mus"
+ ],
+ "application/vnd.muvee.style": [
+ "msty"
+ ],
+ "application/vnd.mynfc": [
+ "taglet"
+ ],
+ "application/vnd.ncd.control": [],
+ "application/vnd.ncd.reference": [],
+ "application/vnd.nervana": [],
+ "application/vnd.netfpx": [],
+ "application/vnd.neurolanguage.nlu": [
+ "nlu"
+ ],
+ "application/vnd.nitf": [
+ "ntf",
+ "nitf"
+ ],
+ "application/vnd.noblenet-directory": [
+ "nnd"
+ ],
+ "application/vnd.noblenet-sealer": [
+ "nns"
+ ],
+ "application/vnd.noblenet-web": [
+ "nnw"
+ ],
+ "application/vnd.nokia.catalogs": [],
+ "application/vnd.nokia.conml+wbxml": [],
+ "application/vnd.nokia.conml+xml": [],
+ "application/vnd.nokia.isds-radio-presets": [],
+ "application/vnd.nokia.iptv.config+xml": [],
+ "application/vnd.nokia.landmark+wbxml": [],
+ "application/vnd.nokia.landmark+xml": [],
+ "application/vnd.nokia.landmarkcollection+xml": [],
+ "application/vnd.nokia.n-gage.ac+xml": [],
+ "application/vnd.nokia.n-gage.data": [
+ "ngdat"
+ ],
+ "application/vnd.nokia.ncd": [],
+ "application/vnd.nokia.pcd+wbxml": [],
+ "application/vnd.nokia.pcd+xml": [],
+ "application/vnd.nokia.radio-preset": [
+ "rpst"
+ ],
+ "application/vnd.nokia.radio-presets": [
+ "rpss"
+ ],
+ "application/vnd.novadigm.edm": [
+ "edm"
+ ],
+ "application/vnd.novadigm.edx": [
+ "edx"
+ ],
+ "application/vnd.novadigm.ext": [
+ "ext"
+ ],
+ "application/vnd.ntt-local.file-transfer": [],
+ "application/vnd.ntt-local.sip-ta_remote": [],
+ "application/vnd.ntt-local.sip-ta_tcp_stream": [],
+ "application/vnd.oasis.opendocument.chart": [
+ "odc"
+ ],
+ "application/vnd.oasis.opendocument.chart-template": [
+ "otc"
+ ],
+ "application/vnd.oasis.opendocument.database": [
+ "odb"
+ ],
+ "application/vnd.oasis.opendocument.formula": [
+ "odf"
+ ],
+ "application/vnd.oasis.opendocument.formula-template": [
+ "odft"
+ ],
+ "application/vnd.oasis.opendocument.graphics": [
+ "odg"
+ ],
+ "application/vnd.oasis.opendocument.graphics-template": [
+ "otg"
+ ],
+ "application/vnd.oasis.opendocument.image": [
+ "odi"
+ ],
+ "application/vnd.oasis.opendocument.image-template": [
+ "oti"
+ ],
+ "application/vnd.oasis.opendocument.presentation": [
+ "odp"
+ ],
+ "application/vnd.oasis.opendocument.presentation-template": [
+ "otp"
+ ],
+ "application/vnd.oasis.opendocument.spreadsheet": [
+ "ods"
+ ],
+ "application/vnd.oasis.opendocument.spreadsheet-template": [
+ "ots"
+ ],
+ "application/vnd.oasis.opendocument.text": [
+ "odt"
+ ],
+ "application/vnd.oasis.opendocument.text-master": [
+ "odm"
+ ],
+ "application/vnd.oasis.opendocument.text-template": [
+ "ott"
+ ],
+ "application/vnd.oasis.opendocument.text-web": [
+ "oth"
+ ],
+ "application/vnd.obn": [],
+ "application/vnd.oftn.l10n+json": [],
+ "application/vnd.oipf.contentaccessdownload+xml": [],
+ "application/vnd.oipf.contentaccessstreaming+xml": [],
+ "application/vnd.oipf.cspg-hexbinary": [],
+ "application/vnd.oipf.dae.svg+xml": [],
+ "application/vnd.oipf.dae.xhtml+xml": [],
+ "application/vnd.oipf.mippvcontrolmessage+xml": [],
+ "application/vnd.oipf.pae.gem": [],
+ "application/vnd.oipf.spdiscovery+xml": [],
+ "application/vnd.oipf.spdlist+xml": [],
+ "application/vnd.oipf.ueprofile+xml": [],
+ "application/vnd.oipf.userprofile+xml": [],
+ "application/vnd.olpc-sugar": [
+ "xo"
+ ],
+ "application/vnd.oma-scws-config": [],
+ "application/vnd.oma-scws-http-request": [],
+ "application/vnd.oma-scws-http-response": [],
+ "application/vnd.oma.bcast.associated-procedure-parameter+xml": [],
+ "application/vnd.oma.bcast.drm-trigger+xml": [],
+ "application/vnd.oma.bcast.imd+xml": [],
+ "application/vnd.oma.bcast.ltkm": [],
+ "application/vnd.oma.bcast.notification+xml": [],
+ "application/vnd.oma.bcast.provisioningtrigger": [],
+ "application/vnd.oma.bcast.sgboot": [],
+ "application/vnd.oma.bcast.sgdd+xml": [],
+ "application/vnd.oma.bcast.sgdu": [],
+ "application/vnd.oma.bcast.simple-symbol-container": [],
+ "application/vnd.oma.bcast.smartcard-trigger+xml": [],
+ "application/vnd.oma.bcast.sprov+xml": [],
+ "application/vnd.oma.bcast.stkm": [],
+ "application/vnd.oma.cab-address-book+xml": [],
+ "application/vnd.oma.cab-feature-handler+xml": [],
+ "application/vnd.oma.cab-pcc+xml": [],
+ "application/vnd.oma.cab-user-prefs+xml": [],
+ "application/vnd.oma.dcd": [],
+ "application/vnd.oma.dcdc": [],
+ "application/vnd.oma.dd2+xml": [
+ "dd2"
+ ],
+ "application/vnd.oma.drm.risd+xml": [],
+ "application/vnd.oma.group-usage-list+xml": [],
+ "application/vnd.oma.pal+xml": [],
+ "application/vnd.oma.poc.detailed-progress-report+xml": [],
+ "application/vnd.oma.poc.final-report+xml": [],
+ "application/vnd.oma.poc.groups+xml": [],
+ "application/vnd.oma.poc.invocation-descriptor+xml": [],
+ "application/vnd.oma.poc.optimized-progress-report+xml": [],
+ "application/vnd.oma.push": [],
+ "application/vnd.oma.scidm.messages+xml": [],
+ "application/vnd.oma.xcap-directory+xml": [],
+ "application/vnd.omads-email+xml": [],
+ "application/vnd.omads-file+xml": [],
+ "application/vnd.omads-folder+xml": [],
+ "application/vnd.omaloc-supl-init": [],
+ "application/vnd.openofficeorg.extension": [
+ "oxt"
+ ],
+ "application/vnd.openxmlformats-officedocument.custom-properties+xml": [],
+ "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": [],
+ "application/vnd.openxmlformats-officedocument.drawing+xml": [],
+ "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": [],
+ "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": [],
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": [],
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": [],
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": [],
+ "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": [],
+ "application/vnd.openxmlformats-officedocument.extended-properties+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation": [
+ "pptx"
+ ],
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.slide": [
+ "sldx"
+ ],
+ "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow": [
+ "ppsx"
+ ],
+ "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.template": [
+ "potx"
+ ],
+ "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": [],
+ "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [
+ "xlsx"
+ ],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template": [
+ "xltx"
+ ],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": [],
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": [],
+ "application/vnd.openxmlformats-officedocument.theme+xml": [],
+ "application/vnd.openxmlformats-officedocument.themeoverride+xml": [],
+ "application/vnd.openxmlformats-officedocument.vmldrawing": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [
+ "docx"
+ ],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template": [
+ "dotx"
+ ],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": [],
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": [],
+ "application/vnd.openxmlformats-package.core-properties+xml": [],
+ "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": [],
+ "application/vnd.openxmlformats-package.relationships+xml": [],
+ "application/vnd.quobject-quoxdocument": [],
+ "application/vnd.osa.netdeploy": [],
+ "application/vnd.osgeo.mapguide.package": [
+ "mgp"
+ ],
+ "application/vnd.osgi.bundle": [],
+ "application/vnd.osgi.dp": [
+ "dp"
+ ],
+ "application/vnd.osgi.subsystem": [
+ "esa"
+ ],
+ "application/vnd.otps.ct-kip+xml": [],
+ "application/vnd.palm": [
+ "pdb",
+ "pqa",
+ "oprc"
+ ],
+ "application/vnd.paos.xml": [],
+ "application/vnd.pawaafile": [
+ "paw"
+ ],
+ "application/vnd.pg.format": [
+ "str"
+ ],
+ "application/vnd.pg.osasli": [
+ "ei6"
+ ],
+ "application/vnd.piaccess.application-licence": [],
+ "application/vnd.picsel": [
+ "efif"
+ ],
+ "application/vnd.pmi.widget": [
+ "wg"
+ ],
+ "application/vnd.poc.group-advertisement+xml": [],
+ "application/vnd.pocketlearn": [
+ "plf"
+ ],
+ "application/vnd.powerbuilder6": [
+ "pbd"
+ ],
+ "application/vnd.powerbuilder6-s": [],
+ "application/vnd.powerbuilder7": [],
+ "application/vnd.powerbuilder7-s": [],
+ "application/vnd.powerbuilder75": [],
+ "application/vnd.powerbuilder75-s": [],
+ "application/vnd.preminet": [],
+ "application/vnd.previewsystems.box": [
+ "box"
+ ],
+ "application/vnd.proteus.magazine": [
+ "mgz"
+ ],
+ "application/vnd.publishare-delta-tree": [
+ "qps"
+ ],
+ "application/vnd.pvi.ptid1": [
+ "ptid"
+ ],
+ "application/vnd.pwg-multiplexed": [],
+ "application/vnd.pwg-xhtml-print+xml": [],
+ "application/vnd.qualcomm.brew-app-res": [],
+ "application/vnd.quark.quarkxpress": [
+ "qxd",
+ "qxt",
+ "qwd",
+ "qwt",
+ "qxl",
+ "qxb"
+ ],
+ "application/vnd.radisys.moml+xml": [],
+ "application/vnd.radisys.msml+xml": [],
+ "application/vnd.radisys.msml-audit+xml": [],
+ "application/vnd.radisys.msml-audit-conf+xml": [],
+ "application/vnd.radisys.msml-audit-conn+xml": [],
+ "application/vnd.radisys.msml-audit-dialog+xml": [],
+ "application/vnd.radisys.msml-audit-stream+xml": [],
+ "application/vnd.radisys.msml-conf+xml": [],
+ "application/vnd.radisys.msml-dialog+xml": [],
+ "application/vnd.radisys.msml-dialog-base+xml": [],
+ "application/vnd.radisys.msml-dialog-fax-detect+xml": [],
+ "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": [],
+ "application/vnd.radisys.msml-dialog-group+xml": [],
+ "application/vnd.radisys.msml-dialog-speech+xml": [],
+ "application/vnd.radisys.msml-dialog-transform+xml": [],
+ "application/vnd.rainstor.data": [],
+ "application/vnd.rapid": [],
+ "application/vnd.realvnc.bed": [
+ "bed"
+ ],
+ "application/vnd.recordare.musicxml": [
+ "mxl"
+ ],
+ "application/vnd.recordare.musicxml+xml": [
+ "musicxml"
+ ],
+ "application/vnd.renlearn.rlprint": [],
+ "application/vnd.rig.cryptonote": [
+ "cryptonote"
+ ],
+ "application/vnd.rim.cod": [
+ "cod"
+ ],
+ "application/vnd.rn-realmedia": [
+ "rm"
+ ],
+ "application/vnd.rn-realmedia-vbr": [
+ "rmvb"
+ ],
+ "application/vnd.route66.link66+xml": [
+ "link66"
+ ],
+ "application/vnd.rs-274x": [],
+ "application/vnd.ruckus.download": [],
+ "application/vnd.s3sms": [],
+ "application/vnd.sailingtracker.track": [
+ "st"
+ ],
+ "application/vnd.sbm.cid": [],
+ "application/vnd.sbm.mid2": [],
+ "application/vnd.scribus": [],
+ "application/vnd.sealed.3df": [],
+ "application/vnd.sealed.csf": [],
+ "application/vnd.sealed.doc": [],
+ "application/vnd.sealed.eml": [],
+ "application/vnd.sealed.mht": [],
+ "application/vnd.sealed.net": [],
+ "application/vnd.sealed.ppt": [],
+ "application/vnd.sealed.tiff": [],
+ "application/vnd.sealed.xls": [],
+ "application/vnd.sealedmedia.softseal.html": [],
+ "application/vnd.sealedmedia.softseal.pdf": [],
+ "application/vnd.seemail": [
+ "see"
+ ],
+ "application/vnd.sema": [
+ "sema"
+ ],
+ "application/vnd.semd": [
+ "semd"
+ ],
+ "application/vnd.semf": [
+ "semf"
+ ],
+ "application/vnd.shana.informed.formdata": [
+ "ifm"
+ ],
+ "application/vnd.shana.informed.formtemplate": [
+ "itp"
+ ],
+ "application/vnd.shana.informed.interchange": [
+ "iif"
+ ],
+ "application/vnd.shana.informed.package": [
+ "ipk"
+ ],
+ "application/vnd.simtech-mindmapper": [
+ "twd",
+ "twds"
+ ],
+ "application/vnd.smaf": [
+ "mmf"
+ ],
+ "application/vnd.smart.notebook": [],
+ "application/vnd.smart.teacher": [
+ "teacher"
+ ],
+ "application/vnd.software602.filler.form+xml": [],
+ "application/vnd.software602.filler.form-xml-zip": [],
+ "application/vnd.solent.sdkm+xml": [
+ "sdkm",
+ "sdkd"
+ ],
+ "application/vnd.spotfire.dxp": [
+ "dxp"
+ ],
+ "application/vnd.spotfire.sfs": [
+ "sfs"
+ ],
+ "application/vnd.sss-cod": [],
+ "application/vnd.sss-dtf": [],
+ "application/vnd.sss-ntf": [],
+ "application/vnd.stardivision.calc": [
+ "sdc"
+ ],
+ "application/vnd.stardivision.draw": [
+ "sda"
+ ],
+ "application/vnd.stardivision.impress": [
+ "sdd"
+ ],
+ "application/vnd.stardivision.math": [
+ "smf"
+ ],
+ "application/vnd.stardivision.writer": [
+ "sdw",
+ "vor"
+ ],
+ "application/vnd.stardivision.writer-global": [
+ "sgl"
+ ],
+ "application/vnd.stepmania.package": [
+ "smzip"
+ ],
+ "application/vnd.stepmania.stepchart": [
+ "sm"
+ ],
+ "application/vnd.street-stream": [],
+ "application/vnd.sun.xml.calc": [
+ "sxc"
+ ],
+ "application/vnd.sun.xml.calc.template": [
+ "stc"
+ ],
+ "application/vnd.sun.xml.draw": [
+ "sxd"
+ ],
+ "application/vnd.sun.xml.draw.template": [
+ "std"
+ ],
+ "application/vnd.sun.xml.impress": [
+ "sxi"
+ ],
+ "application/vnd.sun.xml.impress.template": [
+ "sti"
+ ],
+ "application/vnd.sun.xml.math": [
+ "sxm"
+ ],
+ "application/vnd.sun.xml.writer": [
+ "sxw"
+ ],
+ "application/vnd.sun.xml.writer.global": [
+ "sxg"
+ ],
+ "application/vnd.sun.xml.writer.template": [
+ "stw"
+ ],
+ "application/vnd.sun.wadl+xml": [],
+ "application/vnd.sus-calendar": [
+ "sus",
+ "susp"
+ ],
+ "application/vnd.svd": [
+ "svd"
+ ],
+ "application/vnd.swiftview-ics": [],
+ "application/vnd.symbian.install": [
+ "sis",
+ "sisx"
+ ],
+ "application/vnd.syncml+xml": [
+ "xsm"
+ ],
+ "application/vnd.syncml.dm+wbxml": [
+ "bdm"
+ ],
+ "application/vnd.syncml.dm+xml": [
+ "xdm"
+ ],
+ "application/vnd.syncml.dm.notification": [],
+ "application/vnd.syncml.ds.notification": [],
+ "application/vnd.tao.intent-module-archive": [
+ "tao"
+ ],
+ "application/vnd.tcpdump.pcap": [
+ "pcap",
+ "cap",
+ "dmp"
+ ],
+ "application/vnd.tmobile-livetv": [
+ "tmo"
+ ],
+ "application/vnd.trid.tpt": [
+ "tpt"
+ ],
+ "application/vnd.triscape.mxs": [
+ "mxs"
+ ],
+ "application/vnd.trueapp": [
+ "tra"
+ ],
+ "application/vnd.truedoc": [],
+ "application/vnd.ubisoft.webplayer": [],
+ "application/vnd.ufdl": [
+ "ufd",
+ "ufdl"
+ ],
+ "application/vnd.uiq.theme": [
+ "utz"
+ ],
+ "application/vnd.umajin": [
+ "umj"
+ ],
+ "application/vnd.unity": [
+ "unityweb"
+ ],
+ "application/vnd.uoml+xml": [
+ "uoml"
+ ],
+ "application/vnd.uplanet.alert": [],
+ "application/vnd.uplanet.alert-wbxml": [],
+ "application/vnd.uplanet.bearer-choice": [],
+ "application/vnd.uplanet.bearer-choice-wbxml": [],
+ "application/vnd.uplanet.cacheop": [],
+ "application/vnd.uplanet.cacheop-wbxml": [],
+ "application/vnd.uplanet.channel": [],
+ "application/vnd.uplanet.channel-wbxml": [],
+ "application/vnd.uplanet.list": [],
+ "application/vnd.uplanet.list-wbxml": [],
+ "application/vnd.uplanet.listcmd": [],
+ "application/vnd.uplanet.listcmd-wbxml": [],
+ "application/vnd.uplanet.signal": [],
+ "application/vnd.vcx": [
+ "vcx"
+ ],
+ "application/vnd.vd-study": [],
+ "application/vnd.vectorworks": [],
+ "application/vnd.verimatrix.vcas": [],
+ "application/vnd.vidsoft.vidconference": [],
+ "application/vnd.visio": [
+ "vsd",
+ "vst",
+ "vss",
+ "vsw"
+ ],
+ "application/vnd.visionary": [
+ "vis"
+ ],
+ "application/vnd.vividence.scriptfile": [],
+ "application/vnd.vsf": [
+ "vsf"
+ ],
+ "application/vnd.wap.sic": [],
+ "application/vnd.wap.slc": [],
+ "application/vnd.wap.wbxml": [
+ "wbxml"
+ ],
+ "application/vnd.wap.wmlc": [
+ "wmlc"
+ ],
+ "application/vnd.wap.wmlscriptc": [
+ "wmlsc"
+ ],
+ "application/vnd.webturbo": [
+ "wtb"
+ ],
+ "application/vnd.wfa.wsc": [],
+ "application/vnd.wmc": [],
+ "application/vnd.wmf.bootstrap": [],
+ "application/vnd.wolfram.mathematica": [],
+ "application/vnd.wolfram.mathematica.package": [],
+ "application/vnd.wolfram.player": [
+ "nbp"
+ ],
+ "application/vnd.wordperfect": [
+ "wpd"
+ ],
+ "application/vnd.wqd": [
+ "wqd"
+ ],
+ "application/vnd.wrq-hp3000-labelled": [],
+ "application/vnd.wt.stf": [
+ "stf"
+ ],
+ "application/vnd.wv.csp+wbxml": [],
+ "application/vnd.wv.csp+xml": [],
+ "application/vnd.wv.ssp+xml": [],
+ "application/vnd.xara": [
+ "xar"
+ ],
+ "application/vnd.xfdl": [
+ "xfdl"
+ ],
+ "application/vnd.xfdl.webform": [],
+ "application/vnd.xmi+xml": [],
+ "application/vnd.xmpie.cpkg": [],
+ "application/vnd.xmpie.dpkg": [],
+ "application/vnd.xmpie.plan": [],
+ "application/vnd.xmpie.ppkg": [],
+ "application/vnd.xmpie.xlim": [],
+ "application/vnd.yamaha.hv-dic": [
+ "hvd"
+ ],
+ "application/vnd.yamaha.hv-script": [
+ "hvs"
+ ],
+ "application/vnd.yamaha.hv-voice": [
+ "hvp"
+ ],
+ "application/vnd.yamaha.openscoreformat": [
+ "osf"
+ ],
+ "application/vnd.yamaha.openscoreformat.osfpvg+xml": [
+ "osfpvg"
+ ],
+ "application/vnd.yamaha.remote-setup": [],
+ "application/vnd.yamaha.smaf-audio": [
+ "saf"
+ ],
+ "application/vnd.yamaha.smaf-phrase": [
+ "spf"
+ ],
+ "application/vnd.yamaha.through-ngn": [],
+ "application/vnd.yamaha.tunnel-udpencap": [],
+ "application/vnd.yellowriver-custom-menu": [
+ "cmp"
+ ],
+ "application/vnd.zul": [
+ "zir",
+ "zirz"
+ ],
+ "application/vnd.zzazz.deck+xml": [
+ "zaz"
+ ],
+ "application/voicexml+xml": [
+ "vxml"
+ ],
+ "application/vq-rtcpxr": [],
+ "application/watcherinfo+xml": [],
+ "application/whoispp-query": [],
+ "application/whoispp-response": [],
+ "application/widget": [
+ "wgt"
+ ],
+ "application/winhlp": [
+ "hlp"
+ ],
+ "application/wita": [],
+ "application/wordperfect5.1": [],
+ "application/wsdl+xml": [
+ "wsdl"
+ ],
+ "application/wspolicy+xml": [
+ "wspolicy"
+ ],
+ "application/x-7z-compressed": [
+ "7z"
+ ],
+ "application/x-abiword": [
+ "abw"
+ ],
+ "application/x-ace-compressed": [
+ "ace"
+ ],
+ "application/x-amf": [],
+ "application/x-apple-diskimage": [
+ "dmg"
+ ],
+ "application/x-authorware-bin": [
+ "aab",
+ "x32",
+ "u32",
+ "vox"
+ ],
+ "application/x-authorware-map": [
+ "aam"
+ ],
+ "application/x-authorware-seg": [
+ "aas"
+ ],
+ "application/x-bcpio": [
+ "bcpio"
+ ],
+ "application/x-bittorrent": [
+ "torrent"
+ ],
+ "application/x-blorb": [
+ "blb",
+ "blorb"
+ ],
+ "application/x-bzip": [
+ "bz"
+ ],
+ "application/x-bzip2": [
+ "bz2",
+ "boz"
+ ],
+ "application/x-cbr": [
+ "cbr",
+ "cba",
+ "cbt",
+ "cbz",
+ "cb7"
+ ],
+ "application/x-cdlink": [
+ "vcd"
+ ],
+ "application/x-cfs-compressed": [
+ "cfs"
+ ],
+ "application/x-chat": [
+ "chat"
+ ],
+ "application/x-chess-pgn": [
+ "pgn"
+ ],
+ "application/x-conference": [
+ "nsc"
+ ],
+ "application/x-compress": [],
+ "application/x-cpio": [
+ "cpio"
+ ],
+ "application/x-csh": [
+ "csh"
+ ],
+ "application/x-debian-package": [
+ "deb",
+ "udeb"
+ ],
+ "application/x-dgc-compressed": [
+ "dgc"
+ ],
+ "application/x-director": [
+ "dir",
+ "dcr",
+ "dxr",
+ "cst",
+ "cct",
+ "cxt",
+ "w3d",
+ "fgd",
+ "swa"
+ ],
+ "application/x-doom": [
+ "wad"
+ ],
+ "application/x-dtbncx+xml": [
+ "ncx"
+ ],
+ "application/x-dtbook+xml": [
+ "dtb"
+ ],
+ "application/x-dtbresource+xml": [
+ "res"
+ ],
+ "application/x-dvi": [
+ "dvi"
+ ],
+ "application/x-envoy": [
+ "evy"
+ ],
+ "application/x-eva": [
+ "eva"
+ ],
+ "application/x-font-bdf": [
+ "bdf"
+ ],
+ "application/x-font-dos": [],
+ "application/x-font-framemaker": [],
+ "application/x-font-ghostscript": [
+ "gsf"
+ ],
+ "application/x-font-libgrx": [],
+ "application/x-font-linux-psf": [
+ "psf"
+ ],
+ "application/x-font-otf": [
+ "otf"
+ ],
+ "application/x-font-pcf": [
+ "pcf"
+ ],
+ "application/x-font-snf": [
+ "snf"
+ ],
+ "application/x-font-speedo": [],
+ "application/x-font-sunos-news": [],
+ "application/x-font-ttf": [
+ "ttf",
+ "ttc"
+ ],
+ "application/x-font-type1": [
+ "pfa",
+ "pfb",
+ "pfm",
+ "afm"
+ ],
+ "application/font-woff": [
+ "woff"
+ ],
+ "application/x-font-vfont": [],
+ "application/x-freearc": [
+ "arc"
+ ],
+ "application/x-futuresplash": [
+ "spl"
+ ],
+ "application/x-gca-compressed": [
+ "gca"
+ ],
+ "application/x-glulx": [
+ "ulx"
+ ],
+ "application/x-gnumeric": [
+ "gnumeric"
+ ],
+ "application/x-gramps-xml": [
+ "gramps"
+ ],
+ "application/x-gtar": [
+ "gtar"
+ ],
+ "application/x-gzip": [],
+ "application/x-hdf": [
+ "hdf"
+ ],
+ "application/x-install-instructions": [
+ "install"
+ ],
+ "application/x-iso9660-image": [
+ "iso"
+ ],
+ "application/x-java-jnlp-file": [
+ "jnlp"
+ ],
+ "application/x-latex": [
+ "latex"
+ ],
+ "application/x-lzh-compressed": [
+ "lzh",
+ "lha"
+ ],
+ "application/x-mie": [
+ "mie"
+ ],
+ "application/x-mobipocket-ebook": [
+ "prc",
+ "mobi"
+ ],
+ "application/x-ms-application": [
+ "application"
+ ],
+ "application/x-ms-shortcut": [
+ "lnk"
+ ],
+ "application/x-ms-wmd": [
+ "wmd"
+ ],
+ "application/x-ms-wmz": [
+ "wmz"
+ ],
+ "application/x-ms-xbap": [
+ "xbap"
+ ],
+ "application/x-msaccess": [
+ "mdb"
+ ],
+ "application/x-msbinder": [
+ "obd"
+ ],
+ "application/x-mscardfile": [
+ "crd"
+ ],
+ "application/x-msclip": [
+ "clp"
+ ],
+ "application/x-msdownload": [
+ "exe",
+ "dll",
+ "com",
+ "bat",
+ "msi"
+ ],
+ "application/x-msmediaview": [
+ "mvb",
+ "m13",
+ "m14"
+ ],
+ "application/x-msmetafile": [
+ "wmf",
+ "wmz",
+ "emf",
+ "emz"
+ ],
+ "application/x-msmoney": [
+ "mny"
+ ],
+ "application/x-mspublisher": [
+ "pub"
+ ],
+ "application/x-msschedule": [
+ "scd"
+ ],
+ "application/x-msterminal": [
+ "trm"
+ ],
+ "application/x-mswrite": [
+ "wri"
+ ],
+ "application/x-netcdf": [
+ "nc",
+ "cdf"
+ ],
+ "application/x-nzb": [
+ "nzb"
+ ],
+ "application/x-pkcs12": [
+ "p12",
+ "pfx"
+ ],
+ "application/x-pkcs7-certificates": [
+ "p7b",
+ "spc"
+ ],
+ "application/x-pkcs7-certreqresp": [
+ "p7r"
+ ],
+ "application/x-rar-compressed": [
+ "rar"
+ ],
+ "application/x-research-info-systems": [
+ "ris"
+ ],
+ "application/x-sh": [
+ "sh"
+ ],
+ "application/x-shar": [
+ "shar"
+ ],
+ "application/x-shockwave-flash": [
+ "swf"
+ ],
+ "application/x-silverlight-app": [
+ "xap"
+ ],
+ "application/x-sql": [
+ "sql"
+ ],
+ "application/x-stuffit": [
+ "sit"
+ ],
+ "application/x-stuffitx": [
+ "sitx"
+ ],
+ "application/x-subrip": [
+ "srt"
+ ],
+ "application/x-sv4cpio": [
+ "sv4cpio"
+ ],
+ "application/x-sv4crc": [
+ "sv4crc"
+ ],
+ "application/x-t3vm-image": [
+ "t3"
+ ],
+ "application/x-tads": [
+ "gam"
+ ],
+ "application/x-tar": [
+ "tar"
+ ],
+ "application/x-tcl": [
+ "tcl"
+ ],
+ "application/x-tex": [
+ "tex"
+ ],
+ "application/x-tex-tfm": [
+ "tfm"
+ ],
+ "application/x-texinfo": [
+ "texinfo",
+ "texi"
+ ],
+ "application/x-tgif": [
+ "obj"
+ ],
+ "application/x-ustar": [
+ "ustar"
+ ],
+ "application/x-wais-source": [
+ "src"
+ ],
+ "application/x-x509-ca-cert": [
+ "der",
+ "crt"
+ ],
+ "application/x-xfig": [
+ "fig"
+ ],
+ "application/x-xliff+xml": [
+ "xlf"
+ ],
+ "application/x-xpinstall": [
+ "xpi"
+ ],
+ "application/x-xz": [
+ "xz"
+ ],
+ "application/x-zmachine": [
+ "z1",
+ "z2",
+ "z3",
+ "z4",
+ "z5",
+ "z6",
+ "z7",
+ "z8"
+ ],
+ "application/x400-bp": [],
+ "application/xaml+xml": [
+ "xaml"
+ ],
+ "application/xcap-att+xml": [],
+ "application/xcap-caps+xml": [],
+ "application/xcap-diff+xml": [
+ "xdf"
+ ],
+ "application/xcap-el+xml": [],
+ "application/xcap-error+xml": [],
+ "application/xcap-ns+xml": [],
+ "application/xcon-conference-info-diff+xml": [],
+ "application/xcon-conference-info+xml": [],
+ "application/xenc+xml": [
+ "xenc"
+ ],
+ "application/xhtml+xml": [
+ "xhtml",
+ "xht"
+ ],
+ "application/xhtml-voice+xml": [],
+ "application/xml": [
+ "xml",
+ "xsl"
+ ],
+ "application/xml-dtd": [
+ "dtd"
+ ],
+ "application/xml-external-parsed-entity": [],
+ "application/xmpp+xml": [],
+ "application/xop+xml": [
+ "xop"
+ ],
+ "application/xproc+xml": [
+ "xpl"
+ ],
+ "application/xslt+xml": [
+ "xslt"
+ ],
+ "application/xspf+xml": [
+ "xspf"
+ ],
+ "application/xv+xml": [
+ "mxml",
+ "xhvml",
+ "xvml",
+ "xvm"
+ ],
+ "application/yang": [
+ "yang"
+ ],
+ "application/yin+xml": [
+ "yin"
+ ],
+ "application/zip": [
+ "zip"
+ ],
+ "audio/1d-interleaved-parityfec": [],
+ "audio/32kadpcm": [],
+ "audio/3gpp": [],
+ "audio/3gpp2": [],
+ "audio/ac3": [],
+ "audio/adpcm": [
+ "adp"
+ ],
+ "audio/amr": [],
+ "audio/amr-wb": [],
+ "audio/amr-wb+": [],
+ "audio/asc": [],
+ "audio/atrac-advanced-lossless": [],
+ "audio/atrac-x": [],
+ "audio/atrac3": [],
+ "audio/basic": [
+ "au",
+ "snd"
+ ],
+ "audio/bv16": [],
+ "audio/bv32": [],
+ "audio/clearmode": [],
+ "audio/cn": [],
+ "audio/dat12": [],
+ "audio/dls": [],
+ "audio/dsr-es201108": [],
+ "audio/dsr-es202050": [],
+ "audio/dsr-es202211": [],
+ "audio/dsr-es202212": [],
+ "audio/dv": [],
+ "audio/dvi4": [],
+ "audio/eac3": [],
+ "audio/evrc": [],
+ "audio/evrc-qcp": [],
+ "audio/evrc0": [],
+ "audio/evrc1": [],
+ "audio/evrcb": [],
+ "audio/evrcb0": [],
+ "audio/evrcb1": [],
+ "audio/evrcwb": [],
+ "audio/evrcwb0": [],
+ "audio/evrcwb1": [],
+ "audio/example": [],
+ "audio/fwdred": [],
+ "audio/g719": [],
+ "audio/g722": [],
+ "audio/g7221": [],
+ "audio/g723": [],
+ "audio/g726-16": [],
+ "audio/g726-24": [],
+ "audio/g726-32": [],
+ "audio/g726-40": [],
+ "audio/g728": [],
+ "audio/g729": [],
+ "audio/g7291": [],
+ "audio/g729d": [],
+ "audio/g729e": [],
+ "audio/gsm": [],
+ "audio/gsm-efr": [],
+ "audio/gsm-hr-08": [],
+ "audio/ilbc": [],
+ "audio/ip-mr_v2.5": [],
+ "audio/isac": [],
+ "audio/l16": [],
+ "audio/l20": [],
+ "audio/l24": [],
+ "audio/l8": [],
+ "audio/lpc": [],
+ "audio/midi": [
+ "mid",
+ "midi",
+ "kar",
+ "rmi"
+ ],
+ "audio/mobile-xmf": [],
+ "audio/mp4": [
+ "mp4a"
+ ],
+ "audio/mp4a-latm": [],
+ "audio/mpa": [],
+ "audio/mpa-robust": [],
+ "audio/mpeg": [
+ "mpga",
+ "mp2",
+ "mp2a",
+ "mp3",
+ "m2a",
+ "m3a"
+ ],
+ "audio/mpeg4-generic": [],
+ "audio/musepack": [],
+ "audio/ogg": [
+ "oga",
+ "ogg",
+ "spx"
+ ],
+ "audio/opus": [],
+ "audio/parityfec": [],
+ "audio/pcma": [],
+ "audio/pcma-wb": [],
+ "audio/pcmu-wb": [],
+ "audio/pcmu": [],
+ "audio/prs.sid": [],
+ "audio/qcelp": [],
+ "audio/red": [],
+ "audio/rtp-enc-aescm128": [],
+ "audio/rtp-midi": [],
+ "audio/rtx": [],
+ "audio/s3m": [
+ "s3m"
+ ],
+ "audio/silk": [
+ "sil"
+ ],
+ "audio/smv": [],
+ "audio/smv0": [],
+ "audio/smv-qcp": [],
+ "audio/sp-midi": [],
+ "audio/speex": [],
+ "audio/t140c": [],
+ "audio/t38": [],
+ "audio/telephone-event": [],
+ "audio/tone": [],
+ "audio/uemclip": [],
+ "audio/ulpfec": [],
+ "audio/vdvi": [],
+ "audio/vmr-wb": [],
+ "audio/vnd.3gpp.iufp": [],
+ "audio/vnd.4sb": [],
+ "audio/vnd.audiokoz": [],
+ "audio/vnd.celp": [],
+ "audio/vnd.cisco.nse": [],
+ "audio/vnd.cmles.radio-events": [],
+ "audio/vnd.cns.anp1": [],
+ "audio/vnd.cns.inf1": [],
+ "audio/vnd.dece.audio": [
+ "uva",
+ "uvva"
+ ],
+ "audio/vnd.digital-winds": [
+ "eol"
+ ],
+ "audio/vnd.dlna.adts": [],
+ "audio/vnd.dolby.heaac.1": [],
+ "audio/vnd.dolby.heaac.2": [],
+ "audio/vnd.dolby.mlp": [],
+ "audio/vnd.dolby.mps": [],
+ "audio/vnd.dolby.pl2": [],
+ "audio/vnd.dolby.pl2x": [],
+ "audio/vnd.dolby.pl2z": [],
+ "audio/vnd.dolby.pulse.1": [],
+ "audio/vnd.dra": [
+ "dra"
+ ],
+ "audio/vnd.dts": [
+ "dts"
+ ],
+ "audio/vnd.dts.hd": [
+ "dtshd"
+ ],
+ "audio/vnd.dvb.file": [],
+ "audio/vnd.everad.plj": [],
+ "audio/vnd.hns.audio": [],
+ "audio/vnd.lucent.voice": [
+ "lvp"
+ ],
+ "audio/vnd.ms-playready.media.pya": [
+ "pya"
+ ],
+ "audio/vnd.nokia.mobile-xmf": [],
+ "audio/vnd.nortel.vbk": [],
+ "audio/vnd.nuera.ecelp4800": [
+ "ecelp4800"
+ ],
+ "audio/vnd.nuera.ecelp7470": [
+ "ecelp7470"
+ ],
+ "audio/vnd.nuera.ecelp9600": [
+ "ecelp9600"
+ ],
+ "audio/vnd.octel.sbc": [],
+ "audio/vnd.qcelp": [],
+ "audio/vnd.rhetorex.32kadpcm": [],
+ "audio/vnd.rip": [
+ "rip"
+ ],
+ "audio/vnd.sealedmedia.softseal.mpeg": [],
+ "audio/vnd.vmx.cvsd": [],
+ "audio/vorbis": [],
+ "audio/vorbis-config": [],
+ "audio/webm": [
+ "weba"
+ ],
+ "audio/x-aac": [
+ "aac"
+ ],
+ "audio/x-aiff": [
+ "aif",
+ "aiff",
+ "aifc"
+ ],
+ "audio/x-caf": [
+ "caf"
+ ],
+ "audio/x-flac": [
+ "flac"
+ ],
+ "audio/x-matroska": [
+ "mka"
+ ],
+ "audio/x-mpegurl": [
+ "m3u"
+ ],
+ "audio/x-ms-wax": [
+ "wax"
+ ],
+ "audio/x-ms-wma": [
+ "wma"
+ ],
+ "audio/x-pn-realaudio": [
+ "ram",
+ "ra"
+ ],
+ "audio/x-pn-realaudio-plugin": [
+ "rmp"
+ ],
+ "audio/x-tta": [],
+ "audio/x-wav": [
+ "wav"
+ ],
+ "audio/xm": [
+ "xm"
+ ],
+ "chemical/x-cdx": [
+ "cdx"
+ ],
+ "chemical/x-cif": [
+ "cif"
+ ],
+ "chemical/x-cmdf": [
+ "cmdf"
+ ],
+ "chemical/x-cml": [
+ "cml"
+ ],
+ "chemical/x-csml": [
+ "csml"
+ ],
+ "chemical/x-pdb": [],
+ "chemical/x-xyz": [
+ "xyz"
+ ],
+ "image/bmp": [
+ "bmp"
+ ],
+ "image/cgm": [
+ "cgm"
+ ],
+ "image/example": [],
+ "image/fits": [],
+ "image/g3fax": [
+ "g3"
+ ],
+ "image/gif": [
+ "gif"
+ ],
+ "image/ief": [
+ "ief"
+ ],
+ "image/jp2": [],
+ "image/jpeg": [
+ "jpeg",
+ "jpg",
+ "jpe"
+ ],
+ "image/jpm": [],
+ "image/jpx": [],
+ "image/ktx": [
+ "ktx"
+ ],
+ "image/naplps": [],
+ "image/png": [
+ "png"
+ ],
+ "image/prs.btif": [
+ "btif"
+ ],
+ "image/prs.pti": [],
+ "image/sgi": [
+ "sgi"
+ ],
+ "image/svg+xml": [
+ "svg",
+ "svgz"
+ ],
+ "image/t38": [],
+ "image/tiff": [
+ "tiff",
+ "tif"
+ ],
+ "image/tiff-fx": [],
+ "image/vnd.adobe.photoshop": [
+ "psd"
+ ],
+ "image/vnd.cns.inf2": [],
+ "image/vnd.dece.graphic": [
+ "uvi",
+ "uvvi",
+ "uvg",
+ "uvvg"
+ ],
+ "image/vnd.dvb.subtitle": [
+ "sub"
+ ],
+ "image/vnd.djvu": [
+ "djvu",
+ "djv"
+ ],
+ "image/vnd.dwg": [
+ "dwg"
+ ],
+ "image/vnd.dxf": [
+ "dxf"
+ ],
+ "image/vnd.fastbidsheet": [
+ "fbs"
+ ],
+ "image/vnd.fpx": [
+ "fpx"
+ ],
+ "image/vnd.fst": [
+ "fst"
+ ],
+ "image/vnd.fujixerox.edmics-mmr": [
+ "mmr"
+ ],
+ "image/vnd.fujixerox.edmics-rlc": [
+ "rlc"
+ ],
+ "image/vnd.globalgraphics.pgb": [],
+ "image/vnd.microsoft.icon": [],
+ "image/vnd.mix": [],
+ "image/vnd.ms-modi": [
+ "mdi"
+ ],
+ "image/vnd.ms-photo": [
+ "wdp"
+ ],
+ "image/vnd.net-fpx": [
+ "npx"
+ ],
+ "image/vnd.radiance": [],
+ "image/vnd.sealed.png": [],
+ "image/vnd.sealedmedia.softseal.gif": [],
+ "image/vnd.sealedmedia.softseal.jpg": [],
+ "image/vnd.svf": [],
+ "image/vnd.wap.wbmp": [
+ "wbmp"
+ ],
+ "image/vnd.xiff": [
+ "xif"
+ ],
+ "image/webp": [
+ "webp"
+ ],
+ "image/x-3ds": [
+ "3ds"
+ ],
+ "image/x-cmu-raster": [
+ "ras"
+ ],
+ "image/x-cmx": [
+ "cmx"
+ ],
+ "image/x-freehand": [
+ "fh",
+ "fhc",
+ "fh4",
+ "fh5",
+ "fh7"
+ ],
+ "image/x-icon": [
+ "ico"
+ ],
+ "image/x-mrsid-image": [
+ "sid"
+ ],
+ "image/x-pcx": [
+ "pcx"
+ ],
+ "image/x-pict": [
+ "pic",
+ "pct"
+ ],
+ "image/x-portable-anymap": [
+ "pnm"
+ ],
+ "image/x-portable-bitmap": [
+ "pbm"
+ ],
+ "image/x-portable-graymap": [
+ "pgm"
+ ],
+ "image/x-portable-pixmap": [
+ "ppm"
+ ],
+ "image/x-rgb": [
+ "rgb"
+ ],
+ "image/x-tga": [
+ "tga"
+ ],
+ "image/x-xbitmap": [
+ "xbm"
+ ],
+ "image/x-xpixmap": [
+ "xpm"
+ ],
+ "image/x-xwindowdump": [
+ "xwd"
+ ],
+ "message/cpim": [],
+ "message/delivery-status": [],
+ "message/disposition-notification": [],
+ "message/example": [],
+ "message/external-body": [],
+ "message/feedback-report": [],
+ "message/global": [],
+ "message/global-delivery-status": [],
+ "message/global-disposition-notification": [],
+ "message/global-headers": [],
+ "message/http": [],
+ "message/imdn+xml": [],
+ "message/news": [],
+ "message/partial": [],
+ "message/rfc822": [
+ "eml",
+ "mime"
+ ],
+ "message/s-http": [],
+ "message/sip": [],
+ "message/sipfrag": [],
+ "message/tracking-status": [],
+ "message/vnd.si.simp": [],
+ "model/example": [],
+ "model/iges": [
+ "igs",
+ "iges"
+ ],
+ "model/mesh": [
+ "msh",
+ "mesh",
+ "silo"
+ ],
+ "model/vnd.collada+xml": [
+ "dae"
+ ],
+ "model/vnd.dwf": [
+ "dwf"
+ ],
+ "model/vnd.flatland.3dml": [],
+ "model/vnd.gdl": [
+ "gdl"
+ ],
+ "model/vnd.gs-gdl": [],
+ "model/vnd.gs.gdl": [],
+ "model/vnd.gtw": [
+ "gtw"
+ ],
+ "model/vnd.moml+xml": [],
+ "model/vnd.mts": [
+ "mts"
+ ],
+ "model/vnd.parasolid.transmit.binary": [],
+ "model/vnd.parasolid.transmit.text": [],
+ "model/vnd.vtu": [
+ "vtu"
+ ],
+ "model/vrml": [
+ "wrl",
+ "vrml"
+ ],
+ "model/x3d+binary": [
+ "x3db",
+ "x3dbz"
+ ],
+ "model/x3d+vrml": [
+ "x3dv",
+ "x3dvz"
+ ],
+ "model/x3d+xml": [
+ "x3d",
+ "x3dz"
+ ],
+ "multipart/alternative": [],
+ "multipart/appledouble": [],
+ "multipart/byteranges": [],
+ "multipart/digest": [],
+ "multipart/encrypted": [],
+ "multipart/example": [],
+ "multipart/form-data": [],
+ "multipart/header-set": [],
+ "multipart/mixed": [],
+ "multipart/parallel": [],
+ "multipart/related": [],
+ "multipart/report": [],
+ "multipart/signed": [],
+ "multipart/voice-message": [],
+ "text/1d-interleaved-parityfec": [],
+ "text/cache-manifest": [
+ "appcache"
+ ],
+ "text/calendar": [
+ "ics",
+ "ifb"
+ ],
+ "text/css": [
+ "css"
+ ],
+ "text/csv": [
+ "csv"
+ ],
+ "text/directory": [],
+ "text/dns": [],
+ "text/ecmascript": [],
+ "text/enriched": [],
+ "text/example": [],
+ "text/fwdred": [],
+ "text/html": [
+ "html",
+ "htm"
+ ],
+ "text/javascript": [],
+ "text/n3": [
+ "n3"
+ ],
+ "text/parityfec": [],
+ "text/plain": [
+ "txt",
+ "text",
+ "conf",
+ "def",
+ "list",
+ "log",
+ "in"
+ ],
+ "text/prs.fallenstein.rst": [],
+ "text/prs.lines.tag": [
+ "dsc"
+ ],
+ "text/vnd.radisys.msml-basic-layout": [],
+ "text/red": [],
+ "text/rfc822-headers": [],
+ "text/richtext": [
+ "rtx"
+ ],
+ "text/rtf": [],
+ "text/rtp-enc-aescm128": [],
+ "text/rtx": [],
+ "text/sgml": [
+ "sgml",
+ "sgm"
+ ],
+ "text/t140": [],
+ "text/tab-separated-values": [
+ "tsv"
+ ],
+ "text/troff": [
+ "t",
+ "tr",
+ "roff",
+ "man",
+ "me",
+ "ms"
+ ],
+ "text/turtle": [
+ "ttl"
+ ],
+ "text/ulpfec": [],
+ "text/uri-list": [
+ "uri",
+ "uris",
+ "urls"
+ ],
+ "text/vcard": [
+ "vcard"
+ ],
+ "text/vnd.abc": [],
+ "text/vnd.curl": [
+ "curl"
+ ],
+ "text/vnd.curl.dcurl": [
+ "dcurl"
+ ],
+ "text/vnd.curl.scurl": [
+ "scurl"
+ ],
+ "text/vnd.curl.mcurl": [
+ "mcurl"
+ ],
+ "text/vnd.dmclientscript": [],
+ "text/vnd.dvb.subtitle": [
+ "sub"
+ ],
+ "text/vnd.esmertec.theme-descriptor": [],
+ "text/vnd.fly": [
+ "fly"
+ ],
+ "text/vnd.fmi.flexstor": [
+ "flx"
+ ],
+ "text/vnd.graphviz": [
+ "gv"
+ ],
+ "text/vnd.in3d.3dml": [
+ "3dml"
+ ],
+ "text/vnd.in3d.spot": [
+ "spot"
+ ],
+ "text/vnd.iptc.newsml": [],
+ "text/vnd.iptc.nitf": [],
+ "text/vnd.latex-z": [],
+ "text/vnd.motorola.reflex": [],
+ "text/vnd.ms-mediapackage": [],
+ "text/vnd.net2phone.commcenter.command": [],
+ "text/vnd.si.uricatalogue": [],
+ "text/vnd.sun.j2me.app-descriptor": [
+ "jad"
+ ],
+ "text/vnd.trolltech.linguist": [],
+ "text/vnd.wap.si": [],
+ "text/vnd.wap.sl": [],
+ "text/vnd.wap.wml": [
+ "wml"
+ ],
+ "text/vnd.wap.wmlscript": [
+ "wmls"
+ ],
+ "text/x-asm": [
+ "s",
+ "asm"
+ ],
+ "text/x-c": [
+ "c",
+ "cc",
+ "cxx",
+ "cpp",
+ "h",
+ "hh",
+ "dic"
+ ],
+ "text/x-fortran": [
+ "f",
+ "for",
+ "f77",
+ "f90"
+ ],
+ "text/x-java-source": [
+ "java"
+ ],
+ "text/x-opml": [
+ "opml"
+ ],
+ "text/x-pascal": [
+ "p",
+ "pas"
+ ],
+ "text/x-nfo": [
+ "nfo"
+ ],
+ "text/x-setext": [
+ "etx"
+ ],
+ "text/x-sfv": [
+ "sfv"
+ ],
+ "text/x-uuencode": [
+ "uu"
+ ],
+ "text/x-vcalendar": [
+ "vcs"
+ ],
+ "text/x-vcard": [
+ "vcf"
+ ],
+ "text/xml": [],
+ "text/xml-external-parsed-entity": [],
+ "video/1d-interleaved-parityfec": [],
+ "video/3gpp": [
+ "3gp"
+ ],
+ "video/3gpp-tt": [],
+ "video/3gpp2": [
+ "3g2"
+ ],
+ "video/bmpeg": [],
+ "video/bt656": [],
+ "video/celb": [],
+ "video/dv": [],
+ "video/example": [],
+ "video/h261": [
+ "h261"
+ ],
+ "video/h263": [
+ "h263"
+ ],
+ "video/h263-1998": [],
+ "video/h263-2000": [],
+ "video/h264": [
+ "h264"
+ ],
+ "video/h264-rcdo": [],
+ "video/h264-svc": [],
+ "video/jpeg": [
+ "jpgv"
+ ],
+ "video/jpeg2000": [],
+ "video/jpm": [
+ "jpm",
+ "jpgm"
+ ],
+ "video/mj2": [
+ "mj2",
+ "mjp2"
+ ],
+ "video/mp1s": [],
+ "video/mp2p": [],
+ "video/mp2t": [],
+ "video/mp4": [
+ "mp4",
+ "mp4v",
+ "mpg4"
+ ],
+ "video/mp4v-es": [],
+ "video/mpeg": [
+ "mpeg",
+ "mpg",
+ "mpe",
+ "m1v",
+ "m2v"
+ ],
+ "video/mpeg4-generic": [],
+ "video/mpv": [],
+ "video/nv": [],
+ "video/ogg": [
+ "ogv"
+ ],
+ "video/parityfec": [],
+ "video/pointer": [],
+ "video/quicktime": [
+ "qt",
+ "mov"
+ ],
+ "video/raw": [],
+ "video/rtp-enc-aescm128": [],
+ "video/rtx": [],
+ "video/smpte292m": [],
+ "video/ulpfec": [],
+ "video/vc1": [],
+ "video/vnd.cctv": [],
+ "video/vnd.dece.hd": [
+ "uvh",
+ "uvvh"
+ ],
+ "video/vnd.dece.mobile": [
+ "uvm",
+ "uvvm"
+ ],
+ "video/vnd.dece.mp4": [],
+ "video/vnd.dece.pd": [
+ "uvp",
+ "uvvp"
+ ],
+ "video/vnd.dece.sd": [
+ "uvs",
+ "uvvs"
+ ],
+ "video/vnd.dece.video": [
+ "uvv",
+ "uvvv"
+ ],
+ "video/vnd.directv.mpeg": [],
+ "video/vnd.directv.mpeg-tts": [],
+ "video/vnd.dlna.mpeg-tts": [],
+ "video/vnd.dvb.file": [
+ "dvb"
+ ],
+ "video/vnd.fvt": [
+ "fvt"
+ ],
+ "video/vnd.hns.video": [],
+ "video/vnd.iptvforum.1dparityfec-1010": [],
+ "video/vnd.iptvforum.1dparityfec-2005": [],
+ "video/vnd.iptvforum.2dparityfec-1010": [],
+ "video/vnd.iptvforum.2dparityfec-2005": [],
+ "video/vnd.iptvforum.ttsavc": [],
+ "video/vnd.iptvforum.ttsmpeg2": [],
+ "video/vnd.motorola.video": [],
+ "video/vnd.motorola.videop": [],
+ "video/vnd.mpegurl": [
+ "mxu",
+ "m4u"
+ ],
+ "video/vnd.ms-playready.media.pyv": [
+ "pyv"
+ ],
+ "video/vnd.nokia.interleaved-multimedia": [],
+ "video/vnd.nokia.videovoip": [],
+ "video/vnd.objectvideo": [],
+ "video/vnd.sealed.mpeg1": [],
+ "video/vnd.sealed.mpeg4": [],
+ "video/vnd.sealed.swf": [],
+ "video/vnd.sealedmedia.softseal.mov": [],
+ "video/vnd.uvvu.mp4": [
+ "uvu",
+ "uvvu"
+ ],
+ "video/vnd.vivo": [
+ "viv"
+ ],
+ "video/webm": [
+ "webm"
+ ],
+ "video/x-f4v": [
+ "f4v"
+ ],
+ "video/x-fli": [
+ "fli"
+ ],
+ "video/x-flv": [
+ "flv"
+ ],
+ "video/x-m4v": [
+ "m4v"
+ ],
+ "video/x-matroska": [
+ "mkv",
+ "mk3d",
+ "mks"
+ ],
+ "video/x-mng": [
+ "mng"
+ ],
+ "video/x-ms-asf": [
+ "asf",
+ "asx"
+ ],
+ "video/x-ms-vob": [
+ "vob"
+ ],
+ "video/x-ms-wm": [
+ "wm"
+ ],
+ "video/x-ms-wmv": [
+ "wmv"
+ ],
+ "video/x-ms-wmx": [
+ "wmx"
+ ],
+ "video/x-ms-wvx": [
+ "wvx"
+ ],
+ "video/x-msvideo": [
+ "avi"
+ ],
+ "video/x-sgi-movie": [
+ "movie"
+ ],
+ "video/x-smv": [
+ "smv"
+ ],
+ "x-conference/x-cooltalk": [
+ "ice"
+ ]
+}
diff --git a/deps/npm/node_modules/request/node_modules/mime-types/lib/node.json b/deps/npm/node_modules/request/node_modules/mime-types/lib/node.json
new file mode 100644
index 000000000..ad50d6134
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/lib/node.json
@@ -0,0 +1,55 @@
+{
+ "text/vtt": [
+ "vtt"
+ ],
+ "application/x-chrome-extension": [
+ "crx"
+ ],
+ "text/x-component": [
+ "htc"
+ ],
+ "text/cache-manifest": [
+ "manifest"
+ ],
+ "application/octet-stream": [
+ "buffer"
+ ],
+ "application/mp4": [
+ "m4p"
+ ],
+ "audio/mp4": [
+ "m4a"
+ ],
+ "video/MP2T": [
+ "ts"
+ ],
+ "application/x-web-app-manifest+json": [
+ "webapp"
+ ],
+ "text/x-lua": [
+ "lua"
+ ],
+ "application/x-lua-bytecode": [
+ "luac"
+ ],
+ "text/x-markdown": [
+ "markdown",
+ "md",
+ "mkd"
+ ],
+ "text/plain": [
+ "ini"
+ ],
+ "application/dash+xml": [
+ "mdp"
+ ],
+ "font/opentype": [
+ "otf"
+ ],
+ "application/json": [
+ "map"
+ ],
+ "application/xml": [
+ "xsd"
+ ]
+}
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
new file mode 100644
index 000000000..baa79a956
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/mime-types/package.json
@@ -0,0 +1,69 @@
+{
+ "name": "mime-types",
+ "description": "The ultimate javascript content-type utility.",
+ "version": "1.0.2",
+ "author": {
+ "name": "Jonathan Ong",
+ "email": "me@jongleberry.com",
+ "url": "http://jongleberry.com"
+ },
+ "contributors": [
+ {
+ "name": "Jeremiah Senkpiel",
+ "email": "fishrock123@rocketmail.com",
+ "url": "https://searchbeam.jit.su"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/expressjs/mime-types"
+ },
+ "license": "MIT",
+ "main": "lib",
+ "devDependencies": {
+ "co": "3",
+ "cogent": "0",
+ "mocha": "1",
+ "should": "3"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ },
+ "scripts": {
+ "test": "make test"
+ },
+ "gitHead": "e82b23836eb42003b8346fb31769da2fb7eb54e8",
+ "bugs": {
+ "url": "https://github.com/expressjs/mime-types/issues"
+ },
+ "homepage": "https://github.com/expressjs/mime-types",
+ "_id": "mime-types@1.0.2",
+ "_shasum": "995ae1392ab8affcbfcb2641dd054e943c0d5dce",
+ "_from": "mime-types@~1.0.1",
+ "_npmVersion": "1.4.21",
+ "_npmUser": {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ },
+ "maintainers": [
+ {
+ "name": "jongleberry",
+ "email": "jonathanrichardong@gmail.com"
+ },
+ {
+ "name": "fishrock123",
+ "email": "fishrock123@rocketmail.com"
+ },
+ {
+ "name": "dougwilson",
+ "email": "doug@somethingdoug.com"
+ }
+ ],
+ "dist": {
+ "shasum": "995ae1392ab8affcbfcb2641dd054e943c0d5dce",
+ "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-1.0.2.tgz",
+ "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/package.json b/deps/npm/node_modules/request/node_modules/node-uuid/package.json
index 22ea8648d..ee93121fc 100644
--- a/deps/npm/node_modules/request/node_modules/node-uuid/package.json
+++ b/deps/npm/node_modules/request/node_modules/node-uuid/package.json
@@ -29,7 +29,25 @@
"bugs": {
"url": "https://github.com/broofa/node-uuid/issues"
},
- "homepage": "https://github.com/broofa/node-uuid",
"_id": "node-uuid@1.4.1",
- "_from": "node-uuid@~1.4.0"
+ "dist": {
+ "shasum": "39aef510e5889a3dca9c895b506c73aae1bac048",
+ "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz"
+ },
+ "_from": "node-uuid@~1.4.0",
+ "_npmVersion": "1.3.6",
+ "_npmUser": {
+ "name": "broofa",
+ "email": "robert@broofa.com"
+ },
+ "maintainers": [
+ {
+ "name": "broofa",
+ "email": "robert@broofa.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "39aef510e5889a3dca9c895b506c73aae1bac048",
+ "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz",
+ "homepage": "https://github.com/broofa/node-uuid"
}
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 e35bfa670..3a86aca12 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
@@ -16,23 +16,61 @@ function rfc3986 (str) {
;
}
+// Maps object to bi-dimensional array
+// Converts { foo: 'A', bar: [ 'b', 'B' ]} to
+// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]
+function map (obj) {
+ var key, val, arr = []
+ for (key in obj) {
+ val = obj[key]
+ if (Array.isArray(val))
+ for (var i = 0; i < val.length; i++)
+ arr.push([key, val[i]])
+ else
+ arr.push([key, val])
+ }
+ return arr
+}
+
+// Compare function for sort
+function compare (a, b) {
+ return a > b ? 1 : a < b ? -1 : 0
+}
+
function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
// adapted from https://dev.twitter.com/docs/auth/oauth and
// https://dev.twitter.com/docs/auth/creating-signature
- var querystring = Object.keys(params).sort().map(function(key){
- // big WTF here with the escape + encoding but it's what twitter wants
- return escape(rfc3986(key)) + "%3D" + escape(rfc3986(params[key]))
- }).join('%26')
+ // Parameter normalization
+ // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
+ var normalized = map(params)
+ // 1. First, the name and value of each parameter are encoded
+ .map(function (p) {
+ return [ rfc3986(p[0]), rfc3986(p[1] || '') ]
+ })
+ // 2. The parameters are sorted by name, using ascending byte value
+ // ordering. If two or more parameters share the same name, they
+ // are sorted by their value.
+ .sort(function (a, b) {
+ return compare(a[0], b[0]) || compare(a[1], b[1])
+ })
+ // 3. The name of each parameter is concatenated to its corresponding
+ // value using an "=" character (ASCII code 61) as a separator, even
+ // if the value is empty.
+ .map(function (p) { return p.join('=') })
+ // 4. The sorted name/value pairs are concatenated together into a
+ // single string by using an "&" character (ASCII code 38) as
+ // separator.
+ .join('&')
var base = [
- httpMethod ? httpMethod.toUpperCase() : 'GET',
+ rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),
rfc3986(base_uri),
- querystring
+ rfc3986(normalized)
].join('&')
var key = [
- consumer_secret,
+ consumer_secret || '',
token_secret || ''
].map(rfc3986).join('&')
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 dc99a4ec7..d0e82fecb 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
@@ -6,7 +6,7 @@
},
"name": "oauth-sign",
"description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
- "version": "0.3.0",
+ "version": "0.4.0",
"repository": {
"url": "https://github.com/mikeal/oauth-sign"
},
@@ -25,7 +25,25 @@
"bugs": {
"url": "https://github.com/mikeal/oauth-sign/issues"
},
- "homepage": "https://github.com/mikeal/oauth-sign",
- "_id": "oauth-sign@0.3.0",
- "_from": "oauth-sign@~0.3.0"
+ "_id": "oauth-sign@0.4.0",
+ "dist": {
+ "shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69",
+ "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz"
+ },
+ "_from": "oauth-sign@~0.4.0",
+ "_npmVersion": "1.3.2",
+ "_npmUser": {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69",
+ "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz",
+ "homepage": "https://github.com/mikeal/oauth-sign"
}
diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js b/deps/npm/node_modules/request/node_modules/oauth-sign/test.js
index 46955ff69..b7a4c8022 100644
--- a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js
+++ b/deps/npm/node_modules/request/node_modules/oauth-sign/test.js
@@ -46,4 +46,18 @@ console.log(upsign)
console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=')
assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=')
+// example in rfc5849
+var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q')
+params.oauth_consumer_key = '9djdj82h48djs9d2'
+params.oauth_token = 'kkk9d7dh3k39sjv7'
+params.oauth_nonce = '7d8f3e4a'
+params.oauth_signature_method = 'HMAC-SHA1'
+params.oauth_timestamp = '137131201'
+
+var rfc5849sign = hmacsign('POST', 'http://example.com/request',
+ params, "j49sk3j29djd", "dh893hdasih9")
+
+console.log(rfc5849sign)
+console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=')
+assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=')
diff --git a/deps/npm/node_modules/request/node_modules/qs/.gitmodules b/deps/npm/node_modules/request/node_modules/qs/.gitmodules
deleted file mode 100644
index 49e31dac7..000000000
--- a/deps/npm/node_modules/request/node_modules/qs/.gitmodules
+++ /dev/null
@@ -1,6 +0,0 @@
-[submodule "support/expresso"]
- path = support/expresso
- url = git://github.com/visionmedia/expresso.git
-[submodule "support/should"]
- path = support/should
- url = git://github.com/visionmedia/should.js.git
diff --git a/deps/npm/node_modules/request/node_modules/qs/.jshintignore b/deps/npm/node_modules/request/node_modules/qs/.jshintignore
new file mode 100644
index 000000000..3c3629e64
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/.jshintignore
@@ -0,0 +1 @@
+node_modules
diff --git a/deps/npm/node_modules/request/node_modules/qs/.jshintrc b/deps/npm/node_modules/request/node_modules/qs/.jshintrc
new file mode 100644
index 000000000..997b3f7d4
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/.jshintrc
@@ -0,0 +1,10 @@
+{
+ "node": true,
+
+ "curly": true,
+ "latedef": true,
+ "quotmark": true,
+ "undef": true,
+ "unused": true,
+ "trailing": true
+}
diff --git a/deps/npm/node_modules/request/node_modules/qs/.npmignore b/deps/npm/node_modules/request/node_modules/qs/.npmignore
index e85ce2afa..7e1574dc5 100644
--- a/deps/npm/node_modules/request/node_modules/qs/.npmignore
+++ b/deps/npm/node_modules/request/node_modules/qs/.npmignore
@@ -1,7 +1,18 @@
-test
-.travis.yml
-benchmark.js
-component.json
-examples.js
-History.md
-Makefile
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+complexity.md
diff --git a/deps/npm/node_modules/request/node_modules/qs/.travis.yml b/deps/npm/node_modules/request/node_modules/qs/.travis.yml
new file mode 100644
index 000000000..c891dd0e0
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+
+node_js:
+ - 0.10 \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md b/deps/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md
new file mode 100644
index 000000000..892836159
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/CONTRIBUTING.md
@@ -0,0 +1 @@
+Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md).
diff --git a/deps/npm/node_modules/request/node_modules/qs/LICENSE b/deps/npm/node_modules/request/node_modules/qs/LICENSE
new file mode 100755
index 000000000..d4569487a
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/LICENSE
@@ -0,0 +1,28 @@
+Copyright (c) 2014 Nathan LaFreniere and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * The names of any contributors may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ * * *
+
+The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors
diff --git a/deps/npm/node_modules/request/node_modules/qs/Makefile b/deps/npm/node_modules/request/node_modules/qs/Makefile
new file mode 100644
index 000000000..600a700ec
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/Makefile
@@ -0,0 +1,8 @@
+test:
+ @node node_modules/lab/bin/lab
+test-cov:
+ @node node_modules/lab/bin/lab -t 100
+test-cov-html:
+ @node node_modules/lab/bin/lab -r html -o coverage.html
+
+.PHONY: test test-cov test-cov-html \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/qs/Readme.md b/deps/npm/node_modules/request/node_modules/qs/Readme.md
index 27e54a4af..b8618877c 100644..100755
--- a/deps/npm/node_modules/request/node_modules/qs/Readme.md
+++ b/deps/npm/node_modules/request/node_modules/qs/Readme.md
@@ -1,58 +1,192 @@
-# node-querystring
+# qs
- query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.
+A querystring parsing and stringifying library with some added security.
-## Installation
+[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)
- $ npm install qs
+Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
-## Examples
+The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
-```js
-var qs = require('qs');
+## Usage
-qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');
-// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }
+```javascript
+var Qs = require('qs');
-qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})
-// => user[name]=Tobi&user[email]=tobi%40learnboost.com
+var obj = Qs.parse('a=c'); // { a: 'c' }
+var str = Qs.stringify(obj); // 'a=c'
```
-## Testing
+### Parsing Objects
-Install dev dependencies:
+```javascript
+Qs.parse(string, [depth], [delimiter]);
+```
- $ npm install -d
+**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
+For example, the string `'foo[bar]=baz'` converts to:
-and execute:
+```javascript
+{
+ foo: {
+ bar: 'baz'
+ }
+}
+```
- $ make test
+URI encoded strings work too:
-browser:
+```javascript
+Qs.parse('a%5Bb%5D=c');
+// { a: { b: 'c' } }
+```
- $ open test/browser/index.html
+You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
-## License
+```javascript
+{
+ foo: {
+ bar: {
+ baz: 'foobarbaz'
+ }
+ }
+}
+```
-(The MIT License)
+By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
+`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
+
+```javascript
+{
+ a: {
+ b: {
+ c: {
+ d: {
+ e: {
+ f: {
+ '[g][h][i]': 'j'
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+This depth can be overridden by passing a `depth` option to `Qs.parse(string, depth)`:
-Copyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+```javascript
+Qs.parse('a[b][c][d][e][f][g][h][i]=j', 1);
+// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }
+```
-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 depth limit mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
+An optional delimiter can also be passed:
+
+```javascript
+Qs.parse('a=b;c=d', ';');
+// { a: 'b', c: 'd' }
+```
+
+### Parsing Arrays
+
+**qs** can also parse arrays using a similar `[]` notation:
+
+```javascript
+Qs.parse('a[]=b&a[]=c');
+// { a: ['b', 'c'] }
+```
+
+You may specify an index as well:
+
+```javascript
+Qs.parse('a[1]=c&a[0]=b');
+// { a: ['b', 'c'] }
+```
+
+Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
+to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving
+their order:
+
+```javascript
+Qs.parse('a[1]=b&a[15]=c');
+// { a: ['b', 'c'] }
+```
+
+Note that an empty string is also a value, and will be preserved:
+
+```javascript
+Qs.parse('a[]=&a[]=b');
+// { a: ['', 'b'] }
+Qs.parse('a[0]=b&a[1]=&a[2]=c');
+// { a: ['b', '', 'c'] }
+```
+
+**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
+instead be converted to an object with the index as the key:
+
+```javascript
+Qs.parse('a[100]=b');
+// { a: { '100': 'b' } }
+```
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
+If you mix notations, **qs** will merge the two items into an object:
+
+```javascript
+Qs.parse('a[0]=b&a[b]=c');
+// { a: { '0': 'b', b: 'c' } }
+```
+
+You can also create arrays of objects:
+
+```javascript
+Qs.parse('a[][b]=c');
+// { a: [{ b: 'c' }] }
+```
+
+### Stringifying
+
+```javascript
+Qs.stringify(object, [delimiter]);
+```
+
+When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect:
+
+```javascript
+Qs.stringify({ a: 'b' });
+// 'a=b'
+Qs.stringify({ a: { b: 'c' } });
+// 'a%5Bb%5D=c'
+```
+
+Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
+
+When arrays are stringified, they are always given explicit indices:
+
+```javascript
+Qs.stringify({ a: ['b', 'c', 'd'] });
+// 'a[0]=b&a[1]=c&a[2]=d'
+```
+
+Empty strings and null values will omit the value, but the equals sign (=) remains in place:
+
+```javascript
+Qs.stringify({ a: '' });
+// 'a='
+```
+
+Properties that are set to `undefined` will be omitted entirely:
+
+```javascript
+Qs.stringify({ a: null, b: undefined });
+// 'a='
+```
+
+The delimiter may be overridden with stringify as well:
+
+```javascript
+Qs.stringify({ a: 'b', c: 'd' }, ';');
+// 'a=b;c=d'
+```
diff --git a/deps/npm/node_modules/request/node_modules/qs/index.js b/deps/npm/node_modules/request/node_modules/qs/index.js
index b05938acc..bb0a047c4 100644
--- a/deps/npm/node_modules/request/node_modules/qs/index.js
+++ b/deps/npm/node_modules/request/node_modules/qs/index.js
@@ -1,366 +1 @@
-/**
- * Object#toString() ref for stringify().
- */
-
-var toString = Object.prototype.toString;
-
-/**
- * Object#hasOwnProperty ref
- */
-
-var hasOwnProperty = Object.prototype.hasOwnProperty;
-
-/**
- * Array#indexOf shim.
- */
-
-var indexOf = typeof Array.prototype.indexOf === 'function'
- ? function(arr, el) { return arr.indexOf(el); }
- : function(arr, el) {
- for (var i = 0; i < arr.length; i++) {
- if (arr[i] === el) return i;
- }
- return -1;
- };
-
-/**
- * Array.isArray shim.
- */
-
-var isArray = Array.isArray || function(arr) {
- return toString.call(arr) == '[object Array]';
-};
-
-/**
- * Object.keys shim.
- */
-
-var objectKeys = Object.keys || function(obj) {
- var ret = [];
- for (var key in obj) {
- if (obj.hasOwnProperty(key)) {
- ret.push(key);
- }
- }
- return ret;
-};
-
-/**
- * Array#forEach shim.
- */
-
-var forEach = typeof Array.prototype.forEach === 'function'
- ? function(arr, fn) { return arr.forEach(fn); }
- : function(arr, fn) {
- for (var i = 0; i < arr.length; i++) fn(arr[i]);
- };
-
-/**
- * Array#reduce shim.
- */
-
-var reduce = function(arr, fn, initial) {
- if (typeof arr.reduce === 'function') return arr.reduce(fn, initial);
- var res = initial;
- for (var i = 0; i < arr.length; i++) res = fn(res, arr[i]);
- return res;
-};
-
-/**
- * Cache non-integer test regexp.
- */
-
-var isint = /^[0-9]+$/;
-
-function promote(parent, key) {
- if (parent[key].length == 0) return parent[key] = {}
- var t = {};
- for (var i in parent[key]) {
- if (hasOwnProperty.call(parent[key], i)) {
- t[i] = parent[key][i];
- }
- }
- parent[key] = t;
- return t;
-}
-
-function parse(parts, parent, key, val) {
- var part = parts.shift();
-
- // illegal
- if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return;
-
- // end
- if (!part) {
- if (isArray(parent[key])) {
- parent[key].push(val);
- } else if ('object' == typeof parent[key]) {
- parent[key] = val;
- } else if ('undefined' == typeof parent[key]) {
- parent[key] = val;
- } else {
- parent[key] = [parent[key], val];
- }
- // array
- } else {
- var obj = parent[key] = parent[key] || [];
- if (']' == part) {
- if (isArray(obj)) {
- if ('' != val) obj.push(val);
- } else if ('object' == typeof obj) {
- obj[objectKeys(obj).length] = val;
- } else {
- obj = parent[key] = [parent[key], val];
- }
- // prop
- } else if (~indexOf(part, ']')) {
- part = part.substr(0, part.length - 1);
- if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
- parse(parts, obj, part, val);
- // key
- } else {
- if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
- parse(parts, obj, part, val);
- }
- }
-}
-
-/**
- * Merge parent key/val pair.
- */
-
-function merge(parent, key, val){
- if (~indexOf(key, ']')) {
- var parts = key.split('[')
- , len = parts.length
- , last = len - 1;
- parse(parts, parent, 'base', val);
- // optimize
- } else {
- if (!isint.test(key) && isArray(parent.base)) {
- var t = {};
- for (var k in parent.base) t[k] = parent.base[k];
- parent.base = t;
- }
- set(parent.base, key, val);
- }
-
- return parent;
-}
-
-/**
- * Compact sparse arrays.
- */
-
-function compact(obj) {
- if ('object' != typeof obj) return obj;
-
- if (isArray(obj)) {
- var ret = [];
-
- for (var i in obj) {
- if (hasOwnProperty.call(obj, i)) {
- ret.push(obj[i]);
- }
- }
-
- return ret;
- }
-
- for (var key in obj) {
- obj[key] = compact(obj[key]);
- }
-
- return obj;
-}
-
-/**
- * Parse the given obj.
- */
-
-function parseObject(obj){
- var ret = { base: {} };
-
- forEach(objectKeys(obj), function(name){
- merge(ret, name, obj[name]);
- });
-
- return compact(ret.base);
-}
-
-/**
- * Parse the given str.
- */
-
-function parseString(str){
- var ret = reduce(String(str).split('&'), function(ret, pair){
- var eql = indexOf(pair, '=')
- , brace = lastBraceInKey(pair)
- , key = pair.substr(0, brace || eql)
- , val = pair.substr(brace || eql, pair.length)
- , val = val.substr(indexOf(val, '=') + 1, val.length);
-
- // ?foo
- if ('' == key) key = pair, val = '';
- if ('' == key) return ret;
-
- return merge(ret, decode(key), decode(val));
- }, { base: {} }).base;
-
- return compact(ret);
-}
-
-/**
- * Parse the given query `str` or `obj`, returning an object.
- *
- * @param {String} str | {Object} obj
- * @return {Object}
- * @api public
- */
-
-exports.parse = function(str){
- if (null == str || '' == str) return {};
- return 'object' == typeof str
- ? parseObject(str)
- : parseString(str);
-};
-
-/**
- * Turn the given `obj` into a query string
- *
- * @param {Object} obj
- * @return {String}
- * @api public
- */
-
-var stringify = exports.stringify = function(obj, prefix) {
- if (isArray(obj)) {
- return stringifyArray(obj, prefix);
- } else if ('[object Object]' == toString.call(obj)) {
- return stringifyObject(obj, prefix);
- } else if ('string' == typeof obj) {
- return stringifyString(obj, prefix);
- } else {
- return prefix + '=' + encodeURIComponent(String(obj));
- }
-};
-
-/**
- * Stringify the given `str`.
- *
- * @param {String} str
- * @param {String} prefix
- * @return {String}
- * @api private
- */
-
-function stringifyString(str, prefix) {
- if (!prefix) throw new TypeError('stringify expects an object');
- return prefix + '=' + encodeURIComponent(str);
-}
-
-/**
- * Stringify the given `arr`.
- *
- * @param {Array} arr
- * @param {String} prefix
- * @return {String}
- * @api private
- */
-
-function stringifyArray(arr, prefix) {
- var ret = [];
- if (!prefix) throw new TypeError('stringify expects an object');
- for (var i = 0; i < arr.length; i++) {
- ret.push(stringify(arr[i], prefix + '[' + i + ']'));
- }
- return ret.join('&');
-}
-
-/**
- * Stringify the given `obj`.
- *
- * @param {Object} obj
- * @param {String} prefix
- * @return {String}
- * @api private
- */
-
-function stringifyObject(obj, prefix) {
- var ret = []
- , keys = objectKeys(obj)
- , key;
-
- for (var i = 0, len = keys.length; i < len; ++i) {
- key = keys[i];
- if ('' == key) continue;
- if (null == obj[key]) {
- ret.push(encodeURIComponent(key) + '=');
- } else {
- ret.push(stringify(obj[key], prefix
- ? prefix + '[' + encodeURIComponent(key) + ']'
- : encodeURIComponent(key)));
- }
- }
-
- return ret.join('&');
-}
-
-/**
- * Set `obj`'s `key` to `val` respecting
- * the weird and wonderful syntax of a qs,
- * where "foo=bar&foo=baz" becomes an array.
- *
- * @param {Object} obj
- * @param {String} key
- * @param {String} val
- * @api private
- */
-
-function set(obj, key, val) {
- var v = obj[key];
- if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return;
- if (undefined === v) {
- obj[key] = val;
- } else if (isArray(v)) {
- v.push(val);
- } else {
- obj[key] = [v, val];
- }
-}
-
-/**
- * Locate last brace in `str` within the key.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function lastBraceInKey(str) {
- var len = str.length
- , brace
- , c;
- for (var i = 0; i < len; ++i) {
- c = str[i];
- if (']' == c) brace = false;
- if ('[' == c) brace = true;
- if ('=' == c && !brace) return i;
- }
-}
-
-/**
- * Decode `str`.
- *
- * @param {String} str
- * @return {String}
- * @api private
- */
-
-function decode(str) {
- try {
- return decodeURIComponent(str.replace(/\+/g, ' '));
- } catch (err) {
- return str;
- }
-}
+module.exports = require('./lib');
diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/index.js b/deps/npm/node_modules/request/node_modules/qs/lib/index.js
new file mode 100755
index 000000000..0e094933d
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/lib/index.js
@@ -0,0 +1,15 @@
+// Load modules
+
+var Stringify = require('./stringify');
+var Parse = require('./parse');
+
+
+// Declare internals
+
+var internals = {};
+
+
+module.exports = {
+ stringify: Stringify,
+ parse: Parse
+};
diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js
new file mode 100755
index 000000000..4a3fdd974
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js
@@ -0,0 +1,155 @@
+// Load modules
+
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&',
+ depth: 5,
+ arrayLimit: 20,
+ parametersLimit: 1000
+};
+
+
+internals.parseValues = function (str, delimiter) {
+
+ delimiter = typeof delimiter === 'string' ? delimiter : internals.delimiter;
+
+ var obj = {};
+ var parts = str.split(delimiter, internals.parametersLimit);
+
+ for (var i = 0, il = parts.length; i < il; ++i) {
+ var part = parts[i];
+ var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
+
+ if (pos === -1) {
+ obj[Utils.decode(part)] = '';
+ }
+ else {
+ var key = Utils.decode(part.slice(0, pos));
+ var val = Utils.decode(part.slice(pos + 1));
+
+ if (!obj[key]) {
+ obj[key] = val;
+ }
+ else {
+ obj[key] = [].concat(obj[key]).concat(val);
+ }
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseObject = function (chain, val) {
+
+ if (!chain.length) {
+ return val;
+ }
+
+ var root = chain.shift();
+
+ var obj = {};
+ if (root === '[]') {
+ obj = [];
+ obj = obj.concat(internals.parseObject(chain, val));
+ }
+ else {
+ var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
+ var index = parseInt(cleanRoot, 10);
+ if (!isNaN(index) &&
+ root !== cleanRoot &&
+ index <= internals.arrayLimit) {
+
+ obj = [];
+ obj[index] = internals.parseObject(chain, val);
+ }
+ else {
+ obj[cleanRoot] = internals.parseObject(chain, val);
+ }
+ }
+
+ return obj;
+};
+
+
+internals.parseKeys = function (key, val, depth) {
+
+ if (!key) {
+ return;
+ }
+
+ // The regex chunks
+
+ var parent = /^([^\[\]]*)/;
+ var child = /(\[[^\[\]]*\])/g;
+
+ // Get the parent
+
+ var segment = parent.exec(key);
+
+ // Don't allow them to overwrite object prototype properties
+
+ if (Object.prototype.hasOwnProperty(segment[1])) {
+ return;
+ }
+
+ // Stash the parent if it exists
+
+ var keys = [];
+ if (segment[1]) {
+ keys.push(segment[1]);
+ }
+
+ // Loop through children appending to the array until we hit depth
+
+ var i = 0;
+ while ((segment = child.exec(key)) !== null && i < depth) {
+
+ ++i;
+ if (!Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
+ keys.push(segment[1]);
+ }
+ }
+
+ // If there's a remainder, just add whatever is left
+
+ if (segment) {
+ keys.push('[' + key.slice(segment.index) + ']');
+ }
+
+ return internals.parseObject(keys, val);
+};
+
+
+module.exports = function (str, depth, delimiter) {
+
+ if (str === '' ||
+ str === null ||
+ typeof str === 'undefined') {
+
+ return {};
+ }
+
+ if (typeof depth !== 'number') {
+ delimiter = depth;
+ depth = internals.depth;
+ }
+
+ var tempObj = typeof str === 'string' ? internals.parseValues(str, delimiter) : Utils.clone(str);
+ var obj = {};
+
+ // Iterate over the keys and setup the new object
+ //
+ for (var key in tempObj) {
+ if (tempObj.hasOwnProperty(key)) {
+ var newObj = internals.parseKeys(key, tempObj[key], depth);
+ obj = Utils.merge(obj, newObj);
+ }
+ }
+
+ return Utils.compact(obj);
+};
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
new file mode 100755
index 000000000..1cc3df9fc
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js
@@ -0,0 +1,55 @@
+// Load modules
+
+
+// Declare internals
+
+var internals = {
+ delimiter: '&'
+};
+
+
+internals.stringify = function (obj, prefix) {
+
+ if (Buffer.isBuffer(obj)) {
+ obj = obj.toString();
+ }
+ else if (obj instanceof Date) {
+ obj = obj.toISOString();
+ }
+ else if (obj === null) {
+ obj = '';
+ }
+
+ if (typeof obj === 'string' ||
+ typeof obj === 'number' ||
+ typeof obj === 'boolean') {
+
+ return [encodeURIComponent(prefix) + '=' + encodeURIComponent(obj)];
+ }
+
+ var values = [];
+
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']'));
+ }
+ }
+
+ return values;
+};
+
+
+module.exports = function (obj, delimiter) {
+
+ delimiter = typeof delimiter === 'undefined' ? internals.delimiter : delimiter;
+
+ var keys = [];
+
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ keys = keys.concat(internals.stringify(obj[key], key));
+ }
+ }
+
+ return keys.join(delimiter);
+};
diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js
new file mode 100755
index 000000000..3f5c149d5
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js
@@ -0,0 +1,133 @@
+// Load modules
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.arrayToObject = function (source) {
+
+ var obj = {};
+ for (var i = 0, il = source.length; i < il; ++i) {
+ if (typeof source[i] !== 'undefined') {
+
+ obj[i] = source[i];
+ }
+ }
+
+ return obj;
+};
+
+
+exports.clone = function (source) {
+
+ if (typeof source !== 'object' ||
+ source === null) {
+
+ return source;
+ }
+
+ if (Buffer.isBuffer(source)) {
+ return source.toString();
+ }
+
+ var obj = Array.isArray(source) ? [] : {};
+ for (var i in source) {
+ if (source.hasOwnProperty(i)) {
+ obj[i] = exports.clone(source[i]);
+ }
+ }
+
+ return obj;
+};
+
+
+exports.merge = function (target, source) {
+
+ if (!source) {
+ return target;
+ }
+
+ var obj = exports.clone(target);
+
+ if (Array.isArray(source)) {
+ for (var i = 0, il = source.length; i < il; ++i) {
+ if (typeof source[i] !== 'undefined') {
+ if (typeof obj[i] === 'object') {
+ obj[i] = exports.merge(obj[i], source[i]);
+ }
+ else {
+ obj[i] = source[i];
+ }
+ }
+ }
+
+ return obj;
+ }
+
+ if (Array.isArray(obj)) {
+ obj = exports.arrayToObject(obj);
+ }
+
+ var keys = Object.keys(source);
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
+ var key = keys[k];
+ var value = source[key];
+
+ if (value &&
+ typeof value === 'object') {
+
+ if (!obj[key]) {
+ obj[key] = exports.clone(value);
+ }
+ else {
+ obj[key] = exports.merge(obj[key], value);
+ }
+ }
+ else {
+ obj[key] = value;
+ }
+ }
+
+ return obj;
+};
+
+
+exports.decode = function (str) {
+
+ try {
+ return decodeURIComponent(str.replace(/\+/g, ' '));
+ } catch (e) {
+ return str;
+ }
+};
+
+
+exports.compact = function (obj) {
+
+ if (typeof obj !== 'object' || obj === null) {
+ return obj;
+ }
+
+ var compacted = {};
+
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ if (Array.isArray(obj[key])) {
+ compacted[key] = [];
+
+ for (var i = 0, l = obj[key].length; i < l; i++) {
+ if (typeof obj[key][i] !== 'undefined') {
+ compacted[key].push(obj[key][i]);
+ }
+ }
+ }
+ else {
+ compacted[key] = exports.compact(obj[key]);
+ }
+ }
+ }
+
+ return compacted;
+};
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 313485c0e..7b1917023 100644..100755
--- a/deps/npm/node_modules/request/node_modules/qs/package.json
+++ b/deps/npm/node_modules/request/node_modules/qs/package.json
@@ -1,38 +1,61 @@
{
"name": "qs",
- "description": "querystring parser",
- "version": "0.6.6",
- "keywords": [
- "query string",
- "parser",
- "component"
- ],
- "repository": {
- "type": "git",
- "url": "git://github.com/visionmedia/node-querystring.git"
- },
+ "version": "1.2.2",
+ "description": "A querystring parser that supports nesting and arrays, with a depth limit",
+ "homepage": "https://github.com/hapijs/qs",
+ "main": "index.js",
+ "dependencies": {},
"devDependencies": {
- "mocha": "*",
- "expect.js": "*"
+ "lab": "3.x.x"
},
"scripts": {
- "test": "make test"
+ "test": "make test-cov"
},
- "author": {
- "name": "TJ Holowaychuk",
- "email": "tj@vision-media.ca",
- "url": "http://tjholowaychuk.com"
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/hapijs/qs.git"
},
- "main": "index",
- "engines": {
- "node": "*"
+ "keywords": [
+ "querystring",
+ "qs"
+ ],
+ "author": {
+ "name": "Nathan LaFreniere",
+ "email": "quitlahok@gmail.com"
},
- "readme": "# node-querystring\n\n query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.\n\n## Installation\n\n $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n $ npm install -d\n\nand execute:\n\n $ make test\n\nbrowser:\n\n $ open test/browser/index.html\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
- "readmeFilename": "Readme.md",
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "http://github.com/hapijs/qs/raw/master/LICENSE"
+ }
+ ],
+ "gitHead": "bd9455fea88d1c51a80dbf57ef0f99b4e553177d",
"bugs": {
- "url": "https://github.com/visionmedia/node-querystring/issues"
+ "url": "https://github.com/hapijs/qs/issues"
+ },
+ "_id": "qs@1.2.2",
+ "_shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88",
+ "_from": "qs@~1.2.0",
+ "_npmVersion": "1.4.21",
+ "_npmUser": {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ },
+ "maintainers": [
+ {
+ "name": "nlf",
+ "email": "quitlahok@gmail.com"
+ },
+ {
+ "name": "hueniverse",
+ "email": "eran@hueniverse.com"
+ }
+ ],
+ "dist": {
+ "shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88",
+ "tarball": "http://registry.npmjs.org/qs/-/qs-1.2.2.tgz"
},
- "homepage": "https://github.com/visionmedia/node-querystring",
- "_id": "qs@0.6.6",
- "_from": "qs@~0.6.0"
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/qs/-/qs-1.2.2.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/qs/test/parse.js b/deps/npm/node_modules/request/node_modules/qs/test/parse.js
new file mode 100755
index 000000000..c00e7becf
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/test/parse.js
@@ -0,0 +1,301 @@
+// Load modules
+
+var Lab = require('lab');
+var Qs = require('../');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('#parse', function () {
+
+ it('parses a simple string', function (done) {
+
+ expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' });
+ expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' });
+ expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } });
+ expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } });
+ expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } });
+ expect(Qs.parse('foo')).to.deep.equal({ foo: '' });
+ expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' });
+ expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' });
+ expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' });
+ expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' });
+ expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' });
+ expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({
+ cht: 'p3',
+ chd: 't:60,40',
+ chs: '250x100',
+ chl: 'Hello|World'
+ });
+ done();
+ });
+
+ it('parses a single nested string', function (done) {
+
+ expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } });
+ done();
+ });
+
+ it('parses a double nested string', function (done) {
+
+ expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } });
+ done();
+ });
+
+ it('defaults to a depth of 5', function (done) {
+
+ expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } });
+ done();
+ });
+
+ it('only parses one level when depth = 1', function (done) {
+
+ expect(Qs.parse('a[b][c]=d', 1)).to.deep.equal({ a: { b: { '[c]': 'd' } } });
+ expect(Qs.parse('a[b][c][d]=e', 1)).to.deep.equal({ a: { b: { '[c][d]': 'e' } } });
+ done();
+ });
+
+ it('parses a simple array', function (done) {
+
+ expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
+ done();
+ });
+
+ it('parses an explicit array', function (done) {
+
+ expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] });
+ expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
+ done();
+ });
+
+ it('parses a nested array', function (done) {
+
+ expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } });
+ expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } });
+ done();
+ });
+
+ it('allows to specify array indices', function (done) {
+
+ expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
+ expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] });
+ expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] });
+ done();
+ });
+
+ it('limits specific array indices to 20', function (done) {
+
+ expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] });
+ expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } });
+ done();
+ });
+
+ it('supports encoded = signs', function (done) {
+
+ expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' });
+ done();
+ });
+
+ it('is ok with url encoded strings', function (done) {
+
+ expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } });
+ expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } });
+ done();
+ });
+
+ it('allows brackets in the value', function (done) {
+
+ expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' });
+ expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' });
+ done();
+ });
+
+ it('allows empty values', function (done) {
+
+ expect(Qs.parse('')).to.deep.equal({});
+ expect(Qs.parse(null)).to.deep.equal({});
+ expect(Qs.parse(undefined)).to.deep.equal({});
+ done();
+ });
+
+ it('transforms arrays to objects', function (done) {
+
+ expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
+ expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
+ expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
+ expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
+ expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
+ expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({foo: [ {a: 'a', b: 'b'}, {a: 'aa', b: 'bb'} ]});
+ done();
+ });
+
+ it('correctly prunes undefined values when converting an array to an object', function (done) {
+
+ expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } });
+ done();
+ });
+
+ it('supports malformed uri characters', function (done) {
+
+ expect(Qs.parse('{%:%}')).to.deep.equal({ '{%:%}': '' });
+ expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' });
+ done();
+ });
+
+ it('doesn\'t produce empty keys', function (done) {
+
+ expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' });
+ done();
+ });
+
+ it('cannot override prototypes', function (done) {
+
+ var obj = Qs.parse('toString=bad&bad[toString]=bad&constructor=bad');
+ expect(typeof obj.toString).to.equal('function');
+ expect(typeof obj.bad.toString).to.equal('function');
+ expect(typeof obj.constructor).to.equal('function');
+ done();
+ });
+
+ it('cannot access Object prototype', function (done) {
+
+ Qs.parse('constructor[prototype][bad]=bad');
+ Qs.parse('bad[constructor][prototype][bad]=bad');
+ expect(typeof Object.prototype.bad).to.equal('undefined');
+ done();
+ });
+
+ it('parses arrays of objects', function (done) {
+
+ expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
+ expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
+ done();
+ });
+
+ it('allows for empty strings in arrays', function (done) {
+
+ expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] });
+ expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]=')).to.deep.equal({ a: ['b', '', 'c', ''] });
+ done();
+ });
+
+ it('compacts sparse arrays', function (done) {
+
+ expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] });
+ done();
+ });
+
+ it('parses semi-parsed strings', function (done) {
+
+ expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } });
+ expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } });
+ done();
+ });
+
+ it('parses buffers to strings', function (done) {
+
+ var b = new Buffer('test');
+ expect(Qs.parse({ a: b })).to.deep.equal({ a: b.toString() });
+ done();
+ });
+
+ it('continues parsing when no parent is found', function (done) {
+
+ expect(Qs.parse('[]&a=b')).to.deep.equal({ '0': '', a: 'b' });
+ expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' });
+ done();
+ });
+
+ it('does not error when parsing a very long array', function (done) {
+
+ var str = 'a[]=a';
+ while (Buffer.byteLength(str) < 128 * 1024) {
+ str += '&' + str;
+ }
+
+ expect(function () {
+
+ Qs.parse(str);
+ }).to.not.throw();
+
+ done();
+ });
+
+ it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) {
+
+ Object.prototype.crash = '';
+ Array.prototype.crash = '';
+ expect(Qs.parse.bind(null, 'a=b')).to.not.throw();
+ expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' });
+ expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw();
+ expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
+ delete Object.prototype.crash;
+ delete Array.prototype.crash;
+ done();
+ });
+
+ it('parses a string with an alternative delimiter', function (done) {
+
+ expect(Qs.parse('a=b;c=d', ';')).to.deep.equal({ a: 'b', c: 'd' });
+ done();
+ });
+
+ it('does not use non-string objects as delimiters', function (done) {
+
+ expect(Qs.parse('a=b&c=d', {})).to.deep.equal({ a: 'b', c: 'd' });
+ done();
+ });
+
+ it('parses an object', function (done) {
+
+ var input = {
+ "user[name]": {"pop[bob]": 3},
+ "user[email]": null
+ };
+
+ var expected = {
+ "user": {
+ "name": {"pop[bob]": 3},
+ "email": null
+ }
+ };
+
+ var result = Qs.parse(input);
+
+ expect(result).to.deep.equal(expected);
+ done();
+ });
+
+ it('parses an object and not child values', function (done) {
+
+ var input = {
+ "user[name]": {"pop[bob]": { "test": 3 }},
+ "user[email]": null
+ };
+
+ var expected = {
+ "user": {
+ "name": {"pop[bob]": { "test": 3 }},
+ "email": null
+ }
+ };
+
+ var result = Qs.parse(input);
+
+ expect(result).to.deep.equal(expected);
+ done();
+ });
+});
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
new file mode 100755
index 000000000..7bf1df4b5
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js
@@ -0,0 +1,129 @@
+// Load modules
+
+var Lab = require('lab');
+var Qs = require('../');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('#stringify', function () {
+
+ it('stringifies a querystring object', function (done) {
+
+ expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
+ expect(Qs.stringify({ a: 1 })).to.equal('a=1');
+ expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2');
+ done();
+ });
+
+ it('stringifies a nested object', function (done) {
+
+ expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
+ expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e');
+ done();
+ });
+
+ it('stringifies an array value', function (done) {
+
+ expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
+ done();
+ });
+
+ it('stringifies a nested array value', function (done) {
+
+ expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
+ done();
+ });
+
+ it('stringifies an object inside an array', function (done) {
+
+ expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c');
+ expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
+ done();
+ });
+
+ it('stringifies a complicated object', function (done) {
+
+ expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e');
+ done();
+ });
+
+ it('stringifies an empty value', function (done) {
+
+ expect(Qs.stringify({ a: '' })).to.equal('a=');
+ expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b=');
+ expect(Qs.stringify({ a: null })).to.equal('a=');
+ expect(Qs.stringify({ a: { b: null } })).to.equal('a%5Bb%5D=');
+ done();
+ });
+
+ it('drops keys with a value of undefined', function (done) {
+
+ expect(Qs.stringify({ a: undefined })).to.equal('');
+ expect(Qs.stringify({ a: { b: undefined, c: null } })).to.equal('a%5Bc%5D=');
+ done();
+ });
+
+ it('url encodes values', function (done) {
+
+ expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c');
+ done();
+ });
+
+ it('stringifies a date', function (done) {
+
+ var now = new Date();
+ var str = 'a=' + encodeURIComponent(now.toISOString());
+ expect(Qs.stringify({ a: now })).to.equal(str);
+ done();
+ });
+
+ it('stringifies the weird object from qs', function (done) {
+
+ expect(Qs.stringify({ 'my weird field': 'q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F');
+ done();
+ });
+
+ it('skips properties that are part of the object prototype', function (done) {
+
+ Object.prototype.crash = 'test';
+ expect(Qs.stringify({ a: 'b'})).to.equal('a=b');
+ expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
+ delete Object.prototype.crash;
+ done();
+ });
+
+ it('stringifies boolean values', function (done) {
+
+ expect(Qs.stringify({ a: true })).to.equal('a=true');
+ expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true');
+ expect(Qs.stringify({ b: false })).to.equal('b=false');
+ expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false');
+ done();
+ });
+
+ it('stringifies buffer values', function (done) {
+
+ expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test');
+ expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test');
+ done();
+ });
+
+ it('stringifies an object using an alternative delimiter', function (done) {
+
+ expect(Qs.stringify({ a: 'b', c: 'd' }, ';')).to.equal('a=b;c=d');
+ done();
+ });
+});
diff --git a/deps/npm/node_modules/request/node_modules/stringstream/.npmignore b/deps/npm/node_modules/request/node_modules/stringstream/.npmignore
new file mode 100644
index 000000000..7dccd9707
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/stringstream/.npmignore
@@ -0,0 +1,15 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+node_modules
+npm-debug.log \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/stringstream/.travis.yml b/deps/npm/node_modules/request/node_modules/stringstream/.travis.yml
new file mode 100644
index 000000000..f1d0f13c8
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/stringstream/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt b/deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt
new file mode 100644
index 000000000..eac188156
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/stringstream/LICENSE.txt
@@ -0,0 +1,4 @@
+Copyright 2012 Michael Hart (michael.hart.au@gmail.com)
+
+This project is free software released under the MIT license:
+http://www.opensource.org/licenses/mit-license.php
diff --git a/deps/npm/node_modules/request/node_modules/stringstream/README.md b/deps/npm/node_modules/request/node_modules/stringstream/README.md
new file mode 100644
index 000000000..32fc98255
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/stringstream/README.md
@@ -0,0 +1,38 @@
+# Decode streams into strings The Right Way(tm)
+
+```javascript
+var fs = require('fs')
+var zlib = require('zlib')
+var strs = require('stringstream')
+
+var utf8Stream = fs.createReadStream('massiveLogFile.gz')
+ .pipe(zlib.createGunzip())
+ .pipe(strs('utf8'))
+```
+
+No need to deal with `setEncoding()` weirdness, just compose streams
+like they were supposed to be!
+
+Handles input and output encoding:
+
+```javascript
+// Stream from utf8 to hex to base64... Why not, ay.
+var hex64Stream = fs.createReadStream('myFile')
+ .pipe(strs('utf8', 'hex'))
+ .pipe(strs('hex', 'base64'))
+```
+
+Also deals with `base64` output correctly by aligning each emitted data
+chunk so that there are no dangling `=` characters:
+
+```javascript
+var stream = fs.createReadStream('myFile').pipe(strs('base64'))
+
+var base64Str = ''
+
+stream.on('data', function(data) { base64Str += data })
+stream.on('end', function() {
+ console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()
+ console.log('Original file is: ' + new Buffer(base64Str, 'base64'))
+})
+```
diff --git a/deps/npm/node_modules/request/node_modules/stringstream/example.js b/deps/npm/node_modules/request/node_modules/stringstream/example.js
new file mode 100644
index 000000000..f82b85edc
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/stringstream/example.js
@@ -0,0 +1,27 @@
+var fs = require('fs')
+var zlib = require('zlib')
+var strs = require('stringstream')
+
+var utf8Stream = fs.createReadStream('massiveLogFile.gz')
+ .pipe(zlib.createGunzip())
+ .pipe(strs('utf8'))
+
+utf8Stream.pipe(process.stdout)
+
+// Stream from utf8 to hex to base64... Why not, ay.
+var hex64Stream = fs.createReadStream('myFile')
+ .pipe(strs('utf8', 'hex'))
+ .pipe(strs('hex', 'base64'))
+
+hex64Stream.pipe(process.stdout)
+
+// Deals with base64 correctly by aligning chunks
+var stream = fs.createReadStream('myFile').pipe(strs('base64'))
+
+var base64Str = ''
+
+stream.on('data', function(data) { base64Str += data })
+stream.on('end', function() {
+ console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()
+ console.log('Original file is: ' + new Buffer(base64Str, 'base64'))
+})
diff --git a/deps/npm/node_modules/request/node_modules/stringstream/package.json b/deps/npm/node_modules/request/node_modules/stringstream/package.json
new file mode 100644
index 000000000..f9caf4b84
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/stringstream/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "stringstream",
+ "version": "0.0.4",
+ "description": "Encode and decode streams into string streams",
+ "author": {
+ "name": "Michael Hart",
+ "email": "michael.hart.au@gmail.com",
+ "url": "http://github.com/mhart"
+ },
+ "main": "stringstream.js",
+ "keywords": [
+ "string",
+ "stream",
+ "base64",
+ "gzip"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/mhart/StringStream.git"
+ },
+ "license": "MIT",
+ "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n",
+ "readmeFilename": "README.md",
+ "_id": "stringstream@0.0.4",
+ "dist": {
+ "shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92",
+ "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz"
+ },
+ "_npmVersion": "1.2.0",
+ "_npmUser": {
+ "name": "hichaelmart",
+ "email": "michael.hart.au@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "hichaelmart",
+ "email": "michael.hart.au@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92",
+ "_from": "stringstream@~0.0.4",
+ "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz",
+ "bugs": {
+ "url": "https://github.com/mhart/StringStream/issues"
+ },
+ "homepage": "https://github.com/mhart/StringStream"
+}
diff --git a/deps/npm/node_modules/request/node_modules/stringstream/stringstream.js b/deps/npm/node_modules/request/node_modules/stringstream/stringstream.js
new file mode 100644
index 000000000..4ece1275f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/stringstream/stringstream.js
@@ -0,0 +1,102 @@
+var util = require('util')
+var Stream = require('stream')
+var StringDecoder = require('string_decoder').StringDecoder
+
+module.exports = StringStream
+module.exports.AlignedStringDecoder = AlignedStringDecoder
+
+function StringStream(from, to) {
+ if (!(this instanceof StringStream)) return new StringStream(from, to)
+
+ Stream.call(this)
+
+ if (from == null) from = 'utf8'
+
+ this.readable = this.writable = true
+ this.paused = false
+ this.toEncoding = (to == null ? from : to)
+ this.fromEncoding = (to == null ? '' : from)
+ this.decoder = new AlignedStringDecoder(this.toEncoding)
+}
+util.inherits(StringStream, Stream)
+
+StringStream.prototype.write = function(data) {
+ if (!this.writable) {
+ var err = new Error('stream not writable')
+ err.code = 'EPIPE'
+ this.emit('error', err)
+ return false
+ }
+ if (this.fromEncoding) {
+ if (Buffer.isBuffer(data)) data = data.toString()
+ data = new Buffer(data, this.fromEncoding)
+ }
+ var string = this.decoder.write(data)
+ if (string.length) this.emit('data', string)
+ return !this.paused
+}
+
+StringStream.prototype.flush = function() {
+ if (this.decoder.flush) {
+ var string = this.decoder.flush()
+ if (string.length) this.emit('data', string)
+ }
+}
+
+StringStream.prototype.end = function() {
+ if (!this.writable && !this.readable) return
+ this.flush()
+ this.emit('end')
+ this.writable = this.readable = false
+ this.destroy()
+}
+
+StringStream.prototype.destroy = function() {
+ this.decoder = null
+ this.writable = this.readable = false
+ this.emit('close')
+}
+
+StringStream.prototype.pause = function() {
+ this.paused = true
+}
+
+StringStream.prototype.resume = function () {
+ if (this.paused) this.emit('drain')
+ this.paused = false
+}
+
+function AlignedStringDecoder(encoding) {
+ StringDecoder.call(this, encoding)
+
+ switch (this.encoding) {
+ case 'base64':
+ this.write = alignedWrite
+ this.alignedBuffer = new Buffer(3)
+ this.alignedBytes = 0
+ break
+ }
+}
+util.inherits(AlignedStringDecoder, StringDecoder)
+
+AlignedStringDecoder.prototype.flush = function() {
+ if (!this.alignedBuffer || !this.alignedBytes) return ''
+ var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes)
+ this.alignedBytes = 0
+ return leftover
+}
+
+function alignedWrite(buffer) {
+ var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length
+ if (!rem && !this.alignedBytes) return buffer.toString(this.encoding)
+
+ var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem)
+
+ this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes)
+ buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem)
+
+ buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length)
+ this.alignedBytes = rem
+
+ return returnBuffer.toString(this.encoding)
+}
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc b/deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc
index 8fcead4f8..fb11913a4 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/.jshintrc
@@ -1,72 +1,70 @@
{
- // Settings
- "passfail" : false, // Stop on first error.
- "maxerr" : 100, // Maximum error before stopping.
+ "passfail" : false,
+ "maxerr" : 100,
-
- // Predefined globals whom JSHint will ignore.
- "browser" : false, // Standard browser globals e.g. `window`, `document`.
+ "browser" : false,
"node" : true,
"rhino" : false,
"couch" : false,
- "wsh" : false, // Windows Scripting Host.
+ "wsh" : false,
"jquery" : false,
"prototypejs" : false,
"mootools" : false,
"dojo" : false,
- "predef" : [ // Custom globals.
- "escape", "unescape" // aren't picked up by node flag above :/
- ],
-
-
- // Development.
- "debug" : false, // Allow debugger statements e.g. browser breakpoints.
- "devel" : false, // Allow developments statements e.g. `console.log();`.
+ "debug" : false,
+ "devel" : false,
+ "esnext" : true,
+ "strict" : true,
+ "globalstrict" : true,
- // EcmaScript 5.
- "es5" : true, // Allow EcmaScript 5 syntax.
- "esnext" : true, // Allow ES "next" syntax, specifically 'const' (V8 has this)
- "strict" : false, // Require `use strict` pragma in every file.
- "globalstrict" : false, // Allow global "use strict" (also enables 'strict').
+ "asi" : false,
+ "laxbreak" : false,
+ "bitwise" : true,
+ "boss" : false,
+ "curly" : true,
+ "eqeqeq" : false,
+ "eqnull" : true,
+ "evil" : false,
+ "expr" : false,
+ "forin" : false,
+ "immed" : true,
+ "lastsemic" : true,
+ "latedef" : false,
+ "loopfunc" : false,
+ "noarg" : true,
+ "regexp" : false,
+ "regexdash" : false,
+ "scripturl" : false,
+ "shadow" : false,
+ "supernew" : false,
+ "undef" : true,
+ "unused" : true,
+ "newcap" : true,
+ "noempty" : true,
+ "nonew" : true,
+ "nomen" : false,
+ "onevar" : false,
+ "onecase" : true,
+ "plusplus" : false,
+ "proto" : false,
+ "sub" : true,
+ "trailing" : true,
+ "white" : false,
- // The Good Parts.
- "asi" : false, // Tolerate Automatic Semicolon Insertion (no semicolons).
- "laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
- "bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
- "boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
- "curly" : false, // Require {} for every new block or scope.
- "eqeqeq" : false, // Require triple equals i.e. `===`.
- "eqnull" : true, // Tolerate use of `== null`.
- "evil" : false, // Tolerate use of `eval`.
- "expr" : true, // Tolerate `ExpressionStatement` as Programs.
- "forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
- "immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
- "latedef" : false, // Prohibit variable use before definition.
- "loopfunc" : false, // Allow functions to be defined within loops.
- "noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
- "regexp" : true, // Prohibit `.` and `[^...]` in regular expressions.
- "regexdash" : false, // Tolerate unescaped last dash i.e. `[-...]`.
- "scripturl" : true, // Tolerate script-targeted URLs.
- "shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
- "supernew" : false, // Tolerate `new function () { ... };` and `new Object;`.
- "undef" : true, // Require all non-global variables be declared before they are used.
-
-
- // Personal styling prefrences.
- "lastsemic" : true, // Prohibit missing semicolon for the last statement in a one-line block
- "newcap" : false, // Require capitalization of all constructor functions e.g. `new F()`.
- "noempty" : true, // Prohipit use of empty blocks.
- "nonew" : true, // Prohibit use of constructors for side-effects.
- "nomen" : false, // Prohibit use of initial or trailing underbars in names.
- "onevar" : false, // Allow only one `var` statement per function.
- "onecase" : false, // Allow switches with one case statement
- "plusplus" : false, // Prohibit use of `++` & `--`.
- "proto" : false, // Allow use of __proto__
- "sub" : true, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
- "trailing" : true, // Prohibit trailing whitespaces.
- "white" : false // Check against strict whitespace and indentation rules.
+ "predef": [
+ "describe",
+ "it",
+ "before",
+ "beforeEach",
+ "after",
+ "afterEach",
+ "expect",
+ "setTimeout",
+ "clearTimeout"
+ ],
+ "maxlen": 0
}
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/.travis.yml b/deps/npm/node_modules/request/node_modules/tough-cookie/.travis.yml
new file mode 100644
index 000000000..5d892654f
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+- "0.10"
+- "0.11"
+matrix:
+ fast_finish: true
+ allow_failures:
+ - node_js: 0.11
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md
index fd1dbb1df..9e6caee18 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md
@@ -2,16 +2,21 @@
![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)
+[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie)
+
+[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)
+![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)
+
# Synopsis
``` javascript
-var cookies = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'
-var Cookie = cookies.Cookie;
+var tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'
+var Cookie = tough.Cookie;
var cookie = Cookie.parse(header);
cookie.value = 'somethingdifferent';
header = cookie.toString();
-var cookiejar = new cookies.CookieJar();
+var cookiejar = new tough.CookieJar();
cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);
// ...
cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {
@@ -31,8 +36,8 @@ Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already take
# API
-cookies
-=======
+tough
+=====
Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound".
@@ -124,7 +129,7 @@ Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:
``` javascript
if (res.headers['set-cookie'] instanceof Array)
- cookies = res.headers['set-cookie'].map(Cookie.parse);
+ cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); });
else
cookies = [Cookie.parse(res.headers['set-cookie'])];
```
@@ -146,7 +151,7 @@ Properties
* _secure_ - boolean - the `Secure` cookie flag
* _httpOnly_ - boolean - the `HttpOnly` cookie flag
* _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)
-
+
After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:
* _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)
@@ -236,7 +241,7 @@ Attributes
----------
* _rejectPublicSuffixes_ - boolean - reject cookies with domains like "com" and "co.uk" (default: `true`)
-
+
Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.
.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))
@@ -254,11 +259,16 @@ The `options` object can be omitted and can have the following properties:
As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).
+.setCookieSync(cookieOrString, currentUrl, [{options}])
+-------------------------------------------------------
+
+Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
.storeCookie(cookie, [{options},] cb(err,cookie))
-------------------------------------------------
__REMOVED__ removed in lieu of the CookieStore API below
-
+
.getCookies(currentUrl, [{options},] cb(err,cookies))
-----------------------------------------------------
@@ -276,20 +286,42 @@ The `options` object can be omitted and can have the following properties:
The `.lastAccessed` property of the returned cookies will have been updated.
+.getCookiesSync(currentUrl, [{options}])
+----------------------------------------
+
+Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
.getCookieString(...)
---------------------
Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.
+.getCookieStringSync(...)
+-------------------------
+
+Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
.getSetCookieStrings(...)
-------------------------
-Accepts the same options as `.getCookies()` but passes an array of strings suitable for Set-Cookie headers (rather than an array of `Cookie`s) to the callback. Simply maps the cookie array via `.toString()`.
+Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.
+
+.getSetCookieStringsSync(...)
+-----------------------------
+
+Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).
+
+Store
+=====
+
+Base class for CookieJar stores.
# CookieStore API
The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.
+Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.
+
All `domain` parameters will have been normalized before calling.
The Cookie store must have all of the following methods.
@@ -358,7 +390,7 @@ Pass an error ONLY if removing any existing cookies failed.
(tl;dr: MIT with some MPL/1.1)
-Copyright GoInstant, Inc. and other contributors. All rights reserved.
+Copyright 2012- GoInstant, Inc. and other 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
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js b/deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js
index a7fa54527..74d76aa1c 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js
@@ -18,13 +18,15 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
-
+'use strict';
var fs = require('fs');
var assert = require('assert');
var punycode = require('punycode');
fs.readFile('./public-suffix.txt', 'utf8', function(err,string) {
- if (err) throw err;
+ if (err) {
+ throw err;
+ }
var lines = string.split("\n");
process.nextTick(function() {
processList(lines);
@@ -38,7 +40,9 @@ function processList(lines) {
while (lines.length) {
var line = lines.shift();
line = line.replace(COMMENT,'').trim();
- if (!line) continue;
+ if (!line) {
+ continue;
+ }
addToIndex(index,line);
}
@@ -47,7 +51,7 @@ function processList(lines) {
var w = fs.createWriteStream('./lib/pubsuffix.js',{
flags: 'w',
encoding: 'utf8',
- mode: 0644,
+ mode: parseInt('644',8)
});
w.on('end', process.exit);
w.write("/****************************************************\n");
@@ -76,11 +80,12 @@ function addToIndex(index,line) {
line = line.slice(prefix.length);
}
line = prefix + punycode.toASCII(line);
-
- if (line.substr(0,1) == '!')
+
+ if (line.substr(0,1) == '!') {
index[line.substr(1)] = false;
- else
+ } else {
index[line] = true;
+ }
}
// include the licence in the function since it gets written to pubsuffix.js
@@ -105,8 +110,12 @@ function getPublicSuffix(domain) {
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
- if (!domain) return null;
- if (domain.match(/^\./)) return null;
+ if (!domain) {
+ return null;
+ }
+ if (domain.match(/^\./)) {
+ return null;
+ }
domain = domain.toLowerCase();
var parts = domain.split('.').reverse();
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 1d8615b58..c93e927ae 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
@@ -19,10 +19,11 @@
* IN THE SOFTWARE.
*/
-/*jshint regexp:false */
+'use strict';
var net = require('net');
var urlParse = require('url').parse;
var pubsuffix = require('./pubsuffix');
+var Store = require('./store').Store;
var punycode;
try {
@@ -39,11 +40,11 @@ var TOKEN = /[\x21\x23-\x26\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5A\x5E-\x7A\x7C\x7E]/
// From RFC6265 S4.1.1
// note that it excludes \x3B ";"
var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/;
-var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
+var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'$');
// The name/key cannot be empty but the value can (S5.2):
-var COOKIE_PAIR_STRICT = new RegExp('^('+TOKEN.source+'+)=("?)('+COOKIE_OCTET.source+'*)\\2');
-var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2/;
+var COOKIE_PAIR_STRICT = new RegExp('^('+TOKEN.source+'+)=("?)('+COOKIE_OCTET.source+'*)\\2$');
+var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/;
// RFC6265 S4.1.1 defines extension-av as 'any CHAR except CTLs or ";"'
// Note ';' is \x3B
@@ -70,7 +71,8 @@ var STRICT_TIME = /^(0?[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/;
var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)$/i;
var MONTH_TO_NUM = {
- jan:0, feb:1, mar:2, apr:3, may:4, jun:5, jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
+ jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
+ jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
};
var NUM_TO_MONTH = [
'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
@@ -79,17 +81,17 @@ var NUM_TO_DAY = [
'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
];
-var YEAR = /^([1-9][0-9]{1,3})$/; // 2 to 4 digits (will check range when parsing)
+var YEAR = /^([1-9][0-9]{1,3})$/; // 2 to 4 digits
var MAX_TIME = 2147483647000; // 31-bit max
-var MAX_DATE = new Date(CookieJar.MAX_TIME); // 31-bit max
var MIN_TIME = 0; // 31-bit min
-var MIN_DATE = new Date(CookieJar.MIN_TIME); // 31-bit min
// RFC6265 S5.1.1 date parser:
function parseDate(str,strict) {
- if (!str) return;
+ if (!str) {
+ return;
+ }
var found_time, found_dom, found_month, found_year;
/* RFC6265 S5.1.1:
@@ -97,14 +99,18 @@ function parseDate(str,strict) {
* appear in the cookie-date
*/
var tokens = str.split(DATE_DELIM);
- if (!tokens) return;
+ if (!tokens) {
+ return;
+ }
var date = new Date();
date.setMilliseconds(0);
for (var i=0; i<tokens.length; i++) {
var token = tokens[i].trim();
- if (!token.length) continue;
+ if (!token.length) {
+ continue;
+ }
var result;
@@ -168,13 +174,15 @@ function parseDate(str,strict) {
* 4. If the year-value is greater than or equal to 0 and less
* than or equal to 69, increment the year-value by 2000.
*/
- if (70 <= year && year <= 99)
+ if (70 <= year && year <= 99) {
year += 1900;
- else if (0 <= year && year <= 69)
+ } else if (0 <= year && year <= 69) {
year += 2000;
+ }
- if (year < 1601)
+ if (year < 1601) {
return; // 5. ... the year-value is less than 1601
+ }
found_year = true;
date.setUTCFullYear(year);
@@ -203,19 +211,24 @@ function formatDate(date) {
// S5.1.2 Canonicalized Host Names
function canonicalDomain(str) {
- if (str == null) return null;
+ if (str == null) {
+ return null;
+ }
str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading .
// convert to IDN if any non-ASCII characters
- if (punycode && /[^\u0001-\u007f]/.test(str))
+ if (punycode && /[^\u0001-\u007f]/.test(str)) {
str = punycode.toASCII(str);
+ }
return str.toLowerCase();
}
// S5.1.3 Domain Matching
function domainMatch(str, domStr, canonicalize) {
- if (str == null || domStr == null) return null;
+ if (str == null || domStr == null) {
+ return null;
+ }
if (canonicalize !== false) {
str = canonicalDomain(str);
domStr = canonicalDomain(domStr);
@@ -226,25 +239,35 @@ function domainMatch(str, domStr, canonicalize) {
* domain string and the string will have been canonicalized to lower case at
* this point)"
*/
- if (str == domStr) return true;
+ if (str == domStr) {
+ return true;
+ }
/* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
/* "* The string is a host name (i.e., not an IP address)." */
- if (net.isIP(str)) return false;
+ if (net.isIP(str)) {
+ return false;
+ }
/* "* The domain string is a suffix of the string" */
var idx = str.indexOf(domStr);
- if (idx <= 0) return false; // it's a non-match (-1) or prefix (0)
+ if (idx <= 0) {
+ return false; // it's a non-match (-1) or prefix (0)
+ }
// e.g "a.b.c".indexOf("b.c") === 2
// 5 === 3+2
- if (str.length !== domStr.length + idx) // it's not a suffix
+ if (str.length !== domStr.length + idx) { // it's not a suffix
return false;
+ }
/* "* The last character of the string that is not included in the domain
* string is a %x2E (".") character." */
- if (str.substr(idx-1,1) !== '.') return false;
+ if (str.substr(idx-1,1) !== '.') {
+ return false;
+ }
+
return true;
}
@@ -260,14 +283,20 @@ function domainMatch(str, domStr, canonicalize) {
function defaultPath(path) {
// "2. If the uri-path is empty or if the first character of the uri-path is not
// a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
- if (!path || path.substr(0,1) !== "/") return "/";
+ if (!path || path.substr(0,1) !== "/") {
+ return "/";
+ }
// "3. If the uri-path contains no more than one %x2F ("/") character, output
// %x2F ("/") and skip the remaining step."
- if (path === "/") return path;
+ if (path === "/") {
+ return path;
+ }
var rightSlash = path.lastIndexOf("/");
- if (rightSlash === 0) return "/";
+ if (rightSlash === 0) {
+ return "/";
+ }
// "4. Output the characters of the uri-path from the first character up to,
// but not including, the right-most %x2F ("/")."
@@ -280,21 +309,24 @@ function defaultPath(path) {
*/
function pathMatch(reqPath,cookiePath) {
// "o The cookie-path and the request-path are identical."
- if (cookiePath === reqPath)
+ if (cookiePath === reqPath) {
return true;
+ }
var idx = reqPath.indexOf(cookiePath);
if (idx === 0) {
// "o The cookie-path is a prefix of the request-path, and the last
// character of the cookie-path is %x2F ("/")."
- if (cookiePath.substr(-1) === "/")
+ if (cookiePath.substr(-1) === "/") {
return true;
+ }
// " o The cookie-path is a prefix of the request-path, and the first
// character of the request-path that is not included in the cookie- path
// is a %x2F ("/") character."
- if (reqPath.substr(cookiePath.length,1) === "/")
+ if (reqPath.substr(cookiePath.length,1) === "/") {
return true;
+ }
}
return false;
@@ -307,7 +339,9 @@ function parse(str, strict) {
// If we are not in strict mode we remove the trailing semi-colons.
var semiColonCheck = TRAILING_SEMICOLON.exec(str);
if (semiColonCheck) {
- if (strict) return;
+ if (strict) {
+ return;
+ }
str = str.slice(0, semiColonCheck.index);
}
@@ -318,13 +352,17 @@ function parse(str, strict) {
// Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")"
// constraints as well as trimming any whitespace.
- if (!result) return;
+ if (!result) {
+ return;
+ }
var c = new Cookie();
c.key = result[1]; // the regexp should trim() already
c.value = result[3]; // [2] is quotes or empty-string
- if (firstSemi === -1) return c;
+ if (firstSemi === -1) {
+ return c;
+ }
// S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
// (including the %x3B (";") in question)." plus later on in the same section
@@ -333,7 +371,9 @@ function parse(str, strict) {
// "If the unparsed-attributes string is empty, skip the rest of these
// steps."
- if (unparsed.length === 0) return c;
+ if (unparsed.length === 0) {
+ return c;
+ }
/*
* S5.2 says that when looping over the items "[p]rocess the attribute-name
@@ -347,7 +387,9 @@ function parse(str, strict) {
while (cookie_avs.length) {
var av = cookie_avs.shift();
- if (strict && !EXTENSION_AV.test(av)) return;
+ if (strict && !EXTENSION_AV.test(av)) {
+ return;
+ }
var av_sep = av.indexOf('=');
var av_key, av_value;
@@ -360,28 +402,32 @@ function parse(str, strict) {
}
av_key = av_key.trim().toLowerCase();
- if (av_value) av_value = av_value.trim();
+ if (av_value) {
+ av_value = av_value.trim();
+ }
switch(av_key) {
case 'expires': // S5.2.1
- if (!av_value) { if(strict){return}else{break;} }
+ if (!av_value) {if(strict){return;}else{break;} }
var exp = parseDate(av_value,strict);
// "If the attribute-value failed to parse as a cookie date, ignore the
// cookie-av."
- if (exp == null) { if(strict){return}else{break;} }
+ if (exp == null) { if(strict){return;}else{break;} }
c.expires = exp;
// over and underflow not realistically a concern: V8's getTime() seems to
// store something larger than a 32-bit time_t (even with 32-bit node)
break;
case 'max-age': // S5.2.2
- if (!av_value) { if(strict){return}else{break;} }
+ if (!av_value) { if(strict){return;}else{break;} }
// "If the first character of the attribute-value is not a DIGIT or a "-"
// character ...[or]... If the remainder of attribute-value contains a
// non-DIGIT character, ignore the cookie-av."
- if (!/^-?[0-9]+$/.test(av_value)) { if(strict){return}else{break;} }
+ if (!/^-?[0-9]+$/.test(av_value)) { if(strict){return;}else{break;} }
var delta = parseInt(av_value,10);
- if (strict && delta <= 0) return; // S4.1.1
+ if (strict && delta <= 0) {
+ return; // S4.1.1
+ }
// "If delta-seconds is less than or equal to zero (0), let expiry-time
// be the earliest representable date and time."
c.setMaxAge(delta);
@@ -390,11 +436,11 @@ function parse(str, strict) {
case 'domain': // S5.2.3
// "If the attribute-value is empty, the behavior is undefined. However,
// the user agent SHOULD ignore the cookie-av entirely."
- if (!av_value) { if(strict){return}else{break;} }
+ if (!av_value) { if(strict){return;}else{break;} }
// S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
// (".") character."
var domain = av_value.trim().replace(/^\./,'');
- if (!domain) { if(strict){return}else{break;} } // see "is empty" above
+ if (!domain) { if(strict){return;}else{break;} } // see "is empty" above
// "Convert the cookie-domain to lower case."
c.domain = domain.toLowerCase();
break;
@@ -410,7 +456,9 @@ function parse(str, strict) {
* We'll represent the default-path as null since it depends on the
* context of the parsing.
*/
- if (!av_value || av_value.substr(0,1) != "/") { if(strict){return}else{break;} }
+ if (!av_value || av_value.substr(0,1) != "/") {
+ if(strict){return;}else{break;}
+ }
c.path = av_value;
break;
@@ -420,12 +468,12 @@ function parse(str, strict) {
* the user agent MUST append an attribute to the cookie-attribute-list
* with an attribute-name of Secure and an empty attribute-value."
*/
- if (av_value != null) { if(strict){return} }
+ if (av_value != null) { if(strict){return;} }
c.secure = true;
break;
case 'httponly': // S5.2.6 -- effectively the same as 'secure'
- if (av_value != null) { if(strict){return} }
+ if (av_value != null) { if(strict){return;} }
c.httpOnly = true;
break;
@@ -442,7 +490,9 @@ function parse(str, strict) {
}
function fromJSON(str) {
- if (!str) return null;
+ if (!str) {
+ return null;
+ }
var obj;
try {
@@ -454,7 +504,9 @@ function fromJSON(str) {
var c = new Cookie();
for (var i=0; i<numCookieProperties; i++) {
var prop = cookieProperties[i];
- if (obj[prop] == null) continue;
+ if (obj[prop] == null) {
+ continue;
+ }
if (prop === 'expires' ||
prop === 'creation' ||
prop === 'lastAccessed')
@@ -484,7 +536,9 @@ function fromJSON(str) {
function cookieCompare(a,b) {
// descending for length: b CMP a
var deltaLen = (b.path ? b.path.length : 0) - (a.path ? a.path.length : 0);
- if (deltaLen !== 0) return deltaLen;
+ if (deltaLen !== 0) {
+ return deltaLen;
+ }
// ascending for time: a CMP b
return (a.creation ? a.creation.getTime() : MAX_TIME) -
(b.creation ? b.creation.getTime() : MAX_TIME);
@@ -494,8 +548,12 @@ function cookieCompare(a,b) {
// array is in shortest-to-longest order. Handy for indexing.
function permuteDomain(domain) {
var pubSuf = pubsuffix.getPublicSuffix(domain);
- if (!pubSuf) return null;
- if (pubSuf == domain) return [domain];
+ if (!pubSuf) {
+ return null;
+ }
+ if (pubSuf == domain) {
+ return [domain];
+ }
var prefix = domain.slice(0,-(pubSuf.length+1)); // ".example.com"
var parts = prefix.split('.').reverse();
@@ -511,14 +569,18 @@ function permuteDomain(domain) {
// Gives the permutation of all possible pathMatch()es of a given path. The
// array is in longest-to-shortest order. Handy for indexing.
function permutePath(path) {
- var origPath = path;
- if (path === '/') return ['/'];
- if (path.lastIndexOf('/') === path.length-1)
+ if (path === '/') {
+ return ['/'];
+ }
+ if (path.lastIndexOf('/') === path.length-1) {
path = path.substr(0,path.length-1);
+ }
var permutations = [path];
while (path.length > 1) {
var lindex = path.lastIndexOf('/');
- if (lindex === 0) break;
+ if (lindex === 0) {
+ break;
+ }
path = path.substr(0,lindex);
permutations.push(path);
}
@@ -528,7 +590,9 @@ function permutePath(path) {
function Cookie (opts) {
- if (typeof opts !== "object") return;
+ if (typeof opts !== "object") {
+ return;
+ }
Object.keys(opts).forEach(function (key) {
if (Cookie.prototype.hasOwnProperty(key)) {
this[key] = opts[key] || Cookie.prototype[key];
@@ -558,7 +622,9 @@ Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
Cookie.prototype.lastAccessed = null; // Date when set
var cookieProperties = Object.freeze(Object.keys(Cookie.prototype).map(function(p) {
- if (p instanceof Function) return;
+ if (p instanceof Function) {
+ return;
+ }
return p;
}));
var numCookieProperties = cookieProperties.length;
@@ -573,46 +639,55 @@ Cookie.prototype.inspect = function inspect() {
};
Cookie.prototype.validate = function validate() {
- if (!COOKIE_OCTETS.test(this.value))
+ if (!COOKIE_OCTETS.test(this.value)) {
return false;
- if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires,true))
+ }
+ if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires,true)) {
return false;
- if (this.maxAge != null && this.maxAge <= 0)
+ }
+ if (this.maxAge != null && this.maxAge <= 0) {
return false; // "Max-Age=" non-zero-digit *DIGIT
- if (this.path != null && !PATH_VALUE.test(this.path))
+ }
+ if (this.path != null && !PATH_VALUE.test(this.path)) {
return false;
+ }
var cdomain = this.cdomain();
if (cdomain) {
- if (cdomain.match(/\.$/))
+ if (cdomain.match(/\.$/)) {
return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this
+ }
var suffix = pubsuffix.getPublicSuffix(cdomain);
- if (suffix == null) // it's a public suffix
+ if (suffix == null) { // it's a public suffix
return false;
+ }
}
return true;
};
Cookie.prototype.setExpires = function setExpires(exp) {
- if (exp instanceof Date) this.expires = exp;
- else this.expires = parseDate(exp) || "Infinity";
+ if (exp instanceof Date) {
+ this.expires = exp;
+ } else {
+ this.expires = parseDate(exp) || "Infinity";
+ }
};
Cookie.prototype.setMaxAge = function setMaxAge(age) {
- if (age === Infinity || age === -Infinity)
+ if (age === Infinity || age === -Infinity) {
this.maxAge = age.toString(); // so JSON.stringify() works
- else
+ } else {
this.maxAge = age;
+ }
};
// gives Cookie header format
Cookie.prototype.cookieString = function cookieString() {
var val = this.value;
- if (val == null) val = '';
- if (!val.length || COOKIE_OCTETS.test(val))
- return this.key+'='+val;
- else
- return this.key+'="'+val+'"';
+ if (val == null) {
+ val = '';
+ }
+ return this.key+'='+val;
};
// gives Set-Cookie header format
@@ -620,22 +695,30 @@ Cookie.prototype.toString = function toString() {
var str = this.cookieString();
if (this.expires != Infinity) {
- if (this.expires instanceof Date)
+ if (this.expires instanceof Date) {
str += '; Expires='+formatDate(this.expires);
- else
+ } else {
str += '; Expires='+this.expires;
+ }
}
- if (this.maxAge != null && this.maxAge != Infinity)
+ if (this.maxAge != null && this.maxAge != Infinity) {
str += '; Max-Age='+this.maxAge;
+ }
- if (this.domain && !this.hostOnly)
+ if (this.domain && !this.hostOnly) {
str += '; Domain='+this.domain;
- if (this.path)
+ }
+ if (this.path) {
str += '; Path='+this.path;
+ }
- if (this.secure) str += '; Secure';
- if (this.httpOnly) str += '; HttpOnly';
+ if (this.secure) {
+ str += '; Secure';
+ }
+ if (this.httpOnly) {
+ str += '; HttpOnly';
+ }
if (this.extensions) {
this.extensions.forEach(function(ext) {
str += '; '+ext;
@@ -665,8 +748,9 @@ Cookie.prototype.TTL = function TTL(now) {
expires = parseDate(expires) || Infinity;
}
- if (expires == Infinity)
+ if (expires == Infinity) {
return Infinity;
+ }
return expires.getTime() - (now || Date.now());
}
@@ -683,7 +767,9 @@ Cookie.prototype.expiryTime = function expiryTime(now) {
return relativeTo.getTime() + age;
}
- if (this.expires == Infinity) return Infinity;
+ if (this.expires == Infinity) {
+ return Infinity;
+ }
return this.expires.getTime();
};
@@ -691,9 +777,13 @@ Cookie.prototype.expiryTime = function expiryTime(now) {
// elsewhere), except it returns a Date
Cookie.prototype.expiryDate = function expiryDate(now) {
var millisec = this.expiryTime(now);
- if (millisec == Infinity) return new Date(MAX_TIME);
- else if (millisec == -Infinity) return new Date(MIN_TIME);
- else return new Date(millisec);
+ if (millisec == Infinity) {
+ return new Date(MAX_TIME);
+ } else if (millisec == -Infinity) {
+ return new Date(MIN_TIME);
+ } else {
+ return new Date(millisec);
+ }
};
// This replaces the "persistent-flag" parts of S5.3 step 3
@@ -704,14 +794,19 @@ Cookie.prototype.isPersistent = function isPersistent() {
// Mostly S5.1.2 and S5.2.3:
Cookie.prototype.cdomain =
Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
- if (this.domain == null) return null;
+ if (this.domain == null) {
+ return null;
+ }
return canonicalDomain(this.domain);
};
var memstore;
function CookieJar(store, rejectPublicSuffixes) {
- if (rejectPublicSuffixes != null) this.rejectPublicSuffixes = rejectPublicSuffixes;
+ if (rejectPublicSuffixes != null) {
+ this.rejectPublicSuffixes = rejectPublicSuffixes;
+ }
+
if (!store) {
memstore = memstore || require('./memstore');
store = new memstore.MemoryCookieStore();
@@ -720,8 +815,10 @@ function CookieJar(store, rejectPublicSuffixes) {
}
CookieJar.prototype.store = null;
CookieJar.prototype.rejectPublicSuffixes = true;
+var CAN_BE_SYNC = [];
-CookieJar.prototype.setCookie = function setCookie(cookie, url, options, cb) {
+CAN_BE_SYNC.push('setCookie');
+CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
var err;
var context = (url instanceof Object) ? url : urlParse(url);
if (options instanceof Function) {
@@ -732,8 +829,9 @@ CookieJar.prototype.setCookie = function setCookie(cookie, url, options, cb) {
var host = canonicalDomain(context.hostname);
// S5.3 step 1
- if (!(cookie instanceof Cookie))
+ if (!(cookie instanceof Cookie)) {
cookie = Cookie.parse(cookie, options.strict === true);
+ }
if (!cookie) {
err = new Error("Cookie failed to parse");
return cb(options.ignoreError ? null : err);
@@ -762,8 +860,9 @@ CookieJar.prototype.setCookie = function setCookie(cookie, url, options, cb) {
return cb(options.ignoreError ? null : err);
}
- if (cookie.hostOnly == null) // don't reset if already set
+ if (cookie.hostOnly == null) { // don't reset if already set
cookie.hostOnly = false;
+ }
} else {
cookie.hostOnly = true;
@@ -776,8 +875,9 @@ CookieJar.prototype.setCookie = function setCookie(cookie, url, options, cb) {
cookie.path = defaultPath(context.pathname);
cookie.pathIsDefault = true;
} else {
- if (cookie.path.length > 1 && cookie.path.substr(-1) == '/')
+ if (cookie.path.length > 1 && cookie.path.substr(-1) == '/') {
cookie.path = cookie.path.slice(0,-1);
+ }
}
// S5.3 step 8: NOOP; secure attribute
@@ -792,17 +892,22 @@ CookieJar.prototype.setCookie = function setCookie(cookie, url, options, cb) {
var store = this.store;
if (!store.updateCookie) {
- store.updateCookie = function stubUpdateCookie(oldCookie, newCookie, cb) {
+ store.updateCookie = function(oldCookie, newCookie, cb) {
this.putCookie(newCookie, cb);
};
}
- store.findCookie(cookie.domain, cookie.path, cookie.key, function(err,oldCookie) {
- if (err) return cb(err);
+ function withCookie(err, oldCookie) {
+ if (err) {
+ return cb(err);
+ }
var next = function(err) {
- if (err) return cb(err);
- else cb(null, cookie);
+ if (err) {
+ return cb(err);
+ } else {
+ cb(null, cookie);
+ }
};
if (oldCookie) {
@@ -821,11 +926,14 @@ CookieJar.prototype.setCookie = function setCookie(cookie, url, options, cb) {
cookie.creation = cookie.lastAccessed = now;
store.putCookie(cookie, next); // step 12
}
- });
+ }
+
+ store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
};
// RFC6365 S5.4
-CookieJar.prototype.getCookies = function getCookies(url, options, cb) {
+CAN_BE_SYNC.push('getCookies');
+CookieJar.prototype.getCookies = function(url, options, cb) {
var context = (url instanceof Object) ? url : urlParse(url);
if (options instanceof Function) {
cb = options;
@@ -843,7 +951,9 @@ CookieJar.prototype.getCookies = function getCookies(url, options, cb) {
}
var http = options.http;
- if (http == null) http = true;
+ if (http == null) {
+ http = true;
+ }
var now = options.now || Date.now();
var expireCheck = options.expire !== false;
@@ -858,24 +968,31 @@ CookieJar.prototype.getCookies = function getCookies(url, options, cb) {
// The cookie's host-only-flag is false and the canonicalized
// request-host domain-matches the cookie's domain."
if (c.hostOnly) {
- if (c.domain != host) return false;
+ if (c.domain != host) {
+ return false;
+ }
} else {
- if (!domainMatch(host, c.domain, false)) return false;
+ if (!domainMatch(host, c.domain, false)) {
+ return false;
+ }
}
// "The request-uri's path path-matches the cookie's path."
- if (!allPaths && !pathMatch(path, c.path))
+ if (!allPaths && !pathMatch(path, c.path)) {
return false;
+ }
// "If the cookie's secure-only-flag is true, then the request-uri's
// scheme must denote a "secure" protocol"
- if (c.secure && !secure)
+ if (c.secure && !secure) {
return false;
+ }
// "If the cookie's http-only-flag is true, then exclude the cookie if the
// cookie-string is being generated for a "non-HTTP" API"
- if (c.httpOnly && !http)
+ if (c.httpOnly && !http) {
return false;
+ }
// deferred from S5.3
// non-RFC: allow retention of expired cookies by choice
@@ -888,50 +1005,93 @@ CookieJar.prototype.getCookies = function getCookies(url, options, cb) {
}
store.findCookies(host, allPaths ? null : path, function(err,cookies) {
- if (err) return cb(err);
+ if (err) {
+ return cb(err);
+ }
cookies = cookies.filter(matchingCookie);
// sorting of S5.4 part 2
- if (options.sort !== false)
+ if (options.sort !== false) {
cookies = cookies.sort(cookieCompare);
+ }
// S5.4 part 3
var now = new Date();
- cookies.forEach(function(c) { c.lastAccessed = now });
+ cookies.forEach(function(c) {
+ c.lastAccessed = now;
+ });
// TODO persist lastAccessed
cb(null,cookies);
});
};
+CAN_BE_SYNC.push('getCookieString');
CookieJar.prototype.getCookieString = function(/*..., cb*/) {
var args = Array.prototype.slice.call(arguments,0);
var cb = args.pop();
var next = function(err,cookies) {
- if (err) cb(err);
- else cb(null, cookies.map(function(c){return c.cookieString()}).join('; '));
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, cookies.map(function(c){
+ return c.cookieString();
+ }).join('; '));
+ }
};
args.push(next);
this.getCookies.apply(this,args);
};
+CAN_BE_SYNC.push('getSetCookieStrings');
CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
var args = Array.prototype.slice.call(arguments,0);
var cb = args.pop();
var next = function(err,cookies) {
- if (err) cb(err);
- else cb(null, cookies.map(function(c){return c.toString()}));
+ if (err) {
+ cb(err);
+ } else {
+ cb(null, cookies.map(function(c){
+ return c.toString();
+ }));
+ }
};
args.push(next);
this.getCookies.apply(this,args);
};
+// Use a closure to provide a true imperative API for synchronous stores.
+function syncWrap(method) {
+ return function() {
+ if (!this.store.synchronous) {
+ throw new Error('CookieJar store is not synchronous; use async API instead.');
+ }
+
+ var args = Array.prototype.slice.call(arguments);
+ var syncErr, syncResult;
+ args.push(function syncCb(err, result) {
+ syncErr = err;
+ syncResult = result;
+ });
+ this[method].apply(this, args);
+
+ if (syncErr) {
+ throw syncErr;
+ }
+ return syncResult;
+ };
+}
+// wrap all declared CAN_BE_SYNC methods in the sync wrapper
+CAN_BE_SYNC.forEach(function(method) {
+ CookieJar.prototype[method+'Sync'] = syncWrap(method);
+});
module.exports = {
CookieJar: CookieJar,
Cookie: Cookie,
+ Store: Store,
parseDate: parseDate,
formatDate: formatDate,
parse: parse,
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js
index 66abb3760..fc5774c8a 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/memstore.js
@@ -1,28 +1,39 @@
+'use strict';
var tough = require('./cookie');
+var Store = require('./store').Store;
var permuteDomain = tough.permuteDomain;
var permutePath = tough.permutePath;
var util = require('util');
function MemoryCookieStore() {
+ Store.call(this);
this.idx = {};
}
-module.exports.MemoryCookieStore = MemoryCookieStore;
+util.inherits(MemoryCookieStore, Store);
+exports.MemoryCookieStore = MemoryCookieStore;
MemoryCookieStore.prototype.idx = null;
+MemoryCookieStore.prototype.synchronous = true;
// force a default depth:
-MemoryCookieStore.prototype.inspect = function inspect() {
+MemoryCookieStore.prototype.inspect = function() {
return "{ idx: "+util.inspect(this.idx, false, 2)+' }';
};
-MemoryCookieStore.prototype.findCookie = function findCookie(domain, path, key, cb) {
- if (!this.idx[domain]) return cb(null,undefined);
- if (!this.idx[domain][path]) return cb(null,undefined);
+MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {
+ if (!this.idx[domain]) {
+ return cb(null,undefined);
+ }
+ if (!this.idx[domain][path]) {
+ return cb(null,undefined);
+ }
return cb(null,this.idx[domain][path][key]||null);
};
-MemoryCookieStore.prototype.findCookies = function findCookies(domain, path, cb) {
+MemoryCookieStore.prototype.findCookies = function(domain, path, cb) {
var results = [];
- if (!domain) return cb(null,[]);
+ if (!domain) {
+ return cb(null,[]);
+ }
var pathMatcher;
if (!path) {
@@ -39,7 +50,9 @@ MemoryCookieStore.prototype.findCookies = function findCookies(domain, path, cb)
} else if (path === '/') {
pathMatcher = function matchSlash(domainIndex) {
var pathIndex = domainIndex['/'];
- if (!pathIndex) return;
+ if (!pathIndex) {
+ return;
+ }
for (var key in pathIndex) {
results.push(pathIndex[key]);
}
@@ -50,7 +63,9 @@ MemoryCookieStore.prototype.findCookies = function findCookies(domain, path, cb)
pathMatcher = function matchRFC(domainIndex) {
paths.forEach(function(curPath) {
var pathIndex = domainIndex[curPath];
- if (!pathIndex) return;
+ if (!pathIndex) {
+ return;
+ }
for (var key in pathIndex) {
results.push(pathIndex[key]);
}
@@ -62,16 +77,22 @@ MemoryCookieStore.prototype.findCookies = function findCookies(domain, path, cb)
var idx = this.idx;
domains.forEach(function(curDomain) {
var domainIndex = idx[curDomain];
- if (!domainIndex) return;
+ if (!domainIndex) {
+ return;
+ }
pathMatcher(domainIndex);
});
cb(null,results);
};
-MemoryCookieStore.prototype.putCookie = function putCookie(cookie, cb) {
- if (!this.idx[cookie.domain]) this.idx[cookie.domain] = {};
- if (!this.idx[cookie.domain][cookie.path]) this.idx[cookie.domain][cookie.path] = {};
+MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
+ if (!this.idx[cookie.domain]) {
+ this.idx[cookie.domain] = {};
+ }
+ if (!this.idx[cookie.domain][cookie.path]) {
+ this.idx[cookie.domain][cookie.path] = {};
+ }
this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
cb(null);
};
@@ -91,7 +112,7 @@ MemoryCookieStore.prototype.removeCookie = function removeCookie(domain, path, k
};
MemoryCookieStore.prototype.removeCookies = function removeCookies(domain, path, cb) {
- if (!this.idx[domain]) {
+ if (this.idx[domain]) {
if (path) {
delete this.idx[domain][path];
} else {
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js
new file mode 100644
index 000000000..f8433dfcb
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/store.js
@@ -0,0 +1,37 @@
+'use strict';
+/*jshint unused:false */
+
+function Store() {
+}
+exports.Store = Store;
+
+// Stores may be synchronous, but are still required to use a
+// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync"
+// API that converts from synchronous-callbacks to imperative style.
+Store.prototype.synchronous = false;
+
+Store.prototype.findCookie = function(domain, path, key, cb) {
+ throw new Error('findCookie is not implemented');
+};
+
+Store.prototype.findCookies = function(domain, path, cb) {
+ throw new Error('findCookies is not implemented');
+};
+
+Store.prototype.putCookie = function(cookie, cb) {
+ throw new Error('putCookie is not implemented');
+};
+
+Store.prototype.updateCookie = function(oldCookie, newCookie, cb) {
+ // recommended default implementation:
+ // return this.putCookie(newCookie, cb);
+ throw new Error('updateCookie is not implemented');
+};
+
+Store.prototype.removeCookie = function(domain, path, key, cb) {
+ throw new Error('removeCookie is not implemented');
+};
+
+Store.prototype.removeCookies = function removeCookies(domain, path, cb) {
+ throw new Error('removeCookies is not implemented');
+};
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt
deleted file mode 100644
index 11dddd00e..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-GPL.txt
+++ /dev/null
@@ -1,278 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md
new file mode 100644
index 000000000..577f2c7a1
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md
@@ -0,0 +1,176 @@
+# Punycode.js [![Build status](https://travis-ci.org/bestiejs/punycode.js.svg?branch=master)](https://travis-ci.org/bestiejs/punycode.js) [![Code coverage status](http://img.shields.io/coveralls/bestiejs/punycode.js/master.svg)](https://coveralls.io/r/bestiejs/punycode.js) [![Dependency status](https://gemnasium.com/bestiejs/punycode.js.svg)](https://gemnasium.com/bestiejs/punycode.js)
+
+A robust Punycode converter that fully complies to [RFC 3492](http://tools.ietf.org/html/rfc3492) and [RFC 5891](http://tools.ietf.org/html/rfc5891), and works on nearly all JavaScript platforms.
+
+This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:
+
+* [The C example code from RFC 3492](http://tools.ietf.org/html/rfc3492#appendix-C)
+* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)
+* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)
+* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)
+* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))
+
+This project is [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with [Node.js v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc).
+
+## Installation
+
+Via [npm](http://npmjs.org/) (only required for Node.js releases older than v0.6.2):
+
+```bash
+npm install punycode
+```
+
+Via [Bower](http://bower.io/):
+
+```bash
+bower install punycode
+```
+
+Via [Component](https://github.com/component/component):
+
+```bash
+component install bestiejs/punycode.js
+```
+
+In a browser:
+
+```html
+<script src="punycode.js"></script>
+```
+
+In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):
+
+```js
+var punycode = require('punycode');
+```
+
+In [Rhino](http://www.mozilla.org/rhino/):
+
+```js
+load('punycode.js');
+```
+
+Using an AMD loader like [RequireJS](http://requirejs.org/):
+
+```js
+require(
+ {
+ 'paths': {
+ 'punycode': 'path/to/punycode'
+ }
+ },
+ ['punycode'],
+ function(punycode) {
+ console.log(punycode);
+ }
+);
+```
+
+## API
+
+### `punycode.decode(string)`
+
+Converts a Punycode string of ASCII symbols to a string of Unicode symbols.
+
+```js
+// decode domain name parts
+punycode.decode('maana-pta'); // 'mañana'
+punycode.decode('--dqo34k'); // '☃-⌘'
+```
+
+### `punycode.encode(string)`
+
+Converts a string of Unicode symbols to a Punycode string of ASCII symbols.
+
+```js
+// encode domain name parts
+punycode.encode('mañana'); // 'maana-pta'
+punycode.encode('☃-⌘'); // '--dqo34k'
+```
+
+### `punycode.toUnicode(input)`
+
+Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.
+
+```js
+// decode domain names
+punycode.toUnicode('xn--maana-pta.com');
+// → 'mañana.com'
+punycode.toUnicode('xn----dqo34k.com');
+// → '☃-⌘.com'
+
+// decode email addresses
+punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');
+// → 'джумла@джpумлатест.bрфa'
+```
+
+### `punycode.toASCII(input)`
+
+Converts a Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that's already in ASCII.
+
+```js
+// encode domain names
+punycode.toASCII('mañana.com');
+// → 'xn--maana-pta.com'
+punycode.toASCII('☃-⌘.com');
+// → 'xn----dqo34k.com'
+
+// encode email addresses
+punycode.toASCII('джумла@джpумлатест.bрфa');
+// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'
+```
+
+### `punycode.ucs2`
+
+#### `punycode.ucs2.decode(string)`
+
+Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](http://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.
+
+```js
+punycode.ucs2.decode('abc');
+// → [0x61, 0x62, 0x63]
+// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:
+punycode.ucs2.decode('\uD834\uDF06');
+// → [0x1D306]
+```
+
+#### `punycode.ucs2.encode(codePoints)`
+
+Creates a string based on an array of numeric code point values.
+
+```js
+punycode.ucs2.encode([0x61, 0x62, 0x63]);
+// → 'abc'
+punycode.ucs2.encode([0x1D306]);
+// → '\uD834\uDF06'
+```
+
+### `punycode.version`
+
+A string representing the current Punycode.js version number.
+
+## Unit tests & code coverage
+
+After cloning this repository, run `npm install --dev` to install the dependencies needed for Punycode.js development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`.
+
+Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, PhantomJS, and web browsers as well, use `grunt test`.
+
+To generate the code coverage report, use `grunt cover`.
+
+Feel free to fork if you see possible improvements!
+
+## Author
+
+| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
+|---|
+| [Mathias Bynens](http://mathiasbynens.be/) |
+
+## Contributors
+
+| [![twitter/jdalton](https://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
+|---|
+| [John-David Dalton](http://allyoucanleet.com/) |
+
+## License
+
+Punycode.js is available under the [MIT](http://mths.be/mit) license.
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json
index 0cc83fb22..ab13fc836 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json
@@ -1,6 +1,6 @@
{
"name": "punycode",
- "version": "1.2.3",
+ "version": "1.3.1",
"description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.",
"homepage": "http://mths.be/punycode",
"main": "punycode.js",
@@ -17,57 +17,71 @@
{
"type": "MIT",
"url": "http://mths.be/mit"
- },
- {
- "type": "GPL",
- "url": "http://mths.be/gpl"
}
],
"author": {
"name": "Mathias Bynens",
- "email": "mathias@qiwi.be",
"url": "http://mathiasbynens.be/"
},
"contributors": [
{
"name": "Mathias Bynens",
- "email": "mathias@qiwi.be",
"url": "http://mathiasbynens.be/"
},
{
"name": "John-David Dalton",
- "email": "john.david.dalton@gmail.com",
"url": "http://allyoucanleet.com/"
}
],
- "bugs": {
- "url": "https://github.com/bestiejs/punycode.js/issues"
- },
"repository": {
"type": "git",
"url": "https://github.com/bestiejs/punycode.js.git"
},
- "engines": [
- "node",
- "rhino"
+ "bugs": {
+ "url": "https://github.com/bestiejs/punycode.js/issues"
+ },
+ "files": [
+ "LICENSE-MIT.txt",
+ "punycode.js"
],
"directories": {
- "doc": "docs",
"test": "tests"
},
"scripts": {
"test": "node tests/tests.js"
},
"devDependencies": {
- "grunt": "~0.4.1",
- "grunt-contrib-uglify": "~0.2.2",
- "grunt-shell": "~0.2.2",
- "istanbul": "~0.1.37",
- "qunit-clib": "~1.3.0",
+ "coveralls": "^2.10.1",
+ "grunt": "^0.4.5",
+ "grunt-contrib-uglify": "^0.5.0",
+ "grunt-shell": "^0.7.0",
+ "istanbul": "^0.2.13",
+ "qunit-extras": "^1.2.0",
"qunitjs": "~1.11.0",
- "requirejs": "~2.1.6"
+ "requirejs": "^2.1.14"
+ },
+ "_id": "punycode@1.3.1",
+ "_shasum": "710afe5123c20a1530b712e3e682b9118fe8058e",
+ "_from": "punycode@>=0.2.0",
+ "_npmVersion": "1.4.9",
+ "_npmUser": {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ "maintainers": [
+ {
+ "name": "mathias",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "reconbot",
+ "email": "wizard@roborooter.com"
+ }
+ ],
+ "dist": {
+ "shasum": "710afe5123c20a1530b712e3e682b9118fe8058e",
+ "tarball": "http://registry.npmjs.org/punycode/-/punycode-1.3.1.tgz"
},
- "readme": "ERROR: No README data found!",
- "_id": "punycode@1.2.3",
- "_from": "punycode@>=0.2.0"
+ "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.1.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js
index 41803ba42..6ab1df3a0 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js
@@ -1,12 +1,17 @@
-/*! http://mths.be/punycode v1.2.3 by @mathias */
+/*! http://mths.be/punycode v1.3.1 by @mathias */
;(function(root) {
/** Detect free variables */
- var freeExports = typeof exports == 'object' && exports;
+ var freeExports = typeof exports == 'object' && exports &&
+ !exports.nodeType && exports;
var freeModule = typeof module == 'object' && module &&
- module.exports == freeExports && module;
+ !module.nodeType && module;
var freeGlobal = typeof global == 'object' && global;
- if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
+ if (
+ freeGlobal.global === freeGlobal ||
+ freeGlobal.window === freeGlobal ||
+ freeGlobal.self === freeGlobal
+ ) {
root = freeGlobal;
}
@@ -32,8 +37,8 @@
/** Regular expressions */
regexPunycode = /^xn--/,
- regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars
- regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators
+ regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
+ regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
/** Error messages */
errors = {
@@ -72,23 +77,35 @@
*/
function map(array, fn) {
var length = array.length;
+ var result = [];
while (length--) {
- array[length] = fn(array[length]);
+ result[length] = fn(array[length]);
}
- return array;
+ return result;
}
/**
- * A simple `Array#map`-like wrapper to work with domain name strings.
+ * A simple `Array#map`-like wrapper to work with domain name strings or email
+ * addresses.
* @private
- * @param {String} domain The domain name.
+ * @param {String} domain The domain name or email address.
* @param {Function} callback The function that gets called for every
* character.
* @returns {Array} A new string of characters returned by the callback
* function.
*/
function mapDomain(string, fn) {
- return map(string.split(regexSeparators), fn).join('.');
+ var parts = string.split('@');
+ var result = '';
+ if (parts.length > 1) {
+ // In email addresses, only the domain name should be punycoded. Leave
+ // the local part (i.e. everything up to `@`) intact.
+ result = parts[0] + '@';
+ string = parts[1];
+ }
+ var labels = string.split(regexSeparators);
+ var encoded = map(labels, fn).join('.');
+ return result + encoded;
}
/**
@@ -228,7 +245,6 @@
k,
digit,
t,
- length,
/** Cached calculation results */
baseMinusT;
@@ -308,8 +324,8 @@
}
/**
- * Converts a string of Unicode symbols to a Punycode string of ASCII-only
- * symbols.
+ * Converts a string of Unicode symbols (e.g. a domain name label) to a
+ * Punycode string of ASCII-only symbols.
* @memberOf punycode
* @param {String} input The string of Unicode symbols.
* @returns {String} The resulting Punycode string of ASCII-only symbols.
@@ -422,17 +438,18 @@
}
/**
- * Converts a Punycode string representing a domain name to Unicode. Only the
- * Punycoded parts of the domain name will be converted, i.e. it doesn't
- * matter if you call it on a string that has already been converted to
- * Unicode.
+ * Converts a Punycode string representing a domain name or an email address
+ * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
+ * it doesn't matter if you call it on a string that has already been
+ * converted to Unicode.
* @memberOf punycode
- * @param {String} domain The Punycode domain name to convert to Unicode.
+ * @param {String} input The Punycoded domain name or email address to
+ * convert to Unicode.
* @returns {String} The Unicode representation of the given Punycode
* string.
*/
- function toUnicode(domain) {
- return mapDomain(domain, function(string) {
+ function toUnicode(input) {
+ return mapDomain(input, function(string) {
return regexPunycode.test(string)
? decode(string.slice(4).toLowerCase())
: string;
@@ -440,15 +457,18 @@
}
/**
- * Converts a Unicode string representing a domain name to Punycode. Only the
- * non-ASCII parts of the domain name will be converted, i.e. it doesn't
- * matter if you call it with a domain that's already in ASCII.
+ * Converts a Unicode string representing a domain name or an email address to
+ * Punycode. Only the non-ASCII parts of the domain name will be converted,
+ * i.e. it doesn't matter if you call it with a domain that's already in
+ * ASCII.
* @memberOf punycode
- * @param {String} domain The domain name to convert, as a Unicode string.
- * @returns {String} The Punycode representation of the given domain name.
+ * @param {String} input The domain name or email address to convert, as a
+ * Unicode string.
+ * @returns {String} The Punycode representation of the given domain name or
+ * email address.
*/
- function toASCII(domain) {
- return mapDomain(domain, function(string) {
+ function toASCII(input) {
+ return mapDomain(input, function(string) {
return regexNonASCII.test(string)
? 'xn--' + encode(string)
: string;
@@ -464,7 +484,7 @@
* @memberOf punycode
* @type String
*/
- 'version': '1.2.3',
+ 'version': '1.3.1',
/**
* An object of methods to convert from JavaScript's internal character
* representation (UCS-2) to Unicode code points, and back.
@@ -490,11 +510,11 @@
typeof define.amd == 'object' &&
define.amd
) {
- define(function() {
+ define('punycode', function() {
return punycode;
});
- } else if (freeExports && !freeExports.nodeType) {
- if (freeModule) { // in Node.js or RingoJS v0.8.0+
+ } else if (freeExports && freeModule) {
+ if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+
freeModule.exports = punycode;
} else { // in Narwhal or RingoJS v0.7.0-
for (key in punycode) {
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.min.js b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.min.js
deleted file mode 100644
index ac5d914a1..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! http://mths.be/punycode v1.2.3 by @mathias */
-(function(o){function e(o){throw RangeError(L[o])}function n(o,e){for(var n=o.length;n--;)o[n]=e(o[n]);return o}function t(o,e){return n(o.split(S),e).join(".")}function r(o){for(var e,n,t=[],r=0,u=o.length;u>r;)e=o.charCodeAt(r++),e>=55296&&56319>=e&&u>r?(n=o.charCodeAt(r++),56320==(64512&n)?t.push(((1023&e)<<10)+(1023&n)+65536):(t.push(e),r--)):t.push(e);return t}function u(o){return n(o,function(o){var e="";return o>65535&&(o-=65536,e+=R(55296|1023&o>>>10),o=56320|1023&o),e+=R(o)}).join("")}function i(o){return 10>o-48?o-22:26>o-65?o-65:26>o-97?o-97:x}function f(o,e){return o+22+75*(26>o)-((0!=e)<<5)}function c(o,e,n){var t=0;for(o=n?P(o/m):o>>1,o+=P(o/e);o>M*y>>1;t+=x)o=P(o/M);return P(t+(M+1)*o/(o+j))}function l(o){var n,t,r,f,l,d,s,a,p,h,v=[],g=o.length,w=0,j=I,m=A;for(t=o.lastIndexOf(F),0>t&&(t=0),r=0;t>r;++r)o.charCodeAt(r)>=128&&e("not-basic"),v.push(o.charCodeAt(r));for(f=t>0?t+1:0;g>f;){for(l=w,d=1,s=x;f>=g&&e("invalid-input"),a=i(o.charCodeAt(f++)),(a>=x||a>P((b-w)/d))&&e("overflow"),w+=a*d,p=m>=s?C:s>=m+y?y:s-m,!(p>a);s+=x)h=x-p,d>P(b/h)&&e("overflow"),d*=h;n=v.length+1,m=c(w-l,n,0==l),P(w/n)>b-j&&e("overflow"),j+=P(w/n),w%=n,v.splice(w++,0,j)}return u(v)}function d(o){var n,t,u,i,l,d,s,a,p,h,v,g,w,j,m,E=[];for(o=r(o),g=o.length,n=I,t=0,l=A,d=0;g>d;++d)v=o[d],128>v&&E.push(R(v));for(u=i=E.length,i&&E.push(F);g>u;){for(s=b,d=0;g>d;++d)v=o[d],v>=n&&s>v&&(s=v);for(w=u+1,s-n>P((b-t)/w)&&e("overflow"),t+=(s-n)*w,n=s,d=0;g>d;++d)if(v=o[d],n>v&&++t>b&&e("overflow"),v==n){for(a=t,p=x;h=l>=p?C:p>=l+y?y:p-l,!(h>a);p+=x)m=a-h,j=x-h,E.push(R(f(h+m%j,0))),a=P(m/j);E.push(R(f(a,0))),l=c(t,w,u==i),t=0,++u}++t,++n}return E.join("")}function s(o){return t(o,function(o){return E.test(o)?l(o.slice(4).toLowerCase()):o})}function a(o){return t(o,function(o){return O.test(o)?"xn--"+d(o):o})}var p="object"==typeof exports&&exports,h="object"==typeof module&&module&&module.exports==p&&module,v="object"==typeof global&&global;(v.global===v||v.window===v)&&(o=v);var g,w,b=2147483647,x=36,C=1,y=26,j=38,m=700,A=72,I=128,F="-",E=/^xn--/,O=/[^ -~]/,S=/\x2E|\u3002|\uFF0E|\uFF61/g,L={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},M=x-C,P=Math.floor,R=String.fromCharCode;if(g={version:"1.2.3",ucs2:{decode:r,encode:u},decode:l,encode:d,toASCII:a,toUnicode:s},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return g});else if(p&&!p.nodeType)if(h)h.exports=g;else for(w in g)g.hasOwnProperty(w)&&(p[w]=g[w]);else o.punycode=g})(this); \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/LICENSE.txt b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/LICENSE.txt
deleted file mode 100644
index a7501f98d..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/LICENSE.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/README.md
deleted file mode 100644
index fbddce918..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/README.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Docdown <sup>v1.0.0</sup>
-
-A simple JSDoc to Markdown documentation generator.
-
-## Documentation
-
-The documentation for Docdown can be viewed here: [/doc/README.md](https://github.com/jdalton/docdown/blob/master/doc/README.md#readme)
-
-For a list of upcoming features, check out our [roadmap](https://github.com/jdalton/docdown/wiki/Roadmap).
-
-## Installation and usage
-
-Usage example:
-
-```php
-require("docdown.php");
-
-// generate Markdown
-$markdown = docdown(array(
- "path" => $filepath,
- "url" => "https://github.com/username/project/blob/master/my.js"
-));
-```
-
-## Author
-
-| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
-|---|
-| [John-David Dalton](http://allyoucanleet.com/) |
-
-## Contributors
-
-| [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") |
-|---|
-| [Mathias Bynens](http://mathiasbynens.be/) |
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/README.md
deleted file mode 100644
index 459d36abd..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Docdown <sup>v1.0.0</sup>
-
-<!-- div -->
-
-
-<!-- div -->
-
-## <a id="docdown"></a>`docdown`
-* [`docdown`](#docdown$optionsarray)
-
-<!-- /div -->
-
-
-<!-- /div -->
-
-
-<!-- div -->
-
-
-<!-- div -->
-
-## `docdown`
-
-<!-- div -->
-
-### <a id="docdown$optionsarray"></a>`docdown([$options=array()])`
-<a href="#docdown$optionsarray">#</a> [&#x24C8;](https://github.com/jdalton/docdown/blob/master/docdown.php#L34 "View in source") [&#x24C9;][1]
-
-Generates Markdown from JSDoc entries in a given file.
-
-#### Arguments
-1. `[$options=array()]` *(Array)*: The options array.
-
-#### Returns
-*(String)*: The generated Markdown.
-
-#### Example
-```php
-// specify a file path
-$markdown = docdown(array(
- // path to js file
- 'path' => $filepath,
- // url used to reference line numbers in code
- 'url' => 'https://github.com/username/project/blob/master/my.js'
-));
-
-// or pass raw js
-$markdown = docdown(array(
- // raw JavaScript source
- 'source' => $rawJS,
- // documentation title
- 'title' => 'My API Documentation',
- // url used to reference line numbers in code
- 'url' => 'https://github.com/username/project/blob/master/my.js'
-));
-```
-
-* * *
-
-<!-- /div -->
-
-
-<!-- /div -->
-
-
-<!-- /div -->
-
-
- [1]: #docdown "Jump back to the TOC." \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/parse.php b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/parse.php
deleted file mode 100644
index eca8d145e..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/doc/parse.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
- // cleanup requested filepath
- $file = isset($_GET['f']) ? $_GET['f'] : 'docdown';
- $file = preg_replace('#(\.*[\/])+#', '', $file);
- $file .= preg_match('/\.[a-z]+$/', $file) ? '' : '.php';
-
- // output filename
- if (isset($_GET['o'])) {
- $output = $_GET['o'];
- } else if (isset($_SERVER['argv'][1])) {
- $output = $_SERVER['argv'][1];
- } else {
- $output = basename($file);
- }
-
- /*--------------------------------------------------------------------------*/
-
- require('../docdown.php');
-
- // generate Markdown
- $markdown = docdown(array(
- 'path' => '../' . $file,
- 'title' => 'Docdown <sup>v1.0.0</sup>',
- 'url' => 'https://github.com/jdalton/docdown/blob/master/docdown.php'
- ));
-
- // save to a .md file
- file_put_contents($output . '.md', $markdown);
-
- // print
- header('Content-Type: text/plain;charset=utf-8');
- echo $markdown . PHP_EOL;
-
-?> \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/docdown.php b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/docdown.php
deleted file mode 100644
index 4a786d753..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/docdown.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/*!
- * Docdown v1.0.0-pre
- * Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
- * Available under MIT license <http://mths.be/mit>
- */
-require(dirname(__FILE__) . '/src/DocDown/Generator.php');
-
-/**
- * Generates Markdown from JSDoc entries in a given file.
- *
- * @param {Array} [$options=array()] The options array.
- * @returns {String} The generated Markdown.
- * @example
- *
- * // specify a file path
- * $markdown = docdown(array(
- * // path to js file
- * 'path' => $filepath,
- * // url used to reference line numbers in code
- * 'url' => 'https://github.com/username/project/blob/master/my.js'
- * ));
- *
- * // or pass raw js
- * $markdown = docdown(array(
- * // raw JavaScript source
- * 'source' => $rawJS,
- * // documentation title
- * 'title' => 'My API Documentation',
- * // url used to reference line numbers in code
- * 'url' => 'https://github.com/username/project/blob/master/my.js'
- * ));
- */
-function docdown( $options = array() ) {
- $gen = new Generator($options);
- return $gen->generate();
-}
-?> \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Alias.php b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Alias.php
deleted file mode 100644
index 0a7c552e0..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Alias.php
+++ /dev/null
@@ -1,226 +0,0 @@
-<?php
-
-/**
- * A class to represent a JSDoc entry alias.
- */
-class Alias {
-
- /**
- * The alias owner.
- *
- * @memberOf Alias
- * @type Object
- */
- public $owner;
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * The Alias constructor.
- *
- * @constructor
- * @param {String} $name The alias name.
- * @param {Object} $owner The alias owner.
- */
- public function __construct( $name, $owner ) {
- $this->owner = $owner;
- $this->_name = $name;
- $this->_call = $owner->getCall();
- $this->_category = $owner->getCategory();
- $this->_desc = $owner->getDesc();
- $this->_example = $owner->getExample();
- $this->_isCtor = $owner->isCtor();
- $this->_isLicense = $owner->isLicense();
- $this->_isPlugin = $owner->isPlugin();
- $this->_isPrivate = $owner->isPrivate();
- $this->_isStatic = $owner->isStatic();
- $this->_lineNumber = $owner->getLineNumber();
- $this->_members = $owner->getMembers();
- $this->_params = $owner->getParams();
- $this->_returns = $owner->getReturns();
- $this->_type = $owner->getType();
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Extracts the entry's `alias` objects.
- *
- * @memberOf Alias
- * @param {Number} $index The index of the array value to return.
- * @returns {Array|String} The entry's `alias` objects.
- */
- public function getAliases( $index = null ) {
- $result = array();
- return $index !== null
- ? @$result[$index]
- : $result;
- }
-
- /**
- * Extracts the function call from the owner entry.
- *
- * @memberOf Alias
- * @returns {String} The function call.
- */
- public function getCall() {
- return $this->_call;
- }
-
- /**
- * Extracts the owner entry's `category` data.
- *
- * @memberOf Alias
- * @returns {String} The owner entry's `category` data.
- */
- public function getCategory() {
- return $this->_category;
- }
-
- /**
- * Extracts the owner entry's description.
- *
- * @memberOf Alias
- * @returns {String} The owner entry's description.
- */
- public function getDesc() {
- return $this->_desc;
- }
-
- /**
- * Extracts the owner entry's `example` data.
- *
- * @memberOf Alias
- * @returns {String} The owner entry's `example` data.
- */
- public function getExample() {
- return $this->_example;
- }
-
- /**
- * Checks if the entry is an alias.
- *
- * @memberOf Alias
- * @returns {Boolean} Returns `true`.
- */
- public function isAlias() {
- return true;
- }
-
- /**
- * Checks if the owner entry is a constructor.
- *
- * @memberOf Alias
- * @returns {Boolean} Returns `true` if a constructor, else `false`.
- */
- public function isCtor() {
- return $this->_isCtor;
- }
-
- /**
- * Checks if the owner entry is a license.
- *
- * @memberOf Alias
- * @returns {Boolean} Returns `true` if a license, else `false`.
- */
- public function isLicense() {
- return $this->_isLicense;
- }
-
- /**
- * Checks if the owner entry *is* assigned to a prototype.
- *
- * @memberOf Alias
- * @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
- */
- public function isPlugin() {
- return $this->_isPlugin;
- }
-
- /**
- * Checks if the owner entry is private.
- *
- * @memberOf Alias
- * @returns {Boolean} Returns `true` if private, else `false`.
- */
- public function isPrivate() {
- return $this->_isPrivate;
- }
-
- /**
- * Checks if the owner entry is *not* assigned to a prototype.
- *
- * @memberOf Alias
- * @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
- */
- public function isStatic() {
- return $this->_isStatic;
- }
-
- /**
- * Resolves the owner entry's line number.
- *
- * @memberOf Alias
- * @returns {Number} The owner entry's line number.
- */
- public function getLineNumber() {
- return $this->_lineNumber;
- }
-
- /**
- * Extracts the owner entry's `member` data.
- *
- * @memberOf Alias
- * @param {Number} $index The index of the array value to return.
- * @returns {Array|String} The owner entry's `member` data.
- */
- public function getMembers( $index = null ) {
- return $index !== null
- ? @$this->_members[$index]
- : $this->_members;
- }
-
- /**
- * Extracts the owner entry's `name` data.
- *
- * @memberOf Alias
- * @returns {String} The owner entry's `name` data.
- */
- public function getName() {
- return $this->_name;
- }
-
- /**
- * Extracts the owner entry's `param` data.
- *
- * @memberOf Alias
- * @param {Number} $index The index of the array value to return.
- * @returns {Array} The owner entry's `param` data.
- */
- public function getParams( $index = null ) {
- return $index !== null
- ? @$this->_params[$index]
- : $this->_params;
- }
-
- /**
- * Extracts the owner entry's `returns` data.
- *
- * @memberOf Alias
- * @returns {String} The owner entry's `returns` data.
- */
- public function getReturns() {
- return $this->_returns;
- }
-
- /**
- * Extracts the owner entry's `type` data.
- *
- * @memberOf Alias
- * @returns {String} The owner entry's `type` data.
- */
- public function getType() {
- return $this->_type;
- }
-}
-?> \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Entry.php b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Entry.php
deleted file mode 100644
index a973d9a67..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Entry.php
+++ /dev/null
@@ -1,442 +0,0 @@
-<?php
-
-require(dirname(__FILE__) . "/Alias.php");
-
-/**
- * A class to simplify parsing a single JSDoc entry.
- */
-class Entry {
-
- /**
- * The documentation entry.
- *
- * @memberOf Entry
- * @type String
- */
- public $entry = '';
-
- /**
- * The language highlighter used for code examples.
- *
- * @memberOf Entry
- * @type String
- */
- public $lang = '';
-
- /**
- * The source code.
- *
- * @memberOf Entry
- * @type String
- */
- public $source = '';
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * The Entry constructor.
- *
- * @constructor
- * @param {String} $entry The documentation entry to analyse.
- * @param {String} $source The source code.
- * @param {String} [$lang ='js'] The language highlighter used for code examples.
- */
- public function __construct( $entry, $source, $lang = 'js' ) {
- $this->entry = $entry;
- $this->lang = $lang;
- $this->source = str_replace(PHP_EOL, "\n", $source);
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Extracts the documentation entries from source code.
- *
- * @static
- * @memberOf Entry
- * @param {String} $source The source code.
- * @returns {Array} The array of entries.
- */
- public static function getEntries( $source ) {
- preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
- return array_pop($result);
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Checks if the entry is a function reference.
- *
- * @private
- * @memberOf Entry
- * @returns {Boolean} Returns `true` if the entry is a function reference, else `false`.
- */
- private function isFunction() {
- if (!isset($this->_isFunction)) {
- $this->_isFunction = !!(
- $this->isCtor() ||
- count($this->getParams()) ||
- count($this->getReturns()) ||
- preg_match('/\*[\t ]*@function\b/', $this->entry)
- );
- }
- return $this->_isFunction;
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Extracts the entry's `alias` objects.
- *
- * @memberOf Entry
- * @param {Number} $index The index of the array value to return.
- * @returns {Array|String} The entry's `alias` objects.
- */
- public function getAliases( $index = null ) {
- if (!isset($this->_aliases)) {
- preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
-
- if (count($result)) {
- $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
- $result = preg_split('/,\s*/', $result);
- natsort($result);
-
- foreach ($result as $resultIndex => $value) {
- $result[$resultIndex] = new Alias($value, $this);
- }
- }
- $this->_aliases = $result;
- }
- return $index !== null
- ? @$this->_aliases[$index]
- : $this->_aliases;
- }
-
- /**
- * Extracts the function call from the entry.
- *
- * @memberOf Entry
- * @returns {String} The function call.
- */
- public function getCall() {
- if (isset($this->_call)) {
- return $this->_call;
- }
-
- preg_match('#\*/\s*(?:function ([^(]*)|(.*?)(?=[:=,]|return\b))#', $this->entry, $result);
- if ($result = array_pop($result)) {
- $result = array_pop(explode('var ', trim(trim(array_pop(explode('.', $result))), "'")));
- }
- // resolve name
- // avoid $this->getName() because it calls $this->getCall()
- preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
- if (count($name)) {
- $name = trim($name[1]);
- } else {
- $name = $result;
- }
- // compile function call syntax
- if ($this->isFunction()) {
- // compose parts
- $result = array($result);
- $params = $this->getParams();
- foreach ($params as $param) {
- $result[] = $param[1];
- }
- // format
- $result = $name .'('. implode(array_slice($result, 1), ', ') .')';
- $result = str_replace(', [', ' [, ', str_replace('], [', ', ', $result));
- }
-
- $this->_call = $result ? $result : $name;
- return $this->_call;
- }
-
- /**
- * Extracts the entry's `category` data.
- *
- * @memberOf Entry
- * @returns {String} The entry's `category` data.
- */
- public function getCategory() {
- if (isset($this->_category)) {
- return $this->_category;
- }
-
- preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
- if (count($result)) {
- $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
- } else {
- $result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
- }
- $this->_category = $result;
- return $result;
- }
-
- /**
- * Extracts the entry's description.
- *
- * @memberOf Entry
- * @returns {String} The entry's description.
- */
- public function getDesc() {
- if (isset($this->_desc)) {
- return $this->_desc;
- }
-
- preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
- if (count($result)) {
- $type = $this->getType();
- $result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
- $result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
- $result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
- $result = trim($result);
- $result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
- }
- $this->_desc = $result;
- return $result;
- }
-
- /**
- * Extracts the entry's `example` data.
- *
- * @memberOf Entry
- * @returns {String} The entry's `example` data.
- */
- public function getExample() {
- if (isset($this->_example)) {
- return $this->_example;
- }
-
- preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
- if (count($result)) {
- $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
- $result = '```' . $this->lang . "\n" . $result . "\n```";
- }
- $this->_example = $result;
- return $result;
- }
-
- /**
- * Checks if the entry is an alias.
- *
- * @memberOf Entry
- * @returns {Boolean} Returns `false`.
- */
- public function isAlias() {
- return false;
- }
-
- /**
- * Checks if the entry is a constructor.
- *
- * @memberOf Entry
- * @returns {Boolean} Returns `true` if a constructor, else `false`.
- */
- public function isCtor() {
- if (!isset($this->_isCtor)) {
- $this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
- }
- return $this->_isCtor;
- }
-
- /**
- * Checks if the entry is a license.
- *
- * @memberOf Entry
- * @returns {Boolean} Returns `true` if a license, else `false`.
- */
- public function isLicense() {
- if (!isset($this->_isLicense)) {
- $this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
- }
- return $this->_isLicense;
- }
-
- /**
- * Checks if the entry *is* assigned to a prototype.
- *
- * @memberOf Entry
- * @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
- */
- public function isPlugin() {
- if (!isset($this->_isPlugin)) {
- $this->_isPlugin = !$this->isCtor() && !$this->isPrivate() && !$this->isStatic();
- }
- return $this->_isPlugin;
- }
-
- /**
- * Checks if the entry is private.
- *
- * @memberOf Entry
- * @returns {Boolean} Returns `true` if private, else `false`.
- */
- public function isPrivate() {
- if (!isset($this->_isPrivate)) {
- $this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
- }
- return $this->_isPrivate;
- }
-
- /**
- * Checks if the entry is *not* assigned to a prototype.
- *
- * @memberOf Entry
- * @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
- */
- public function isStatic() {
- if (isset($this->_isStatic)) {
- return $this->_isStatic;
- }
-
- $public = !$this->isPrivate();
- $result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
-
- // set in cases where it isn't explicitly stated
- if ($public && !$result) {
- if ($parent = array_pop(preg_split('/[#.]/', $this->getMembers(0)))) {
- foreach (Entry::getEntries($this->source) as $entry) {
- $entry = new Entry($entry, $this->source);
- if ($entry->getName() == $parent) {
- $result = !$entry->isCtor();
- break;
- }
- }
- } else {
- $result = true;
- }
- }
- $this->_isStatic = $result;
- return $result;
- }
-
- /**
- * Resolves the entry's line number.
- *
- * @memberOf Entry
- * @returns {Number} The entry's line number.
- */
- public function getLineNumber() {
- if (!isset($this->_lineNumber)) {
- preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines);
- $this->_lineNumber = count(array_pop($lines)) + 1;
- }
- return $this->_lineNumber;
- }
-
- /**
- * Extracts the entry's `member` data.
- *
- * @memberOf Entry
- * @param {Number} $index The index of the array value to return.
- * @returns {Array|String} The entry's `member` data.
- */
- public function getMembers( $index = null ) {
- if (!isset($this->_members)) {
- preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
- if (count($result)) {
- $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
- $result = preg_split('/,\s*/', $result);
- natsort($result);
- }
- $this->_members = $result;
- }
- return $index !== null
- ? @$this->_members[$index]
- : $this->_members;
- }
-
- /**
- * Extracts the entry's `name` data.
- *
- * @memberOf Entry
- * @returns {String} The entry's `name` data.
- */
- public function getName() {
- if (isset($this->_name)) {
- return $this->_name;
- }
-
- preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
- if (count($result)) {
- $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
- } else {
- $result = array_shift(explode('(', $this->getCall()));
- }
- $this->_name = $result;
- return $result;
- }
-
- /**
- * Extracts the entry's `param` data.
- *
- * @memberOf Entry
- * @param {Number} $index The index of the array value to return.
- * @returns {Array} The entry's `param` data.
- */
- public function getParams( $index = null ) {
- if (!isset($this->_params)) {
- preg_match_all('#\*[\t ]*@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
- if (count($result = array_filter(array_slice($result, 1)))) {
- // repurpose array
- foreach ($result as $param) {
- foreach ($param as $key => $value) {
- if (!is_array($result[0][$key])) {
- $result[0][$key] = array();
- }
- $result[0][$key][] = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value));
- }
- }
- $result = $result[0];
- }
- $this->_params = $result;
- }
- return $index !== null
- ? @$this->_params[$index]
- : $this->_params;
- }
-
- /**
- * Extracts the entry's `returns` data.
- *
- * @memberOf Entry
- * @returns {String} The entry's `returns` data.
- */
- public function getReturns() {
- if (isset($this->_returns)) {
- return $this->_returns;
- }
-
- preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
- if (count($result)) {
- $result = array_map('trim', array_slice($result, 1));
- $result[0] = str_replace('|', ', ', $result[0]);
- $result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
- }
- $this->_returns = $result;
- return $result;
- }
-
- /**
- * Extracts the entry's `type` data.
- *
- * @memberOf Entry
- * @returns {String} The entry's `type` data.
- */
- public function getType() {
- if (isset($this->_type)) {
- return $this->_type;
- }
-
- preg_match('#\*[\t ]*@type\s+(.+)#', $this->entry, $result);
- if (count($result)) {
- $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
- } else {
- $result = $this->isFunction() ? 'Function' : 'Unknown';
- }
- $this->_type = $result;
- return $result;
- }
-}
-?> \ No newline at end of file
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Generator.php b/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Generator.php
deleted file mode 100644
index 5dc2583f8..000000000
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/node_modules/punycode/vendor/docdown/src/DocDown/Generator.php
+++ /dev/null
@@ -1,563 +0,0 @@
-<?php
-
-require(dirname(__FILE__) . "/Entry.php");
-
-/**
- * Generates Markdown from JSDoc entries.
- */
-class Generator {
-
- /**
- * The HTML for the close tag.
- *
- * @static
- * @memberOf Generator
- * @type String
- */
- public $closeTag = "\n<!-- /div -->\n";
-
- /**
- * An array of JSDoc entries.
- *
- * @memberOf Generator
- * @type Array
- */
- public $entries = array();
-
- /**
- * The HTML for the open tag.
- *
- * @static
- * @memberOf Generator
- * @type String
- */
- public $openTag = "\n<!-- div -->\n";
-
- /**
- * An options array used to configure the generator.
- *
- * @memberOf Generator
- * @type Array
- */
- public $options = array();
-
- /**
- * The file's source code.
- *
- * @memberOf Generator
- * @type String
- */
- public $source = '';
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * The Generator constructor.
- *
- * @constructor
- * @param {String} $source The source code to parse.
- * @param {Array} $options The options array.
- */
- public function __construct( $source, $options = array() ) {
- // juggle arguments
- if (is_array($source)) {
- $options = $source;
- } else {
- $options['source'] = $source;
- }
- if (isset($options['source']) && realpath($options['source'])) {
- $options['path'] = $options['source'];
- }
- if (isset($options['path'])) {
- preg_match('/(?<=\.)[a-z]+$/', $options['path'], $ext);
- $options['source'] = file_get_contents($options['path']);
- $ext = array_pop($ext);
-
- if (!isset($options['lang']) && $ext) {
- $options['lang'] = $ext;
- }
- if (!isset($options['title'])) {
- $options['title'] = ucfirst(basename($options['path'])) . ' API documentation';
- }
- }
- if (!isset($options['lang'])) {
- $options['lang'] = 'js';
- }
- if (!isset($options['toc'])) {
- $options['toc'] = 'properties';
- }
-
- $this->options = $options;
- $this->source = str_replace(PHP_EOL, "\n", $options['source']);
- $this->entries = Entry::getEntries($this->source);
-
- foreach ($this->entries as $index => $value) {
- $this->entries[$index] = new Entry($value, $this->source, $options['lang']);
- }
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Performs common string formatting operations.
- *
- * @private
- * @static
- * @memberOf Generator
- * @param {String} $string The string to format.
- * @returns {String} The formatted string.
- */
- private static function format( $string ) {
- $counter = 0;
-
- // tokenize inline code snippets
- preg_match_all('/`[^`]+`/', $string, $tokenized);
- $tokenized = $tokenized[0];
- foreach ($tokenized as $snippet) {
- $string = str_replace($snippet, '__token' . ($counter++) .'__', $string);
- }
-
- // italicize parentheses
- $string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
-
- // mark numbers as inline code
- $string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
-
- // detokenize inline code snippets
- $counter = 0;
- foreach ($tokenized as $snippet) {
- $string = str_replace('__token' . ($counter++) . '__', $snippet, $string);
- }
-
- return trim($string);
- }
-
- /**
- * Modify a string by replacing named tokens with matching assoc. array values.
- *
- * @private
- * @static
- * @memberOf Generator
- * @param {String} $string The string to modify.
- * @param {Array|Object} $object The template object.
- * @returns {String} The modified string.
- */
- private static function interpolate( $string, $object ) {
- preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
- $tokens = array_unique(array_pop($tokens));
-
- foreach ($tokens as $token) {
- $pattern = '/#\{' . $token . '\}/';
- $replacement = '';
-
- if (is_object($object)) {
- preg_match('/\(([^)]+?)\)$/', $token, $args);
- $args = preg_split('/,\s*/', array_pop($args));
- $method = 'get' . ucfirst(str_replace('/\([^)]+?\)$/', '', $token));
-
- if (method_exists($object, $method)) {
- $replacement = (string) call_user_func_array(array($object, $method), $args);
- } else if (isset($object->{$token})) {
- $replacement = (string) $object->{$token};
- }
- } else if (isset($object[$token])) {
- $replacement = (string) $object[$token];
- }
- $string = preg_replace($pattern, trim($replacement), $string);
- }
- return Generator::format($string);
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Adds the given `$entries` to the `$result` array.
- *
- * @private
- * @memberOf Generator
- * @param {Array} $result The result array to modify.
- * @param {Array} $entries The entries to add to the `$result`.
- */
- private function addEntries( &$result, $entries ) {
- foreach ($entries as $entry) {
- // skip aliases
- if ($entry->isAlias()) {
- continue;
- }
- // name and description
- array_push(
- $result,
- $this->openTag,
- Generator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [&#x24C8;](#{href} \"View in source\") [&#x24C9;][1]\n\n#{desc}", $entry)
- );
-
- // @alias
- if (count($aliases = $entry->getAliases())) {
- array_push($result, '', '#### Aliases');
- foreach ($aliases as $index => $alias) {
- $aliases[$index] = $alias->getName();
- }
- $result[] = '*' . implode(', ', $aliases) . '*';
- }
- // @param
- if (count($params = $entry->getParams())) {
- array_push($result, '', '#### Arguments');
- foreach ($params as $index => $param) {
- $result[] = Generator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
- 'desc' => $param[2],
- 'name' => $param[1],
- 'num' => $index + 1,
- 'type' => $param[0]
- ));
- }
- }
- // @returns
- if (count($returns = $entry->getReturns())) {
- array_push(
- $result, '',
- '#### Returns',
- Generator::interpolate('(#{type}): #{desc}', array('desc' => $returns[1], 'type' => $returns[0]))
- );
- }
- // @example
- if ($example = $entry->getExample()) {
- array_push($result, '', '#### Example', $example);
- }
- array_push($result, "\n* * *", $this->closeTag);
- }
- }
-
- /**
- * Resolves the entry's hash used to navigate the documentation.
- *
- * @private
- * @memberOf Generator
- * @param {Number|Object} $entry The entry object.
- * @param {String} $member The name of the member.
- * @returns {String} The url hash.
- */
- private function getHash( $entry, $member = '' ) {
- $entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
- $member = !$member ? $entry->getMembers(0) : $member;
- $result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
- $result = preg_replace('/\(\[|\[\]/', '', $result);
- $result = preg_replace('/[ =|\'"{}.()\]]/', '', $result);
- $result = preg_replace('/[[#,]/', '-', $result);
- return strtolower($result);
- }
-
- /**
- * Resolves the entry's url for the specific line number.
- *
- * @private
- * @memberOf Generator
- * @param {Number|Object} $entry The entry object.
- * @returns {String} The url.
- */
- private function getLineUrl( $entry ) {
- $entry = is_numeric($entry) ? $this->entries($entry) : $entry;
- return $this->options['url'] . '#L' . $entry->getLineNumber();
- }
-
- /**
- * Extracts the character used to separate the entry's name from its member.
- *
- * @private
- * @memberOf Generator
- * @param {Number|Object} $entry The entry object.
- * @returns {String} The separator.
- */
- private function getSeparator( $entry ) {
- $entry = is_numeric($entry) ? $this->entries($entry) : $entry;
- return $entry->isPlugin() ? '.prototype.' : '.';
- }
-
- /*--------------------------------------------------------------------------*/
-
- /**
- * Generates Markdown from JSDoc entries.
- *
- * @memberOf Generator
- * @returns {String} The rendered Markdown.
- */
- public function generate() {
- $api = array();
- $byCategory = $this->options['toc'] == 'categories';
- $categories = array();
- $closeTag = $this->closeTag;
- $compiling = false;
- $openTag = $this->openTag;
- $result = array('# ' . $this->options['title']);
- $toc = 'toc';
-
- // initialize $api array
- foreach ($this->entries as $entry) {
- // skip invalid or private entries
- $name = $entry->getName();
- if (!$name || $entry->isPrivate()) {
- continue;
- }
-
- $members = $entry->getMembers();
- $members = count($members) ? $members : array('');
-
- foreach ($members as $member) {
- // create api category arrays
- if ($member && !isset($api[$member])) {
- // create temporary entry to be replaced later
- $api[$member] = new stdClass;
- $api[$member]->static = array();
- $api[$member]->plugin = array();
- }
-
- // append entry to api member
- if (!$member || $entry->isCtor() || ($entry->getType() == 'Object' &&
- !preg_match('/[=:]\s*(?:null|undefined)\s*[,;]?$/', $entry->entry))) {
-
- // assign the real entry, replacing the temporary entry if it exist
- $member = ($member ? $member . ($entry->isPlugin() ? '#' : '.') : '') . $name;
- $entry->static = @$api[$member] ? $api[$member]->static : array();
- $entry->plugin = @$api[$member] ? $api[$member]->plugin : array();
-
- $api[$member] = $entry;
- foreach ($entry->getAliases() as $alias) {
- $api[$member]->static[] = $alias;
- }
- }
- else if ($entry->isStatic()) {
- $api[$member]->static[] = $entry;
- foreach ($entry->getAliases() as $alias) {
- $api[$member]->static[] = $alias;
- }
- }
- else if (!$entry->isCtor()) {
- $api[$member]->plugin[] = $entry;
- foreach ($entry->getAliases() as $alias) {
- $api[$member]->plugin[] = $alias;
- }
- }
- }
- }
-
- // add properties to each entry
- foreach ($api as $entry) {
- $entry->hash = $this->getHash($entry);
- $entry->href = $this->getLineUrl($entry);
-
- $member = $entry->getMembers(0);
- $member = ($member ? $member . ($entry->isPlugin() ? '.prototype.' : '.') : '') . $entry->getName();
- $entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
-
- // add properties to static and plugin sub-entries
- foreach (array('static', 'plugin') as $kind) {
- foreach ($entry->{$kind} as $subentry) {
- $subentry->hash = $this->getHash($subentry);
- $subentry->href = $this->getLineUrl($subentry);
- $subentry->member = $member;
- $subentry->separator = $this->getSeparator($subentry);
- }
- }
- }
-
- /*------------------------------------------------------------------------*/
-
- // custom sort for root level entries
- // TODO: see how well it handles deeper namespace traversal
- function sortCompare($a, $b) {
- $score = array( 'a' => 0, 'b' => 0);
- foreach (array( 'a' => $a, 'b' => $b) as $key => $value) {
- // capitalized properties are last
- if (preg_match('/[#.][A-Z]/', $value)) {
- $score[$key] = 0;
- }
- // lowercase prototype properties are next to last
- else if (preg_match('/#[a-z]/', $value)) {
- $score[$key] = 1;
- }
- // lowercase static properties next to first
- else if (preg_match('/\.[a-z]/', $value)) {
- $score[$key] = 2;
- }
- // root properties are first
- else if (preg_match('/^[^#.]+$/', $value)) {
- $score[$key] = 3;
- }
- }
- $score = $score['b'] - $score['a'];
- return $score ? $score : strcasecmp($a, $b);
- }
-
- uksort($api, 'sortCompare');
-
- // sort static and plugin sub-entries
- foreach ($api as $entry) {
- foreach (array('static', 'plugin') as $kind) {
- $sortBy = array( 'a' => array(), 'b' => array(), 'c' => array() );
- foreach ($entry->{$kind} as $subentry) {
- $name = $subentry->getName();
- // functions w/o ALL-CAPs names are last
- $sortBy['a'][] = $subentry->getType() == 'Function' && !preg_match('/^[A-Z_]+$/', $name);
- // ALL-CAPs properties first
- $sortBy['b'][] = preg_match('/^[A-Z_]+$/', $name);
- // lowercase alphanumeric sort
- $sortBy['c'][] = strtolower($name);
- }
- array_multisort($sortBy['a'], SORT_ASC, $sortBy['b'], SORT_DESC, $sortBy['c'], SORT_ASC, $entry->{$kind});
- }
- }
-
- /*------------------------------------------------------------------------*/
-
- // add categories
- foreach ($api as $entry) {
- $categories[$entry->getCategory()][] = $entry;
- foreach (array('static', 'plugin') as $kind) {
- foreach ($entry->{$kind} as $subentry) {
- $categories[$subentry->getCategory()][] = $subentry;
- }
- }
- }
-
- // sort categories
- ksort($categories);
-
- foreach(array('Methods', 'Properties') as $category) {
- if (isset($categories[$category])) {
- $entries = $categories[$category];
- unset($categories[$category]);
- $categories[$category] = $entries;
- }
- }
-
- /*------------------------------------------------------------------------*/
-
- // compile TOC
- $result[] = $openTag;
-
- // compile TOC by categories
- if ($byCategory) {
- foreach ($categories as $category => $entries) {
- if ($compiling) {
- $result[] = $closeTag;
- } else {
- $compiling = true;
- }
- // assign TOC hash
- if (count($result) == 2) {
- $toc = $category;
- }
- // add category
- array_push(
- $result,
- $openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $category . '`'
- );
- // add entries
- foreach ($entries as $entry) {
- $result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
- }
- }
- }
- // compile TOC by namespace
- else {
- foreach ($api as $entry) {
- if ($compiling) {
- $result[] = $closeTag;
- } else {
- $compiling = true;
- }
- $member = $entry->member . $entry->getName();
-
- // assign TOC hash
- if (count($result) == 2) {
- $toc = $member;
- }
- // add root entry
- array_push(
- $result,
- $openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
- Generator::interpolate('* [`' . $member . '`](##{hash})', $entry)
- );
-
- // add static and plugin sub-entries
- foreach (array('static', 'plugin') as $kind) {
- if ($kind == 'plugin' && count($entry->plugin)) {
- array_push(
- $result,
- $closeTag,
- $openTag,
- '## `' . $member . ($entry->isCtor() ? '.prototype`' : '`')
- );
- }
- foreach ($entry->{$kind} as $subentry) {
- $subentry->member = $member;
- $result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
- }
- }
- }
- }
-
- array_push($result, $closeTag, $closeTag);
-
- /*------------------------------------------------------------------------*/
-
- // compile content
- $compiling = false;
- $result[] = $openTag;
-
- if ($byCategory) {
- foreach ($categories as $category => $entries) {
- if ($compiling) {
- $result[] = $closeTag;
- } else {
- $compiling = true;
- }
- if ($category != 'Methods' && $category != 'Properties') {
- $category = '“' . $category . '” Methods';
- }
- array_push($result, $openTag, '## `' . $category . '`');
- $this->addEntries($result, $entries);
- }
- }
- else {
- foreach ($api as $entry) {
- // skip aliases
- if ($entry->isAlias()) {
- continue;
- }
- if ($compiling) {
- $result[] = $closeTag;
- } else {
- $compiling = true;
- }
- // add root entry name
- $member = $entry->member . $entry->getName();
- array_push($result, $openTag, '## `' . $member . '`');
-
- foreach (array($entry, 'static', 'plugin') as $kind) {
- $subentries = is_string($kind) ? $entry->{$kind} : array($kind);
-
- // add sub-entry name
- if ($kind != 'static' && $entry->getType() != 'Object' &&
- count($subentries) && $subentries[0] != $kind) {
- if ($kind == 'plugin') {
- $result[] = $closeTag;
- }
- array_push(
- $result,
- $openTag,
- '## `' . $member . ($kind == 'plugin' ? '.prototype`' : '`')
- );
- }
- $this->addEntries($result, $subentries);
- }
- }
- }
-
- // close tags add TOC link reference
- array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
-
- // cleanup whitespace
- return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
- }
-}
-?>
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 e91645aa1..f4ede6689 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json
@@ -1,9 +1,8 @@
{
"author": {
- "name": "Jeremy Stashewsky",
- "email": "jeremy@goinstant.com",
- "url": "https://github.com/stash"
+ "name": "GoInstant Inc., a salesforce.com company"
},
+ "license": "MIT",
"name": "tough-cookie",
"description": "RFC6265 Cookies and Cookie Jar for node.js",
"keywords": [
@@ -16,14 +15,14 @@
"RFC6265",
"RFC2965"
],
- "version": "0.9.15",
- "homepage": "https://github.com/goinstant/node-cookie",
+ "version": "0.12.1",
+ "homepage": "https://github.com/goinstant/tough-cookie",
"repository": {
"type": "git",
- "url": "git://github.com/goinstant/node-cookie.git"
+ "url": "git://github.com/goinstant/tough-cookie.git"
},
"bugs": {
- "url": "https://github.com/goinstant/node-cookie/issues"
+ "url": "https://github.com/goinstant/tough-cookie/issues"
},
"main": "./lib/cookie",
"scripts": {
@@ -36,11 +35,33 @@
"punycode": ">=0.2.0"
},
"devDependencies": {
- "vows": ">=0.6.0",
+ "vows": "0.7.0",
"async": ">=0.1.12"
},
- "readme": "[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js\n\n![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)\n\n# Synopsis\n\n``` javascript\nvar cookies = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'\nvar Cookie = cookies.Cookie;\nvar cookie = Cookie.parse(header);\ncookie.value = 'somethingdifferent';\nheader = cookie.toString();\n\nvar cookiejar = new cookies.CookieJar();\ncookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);\n// ...\ncookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {\n res.headers['cookie'] = cookies.join('; ');\n});\n```\n\n# Installation\n\nIt's _so_ easy!\n\n`npm install tough-cookie`\n\nRequires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default.\n\nWhy the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.\n\n# API\n\ncookies\n=======\n\nFunctions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be \"bound\".\n\nparseDate(string[,strict])\n-----------------\n\nParse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. \"Thu, 01 Jan 1970 00:00:010 GMT\" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid).\n\nformatDate(date)\n----------------\n\nFormat a Date into a RFC1123 string (the RFC6265-recommended format).\n\ncanonicalDomain(str)\n--------------------\n\nTransforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).\n\ndomainMatch(str,domStr[,canonicalize=true])\n-------------------------------------------\n\nAnswers \"does this real domain match the domain in a cookie?\". The `str` is the \"current\" domain-name and the `domStr` is the \"cookie\" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a \"suffix match\".\n\nThe `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.\n\ndefaultPath(path)\n-----------------\n\nGiven a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the \"directory\" of a \"file\" in the path, but is specified by Section 5.1.4 of the RFC.\n\nThe `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.\n\npathMatch(reqPath,cookiePath)\n-----------------------------\n\nAnswers \"does the request-path path-match a given cookie-path?\" as per RFC6265 Section 5.1.4. Returns a boolean.\n\nThis is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.\n\nparse(header[,strict=false])\n----------------------------\n\nalias for `Cookie.parse(header[,strict])`\n\nfromJSON(string)\n----------------\n\nalias for `Cookie.fromJSON(string)`\n\ngetPublicSuffix(hostname)\n-------------------------\n\nReturns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.\n\nFor example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.\n\nFor further information, see http://publicsuffix.org/. This module derives its list from that site.\n\ncookieCompare(a,b)\n------------------\n\nFor use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.\n\n``` javascript\nvar cookies = [ /* unsorted array of Cookie objects */ ];\ncookies = cookies.sort(cookieCompare);\n```\n\npermuteDomain(domain)\n---------------------\n\nGenerates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.\n\n\npermutePath(path)\n-----------------\n\nGenerates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.\n\nCookie\n======\n\nCookie.parse(header[,strict=false])\n-----------------------------------\n\nParses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off.\n\nHere's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:\n\n``` javascript\nif (res.headers['set-cookie'] instanceof Array)\n cookies = res.headers['set-cookie'].map(Cookie.parse);\nelse\n cookies = [Cookie.parse(res.headers['set-cookie'])];\n```\n\nCookie.fromJSON(string)\n-----------------------\n\nConvert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.\n\nProperties\n==========\n\n * _key_ - string - the name or key of the cookie (default \"\")\n * _value_ - string - the value of the cookie (default \"\")\n * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `\"Infinity\"`). See `setExpires()`\n * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `\"Infinity\"` and `\"-Infinity\"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`\n * _domain_ - string - the `Domain=` attribute of the cookie\n * _path_ - string - the `Path=` of the cookie\n * _secure_ - boolean - the `Secure` cookie flag\n * _httpOnly_ - boolean - the `HttpOnly` cookie flag\n * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)\n \nAfter a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:\n\n * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)\n * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.\n * _created_ - `Date` - when this cookie was added to the jar\n * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.\n\nConstruction([{options}])\n------------\n\nReceives an options object that can contain any Cookie properties, uses the default for unspecified properties.\n\n.toString()\n-----------\n\nencode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.\n\n.cookieString()\n---------------\n\nencode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').\n\n.setExpires(String)\n-------------------\n\nsets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `\"Infinity\"` (a string) is set.\n\n.setMaxAge(number)\n-------------------\n\nsets the maxAge in seconds. Coerces `-Infinity` to `\"-Infinity\"` and `Infinity` to `\"Infinity\"` so it JSON serializes correctly.\n\n.expiryTime([now=Date.now()])\n-----------------------------\n\n.expiryDate([now=Date.now()])\n-----------------------------\n\nexpiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.\n\nMax-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.\n\nIf Expires (`.expires`) is set, that's returned.\n\nOtherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for \"Tue, 19 Jan 2038 03:14:07 GMT\" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).\n\n.TTL([now=Date.now()])\n---------\n\ncompute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.\n\nThe \"number\" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.\n\n.canonicalizedDoman()\n---------------------\n\n.cdomain()\n----------\n\nreturn the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.\n\n.validate()\n-----------\n\nStatus: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.\n\nvalidates cookie attributes for semantic correctness. Useful for \"lint\" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:\n\n``` javascript\nif (cookie.validate() === true) {\n // it's tasty\n} else {\n // yuck!\n}\n```\n\nCookieJar\n=========\n\nConstruction([store = new MemoryCookieStore()][, rejectPublicSuffixes])\n------------\n\nSimply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.\n\n\nAttributes\n----------\n\n * _rejectPublicSuffixes_ - boolean - reject cookies with domains like \"com\" and \"co.uk\" (default: `true`)\n \nSince eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.\n\n.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))\n-------------------------------------------------------------------\n\nAttempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _strict_ - boolean - default `false` - perform extra checks\n * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.\n\nAs per the RFC, the `.hostOnly` property is set if there was no \"Domain=\" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).\n\n.storeCookie(cookie, [{options},] cb(err,cookie))\n-------------------------------------------------\n\n__REMOVED__ removed in lieu of the CookieStore API below\n \n.getCookies(currentUrl, [{options},] cb(err,cookies))\n-----------------------------------------------------\n\nRetrieve the list of cookies that can be sent in a Cookie header for the current url.\n\nIf an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).\n * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).\n\nThe `.lastAccessed` property of the returned cookies will have been updated.\n\n.getCookieString(...)\n---------------------\n\nAccepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.\n\n.getSetCookieStrings(...)\n-------------------------\n\nAccepts the same options as `.getCookies()` but passes an array of strings suitable for Set-Cookie headers (rather than an array of `Cookie`s) to the callback. Simply maps the cookie array via `.toString()`.\n\n# CookieStore API\n\nThe storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.\n\nAll `domain` parameters will have been normalized before calling.\n\nThe Cookie store must have all of the following methods.\n\nstore.findCookie(domain, path, key, cb(err,cookie))\n---------------------------------------------------\n\nRetrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.\n\nCallback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).\n\nstore.findCookies(domain, path, cb(err,cookies))\n------------------------------------------------\n\nLocates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.\n\nIf no cookies are found, the callback MUST be passed an empty array.\n\nThe resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.\n\nAs of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).\n\nstore.putCookie(cookie, cb(err))\n--------------------------------\n\nAdds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.\n\nThe `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.\n\nPass an error if the cookie cannot be stored.\n\nstore.updateCookie(oldCookie, newCookie, cb(err))\n-------------------------------------------------\n\nUpdate an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.\n\nThe `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).\n\nStores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.\n\nThe `newCookie` and `oldCookie` objects MUST NOT be modified.\n\nPass an error if the newCookie cannot be stored.\n\nstore.removeCookie(domain, path, key, cb(err))\n----------------------------------------------\n\nRemove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).\n\nThe implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.\n\nstore.removeCookies(domain, path, cb(err))\n------------------------------------------\n\nRemoves matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed.\n\nPass an error ONLY if removing any existing cookies failed.\n\n# TODO\n\n * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()`\n * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891\n * better tests for `validate()`?\n\n# Copyright and License\n\n(tl;dr: MIT with some MPL/1.1)\n\nCopyright GoInstant, Inc. and other contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\nPortions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details.\n",
+ "readme": "[RFC6265](http://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js\n\n![Tough Cookie](http://www.goinstant.com.s3.amazonaws.com/tough-cookie.jpg)\n\n[![Build Status](https://travis-ci.org/goinstant/node-cookie.png?branch=master)](https://travis-ci.org/goinstant/node-cookie)\n\n[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)\n![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)\n\n# Synopsis\n\n``` javascript\nvar tough = require('tough-cookie'); // note: not 'cookie', 'cookies' or 'node-cookie'\nvar Cookie = tough.Cookie;\nvar cookie = Cookie.parse(header);\ncookie.value = 'somethingdifferent';\nheader = cookie.toString();\n\nvar cookiejar = new tough.CookieJar();\ncookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);\n// ...\ncookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {\n res.headers['cookie'] = cookies.join('; ');\n});\n```\n\n# Installation\n\nIt's _so_ easy!\n\n`npm install tough-cookie`\n\nRequires `punycode`, which should get installed automatically for you. Note that node.js v0.6.2+ bundles punycode by default.\n\nWhy the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken.\n\n# API\n\ntough\n=====\n\nFunctions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be \"bound\".\n\nparseDate(string[,strict])\n-----------------\n\nParse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. If strict is set to true then leading/trailing non-seperator characters around the time part will cause the parsing to fail (e.g. \"Thu, 01 Jan 1970 00:00:010 GMT\" has an extra trailing zero but Chrome, an assumedly RFC-compliant browser, treats this as valid).\n\nformatDate(date)\n----------------\n\nFormat a Date into a RFC1123 string (the RFC6265-recommended format).\n\ncanonicalDomain(str)\n--------------------\n\nTransforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects).\n\ndomainMatch(str,domStr[,canonicalize=true])\n-------------------------------------------\n\nAnswers \"does this real domain match the domain in a cookie?\". The `str` is the \"current\" domain-name and the `domStr` is the \"cookie\" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a \"suffix match\".\n\nThe `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.\n\ndefaultPath(path)\n-----------------\n\nGiven a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the \"directory\" of a \"file\" in the path, but is specified by Section 5.1.4 of the RFC.\n\nThe `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output.\n\npathMatch(reqPath,cookiePath)\n-----------------------------\n\nAnswers \"does the request-path path-match a given cookie-path?\" as per RFC6265 Section 5.1.4. Returns a boolean.\n\nThis is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.\n\nparse(header[,strict=false])\n----------------------------\n\nalias for `Cookie.parse(header[,strict])`\n\nfromJSON(string)\n----------------\n\nalias for `Cookie.fromJSON(string)`\n\ngetPublicSuffix(hostname)\n-------------------------\n\nReturns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it.\n\nFor example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.\n\nFor further information, see http://publicsuffix.org/. This module derives its list from that site.\n\ncookieCompare(a,b)\n------------------\n\nFor use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). Longest `.path`s go first, then sorted oldest to youngest.\n\n``` javascript\nvar cookies = [ /* unsorted array of Cookie objects */ ];\ncookies = cookies.sort(cookieCompare);\n```\n\npermuteDomain(domain)\n---------------------\n\nGenerates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores.\n\n\npermutePath(path)\n-----------------\n\nGenerates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores.\n\nCookie\n======\n\nCookie.parse(header[,strict=false])\n-----------------------------------\n\nParses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. If in strict mode, returns `undefined` if the cookie doesn't follow the guidelines in section 4 of RFC6265. Generally speaking, strict mode can be used to validate your own generated Set-Cookie headers, but acting as a client you want to be lenient and leave strict mode off.\n\nHere's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:\n\n``` javascript\nif (res.headers['set-cookie'] instanceof Array)\n cookies = res.headers['set-cookie'].map(function (c) { return (Cookie.parse(c)); });\nelse\n cookies = [Cookie.parse(res.headers['set-cookie'])];\n```\n\nCookie.fromJSON(string)\n-----------------------\n\nConvert a JSON string to a `Cookie` object. Does a `JSON.parse()` and converts the `.created`, `.lastAccessed` and `.expires` properties into `Date` objects.\n\nProperties\n==========\n\n * _key_ - string - the name or key of the cookie (default \"\")\n * _value_ - string - the value of the cookie (default \"\")\n * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `\"Infinity\"`). See `setExpires()`\n * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `\"Infinity\"` and `\"-Infinity\"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()`\n * _domain_ - string - the `Domain=` attribute of the cookie\n * _path_ - string - the `Path=` of the cookie\n * _secure_ - boolean - the `Secure` cookie flag\n * _httpOnly_ - boolean - the `HttpOnly` cookie flag\n * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)\n\nAfter a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:\n\n * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)\n * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.\n * _created_ - `Date` - when this cookie was added to the jar\n * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute.\n\nConstruction([{options}])\n------------\n\nReceives an options object that can contain any Cookie properties, uses the default for unspecified properties.\n\n.toString()\n-----------\n\nencode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.\n\n.cookieString()\n---------------\n\nencode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').\n\n.setExpires(String)\n-------------------\n\nsets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `\"Infinity\"` (a string) is set.\n\n.setMaxAge(number)\n-------------------\n\nsets the maxAge in seconds. Coerces `-Infinity` to `\"-Infinity\"` and `Infinity` to `\"Infinity\"` so it JSON serializes correctly.\n\n.expiryTime([now=Date.now()])\n-----------------------------\n\n.expiryDate([now=Date.now()])\n-----------------------------\n\nexpiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds.\n\nMax-Age takes precedence over Expires (as per the RFC). The `.created` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.\n\nIf Expires (`.expires`) is set, that's returned.\n\nOtherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for \"Tue, 19 Jan 2038 03:14:07 GMT\" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).\n\n.TTL([now=Date.now()])\n---------\n\ncompute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply.\n\nThe \"number\" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned.\n\n.canonicalizedDoman()\n---------------------\n\n.cdomain()\n----------\n\nreturn the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.\n\n.validate()\n-----------\n\nStatus: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.\n\nvalidates cookie attributes for semantic correctness. Useful for \"lint\" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:\n\n``` javascript\nif (cookie.validate() === true) {\n // it's tasty\n} else {\n // yuck!\n}\n```\n\nCookieJar\n=========\n\nConstruction([store = new MemoryCookieStore()][, rejectPublicSuffixes])\n------------\n\nSimply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.\n\n\nAttributes\n----------\n\n * _rejectPublicSuffixes_ - boolean - reject cookies with domains like \"com\" and \"co.uk\" (default: `true`)\n\nSince eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.\n\n.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))\n-------------------------------------------------------------------\n\nAttempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.created`, `.lastAccessed` and `.hostOnly` properties.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _strict_ - boolean - default `false` - perform extra checks\n * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. CookieStore errors aren't ignored by this option.\n\nAs per the RFC, the `.hostOnly` property is set if there was no \"Domain=\" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).\n\n.setCookieSync(cookieOrString, currentUrl, [{options}])\n-------------------------------------------------------\n\nSynchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.storeCookie(cookie, [{options},] cb(err,cookie))\n-------------------------------------------------\n\n__REMOVED__ removed in lieu of the CookieStore API below\n\n.getCookies(currentUrl, [{options},] cb(err,cookies))\n-----------------------------------------------------\n\nRetrieve the list of cookies that can be sent in a Cookie header for the current url.\n\nIf an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.\n\nThe `options` object can be omitted and can have the following properties:\n\n * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies.\n * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).\n * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the CookieStore `fetchCookies` function (the default MemoryCookieStore supports it).\n\nThe `.lastAccessed` property of the returned cookies will have been updated.\n\n.getCookiesSync(currentUrl, [{options}])\n----------------------------------------\n\nSynchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getCookieString(...)\n---------------------\n\nAccepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`.\n\n.getCookieStringSync(...)\n-------------------------\n\nSynchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n.getSetCookieStrings(...)\n-------------------------\n\nReturns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`.\n\n.getSetCookieStringsSync(...)\n-----------------------------\n\nSynchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\nStore\n=====\n\nBase class for CookieJar stores.\n\n# CookieStore API\n\nThe storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores.\n\nStores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. Stores are asynchronous by default, but if `store.synchronous` is set, then the `*Sync` methods on the CookieJar can be used.\n\nAll `domain` parameters will have been normalized before calling.\n\nThe Cookie store must have all of the following methods.\n\nstore.findCookie(domain, path, key, cb(err,cookie))\n---------------------------------------------------\n\nRetrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned.\n\nCallback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error).\n\nstore.findCookies(domain, path, cb(err,cookies))\n------------------------------------------------\n\nLocates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above.\n\nIf no cookies are found, the callback MUST be passed an empty array.\n\nThe resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.\n\nAs of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).\n\nstore.putCookie(cookie, cb(err))\n--------------------------------\n\nAdds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.\n\nThe `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.\n\nPass an error if the cookie cannot be stored.\n\nstore.updateCookie(oldCookie, newCookie, cb(err))\n-------------------------------------------------\n\nUpdate an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.\n\nThe `.lastAccessed` property will always be different between the two objects and `.created` will always be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are sorted (or selected for deletion).\n\nStores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.\n\nThe `newCookie` and `oldCookie` objects MUST NOT be modified.\n\nPass an error if the newCookie cannot be stored.\n\nstore.removeCookie(domain, path, key, cb(err))\n----------------------------------------------\n\nRemove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).\n\nThe implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.\n\nstore.removeCookies(domain, path, cb(err))\n------------------------------------------\n\nRemoves matching cookies from the store. The `path` paramter is optional, and if missing means all paths in a domain should be removed.\n\nPass an error ONLY if removing any existing cookies failed.\n\n# TODO\n\n * _full_ RFC5890/RFC5891 canonicalization for domains in `cdomain()`\n * the optional `punycode` requirement implements RFC3492, but RFC6265 requires RFC5891\n * better tests for `validate()`?\n\n# Copyright and License\n\n(tl;dr: MIT with some MPL/1.1)\n\nCopyright 2012- GoInstant, Inc. and other contributors. All rights reserved.\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to\ndeal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or\nsell copies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\nPortions may be licensed under different licenses (in particular public-suffix.txt is MPL/1.1); please read the LICENSE file for full details.\n",
"readmeFilename": "README.md",
- "_id": "tough-cookie@0.9.15",
- "_from": "tough-cookie@~0.9.15"
+ "_id": "tough-cookie@0.12.1",
+ "dist": {
+ "shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62",
+ "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz"
+ },
+ "_from": "tough-cookie@>=0.12.0",
+ "_npmVersion": "1.3.11",
+ "_npmUser": {
+ "name": "goinstant",
+ "email": "support@goinstant.com"
+ },
+ "maintainers": [
+ {
+ "name": "jstash",
+ "email": "jeremy@goinstant.com"
+ },
+ {
+ "name": "goinstant",
+ "email": "services@goinstant.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "8220c7e21abd5b13d96804254bd5a81ebf2c7d62",
+ "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-0.12.1.tgz"
}
diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/test.js b/deps/npm/node_modules/request/node_modules/tough-cookie/test.js
index 3cce815e7..5cbf536ca 100644
--- a/deps/npm/node_modules/request/node_modules/tough-cookie/test.js
+++ b/deps/npm/node_modules/request/node_modules/tough-cookie/test.js
@@ -18,7 +18,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
-
+'use strict';
var vows = require('vows');
var assert = require('assert');
var async = require('async');
@@ -31,7 +31,7 @@ var CookieJar = tough.CookieJar;
function dateVows(table) {
var theVows = { };
- var keys = Object.keys(table).forEach(function(date) {
+ Object.keys(table).forEach(function(date) {
var expect = table[date];
theVows[date] = function() {
var got = tough.parseDate(date) ? 'valid' : 'invalid';
@@ -69,7 +69,7 @@ function defaultPathVows(table) {
}
var atNow = Date.now();
-function at(offset) { return {now: new Date(atNow+offset)} }
+function at(offset) { return {now: new Date(atNow+offset)}; }
vows.describe('Cookie Jar')
.addBatch({
@@ -135,8 +135,8 @@ vows.describe('Cookie Jar')
"doesn't validate": function(c) {
assert.ok(!c.validate());
},
- "to string": function(c) {
- assert.equal(c.toString(), 'a="beta gamma"');
+ "'garbage in, garbage out'": function(c) {
+ assert.equal(c.toString(), 'a=beta gamma');
},
},
"with an empty value and HttpOnly": {
@@ -277,7 +277,7 @@ vows.describe('Cookie Jar')
assert.ok(c.isPersistent());
},
"default TTL": {
- topic: function() { return new Cookie() },
+ topic: function() { return new Cookie(); },
"is Infinite-future": function(c) { assert.equal(c.TTL(), Infinity) },
"is a 'session' cookie": function(c) { assert.ok(!c.isPersistent()) },
},
@@ -507,7 +507,64 @@ vows.describe('Cookie Jar')
assert.equal(c.expires.getTime(), 1397700749000);
},
"httponly": function(c) { assert.ok(c.httpOnly) },
- }
+ },
+ "spaces in value": {
+ "strict": {
+ topic: function() {
+ return Cookie.parse('a=one two three',true) || null;
+ },
+ "did not parse": function(c) { assert.isNull(c) },
+ },
+ "non-strict": {
+ topic: function() {
+ return Cookie.parse('a=one two three',false) || null;
+ },
+ "parsed": function(c) { assert.ok(c) },
+ "key": function(c) { assert.equal(c.key, 'a') },
+ "value": function(c) { assert.equal(c.value, 'one two three') },
+ "no path": function(c) { assert.equal(c.path, null) },
+ "no domain": function(c) { assert.equal(c.domain, null) },
+ "no extensions": function(c) { assert.ok(!c.extensions) },
+ },
+ },
+ "quoted spaces in value": {
+ "strict": {
+ topic: function() {
+ return Cookie.parse('a="one two three"',true) || null;
+ },
+ "did not parse": function(c) { assert.isNull(c) },
+ },
+ "non-strict": {
+ topic: function() {
+ return Cookie.parse('a="one two three"',false) || null;
+ },
+ "parsed": function(c) { assert.ok(c) },
+ "key": function(c) { assert.equal(c.key, 'a') },
+ "value": function(c) { assert.equal(c.value, 'one two three') },
+ "no path": function(c) { assert.equal(c.path, null) },
+ "no domain": function(c) { assert.equal(c.domain, null) },
+ "no extensions": function(c) { assert.ok(!c.extensions) },
+ }
+ },
+ "non-ASCII in value": {
+ "strict": {
+ topic: function() {
+ return Cookie.parse('farbe=weiß',true) || null;
+ },
+ "did not parse": function(c) { assert.isNull(c) },
+ },
+ "non-strict": {
+ topic: function() {
+ return Cookie.parse('farbe=weiß',false) || null;
+ },
+ "parsed": function(c) { assert.ok(c) },
+ "key": function(c) { assert.equal(c.key, 'farbe') },
+ "value": function(c) { assert.equal(c.value, 'weiß') },
+ "no path": function(c) { assert.equal(c.path, null) },
+ "no domain": function(c) { assert.equal(c.domain, null) },
+ "no extensions": function(c) { assert.ok(!c.extensions) },
+ },
+ },
}
})
.addBatch({
@@ -706,6 +763,20 @@ vows.describe('Cookie Jar')
assert.equal(c.domain, 'example.com');
},
},
+ "Setting a sub-path cookie on a super-domain": {
+ topic: function() {
+ var cj = new CookieJar();
+ var c = Cookie.parse("a=b; Domain=example.com; Path=/subpath");
+ assert.strictEqual(c.hostOnly, null);
+ assert.instanceOf(c.creation, Date);
+ assert.strictEqual(c.lastAccessed, null);
+ c.creation = new Date(Date.now()-10000);
+ cj.setCookie(c, 'http://www.example.com/index.html', this.callback);
+ },
+ "domain is super-domain": function(c) { assert.equal(c.domain, 'example.com') },
+ "path is /subpath": function(c) { assert.equal(c.path, '/subpath') },
+ "path was NOT derived": function(c) { assert.strictEqual(c.pathIsDefault, null) },
+ },
"Setting HttpOnly cookie over non-HTTP API": {
topic: function() {
var cj = new CookieJar();
@@ -755,10 +826,13 @@ vows.describe('Cookie Jar')
});
},
"setup ok": function(err,cj,results) {
- assert.ok(1);
+ assert.ok(!err);
+ assert.ok(cj);
+ assert.ok(results);
},
"then retrieving for http://nodejs.org": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('http://nodejs.org',this.callback);
},
"get a nodejs cookie": function(cookies) {
@@ -768,7 +842,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for https://example.com": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('https://example.com',{secure:true},this.callback);
},
"get a secure example cookie with others": function(cookies) {
@@ -777,7 +852,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for https://example.com (missing options)": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('https://example.com',this.callback);
},
"get a secure example cookie with others": function(cookies) {
@@ -786,7 +862,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for http://example.com": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('http://example.com',this.callback);
},
"get a bunch of cookies": function(cookies) {
@@ -795,7 +872,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for http://EXAMPlE.com": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('http://EXAMPlE.com',this.callback);
},
"get a bunch of cookies": function(cookies) {
@@ -804,7 +882,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for http://example.com, non-HTTP": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('http://example.com',{http:false},this.callback);
},
"get a bunch of cookies": function(cookies) {
@@ -813,7 +892,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for http://example.com/foo/bar": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('http://example.com/foo/bar',this.callback);
},
"get a bunch of cookies": function(cookies) {
@@ -822,7 +902,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for http://example.com as a string": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookieString('http://example.com',this.callback);
},
"get a single string": function(cookieHeader) {
@@ -830,7 +911,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for http://example.com as a set-cookie header": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getSetCookieStrings('http://example.com',this.callback);
},
"get a single string": function(cookieHeaders) {
@@ -841,7 +923,8 @@ vows.describe('Cookie Jar')
},
},
"then retrieving for http://www.example.com/": {
- topic: function(cj,results) {
+ topic: function(cj,oldResults) {
+ assert.ok(oldResults);
cj.getCookies('http://www.example.com/foo/bar',this.callback);
},
"get a bunch of cookies": function(cookies) {
@@ -909,6 +992,7 @@ vows.describe('Cookie Jar')
topic: function() {
var cb = this.callback;
var next = function (err,c) {
+ c = null;
return cb(err,cj);
};
var cj = new CookieJar();
@@ -916,11 +1000,16 @@ vows.describe('Cookie Jar')
},
"initial cookie is set": function(err,cj) {
assert.ok(!err);
+ assert.ok(cj);
},
"but when trying to overwrite": {
topic: function(cj) {
var cb = this.callback;
- cj.setCookie('k=12; Domain=example.ca; Path=/','http://example.ca',{http:false},function(err,c) {cb(null,err)});
+ var next = function(err,c) {
+ c = null;
+ cb(null,err);
+ };
+ cj.setCookie('k=12; Domain=example.ca; Path=/','http://example.ca',{http:false},next);
},
"it's an error": function(err) {
assert.ok(err);
@@ -1337,4 +1426,200 @@ vows.describe('Cookie Jar')
},
}
})
+.addBatch({
+ "remove cookies": {
+ topic: function() {
+ var jar = new CookieJar();
+ var cookie = Cookie.parse("a=b; Domain=example.com; Path=/");
+ var cookie2 = Cookie.parse("a=b; Domain=foo.com; Path=/");
+ var cookie3 = Cookie.parse("foo=bar; Domain=foo.com; Path=/");
+ jar.setCookie(cookie, 'http://example.com/index.html', function(){});
+ jar.setCookie(cookie2, 'http://foo.com/index.html', function(){});
+ jar.setCookie(cookie3, 'http://foo.com/index.html', function(){});
+ return jar;
+ },
+ "all from matching domain": function(jar){
+ jar.store.removeCookies('example.com',null, function(err) {
+ assert(err == null);
+
+ jar.store.findCookies('example.com', null, function(err, cookies){
+ assert(err == null);
+ assert(cookies != null);
+ assert(cookies.length === 0, 'cookie was not removed');
+ });
+
+ jar.store.findCookies('foo.com', null, function(err, cookies){
+ assert(err == null);
+ assert(cookies != null);
+ assert(cookies.length === 2, 'cookies should not have been removed');
+ });
+ });
+ },
+ "from cookie store matching domain and key": function(jar){
+ jar.store.removeCookie('foo.com', '/', 'foo', function(err) {
+ assert(err == null);
+
+ jar.store.findCookies('foo.com', null, function(err, cookies){
+ assert(err == null);
+ assert(cookies != null);
+ assert(cookies.length === 1, 'cookie was not removed correctly');
+ assert(cookies[0].key === 'a', 'wrong cookie was removed');
+ });
+ });
+ }
+ }
+})
+.addBatch({
+ "Synchronous CookieJar": {
+ "setCookieSync": {
+ topic: function() {
+ var jar = new CookieJar();
+ var cookie = Cookie.parse("a=b; Domain=example.com; Path=/");
+ cookie = jar.setCookieSync(cookie, 'http://example.com/index.html');
+ return cookie;
+ },
+ "returns a copy of the cookie": function(cookie) {
+ assert.instanceOf(cookie, Cookie);
+ }
+ },
+
+ "setCookieSync strict parse error": {
+ topic: function() {
+ var jar = new CookieJar();
+ var opts = { strict: true };
+ try {
+ jar.setCookieSync("farbe=weiß", 'http://example.com/index.html', opts);
+ return false;
+ } catch (e) {
+ return e;
+ }
+ },
+ "throws the error": function(err) {
+ assert.instanceOf(err, Error);
+ assert.equal(err.message, "Cookie failed to parse");
+ }
+ },
+
+ "getCookiesSync": {
+ topic: function() {
+ var jar = new CookieJar();
+ var url = 'http://example.com/index.html';
+ jar.setCookieSync("a=b; Domain=example.com; Path=/", url);
+ jar.setCookieSync("c=d; Domain=example.com; Path=/", url);
+ return jar.getCookiesSync(url);
+ },
+ "returns the cookie array": function(err, cookies) {
+ assert.ok(!err);
+ assert.ok(Array.isArray(cookies));
+ assert.lengthOf(cookies, 2);
+ cookies.forEach(function(cookie) {
+ assert.instanceOf(cookie, Cookie);
+ });
+ }
+ },
+
+ "getCookieStringSync": {
+ topic: function() {
+ var jar = new CookieJar();
+ var url = 'http://example.com/index.html';
+ jar.setCookieSync("a=b; Domain=example.com; Path=/", url);
+ jar.setCookieSync("c=d; Domain=example.com; Path=/", url);
+ return jar.getCookieStringSync(url);
+ },
+ "returns the cookie header string": function(err, str) {
+ assert.ok(!err);
+ assert.typeOf(str, 'string');
+ }
+ },
+
+ "getSetCookieStringsSync": {
+ topic: function() {
+ var jar = new CookieJar();
+ var url = 'http://example.com/index.html';
+ jar.setCookieSync("a=b; Domain=example.com; Path=/", url);
+ jar.setCookieSync("c=d; Domain=example.com; Path=/", url);
+ return jar.getSetCookieStringsSync(url);
+ },
+ "returns the cookie header string": function(err, headers) {
+ assert.ok(!err);
+ assert.ok(Array.isArray(headers));
+ assert.lengthOf(headers, 2);
+ headers.forEach(function(header) {
+ assert.typeOf(header, 'string');
+ });
+ }
+ },
+ }
+})
+.addBatch({
+ "Synchronous API on async CookieJar": {
+ topic: function() {
+ return new tough.Store();
+ },
+ "setCookieSync": {
+ topic: function(store) {
+ var jar = new CookieJar(store);
+ try {
+ jar.setCookieSync("a=b", 'http://example.com/index.html');
+ return false;
+ } catch(e) {
+ return e;
+ }
+ },
+ "fails": function(err) {
+ assert.instanceOf(err, Error);
+ assert.equal(err.message,
+ 'CookieJar store is not synchronous; use async API instead.');
+ }
+ },
+ "getCookiesSync": {
+ topic: function(store) {
+ var jar = new CookieJar(store);
+ try {
+ jar.getCookiesSync('http://example.com/index.html');
+ return false;
+ } catch(e) {
+ return e;
+ }
+ },
+ "fails": function(err) {
+ assert.instanceOf(err, Error);
+ assert.equal(err.message,
+ 'CookieJar store is not synchronous; use async API instead.');
+ }
+ },
+ "getCookieStringSync": {
+ topic: function(store) {
+ var jar = new CookieJar(store);
+ try {
+ jar.getCookieStringSync('http://example.com/index.html');
+ return false;
+ } catch(e) {
+ return e;
+ }
+ },
+ "fails": function(err) {
+ assert.instanceOf(err, Error);
+ assert.equal(err.message,
+ 'CookieJar store is not synchronous; use async API instead.');
+ }
+ },
+ "getSetCookieStringsSync": {
+ topic: function(store) {
+ var jar = new CookieJar(store);
+ try {
+ jar.getSetCookieStringsSync('http://example.com/index.html');
+ return false;
+ } catch(e) {
+ return e;
+ }
+ },
+ "fails": function(err) {
+ assert.instanceOf(err, Error);
+ assert.equal(err.message,
+ 'CookieJar store is not synchronous; use async API instead.');
+ }
+ },
+ }
+})
.export(module);
diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc b/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc
new file mode 100644
index 000000000..4c1c8d497
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc
@@ -0,0 +1,5 @@
+{
+ "node": true,
+ "asi": true,
+ "laxcomma": true
+}
diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js b/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js
index 3f7bbb909..13c04272d 100644
--- a/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js
+++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js
@@ -67,9 +67,18 @@ function TunnelingAgent(options) {
}
util.inherits(TunnelingAgent, events.EventEmitter)
-TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) {
+TunnelingAgent.prototype.addRequest = function addRequest(req, options) {
var self = this
+ // Legacy API: addRequest(req, host, port, path)
+ if (typeof options === 'string') {
+ options = {
+ host: options,
+ port: arguments[2],
+ path: arguments[3]
+ };
+ }
+
if (self.sockets.length >= this.maxSockets) {
// We are over limit so we'll add it to the queue.
self.requests.push({host: host, port: port, request: req})
@@ -77,14 +86,14 @@ TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) {
}
// If we are under maxSockets create a new one.
- self.createSocket({host: host, port: port, request: req}, function(socket) {
+ self.createSocket({host: options.host, port: options.port, request: req}, function(socket) {
socket.on('free', onFree)
socket.on('close', onCloseOrRemove)
socket.on('agentRemove', onCloseOrRemove)
req.onSocket(socket)
function onFree() {
- self.emit('free', socket, host, port)
+ self.emit('free', socket, options.host, options.port)
}
function onCloseOrRemove(err) {
diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json
index 3d7492aa8..59c7f5cb5 100644
--- a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json
+++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json
@@ -6,7 +6,7 @@
},
"name": "tunnel-agent",
"description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.",
- "version": "0.3.0",
+ "version": "0.4.0",
"repository": {
"url": "https://github.com/mikeal/tunnel-agent"
},
@@ -17,12 +17,29 @@
"engines": {
"node": "*"
},
- "readme": "tunnel-agent\n============\n\nHTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/mikeal/tunnel-agent/issues"
},
"homepage": "https://github.com/mikeal/tunnel-agent",
- "_id": "tunnel-agent@0.3.0",
- "_from": "tunnel-agent@~0.3.0"
+ "_id": "tunnel-agent@0.4.0",
+ "dist": {
+ "shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550",
+ "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz"
+ },
+ "_from": "tunnel-agent@~0.4.0",
+ "_npmVersion": "1.3.21",
+ "_npmUser": {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "mikeal",
+ "email": "mikeal.rogers@gmail.com"
+ }
+ ],
+ "directories": {},
+ "_shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550",
+ "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz",
+ "readme": "ERROR: No README data found!"
}