Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-04-07 21:08:29 +0300
committerRebecca Turner <me@re-becca.org>2016-04-07 21:08:36 +0300
commit486bbc0e1b101f847e890e6f1925dc8cb253cf3e (patch)
tree8299c7e74bcafbeedebef2977e3d33c6f5dac008 /node_modules/request
parentb1aff346fc41f13e3306b437e1831942aacf2f54 (diff)
request@2.70.0
A bunch of dep updates, accept read stream as body option, support JSON stringify replacer argument. Credit: @simov
Diffstat (limited to 'node_modules/request')
-rw-r--r--node_modules/request/CHANGELOG.md23
-rw-r--r--node_modules/request/CONTRIBUTING.md45
-rw-r--r--node_modules/request/README.md4
-rw-r--r--node_modules/request/lib/helpers.js6
-rw-r--r--node_modules/request/node_modules/aws4/.npmignore3
-rw-r--r--node_modules/request/node_modules/aws4/README.md4
-rw-r--r--node_modules/request/node_modules/aws4/aws4.js11
-rw-r--r--node_modules/request/node_modules/aws4/example.js372
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore1
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml8
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS14
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md55
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js533
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE15
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md60
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js9
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json77
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js113
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js86
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore4
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml7
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md4
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE15
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md204
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json77
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js188
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js360
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json61
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js396
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js120
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js51
-rw-r--r--node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js216
-rw-r--r--node_modules/request/node_modules/aws4/package.json104
-rw-r--r--node_modules/request/node_modules/bl/.travis.yml5
-rw-r--r--node_modules/request/node_modules/bl/README.md6
-rw-r--r--node_modules/request/node_modules/bl/bl.js90
-rw-r--r--node_modules/request/node_modules/bl/package.json52
-rw-r--r--node_modules/request/node_modules/bl/test/basic-test.js557
-rw-r--r--node_modules/request/node_modules/bl/test/sauce.js38
-rw-r--r--node_modules/request/node_modules/bl/test/test.js643
-rw-r--r--node_modules/request/node_modules/form-data/.dockerignore7
-rw-r--r--node_modules/request/node_modules/form-data/.editorconfig10
-rw-r--r--node_modules/request/node_modules/form-data/.eslintignore1
-rw-r--r--node_modules/request/node_modules/form-data/Readme.md10
-rw-r--r--node_modules/request/node_modules/form-data/lib/browser.js3
-rw-r--r--node_modules/request/node_modules/form-data/lib/form_data.js307
-rw-r--r--node_modules/request/node_modules/form-data/lib/populate.js9
-rw-r--r--node_modules/request/node_modules/form-data/package.json150
-rw-r--r--node_modules/request/node_modules/form-data/wercker.yml36
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json103
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json44
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/chalk/package.json149
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md4
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js21
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json38
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json36
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js18
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js6
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json32
-rw-r--r--node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md2
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js3
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js2
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS6
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md14
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md162
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js211
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json107
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json46
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md53
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt9
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md66
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js74
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js4
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js72
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js2
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json67
-rw-r--r--node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json36
-rw-r--r--node_modules/request/node_modules/mime-types/HISTORY.md8
-rw-r--r--node_modules/request/node_modules/mime-types/README.md2
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md14
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json29
-rw-r--r--node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json69
-rw-r--r--node_modules/request/node_modules/mime-types/package.json49
-rw-r--r--node_modules/request/node_modules/oauth-sign/index.js2
-rw-r--r--node_modules/request/node_modules/oauth-sign/package.json98
-rw-r--r--node_modules/request/node_modules/qs/CHANGELOG.md5
-rw-r--r--node_modules/request/node_modules/qs/bower.json1
-rw-r--r--node_modules/request/node_modules/qs/component.json2
-rw-r--r--node_modules/request/node_modules/qs/dist/qs.js9
-rwxr-xr-xnode_modules/request/node_modules/qs/lib/stringify.js9
-rw-r--r--node_modules/request/node_modules/qs/package.json50
-rwxr-xr-xnode_modules/request/node_modules/qs/test/stringify.js24
-rw-r--r--node_modules/request/node_modules/tough-cookie/lib/cookie.js4
-rw-r--r--node_modules/request/node_modules/tough-cookie/package.json42
-rw-r--r--node_modules/request/package.json67
-rw-r--r--node_modules/request/request.js29
96 files changed, 4157 insertions, 2913 deletions
diff --git a/node_modules/request/CHANGELOG.md b/node_modules/request/CHANGELOG.md
index 86386a9ae..34f8e7325 100644
--- a/node_modules/request/CHANGELOG.md
+++ b/node_modules/request/CHANGELOG.md
@@ -1,5 +1,23 @@
## Change Log
+### v2.70.0 (2016/04/05)
+- [#2147](https://github.com/request/request/pull/2147) Update eslint to version 2.5.3 🚀 (@simov, @greenkeeperio-bot)
+- [#2009](https://github.com/request/request/pull/2009) Support JSON stringify replacer argument. (@elyobo)
+- [#2142](https://github.com/request/request/pull/2142) Update eslint to version 2.5.1 🚀 (@greenkeeperio-bot)
+- [#2128](https://github.com/request/request/pull/2128) Update browserify-istanbul to version 2.0.0 🚀 (@greenkeeperio-bot)
+- [#2115](https://github.com/request/request/pull/2115) Update eslint to version 2.3.0 🚀 (@simov, @greenkeeperio-bot)
+- [#2089](https://github.com/request/request/pull/2089) Fix badges (@simov)
+- [#2092](https://github.com/request/request/pull/2092) Update browserify-istanbul to version 1.0.0 🚀 (@greenkeeperio-bot)
+- [#2079](https://github.com/request/request/pull/2079) Accept read stream as body option (@simov)
+- [#2070](https://github.com/request/request/pull/2070) Update bl to version 1.1.2 🚀 (@greenkeeperio-bot)
+- [#2063](https://github.com/request/request/pull/2063) Up bluebird and oauth-sign (@simov)
+- [#2058](https://github.com/request/request/pull/2058) Karma fixes for latest versions (@eiriksm)
+- [#2057](https://github.com/request/request/pull/2057) Update contributing guidelines (@simov)
+- [#2054](https://github.com/request/request/pull/2054) Update qs to version 6.1.0 🚀 (@greenkeeperio-bot)
+
+### v2.69.0 (2016/01/27)
+- [#2041](https://github.com/request/request/pull/2041) restore aws4 as regular dependency (@rmg)
+
### v2.68.0 (2016/01/27)
- [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods)
- [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross)
@@ -85,7 +103,8 @@
- [#1687](https://github.com/request/request/pull/1687) Fix caseless bug - content-type not being set for multipart/form-data (@simov, @garymathews)
### v2.59.0 (2015/07/20)
-- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. Forever option defaults to using http(s).Agent in node 0.12+ (@simov)
+- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options.
+ Forever option defaults to using http(s).Agent in node 0.12+ (@simov)
- [#1679](https://github.com/request/request/pull/1679) Fix - do not remove OAuth param when using OAuth realm (@simov, @jhalickman)
- [#1668](https://github.com/request/request/pull/1668) updated dependencies (@deamme)
- [#1656](https://github.com/request/request/pull/1656) Fix form method (@simov)
@@ -470,7 +489,7 @@
- [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421)
- [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka)
-### v2.18.0 (2013/04/22)
+### v2.20.0 (2013/04/22)
- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421)
- [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421)
- [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun)
diff --git a/node_modules/request/CONTRIBUTING.md b/node_modules/request/CONTRIBUTING.md
index 06b1968d9..8aa6999ac 100644
--- a/node_modules/request/CONTRIBUTING.md
+++ b/node_modules/request/CONTRIBUTING.md
@@ -1,19 +1,57 @@
-# This is an OPEN Open Source Project
+
+# Contributing to Request
+
+:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
+
+The following is a set of guidelines for contributing to Request and its packages, which are hosted in the [Request Organization](https://github.com/request) on GitHub.
+These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
+
+
+## Submitting an Issue
+
+1. Provide a small self **sufficient** code example to **reproduce** the issue.
+2. Run your test code using [request-debug](https://github.com/request/request-debug) and copy/paste the results inside the issue.
+3. You should **always** use fenced code blocks when submitting code examples or any other formatted output:
+ <pre>
+ ```js
+ put your javascript code here
+ ```
+
+ ```
+ put any other formatted output here,
+ like for example the one returned from using request-debug
+ ```
+ </pre>
+
+If the problem cannot be reliably reproduced, the issue will be marked as `Not enough info (see CONTRIBUTING.md)`.
+
+If the problem is not related to request the issue will be marked as `Help (please use Stackoverflow)`.
+
+
+## Submitting a Pull Request
+
+1. In almost all of the cases your PR **needs tests**. Make sure you have any.
+2. Run `npm test` locally. Fix any errors before pushing to GitHub.
+3. After submitting the PR a build will be triggered on TravisCI. Wait for it to ends and make sure all jobs are passing.
+
-----------------------------------------
-## What?
+
+## Becoming a Contributor
Individuals making significant and valuable contributions are given
commit-access to the project to contribute as they see fit. This project is
more like an open wiki than a standard guarded open source project.
+
## Rules
There are a few basic ground-rules for contributors:
1. **No `--force` pushes** or modifying the Git history in any way.
1. **Non-master branches** ought to be used for ongoing work.
+1. **Any** change should be added through Pull Request.
1. **External API changes and significant modifications** ought to be subject
to an **internal pull-request** to solicit feedback from other contributors.
1. Internal pull-requests to solicit feedback are *encouraged* for any other
@@ -35,10 +73,9 @@ There are a few basic ground-rules for contributors:
Declaring formal releases remains the prerogative of the project maintainer.
+
## Changes to this arrangement
This is an experiment and feedback is welcome! This document may also be
subject to pull-requests or changes by contributors where you believe you have
something valuable to add or change.
-
------------------------------------------
diff --git a/node_modules/request/README.md b/node_modules/request/README.md
index 6ee45b205..64c43e742 100644
--- a/node_modules/request/README.md
+++ b/node_modules/request/README.md
@@ -7,6 +7,7 @@
[![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master)
[![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request)
[![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request)
+[![Known Vulnerabilities](https://snyk.io/test/npm/request/badge.svg?style=flat-square)](https://snyk.io/test/npm/request)
[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge)
@@ -733,7 +734,7 @@ The first argument can be either a `url` or an `options` object. The only requir
---
-- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object.
+- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer`, `String` or `ReadStream`. If `json` is `true`, then `body` must be a JSON-serializable object.
- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above.
- `formData` - Data to pass for a `multipart/form-data` request. See
[Forms](#forms) section above.
@@ -748,6 +749,7 @@ The first argument can be either a `url` or an `options` object. The only requir
- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.
- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON.
- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.
+- `jsonReplacer` - a [replacer function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that will be passed to `JSON.stringify()` when stringifying a JSON request body.
---
diff --git a/node_modules/request/lib/helpers.js b/node_modules/request/lib/helpers.js
index 5e8594606..356ff748e 100644
--- a/node_modules/request/lib/helpers.js
+++ b/node_modules/request/lib/helpers.js
@@ -24,12 +24,12 @@ function paramsHaveRequestBody(params) {
)
}
-function safeStringify (obj) {
+function safeStringify (obj, replacer) {
var ret
try {
- ret = JSON.stringify(obj)
+ ret = JSON.stringify(obj, replacer)
} catch (e) {
- ret = jsonSafeStringify(obj)
+ ret = jsonSafeStringify(obj, replacer)
}
return ret
}
diff --git a/node_modules/request/node_modules/aws4/.npmignore b/node_modules/request/node_modules/aws4/.npmignore
index ccafa6b41..6c6ade6ff 100644
--- a/node_modules/request/node_modules/aws4/.npmignore
+++ b/node_modules/request/node_modules/aws4/.npmignore
@@ -1,3 +1,4 @@
test
-coverage
examples
+example.js
+browser
diff --git a/node_modules/request/node_modules/aws4/README.md b/node_modules/request/node_modules/aws4/README.md
index 18a3a5376..6c55da805 100644
--- a/node_modules/request/node_modules/aws4/README.md
+++ b/node_modules/request/node_modules/aws4/README.md
@@ -6,6 +6,8 @@ aws4
A small utility to sign vanilla node.js http(s) request options using Amazon's
[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).
+Can also be used [in the browser](./browser).
+
This signature is supported by nearly all Amazon services, including
[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),
[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
@@ -497,6 +499,8 @@ With [npm](http://npmjs.org/) do:
npm install aws4
```
+Can also be used [in the browser](./browser).
+
Thanks
------
diff --git a/node_modules/request/node_modules/aws4/aws4.js b/node_modules/request/node_modules/aws4/aws4.js
index 3ef54a468..71e08bbc1 100644
--- a/node_modules/request/node_modules/aws4/aws4.js
+++ b/node_modules/request/node_modules/aws4/aws4.js
@@ -43,8 +43,13 @@ function RequestSigner(request, credentials) {
if (!request.method && request.body)
request.method = 'POST'
- if (!headers.Host && !headers.host)
+ if (!headers.Host && !headers.host) {
headers.Host = request.hostname || request.host || this.createHost()
+
+ // If a port is specified explicitly, use it as is
+ if (request.port)
+ headers.Host += ':' + request.port
+ }
if (!request.hostname && !request.host)
request.hostname = headers.Host || headers.host
}
@@ -210,8 +215,7 @@ RequestSigner.prototype.canonicalString = function() {
}
if (pathStr !== '/') {
if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
- if (pathStr[0] === '/') pathStr = pathStr.slice(1)
- pathStr = '/' + pathStr.split('/').reduce(function(path, piece) {
+ pathStr = pathStr.split('/').reduce(function(path, piece) {
if (normalizePath && piece === '..') {
path.pop()
} else if (!normalizePath || piece !== '.') {
@@ -220,6 +224,7 @@ RequestSigner.prototype.canonicalString = function() {
}
return path
}, []).join('/')
+ if (pathStr[0] !== '/') pathStr = '/' + pathStr
if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
}
diff --git a/node_modules/request/node_modules/aws4/example.js b/node_modules/request/node_modules/aws4/example.js
deleted file mode 100644
index 6c1a95a0b..000000000
--- a/node_modules/request/node_modules/aws4/example.js
+++ /dev/null
@@ -1,372 +0,0 @@
-var http = require('http'),
- https = require('https'),
- aws4 = require('aws4')
-
-// given an options object you could pass to http.request
-var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
-
-// alternatively (as aws4 can infer the host):
-opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
-
-// alternatively (as us-east-1 is default):
-opts = {service: 'sqs', path: '/?Action=ListQueues'}
-
-aws4.sign(opts) // assumes AWS credentials are available in process.env
-
-console.log(opts)
-/*
-{
- host: 'sqs.us-east-1.amazonaws.com',
- path: '/?Action=ListQueues',
- headers: {
- Host: 'sqs.us-east-1.amazonaws.com',
- 'X-Amz-Date': '20121226T061030Z',
- Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
- }
-}
-*/
-
-// we can now use this to query AWS using the standard node.js http API
-http.request(opts, function(res) { res.pipe(process.stdout) }).end()
-/*
-<?xml version="1.0"?>
-<ListQueuesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
-...
-*/
-
-// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
-aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
-
-// can also add the signature to query strings
-aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
-
-// create a utility function to pipe to stdout (with https this time)
-function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
-
-// aws4 can infer the HTTP method if a body is passed in
-// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
-request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
-/*
-<ListGroupsResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
-...
-*/
-
-// can specify any custom option or header as per usual
-request(aws4.sign({
- service: 'dynamodb',
- region: 'ap-southeast-2',
- method: 'POST',
- path: '/',
- headers: {
- 'Content-Type': 'application/x-amz-json-1.0',
- 'X-Amz-Target': 'DynamoDB_20120810.ListTables'
- },
- body: '{}'
-}))
-/*
-{"TableNames":[]}
-...
-*/
-
-// works with all other services that support Signature Version 4
-
-request(aws4.sign({service: 's3', path: '/', signQuery: true}))
-/*
-<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
-...
-*/
-
-request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
-/*
-<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
-...
-*/
-
-request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
-/*
-<ListTopicsResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
-...
-*/
-
-request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
-/*
-<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
-...
-*/
-
-request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
-/*
-<ListDomainNamesResponse xmlns="http://cloudsearch.amazonaws.com/doc/2013-01-01/">
-...
-*/
-
-request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
-/*
-<ListIdentitiesResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
-...
-*/
-
-request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
-/*
-<DescribeAutoScalingInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/">
-...
-*/
-
-request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
-/*
-<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
-...
-*/
-
-request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
-/*
-<ListStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
-...
-*/
-
-request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
-/*
-<ListAvailableSolutionStacksResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
-...
-*/
-
-request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
-/*
-<DescribeDBInstancesResponse xmlns="http://rds.amazonaws.com/doc/2012-09-17/">
-...
-*/
-
-request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
-/*
-<ListMetricsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
-...
-*/
-
-request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
-/*
-<DescribeClustersResponse xmlns="http://redshift.amazonaws.com/doc/2012-12-01/">
-...
-*/
-
-request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
-/*
-<DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2014-05-31/">
-...
-*/
-
-request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
-/*
-<DescribeCacheClustersResponse xmlns="http://elasticache.amazonaws.com/doc/2014-07-15/">
-...
-*/
-
-request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
-/*
-<DescribeJobFlowsResponse xmlns="http://elasticmapreduce.amazonaws.com/doc/2009-03-31">
-...
-*/
-
-request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
-/*
-<ListHostedZonesResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
-...
-*/
-
-request(aws4.sign({service: 'appstream', path: '/applications'}))
-/*
-{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
-...
-*/
-
-request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
-/*
-{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
-...
-*/
-
-request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
-/*
-{"NextPageToken":null,"Pipelines":[]}
-...
-*/
-
-request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
-/*
-{"Functions":[],"NextMarker":null}
-...
-*/
-
-request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
-/*
-<ListClustersResponse xmlns="http://ecs.amazonaws.com/doc/2014-11-13/">
-...
-*/
-
-request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
-/*
-{"Marker":null,"VaultList":[]}
-...
-*/
-
-request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
-}}))
-/*
-{"Gateways":[]}
-...
-*/
-
-request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'DataPipeline.ListPipelines'
-}}))
-/*
-{"hasMoreResults":false,"pipelineIdList":[]}
-...
-*/
-
-request(aws4.sign({service: 'opsworks', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
-}}))
-/*
-{"Stacks":[]}
-...
-*/
-
-request(aws4.sign({service: 'route53domains', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
-}}))
-/*
-{"Domains":[]}
-...
-*/
-
-request(aws4.sign({service: 'kinesis', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'Kinesis_20131202.ListStreams'
-}}))
-/*
-{"HasMoreStreams":false,"StreamNames":[]}
-...
-*/
-
-request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
-}}))
-/*
-{"trailList":[]}
-...
-*/
-
-request(aws4.sign({service: 'logs', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
-}}))
-/*
-{"logGroups":[]}
-...
-*/
-
-request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
-}}))
-/*
-{"applications":[]}
-...
-*/
-
-request(aws4.sign({service: 'directconnect', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'OvertureService.DescribeConnections'
-}}))
-/*
-{"connections":[]}
-...
-*/
-
-request(aws4.sign({service: 'kms', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'TrentService.ListKeys'
-}}))
-/*
-{"Keys":[],"Truncated":false}
-...
-*/
-
-request(aws4.sign({service: 'config', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
-}}))
-/*
-{"DeliveryChannels":[]}
-...
-*/
-
-request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
-}}))
-/*
-{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
-...
-*/
-
-request(aws4.sign({
- service: 'swf',
- body: '{"registrationStatus":"REGISTERED"}',
- headers: {
- 'Content-Type': 'application/x-amz-json-1.0',
- 'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
- }
-}))
-/*
-{"domainInfos":[]}
-...
-*/
-
-request(aws4.sign({
- service: 'cognito-identity',
- body: '{"MaxResults": 1}',
- headers: {
- 'Content-Type': 'application/x-amz-json-1.1',
- 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
- }
-}))
-/*
-{"IdentityPools":[]}
-...
-*/
-
-request(aws4.sign({
- service: 'mobileanalytics',
- path: '/2014-06-05/events',
- body: JSON.stringify({events:[{
- eventType: 'a',
- timestamp: new Date().toISOString(),
- session: {},
- }]}),
- headers: {
- 'Content-Type': 'application/json',
- 'X-Amz-Client-Context': JSON.stringify({
- client: {client_id: 'a', app_title: 'a'},
- custom: {},
- env: {platform: 'a'},
- services: {},
- }),
- }
-}))
-/*
-(HTTP 202, empty response)
-*/
-
-// Still not updated to v4...
-
-//request(aws4.sign({service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01'}))
-
-//request(aws4.sign({service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15'}))
-
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore b/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore
deleted file mode 100644
index 07e6e472c..000000000
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-/node_modules
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml b/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml
deleted file mode 100644
index 4af02b3d1..000000000
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-language: node_js
-node_js:
- - '0.8'
- - '0.10'
- - '0.12'
- - 'iojs'
-before_install:
- - npm install -g npm@latest
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS b/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS
deleted file mode 100644
index 4a0bc5033..000000000
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS
+++ /dev/null
@@ -1,14 +0,0 @@
-# Authors, sorted by whether or not they are me
-Isaac Z. Schlueter <i@izs.me>
-Brian Cottingham <spiffytech@gmail.com>
-Carlos Brito Lage <carlos@carloslage.net>
-Jesse Dailey <jesse.dailey@gmail.com>
-Kevin O'Hara <kevinohara80@gmail.com>
-Marco Rogers <marco.rogers@gmail.com>
-Mark Cavage <mcavage@gmail.com>
-Marko Mikulicic <marko.mikulicic@isti.cnr.it>
-Nathan Rajlich <nathan@tootallnate.net>
-Satheesh Natesan <snateshan@myspace-inc.com>
-Trent Mick <trentm@gmail.com>
-ashleybrener <ashley@starlogik.com>
-n4kz <n4kz@n4kz.com>
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md b/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md
index c06814e04..1bc7b03f3 100644
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md
@@ -2,12 +2,14 @@
A cache object that deletes the least-recently-used items.
+[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache)
+
## Usage:
```javascript
var LRU = require("lru-cache")
, options = { max: 500
- , length: function (n) { return n * 2 }
+ , length: function (n, key) { return n * 2 + key.length }
, dispose: function (key, n) { n.close() }
, maxAge: 1000 * 60 * 60 }
, cache = LRU(options)
@@ -16,6 +18,12 @@ var LRU = require("lru-cache")
cache.set("key", "value")
cache.get("key") // "value"
+// non-string keys ARE fully supported
+var someObject = {}
+cache.set(someObject, 'a value')
+cache.set('[object Object]', 'a different value')
+assert.equal(cache.get(someObject), 'a value')
+
cache.reset() // empty the cache
```
@@ -24,24 +32,6 @@ If you put more stuff in it, then items will fall out.
If you try to put an oversized thing in it, then it'll fall out right
away.
-## Keys should always be Strings or Numbers
-
-Note: this module will print warnings to `console.error` if you use a
-key that is not a String or Number. Because items are stored in an
-object, which coerces keys to a string, it won't go well for you if
-you try to use a key that is not a unique string, it'll cause surprise
-collisions. For example:
-
-```JavaScript
-// Bad Example! Dont' do this!
-var cache = LRU()
-var a = {}
-var b = {}
-cache.set(a, 'this is a')
-cache.set(b, 'this is b')
-console.log(cache.get(a)) // prints: 'this is b'
-```
-
## Options
* `max` The maximum size of the cache, checked by applying the length
@@ -53,9 +43,10 @@ console.log(cache.get(a)) // prints: 'this is b'
drop it and return undefined instead of giving it to you.
* `length` Function that is used to calculate the length of stored
items. If you're storing strings or buffers, then you probably want
- to do something like `function(n){return n.length}`. The default is
- `function(n){return 1}`, which is fine if you want to store `max`
- like-sized things.
+ to do something like `function(n, key){return n.length}`. The default is
+ `function(){return 1}`, which is fine if you want to store `max`
+ like-sized things. They item is passed as the first argument, and
+ the key is passed as the second argumnet.
* `dispose` Function that is called on items when they are dropped
from the cache. This can be handy if you want to close file
descriptors or do other cleanup tasks when items are no longer
@@ -76,8 +67,12 @@ console.log(cache.get(a)) // prints: 'this is b'
* `get(key) => value`
Both of these will update the "recently used"-ness of the key.
- They do what you think. `max` is optional and overrides the
- cache `max` option if provided.
+ They do what you think. `maxAge` is optional and overrides the
+ cache `maxAge` option if provided.
+
+ If the key is not found, `get()` will return `undefined`.
+
+ The key and val can be any value.
* `peek(key)`
@@ -107,6 +102,12 @@ console.log(cache.get(a)) // prints: 'this is b'
in the cache, in order of recent-ness. (Ie, more recently used
items are iterated over first.)
+* `rforEach(function(value,key,cache), [thisp])`
+
+ The same as `cache.forEach(...)` but items are iterated over in
+ reverse order. (ie, less recently used items are iterated over
+ first.)
+
* `keys()`
Return an array of the keys in the cache.
@@ -115,7 +116,7 @@ console.log(cache.get(a)) // prints: 'this is b'
Return an array of the values in the cache.
-* `length()`
+* `length`
Return total length of objects in cache taking into account
`length` options function.
@@ -135,3 +136,7 @@ console.log(cache.get(a)) // prints: 'this is b'
Loads another cache entries array, obtained with `sourceCache.dump()`,
into the cache. The destination cache is reset before loading new entries
+
+* `prune()`
+
+ Manually iterates over the entire cache proactively pruning old entries
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js
index 2bbe653be..e98ef78a5 100644
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js
@@ -1,225 +1,353 @@
-;(function () { // closure for web browsers
-
-if (typeof module === 'object' && module.exports) {
- module.exports = LRUCache
+module.exports = LRUCache
+
+// This will be a proper iterable 'Map' in engines that support it,
+// or a fakey-fake PseudoMap in older versions.
+var Map = require('pseudomap')
+var util = require('util')
+
+// A linked list to keep track of recently-used-ness
+var Yallist = require('yallist')
+
+// use symbols if possible, otherwise just _props
+var symbols = {}
+var hasSymbol = typeof Symbol === 'function'
+var makeSymbol
+/* istanbul ignore if */
+if (hasSymbol) {
+ makeSymbol = function (key) {
+ return Symbol.for(key)
+ }
} else {
- // just set the global for non-node platforms.
- this.LRUCache = LRUCache
+ makeSymbol = function (key) {
+ return '_' + key
+ }
}
-function hOP (obj, key) {
- return Object.prototype.hasOwnProperty.call(obj, key)
+function priv (obj, key, val) {
+ var sym
+ if (symbols[key]) {
+ sym = symbols[key]
+ } else {
+ sym = makeSymbol(key)
+ symbols[key] = sym
+ }
+ if (arguments.length === 2) {
+ return obj[sym]
+ } else {
+ obj[sym] = val
+ return val
+ }
}
function naiveLength () { return 1 }
-var didTypeWarning = false
-function typeCheckKey(key) {
- if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') {
- didTypeWarning = true
- console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack)
- }
-}
-
+// lruList is a yallist where the head is the youngest
+// item, and the tail is the oldest. the list contains the Hit
+// objects as the entries.
+// Each Hit object has a reference to its Yallist.Node. This
+// never changes.
+//
+// cache is a Map (or PseudoMap) that matches the keys to
+// the Yallist.Node object.
function LRUCache (options) {
- if (!(this instanceof LRUCache))
+ if (!(this instanceof LRUCache)) {
return new LRUCache(options)
+ }
- if (typeof options === 'number')
+ if (typeof options === 'number') {
options = { max: options }
+ }
- if (!options)
+ if (!options) {
options = {}
+ }
- this._max = options.max
+ var max = priv(this, 'max', options.max)
// Kind of weird to have a default max of Infinity, but oh well.
- if (!this._max || !(typeof this._max === "number") || this._max <= 0 )
- this._max = Infinity
+ if (!max ||
+ !(typeof max === 'number') ||
+ max <= 0) {
+ priv(this, 'max', Infinity)
+ }
- this._lengthCalculator = options.length || naiveLength
- if (typeof this._lengthCalculator !== "function")
- this._lengthCalculator = naiveLength
+ var lc = options.length || naiveLength
+ if (typeof lc !== 'function') {
+ lc = naiveLength
+ }
+ priv(this, 'lengthCalculator', lc)
- this._allowStale = options.stale || false
- this._maxAge = options.maxAge || null
- this._dispose = options.dispose
+ priv(this, 'allowStale', options.stale || false)
+ priv(this, 'maxAge', options.maxAge || 0)
+ priv(this, 'dispose', options.dispose)
this.reset()
}
// resize the cache when the max changes.
-Object.defineProperty(LRUCache.prototype, "max",
- { set : function (mL) {
- if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity
- this._max = mL
- if (this._length > this._max) trim(this)
+Object.defineProperty(LRUCache.prototype, 'max', {
+ set: function (mL) {
+ if (!mL || !(typeof mL === 'number') || mL <= 0) {
+ mL = Infinity
}
- , get : function () { return this._max }
- , enumerable : true
- })
+ priv(this, 'max', mL)
+ trim(this)
+ },
+ get: function () {
+ return priv(this, 'max')
+ },
+ enumerable: true
+})
+
+Object.defineProperty(LRUCache.prototype, 'allowStale', {
+ set: function (allowStale) {
+ priv(this, 'allowStale', !!allowStale)
+ },
+ get: function () {
+ return priv(this, 'allowStale')
+ },
+ enumerable: true
+})
+
+Object.defineProperty(LRUCache.prototype, 'maxAge', {
+ set: function (mA) {
+ if (!mA || !(typeof mA === 'number') || mA < 0) {
+ mA = 0
+ }
+ priv(this, 'maxAge', mA)
+ trim(this)
+ },
+ get: function () {
+ return priv(this, 'maxAge')
+ },
+ enumerable: true
+})
// resize the cache when the lengthCalculator changes.
-Object.defineProperty(LRUCache.prototype, "lengthCalculator",
- { set : function (lC) {
- if (typeof lC !== "function") {
- this._lengthCalculator = naiveLength
- this._length = this._itemCount
- for (var key in this._cache) {
- this._cache[key].length = 1
- }
- } else {
- this._lengthCalculator = lC
- this._length = 0
- for (var key in this._cache) {
- this._cache[key].length = this._lengthCalculator(this._cache[key].value)
- this._length += this._cache[key].length
- }
- }
-
- if (this._length > this._max) trim(this)
+Object.defineProperty(LRUCache.prototype, 'lengthCalculator', {
+ set: function (lC) {
+ if (typeof lC !== 'function') {
+ lC = naiveLength
}
- , get : function () { return this._lengthCalculator }
- , enumerable : true
- })
-
-Object.defineProperty(LRUCache.prototype, "length",
- { get : function () { return this._length }
- , enumerable : true
- })
-
+ if (lC !== priv(this, 'lengthCalculator')) {
+ priv(this, 'lengthCalculator', lC)
+ priv(this, 'length', 0)
+ priv(this, 'lruList').forEach(function (hit) {
+ hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key)
+ priv(this, 'length', priv(this, 'length') + hit.length)
+ }, this)
+ }
+ trim(this)
+ },
+ get: function () { return priv(this, 'lengthCalculator') },
+ enumerable: true
+})
+
+Object.defineProperty(LRUCache.prototype, 'length', {
+ get: function () { return priv(this, 'length') },
+ enumerable: true
+})
+
+Object.defineProperty(LRUCache.prototype, 'itemCount', {
+ get: function () { return priv(this, 'lruList').length },
+ enumerable: true
+})
+
+LRUCache.prototype.rforEach = function (fn, thisp) {
+ thisp = thisp || this
+ for (var walker = priv(this, 'lruList').tail; walker !== null;) {
+ var prev = walker.prev
+ forEachStep(this, fn, walker, thisp)
+ walker = prev
+ }
+}
-Object.defineProperty(LRUCache.prototype, "itemCount",
- { get : function () { return this._itemCount }
- , enumerable : true
- })
+function forEachStep (self, fn, node, thisp) {
+ var hit = node.value
+ if (isStale(self, hit)) {
+ del(self, node)
+ if (!priv(self, 'allowStale')) {
+ hit = undefined
+ }
+ }
+ if (hit) {
+ fn.call(thisp, hit.value, hit.key, self)
+ }
+}
LRUCache.prototype.forEach = function (fn, thisp) {
thisp = thisp || this
- var i = 0
- var itemCount = this._itemCount
-
- for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) {
- i++
- var hit = this._lruList[k]
- if (isStale(this, hit)) {
- del(this, hit)
- if (!this._allowStale) hit = undefined
- }
- if (hit) {
- fn.call(thisp, hit.value, hit.key, this)
- }
+ for (var walker = priv(this, 'lruList').head; walker !== null;) {
+ var next = walker.next
+ forEachStep(this, fn, walker, thisp)
+ walker = next
}
}
LRUCache.prototype.keys = function () {
- var keys = new Array(this._itemCount)
- var i = 0
- for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
- var hit = this._lruList[k]
- keys[i++] = hit.key
- }
- return keys
+ return priv(this, 'lruList').toArray().map(function (k) {
+ return k.key
+ }, this)
}
LRUCache.prototype.values = function () {
- var values = new Array(this._itemCount)
- var i = 0
- for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
- var hit = this._lruList[k]
- values[i++] = hit.value
- }
- return values
+ return priv(this, 'lruList').toArray().map(function (k) {
+ return k.value
+ }, this)
}
LRUCache.prototype.reset = function () {
- if (this._dispose && this._cache) {
- for (var k in this._cache) {
- this._dispose(k, this._cache[k].value)
- }
+ if (priv(this, 'dispose') &&
+ priv(this, 'lruList') &&
+ priv(this, 'lruList').length) {
+ priv(this, 'lruList').forEach(function (hit) {
+ priv(this, 'dispose').call(this, hit.key, hit.value)
+ }, this)
}
- this._cache = Object.create(null) // hash of items by key
- this._lruList = Object.create(null) // list of items in order of use recency
- this._mru = 0 // most recently used
- this._lru = 0 // least recently used
- this._length = 0 // number of items in the list
- this._itemCount = 0
+ priv(this, 'cache', new Map()) // hash of items by key
+ priv(this, 'lruList', new Yallist()) // list of items in order of use recency
+ priv(this, 'length', 0) // length of items in the list
}
LRUCache.prototype.dump = function () {
- var arr = []
- var i = 0
-
- for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
- var hit = this._lruList[k]
+ return priv(this, 'lruList').map(function (hit) {
if (!isStale(this, hit)) {
- //Do not store staled hits
- ++i
- arr.push({
+ return {
k: hit.key,
v: hit.value,
e: hit.now + (hit.maxAge || 0)
- });
+ }
}
- }
- //arr has the most read first
- return arr
+ }, this).toArray().filter(function (h) {
+ return h
+ })
}
LRUCache.prototype.dumpLru = function () {
- return this._lruList
+ return priv(this, 'lruList')
+}
+
+LRUCache.prototype.inspect = function (n, opts) {
+ var str = 'LRUCache {'
+ var extras = false
+
+ var as = priv(this, 'allowStale')
+ if (as) {
+ str += '\n allowStale: true'
+ extras = true
+ }
+
+ var max = priv(this, 'max')
+ if (max && max !== Infinity) {
+ if (extras) {
+ str += ','
+ }
+ str += '\n max: ' + util.inspect(max, opts)
+ extras = true
+ }
+
+ var maxAge = priv(this, 'maxAge')
+ if (maxAge) {
+ if (extras) {
+ str += ','
+ }
+ str += '\n maxAge: ' + util.inspect(maxAge, opts)
+ extras = true
+ }
+
+ var lc = priv(this, 'lengthCalculator')
+ if (lc && lc !== naiveLength) {
+ if (extras) {
+ str += ','
+ }
+ str += '\n length: ' + util.inspect(priv(this, 'length'), opts)
+ extras = true
+ }
+
+ var didFirst = false
+ priv(this, 'lruList').forEach(function (item) {
+ if (didFirst) {
+ str += ',\n '
+ } else {
+ if (extras) {
+ str += ',\n'
+ }
+ didFirst = true
+ str += '\n '
+ }
+ var key = util.inspect(item.key).split('\n').join('\n ')
+ var val = { value: item.value }
+ if (item.maxAge !== maxAge) {
+ val.maxAge = item.maxAge
+ }
+ if (lc !== naiveLength) {
+ val.length = item.length
+ }
+ if (isStale(this, item)) {
+ val.stale = true
+ }
+
+ val = util.inspect(val, opts).split('\n').join('\n ')
+ str += key + ' => ' + val
+ })
+
+ if (didFirst || extras) {
+ str += '\n'
+ }
+ str += '}'
+
+ return str
}
LRUCache.prototype.set = function (key, value, maxAge) {
- maxAge = maxAge || this._maxAge
- typeCheckKey(key)
+ maxAge = maxAge || priv(this, 'maxAge')
var now = maxAge ? Date.now() : 0
- var len = this._lengthCalculator(value)
+ var len = priv(this, 'lengthCalculator').call(this, value, key)
- if (hOP(this._cache, key)) {
- if (len > this._max) {
- del(this, this._cache[key])
+ if (priv(this, 'cache').has(key)) {
+ if (len > priv(this, 'max')) {
+ del(this, priv(this, 'cache').get(key))
return false
}
- // dispose of the old one before overwriting
- if (this._dispose)
- this._dispose(key, this._cache[key].value)
-
- this._cache[key].now = now
- this._cache[key].maxAge = maxAge
- this._cache[key].value = value
- this._length += (len - this._cache[key].length)
- this._cache[key].length = len
- this.get(key)
- if (this._length > this._max)
- trim(this)
+ var node = priv(this, 'cache').get(key)
+ var item = node.value
+
+ // dispose of the old one before overwriting
+ if (priv(this, 'dispose')) {
+ priv(this, 'dispose').call(this, key, item.value)
+ }
+ item.now = now
+ item.maxAge = maxAge
+ item.value = value
+ priv(this, 'length', priv(this, 'length') + (len - item.length))
+ item.length = len
+ this.get(key)
+ trim(this)
return true
}
- var hit = new Entry(key, value, this._mru++, len, now, maxAge)
+ var hit = new Entry(key, value, len, now, maxAge)
// oversized objects fall out of cache automatically.
- if (hit.length > this._max) {
- if (this._dispose) this._dispose(key, value)
+ if (hit.length > priv(this, 'max')) {
+ if (priv(this, 'dispose')) {
+ priv(this, 'dispose').call(this, key, value)
+ }
return false
}
- this._length += hit.length
- this._lruList[hit.lu] = this._cache[key] = hit
- this._itemCount ++
-
- if (this._length > this._max)
- trim(this)
-
+ priv(this, 'length', priv(this, 'length') + hit.length)
+ priv(this, 'lruList').unshift(hit)
+ priv(this, 'cache').set(key, priv(this, 'lruList').head)
+ trim(this)
return true
}
LRUCache.prototype.has = function (key) {
- typeCheckKey(key)
- if (!hOP(this._cache, key)) return false
- var hit = this._cache[key]
+ if (!priv(this, 'cache').has(key)) return false
+ var hit = priv(this, 'cache').get(key).value
if (isStale(this, hit)) {
return false
}
@@ -227,108 +355,115 @@ LRUCache.prototype.has = function (key) {
}
LRUCache.prototype.get = function (key) {
- typeCheckKey(key)
return get(this, key, true)
}
LRUCache.prototype.peek = function (key) {
- typeCheckKey(key)
return get(this, key, false)
}
LRUCache.prototype.pop = function () {
- var hit = this._lruList[this._lru]
- del(this, hit)
- return hit || null
+ var node = priv(this, 'lruList').tail
+ if (!node) return null
+ del(this, node)
+ return node.value
}
LRUCache.prototype.del = function (key) {
- typeCheckKey(key)
- del(this, this._cache[key])
+ del(this, priv(this, 'cache').get(key))
}
LRUCache.prototype.load = function (arr) {
- //reset the cache
- this.reset();
+ // reset the cache
+ this.reset()
var now = Date.now()
- //A previous serialized cache has the most recent items first
- for (var l = arr.length - 1; l >= 0; l-- ) {
+ // A previous serialized cache has the most recent items first
+ for (var l = arr.length - 1; l >= 0; l--) {
var hit = arr[l]
- typeCheckKey(hit.k)
var expiresAt = hit.e || 0
if (expiresAt === 0) {
- //the item was created without expiration in a non aged cache
+ // the item was created without expiration in a non aged cache
this.set(hit.k, hit.v)
} else {
var maxAge = expiresAt - now
- //dont add already expired items
- if (maxAge > 0) this.set(hit.k, hit.v, maxAge)
+ // dont add already expired items
+ if (maxAge > 0) {
+ this.set(hit.k, hit.v, maxAge)
+ }
}
}
}
+LRUCache.prototype.prune = function () {
+ var self = this
+ priv(this, 'cache').forEach(function (value, key) {
+ get(self, key, false)
+ })
+}
+
function get (self, key, doUse) {
- typeCheckKey(key)
- var hit = self._cache[key]
- if (hit) {
+ var node = priv(self, 'cache').get(key)
+ if (node) {
+ var hit = node.value
if (isStale(self, hit)) {
- del(self, hit)
- if (!self._allowStale) hit = undefined
+ del(self, node)
+ if (!priv(self, 'allowStale')) hit = undefined
} else {
- if (doUse) use(self, hit)
+ if (doUse) {
+ priv(self, 'lruList').unshiftNode(node)
+ }
}
if (hit) hit = hit.value
}
return hit
}
-function isStale(self, hit) {
- if (!hit || (!hit.maxAge && !self._maxAge)) return false
- var stale = false;
+function isStale (self, hit) {
+ if (!hit || (!hit.maxAge && !priv(self, 'maxAge'))) {
+ return false
+ }
+ var stale = false
var diff = Date.now() - hit.now
if (hit.maxAge) {
stale = diff > hit.maxAge
} else {
- stale = self._maxAge && (diff > self._maxAge)
+ stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge'))
}
- return stale;
-}
-
-function use (self, hit) {
- shiftLU(self, hit)
- hit.lu = self._mru ++
- self._lruList[hit.lu] = hit
+ return stale
}
function trim (self) {
- while (self._lru < self._mru && self._length > self._max)
- del(self, self._lruList[self._lru])
-}
-
-function shiftLU (self, hit) {
- delete self._lruList[ hit.lu ]
- while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++
+ if (priv(self, 'length') > priv(self, 'max')) {
+ for (var walker = priv(self, 'lruList').tail;
+ priv(self, 'length') > priv(self, 'max') && walker !== null;) {
+ // We know that we're about to delete this one, and also
+ // what the next least recently used key will be, so just
+ // go ahead and set it now.
+ var prev = walker.prev
+ del(self, walker)
+ walker = prev
+ }
+ }
}
-function del (self, hit) {
- if (hit) {
- if (self._dispose) self._dispose(hit.key, hit.value)
- self._length -= hit.length
- self._itemCount --
- delete self._cache[ hit.key ]
- shiftLU(self, hit)
+function del (self, node) {
+ if (node) {
+ var hit = node.value
+ if (priv(self, 'dispose')) {
+ priv(self, 'dispose').call(this, hit.key, hit.value)
+ }
+ priv(self, 'length', priv(self, 'length') - hit.length)
+ priv(self, 'cache').delete(hit.key)
+ priv(self, 'lruList').removeNode(node)
}
}
// classy, since V8 prefers predictable objects.
-function Entry (key, value, lu, length, now, maxAge) {
+function Entry (key, value, length, now, maxAge) {
this.key = key
this.value = value
- this.lu = lu
this.length = length
this.now = now
- if (maxAge) this.maxAge = maxAge
+ this.maxAge = maxAge || 0
}
-
-})()
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE
new file mode 100644
index 000000000..19129e315
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md
new file mode 100644
index 000000000..778bf01df
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md
@@ -0,0 +1,60 @@
+# pseudomap
+
+A thing that is a lot like ES6 `Map`, but without iterators, for use
+in environments where `for..of` syntax and `Map` are not available.
+
+If you need iterators, or just in general a more faithful polyfill to
+ES6 Maps, check out [es6-map](http://npm.im/es6-map).
+
+If you are in an environment where `Map` is supported, then that will
+be returned instead, unless `process.env.TEST_PSEUDOMAP` is set.
+
+You can use any value as keys, and any value as data. Setting again
+with the identical key will overwrite the previous value.
+
+Internally, data is stored on an `Object.create(null)` style object.
+The key is coerced to a string to generate the key on the internal
+data-bag object. The original key used is stored along with the data.
+
+In the event of a stringified-key collision, a new key is generated by
+appending an increasing number to the stringified-key until finding
+either the intended key or an empty spot.
+
+Note that because object traversal order of plain objects is not
+guaranteed to be identical to insertion order, the insertion order
+guarantee of `Map.prototype.forEach` is not guaranteed in this
+implementation. However, in all versions of Node.js and V8 where this
+module works, `forEach` does traverse data in insertion order.
+
+## API
+
+Most of the [Map
+API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map),
+with the following exceptions:
+
+1. A `Map` object is not an iterator.
+2. `values`, `keys`, and `entries` methods are not implemented,
+ because they return iterators.
+3. The argument to the constructor can be an Array of `[key, value]`
+ pairs, or a `Map` or `PseudoMap` object. But, since iterators
+ aren't used, passing any plain-old iterator won't initialize the
+ map properly.
+
+## USAGE
+
+Use just like a regular ES6 Map.
+
+```javascript
+var PseudoMap = require('pseudomap')
+
+// optionally provide a pseudomap, or an array of [key,value] pairs
+// as the argument to initialize the map with
+var myMap = new PseudoMap()
+
+myMap.set(1, 'number 1')
+myMap.set('1', 'string 1')
+var akey = {}
+var bkey = {}
+myMap.set(akey, { some: 'data' })
+myMap.set(bkey, { some: 'other data' })
+```
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js
new file mode 100644
index 000000000..7db159946
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js
@@ -0,0 +1,9 @@
+if (process.env.npm_package_name === 'pseudomap' &&
+ process.env.npm_lifecycle_script === 'test')
+ process.env.TEST_PSEUDOMAP = 'true'
+
+if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) {
+ module.exports = Map
+} else {
+ module.exports = require('./pseudomap')
+}
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json
new file mode 100644
index 000000000..8e1129b8d
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json
@@ -0,0 +1,77 @@
+{
+ "_args": [
+ [
+ "pseudomap@^1.0.1",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache"
+ ]
+ ],
+ "_from": "pseudomap@>=1.0.1 <2.0.0",
+ "_id": "pseudomap@1.0.2",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/aws4/lru-cache/pseudomap",
+ "_nodeVersion": "4.0.0",
+ "_npmUser": {
+ "email": "i@izs.me",
+ "name": "isaacs"
+ },
+ "_npmVersion": "3.3.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "pseudomap",
+ "raw": "pseudomap@^1.0.1",
+ "rawSpec": "^1.0.1",
+ "scope": null,
+ "spec": ">=1.0.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/aws4/lru-cache"
+ ],
+ "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
+ "_shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3",
+ "_shrinkwrap": null,
+ "_spec": "pseudomap@^1.0.1",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache",
+ "author": {
+ "email": "i@izs.me",
+ "name": "Isaac Z. Schlueter",
+ "url": "http://blog.izs.me/"
+ },
+ "bugs": {
+ "url": "https://github.com/isaacs/pseudomap/issues"
+ },
+ "dependencies": {},
+ "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.",
+ "devDependencies": {
+ "tap": "^2.3.1"
+ },
+ "directories": {
+ "test": "test"
+ },
+ "dist": {
+ "shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3",
+ "tarball": "http://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz"
+ },
+ "gitHead": "b6dc728207a0321ede6479e34506d3e0e13a940b",
+ "homepage": "https://github.com/isaacs/pseudomap#readme",
+ "license": "ISC",
+ "main": "map.js",
+ "maintainers": [
+ {
+ "email": "i@izs.me",
+ "name": "isaacs"
+ }
+ ],
+ "name": "pseudomap",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/isaacs/pseudomap.git"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "version": "1.0.2"
+}
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js
new file mode 100644
index 000000000..25a21d829
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js
@@ -0,0 +1,113 @@
+var hasOwnProperty = Object.prototype.hasOwnProperty
+
+module.exports = PseudoMap
+
+function PseudoMap (set) {
+ if (!(this instanceof PseudoMap)) // whyyyyyyy
+ throw new TypeError("Constructor PseudoMap requires 'new'")
+
+ this.clear()
+
+ if (set) {
+ if ((set instanceof PseudoMap) ||
+ (typeof Map === 'function' && set instanceof Map))
+ set.forEach(function (value, key) {
+ this.set(key, value)
+ }, this)
+ else if (Array.isArray(set))
+ set.forEach(function (kv) {
+ this.set(kv[0], kv[1])
+ }, this)
+ else
+ throw new TypeError('invalid argument')
+ }
+}
+
+PseudoMap.prototype.forEach = function (fn, thisp) {
+ thisp = thisp || this
+ Object.keys(this._data).forEach(function (k) {
+ if (k !== 'size')
+ fn.call(thisp, this._data[k].value, this._data[k].key)
+ }, this)
+}
+
+PseudoMap.prototype.has = function (k) {
+ return !!find(this._data, k)
+}
+
+PseudoMap.prototype.get = function (k) {
+ var res = find(this._data, k)
+ return res && res.value
+}
+
+PseudoMap.prototype.set = function (k, v) {
+ set(this._data, k, v)
+}
+
+PseudoMap.prototype.delete = function (k) {
+ var res = find(this._data, k)
+ if (res) {
+ delete this._data[res._index]
+ this._data.size--
+ }
+}
+
+PseudoMap.prototype.clear = function () {
+ var data = Object.create(null)
+ data.size = 0
+
+ Object.defineProperty(this, '_data', {
+ value: data,
+ enumerable: false,
+ configurable: true,
+ writable: false
+ })
+}
+
+Object.defineProperty(PseudoMap.prototype, 'size', {
+ get: function () {
+ return this._data.size
+ },
+ set: function (n) {},
+ enumerable: true,
+ configurable: true
+})
+
+PseudoMap.prototype.values =
+PseudoMap.prototype.keys =
+PseudoMap.prototype.entries = function () {
+ throw new Error('iterators are not implemented in this version')
+}
+
+// Either identical, or both NaN
+function same (a, b) {
+ return a === b || a !== a && b !== b
+}
+
+function Entry (k, v, i) {
+ this.key = k
+ this.value = v
+ this._index = i
+}
+
+function find (data, k) {
+ for (var i = 0, s = '_' + k, key = s;
+ hasOwnProperty.call(data, key);
+ key = s + i++) {
+ if (same(data[key].key, k))
+ return data[key]
+ }
+}
+
+function set (data, k, v) {
+ for (var i = 0, s = '_' + k, key = s;
+ hasOwnProperty.call(data, key);
+ key = s + i++) {
+ if (same(data[key].key, k)) {
+ data[key].value = v
+ return
+ }
+ }
+ data.size++
+ data[key] = new Entry(k, v, key)
+}
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js
new file mode 100644
index 000000000..4378e4541
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js
@@ -0,0 +1,86 @@
+var t = require('tap')
+
+process.env.TEST_PSEUDOMAP = 'true'
+
+var PM = require('../')
+runTests(PM)
+
+// if possible, verify that Map also behaves the same way
+if (typeof Map === 'function')
+ runTests(Map)
+
+
+function runTests (Map) {
+ t.throws(Map)
+
+ var m = new Map()
+
+ t.equal(m.size, 0)
+
+ m.set(1, '1 string')
+ t.equal(m.get(1), '1 string')
+ t.equal(m.size, 1)
+ m.size = 1000
+ t.equal(m.size, 1)
+ m.size = 0
+ t.equal(m.size, 1)
+
+ m = new Map([[1, 'number 1'], ['1', 'string 1']])
+ t.equal(m.get(1), 'number 1')
+ t.equal(m.get('1'), 'string 1')
+ t.equal(m.size, 2)
+
+ m = new Map(m)
+ t.equal(m.get(1), 'number 1')
+ t.equal(m.get('1'), 'string 1')
+ t.equal(m.size, 2)
+
+ var akey = {}
+ var bkey = {}
+ m.set(akey, { some: 'data' })
+ m.set(bkey, { some: 'other data' })
+ t.same(m.get(akey), { some: 'data' })
+ t.same(m.get(bkey), { some: 'other data' })
+ t.equal(m.size, 4)
+
+ var x = /x/
+ var y = /x/
+ m.set(x, 'x regex')
+ m.set(y, 'y regex')
+ t.equal(m.get(x), 'x regex')
+ m.set(x, 'x again')
+ t.equal(m.get(x), 'x again')
+ t.equal(m.size, 6)
+
+ m.set(NaN, 'not a number')
+ t.equal(m.get(NaN), 'not a number')
+ m.set(NaN, 'it is a ' + typeof NaN)
+ t.equal(m.get(NaN), 'it is a number')
+ m.set('NaN', 'stringie nan')
+ t.equal(m.get(NaN), 'it is a number')
+ t.equal(m.get('NaN'), 'stringie nan')
+ t.equal(m.size, 8)
+
+ m.delete(NaN)
+ t.equal(m.get(NaN), undefined)
+ t.equal(m.size, 7)
+
+ var expect = [
+ { value: 'number 1', key: 1 },
+ { value: 'string 1', key: '1' },
+ { value: { some: 'data' }, key: {} },
+ { value: { some: 'other data' }, key: {} },
+ { value: 'x again', key: /x/ },
+ { value: 'y regex', key: /x/ },
+ { value: 'stringie nan', key: 'NaN' }
+ ]
+ var actual = []
+
+ m.forEach(function (value, key) {
+ actual.push({ value: value, key: key })
+ })
+ t.same(actual, expect)
+
+ m.clear()
+ t.equal(m.size, 0)
+}
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore
new file mode 100644
index 000000000..534108e3f
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore
@@ -0,0 +1,4 @@
+node_modules/
+coverage/
+.nyc_output/
+nyc_output/
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml
new file mode 100644
index 000000000..9c1a7b6cc
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml
@@ -0,0 +1,7 @@
+sudo: false
+language: node_js
+node_js:
+ - '0.10'
+ - '0.12'
+ - '4'
+ - '5'
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md
new file mode 100644
index 000000000..5f51e6f1e
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md
@@ -0,0 +1,4 @@
+1. The whole API is public. No underscore-prefixed pretend-private
+ things or hidden Object.create magic mumbo jumbo here. Plain old
+ objects that are created from constructors.
+2. 100% test coverage must be maintained.
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE
new file mode 100644
index 000000000..19129e315
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md
new file mode 100644
index 000000000..f58610186
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md
@@ -0,0 +1,204 @@
+# yallist
+
+Yet Another Linked List
+
+There are many doubly-linked list implementations like it, but this
+one is mine.
+
+For when an array would be too big, and a Map can't be iterated in
+reverse order.
+
+
+[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist)
+
+## basic usage
+
+```javascript
+var yallist = require('yallist')
+var myList = yallist.create([1, 2, 3])
+myList.push('foo')
+myList.unshift('bar')
+// of course pop() and shift() are there, too
+console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo']
+myList.forEach(function (k) {
+ // walk the list head to tail
+})
+myList.forEachReverse(function (k, index, list) {
+ // walk the list tail to head
+})
+var myDoubledList = myList.map(function (k) {
+ return k + k
+})
+// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo']
+// mapReverse is also a thing
+var myDoubledListReverse = myList.mapReverse(function (k) {
+ return k + k
+}) // ['foofoo', 6, 4, 2, 'barbar']
+
+var reduced = myList.reduce(function (set, entry) {
+ set += entry
+ return set
+}, 'start')
+console.log(reduced) // 'startfoo123bar'
+```
+
+## api
+
+The whole API is considered "public".
+
+Functions with the same name as an Array method work more or less the
+same way.
+
+There's reverse versions of most things because that's the point.
+
+### Yallist
+
+Default export, the class that holds and manages a list.
+
+Call it with either a forEach-able (like an array) or a set of
+arguments, to initialize the list.
+
+The Array-ish methods all act like you'd expect. No magic length,
+though, so if you change that it won't automatically prune or add
+empty spots.
+
+### Yallist.create(..)
+
+Alias for Yallist function. Some people like factories.
+
+#### yallist.head
+
+The first node in the list
+
+#### yallist.tail
+
+The last node in the list
+
+#### yallist.length
+
+The number of nodes in the list. (Change this at your peril. It is
+not magic like Array length.)
+
+#### yallist.toArray()
+
+Convert the list to an array.
+
+#### yallist.forEach(fn, [thisp])
+
+Call a function on each item in the list.
+
+#### yallist.forEachReverse(fn, [thisp])
+
+Call a function on each item in the list, in reverse order.
+
+#### yallist.get(n)
+
+Get the data at position `n` in the list. If you use this a lot,
+probably better off just using an Array.
+
+#### yallist.getReverse(n)
+
+Get the data at position `n`, counting from the tail.
+
+#### yallist.map(fn, thisp)
+
+Create a new Yallist with the result of calling the function on each
+item.
+
+#### yallist.mapReverse(fn, thisp)
+
+Same as `map`, but in reverse.
+
+#### yallist.pop()
+
+Get the data from the list tail, and remove the tail from the list.
+
+#### yallist.push(item, ...)
+
+Insert one or more items to the tail of the list.
+
+#### yallist.reduce(fn, initialValue)
+
+Like Array.reduce.
+
+#### yallist.reduceReverse
+
+Like Array.reduce, but in reverse.
+
+#### yallist.reverse
+
+Reverse the list in place.
+
+#### yallist.shift()
+
+Get the data from the list head, and remove the head from the list.
+
+#### yallist.slice([from], [to])
+
+Just like Array.slice, but returns a new Yallist.
+
+#### yallist.sliceReverse([from], [to])
+
+Just like yallist.slice, but the result is returned in reverse.
+
+#### yallist.toArray()
+
+Create an array representation of the list.
+
+#### yallist.toArrayReverse()
+
+Create a reversed array representation of the list.
+
+#### yallist.unshift(item, ...)
+
+Insert one or more items to the head of the list.
+
+#### yallist.unshiftNode(node)
+
+Move a Node object to the front of the list. (That is, pull it out of
+wherever it lives, and make it the new head.)
+
+If the node belongs to a different list, then that list will remove it
+first.
+
+#### yallist.pushNode(node)
+
+Move a Node object to the end of the list. (That is, pull it out of
+wherever it lives, and make it the new tail.)
+
+If the node belongs to a list already, then that list will remove it
+first.
+
+#### yallist.removeNode(node)
+
+Remove a node from the list, preserving referential integrity of head
+and tail and other nodes.
+
+Will throw an error if you try to have a list remove a node that
+doesn't belong to it.
+
+### Yallist.Node
+
+The class that holds the data and is actually the list.
+
+Call with `var n = new Node(value, previousNode, nextNode)`
+
+Note that if you do direct operations on Nodes themselves, it's very
+easy to get into weird states where the list is broken. Be careful :)
+
+#### node.next
+
+The next node in the list.
+
+#### node.prev
+
+The previous node in the list.
+
+#### node.value
+
+The data the node contains.
+
+#### node.list
+
+The list to which this node belongs. (Null if it does not belong to
+any list.)
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json
new file mode 100644
index 000000000..a1c290b52
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json
@@ -0,0 +1,77 @@
+{
+ "_args": [
+ [
+ "yallist@^2.0.0",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache"
+ ]
+ ],
+ "_from": "yallist@>=2.0.0 <3.0.0",
+ "_id": "yallist@2.0.0",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/aws4/lru-cache/yallist",
+ "_nodeVersion": "4.0.0",
+ "_npmUser": {
+ "email": "i@izs.me",
+ "name": "isaacs"
+ },
+ "_npmVersion": "3.3.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "yallist",
+ "raw": "yallist@^2.0.0",
+ "rawSpec": "^2.0.0",
+ "scope": null,
+ "spec": ">=2.0.0 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/aws4/lru-cache"
+ ],
+ "_resolved": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz",
+ "_shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4",
+ "_shrinkwrap": null,
+ "_spec": "yallist@^2.0.0",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache",
+ "author": {
+ "email": "i@izs.me",
+ "name": "Isaac Z. Schlueter",
+ "url": "http://blog.izs.me/"
+ },
+ "bugs": {
+ "url": "https://github.com/isaacs/yallist/issues"
+ },
+ "dependencies": {},
+ "description": "Yet Another Linked List",
+ "devDependencies": {
+ "tap": "^2.3.2"
+ },
+ "directories": {
+ "test": "test"
+ },
+ "dist": {
+ "shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4",
+ "tarball": "http://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz"
+ },
+ "gitHead": "702eaba87deefa9f8fc2f8e36cb225bc2141fdc3",
+ "homepage": "https://github.com/isaacs/yallist#readme",
+ "license": "ISC",
+ "main": "yallist.js",
+ "maintainers": [
+ {
+ "email": "i@izs.me",
+ "name": "isaacs"
+ }
+ ],
+ "name": "yallist",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/isaacs/yallist.git"
+ },
+ "scripts": {
+ "test": "tap test/*.js --cov"
+ },
+ "version": "2.0.0"
+}
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js
new file mode 100644
index 000000000..42a9eedca
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js
@@ -0,0 +1,188 @@
+var t = require('tap')
+var Yallist = require('../yallist.js')
+
+var y = new Yallist(1,2,3,4,5)
+var z = new Yallist([1,2,3,4,5])
+t.similar(y, z, 'build from single list or args')
+
+function add10 (i) {
+ return i + 10
+}
+t.similar(y.map(add10).toArray(), [11, 12, 13, 14, 15])
+t.similar(y.mapReverse(add10).toArray(), [15, 14, 13, 12, 11])
+
+t.similar(y.map(add10).toArrayReverse(), [15, 14, 13, 12, 11])
+t.isa(Yallist(1,2,3), 'Yallist')
+t.equal(y.push(6, 7, 8), 8)
+t.similar(y.toArray(), [1, 2, 3, 4, 5, 6, 7, 8])
+y.pop()
+y.shift()
+y.unshift(100)
+
+var expect = [100, 2, 3, 4, 5, 6, 7]
+var expectReverse = [ 7, 6, 5, 4, 3, 2, 100 ]
+
+t.similar(y.toArray(), expect)
+t.equal(y.length, y.toArray().length)
+
+t.test(function forEach (t) {
+ t.plan(y.length * 2)
+ y.forEach(function (item, i, list) {
+ t.equal(item, expect[i])
+ t.equal(list, y)
+ })
+})
+
+t.test(function forEach (t) {
+ t.plan(y.length * 5)
+ var n = 0
+ y.forEachReverse(function (item, i, list) {
+ t.equal(item, expectReverse[n])
+ t.equal(item, expect[i])
+ t.equal(item, y.get(i))
+ t.equal(item, y.getReverse(n))
+ n += 1
+ t.equal(list, y)
+ })
+})
+
+t.equal(y.getReverse(100), undefined)
+
+t.equal(y.get(9999), undefined)
+
+
+function sum (a, b) { return a + b }
+t.equal(y.reduce(sum), 127)
+t.equal(y.reduce(sum, 100), 227)
+t.equal(y.reduceReverse(sum), 127)
+t.equal(y.reduceReverse(sum, 100), 227)
+
+t.equal(Yallist().pop(), undefined)
+t.equal(Yallist().shift(), undefined)
+
+var x = Yallist()
+x.unshift(1)
+t.equal(x.length, 1)
+t.similar(x.toArray(), [1])
+
+// verify that y.toArray() returns an array and if we create a
+// new Yallist from that array, we get a list matching
+t.similar(Yallist(y.toArray()), y)
+t.similar(Yallist.apply(null, y.toArray()), y)
+
+t.throws(function () {
+ new Yallist().reduce(function () {})
+}, {}, new TypeError('Reduce of empty list with no initial value'))
+t.throws(function () {
+ new Yallist().reduceReverse(function () {})
+}, {}, new TypeError('Reduce of empty list with no initial value'))
+
+var z = y.reverse()
+t.equal(z, y)
+t.similar(y.toArray(), expectReverse)
+y.reverse()
+t.similar(y.toArray(), expect)
+
+var a = Yallist(1,2,3,4,5,6)
+var cases = [
+ [ [2, 4], [3, 4] ],
+ [ [2, -4], [] ],
+ [ [2, -2], [3, 4] ],
+ [ [1, -2], [2, 3, 4] ],
+ [ [-1, -2], [] ],
+ [ [-5, -2], [2, 3, 4] ],
+ [ [-99, 2], [1, 2] ],
+ [ [5, 99], [6] ],
+ [ [], [1,2,3,4,5,6] ]
+]
+t.test('slice', function (t) {
+ t.plan(cases.length)
+ cases.forEach(function (c) {
+ t.test(JSON.stringify(c), function (t) {
+ t.similar(a.slice.apply(a, c[0]), Yallist(c[1]))
+ t.similar([].slice.apply(a.toArray(), c[0]), c[1])
+ t.end()
+ })
+ })
+})
+
+t.test('sliceReverse', function (t) {
+ t.plan(cases.length)
+ cases.forEach(function (c) {
+ var rev = c[1].slice().reverse()
+ t.test(JSON.stringify([c[0], rev]), function (t) {
+ t.similar(a.sliceReverse.apply(a, c[0]), Yallist(rev))
+ t.similar([].slice.apply(a.toArray(), c[0]).reverse(), rev)
+ t.end()
+ })
+ })
+})
+
+var inserter = Yallist(1,2,3,4,5)
+inserter.unshiftNode(inserter.head.next)
+t.similar(inserter.toArray(), [2,1,3,4,5])
+inserter.unshiftNode(inserter.tail)
+t.similar(inserter.toArray(), [5,2,1,3,4])
+inserter.unshiftNode(inserter.head)
+t.similar(inserter.toArray(), [5,2,1,3,4])
+
+var single = Yallist(1)
+single.unshiftNode(single.head)
+t.similar(single.toArray(), [1])
+
+inserter = Yallist(1,2,3,4,5)
+inserter.pushNode(inserter.tail.prev)
+t.similar(inserter.toArray(), [1,2,3,5,4])
+inserter.pushNode(inserter.head)
+t.similar(inserter.toArray(), [2,3,5,4,1])
+inserter.unshiftNode(inserter.head)
+t.similar(inserter.toArray(), [2,3,5,4,1])
+
+single = Yallist(1)
+single.pushNode(single.tail)
+t.similar(single.toArray(), [1])
+
+var swiped = Yallist(9,8,7)
+inserter.unshiftNode(swiped.head.next)
+t.similar(inserter.toArray(), [8,2,3,5,4,1])
+t.similar(swiped.toArray(), [9,7])
+
+swiped = Yallist(9,8,7)
+inserter.pushNode(swiped.head.next)
+t.similar(inserter.toArray(), [8,2,3,5,4,1,8])
+t.similar(swiped.toArray(), [9,7])
+
+swiped.unshiftNode(Yallist.Node(99))
+t.similar(swiped.toArray(), [99,9,7])
+swiped.pushNode(Yallist.Node(66))
+t.similar(swiped.toArray(), [99,9,7,66])
+
+var e = Yallist()
+e.unshiftNode(Yallist.Node(1))
+t.same(e.toArray(), [1])
+e = Yallist()
+e.pushNode(Yallist.Node(1))
+t.same(e.toArray(), [1])
+
+// steal them back, don't break the lists
+swiped.unshiftNode(inserter.head)
+t.same(swiped, Yallist(8,99,9,7,66))
+t.same(inserter, Yallist(2,3,5,4,1,8))
+swiped.unshiftNode(inserter.tail)
+t.same(inserter, Yallist(2,3,5,4,1))
+t.same(swiped, Yallist(8,8,99,9,7,66))
+
+
+t.throws(function remove_foreign_node () {
+ e.removeNode(swiped.head)
+}, {}, new Error('removing node which does not belong to this list'))
+t.throws(function remove_unlisted_node () {
+ e.removeNode(Yallist.Node('nope'))
+}, {}, new Error('removing node which does not belong to this list'))
+
+e = Yallist(1,2)
+e.removeNode(e.head)
+t.same(e, Yallist(2))
+e = Yallist(1,2)
+e.removeNode(e.tail)
+t.same(e, Yallist(1))
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js
new file mode 100644
index 000000000..fb60fc287
--- /dev/null
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js
@@ -0,0 +1,360 @@
+module.exports = Yallist
+
+Yallist.Node = Node
+Yallist.create = Yallist
+
+function Yallist (list) {
+ var self = this
+ if (!(self instanceof Yallist)) {
+ self = new Yallist()
+ }
+
+ self.tail = null
+ self.head = null
+ self.length = 0
+
+ if (list && typeof list.forEach === 'function') {
+ list.forEach(function (item) {
+ self.push(item)
+ })
+ } else if (arguments.length > 0) {
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ self.push(arguments[i])
+ }
+ }
+
+ return self
+}
+
+Yallist.prototype.removeNode = function (node) {
+ if (node.list !== this) {
+ throw new Error('removing node which does not belong to this list')
+ }
+
+ var next = node.next
+ var prev = node.prev
+
+ if (next) {
+ next.prev = prev
+ }
+
+ if (prev) {
+ prev.next = next
+ }
+
+ if (node === this.head) {
+ this.head = next
+ }
+ if (node === this.tail) {
+ this.tail = prev
+ }
+
+ node.list.length --
+ node.next = null
+ node.prev = null
+ node.list = null
+}
+
+Yallist.prototype.unshiftNode = function (node) {
+ if (node === this.head) {
+ return
+ }
+
+ if (node.list) {
+ node.list.removeNode(node)
+ }
+
+ var head = this.head
+ node.list = this
+ node.next = head
+ if (head) {
+ head.prev = node
+ }
+
+ this.head = node
+ if (!this.tail) {
+ this.tail = node
+ }
+ this.length ++
+}
+
+Yallist.prototype.pushNode = function (node) {
+ if (node === this.tail) {
+ return
+ }
+
+ if (node.list) {
+ node.list.removeNode(node)
+ }
+
+ var tail = this.tail
+ node.list = this
+ node.prev = tail
+ if (tail) {
+ tail.next = node
+ }
+
+ this.tail = node
+ if (!this.head) {
+ this.head = node
+ }
+ this.length ++
+}
+
+Yallist.prototype.push = function () {
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ push(this, arguments[i])
+ }
+ return this.length
+}
+
+Yallist.prototype.unshift = function () {
+ for (var i = 0, l = arguments.length; i < l; i++) {
+ unshift(this, arguments[i])
+ }
+ return this.length
+}
+
+Yallist.prototype.pop = function () {
+ if (!this.tail)
+ return undefined
+
+ var res = this.tail.value
+ this.tail = this.tail.prev
+ this.tail.next = null
+ this.length --
+ return res
+}
+
+Yallist.prototype.shift = function () {
+ if (!this.head)
+ return undefined
+
+ var res = this.head.value
+ this.head = this.head.next
+ this.head.prev = null
+ this.length --
+ return res
+}
+
+Yallist.prototype.forEach = function (fn, thisp) {
+ thisp = thisp || this
+ for (var walker = this.head, i = 0; walker !== null; i++) {
+ fn.call(thisp, walker.value, i, this)
+ walker = walker.next
+ }
+}
+
+Yallist.prototype.forEachReverse = function (fn, thisp) {
+ thisp = thisp || this
+ for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
+ fn.call(thisp, walker.value, i, this)
+ walker = walker.prev
+ }
+}
+
+Yallist.prototype.get = function (n) {
+ for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
+ // abort out of the list early if we hit a cycle
+ walker = walker.next
+ }
+ if (i === n && walker !== null) {
+ return walker.value
+ }
+}
+
+Yallist.prototype.getReverse = function (n) {
+ for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
+ // abort out of the list early if we hit a cycle
+ walker = walker.prev
+ }
+ if (i === n && walker !== null) {
+ return walker.value
+ }
+}
+
+Yallist.prototype.map = function (fn, thisp) {
+ thisp = thisp || this
+ var res = new Yallist()
+ for (var walker = this.head; walker !== null; ) {
+ res.push(fn.call(thisp, walker.value, this))
+ walker = walker.next
+ }
+ return res
+}
+
+Yallist.prototype.mapReverse = function (fn, thisp) {
+ thisp = thisp || this
+ var res = new Yallist()
+ for (var walker = this.tail; walker !== null;) {
+ res.push(fn.call(thisp, walker.value, this))
+ walker = walker.prev
+ }
+ return res
+}
+
+Yallist.prototype.reduce = function (fn, initial) {
+ var acc
+ var walker = this.head
+ if (arguments.length > 1) {
+ acc = initial
+ } else if (this.head) {
+ walker = this.head.next
+ acc = this.head.value
+ } else {
+ throw new TypeError('Reduce of empty list with no initial value')
+ }
+
+ for (var i = 0; walker !== null; i++) {
+ acc = fn(acc, walker.value, i)
+ walker = walker.next
+ }
+
+ return acc
+}
+
+Yallist.prototype.reduceReverse = function (fn, initial) {
+ var acc
+ var walker = this.tail
+ if (arguments.length > 1) {
+ acc = initial
+ } else if (this.tail) {
+ walker = this.tail.prev
+ acc = this.tail.value
+ } else {
+ throw new TypeError('Reduce of empty list with no initial value')
+ }
+
+ for (var i = this.length - 1; walker !== null; i--) {
+ acc = fn(acc, walker.value, i)
+ walker = walker.prev
+ }
+
+ return acc
+}
+
+Yallist.prototype.toArray = function () {
+ var arr = new Array(this.length)
+ for (var i = 0, walker = this.head; walker !== null; i++) {
+ arr[i] = walker.value
+ walker = walker.next
+ }
+ return arr
+}
+
+Yallist.prototype.toArrayReverse = function () {
+ var arr = new Array(this.length)
+ for (var i = 0, walker = this.tail; walker !== null; i++) {
+ arr[i] = walker.value
+ walker = walker.prev
+ }
+ return arr
+}
+
+Yallist.prototype.slice = function (from, to) {
+ to = to || this.length
+ if (to < 0) {
+ to += this.length
+ }
+ from = from || 0
+ if (from < 0) {
+ from += this.length
+ }
+ var ret = new Yallist()
+ if (to < from || to < 0) {
+ return ret
+ }
+ if (from < 0) {
+ from = 0
+ }
+ if (to > this.length) {
+ to = this.length
+ }
+ for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
+ walker = walker.next
+ }
+ for (; walker !== null && i < to; i++, walker = walker.next) {
+ ret.push(walker.value)
+ }
+ return ret
+}
+
+Yallist.prototype.sliceReverse = function (from, to) {
+ to = to || this.length
+ if (to < 0) {
+ to += this.length
+ }
+ from = from || 0
+ if (from < 0) {
+ from += this.length
+ }
+ var ret = new Yallist()
+ if (to < from || to < 0) {
+ return ret
+ }
+ if (from < 0) {
+ from = 0
+ }
+ if (to > this.length) {
+ to = this.length
+ }
+ for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
+ walker = walker.prev
+ }
+ for (; walker !== null && i > from; i--, walker = walker.prev) {
+ ret.push(walker.value)
+ }
+ return ret
+}
+
+Yallist.prototype.reverse = function () {
+ var head = this.head
+ var tail = this.tail
+ for (var walker = head; walker !== null; walker = walker.prev) {
+ var p = walker.prev
+ walker.prev = walker.next
+ walker.next = p
+ }
+ this.head = tail
+ this.tail = head
+ return this
+}
+
+function push (self, item) {
+ self.tail = new Node(item, self.tail, null, self)
+ if (!self.head) {
+ self.head = self.tail
+ }
+ self.length ++
+}
+
+function unshift (self, item) {
+ self.head = new Node(item, null, self.head, self)
+ if (!self.tail) {
+ self.tail = self.head
+ }
+ self.length ++
+}
+
+function Node (value, prev, next, list) {
+ if (!(this instanceof Node)) {
+ return new Node(value, prev, next, list)
+ }
+
+ this.list = list
+ this.value = value
+
+ if (prev) {
+ prev.next = this
+ this.prev = prev
+ } else {
+ this.prev = null
+ }
+
+ if (next) {
+ next.prev = this
+ this.next = next
+ } else {
+ this.next = null
+ }
+}
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json b/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json
index 501c3e735..fafc088e7 100644
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json
+++ b/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json
@@ -1,37 +1,41 @@
{
"_args": [
[
- "lru-cache@^2.6.5",
+ "lru-cache@^4.0.0",
"/Users/rebecca/code/npm/node_modules/request/node_modules/aws4"
]
],
- "_from": "lru-cache@>=2.6.5 <3.0.0",
- "_id": "lru-cache@2.7.3",
+ "_from": "lru-cache@>=4.0.0 <5.0.0",
+ "_id": "lru-cache@4.0.1",
"_inCache": true,
"_installable": true,
"_location": "/request/aws4/lru-cache",
- "_nodeVersion": "4.0.0",
+ "_nodeVersion": "5.6.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/lru-cache-4.0.1.tgz_1458667372415_0.8005518841091543"
+ },
"_npmUser": {
"email": "i@izs.me",
"name": "isaacs"
},
- "_npmVersion": "3.3.2",
+ "_npmVersion": "3.7.3",
"_phantomChildren": {},
"_requested": {
"name": "lru-cache",
- "raw": "lru-cache@^2.6.5",
- "rawSpec": "^2.6.5",
+ "raw": "lru-cache@^4.0.0",
+ "rawSpec": "^4.0.0",
"scope": null,
- "spec": ">=2.6.5 <3.0.0",
+ "spec": ">=4.0.0 <5.0.0",
"type": "range"
},
"_requiredBy": [
"/request/aws4"
],
- "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
- "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
+ "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz",
+ "_shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be",
"_shrinkwrap": null,
- "_spec": "lru-cache@^2.6.5",
+ "_spec": "lru-cache@^4.0.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4",
"author": {
"email": "i@izs.me",
@@ -40,34 +44,40 @@
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
- "dependencies": {},
+ "dependencies": {
+ "pseudomap": "^1.0.1",
+ "yallist": "^2.0.0"
+ },
"description": "A cache object that deletes the least-recently-used items.",
"devDependencies": {
- "tap": "^1.2.0",
- "weak": ""
+ "standard": "^5.4.1",
+ "tap": "^5.1.1"
},
"directories": {},
"dist": {
- "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
- "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
+ "shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be",
+ "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz"
},
- "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714",
+ "files": [
+ "lib/lru-cache.js"
+ ],
+ "gitHead": "6cd8c8a43cf56c585bdb696faae94f9836cb9e28",
"homepage": "https://github.com/isaacs/node-lru-cache#readme",
"keywords": [
- "cache",
+ "mru",
"lru",
- "mru"
+ "cache"
],
"license": "ISC",
"main": "lib/lru-cache.js",
"maintainers": [
{
- "name": "isaacs",
- "email": "isaacs@npmjs.com"
+ "email": "isaacs@npmjs.com",
+ "name": "isaacs"
},
{
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
+ "email": "ogd@aoaioxxysz.net",
+ "name": "othiym23"
}
],
"name": "lru-cache",
@@ -78,7 +88,8 @@
"url": "git://github.com/isaacs/node-lru-cache.git"
},
"scripts": {
- "test": "tap test --gc"
+ "posttest": "standard test/*.js lib/*.js",
+ "test": "tap test --branches=100 --functions=100 --lines=100 --statements=100"
},
- "version": "2.7.3"
+ "version": "4.0.1"
}
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js
deleted file mode 100644
index b47225f10..000000000
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js
+++ /dev/null
@@ -1,396 +0,0 @@
-var test = require("tap").test
- , LRU = require("../")
-
-test("basic", function (t) {
- var cache = new LRU({max: 10})
- cache.set("key", "value")
- t.equal(cache.get("key"), "value")
- t.equal(cache.get("nada"), undefined)
- t.equal(cache.length, 1)
- t.equal(cache.max, 10)
- t.end()
-})
-
-test("least recently set", function (t) {
- var cache = new LRU(2)
- cache.set("a", "A")
- cache.set("b", "B")
- cache.set("c", "C")
- t.equal(cache.get("c"), "C")
- t.equal(cache.get("b"), "B")
- t.equal(cache.get("a"), undefined)
- t.end()
-})
-
-test("lru recently gotten", function (t) {
- var cache = new LRU(2)
- cache.set("a", "A")
- cache.set("b", "B")
- cache.get("a")
- cache.set("c", "C")
- t.equal(cache.get("c"), "C")
- t.equal(cache.get("b"), undefined)
- t.equal(cache.get("a"), "A")
- t.end()
-})
-
-test("del", function (t) {
- var cache = new LRU(2)
- cache.set("a", "A")
- cache.del("a")
- t.equal(cache.get("a"), undefined)
- t.end()
-})
-
-test("max", function (t) {
- var cache = new LRU(3)
-
- // test changing the max, verify that the LRU items get dropped.
- cache.max = 100
- for (var i = 0; i < 100; i ++) cache.set(i, i)
- t.equal(cache.length, 100)
- for (var i = 0; i < 100; i ++) {
- t.equal(cache.get(i), i)
- }
- cache.max = 3
- t.equal(cache.length, 3)
- for (var i = 0; i < 97; i ++) {
- t.equal(cache.get(i), undefined)
- }
- for (var i = 98; i < 100; i ++) {
- t.equal(cache.get(i), i)
- }
-
- // now remove the max restriction, and try again.
- cache.max = "hello"
- for (var i = 0; i < 100; i ++) cache.set(i, i)
- t.equal(cache.length, 100)
- for (var i = 0; i < 100; i ++) {
- t.equal(cache.get(i), i)
- }
- // should trigger an immediate resize
- cache.max = 3
- t.equal(cache.length, 3)
- for (var i = 0; i < 97; i ++) {
- t.equal(cache.get(i), undefined)
- }
- for (var i = 98; i < 100; i ++) {
- t.equal(cache.get(i), i)
- }
- t.end()
-})
-
-test("reset", function (t) {
- var cache = new LRU(10)
- cache.set("a", "A")
- cache.set("b", "B")
- cache.reset()
- t.equal(cache.length, 0)
- t.equal(cache.max, 10)
- t.equal(cache.get("a"), undefined)
- t.equal(cache.get("b"), undefined)
- t.end()
-})
-
-
-test("basic with weighed length", function (t) {
- var cache = new LRU({
- max: 100,
- length: function (item) { return item.size }
- })
- cache.set("key", {val: "value", size: 50})
- t.equal(cache.get("key").val, "value")
- t.equal(cache.get("nada"), undefined)
- t.equal(cache.lengthCalculator(cache.get("key")), 50)
- t.equal(cache.length, 50)
- t.equal(cache.max, 100)
- t.end()
-})
-
-
-test("weighed length item too large", function (t) {
- var cache = new LRU({
- max: 10,
- length: function (item) { return item.size }
- })
- t.equal(cache.max, 10)
-
- // should fall out immediately
- cache.set("key", {val: "value", size: 50})
-
- t.equal(cache.length, 0)
- t.equal(cache.get("key"), undefined)
- t.end()
-})
-
-test("least recently set with weighed length", function (t) {
- var cache = new LRU({
- max:8,
- length: function (item) { return item.length }
- })
- cache.set("a", "A")
- cache.set("b", "BB")
- cache.set("c", "CCC")
- cache.set("d", "DDDD")
- t.equal(cache.get("d"), "DDDD")
- t.equal(cache.get("c"), "CCC")
- t.equal(cache.get("b"), undefined)
- t.equal(cache.get("a"), undefined)
- t.end()
-})
-
-test("lru recently gotten with weighed length", function (t) {
- var cache = new LRU({
- max: 8,
- length: function (item) { return item.length }
- })
- cache.set("a", "A")
- cache.set("b", "BB")
- cache.set("c", "CCC")
- cache.get("a")
- cache.get("b")
- cache.set("d", "DDDD")
- t.equal(cache.get("c"), undefined)
- t.equal(cache.get("d"), "DDDD")
- t.equal(cache.get("b"), "BB")
- t.equal(cache.get("a"), "A")
- t.end()
-})
-
-test("lru recently updated with weighed length", function (t) {
- var cache = new LRU({
- max: 8,
- length: function (item) { return item.length }
- })
- cache.set("a", "A")
- cache.set("b", "BB")
- cache.set("c", "CCC")
- t.equal(cache.length, 6) //CCC BB A
- cache.set("a", "+A")
- t.equal(cache.length, 7) //+A CCC BB
- cache.set("b", "++BB")
- t.equal(cache.length, 6) //++BB +A
- t.equal(cache.get("c"), undefined)
-
- cache.set("c", "oversized")
- t.equal(cache.length, 6) //++BB +A
- t.equal(cache.get("c"), undefined)
-
- cache.set("a", "oversized")
- t.equal(cache.length, 4) //++BB
- t.equal(cache.get("a"), undefined)
- t.equal(cache.get("b"), "++BB")
- t.end()
-})
-
-test("set returns proper booleans", function(t) {
- var cache = new LRU({
- max: 5,
- length: function (item) { return item.length }
- })
-
- t.equal(cache.set("a", "A"), true)
-
- // should return false for max exceeded
- t.equal(cache.set("b", "donuts"), false)
-
- t.equal(cache.set("b", "B"), true)
- t.equal(cache.set("c", "CCCC"), true)
- t.end()
-})
-
-test("drop the old items", function(t) {
- var cache = new LRU({
- max: 5,
- maxAge: 50
- })
-
- cache.set("a", "A")
-
- setTimeout(function () {
- cache.set("b", "b")
- t.equal(cache.get("a"), "A")
- }, 25)
-
- setTimeout(function () {
- cache.set("c", "C")
- // timed out
- t.notOk(cache.get("a"))
- }, 60 + 25)
-
- setTimeout(function () {
- t.notOk(cache.get("b"))
- t.equal(cache.get("c"), "C")
- }, 90)
-
- setTimeout(function () {
- t.notOk(cache.get("c"))
- t.end()
- }, 155)
-})
-
-test("individual item can have it's own maxAge", function(t) {
- var cache = new LRU({
- max: 5,
- maxAge: 50
- })
-
- cache.set("a", "A", 20)
- setTimeout(function () {
- t.notOk(cache.get("a"))
- t.end()
- }, 25)
-})
-
-test("individual item can have it's own maxAge > cache's", function(t) {
- var cache = new LRU({
- max: 5,
- maxAge: 20
- })
-
- cache.set("a", "A", 50)
- setTimeout(function () {
- t.equal(cache.get("a"), "A")
- t.end()
- }, 25)
-})
-
-test("disposal function", function(t) {
- var disposed = false
- var cache = new LRU({
- max: 1,
- dispose: function (k, n) {
- disposed = n
- }
- })
-
- cache.set(1, 1)
- cache.set(2, 2)
- t.equal(disposed, 1)
- cache.set(3, 3)
- t.equal(disposed, 2)
- cache.reset()
- t.equal(disposed, 3)
- t.end()
-})
-
-test("disposal function on too big of item", function(t) {
- var disposed = false
- var cache = new LRU({
- max: 1,
- length: function (k) {
- return k.length
- },
- dispose: function (k, n) {
- disposed = n
- }
- })
- var obj = [ 1, 2 ]
-
- t.equal(disposed, false)
- cache.set("obj", obj)
- t.equal(disposed, obj)
- t.end()
-})
-
-test("has()", function(t) {
- var cache = new LRU({
- max: 1,
- maxAge: 10
- })
-
- cache.set('foo', 'bar')
- t.equal(cache.has('foo'), true)
- cache.set('blu', 'baz')
- t.equal(cache.has('foo'), false)
- t.equal(cache.has('blu'), true)
- setTimeout(function() {
- t.equal(cache.has('blu'), false)
- t.end()
- }, 15)
-})
-
-test("stale", function(t) {
- var cache = new LRU({
- maxAge: 10,
- stale: true
- })
-
- cache.set('foo', 'bar')
- t.equal(cache.get('foo'), 'bar')
- t.equal(cache.has('foo'), true)
- setTimeout(function() {
- t.equal(cache.has('foo'), false)
- t.equal(cache.get('foo'), 'bar')
- t.equal(cache.get('foo'), undefined)
- t.end()
- }, 15)
-})
-
-test("lru update via set", function(t) {
- var cache = LRU({ max: 2 });
-
- cache.set('foo', 1);
- cache.set('bar', 2);
- cache.del('bar');
- cache.set('baz', 3);
- cache.set('qux', 4);
-
- t.equal(cache.get('foo'), undefined)
- t.equal(cache.get('bar'), undefined)
- t.equal(cache.get('baz'), 3)
- t.equal(cache.get('qux'), 4)
- t.end()
-})
-
-test("least recently set w/ peek", function (t) {
- var cache = new LRU(2)
- cache.set("a", "A")
- cache.set("b", "B")
- t.equal(cache.peek("a"), "A")
- cache.set("c", "C")
- t.equal(cache.get("c"), "C")
- t.equal(cache.get("b"), "B")
- t.equal(cache.get("a"), undefined)
- t.end()
-})
-
-test("pop the least used item", function (t) {
- var cache = new LRU(3)
- , last
-
- cache.set("a", "A")
- cache.set("b", "B")
- cache.set("c", "C")
-
- t.equal(cache.length, 3)
- t.equal(cache.max, 3)
-
- // Ensure we pop a, c, b
- cache.get("b", "B")
-
- last = cache.pop()
- t.equal(last.key, "a")
- t.equal(last.value, "A")
- t.equal(cache.length, 2)
- t.equal(cache.max, 3)
-
- last = cache.pop()
- t.equal(last.key, "c")
- t.equal(last.value, "C")
- t.equal(cache.length, 1)
- t.equal(cache.max, 3)
-
- last = cache.pop()
- t.equal(last.key, "b")
- t.equal(last.value, "B")
- t.equal(cache.length, 0)
- t.equal(cache.max, 3)
-
- last = cache.pop()
- t.equal(last, null)
- t.equal(cache.length, 0)
- t.equal(cache.max, 3)
-
- t.end()
-})
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js
deleted file mode 100644
index 4190417cb..000000000
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js
+++ /dev/null
@@ -1,120 +0,0 @@
-var test = require('tap').test
-var LRU = require('../')
-
-test('forEach', function (t) {
- var l = new LRU(5)
- for (var i = 0; i < 10; i ++) {
- l.set(i.toString(), i.toString(2))
- }
-
- var i = 9
- l.forEach(function (val, key, cache) {
- t.equal(cache, l)
- t.equal(key, i.toString())
- t.equal(val, i.toString(2))
- i -= 1
- })
-
- // get in order of most recently used
- l.get(6)
- l.get(8)
-
- var order = [ 8, 6, 9, 7, 5 ]
- var i = 0
-
- l.forEach(function (val, key, cache) {
- var j = order[i ++]
- t.equal(cache, l)
- t.equal(key, j.toString())
- t.equal(val, j.toString(2))
- })
- t.equal(i, order.length);
-
- t.end()
-})
-
-test('keys() and values()', function (t) {
- var l = new LRU(5)
- for (var i = 0; i < 10; i ++) {
- l.set(i.toString(), i.toString(2))
- }
-
- t.similar(l.keys(), ['9', '8', '7', '6', '5'])
- t.similar(l.values(), ['1001', '1000', '111', '110', '101'])
-
- // get in order of most recently used
- l.get(6)
- l.get(8)
-
- t.similar(l.keys(), ['8', '6', '9', '7', '5'])
- t.similar(l.values(), ['1000', '110', '1001', '111', '101'])
-
- t.end()
-})
-
-test('all entries are iterated over', function(t) {
- var l = new LRU(5)
- for (var i = 0; i < 10; i ++) {
- l.set(i.toString(), i.toString(2))
- }
-
- var i = 0
- l.forEach(function (val, key, cache) {
- if (i > 0) {
- cache.del(key)
- }
- i += 1
- })
-
- t.equal(i, 5)
- t.equal(l.keys().length, 1)
-
- t.end()
-})
-
-test('all stale entries are removed', function(t) {
- var l = new LRU({ max: 5, maxAge: -5, stale: true })
- for (var i = 0; i < 10; i ++) {
- l.set(i.toString(), i.toString(2))
- }
-
- var i = 0
- l.forEach(function () {
- i += 1
- })
-
- t.equal(i, 5)
- t.equal(l.keys().length, 0)
-
- t.end()
-})
-
-test('expires', function (t) {
- var l = new LRU({
- max: 10,
- maxAge: 50
- })
- for (var i = 0; i < 10; i++) {
- l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined))
- }
-
- var i = 0
- var order = [ 8, 6, 4, 2, 0 ]
- setTimeout(function () {
- l.forEach(function (val, key, cache) {
- var j = order[i++]
- t.equal(cache, l)
- t.equal(key, j.toString())
- t.equal(val, j.toString(2))
- })
- t.equal(i, order.length);
-
- setTimeout(function () {
- var count = 0;
- l.forEach(function (val, key, cache) { count++; })
- t.equal(0, count);
- t.end()
- }, 25)
-
- }, 26)
-})
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js
deleted file mode 100644
index b5912f6f1..000000000
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env node --expose_gc
-
-
-var weak = require('weak');
-var test = require('tap').test
-var LRU = require('../')
-var l = new LRU({ max: 10 })
-var refs = 0
-function X() {
- refs ++
- weak(this, deref)
-}
-
-function deref() {
- refs --
-}
-
-test('no leaks', function (t) {
- // fill up the cache
- for (var i = 0; i < 100; i++) {
- l.set(i, new X);
- // throw some gets in there, too.
- if (i % 2 === 0)
- l.get(i / 2)
- }
-
- gc()
-
- var start = process.memoryUsage()
-
- // capture the memory
- var startRefs = refs
-
- // do it again, but more
- for (var i = 0; i < 10000; i++) {
- l.set(i, new X);
- // throw some gets in there, too.
- if (i % 2 === 0)
- l.get(i / 2)
- }
-
- gc()
-
- var end = process.memoryUsage()
- t.equal(refs, startRefs, 'no leaky refs')
-
- console.error('start: %j\n' +
- 'end: %j', start, end);
- t.pass();
- t.end();
-})
diff --git a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js b/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js
deleted file mode 100644
index 1094194a0..000000000
--- a/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js
+++ /dev/null
@@ -1,216 +0,0 @@
-var test = require('tap').test
-var LRU = require('../')
-
-test('dump', function (t) {
- var cache = new LRU()
-
- t.equal(cache.dump().length, 0, "nothing in dump for empty cache")
-
- cache.set("a", "A")
- cache.set("b", "B")
- t.deepEqual(cache.dump(), [
- { k: "b", v: "B", e: 0 },
- { k: "a", v: "A", e: 0 }
- ])
-
- cache.set("a", "A");
- t.deepEqual(cache.dump(), [
- { k: "a", v: "A", e: 0 },
- { k: "b", v: "B", e: 0 }
- ])
-
- cache.get("b");
- t.deepEqual(cache.dump(), [
- { k: "b", v: "B", e: 0 },
- { k: "a", v: "A", e: 0 }
- ])
-
- cache.del("a");
- t.deepEqual(cache.dump(), [
- { k: "b", v: "B", e: 0 }
- ])
-
- t.end()
-})
-
-test("do not dump stale items", function(t) {
- var cache = new LRU({
- max: 5,
- maxAge: 50
- })
-
- //expires at 50
- cache.set("a", "A")
-
- setTimeout(function () {
- //expires at 75
- cache.set("b", "B")
- var s = cache.dump()
- t.equal(s.length, 2)
- t.equal(s[0].k, "b")
- t.equal(s[1].k, "a")
- }, 25)
-
- setTimeout(function () {
- //expires at 110
- cache.set("c", "C")
- var s = cache.dump()
- t.equal(s.length, 2)
- t.equal(s[0].k, "c")
- t.equal(s[1].k, "b")
- }, 60)
-
- setTimeout(function () {
- //expires at 130
- cache.set("d", "D", 40)
- var s = cache.dump()
- t.equal(s.length, 2)
- t.equal(s[0].k, "d")
- t.equal(s[1].k, "c")
- }, 90)
-
- setTimeout(function () {
- var s = cache.dump()
- t.equal(s.length, 1)
- t.equal(s[0].k, "d")
- }, 120)
-
- setTimeout(function () {
- var s = cache.dump()
- t.deepEqual(s, [])
- t.end()
- }, 155)
-})
-
-test("load basic cache", function(t) {
- var cache = new LRU(),
- copy = new LRU()
-
- cache.set("a", "A")
- cache.set("b", "B")
-
- copy.load(cache.dump())
- t.deepEquals(cache.dump(), copy.dump())
-
- t.end()
-})
-
-
-test("load staled cache", function(t) {
- var cache = new LRU({maxAge: 50}),
- copy = new LRU({maxAge: 50}),
- arr
-
- //expires at 50
- cache.set("a", "A")
- setTimeout(function () {
- //expires at 80
- cache.set("b", "B")
- arr = cache.dump()
- t.equal(arr.length, 2)
- }, 30)
-
- setTimeout(function () {
- copy.load(arr)
- t.equal(copy.get("a"), undefined)
- t.equal(copy.get("b"), "B")
- }, 60)
-
- setTimeout(function () {
- t.equal(copy.get("b"), undefined)
- t.end()
- }, 90)
-})
-
-test("load to other size cache", function(t) {
- var cache = new LRU({max: 2}),
- copy = new LRU({max: 1})
-
- cache.set("a", "A")
- cache.set("b", "B")
-
- copy.load(cache.dump())
- t.equal(copy.get("a"), undefined)
- t.equal(copy.get("b"), "B")
-
- //update the last read from original cache
- cache.get("a")
- copy.load(cache.dump())
- t.equal(copy.get("a"), "A")
- t.equal(copy.get("b"), undefined)
-
- t.end()
-})
-
-
-test("load to other age cache", function(t) {
- var cache = new LRU({maxAge: 50}),
- aged = new LRU({maxAge: 100}),
- simple = new LRU(),
- arr,
- expired
-
- //created at 0
- //a would be valid till 0 + 50
- cache.set("a", "A")
- setTimeout(function () {
- //created at 20
- //b would be valid till 20 + 50
- cache.set("b", "B")
- //b would be valid till 20 + 70
- cache.set("c", "C", 70)
- arr = cache.dump()
- t.equal(arr.length, 3)
- }, 20)
-
- setTimeout(function () {
- t.equal(cache.get("a"), undefined)
- t.equal(cache.get("b"), "B")
- t.equal(cache.get("c"), "C")
-
- aged.load(arr)
- t.equal(aged.get("a"), undefined)
- t.equal(aged.get("b"), "B")
- t.equal(aged.get("c"), "C")
-
- simple.load(arr)
- t.equal(simple.get("a"), undefined)
- t.equal(simple.get("b"), "B")
- t.equal(simple.get("c"), "C")
- }, 60)
-
- setTimeout(function () {
- t.equal(cache.get("a"), undefined)
- t.equal(cache.get("b"), undefined)
- t.equal(cache.get("c"), "C")
-
- aged.load(arr)
- t.equal(aged.get("a"), undefined)
- t.equal(aged.get("b"), undefined)
- t.equal(aged.get("c"), "C")
-
- simple.load(arr)
- t.equal(simple.get("a"), undefined)
- t.equal(simple.get("b"), undefined)
- t.equal(simple.get("c"), "C")
- }, 80)
-
- setTimeout(function () {
- t.equal(cache.get("a"), undefined)
- t.equal(cache.get("b"), undefined)
- t.equal(cache.get("c"), undefined)
-
- aged.load(arr)
- t.equal(aged.get("a"), undefined)
- t.equal(aged.get("b"), undefined)
- t.equal(aged.get("c"), undefined)
-
- simple.load(arr)
- t.equal(simple.get("a"), undefined)
- t.equal(simple.get("b"), undefined)
- t.equal(simple.get("c"), undefined)
- t.end()
- }, 100)
-
-})
-
diff --git a/node_modules/request/node_modules/aws4/package.json b/node_modules/request/node_modules/aws4/package.json
index 31de63b47..5e7ae9de2 100644
--- a/node_modules/request/node_modules/aws4/package.json
+++ b/node_modules/request/node_modules/aws4/package.json
@@ -6,16 +6,20 @@
]
],
"_from": "aws4@>=1.2.1 <2.0.0",
- "_id": "aws4@1.2.1",
+ "_id": "aws4@1.3.2",
"_inCache": true,
"_installable": true,
"_location": "/request/aws4",
- "_nodeVersion": "4.2.4",
+ "_nodeVersion": "4.3.1",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/aws4-1.3.2.tgz_1456871543899_0.13955276948399842"
+ },
"_npmUser": {
"email": "michael.hart.au@gmail.com",
"name": "hichaelmart"
},
- "_npmVersion": "2.14.15",
+ "_npmVersion": "2.14.21",
"_phantomChildren": {},
"_requested": {
"name": "aws4",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz",
- "_shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
+ "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz",
+ "_shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1",
"_shrinkwrap": null,
"_spec": "aws4@^1.2.1",
"_where": "/Users/rebecca/code/npm/node_modules/request",
@@ -42,78 +46,78 @@
"url": "https://github.com/mhart/aws4/issues"
},
"dependencies": {
- "lru-cache": "^2.6.5"
+ "lru-cache": "^4.0.0"
},
"description": "Signs and prepares requests using AWS Signature Version 4",
"devDependencies": {
- "mocha": "^2.2.5",
- "should": "^7.0.1"
+ "mocha": "^2.4.5",
+ "should": "^8.2.2"
},
"directories": {},
"dist": {
- "shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
- "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz"
+ "shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1",
+ "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz"
},
- "gitHead": "3d8a3a06a8415bd5255b4f60eb91576952e97f5c",
+ "gitHead": "e899db3aacbf2a034398f7dd483345dc793e8d72",
"homepage": "https://github.com/mhart/aws4#readme",
"keywords": [
"amazon",
- "appstream",
- "autoscaling",
"aws",
+ "signature",
+ "s3",
+ "ec2",
+ "autoscaling",
"cloudformation",
- "cloudfront",
- "cloudhsm",
+ "elasticloadbalancing",
+ "elb",
+ "elasticbeanstalk",
"cloudsearch",
- "cloudtrail",
- "cloudwatch",
- "codedeploy",
- "cognito",
- "cognitoidentity",
- "cognitosync",
- "config",
- "containerservice",
+ "dynamodb",
+ "kinesis",
+ "lambda",
+ "glacier",
+ "sqs",
+ "sns",
+ "iam",
+ "sts",
+ "ses",
+ "swf",
+ "storagegateway",
"datapipeline",
"directconnect",
- "dynamodb",
- "ec2",
- "ecs",
+ "redshift",
+ "opsworks",
+ "rds",
+ "monitoring",
+ "cloudtrail",
+ "cloudfront",
+ "codedeploy",
"elasticache",
- "elasticbeanstalk",
- "elasticloadbalancing",
"elasticmapreduce",
"elastictranscoder",
- "elb",
"emr",
- "glacier",
- "iam",
+ "cloudwatch",
+ "mobileanalytics",
+ "cognitoidentity",
+ "cognitosync",
+ "cognito",
+ "containerservice",
+ "ecs",
+ "appstream",
"keymanagementservice",
- "kinesis",
"kms",
- "lambda",
- "logs",
- "mobileanalytics",
- "monitoring",
- "opsworks",
- "rds",
- "redshift",
+ "config",
+ "cloudhsm",
"route53",
"route53domains",
- "s3",
- "ses",
- "signature",
- "sns",
- "sqs",
- "storagegateway",
- "sts",
- "swf"
+ "logs"
],
"license": "MIT",
"main": "aws4.js",
"maintainers": [
{
- "name": "hichaelmart",
- "email": "michael.hart.au@gmail.com"
+ "email": "michael.hart.au@gmail.com",
+ "name": "hichaelmart"
}
],
"name": "aws4",
@@ -126,5 +130,5 @@
"scripts": {
"test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list"
},
- "version": "1.2.1"
+ "version": "1.3.2"
}
diff --git a/node_modules/request/node_modules/bl/.travis.yml b/node_modules/request/node_modules/bl/.travis.yml
index e431a1bd0..5cb0480b4 100644
--- a/node_modules/request/node_modules/bl/.travis.yml
+++ b/node_modules/request/node_modules/bl/.travis.yml
@@ -2,8 +2,9 @@ sudo: false
language: node_js
node_js:
- '0.10'
- - node
- - iojs
+ - '0.12'
+ - '4'
+ - '5'
branches:
only:
- master
diff --git a/node_modules/request/node_modules/bl/README.md b/node_modules/request/node_modules/bl/README.md
index 4d87866aa..f7044db26 100644
--- a/node_modules/request/node_modules/bl/README.md
+++ b/node_modules/request/node_modules/bl/README.md
@@ -96,7 +96,7 @@ bl.pipe(fs.createWriteStream('gibberish.txt'))
--------------------------------------------------------
<a name="ctor"></a>
-### new BufferList([ callback | buffer | buffer array ])
+### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
@@ -120,8 +120,8 @@ Get the length of the list in bytes. This is the sum of the lengths of all of th
--------------------------------------------------------
<a name="append"></a>
-### bl.append(buffer)
-`append(buffer)` adds an additional buffer or BufferList to the internal list.
+### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
+`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
--------------------------------------------------------
<a name="get"></a>
diff --git a/node_modules/request/node_modules/bl/bl.js b/node_modules/request/node_modules/bl/bl.js
index b979ba82e..f585df172 100644
--- a/node_modules/request/node_modules/bl/bl.js
+++ b/node_modules/request/node_modules/bl/bl.js
@@ -1,6 +1,7 @@
var DuplexStream = require('readable-stream/duplex')
, util = require('util')
+
function BufferList (callback) {
if (!(this instanceof BufferList))
return new BufferList(callback)
@@ -11,34 +12,31 @@ function BufferList (callback) {
if (typeof callback == 'function') {
this._callback = callback
- var piper = function (err) {
+ var piper = function piper (err) {
if (this._callback) {
this._callback(err)
this._callback = null
}
}.bind(this)
- this.on('pipe', function (src) {
+ this.on('pipe', function onPipe (src) {
src.on('error', piper)
})
- this.on('unpipe', function (src) {
+ this.on('unpipe', function onUnpipe (src) {
src.removeListener('error', piper)
})
- }
- else if (Buffer.isBuffer(callback))
+ } else {
this.append(callback)
- else if (Array.isArray(callback)) {
- callback.forEach(function (b) {
- Buffer.isBuffer(b) && this.append(b)
- }.bind(this))
}
DuplexStream.call(this)
}
+
util.inherits(BufferList, DuplexStream)
-BufferList.prototype._offset = function (offset) {
+
+BufferList.prototype._offset = function _offset (offset) {
var tot = 0, i = 0, _t
for (; i < this._bufs.length; i++) {
_t = tot + this._bufs[i].length
@@ -48,35 +46,52 @@ BufferList.prototype._offset = function (offset) {
}
}
-BufferList.prototype.append = function (buf) {
- var isBuffer = Buffer.isBuffer(buf) ||
- buf instanceof BufferList
- // coerce number arguments to strings, since Buffer(number) does
- // uninitialized memory allocation
- if (typeof buf == 'number')
- buf = buf.toString()
+BufferList.prototype.append = function append (buf) {
+ var i = 0
+ , newBuf
+
+ if (Array.isArray(buf)) {
+ for (; i < buf.length; i++)
+ this.append(buf[i])
+ } else if (buf instanceof BufferList) {
+ // unwrap argument into individual BufferLists
+ for (; i < buf._bufs.length; i++)
+ this.append(buf._bufs[i])
+ } else if (buf != null) {
+ // coerce number arguments to strings, since Buffer(number) does
+ // uninitialized memory allocation
+ if (typeof buf == 'number')
+ buf = buf.toString()
+
+ newBuf = Buffer.isBuffer(buf) ? buf : new Buffer(buf)
+ this._bufs.push(newBuf)
+ this.length += newBuf.length
+ }
- this._bufs.push(isBuffer ? buf : new Buffer(buf))
- this.length += buf.length
return this
}
-BufferList.prototype._write = function (buf, encoding, callback) {
+
+BufferList.prototype._write = function _write (buf, encoding, callback) {
this.append(buf)
- if (callback)
+
+ if (typeof callback == 'function')
callback()
}
-BufferList.prototype._read = function (size) {
+
+BufferList.prototype._read = function _read (size) {
if (!this.length)
return this.push(null)
+
size = Math.min(size, this.length)
this.push(this.slice(0, size))
this.consume(size)
}
-BufferList.prototype.end = function (chunk) {
+
+BufferList.prototype.end = function end (chunk) {
DuplexStream.prototype.end.call(this, chunk)
if (this._callback) {
@@ -85,15 +100,18 @@ BufferList.prototype.end = function (chunk) {
}
}
-BufferList.prototype.get = function (index) {
+
+BufferList.prototype.get = function get (index) {
return this.slice(index, index + 1)[0]
}
-BufferList.prototype.slice = function (start, end) {
+
+BufferList.prototype.slice = function slice (start, end) {
return this.copy(null, 0, start, end)
}
-BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
+
+BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
if (typeof srcStart != 'number' || srcStart < 0)
srcStart = 0
if (typeof srcEnd != 'number' || srcEnd > this.length)
@@ -156,13 +174,13 @@ BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) {
return dst
}
-BufferList.prototype.toString = function (encoding, start, end) {
+BufferList.prototype.toString = function toString (encoding, start, end) {
return this.slice(start, end).toString(encoding)
}
-BufferList.prototype.consume = function (bytes) {
+BufferList.prototype.consume = function consume (bytes) {
while (this._bufs.length) {
- if (bytes > this._bufs[0].length) {
+ if (bytes >= this._bufs[0].length) {
bytes -= this._bufs[0].length
this.length -= this._bufs[0].length
this._bufs.shift()
@@ -175,7 +193,8 @@ BufferList.prototype.consume = function (bytes) {
return this
}
-BufferList.prototype.duplicate = function () {
+
+BufferList.prototype.duplicate = function duplicate () {
var i = 0
, copy = new BufferList()
@@ -185,12 +204,14 @@ BufferList.prototype.duplicate = function () {
return copy
}
-BufferList.prototype.destroy = function () {
- this._bufs.length = 0;
- this.length = 0;
- this.push(null);
+
+BufferList.prototype.destroy = function destroy () {
+ this._bufs.length = 0
+ this.length = 0
+ this.push(null)
}
+
;(function () {
var methods = {
'readDoubleBE' : 8
@@ -218,4 +239,5 @@ BufferList.prototype.destroy = function () {
}
}())
+
module.exports = BufferList
diff --git a/node_modules/request/node_modules/bl/package.json b/node_modules/request/node_modules/bl/package.json
index 61b85c139..09ebb7b74 100644
--- a/node_modules/request/node_modules/bl/package.json
+++ b/node_modules/request/node_modules/bl/package.json
@@ -1,16 +1,20 @@
{
"_args": [
[
- "bl@~1.0.0",
+ "bl@~1.1.2",
"/Users/rebecca/code/npm/node_modules/request"
]
],
- "_from": "bl@>=1.0.0 <1.1.0",
- "_id": "bl@1.0.1",
+ "_from": "bl@>=1.1.2 <1.2.0",
+ "_id": "bl@1.1.2",
"_inCache": true,
"_installable": true,
"_location": "/request/bl",
- "_nodeVersion": "6.0.0-nightly2016011666b9c0d8bd",
+ "_nodeVersion": "5.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/bl-1.1.2.tgz_1455246621698_0.6300242957659066"
+ },
"_npmUser": {
"email": "rod@vagg.org",
"name": "rvagg"
@@ -19,24 +23,24 @@
"_phantomChildren": {},
"_requested": {
"name": "bl",
- "raw": "bl@~1.0.0",
- "rawSpec": "~1.0.0",
+ "raw": "bl@~1.1.2",
+ "rawSpec": "~1.1.2",
"scope": null,
- "spec": ">=1.0.0 <1.1.0",
+ "spec": ">=1.1.2 <1.2.0",
"type": "range"
},
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.1.tgz",
- "_shasum": "0e6df7330308c46515751676cafa7334dc9852fd",
+ "_resolved": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz",
+ "_shasum": "fdca871a99713aa00d19e3bbba41c44787a65398",
"_shrinkwrap": null,
- "_spec": "bl@~1.0.0",
+ "_spec": "bl@~1.1.2",
"_where": "/Users/rebecca/code/npm/node_modules/request",
"authors": [
- "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)",
+ "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
- "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)"
+ "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)"
],
"bugs": {
"url": "https://github.com/rvagg/bl/issues"
@@ -46,30 +50,29 @@
},
"description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
"devDependencies": {
- "brtapsauce": "~0.3.0",
- "faucet": "~0.0.1",
+ "faucet": "0.0.1",
"hash_file": "~0.1.1",
- "tape": "~2.12.3"
+ "tape": "~4.4.0"
},
"directories": {},
"dist": {
- "shasum": "0e6df7330308c46515751676cafa7334dc9852fd",
- "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.1.tgz"
+ "shasum": "fdca871a99713aa00d19e3bbba41c44787a65398",
+ "tarball": "https://registry.npmjs.org/bl/-/bl-1.1.2.tgz"
},
- "gitHead": "9eced07e8c4f4b44b42e6e99ac33d4c390b4e74a",
+ "gitHead": "ea42021059dc65fc60d7f4b9217c73431f09d23d",
"homepage": "https://github.com/rvagg/bl",
"keywords": [
- "awesomesauce",
"buffer",
"buffers",
- "stream"
+ "stream",
+ "awesomesauce"
],
"license": "MIT",
"main": "bl.js",
"maintainers": [
{
- "name": "rvagg",
- "email": "rod@vagg.org"
+ "email": "rod@vagg.org",
+ "name": "rvagg"
}
],
"name": "bl",
@@ -80,8 +83,7 @@
"url": "git+https://github.com/rvagg/bl.git"
},
"scripts": {
- "test": "node test/test.js | faucet",
- "test-local": "brtapsauce-local test/basic-test.js"
+ "test": "node test/test.js | faucet"
},
- "version": "1.0.1"
+ "version": "1.1.2"
}
diff --git a/node_modules/request/node_modules/bl/test/basic-test.js b/node_modules/request/node_modules/bl/test/basic-test.js
deleted file mode 100644
index 92572642f..000000000
--- a/node_modules/request/node_modules/bl/test/basic-test.js
+++ /dev/null
@@ -1,557 +0,0 @@
-var tape = require('tape')
- , crypto = require('crypto')
- , fs = require('fs')
- , hash = require('hash_file')
- , BufferList = require('../')
-
- , encodings =
- ('hex utf8 utf-8 ascii binary base64'
- + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-
-tape('single bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
-
- t.end()
-})
-
-tape('single bytes from multiple buffers', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.get(0), 97)
- t.equal(bl.get(1), 98)
- t.equal(bl.get(2), 99)
- t.equal(bl.get(3), 100)
- t.equal(bl.get(4), 101)
- t.equal(bl.get(5), 102)
- t.equal(bl.get(6), 103)
- t.equal(bl.get(7), 104)
- t.equal(bl.get(8), 105)
- t.equal(bl.get(9), 106)
- t.end()
-})
-
-tape('multi bytes from single buffer', function (t) {
- var bl = new BufferList()
- bl.append(new Buffer('abcd'))
-
- t.equal(bl.length, 4)
-
- t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
- t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
- t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('multiple bytes from multiple buffer lists', function (t) {
- var bl = new BufferList()
-
- bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
- bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
- t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
- t.equal(bl.slice(3, 6).toString('ascii'), 'def')
- t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
- t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
- t.end()
-})
-
-tape('consuming from multiple buffers', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.length, 10)
-
- t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
- bl.consume(3)
- t.equal(bl.length, 7)
- t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
-
- bl.consume(2)
- t.equal(bl.length, 5)
- t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
-
- bl.consume(1)
- t.equal(bl.length, 4)
- t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
-
- bl.consume(1)
- t.equal(bl.length, 3)
- t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
-
- bl.consume(2)
- t.equal(bl.length, 1)
- t.equal(bl.slice(0, 1).toString('ascii'), 'j')
-
- t.end()
-})
-
-tape('test readUInt8 / readInt8', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt8(2), 0x3)
- t.equal(bl.readInt8(2), 0x3)
- t.equal(bl.readUInt8(3), 0x4)
- t.equal(bl.readInt8(3), 0x4)
- t.equal(bl.readUInt8(4), 0x23)
- t.equal(bl.readInt8(4), 0x23)
- t.equal(bl.readUInt8(5), 0x42)
- t.equal(bl.readInt8(5), 0x42)
- t.end()
-})
-
-tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt16BE(2), 0x0304)
- t.equal(bl.readUInt16LE(2), 0x0403)
- t.equal(bl.readInt16BE(2), 0x0304)
- t.equal(bl.readInt16LE(2), 0x0403)
- t.equal(bl.readUInt16BE(3), 0x0423)
- t.equal(bl.readUInt16LE(3), 0x2304)
- t.equal(bl.readInt16BE(3), 0x0423)
- t.equal(bl.readInt16LE(3), 0x2304)
- t.equal(bl.readUInt16BE(4), 0x2342)
- t.equal(bl.readUInt16LE(4), 0x4223)
- t.equal(bl.readInt16BE(4), 0x2342)
- t.equal(bl.readInt16LE(4), 0x4223)
- t.end()
-})
-
-tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x3
- buf2[2] = 0x4
- buf3[0] = 0x23
- buf3[1] = 0x42
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readUInt32BE(2), 0x03042342)
- t.equal(bl.readUInt32LE(2), 0x42230403)
- t.equal(bl.readInt32BE(2), 0x03042342)
- t.equal(bl.readInt32LE(2), 0x42230403)
- t.end()
-})
-
-tape('test readFloatLE / readFloatBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(3)
- , bl = new BufferList()
-
- buf2[1] = 0x00
- buf2[2] = 0x00
- buf3[0] = 0x80
- buf3[1] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readFloatLE(2), 0x01)
- t.end()
-})
-
-tape('test readDoubleLE / readDoubleBE', function (t) {
- var buf1 = new Buffer(1)
- , buf2 = new Buffer(3)
- , buf3 = new Buffer(10)
- , bl = new BufferList()
-
- buf2[1] = 0x55
- buf2[2] = 0x55
- buf3[0] = 0x55
- buf3[1] = 0x55
- buf3[2] = 0x55
- buf3[3] = 0x55
- buf3[4] = 0xd5
- buf3[5] = 0x3f
-
- bl.append(buf1)
- bl.append(buf2)
- bl.append(buf3)
-
- t.equal(bl.readDoubleLE(2), 0.3333333333333333)
- t.end()
-})
-
-tape('test toString', function (t) {
- var bl = new BufferList()
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
-
- t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
- t.equal(bl.toString('ascii', 3, 10), 'defghij')
- t.equal(bl.toString('ascii', 3, 6), 'def')
- t.equal(bl.toString('ascii', 3, 8), 'defgh')
- t.equal(bl.toString('ascii', 5, 10), 'fghij')
-
- t.end()
-})
-
-tape('test toString encoding', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append(new Buffer('abcd'))
- bl.append(new Buffer('efg'))
- bl.append(new Buffer('hi'))
- bl.append(new Buffer('j'))
- bl.append(new Buffer('\xff\x00'))
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc), enc)
- })
-
- t.end()
-})
-
-!process.browser && tape('test stream', function (t) {
- var random = crypto.randomBytes(65534)
- , rndhash = hash(random, 'md5')
- , md5sum = crypto.createHash('md5')
- , bl = new BufferList(function (err, buf) {
- t.ok(Buffer.isBuffer(buf))
- t.ok(err === null)
- t.equal(rndhash, hash(bl.slice(), 'md5'))
- t.equal(rndhash, hash(buf, 'md5'))
-
- bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
- .on('close', function () {
- var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
- s.on('data', md5sum.update.bind(md5sum))
- s.on('end', function() {
- t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
- t.end()
- })
- })
-
- })
-
- fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
- fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
-})
-
-tape('instantiation with Buffer', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = crypto.randomBytes(1024)
- , b = BufferList(buf)
-
- t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
- b = BufferList([ buf, buf2 ])
- t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('test String appendage', function (t) {
- var bl = new BufferList()
- , b = new Buffer('abcdefghij\xff\x00')
-
- bl.append('abcd')
- bl.append('efg')
- bl.append('hi')
- bl.append('j')
- bl.append('\xff\x00')
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('test Number appendage', function (t) {
- var bl = new BufferList()
- , b = new Buffer('1234567890')
-
- bl.append(1234)
- bl.append(567)
- bl.append(89)
- bl.append(0)
-
- encodings.forEach(function (enc) {
- t.equal(bl.toString(enc), b.toString(enc))
- })
-
- t.end()
-})
-
-tape('write nothing, should get empty buffer', function (t) {
- t.plan(3)
- BufferList(function (err, data) {
- t.notOk(err, 'no error')
- t.ok(Buffer.isBuffer(data), 'got a buffer')
- t.equal(0, data.length, 'got a zero-length buffer')
- t.end()
- }).end()
-})
-
-tape('unicode string', function (t) {
- t.plan(2)
- var inp1 = '\u2600'
- , inp2 = '\u2603'
- , exp = inp1 + ' and ' + inp2
- , bl = BufferList()
- bl.write(inp1)
- bl.write(' and ')
- bl.write(inp2)
- t.equal(exp, bl.toString())
- t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
-})
-
-tape('should emit finish', function (t) {
- var source = BufferList()
- , dest = BufferList()
-
- source.write('hello')
- source.pipe(dest)
-
- dest.on('finish', function () {
- t.equal(dest.toString('utf8'), 'hello')
- t.end()
- })
-})
-
-tape('basic copy', function (t) {
- var buf = crypto.randomBytes(1024)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy after many appends', function (t) {
- var buf = crypto.randomBytes(512)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2)
- t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy at a precise position', function (t) {
- var buf = crypto.randomBytes(1004)
- , buf2 = new Buffer(1024)
- , b = BufferList(buf)
-
- b.copy(buf2, 20)
- t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy starting from a precise location', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(5)
- , b = BufferList(buf)
-
- b.copy(buf2, 0, 5)
- t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy in an interval', function (t) {
- var rnd = crypto.randomBytes(10)
- , b = BufferList(rnd) // put the random bytes there
- , actual = new Buffer(3)
- , expected = new Buffer(3)
-
- rnd.copy(expected, 0, 5, 8)
- b.copy(actual, 0, 5, 8)
-
- t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('copy an interval between two buffers', function (t) {
- var buf = crypto.randomBytes(10)
- , buf2 = new Buffer(10)
- , b = BufferList(buf)
-
- b.append(buf)
- b.copy(buf2, 0, 5, 15)
-
- t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
- t.end()
-})
-
-tape('duplicate', function (t) {
- t.plan(2)
-
- var bl = new BufferList('abcdefghij\xff\x00')
- , dup = bl.duplicate()
-
- t.equal(bl.prototype, dup.prototype)
- t.equal(bl.toString('hex'), dup.toString('hex'))
-})
-
-tape('destroy no pipe', function (t) {
- t.plan(2)
-
- var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
-
-})
-
-!process.browser && tape('destroy with pipe before read end with race', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .pipe(bl)
-
- setTimeout(function () {
- bl.destroy()
- setTimeout(function () {
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }, 500)
- }, 500)
-})
-
-!process.browser && tape('destroy with pipe after read end', function (t) {
- t.plan(2)
-
- var bl = new BufferList()
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.destroy()
-
- t.equal(bl._bufs.length, 0)
- t.equal(bl.length, 0)
- }
-})
-
-!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
- t.plan(4)
-
- var bl = new BufferList()
- , ds = new BufferList()
-
- fs.createReadStream(__dirname + '/sauce.js')
- .on('end', onEnd)
- .pipe(bl)
-
- function onEnd () {
- bl.pipe(ds)
-
- setTimeout(function () {
- bl.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- ds.destroy()
-
- t.equals(bl._bufs.length, 0)
- t.equals(bl.length, 0)
-
- }, 100)
- }
-})
-
-!process.browser && tape('handle error', function (t) {
- t.plan(2)
- fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
- t.ok(err instanceof Error, 'has error')
- t.notOk(data, 'no data')
- }))
-})
diff --git a/node_modules/request/node_modules/bl/test/sauce.js b/node_modules/request/node_modules/bl/test/sauce.js
deleted file mode 100644
index a6d28625f..000000000
--- a/node_modules/request/node_modules/bl/test/sauce.js
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-const user = process.env.SAUCE_USER
- , key = process.env.SAUCE_KEY
- , path = require('path')
- , brtapsauce = require('brtapsauce')
- , testFile = path.join(__dirname, 'basic-test.js')
-
- , capabilities = [
- { browserName: 'chrome' , platform: 'Windows XP', version: '' }
- , { browserName: 'firefox' , platform: 'Windows 8' , version: '' }
- , { browserName: 'firefox' , platform: 'Windows XP', version: '4' }
- , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' }
- , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' }
- , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' }
- , { browserName: 'safari' , platform: 'Windows 7' , version: '5' }
- , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '' }
- , { browserName: 'opera' , platform: 'Windows 7' , version: '11' }
- , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' }
- , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' }
- ]
-
-if (!user)
- throw new Error('Must set a SAUCE_USER env var')
-if (!key)
- throw new Error('Must set a SAUCE_KEY env var')
-
-brtapsauce({
- name : 'Traversty'
- , user : user
- , key : key
- , brsrc : testFile
- , capabilities : capabilities
- , options : { timeout: 60 * 6 }
-}) \ No newline at end of file
diff --git a/node_modules/request/node_modules/bl/test/test.js b/node_modules/request/node_modules/bl/test/test.js
index aa9b48771..c95b1ba48 100644
--- a/node_modules/request/node_modules/bl/test/test.js
+++ b/node_modules/request/node_modules/bl/test/test.js
@@ -1,9 +1,640 @@
-require('./basic-test')
+var tape = require('tape')
+ , crypto = require('crypto')
+ , fs = require('fs')
+ , hash = require('hash_file')
+ , BufferList = require('../')
-if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
- return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
+ , encodings =
+ ('hex utf8 utf-8 ascii binary base64'
+ + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-if (!/v0\.10/.test(process.version))
- return console.log('Not Node v0.10.x, not running sauce tests')
+tape('single bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
-require('./sauce.js') \ No newline at end of file
+ t.equal(bl.length, 4)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+
+ t.end()
+})
+
+tape('single bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+ t.equal(bl.get(4), 101)
+ t.equal(bl.get(5), 102)
+ t.equal(bl.get(6), 103)
+ t.equal(bl.get(7), 104)
+ t.equal(bl.get(8), 105)
+ t.equal(bl.get(9), 106)
+ t.end()
+})
+
+tape('multi bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abcd'))
+
+ t.equal(bl.length, 4)
+
+ t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
+ t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
+ t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([ new Buffer('abcd'), new Buffer('efg') ]))
+ bl.append(new BufferList([ new Buffer('hi'), new Buffer('j') ]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+// same data as previous test, just using nested constructors
+tape('multiple bytes from crazy nested buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([
+ new BufferList([
+ new BufferList(new Buffer('abc'))
+ , new Buffer('d')
+ , new BufferList(new Buffer('efg'))
+ ])
+ , new BufferList([ new Buffer('hi') ])
+ , new BufferList(new Buffer('j'))
+ ]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('append accepts arrays of Buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abc'))
+ bl.append([ new Buffer('def') ])
+ bl.append([ new Buffer('ghi'), new Buffer('jkl') ])
+ bl.append([ new Buffer('mnop'), new Buffer('qrstu'), new Buffer('vwxyz') ])
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('append accepts arrays of BufferLists', function (t) {
+ var bl = new BufferList()
+ bl.append(new Buffer('abc'))
+ bl.append([ new BufferList('def') ])
+ bl.append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ]))
+ bl.append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ])
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('append chainable', function (t) {
+ var bl = new BufferList()
+ t.ok(bl.append(new Buffer('abcd')) === bl)
+ t.ok(bl.append([ new Buffer('abcd') ]) === bl)
+ t.ok(bl.append(new BufferList(new Buffer('abcd'))) === bl)
+ t.ok(bl.append([ new BufferList(new Buffer('abcd')) ]) === bl)
+ t.end()
+})
+
+tape('append chainable (test results)', function (t) {
+ var bl = new BufferList('abc')
+ .append([ new BufferList('def') ])
+ .append(new BufferList([ new Buffer('ghi'), new BufferList('jkl') ]))
+ .append([ new Buffer('mnop'), new BufferList([ new Buffer('qrstu'), new Buffer('vwxyz') ]) ])
+
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('consuming from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ bl.consume(3)
+ t.equal(bl.length, 7)
+ t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
+
+ bl.consume(2)
+ t.equal(bl.length, 5)
+ t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 4)
+ t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 3)
+ t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
+
+ bl.consume(2)
+ t.equal(bl.length, 1)
+ t.equal(bl.slice(0, 1).toString('ascii'), 'j')
+
+ t.end()
+})
+
+tape('complete consumption', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('a'))
+ bl.append(new Buffer('b'))
+
+ bl.consume(2)
+
+ t.equal(bl.length, 0)
+ t.equal(bl._bufs.length, 0)
+
+ t.end()
+})
+
+tape('test readUInt8 / readInt8', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt8(2), 0x3)
+ t.equal(bl.readInt8(2), 0x3)
+ t.equal(bl.readUInt8(3), 0x4)
+ t.equal(bl.readInt8(3), 0x4)
+ t.equal(bl.readUInt8(4), 0x23)
+ t.equal(bl.readInt8(4), 0x23)
+ t.equal(bl.readUInt8(5), 0x42)
+ t.equal(bl.readInt8(5), 0x42)
+ t.end()
+})
+
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt16BE(2), 0x0304)
+ t.equal(bl.readUInt16LE(2), 0x0403)
+ t.equal(bl.readInt16BE(2), 0x0304)
+ t.equal(bl.readInt16LE(2), 0x0403)
+ t.equal(bl.readUInt16BE(3), 0x0423)
+ t.equal(bl.readUInt16LE(3), 0x2304)
+ t.equal(bl.readInt16BE(3), 0x0423)
+ t.equal(bl.readInt16LE(3), 0x2304)
+ t.equal(bl.readUInt16BE(4), 0x2342)
+ t.equal(bl.readUInt16LE(4), 0x4223)
+ t.equal(bl.readInt16BE(4), 0x2342)
+ t.equal(bl.readInt16LE(4), 0x4223)
+ t.end()
+})
+
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt32BE(2), 0x03042342)
+ t.equal(bl.readUInt32LE(2), 0x42230403)
+ t.equal(bl.readInt32BE(2), 0x03042342)
+ t.equal(bl.readInt32LE(2), 0x42230403)
+ t.end()
+})
+
+tape('test readFloatLE / readFloatBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x00
+ buf2[2] = 0x00
+ buf3[0] = 0x80
+ buf3[1] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readFloatLE(2), 0x01)
+ t.end()
+})
+
+tape('test readDoubleLE / readDoubleBE', function (t) {
+ var buf1 = new Buffer(1)
+ , buf2 = new Buffer(3)
+ , buf3 = new Buffer(10)
+ , bl = new BufferList()
+
+ buf2[1] = 0x55
+ buf2[2] = 0x55
+ buf3[0] = 0x55
+ buf3[1] = 0x55
+ buf3[2] = 0x55
+ buf3[3] = 0x55
+ buf3[4] = 0xd5
+ buf3[5] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readDoubleLE(2), 0.3333333333333333)
+ t.end()
+})
+
+tape('test toString', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+
+ t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
+ t.equal(bl.toString('ascii', 3, 10), 'defghij')
+ t.equal(bl.toString('ascii', 3, 6), 'def')
+ t.equal(bl.toString('ascii', 3, 8), 'defgh')
+ t.equal(bl.toString('ascii', 5, 10), 'fghij')
+
+ t.end()
+})
+
+tape('test toString encoding', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append(new Buffer('abcd'))
+ bl.append(new Buffer('efg'))
+ bl.append(new Buffer('hi'))
+ bl.append(new Buffer('j'))
+ bl.append(new Buffer('\xff\x00'))
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc), enc)
+ })
+
+ t.end()
+})
+
+!process.browser && tape('test stream', function (t) {
+ var random = crypto.randomBytes(65534)
+ , rndhash = hash(random, 'md5')
+ , md5sum = crypto.createHash('md5')
+ , bl = new BufferList(function (err, buf) {
+ t.ok(Buffer.isBuffer(buf))
+ t.ok(err === null)
+ t.equal(rndhash, hash(bl.slice(), 'md5'))
+ t.equal(rndhash, hash(buf, 'md5'))
+
+ bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
+ .on('close', function () {
+ var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
+ s.on('data', md5sum.update.bind(md5sum))
+ s.on('end', function() {
+ t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
+ t.end()
+ })
+ })
+
+ })
+
+ fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
+ fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
+})
+
+tape('instantiation with Buffer', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = crypto.randomBytes(1024)
+ , b = BufferList(buf)
+
+ t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
+ b = BufferList([ buf, buf2 ])
+ t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('test String appendage', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('abcdefghij\xff\x00')
+
+ bl.append('abcd')
+ bl.append('efg')
+ bl.append('hi')
+ bl.append('j')
+ bl.append('\xff\x00')
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('test Number appendage', function (t) {
+ var bl = new BufferList()
+ , b = new Buffer('1234567890')
+
+ bl.append(1234)
+ bl.append(567)
+ bl.append(89)
+ bl.append(0)
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('write nothing, should get empty buffer', function (t) {
+ t.plan(3)
+ BufferList(function (err, data) {
+ t.notOk(err, 'no error')
+ t.ok(Buffer.isBuffer(data), 'got a buffer')
+ t.equal(0, data.length, 'got a zero-length buffer')
+ t.end()
+ }).end()
+})
+
+tape('unicode string', function (t) {
+ t.plan(2)
+ var inp1 = '\u2600'
+ , inp2 = '\u2603'
+ , exp = inp1 + ' and ' + inp2
+ , bl = BufferList()
+ bl.write(inp1)
+ bl.write(' and ')
+ bl.write(inp2)
+ t.equal(exp, bl.toString())
+ t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
+})
+
+tape('should emit finish', function (t) {
+ var source = BufferList()
+ , dest = BufferList()
+
+ source.write('hello')
+ source.pipe(dest)
+
+ dest.on('finish', function () {
+ t.equal(dest.toString('utf8'), 'hello')
+ t.end()
+ })
+})
+
+tape('basic copy', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy after many appends', function (t) {
+ var buf = crypto.randomBytes(512)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy at a precise position', function (t) {
+ var buf = crypto.randomBytes(1004)
+ , buf2 = new Buffer(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 20)
+ t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy starting from a precise location', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(5)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 0, 5)
+ t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy in an interval', function (t) {
+ var rnd = crypto.randomBytes(10)
+ , b = BufferList(rnd) // put the random bytes there
+ , actual = new Buffer(3)
+ , expected = new Buffer(3)
+
+ rnd.copy(expected, 0, 5, 8)
+ b.copy(actual, 0, 5, 8)
+
+ t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy an interval between two buffers', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = new Buffer(10)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2, 0, 5, 15)
+
+ t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('duplicate', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('abcdefghij\xff\x00')
+ , dup = bl.duplicate()
+
+ t.equal(bl.prototype, dup.prototype)
+ t.equal(bl.toString('hex'), dup.toString('hex'))
+})
+
+tape('destroy no pipe', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+})
+
+!process.browser && tape('destroy with pipe before read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+
+})
+
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ setTimeout(function () {
+ bl.destroy()
+ setTimeout(function () {
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }, 500)
+ }, 500)
+})
+
+!process.browser && tape('destroy with pipe after read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }
+})
+
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
+ t.plan(4)
+
+ var bl = new BufferList()
+ , ds = new BufferList()
+
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.pipe(ds)
+
+ setTimeout(function () {
+ bl.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ ds.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ }, 100)
+ }
+})
+
+!process.browser && tape('handle error', function (t) {
+ t.plan(2)
+ fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
+ t.ok(err instanceof Error, 'has error')
+ t.notOk(data, 'no data')
+ }))
+})
diff --git a/node_modules/request/node_modules/form-data/.dockerignore b/node_modules/request/node_modules/form-data/.dockerignore
new file mode 100644
index 000000000..c67305cf9
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/.dockerignore
@@ -0,0 +1,7 @@
+*.iml
+*.sublime-*
+*.un~
+.idea
+sftp-config.json
+node_modules/
+test/tmp/
diff --git a/node_modules/request/node_modules/form-data/.editorconfig b/node_modules/request/node_modules/form-data/.editorconfig
new file mode 100644
index 000000000..0f099897b
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/.editorconfig
@@ -0,0 +1,10 @@
+# editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
diff --git a/node_modules/request/node_modules/form-data/.eslintignore b/node_modules/request/node_modules/form-data/.eslintignore
new file mode 100644
index 000000000..8d87b1d26
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/.eslintignore
@@ -0,0 +1 @@
+node_modules/*
diff --git a/node_modules/request/node_modules/form-data/Readme.md b/node_modules/request/node_modules/form-data/Readme.md
index 492773231..e857db6e2 100644
--- a/node_modules/request/node_modules/form-data/Readme.md
+++ b/node_modules/request/node_modules/form-data/Readme.md
@@ -1,4 +1,4 @@
-# Form-Data [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) [![Build Status](https://img.shields.io/travis/form-data/form-data/master.svg)](https://travis-ci.org/form-data/form-data) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
+# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data)
A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
@@ -7,6 +7,14 @@ The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface]
[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions
+[![Linux Build](https://img.shields.io/travis/form-data/form-data/master.svg?label=linux:0.10-5.x)](https://travis-ci.org/form-data/form-data)
+[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/master.svg?label=windows:0.10-5.x)](https://ci.appveyor.com/project/alexindigo/form-data)
+[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/master.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master)
+
+[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)
+[![Codacy Badge](https://img.shields.io/codacy/43ece80331c246179695e41f81eeffe2.svg)](https://www.codacy.com/app/form-data/form-data)
+[![bitHound Overall Score](https://www.bithound.io/github/form-data/form-data/badges/score.svg)](https://www.bithound.io/github/form-data/form-data)
+
## Install
```
diff --git a/node_modules/request/node_modules/form-data/lib/browser.js b/node_modules/request/node_modules/form-data/lib/browser.js
index 1e7717d56..8141d6589 100644
--- a/node_modules/request/node_modules/form-data/lib/browser.js
+++ b/node_modules/request/node_modules/form-data/lib/browser.js
@@ -1 +1,2 @@
-module.exports = FormData; \ No newline at end of file
+/* eslint-env browser */
+module.exports = FormData;
diff --git a/node_modules/request/node_modules/form-data/lib/form_data.js b/node_modules/request/node_modules/form-data/lib/form_data.js
index 524f392b4..55328b463 100644
--- a/node_modules/request/node_modules/form-data/lib/form_data.js
+++ b/node_modules/request/node_modules/form-data/lib/form_data.js
@@ -7,29 +7,51 @@ var parseUrl = require('url').parse;
var fs = require('fs');
var mime = require('mime-types');
var async = require('async');
+var populate = require('./populate.js');
+// Public API
module.exports = FormData;
+
+// make it a Stream
+util.inherits(FormData, CombinedStream);
+
+/**
+ * Create readable "multipart/form-data" streams.
+ * Can be used to submit forms
+ * and file uploads to other web applications.
+ *
+ * @constructor
+ */
function FormData() {
+ if (!(this instanceof FormData)) {
+ throw new TypeError('Failed to construct FormData: Please use the _new_ operator, this object constructor cannot be called as a function.');
+ }
+
this._overheadLength = 0;
this._valueLength = 0;
this._lengthRetrievers = [];
CombinedStream.call(this);
}
-util.inherits(FormData, CombinedStream);
FormData.LINE_BREAK = '\r\n';
FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
FormData.prototype.append = function(field, value, options) {
- options = (typeof options === 'string')
- ? { filename: options }
- : options || {};
+
+ options = options || {};
+
+ // allow filename as single option
+ if (typeof options == 'string') {
+ options = {filename: options};
+ }
var append = CombinedStream.prototype.append.bind(this);
// all that streamy business can't handle numbers
- if (typeof value == 'number') value = ''+value;
+ if (typeof value == 'number') {
+ value = '' + value;
+ }
// https://github.com/felixge/node-form-data/issues/38
if (util.isArray(value)) {
@@ -40,7 +62,7 @@ FormData.prototype.append = function(field, value, options) {
}
var header = this._multiPartHeader(field, value, options);
- var footer = this._multiPartFooter(field, value, options);
+ var footer = this._multiPartFooter();
append(header);
append(value);
@@ -78,118 +100,141 @@ FormData.prototype._trackLength = function(header, value, options) {
}
// no need to bother with the length
- if (!options.knownLength)
- this._lengthRetrievers.push(function(next) {
-
- if (value.hasOwnProperty('fd')) {
-
- // take read range into a account
- // `end` = Infinity –> read file till the end
- //
- // TODO: Looks like there is bug in Node fs.createReadStream
- // it doesn't respect `end` options without `start` options
- // Fix it when node fixes it.
- // https://github.com/joyent/node/issues/7819
- if (value.end != undefined && value.end != Infinity && value.start != undefined) {
-
- // when end specified
- // no need to calculate range
- // inclusive, starts with 0
- next(null, value.end+1 - (value.start ? value.start : 0));
-
- // not that fast snoopy
- } else {
- // still need to fetch file size from fs
- fs.stat(value.path, function(err, stat) {
-
- var fileSize;
-
- if (err) {
- next(err);
- return;
- }
-
- // update final size based on the range options
- fileSize = stat.size - (value.start ? value.start : 0);
- next(null, fileSize);
+ if (!options.knownLength) {
+ this._lengthRetrievers.push(function(next) {
+
+ if (value.hasOwnProperty('fd')) {
+
+ // take read range into a account
+ // `end` = Infinity –> read file till the end
+ //
+ // TODO: Looks like there is bug in Node fs.createReadStream
+ // it doesn't respect `end` options without `start` options
+ // Fix it when node fixes it.
+ // https://github.com/joyent/node/issues/7819
+ if (value.end != undefined && value.end != Infinity && value.start != undefined) {
+
+ // when end specified
+ // no need to calculate range
+ // inclusive, starts with 0
+ next(null, value.end + 1 - (value.start ? value.start : 0));
+
+ // not that fast snoopy
+ } else {
+ // still need to fetch file size from fs
+ fs.stat(value.path, function(err, stat) {
+
+ var fileSize;
+
+ if (err) {
+ next(err);
+ return;
+ }
+
+ // update final size based on the range options
+ fileSize = stat.size - (value.start ? value.start : 0);
+ next(null, fileSize);
+ });
+ }
+
+ // or http response
+ } else if (value.hasOwnProperty('httpVersion')) {
+ next(null, +value.headers['content-length']);
+
+ // or request stream http://github.com/mikeal/request
+ } else if (value.hasOwnProperty('httpModule')) {
+ // wait till response come back
+ value.on('response', function(response) {
+ value.pause();
+ next(null, +response.headers['content-length']);
});
- }
+ value.resume();
- // or http response
- } else if (value.hasOwnProperty('httpVersion')) {
- next(null, +value.headers['content-length']);
-
- // or request stream http://github.com/mikeal/request
- } else if (value.hasOwnProperty('httpModule')) {
- // wait till response come back
- value.on('response', function(response) {
- value.pause();
- next(null, +response.headers['content-length']);
- });
- value.resume();
-
- // something else
- } else {
- next('Unknown stream');
- }
- });
+ // something else
+ } else {
+ next('Unknown stream');
+ }
+ });
+ }
};
FormData.prototype._multiPartHeader = function(field, value, options) {
// custom header specified (as string)?
// it becomes responsible for boundary
// (e.g. to handle extra CRLFs on .NET servers)
- if (options.header != null) {
+ if (options.header) {
return options.header;
}
+ var contentDisposition = this._getContentDisposition(value, options);
+ var contentType = this._getContentType(value, options);
+
var contents = '';
var headers = {
- 'Content-Disposition': ['form-data', 'name="' + field + '"'],
- 'Content-Type': []
+ // add custom disposition as third element or keep it two elements if not
+ 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
+ // if no content type. allow it to be empty array
+ 'Content-Type': [].concat(contentType || [])
};
- // fs- and request- streams have path property
- // or use custom filename and/or contentType
- // TODO: Use request's response mime-type
- if (options.filename || value.path) {
- headers['Content-Disposition'].push(
- 'filename="' + path.basename(options.filename || value.path) + '"'
- );
- headers['Content-Type'].push(
- options.contentType ||
- mime.lookup(options.filename || value.path) ||
- FormData.DEFAULT_CONTENT_TYPE
- );
- // http response has not
- } else if (value.readable && value.hasOwnProperty('httpVersion')) {
- headers['Content-Disposition'].push(
- 'filename="' + path.basename(value.client._httpMessage.path) + '"'
- );
- headers['Content-Type'].push(
- options.contentType ||
- value.headers['content-type'] ||
- FormData.DEFAULT_CONTENT_TYPE
- );
- } else if (Buffer.isBuffer(value)) {
- headers['Content-Type'].push(
- options.contentType ||
- FormData.DEFAULT_CONTENT_TYPE
- );
- } else if (options.contentType) {
- headers['Content-Type'].push(options.contentType);
- }
-
for (var prop in headers) {
if (headers[prop].length) {
contents += prop + ': ' + headers[prop].join('; ') + FormData.LINE_BREAK;
}
}
-
+
return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
};
-FormData.prototype._multiPartFooter = function(field, value, options) {
+FormData.prototype._getContentDisposition = function(value, options) {
+
+ var contentDisposition;
+
+ // custom filename takes precedence
+ // fs- and request- streams have path property
+ var filename = options.filename || value.path;
+
+ // or try http response
+ if (!filename && value.readable && value.hasOwnProperty('httpVersion')) {
+ filename = value.client._httpMessage.path;
+ }
+
+ if (filename) {
+ contentDisposition = 'filename="' + path.basename(filename) + '"';
+ }
+
+ return contentDisposition;
+};
+
+FormData.prototype._getContentType = function(value, options) {
+
+ // use custom content-type above all
+ var contentType = options.contentType;
+
+ // or try `path` from fs-, request- streams
+ if (!contentType && value.path) {
+ contentType = mime.lookup(value.path);
+ }
+
+ // or if it's http-reponse
+ if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
+ contentType = value.headers['content-type'];
+ }
+
+ // or guess it from the filename
+ if (!contentType && options.filename) {
+ contentType = mime.lookup(options.filename);
+ }
+
+ // fallback to the default content type if `value` is not simple value
+ if (!contentType && typeof value == 'object') {
+ contentType = FormData.DEFAULT_CONTENT_TYPE;
+ }
+
+ return contentType;
+};
+
+FormData.prototype._multiPartFooter = function() {
return function(next) {
var footer = FormData.LINE_BREAK;
@@ -207,27 +252,30 @@ FormData.prototype._lastBoundary = function() {
};
FormData.prototype.getHeaders = function(userHeaders) {
+ var header;
var formHeaders = {
'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
};
- for (var header in userHeaders) {
- formHeaders[header.toLowerCase()] = userHeaders[header];
+ for (header in userHeaders) {
+ if (userHeaders.hasOwnProperty(header)) {
+ formHeaders[header.toLowerCase()] = userHeaders[header];
+ }
}
return formHeaders;
-}
+};
FormData.prototype.getCustomHeaders = function(contentType) {
- contentType = contentType ? contentType : 'multipart/form-data';
+ contentType = contentType ? contentType : 'multipart/form-data';
- var formHeaders = {
- 'content-type': contentType + '; boundary=' + this.getBoundary(),
- 'content-length': this.getLengthSync()
- };
+ var formHeaders = {
+ 'content-type': contentType + '; boundary=' + this.getBoundary(),
+ 'content-length': this.getLengthSync()
+ };
- return formHeaders;
-}
+ return formHeaders;
+};
FormData.prototype.getBoundary = function() {
if (!this._boundary) {
@@ -251,7 +299,7 @@ FormData.prototype._generateBoundary = function() {
// Note: getLengthSync DOESN'T calculate streams length
// As workaround one can calculate file size manually
// and add it as knownLength option
-FormData.prototype.getLengthSync = function(debug) {
+FormData.prototype.getLengthSync = function() {
var knownLength = this._overheadLength + this._valueLength;
// Don't get confused, there are 3 "internal" streams for each keyval pair
@@ -260,9 +308,9 @@ FormData.prototype.getLengthSync = function(debug) {
knownLength += this._lastBoundary().length;
}
- // https://github.com/felixge/node-form-data/issues/40
+ // https://github.com/form-data/form-data/issues/40
if (this._lengthRetrievers.length) {
- // Some async length retrivers are present
+ // Some async length retrievers are present
// therefore synchronous length calculation is false.
// Please use getLength(callback) to get proper length
this._error(new Error('Cannot calculate proper length in synchronous way.'));
@@ -298,26 +346,25 @@ FormData.prototype.getLength = function(cb) {
};
FormData.prototype.submit = function(params, cb) {
-
var request
, options
- , defaults = {
- method : 'post'
- };
+ , defaults = {method: 'post'}
+ ;
// parse provided url if it's string
// or treat it as options object
if (typeof params == 'string') {
- params = parseUrl(params);
+ params = parseUrl(params);
options = populate({
port: params.port,
path: params.pathname,
host: params.hostname
}, defaults);
- }
- else // use custom params
- {
+
+ // use custom params
+ } else {
+
options = populate(params, defaults);
// if no port provided use default one
if (!options.port) {
@@ -337,8 +384,10 @@ FormData.prototype.submit = function(params, cb) {
// get content length and fire away
this.getLength(function(err, length) {
-
- // TODO: Add chunked encoding when no length (if err)
+ if (err) {
+ this._error(err);
+ return;
+ }
// add content length
request.setHeader('Content-Length', length);
@@ -354,21 +403,9 @@ FormData.prototype.submit = function(params, cb) {
};
FormData.prototype._error = function(err) {
- if (this.error) return;
-
- this.error = err;
- this.pause();
- this.emit('error', err);
-};
-
-/*
- * Santa's little helpers
- */
-
-// populates missing values
-function populate(dst, src) {
- for (var prop in src) {
- if (!dst[prop]) dst[prop] = src[prop];
+ if (!this.error) {
+ this.error = err;
+ this.pause();
+ this.emit('error', err);
}
- return dst;
-}
+};
diff --git a/node_modules/request/node_modules/form-data/lib/populate.js b/node_modules/request/node_modules/form-data/lib/populate.js
new file mode 100644
index 000000000..6f64a6d32
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/lib/populate.js
@@ -0,0 +1,9 @@
+// populates missing values
+module.exports = function(dst, src) {
+ for (var prop in src) {
+ if (src.hasOwnProperty(prop) && !dst[prop]) {
+ dst[prop] = src[prop];
+ }
+ }
+ return dst;
+};
diff --git a/node_modules/request/node_modules/form-data/package.json b/node_modules/request/node_modules/form-data/package.json
index 662e628b2..8977f984e 100644
--- a/node_modules/request/node_modules/form-data/package.json
+++ b/node_modules/request/node_modules/form-data/package.json
@@ -1,85 +1,129 @@
{
+ "_args": [
+ [
+ "form-data@~1.0.0-rc3",
+ "/Users/rebecca/code/npm/node_modules/request"
+ ]
+ ],
+ "_from": "form-data@>=1.0.0-rc3 <1.1.0",
+ "_id": "form-data@1.0.0-rc4",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/form-data",
+ "_nodeVersion": "0.12.11",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/form-data-1.0.0-rc4.tgz_1458059747097_0.14101114077493548"
+ },
+ "_npmUser": {
+ "email": "iam@alexindigo.com",
+ "name": "alexindigo"
+ },
+ "_npmVersion": "2.14.9",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "form-data",
+ "raw": "form-data@~1.0.0-rc3",
+ "rawSpec": "~1.0.0-rc3",
+ "scope": null,
+ "spec": ">=1.0.0-rc3 <1.1.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request"
+ ],
+ "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz",
+ "_shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e",
+ "_shrinkwrap": null,
+ "_spec": "form-data@~1.0.0-rc3",
+ "_where": "/Users/rebecca/code/npm/node_modules/request",
"author": {
- "name": "Felix Geisendörfer",
"email": "felix@debuggable.com",
+ "name": "Felix Geisendörfer",
"url": "http://debuggable.com/"
},
- "name": "form-data",
- "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
- "version": "1.0.0-rc3",
- "repository": {
- "type": "git",
- "url": "git://github.com/form-data/form-data.git"
- },
- "main": "./lib/form_data",
"browser": "./lib/browser",
- "scripts": {
- "test": "./test/run.js"
- },
- "pre-commit": [
- "test"
- ],
- "engines": {
- "node": ">= 0.10"
+ "bugs": {
+ "url": "https://github.com/form-data/form-data/issues"
},
"dependencies": {
- "async": "^1.4.0",
+ "async": "^1.5.2",
"combined-stream": "^1.0.5",
- "mime-types": "^2.1.3"
+ "mime-types": "^2.1.10"
},
- "license": "MIT",
+ "description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
"devDependencies": {
+ "codacy-coverage": "^1.1.3",
+ "coveralls": "^2.11.8",
+ "cross-spawn": "^2.1.5",
+ "eslint": "^2.4.0",
"fake": "^0.2.2",
"far": "^0.0.7",
"formidable": "^1.0.17",
- "pre-commit": "^1.0.10",
- "request": "^2.60.0"
- },
- "gitHead": "c174f1b7f3a78a00ec5af0360469280445e37804",
- "bugs": {
- "url": "https://github.com/form-data/form-data/issues"
- },
- "homepage": "https://github.com/form-data/form-data#readme",
- "_id": "form-data@1.0.0-rc3",
- "_shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
- "_from": "form-data@>=1.0.0-rc3 <1.1.0",
- "_npmVersion": "2.11.0",
- "_nodeVersion": "2.2.1",
- "_npmUser": {
- "name": "dylanpiercey",
- "email": "pierceydylan@gmail.com"
+ "istanbul": "^0.4.2",
+ "pre-commit": "^1.1.2",
+ "request": "^2.69.0",
+ "rimraf": "^2.5.2"
},
+ "directories": {},
"dist": {
- "shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
- "tarball": "http://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz"
+ "shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e",
+ "tarball": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz"
+ },
+ "engines": {
+ "node": ">= 0.10"
},
+ "gitHead": "f73996e0508ee2d4b2b376276adfac1de4188ac2",
+ "homepage": "https://github.com/form-data/form-data#readme",
+ "license": "MIT",
+ "main": "./lib/form_data",
"maintainers": [
{
- "name": "felixge",
- "email": "felix@debuggable.com"
+ "email": "felix@debuggable.com",
+ "name": "felixge"
},
{
- "name": "idralyuk",
- "email": "igor@buran.us"
+ "email": "igor@buran.us",
+ "name": "idralyuk"
},
{
- "name": "alexindigo",
- "email": "iam@alexindigo.com"
+ "email": "iam@alexindigo.com",
+ "name": "alexindigo"
},
{
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
+ "email": "mikeal.rogers@gmail.com",
+ "name": "mikeal"
},
{
- "name": "celer",
- "email": "dtyree77@gmail.com"
+ "email": "dtyree77@gmail.com",
+ "name": "celer"
},
{
- "name": "dylanpiercey",
- "email": "pierceydylan@gmail.com"
+ "email": "pierceydylan@gmail.com",
+ "name": "dylanpiercey"
}
],
- "directories": {},
- "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz",
- "readme": "ERROR: No README data found!"
+ "name": "form-data",
+ "optionalDependencies": {},
+ "pre-commit": [
+ "lint",
+ "test",
+ "check"
+ ],
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/form-data/form-data.git"
+ },
+ "scripts": {
+ "check": "istanbul check-coverage coverage/coverage*.json",
+ "coverage": "codacy-coverage < ./coverage/lcov.info; true",
+ "debug": "verbose=1 ./test/run.js",
+ "lint": "eslint lib/*.js test/*.js test/**/*.js",
+ "posttest": "istanbul report",
+ "predebug": "rimraf coverage test/tmp",
+ "pretest": "rimraf coverage test/tmp",
+ "test": "istanbul cover --report none test/run.js"
+ },
+ "version": "1.0.0-rc4"
}
diff --git a/node_modules/request/node_modules/form-data/wercker.yml b/node_modules/request/node_modules/form-data/wercker.yml
new file mode 100644
index 000000000..6b118d1e3
--- /dev/null
+++ b/node_modules/request/node_modules/form-data/wercker.yml
@@ -0,0 +1,36 @@
+# This references the default nodejs container from
+# the Docker Hub: https://registry.hub.docker.com/_/node/
+# If you want Nodesource's container you would reference nodesource/node
+# Read more about containers on our dev center
+# http://devcenter.wercker.com/docs/containers/index.html
+box: node
+# This is the build pipeline. Pipelines are the core of wercker
+# Read more about pipelines on our dev center
+# http://devcenter.wercker.com/docs/pipelines/index.html
+
+# You can also use services such as databases. Read more on our dev center:
+# http://devcenter.wercker.com/docs/services/index.html
+# services:
+ # - postgres
+ # http://devcenter.wercker.com/docs/services/postgresql.html
+
+ # - mongodb
+ # http://devcenter.wercker.com/docs/services/mongodb.html
+build:
+ # The steps that will be executed on build
+ # Steps make up the actions in your pipeline
+ # Read more about steps on our dev center:
+ # http://devcenter.wercker.com/docs/steps/index.html
+ steps:
+ # A step that executes `npm install` command
+ - npm-install
+ # A step that executes `npm test` command
+ - npm-test
+
+ # A custom script step, name value is used in the UI
+ # and the code value contains the command that get executed
+ - script:
+ name: echo nodejs information
+ code: |
+ echo "node version $(node -v) running"
+ echo "npm version $(npm -v) running"
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
index f2e9595b8..98f458038 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
@@ -1,38 +1,68 @@
{
- "name": "ansi-styles",
- "version": "2.1.0",
- "description": "ANSI escape codes for styling strings in the terminal",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/chalk/ansi-styles.git"
+ "_args": [
+ [
+ "ansi-styles@^2.2.1",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk"
+ ]
+ ],
+ "_from": "ansi-styles@>=2.2.1 <3.0.0",
+ "_id": "ansi-styles@2.2.1",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/har-validator/chalk/ansi-styles",
+ "_nodeVersion": "4.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176"
+ },
+ "_npmUser": {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
},
+ "_npmVersion": "3.8.3",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "ansi-styles",
+ "raw": "ansi-styles@^2.2.1",
+ "rawSpec": "^2.2.1",
+ "scope": null,
+ "spec": ">=2.2.1 <3.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/har-validator/chalk"
+ ],
+ "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz",
+ "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
+ "_shrinkwrap": null,
+ "_spec": "ansi-styles@^2.2.1",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk",
"author": {
- "name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
+ "name": "Sindre Sorhus",
"url": "sindresorhus.com"
},
- "maintainers": [
- {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- {
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "jbnicolai.com"
- }
- ],
+ "bugs": {
+ "url": "https://github.com/chalk/ansi-styles/issues"
+ },
+ "dependencies": {},
+ "description": "ANSI escape codes for styling strings in the terminal",
+ "devDependencies": {
+ "mocha": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe",
+ "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz"
+ },
"engines": {
"node": ">=0.10.0"
},
- "scripts": {
- "test": "mocha"
- },
"files": [
"index.js"
],
+ "gitHead": "95c59b23be760108b6530ca1c89477c21b258032",
+ "homepage": "https://github.com/chalk/ansi-styles#readme",
"keywords": [
"ansi",
"styles",
@@ -55,17 +85,22 @@
"command-line",
"text"
],
- "devDependencies": {
- "mocha": "*"
+ "license": "MIT",
+ "maintainers": [
+ {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ }
+ ],
+ "name": "ansi-styles",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/ansi-styles.git"
},
- "readme": "# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n![](screenshot.png)\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## Advanced usage\n\nBy default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
- "bugs": {
- "url": "https://github.com/chalk/ansi-styles/issues"
+ "scripts": {
+ "test": "mocha"
},
- "homepage": "https://github.com/chalk/ansi-styles#readme",
- "_id": "ansi-styles@2.1.0",
- "_shasum": "990f747146927b559a932bf92959163d60c0d0e2",
- "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz",
- "_from": "ansi-styles@>=2.1.0 <3.0.0"
+ "version": "2.2.1"
}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
index 5811067ac..139993354 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
@@ -6,16 +6,20 @@
]
],
"_from": "escape-string-regexp@>=1.0.2 <2.0.0",
- "_id": "escape-string-regexp@1.0.4",
+ "_id": "escape-string-regexp@1.0.5",
"_inCache": true,
"_installable": true,
"_location": "/request/har-validator/chalk/escape-string-regexp",
- "_nodeVersion": "4.2.1",
+ "_nodeVersion": "4.2.6",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477"
+ },
"_npmUser": {
- "email": "sindresorhus@gmail.com",
- "name": "sindresorhus"
+ "email": "jappelman@xebia.com",
+ "name": "jbnicolai"
},
- "_npmVersion": "2.14.7",
+ "_npmVersion": "2.14.12",
"_phantomChildren": {},
"_requested": {
"name": "escape-string-regexp",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/har-validator/chalk"
],
- "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz",
- "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
+ "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
"_shrinkwrap": null,
"_spec": "escape-string-regexp@^1.0.2",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk",
@@ -49,8 +53,8 @@
},
"directories": {},
"dist": {
- "shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
- "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz"
+ "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
+ "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
},
"engines": {
"node": ">=0.8.0"
@@ -58,29 +62,29 @@
"files": [
"index.js"
],
- "gitHead": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97",
+ "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20",
"homepage": "https://github.com/sindresorhus/escape-string-regexp",
"keywords": [
- "characters",
"escape",
- "expression",
- "re",
"regex",
"regexp",
+ "re",
"regular",
- "special",
+ "expression",
+ "string",
"str",
- "string"
+ "special",
+ "characters"
],
"license": "MIT",
"maintainers": [
{
- "name": "sindresorhus",
- "email": "sindresorhus@gmail.com"
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
},
{
- "name": "jbnicolai",
- "email": "jappelman@xebia.com"
+ "email": "jappelman@xebia.com",
+ "name": "jbnicolai"
}
],
"name": "escape-string-regexp",
@@ -93,5 +97,5 @@
"scripts": {
"test": "xo && ava"
},
- "version": "1.0.4"
+ "version": "1.0.5"
}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
index 2ad36d4d9..cf2ae5bd3 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
+++ b/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
@@ -1,41 +1,78 @@
{
- "name": "chalk",
- "version": "1.1.1",
- "description": "Terminal string styling done right. Much color.",
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/chalk/chalk.git"
+ "_args": [
+ [
+ "chalk@^1.1.1",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator"
+ ]
+ ],
+ "_from": "chalk@>=1.1.1 <2.0.0",
+ "_id": "chalk@1.1.3",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/har-validator/chalk",
+ "_nodeVersion": "0.10.32",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276"
},
- "maintainers": [
- {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- {
- "name": "Joshua Appelman",
- "email": "jappelman@xebia.com",
- "url": "jbnicolai.com"
- },
- {
- "name": "JD Ballard",
- "email": "i.am.qix@gmail.com",
- "url": "github.com/qix-"
- }
+ "_npmUser": {
+ "email": "i.am.qix@gmail.com",
+ "name": "qix"
+ },
+ "_npmVersion": "2.14.2",
+ "_phantomChildren": {
+ "ansi-regex": "2.0.0"
+ },
+ "_requested": {
+ "name": "chalk",
+ "raw": "chalk@^1.1.1",
+ "rawSpec": "^1.1.1",
+ "scope": null,
+ "spec": ">=1.1.1 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/har-validator"
],
+ "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+ "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98",
+ "_shrinkwrap": null,
+ "_spec": "chalk@^1.1.1",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator",
+ "bugs": {
+ "url": "https://github.com/chalk/chalk/issues"
+ },
+ "dependencies": {
+ "ansi-styles": "^2.2.1",
+ "escape-string-regexp": "^1.0.2",
+ "has-ansi": "^2.0.0",
+ "strip-ansi": "^3.0.0",
+ "supports-color": "^2.0.0"
+ },
+ "description": "Terminal string styling done right. Much color.",
+ "devDependencies": {
+ "coveralls": "^2.11.2",
+ "matcha": "^0.6.0",
+ "mocha": "*",
+ "nyc": "^3.0.0",
+ "require-uncached": "^1.0.2",
+ "resolve-from": "^1.0.0",
+ "semver": "^4.3.3",
+ "xo": "*"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98",
+ "tarball": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz"
+ },
"engines": {
"node": ">=0.10.0"
},
- "scripts": {
- "test": "xo && mocha",
- "bench": "matcha benchmark.js",
- "coverage": "nyc npm test && nyc report",
- "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls"
- },
"files": [
"index.js"
],
+ "gitHead": "0d8d8c204eb87a4038219131ad4d8369c9f59d24",
+ "homepage": "https://github.com/chalk/chalk#readme",
"keywords": [
"color",
"colour",
@@ -59,37 +96,39 @@
"command-line",
"text"
],
- "dependencies": {
- "ansi-styles": "^2.1.0",
- "escape-string-regexp": "^1.0.2",
- "has-ansi": "^2.0.0",
- "strip-ansi": "^3.0.0",
- "supports-color": "^2.0.0"
+ "license": "MIT",
+ "maintainers": [
+ {
+ "email": "i.am.qix@gmail.com",
+ "name": "qix"
+ },
+ {
+ "email": "sindresorhus@gmail.com",
+ "name": "sindresorhus"
+ },
+ {
+ "email": "sindresorhus+unicorn@gmail.com",
+ "name": "unicorn"
+ }
+ ],
+ "name": "chalk",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/chalk.git"
},
- "devDependencies": {
- "coveralls": "^2.11.2",
- "matcha": "^0.6.0",
- "mocha": "*",
- "nyc": "^3.0.0",
- "require-uncached": "^1.0.2",
- "resolve-from": "^1.0.0",
- "semver": "^4.3.3",
- "xo": "*"
+ "scripts": {
+ "bench": "matcha benchmark.js",
+ "coverage": "nyc npm test && nyc report",
+ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
+ "test": "xo && mocha"
},
+ "version": "1.1.3",
"xo": {
"envs": [
"node",
"mocha"
]
- },
- "readme": "<h1 align=\"center\">\n\t<br>\n\t<br>\n\t<img width=\"360\" src=\"https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg\" alt=\"chalk\">\n\t<br>\n\t<br>\n\t<br>\n</h1>\n\n> Terminal string styling done right\n\n[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)\n[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)\n[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)\n\n\n[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\n\n## Why\n\n- Highly performant\n- Doesn't extend `String.prototype`\n- Expressive API\n- Ability to nest styles\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015\n\n\n## Install\n\n```\n$ npm install --save chalk\n```\n\n\n## Usage\n\nChalk comes with an easy to use composable API where you just chain and nest the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nchalk.blue('Hello world!');\n\n// combine styled and normal strings\nchalk.blue('Hello') + 'World' + chalk.red('!');\n\n// compose multiple styles using the chainable API\nchalk.blue.bgRed.bold('Hello world!');\n\n// pass in multiple arguments\nchalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');\n\n// nest styles\nchalk.red('Hello', chalk.underline.bgBlue('world') + '!');\n\n// nest styles of the same type even (color, underline, background)\nchalk.green(\n\t'I am a green line ' +\n\tchalk.blue.underline.bold('with a blue substring') +\n\t' that becomes green again!'\n);\n```\n\nEasily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\nTake advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).\n\n```js\nvar name = 'Sindre';\nconsole.log(chalk.green('Hello %s'), name);\n//=> Hello Sindre\n```\n\n\n## API\n\n### chalk.`<style>[.<style>...](string, [string...])`\n\nExample: `chalk.red.bold.underline('Hello', 'world');`\n\nChain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.\n\nMultiple arguments will be separated by space.\n\n### chalk.enabled\n\nColor support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.\n\nIf you need to change this in a reusable module create a new instance:\n\n```js\nvar ctx = new chalk.constructor({enabled: false});\n```\n\n### chalk.supportsColor\n\nDetect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.\n\nCan be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n### chalk.styles\n\nExposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).\n\nGenerally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.\n\n```js\nvar chalk = require('chalk');\n\nconsole.log(chalk.styles.red);\n//=> {open: '\\u001b[31m', close: '\\u001b[39m'}\n\nconsole.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);\n```\n\n### chalk.hasColor(string)\n\nCheck whether a string [has color](https://github.com/chalk/has-ansi).\n\n### chalk.stripColor(string)\n\n[Strip color](https://github.com/chalk/strip-ansi) from a string.\n\nCan be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.\n\nExample:\n\n```js\nvar chalk = require('chalk');\nvar styledString = getText();\n\nif (!chalk.supportsColor) {\n\tstyledString = chalk.stripColor(styledString);\n}\n```\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue` *(on Windows the bright version is used as normal blue is illegible)*\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## 256-colors\n\nChalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.\n\n\n## Windows\n\nIf you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.\n\n\n## Related\n\n- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module\n- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal\n- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color\n- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes\n- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes\n- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes\n- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
- "readmeFilename": "readme.md",
- "bugs": {
- "url": "https://github.com/chalk/chalk/issues"
- },
- "homepage": "https://github.com/chalk/chalk#readme",
- "_id": "chalk@1.1.1",
- "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019",
- "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz",
- "_from": "chalk@>=1.1.1 <2.0.0"
+ }
}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
index cbf2b20d3..104a425ad 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md
@@ -40,7 +40,7 @@ console.log(validate.errors)
You can also pass the schema as a string
``` js
-var validate = validate('{"type": ... }')
+var validate = validator('{"type": ... }')
```
Optionally you can use the require submodule to load a schema from `__dirname`
@@ -128,7 +128,7 @@ var validate = validator({
})
validate({hello: 100});
-console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100}
+console.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100, type: 'string'}
```
## Greedy mode tries to validate as much as possible
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
index f24db9b1c..f929bb753 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/index.js
@@ -5,7 +5,6 @@ var xtend = require('xtend')
var formats = require('./formats')
var get = function(obj, additionalSchemas, ptr) {
- if (/^https?:\/\//.test(ptr)) return null
var visit = function(sub) {
if (sub && sub.id === ptr) return sub
@@ -98,13 +97,25 @@ var unique = function(array) {
return true
}
+var isMultipleOf = function(name, multipleOf) {
+ var res;
+ var factor = ((multipleOf | 0) !== multipleOf) ? Math.pow(10, multipleOf.toString().split('.').pop().length) : 1
+ if (factor > 1) {
+ var factorName = ((name | 0) !== name) ? Math.pow(10, name.toString().split('.').pop().length) : 1
+ if (factorName > factor) res = true
+ else res = Math.round(factor * name) % (factor * multipleOf)
+ }
+ else res = name % multipleOf;
+ return !res;
+}
+
var toType = function(node) {
return node.type
}
var compile = function(schema, cache, root, reporter, opts) {
var fmts = opts ? xtend(formats, opts.formats) : formats
- var scope = {unique:unique, formats:fmts}
+ var scope = {unique:unique, formats:fmts, isMultipleOf:isMultipleOf}
var verbose = opts ? !!opts.verbose : false;
var greedy = opts && opts.greedy !== undefined ?
opts.greedy : false;
@@ -150,7 +161,7 @@ var compile = function(schema, cache, root, reporter, opts) {
if (reporter === true) {
validate('if (validate.errors === null) validate.errors = []')
if (verbose) {
- validate('validate.errors.push({field:%s,message:%s,value:%s})', formatName(prop || name), JSON.stringify(msg), value || name)
+ validate('validate.errors.push({field:%s,message:%s,value:%s,type:%s})', formatName(prop || name), JSON.stringify(msg), value || name, JSON.stringify(type))
} else {
validate('validate.errors.push({field:%s,message:%s})', formatName(prop || name), JSON.stringify(msg))
}
@@ -434,9 +445,7 @@ var compile = function(schema, cache, root, reporter, opts) {
if (node.multipleOf !== undefined) {
if (type !== 'number' && type !== 'integer') validate('if (%s) {', types.number(name))
- var factor = ((node.multipleOf | 0) !== node.multipleOf) ? Math.pow(10, node.multipleOf.toString().split('.').pop().length) : 1
- if (factor > 1) validate('if ((%d*%s) % %d) {', factor, name, factor*node.multipleOf)
- else validate('if (%s % %d) {', name, node.multipleOf)
+ validate('if (!isMultipleOf(%s, %d)) {', name, node.multipleOf)
error('has a remainder')
validate('}')
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
index 5a7c28832..97fba32e7 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
@@ -6,11 +6,15 @@
]
],
"_from": "is-my-json-valid@>=2.12.4 <3.0.0",
- "_id": "is-my-json-valid@2.12.4",
+ "_id": "is-my-json-valid@2.13.1",
"_inCache": true,
"_installable": true,
"_location": "/request/har-validator/is-my-json-valid",
"_nodeVersion": "4.2.3",
+ "_npmOperationalInternal": {
+ "host": "packages-5-east.internal.npmjs.com",
+ "tmp": "tmp/is-my-json-valid-2.13.1.tgz_1456180270224_0.17748022079467773"
+ },
"_npmUser": {
"email": "mathiasbuus@gmail.com",
"name": "mafintosh"
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/har-validator"
],
- "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz",
- "_shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880",
+ "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz",
+ "_shasum": "d55778a82feb6b0963ff4be111d5d1684e890707",
"_shrinkwrap": null,
"_spec": "is-my-json-valid@^2.12.4",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator",
@@ -51,35 +55,35 @@
},
"directories": {},
"dist": {
- "shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880",
- "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz"
+ "shasum": "d55778a82feb6b0963ff4be111d5d1684e890707",
+ "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz"
},
- "gitHead": "8978aa8f40eef4ac47a5d18270c13abd48927ddb",
+ "gitHead": "5bacc71441750bc6e79829abcfc21d4f2f0c4396",
"homepage": "https://github.com/mafintosh/is-my-json-valid",
"keywords": [
"json",
- "jsonschema",
+ "schema",
"orderly",
- "schema"
+ "jsonschema"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
- "name": "freeall",
- "email": "freeall@gmail.com"
+ "email": "freeall@gmail.com",
+ "name": "freeall"
},
{
- "name": "mafintosh",
- "email": "mathiasbuus@gmail.com"
+ "email": "mathiasbuus@gmail.com",
+ "name": "mafintosh"
},
{
- "name": "watson",
- "email": "w@tson.dk"
+ "email": "w@tson.dk",
+ "name": "watson"
},
{
- "name": "yoshuawuyts",
- "email": "i@yoshuawuyts.com"
+ "email": "i@yoshuawuyts.com",
+ "name": "yoshuawuyts"
}
],
"name": "is-my-json-valid",
@@ -92,5 +96,5 @@
"scripts": {
"test": "tape test/*.js"
},
- "version": "2.12.4"
+ "version": "2.13.1"
}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
index ca3b76180..c13b2670b 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json
@@ -56,5 +56,41 @@
"valid": false
}
]
+ },
+ {
+ "description": "by decimal number where floating point precision is wrong",
+ "schema": {"multipleOf": 0.01},
+ "tests": [
+ {
+ "description": "Number 2 is multiple of 0.01",
+ "data": 2,
+ "valid": true
+ },
+ {
+ "description": "Number 2.1 is multiple of 0.01",
+ "data": 2.1,
+ "valid": true
+ },
+ {
+ "description": "Number 2.2 is multiple of 0.01",
+ "data": 2.2,
+ "valid": true
+ },
+ {
+ "description": "Number 2.3 is multiple of 0.01",
+ "data": 2.3,
+ "valid": true
+ },
+ {
+ "description": "Number 2.4 is multiple of 0.01",
+ "data": 2.4,
+ "valid": true
+ },
+ {
+ "description": "Number 1.211 is not multiple of 0.01",
+ "data": 1.211,
+ "valid": false
+ }
+ ]
}
]
diff --git a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
index b5109e576..275f2ac72 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
+++ b/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/misc.js
@@ -98,6 +98,7 @@ tape('additional props', function(t) {
t.ok(validate({}))
t.notOk(validate({foo:'bar'}))
t.ok(validate.errors[0].value === 'data.foo', 'should output the property not allowed in verbose mode')
+ t.strictEqual(validate.errors[0].type, 'object', 'error object should contain the type')
t.end()
})
@@ -278,6 +279,22 @@ tape('external schemas', function(t) {
t.end()
})
+tape('external schema URIs', function(t) {
+ var ext = {type: 'string'}
+ var schema = {
+ required: true,
+ $ref: 'http://example.com/schemas/schemaURIs'
+ }
+
+ var opts = {schemas:{}};
+ opts.schemas['http://example.com/schemas/schemaURIs'] = ext;
+ var validate = validator(schema, opts)
+
+ t.ok(validate('hello string'), 'is a string')
+ t.notOk(validate(42), 'not a string')
+ t.end()
+})
+
tape('top-level external schema', function(t) {
var defs = {
"string": {
@@ -354,6 +371,7 @@ tape('verbose mode', function(t) {
t.ok(validate({hello: 'string'}), 'should be valid')
t.notOk(validate({hello: 100}), 'should not be valid')
t.strictEqual(validate.errors[0].value, 100, 'error object should contain the invalid value')
+ t.strictEqual(validate.errors[0].type, 'string', 'error object should contain the type')
t.end()
})
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
index fb36c2a45..14ce1bfe3 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
@@ -5,7 +5,7 @@ var SETTLED = 'settled';
var FULFILLED = 'fulfilled';
var REJECTED = 'rejected';
var NOOP = function () {};
-var isNode = typeof process !== 'undefined' && typeof process.emit === 'function';
+var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
var asyncQueue = [];
@@ -156,12 +156,12 @@ function publishRejection(promise) {
promise._state = REJECTED;
publish(promise);
if (!promise._handled && isNode) {
- process.emit('unhandledRejection', promise._data, promise);
+ global.process.emit('unhandledRejection', promise._data, promise);
}
}
function notifyRejectionHandled(promise) {
- process.emit('rejectionHandled', promise);
+ global.process.emit('rejectionHandled', promise);
}
/**
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json
index 2c263f29f..8cebb11e4 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json
@@ -2,20 +2,20 @@
"_args": [
[
"pinkie@^2.0.0",
- "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise"
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise"
]
],
"_from": "pinkie@>=2.0.0 <3.0.0",
- "_id": "pinkie@2.0.1",
+ "_id": "pinkie@2.0.4",
"_inCache": true,
"_installable": true,
"_location": "/request/har-validator/pinkie-promise/pinkie",
- "_nodeVersion": "4.2.0",
+ "_nodeVersion": "4.2.4",
"_npmUser": {
"email": "floatdrop@gmail.com",
"name": "floatdrop"
},
- "_npmVersion": "2.14.7",
+ "_npmVersion": "2.14.12",
"_phantomChildren": {},
"_requested": {
"name": "pinkie",
@@ -28,11 +28,11 @@
"_requiredBy": [
"/request/har-validator/pinkie-promise"
],
- "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.1.tgz",
- "_shasum": "4236c86fc29f261c2045bbe81f78cbb2a5e8306c",
+ "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+ "_shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870",
"_shrinkwrap": null,
"_spec": "pinkie@^2.0.0",
- "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise",
"author": {
"email": "floatdrop@gmail.com",
"name": "Vsevolod Strukchinsky",
@@ -53,8 +53,8 @@
},
"directories": {},
"dist": {
- "shasum": "4236c86fc29f261c2045bbe81f78cbb2a5e8306c",
- "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.1.tgz"
+ "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870",
+ "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -62,19 +62,19 @@
"files": [
"index.js"
],
- "gitHead": "11d969408e6004f50c3b442fe330f2ead7eb3619",
+ "gitHead": "8d4a92447a5c62bff9f89756caeb4c9c8770579b",
"homepage": "https://github.com/floatdrop/pinkie",
"keywords": [
- "es2015",
- "es6",
"promise",
- "promises"
+ "promises",
+ "es2015",
+ "es6"
],
"license": "MIT",
"maintainers": [
{
- "name": "floatdrop",
- "email": "floatdrop@gmail.com"
+ "email": "floatdrop@gmail.com",
+ "name": "floatdrop"
}
],
"name": "pinkie",
@@ -88,5 +88,5 @@
"coverage": "nyc report --reporter=text-lcov | coveralls",
"test": "xo && nyc mocha"
},
- "version": "2.0.1"
+ "version": "2.0.4"
}
diff --git a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md
index 7e0f95505..1565f9588 100644
--- a/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md
+++ b/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md
@@ -7,7 +7,7 @@
> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation
-[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)
+[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)
There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality.
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js b/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js
index 94e6a907d..3e0e286cd 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js
@@ -137,7 +137,8 @@ function write(key) {
for (i = 0; i < parts.length; ++i) {
var data = key.part[parts[i]].data;
- data = utils.mpNormalize(data);
+ if (algInfo.normalize !== false)
+ data = utils.mpNormalize(data);
buf.writeBuffer(data);
}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js
index d57285aeb..572b00ede 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js
@@ -139,7 +139,7 @@ function parseInteger(option, optstr, arg) {
function parsePositiveInteger(option, optstr, arg) {
assert.string(arg, 'arg');
var num = Number(arg);
- if (!/^[0-9]+$/.test(arg) || isNaN(num)) {
+ if (!/^[0-9]+$/.test(arg) || isNaN(num) || num === 0) {
throw new Error(format('arg for "%s" is not a positive integer: "%s"',
optstr, arg));
}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS
new file mode 100644
index 000000000..1923524fe
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS
@@ -0,0 +1,6 @@
+Dave Eddy <dave@daveeddy.com>
+Fred Kuo <fred.kuo@joyent.com>
+Lars-Magnus Skog <ralphtheninja@riseup.net>
+Mark Cavage <mcavage@gmail.com>
+Patrick Mooney <pmooney@pfmooney.com>
+Rob Gulewich <robert.gulewich@joyent.com>
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md
new file mode 100644
index 000000000..57d92bfdb
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md
@@ -0,0 +1,14 @@
+# assert-plus Changelog
+
+## 1.0.0
+
+- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input
+- Add assert.finite check. Previous assert.number callers should use this if
+ they expect Infinity inputs to throw.
+
+## 0.2.0
+
+- Fix `assert.object(null)` so it throws
+- Fix optional/arrayOf exports for non-type-of asserts
+- Add optiona/arrayOf exports for Stream/Date/Regex/uuid
+- Add basic unit test coverage
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md
new file mode 100644
index 000000000..ec200d161
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md
@@ -0,0 +1,162 @@
+# assert-plus
+
+This library is a super small wrapper over node's assert module that has two
+things: (1) the ability to disable assertions with the environment variable
+NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like
+`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks
+like this:
+
+```javascript
+ var assert = require('assert-plus');
+
+ function fooAccount(options, callback) {
+ assert.object(options, 'options');
+ assert.number(options.id, 'options.id');
+ assert.bool(options.isManager, 'options.isManager');
+ assert.string(options.name, 'options.name');
+ assert.arrayOfString(options.email, 'options.email');
+ assert.func(callback, 'callback');
+
+ // Do stuff
+ callback(null, {});
+ }
+```
+
+# API
+
+All methods that *aren't* part of node's core assert API are simply assumed to
+take an argument, and then a string 'name' that's not a message; `AssertionError`
+will be thrown if the assertion fails with a message like:
+
+ AssertionError: foo (string) is required
+ at test (/home/mark/work/foo/foo.js:3:9)
+ at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
+ at Module._compile (module.js:446:26)
+ at Object..js (module.js:464:10)
+ at Module.load (module.js:353:31)
+ at Function._load (module.js:311:12)
+ at Array.0 (module.js:484:10)
+ at EventEmitter._tickCallback (node.js:190:38)
+
+from:
+
+```javascript
+ function test(foo) {
+ assert.string(foo, 'foo');
+ }
+```
+
+There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`:
+
+```javascript
+ function test(foo) {
+ assert.arrayOfString(foo, 'foo');
+ }
+```
+
+You can assert IFF an argument is not `undefined` (i.e., an optional arg):
+
+```javascript
+ assert.optionalString(foo, 'foo');
+```
+
+Lastly, you can opt-out of assertion checking altogether by setting the
+environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have
+lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
+production. Be advised: The standard functions re-exported from `assert` are
+also disabled in assert-plus if NDEBUG is specified. Using them directly from
+the `assert` module avoids this behavior.
+
+The complete list of APIs is:
+
+* assert.array
+* assert.bool
+* assert.buffer
+* assert.func
+* assert.number
+* assert.finite
+* assert.object
+* assert.string
+* assert.stream
+* assert.date
+* assert.regexp
+* assert.uuid
+* assert.arrayOfArray
+* assert.arrayOfBool
+* assert.arrayOfBuffer
+* assert.arrayOfFunc
+* assert.arrayOfNumber
+* assert.arrayOfFinite
+* assert.arrayOfObject
+* assert.arrayOfString
+* assert.arrayOfStream
+* assert.arrayOfDate
+* assert.arrayOfRegexp
+* assert.arrayOfUuid
+* assert.optionalArray
+* assert.optionalBool
+* assert.optionalBuffer
+* assert.optionalFunc
+* assert.optionalNumber
+* assert.optionalFinite
+* assert.optionalObject
+* assert.optionalString
+* assert.optionalStream
+* assert.optionalDate
+* assert.optionalRegexp
+* assert.optionalUuid
+* assert.optionalArrayOfArray
+* assert.optionalArrayOfBool
+* assert.optionalArrayOfBuffer
+* assert.optionalArrayOfFunc
+* assert.optionalArrayOfNumber
+* assert.optionalArrayOfFinite
+* assert.optionalArrayOfObject
+* assert.optionalArrayOfString
+* assert.optionalArrayOfStream
+* assert.optionalArrayOfDate
+* assert.optionalArrayOfRegexp
+* assert.optionalArrayOfUuid
+* assert.AssertionError
+* assert.fail
+* assert.ok
+* assert.equal
+* assert.notEqual
+* assert.deepEqual
+* assert.notDeepEqual
+* assert.strictEqual
+* assert.notStrictEqual
+* assert.throws
+* assert.doesNotThrow
+* assert.ifError
+
+# Installation
+
+ npm install assert-plus
+
+## License
+
+The MIT License (MIT)
+Copyright (c) 2012 Mark Cavage
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+## Bugs
+
+See <https://github.com/mcavage/node-assert-plus/issues>.
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js
new file mode 100644
index 000000000..26f944eec
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js
@@ -0,0 +1,211 @@
+// Copyright (c) 2012, Mark Cavage. All rights reserved.
+// Copyright 2015 Joyent, Inc.
+
+var assert = require('assert');
+var Stream = require('stream').Stream;
+var util = require('util');
+
+
+///--- Globals
+
+/* JSSTYLED */
+var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
+
+
+///--- Internal
+
+function _capitalize(str) {
+ return (str.charAt(0).toUpperCase() + str.slice(1));
+}
+
+function _toss(name, expected, oper, arg, actual) {
+ throw new assert.AssertionError({
+ message: util.format('%s (%s) is required', name, expected),
+ actual: (actual === undefined) ? typeof (arg) : actual(arg),
+ expected: expected,
+ operator: oper || '===',
+ stackStartFunction: _toss.caller
+ });
+}
+
+function _getClass(arg) {
+ return (Object.prototype.toString.call(arg).slice(8, -1));
+}
+
+function noop() {
+ // Why even bother with asserts?
+}
+
+
+///--- Exports
+
+var types = {
+ bool: {
+ check: function (arg) { return typeof (arg) === 'boolean'; }
+ },
+ func: {
+ check: function (arg) { return typeof (arg) === 'function'; }
+ },
+ string: {
+ check: function (arg) { return typeof (arg) === 'string'; }
+ },
+ object: {
+ check: function (arg) {
+ return typeof (arg) === 'object' && arg !== null;
+ }
+ },
+ number: {
+ check: function (arg) {
+ return typeof (arg) === 'number' && !isNaN(arg);
+ }
+ },
+ finite: {
+ check: function (arg) {
+ return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
+ }
+ },
+ buffer: {
+ check: function (arg) { return Buffer.isBuffer(arg); },
+ operator: 'Buffer.isBuffer'
+ },
+ array: {
+ check: function (arg) { return Array.isArray(arg); },
+ operator: 'Array.isArray'
+ },
+ stream: {
+ check: function (arg) { return arg instanceof Stream; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ date: {
+ check: function (arg) { return arg instanceof Date; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ regexp: {
+ check: function (arg) { return arg instanceof RegExp; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ uuid: {
+ check: function (arg) {
+ return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
+ },
+ operator: 'isUUID'
+ }
+};
+
+function _setExports(ndebug) {
+ var keys = Object.keys(types);
+ var out;
+
+ /* re-export standard assert */
+ if (process.env.NODE_NDEBUG) {
+ out = noop;
+ } else {
+ out = function (arg, msg) {
+ if (!arg) {
+ _toss(msg, 'true', arg);
+ }
+ };
+ }
+
+ /* standard checks */
+ keys.forEach(function (k) {
+ if (ndebug) {
+ out[k] = noop;
+ return;
+ }
+ var type = types[k];
+ out[k] = function (arg, msg) {
+ if (!type.check(arg)) {
+ _toss(msg, k, type.operator, arg, type.actual);
+ }
+ };
+ });
+
+ /* optional checks */
+ keys.forEach(function (k) {
+ var name = 'optional' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ out[name] = function (arg, msg) {
+ if (arg === undefined || arg === null) {
+ return;
+ }
+ if (!type.check(arg)) {
+ _toss(msg, k, type.operator, arg, type.actual);
+ }
+ };
+ });
+
+ /* arrayOf checks */
+ keys.forEach(function (k) {
+ var name = 'arrayOf' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ var expected = '[' + k + ']';
+ out[name] = function (arg, msg) {
+ if (!Array.isArray(arg)) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ var i;
+ for (i = 0; i < arg.length; i++) {
+ if (!type.check(arg[i])) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ }
+ };
+ });
+
+ /* optionalArrayOf checks */
+ keys.forEach(function (k) {
+ var name = 'optionalArrayOf' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ var expected = '[' + k + ']';
+ out[name] = function (arg, msg) {
+ if (arg === undefined || arg === null) {
+ return;
+ }
+ if (!Array.isArray(arg)) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ var i;
+ for (i = 0; i < arg.length; i++) {
+ if (!type.check(arg[i])) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ }
+ };
+ });
+
+ /* re-export built-in assertions */
+ Object.keys(assert).forEach(function (k) {
+ if (k === 'AssertionError') {
+ out[k] = assert[k];
+ return;
+ }
+ if (ndebug) {
+ out[k] = noop;
+ return;
+ }
+ out[k] = assert[k];
+ });
+
+ /* export ourselves (for unit tests _only_) */
+ out._setExports = _setExports;
+
+ return out;
+}
+
+module.exports = _setExports(process.env.NODE_NDEBUG);
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json
new file mode 100644
index 000000000..5e7cfaadf
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json
@@ -0,0 +1,107 @@
+{
+ "_args": [
+ [
+ "assert-plus@^1.0.0",
+ "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash"
+ ]
+ ],
+ "_from": "assert-plus@>=1.0.0 <2.0.0",
+ "_id": "assert-plus@1.0.0",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/http-signature/sshpk/dashdash/assert-plus",
+ "_nodeVersion": "0.10.40",
+ "_npmUser": {
+ "email": "patrick.f.mooney@gmail.com",
+ "name": "pfmooney"
+ },
+ "_npmVersion": "3.3.9",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "assert-plus",
+ "raw": "assert-plus@^1.0.0",
+ "rawSpec": "^1.0.0",
+ "scope": null,
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request/http-signature/sshpk/dashdash"
+ ],
+ "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
+ "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
+ "_shrinkwrap": null,
+ "_spec": "assert-plus@^1.0.0",
+ "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash",
+ "author": {
+ "email": "mcavage@gmail.com",
+ "name": "Mark Cavage"
+ },
+ "bugs": {
+ "url": "https://github.com/mcavage/node-assert-plus/issues"
+ },
+ "contributors": [
+ {
+ "email": "dave@daveeddy.com",
+ "name": "Dave Eddy"
+ },
+ {
+ "email": "fred.kuo@joyent.com",
+ "name": "Fred Kuo"
+ },
+ {
+ "email": "ralphtheninja@riseup.net",
+ "name": "Lars-Magnus Skog"
+ },
+ {
+ "email": "mcavage@gmail.com",
+ "name": "Mark Cavage"
+ },
+ {
+ "email": "pmooney@pfmooney.com",
+ "name": "Patrick Mooney"
+ },
+ {
+ "email": "robert.gulewich@joyent.com",
+ "name": "Rob Gulewich"
+ }
+ ],
+ "dependencies": {},
+ "description": "Extra assertions on top of node's assert module",
+ "devDependencies": {
+ "faucet": "0.0.1",
+ "tape": "4.2.2"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
+ "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.8"
+ },
+ "homepage": "https://github.com/mcavage/node-assert-plus#readme",
+ "license": "MIT",
+ "main": "./assert.js",
+ "maintainers": [
+ {
+ "email": "mcavage@gmail.com",
+ "name": "mcavage"
+ },
+ {
+ "email": "patrick.f.mooney@gmail.com",
+ "name": "pfmooney"
+ }
+ ],
+ "name": "assert-plus",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mcavage/node-assert-plus.git"
+ },
+ "scripts": {
+ "test": "tape tests/*.js | ./node_modules/.bin/faucet"
+ },
+ "version": "1.0.0"
+}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json
index 75331bae2..81f871030 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json
@@ -6,15 +6,19 @@
]
],
"_from": "dashdash@>=1.10.1 <2.0.0",
- "_id": "dashdash@1.12.2",
+ "_id": "dashdash@1.13.0",
"_inCache": true,
"_installable": true,
"_location": "/request/http-signature/sshpk/dashdash",
+ "_npmOperationalInternal": {
+ "host": "packages-5-east.internal.npmjs.com",
+ "tmp": "tmp/dashdash-1.13.0.tgz_1455248887432_0.5643249636050314"
+ },
"_npmUser": {
"email": "trentm@gmail.com",
"name": "trentm"
},
- "_npmVersion": "1.4.28",
+ "_npmVersion": "1.4.29",
"_phantomChildren": {},
"_requested": {
"name": "dashdash",
@@ -27,8 +31,8 @@
"_requiredBy": [
"/request/http-signature/sshpk"
],
- "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.12.2.tgz",
- "_shasum": "1c6f70588498d047b8cd5777b32ba85a5e25be36",
+ "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz",
+ "_shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a",
"_shrinkwrap": null,
"_spec": "dashdash@>=1.10.1 <2.0.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk",
@@ -42,8 +46,8 @@
},
"contributors": [
{
- "name": "Trent Mick",
"email": "trentm@gmail.com",
+ "name": "Trent Mick",
"url": "http://trentm.com"
},
{
@@ -57,10 +61,14 @@
{
"name": "Patrick Mooney",
"url": "https://github.com/pfmooney"
+ },
+ {
+ "name": "Dave Pacheco",
+ "url": "https://github.com/davepacheco"
}
],
"dependencies": {
- "assert-plus": "^0.2.0"
+ "assert-plus": "^1.0.0"
},
"description": "A light, featureful and explicit option parsing library.",
"devDependencies": {
@@ -68,30 +76,30 @@
},
"directories": {},
"dist": {
- "shasum": "1c6f70588498d047b8cd5777b32ba85a5e25be36",
- "tarball": "http://registry.npmjs.org/dashdash/-/dashdash-1.12.2.tgz"
+ "shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a",
+ "tarball": "http://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz"
},
"engines": {
- "node": ">=0.8"
+ "node": ">=0.10"
},
- "gitHead": "d4248f21da0b30bd89c88ccee9bf6eac0e59f9f6",
+ "gitHead": "69425c9d9000d72c95e78ca43e3f84675f8f73ff",
"homepage": "https://github.com/trentm/node-dashdash",
"keywords": [
- "args",
- "bash",
- "cli",
- "command",
- "completion",
"option",
"parser",
- "parsing"
+ "parsing",
+ "cli",
+ "command",
+ "args",
+ "bash",
+ "completion"
],
"license": "MIT",
"main": "./lib/dashdash.js",
"maintainers": [
{
- "name": "trentm",
- "email": "trentm@gmail.com"
+ "email": "trentm@gmail.com",
+ "name": "trentm"
}
],
"name": "dashdash",
@@ -104,5 +112,5 @@
"scripts": {
"test": "nodeunit test/*.test.js"
},
- "version": "1.12.2"
+ "version": "1.13.0"
}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md
index 77c69bd5e..9debcb42f 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md
@@ -2,6 +2,59 @@ TweetNaCl.js Changelog
======================
+v0.14.1
+-------
+
+No code changes, just tweaked packaging and added COPYING.txt.
+
+
+v0.14.0
+-------
+
+* **Breaking change!** All functions from `nacl.util` have been removed. These
+ functions are no longer available:
+
+ nacl.util.decodeUTF8
+ nacl.util.encodeUTF8
+ nacl.util.decodeBase64
+ nacl.util.encodeBase64
+
+ If want to continue using them, you can include
+ <https://github.com/dchest/tweetnacl-util-js> package:
+
+ <script src="nacl.min.js"></script>
+ <script src="nacl-util.min.js"></script>
+
+ or
+
+ var nacl = require('tweetnacl');
+ nacl.util = require('tweetnacl-util');
+
+ However it is recommended to use better packages that have wider
+ compatibility and better performance. Functions from `nacl.util` were never
+ intended to be robust solution for string conversion and were included for
+ convenience: cryptography library is not the right place for them.
+
+ Currently calling these functions will throw error pointing to
+ `tweetnacl-util-js` (in the next version this error message will be removed).
+
+* Improved detection of available random number generators, making it possible
+ to use `nacl.randomBytes` and related functions in Web Workers without
+ changes.
+
+* Changes to testing (see README).
+
+
+v0.13.3
+-------
+
+No code changes.
+
+* Reverted license field in package.json to "Public domain".
+
+* Fixed typo in README.
+
+
v0.13.2
-------
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt
new file mode 100644
index 000000000..c2bd1e5b7
--- /dev/null
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt
@@ -0,0 +1,9 @@
+Public Domain
+
+The person who associated a work with this deed has dedicated the work to the
+public domain by waiving all of his or her rights to the work worldwide under
+copyright law, including all related and neighboring rights, to the extent
+allowed by law.
+
+You can copy, modify, distribute and perform the work, even for commercial
+purposes, all without asking permission.
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md
index 11bd3472c..c80bbed8d 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md
@@ -7,7 +7,7 @@ to JavaScript for modern browsers and Node.js. Public domain.
[![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master)
](https://travis-ci.org/dchest/tweetnacl-js)
-[Demo](https://dchest.github.io/tweetnacl-js/)
+Demo: <https://tweetnacl.js.org>
**:warning: Beta version. The library is stable and API is frozen, however
it has not been independently reviewed. If you can help reviewing it, please
@@ -26,8 +26,6 @@ Documentation
* [Hashing](#hashing)
* [Random bytes generation](#random-bytes-generation)
* [Constant-time comparison](#constant-time-comparison)
- * [Utilities](#utilities)
-* [Examples](#examples)
* [System requirements](#system-requirements)
* [Development and testing](#development-and-testing)
* [Contributors](#contributors)
@@ -67,10 +65,20 @@ or [download source code](https://github.com/dchest/tweetnacl-js/releases).
Usage
-------
+-----
All API functions accept and return bytes as `Uint8Array`s. If you need to
-encode or decode strings, use functions from `nacl.util` namespace.
+encode or decode strings, use functions from
+<https://github.com/dchest/tweetnacl-util-js> or one of the more robust codec
+packages.
+
+In Node.js v4 and later `Buffer` objects are backed by `Uint8Array`s, so you
+can freely pass them to TweetNaCl.js functions as arguments. The returned
+objects are still `Uint8Array`s, so if you need `Buffer`s, you'll have to
+convert them manually; make sure to convert using copying: `new Buffer(array)`,
+instead of sharing: `new Buffer(array.buffer)`, because some functions return
+subarrays of their buffers.
+
### Public-key authenticated encryption (box)
@@ -287,12 +295,6 @@ depending on the platform it runs on:
* `window.msCrypto.getRandomValues` (Internet Explorer 11)
* `crypto.randomBytes` (Node.js)
-Note that browsers are required to throw `QuotaExceededError` exception if
-requested `length` is more than 65536, so do not ask for more than 65536 bytes
-in *one call* (multiple calls to get as many bytes as you like are okay:
-browsers can generate infinite amount of random bytes without any bad
-consequences).
-
If the platform doesn't provide a suitable PRNG, the following functions,
which require random numbers, will throw exception:
@@ -326,30 +328,6 @@ Returns `false` if either of the arguments has zero length, or arguments have
different lengths, or their contents differ.
-### Utilities
-
-Encoding/decoding functions are provided for convenience. They are correct,
-however their performance and wide compatibility with uncommon runtimes is not
-something that is considered important compared to the simplicity and size of
-implementation. You can use third-party libraries if you need to.
-
-#### nacl.util.decodeUTF8(string)
-
-Decodes string and returns `Uint8Array` of bytes.
-
-#### nacl.util.encodeUTF8(array)
-
-Encodes `Uint8Array` or `Array` of bytes into string.
-
-#### nacl.util.decodeBase64(string)
-
-Decodes Base-64 encoded string and returns `Uint8Array` of bytes.
-
-#### nacl.util.encodeBase64(array)
-
-Encodes `Uint8Array` or `Array` of bytes into string using Base-64 encoding.
-
-
System requirements
-------------------
@@ -364,7 +342,7 @@ of:
Other systems:
-* Node.js (we test on 0.10 and later)
+* Node.js
Development and testing
@@ -385,32 +363,36 @@ Tests use minified version, so make sure to rebuild it every time you change
To run tests in Node.js:
- $ npm test
+ $ npm run test-node
By default all tests described here work on `nacl.min.js`. To test other
versions, set environment variable `NACL_SRC` to the file name you want to test.
For example, the following command will test fast minified version:
- $ NACL_SRC=nacl-fast.min.js npm test
+ $ NACL_SRC=nacl-fast.min.js npm run test-node
To run full suite of tests in Node.js, including comparing outputs of
JavaScript port to outputs of the original C version:
- $ npm run testall
+ $ npm run test-node-all
To prepare tests for browsers:
- $ npm run browser
+ $ npm run build-test-browser
and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to
run them.
-To run headless browser tests with `testling`:
+To run headless browser tests with `tape-run` (powered by Electron):
- $ npm run testling
+ $ npm run test-browser
(If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.)
+To run tests in both Node and Electron:
+
+ $ npm test
+
### Benchmarking
To run benchmarks in Node.js:
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js
index 6c4995848..5e4562fe8 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js
@@ -745,7 +745,7 @@ poly1305.prototype.finish = function(mac, macpos) {
}
g[9] -= (1 << 13);
- mask = (g[9] >>> ((2 * 8) - 1)) - 1;
+ mask = (c ^ 1) - 1;
for (i = 0; i < 10; i++) g[i] &= mask;
mask = ~mask;
for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];
@@ -2157,39 +2157,13 @@ function cleanup(arr) {
for (var i = 0; i < arr.length; i++) arr[i] = 0;
}
-nacl.util = {};
-
-nacl.util.decodeUTF8 = function(s) {
- var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length);
- for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
- return b;
-};
-
-nacl.util.encodeUTF8 = function(arr) {
- var i, s = [];
- for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i]));
- return decodeURIComponent(escape(s.join('')));
-};
-
-nacl.util.encodeBase64 = function(arr) {
- if (typeof btoa === 'undefined') {
- return (new Buffer(arr)).toString('base64');
- } else {
- var i, s = [], len = arr.length;
- for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i]));
- return btoa(s.join(''));
- }
-};
-
-nacl.util.decodeBase64 = function(s) {
- if (typeof atob === 'undefined') {
- return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0));
- } else {
- var i, d = atob(s), b = new Uint8Array(d.length);
- for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
- return b;
- }
-};
+// TODO: Completely remove this in v0.15.
+if (!nacl.util) {
+ nacl.util = {};
+ nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
+ throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');
+ };
+}
nacl.randomBytes = function(n) {
var b = new Uint8Array(n);
@@ -2386,26 +2360,22 @@ nacl.setPRNG = function(fn) {
(function() {
// Initialize PRNG if environment provides CSPRNG.
// If not, methods calling randombytes will throw.
- var crypto;
- if (typeof window !== 'undefined') {
- // Browser.
- if (window.crypto && window.crypto.getRandomValues) {
- crypto = window.crypto; // Standard
- } else if (window.msCrypto && window.msCrypto.getRandomValues) {
- crypto = window.msCrypto; // Internet Explorer 11+
- }
- if (crypto) {
- nacl.setPRNG(function(x, n) {
- var i, v = new Uint8Array(n);
- crypto.getRandomValues(v);
- for (i = 0; i < n; i++) x[i] = v[i];
- cleanup(v);
- });
- }
+ var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
+ if (crypto && crypto.getRandomValues) {
+ // Browsers.
+ var QUOTA = 65536;
+ nacl.setPRNG(function(x, n) {
+ var i, v = new Uint8Array(n);
+ for (i = 0; i < n; i += QUOTA) {
+ crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
+ }
+ for (i = 0; i < n; i++) x[i] = v[i];
+ cleanup(v);
+ });
} else if (typeof require !== 'undefined') {
// Node.js.
crypto = require('crypto');
- if (crypto) {
+ if (crypto && crypto.randomBytes) {
nacl.setPRNG(function(x, n) {
var i, v = crypto.randomBytes(n);
for (i = 0; i < n; i++) x[i] = v[i];
@@ -2415,4 +2385,4 @@ nacl.setPRNG = function(fn) {
}
})();
-})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {}));
+})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js
index 7072c2af4..624fbbe91 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js
@@ -1,2 +1,2 @@
-!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;_=_+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+g|0,L=L+v|0,C=C+b|0,R=R+d|0,z=z+A|0,r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=C>>>0&255,r[53]=C>>>8&255,r[54]=C>>>16&255,r[55]=C>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=z>>>0&255,r[61]=z>>>8&255,r[62]=z>>>16&255,r[63]=z>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=z>>>0&255,r[13]=z>>>8&255,r[14]=z>>>16&255,r[15]=z>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function g(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function v(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function b(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function d(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(b(h),b(h),b(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function _(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,g=0,v=0,b=0,d=0,A=0,_=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,C=0,R=0,z=n[0],P=n[1],O=n[2],N=n[3],F=n[4],I=n[5],j=n[6],G=n[7],Z=n[8],V=n[9],q=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*z,h+=e*P,a+=e*O,f+=e*N,s+=e*F,u+=e*I,c+=e*j,y+=e*G,l+=e*Z,w+=e*V,p+=e*q,g+=e*X,v+=e*D,b+=e*H,d+=e*J,A+=e*Q,e=t[1],h+=e*z,a+=e*P,f+=e*O,s+=e*N,u+=e*F,c+=e*I,y+=e*j,l+=e*G,w+=e*Z,p+=e*V,g+=e*q,v+=e*X,b+=e*D,d+=e*H,A+=e*J,_+=e*Q,e=t[2],a+=e*z,f+=e*P,s+=e*O,u+=e*N,c+=e*F,y+=e*I,l+=e*j,w+=e*G,p+=e*Z,g+=e*V,v+=e*q,b+=e*X,d+=e*D,A+=e*H,_+=e*J,U+=e*Q,e=t[3],f+=e*z,s+=e*P,u+=e*O,c+=e*N,y+=e*F,l+=e*I,w+=e*j,p+=e*G,g+=e*Z,v+=e*V,b+=e*q,d+=e*X,A+=e*D,_+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*z,u+=e*P,c+=e*O,y+=e*N,l+=e*F,w+=e*I,p+=e*j,g+=e*G,v+=e*Z,b+=e*V,d+=e*q,A+=e*X,_+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*z,c+=e*P,y+=e*O,l+=e*N,w+=e*F,p+=e*I,g+=e*j,v+=e*G,b+=e*Z,d+=e*V,A+=e*q,_+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*z,y+=e*P,l+=e*O,w+=e*N,p+=e*F,g+=e*I,v+=e*j,b+=e*G,d+=e*Z,A+=e*V,_+=e*q,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*z,l+=e*P,w+=e*O,p+=e*N,g+=e*F,v+=e*I,b+=e*j,d+=e*G,A+=e*Z,_+=e*V,U+=e*q,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*z,w+=e*P,p+=e*O,g+=e*N,v+=e*F,b+=e*I,d+=e*j,A+=e*G,_+=e*Z,U+=e*V,E+=e*q,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*z,p+=e*P,g+=e*O,v+=e*N,b+=e*F,d+=e*I,A+=e*j,_+=e*G,U+=e*Z,E+=e*V,x+=e*q,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*z,g+=e*P,v+=e*O,b+=e*N,d+=e*F,A+=e*I,_+=e*j,U+=e*G,E+=e*Z,x+=e*V,M+=e*q,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],g+=e*z,v+=e*P,b+=e*O,d+=e*N,A+=e*F,_+=e*I,U+=e*j,E+=e*G,x+=e*Z,M+=e*V,m+=e*q,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],v+=e*z,b+=e*P,d+=e*O,A+=e*N,_+=e*F,U+=e*I,E+=e*j,x+=e*G,M+=e*Z,m+=e*V,B+=e*q,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],b+=e*z,d+=e*P,A+=e*O,_+=e*N,U+=e*F,E+=e*I,x+=e*j,M+=e*G,m+=e*Z,B+=e*V,S+=e*q,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],d+=e*z,A+=e*P,_+=e*O,U+=e*N,E+=e*F,x+=e*I,M+=e*j,m+=e*G,B+=e*Z,S+=e*V,K+=e*q,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,C+=e*Q,e=t[15],A+=e*z,_+=e*P,U+=e*O,E+=e*N,x+=e*F,M+=e*I,m+=e*j,B+=e*G,S+=e*Z,K+=e*V,T+=e*q,Y+=e*X,k+=e*D,L+=e*H,C+=e*J,R+=e*Q,i+=38*_,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,g+=38*k,v+=38*L,b+=38*C,d+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=g,r[12]=v,r[13]=b,r[14]=d,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,d(a,f,e),d(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),d(a,f,e),d(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function C(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function z(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],C=r[2],R=r[3],z=r[4],P=r[5],O=r[6],N=r[7],F=t[0],I=t[1],j=t[2],G=t[3],Z=t[4],V=t[5],q=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=C,a=R,f=z,s=P,u=O,c=N,y=F,l=I,w=j,p=G,g=Z,v=V,b=q,d=X,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(z>>>14|Z<<18)^(z>>>18|Z<<14)^(Z>>>9|z<<23),M=(Z>>>14|z<<18)^(Z>>>18|z<<14)^(z>>>9|Z<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=z&P^~z&O,M=Z&V^~Z&q,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,_=65535&m|B<<16,x=A,M=_,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&C^L&C,M=F&I^F&j^I&j,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,d=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=_,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,C=i,R=h,z=a,P=f,O=s,N=u,k=c,I=y,j=l,G=w,Z=p,V=g,q=v,X=b,F=d,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],_=Y[(E+1)%16],x=(A>>>1|_<<31)^(A>>>8|_<<24)^A>>>7,M=(_>>>1|A<<31)^(_>>>8|A<<24)^(_>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],_=Y[(E+14)%16],x=(A>>>19|_<<13)^(_>>>29|A<<3)^A>>>6,M=(_>>>19|A<<13)^(A>>>29|_<<3)^(_>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=C,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=C=65535&S|K<<16,t[2]=j=65535&m|B<<16,x=R,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=G=65535&m|B<<16,x=z,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=z=65535&S|K<<16,t[4]=Z=65535&m|B<<16,x=P,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=P=65535&S|K<<16,t[5]=V=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=O=65535&S|K<<16,t[6]=q=65535&m|B<<16,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=N=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function P(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,z(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),z(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function O(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function N(r,t,n){var e;for(e=0;4>e;e++)d(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(v(r[0],er),v(r[1],or),v(r[2],or),v(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,N(r,t,e),O(t,r),O(r,r),N(r,t,e)}function j(r,t){var n=[$(),$(),$(),$()];v(n[0],fr),v(n[1],sr),v(n[2],or),m(n[3],fr,sr),I(r,n,t)}function G(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),P(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,j(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function Z(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*gr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*gr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*gr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function V(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;Z(r,n)}function q(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];P(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(P(f,r.subarray(32),n+32),V(f),j(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(P(a,r,n+64),V(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return Z(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return v(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),_(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),_(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(P(f,r,n),V(f),I(s,u,f),j(u,t.subarray(32)),O(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==vr)throw new Error("bad key size");if(t.length!==br)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t<arguments.length;t++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[t])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function W(r){for(var t=0;t<r.length;t++)r[t]=0}var $=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},rr=function(){throw new Error("no PRNG")},tr=new Uint8Array(16),nr=new Uint8Array(32);nr[0]=9;var er=$(),or=$([1]),ir=$([56129,1]),hr=$([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),ar=$([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),fr=$([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),sr=$([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ur=$([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),cr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),yr=function(r){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t,n,e,o,i,h,a,f;t=255&r[0]|(255&r[1])<<8,this.r[0]=8191&t,n=255&r[2]|(255&r[3])<<8,this.r[1]=8191&(t>>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],C=this.r[1],R=this.r[2],z=this.r[3],P=this.r[4],O=this.r[5],N=this.r[6],F=this.r[7],I=this.r[8],j=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=5*x*j,y+=5*M*I,y+=5*m*F,y+=5*B*N,c=y>>>13,y&=8191,y+=5*S*O,y+=5*K*P,y+=5*T*z,y+=5*Y*R,y+=5*k*C,c+=y>>>13,y&=8191,l=c,l+=E*C,l+=x*L,l+=5*M*j,l+=5*m*I,l+=5*B*F,c=l>>>13,l&=8191,l+=5*S*N,l+=5*K*O,l+=5*T*P,l+=5*Y*z,l+=5*k*R,c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*C,w+=M*L,w+=5*m*j,w+=5*B*I,c=w>>>13,w&=8191,w+=5*S*F,w+=5*K*N,w+=5*T*O,w+=5*Y*P,w+=5*k*z,c+=w>>>13,w&=8191,p=c,p+=E*z,p+=x*R,p+=M*C,p+=m*L,p+=5*B*j,c=p>>>13,p&=8191,p+=5*S*I,p+=5*K*F,p+=5*T*N,p+=5*Y*O,p+=5*k*P,c+=p>>>13,p&=8191,g=c,g+=E*P,g+=x*z,g+=M*R,g+=m*C,g+=B*L,c=g>>>13,g&=8191,g+=5*S*j,g+=5*K*I,g+=5*T*F,g+=5*Y*N,g+=5*k*O,c+=g>>>13,g&=8191,v=c,v+=E*O,v+=x*P,v+=M*z,v+=m*R,v+=B*C,c=v>>>13,v&=8191,v+=S*L,v+=5*K*j,v+=5*T*I,v+=5*Y*F,v+=5*k*N,c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*z,b+=B*R,c=b>>>13,b&=8191,b+=S*C,b+=K*L,b+=5*T*j,b+=5*Y*I,b+=5*k*F,c+=b>>>13,b&=8191,d=c,d+=E*F,d+=x*N,d+=M*O,d+=m*P,d+=B*z,c=d>>>13,d&=8191,d+=S*R,d+=K*C,d+=T*L,d+=5*Y*j,d+=5*k*I,c+=d>>>13,d&=8191,A=c,A+=E*I,A+=x*F,A+=M*N,A+=m*O,A+=B*P,c=A>>>13,A&=8191,A+=S*z,A+=K*R,A+=T*C,A+=Y*L,A+=5*k*j,c+=A>>>13,A&=8191,_=c,_+=E*j,_+=x*I,_+=M*F,_+=m*N,_+=B*O,c=_>>>13,_&=8191,_+=S*P,_+=K*z,_+=T*R,_+=Y*C,_+=k*L,c+=_>>>13,_&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=g,S=v,K=b,T=d,Y=A,k=_,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(h[9]>>>15)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=g,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],gr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),vr=32,br=24,dr=32,Ar=16,_r=32,Ur=32,Er=32,xr=32,Mr=32,mr=br,Br=dr,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:g,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:C,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:P,crypto_sign:q,crypto_sign_keypair:G,crypto_sign_open:D,crypto_secretbox_KEYBYTES:vr,crypto_secretbox_NONCEBYTES:br,crypto_secretbox_ZEROBYTES:dr,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:_r,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util={},r.util.decodeUTF8=function(r){var t,n=unescape(encodeURIComponent(r)),e=new Uint8Array(n.length);for(t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e},r.util.encodeUTF8=function(r){var t,n=[];for(t=0;t<r.length;t++)n.push(String.fromCharCode(r[t]));return decodeURIComponent(escape(n.join("")))},r.util.encodeBase64=function(r){if("undefined"==typeof btoa)return new Buffer(r).toString("base64");var t,n=[],e=r.length;for(t=0;e>t;t++)n.push(String.fromCharCode(r[t]));return btoa(n.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var t,n=atob(r),e=new Uint8Array(n.length);for(t=0;t<n.length;t++)e[t]=n.charCodeAt(t);return e},r.randomBytes=function(r){var t=new Uint8Array(r);return rr(t,r),t},r.secretbox=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(dr+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+dr]=r[i];return p(o,e,e.length,t,n),o.subarray(Ar)},r.secretbox.open=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(Ar+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+Ar]=r[i];return e.length<32?!1:0!==g(o,e,e.length,t,n)?!1:o.subarray(dr)},r.secretbox.keyLength=vr,r.secretbox.nonceLength=br,r.secretbox.overheadLength=Ar,r.scalarMult=function(r,t){if(Q(r,t),r.length!==Ur)throw new Error("bad n size");if(t.length!==_r)throw new Error("bad p size");var n=new Uint8Array(_r);return T(n,r,t),n},r.scalarMult.base=function(r){if(Q(r),r.length!==Ur)throw new Error("bad n size");var t=new Uint8Array(_r);return Y(t,r),t},r.scalarMult.scalarLength=Ur,r.scalarMult.groupElementLength=_r,r.box=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox(t,n,i)},r.box.before=function(r,t){Q(r,t),J(r,t);var n=new Uint8Array(Mr);return L(n,r,t),n},r.box.after=r.secretbox,r.box.open=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox.open(t,n,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Er),t=new Uint8Array(xr);return k(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==xr)throw new Error("bad secret key size");var t=new Uint8Array(Er);return Y(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Er,r.box.secretKeyLength=xr,r.box.sharedKeyLength=Mr,r.box.nonceLength=mr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(Q(r,t),t.length!==Yr)throw new Error("bad secret key size");var n=new Uint8Array(Kr+r.length);return q(n,r,r.length,t),n},r.sign.open=function(r,t){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Q(r,t),t.length!==Tr)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=D(n,r,r.length,t);if(0>e)return null;for(var o=new Uint8Array(e),i=0;i<o.length;i++)o[i]=n[i];return o},r.sign.detached=function(t,n){for(var e=r.sign(t,n),o=new Uint8Array(Kr),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(Q(r,t,n),t.length!==Kr)throw new Error("bad signature size");if(n.length!==Tr)throw new Error("bad public key size");var e,o=new Uint8Array(Kr+r.length),i=new Uint8Array(Kr+r.length);for(e=0;Kr>e;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+Kr]=r[e];return D(i,o,o.length,n)>=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return G(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;n<t.length;n++)t[n]=r[32+n];return{publicKey:t,secretKey:new Uint8Array(r)
-}},r.sign.keyPair.fromSeed=function(r){if(Q(r),r.length!==kr)throw new Error("bad seed size");for(var t=new Uint8Array(Tr),n=new Uint8Array(Yr),e=0;32>e;e++)n[e]=r[e];return G(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return P(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t),0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?t=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(t=window.msCrypto),t&&r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(t.getRandomValues(o),e=0;n>e;e++)r[e]=o[e];W(o)})):"undefined"!=typeof require&&(t=require("crypto"),t&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file
+!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;20>O;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;d=d+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+v|0,L=L+b|0,z=z+g|0,R=R+_|0,P=P+A|0,r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;20>O;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=P>>>0&255,r[13]=P>>>8&255,r[14]=P>>>16&255,r[15]=P>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function v(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function b(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function g(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function _(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(g(h),g(h),g(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,_(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function d(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,v=0,b=0,g=0,_=0,A=0,d=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,z=0,R=0,P=n[0],O=n[1],N=n[2],C=n[3],F=n[4],I=n[5],G=n[6],Z=n[7],j=n[8],q=n[9],V=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*P,h+=e*O,a+=e*N,f+=e*C,s+=e*F,u+=e*I,c+=e*G,y+=e*Z,l+=e*j,w+=e*q,p+=e*V,v+=e*X,b+=e*D,g+=e*H,_+=e*J,A+=e*Q,e=t[1],h+=e*P,a+=e*O,f+=e*N,s+=e*C,u+=e*F,c+=e*I,y+=e*G,l+=e*Z,w+=e*j,p+=e*q,v+=e*V,b+=e*X,g+=e*D,_+=e*H,A+=e*J,d+=e*Q,e=t[2],a+=e*P,f+=e*O,s+=e*N,u+=e*C,c+=e*F,y+=e*I,l+=e*G,w+=e*Z,p+=e*j,v+=e*q,b+=e*V,g+=e*X,_+=e*D,A+=e*H,d+=e*J,U+=e*Q,e=t[3],f+=e*P,s+=e*O,u+=e*N,c+=e*C,y+=e*F,l+=e*I,w+=e*G,p+=e*Z,v+=e*j,b+=e*q,g+=e*V,_+=e*X,A+=e*D,d+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*P,u+=e*O,c+=e*N,y+=e*C,l+=e*F,w+=e*I,p+=e*G,v+=e*Z,b+=e*j,g+=e*q,_+=e*V,A+=e*X,d+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*P,c+=e*O,y+=e*N,l+=e*C,w+=e*F,p+=e*I,v+=e*G,b+=e*Z,g+=e*j,_+=e*q,A+=e*V,d+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*P,y+=e*O,l+=e*N,w+=e*C,p+=e*F,v+=e*I,b+=e*G,g+=e*Z,_+=e*j,A+=e*q,d+=e*V,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*P,l+=e*O,w+=e*N,p+=e*C,v+=e*F,b+=e*I,g+=e*G,_+=e*Z,A+=e*j,d+=e*q,U+=e*V,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*P,w+=e*O,p+=e*N,v+=e*C,b+=e*F,g+=e*I,_+=e*G,A+=e*Z,d+=e*j,U+=e*q,E+=e*V,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*P,p+=e*O,v+=e*N,b+=e*C,g+=e*F,_+=e*I,A+=e*G,d+=e*Z,U+=e*j,E+=e*q,x+=e*V,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*P,v+=e*O,b+=e*N,g+=e*C,_+=e*F,A+=e*I,d+=e*G,U+=e*Z,E+=e*j,x+=e*q,M+=e*V,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],v+=e*P,b+=e*O,g+=e*N,_+=e*C,A+=e*F,d+=e*I,U+=e*G,E+=e*Z,x+=e*j,M+=e*q,m+=e*V,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],b+=e*P,g+=e*O,_+=e*N,A+=e*C,d+=e*F,U+=e*I,E+=e*G,x+=e*Z,M+=e*j,m+=e*q,B+=e*V,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],g+=e*P,_+=e*O,A+=e*N,d+=e*C,U+=e*F,E+=e*I,x+=e*G,M+=e*Z,m+=e*j,B+=e*q,S+=e*V,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],_+=e*P,A+=e*O,d+=e*N,U+=e*C,E+=e*F,x+=e*I,M+=e*G,m+=e*Z,B+=e*j,S+=e*q,K+=e*V,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,z+=e*Q,e=t[15],A+=e*P,d+=e*O,U+=e*N,E+=e*C,x+=e*F,M+=e*I,m+=e*G,B+=e*Z,S+=e*j,K+=e*q,T+=e*V,Y+=e*X,k+=e*D,L+=e*H,z+=e*J,R+=e*Q,i+=38*d,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,v+=38*k,b+=38*L,g+=38*z,_+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=v,r[12]=b,r[13]=g,r[14]=_,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,_(a,f,e),_(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),_(a,f,e),_(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function z(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function P(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,v,b,g,_,A,d,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],z=r[2],R=r[3],P=r[4],O=r[5],N=r[6],C=r[7],F=t[0],I=t[1],G=t[2],Z=t[3],j=t[4],q=t[5],V=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=z,a=R,f=P,s=O,u=N,c=C,y=F,l=I,w=G,p=Z,v=j,b=q,g=V,_=X,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(P>>>14|j<<18)^(P>>>18|j<<14)^(j>>>9|P<<23),M=(j>>>14|P<<18)^(j>>>18|P<<14)^(P>>>9|j<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=P&O^~P&N,M=j&q^~j&V,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,d=65535&m|B<<16,x=A,M=d,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&z^L&z,M=F&I^F&G^I&G,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,_=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=d,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,z=i,R=h,P=a,O=f,N=s,C=u,k=c,I=y,G=l,Z=w,j=p,q=v,V=b,X=g,F=_,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],d=Y[(E+1)%16],x=(A>>>1|d<<31)^(A>>>8|d<<24)^A>>>7,M=(d>>>1|A<<31)^(d>>>8|A<<24)^(d>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],d=Y[(E+14)%16],x=(A>>>19|d<<13)^(d>>>29|A<<3)^A>>>6,M=(d>>>19|A<<13)^(A>>>29|d<<3)^(d>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=z,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=z=65535&S|K<<16,t[2]=G=65535&m|B<<16,x=R,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=Z=65535&m|B<<16,x=P,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=P=65535&S|K<<16,t[4]=j=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=O=65535&S|K<<16,t[5]=q=65535&m|B<<16,x=N,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=N=65535&S|K<<16,t[6]=V=65535&m|B<<16,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=C=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function O(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,P(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),P(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function N(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function C(r,t,n){var e;for(e=0;4>e;e++)_(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(b(r[0],er),b(r[1],or),b(r[2],or),b(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,C(r,t,e),N(t,r),N(r,r),C(r,t,e)}function G(r,t){var n=[$(),$(),$(),$()];b(n[0],fr),b(n[1],sr),b(n[2],or),m(n[3],fr,sr),I(r,n,t)}function Z(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),O(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,G(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function j(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*vr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*vr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*vr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function q(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;j(r,n)}function V(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];O(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(O(f,r.subarray(32),n+32),q(f),G(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(O(a,r,n+64),q(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return j(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return b(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),d(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),d(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(O(f,r,n),q(f),I(s,u,f),G(u,t.subarray(32)),N(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==br)throw new Error("bad key size");if(t.length!==gr)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t<arguments.length;t++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[t])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function W(r){for(var t=0;t<r.length;t++)r[t]=0}var $=function(r){var t,n=new Float64Array(16);if(r)for(t=0;t<r.length;t++)n[t]=r[t];return n},rr=function(){throw new Error("no PRNG")},tr=new Uint8Array(16),nr=new Uint8Array(32);nr[0]=9;var er=$(),or=$([1]),ir=$([56129,1]),hr=$([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),ar=$([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),fr=$([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),sr=$([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),ur=$([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),cr=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),yr=function(r){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var t,n,e,o,i,h,a,f;t=255&r[0]|(255&r[1])<<8,this.r[0]=8191&t,n=255&r[2]|(255&r[3])<<8,this.r[1]=8191&(t>>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,v,b,g,_,A,d,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],O=this.r[4],N=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],G=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=x*(5*G),y+=M*(5*I),y+=m*(5*F),y+=B*(5*C),c=y>>>13,y&=8191,y+=S*(5*N),y+=K*(5*O),y+=T*(5*P),y+=Y*(5*R),y+=k*(5*z),c+=y>>>13,y&=8191,l=c,l+=E*z,l+=x*L,l+=M*(5*G),l+=m*(5*I),l+=B*(5*F),c=l>>>13,l&=8191,l+=S*(5*C),l+=K*(5*N),l+=T*(5*O),l+=Y*(5*P),l+=k*(5*R),c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*z,w+=M*L,w+=m*(5*G),w+=B*(5*I),c=w>>>13,w&=8191,w+=S*(5*F),w+=K*(5*C),w+=T*(5*N),w+=Y*(5*O),w+=k*(5*P),c+=w>>>13,w&=8191,p=c,p+=E*P,p+=x*R,p+=M*z,p+=m*L,p+=B*(5*G),c=p>>>13,p&=8191,p+=S*(5*I),p+=K*(5*F),p+=T*(5*C),p+=Y*(5*N),p+=k*(5*O),c+=p>>>13,p&=8191,v=c,v+=E*O,v+=x*P,v+=M*R,v+=m*z,v+=B*L,c=v>>>13,v&=8191,v+=S*(5*G),v+=K*(5*I),v+=T*(5*F),v+=Y*(5*C),v+=k*(5*N),c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*R,b+=B*z,c=b>>>13,b&=8191,b+=S*L,b+=K*(5*G),b+=T*(5*I),b+=Y*(5*F),b+=k*(5*C),c+=b>>>13,b&=8191,g=c,g+=E*C,g+=x*N,g+=M*O,g+=m*P,g+=B*R,c=g>>>13,g&=8191,g+=S*z,g+=K*L,g+=T*(5*G),g+=Y*(5*I),g+=k*(5*F),c+=g>>>13,g&=8191,_=c,_+=E*F,_+=x*C,_+=M*N,_+=m*O,_+=B*P,c=_>>>13,_&=8191,_+=S*R,_+=K*z,_+=T*L,_+=Y*(5*G),_+=k*(5*I),c+=_>>>13,_&=8191,A=c,A+=E*I,A+=x*F,A+=M*C,A+=m*N,A+=B*O,c=A>>>13,A&=8191,A+=S*P,A+=K*R,A+=T*z,A+=Y*L,A+=k*(5*G),c+=A>>>13,A&=8191,d=c,d+=E*G,d+=x*I,d+=M*F,d+=m*C,d+=B*N,c=d>>>13,d&=8191,d+=S*O,d+=K*P,d+=T*R,d+=Y*z,d+=k*L,c+=d>>>13,d&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=v,S=b,K=g,T=_,Y=A,k=d,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=v,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],vr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),br=32,gr=24,_r=32,Ar=16,dr=32,Ur=32,Er=32,xr=32,Mr=32,mr=gr,Br=_r,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:v,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:z,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:O,crypto_sign:V,crypto_sign_keypair:Z,crypto_sign_open:D,crypto_secretbox_KEYBYTES:br,crypto_secretbox_NONCEBYTES:gr,crypto_secretbox_ZEROBYTES:_r,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:dr,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util||(r.util={},r.util.decodeUTF8=r.util.encodeUTF8=r.util.encodeBase64=r.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),r.randomBytes=function(r){var t=new Uint8Array(r);return rr(t,r),t},r.secretbox=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(_r+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+_r]=r[i];return p(o,e,e.length,t,n),o.subarray(Ar)},r.secretbox.open=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(Ar+r.length),o=new Uint8Array(e.length),i=0;i<r.length;i++)e[i+Ar]=r[i];return e.length<32?!1:0!==v(o,e,e.length,t,n)?!1:o.subarray(_r)},r.secretbox.keyLength=br,r.secretbox.nonceLength=gr,r.secretbox.overheadLength=Ar,r.scalarMult=function(r,t){if(Q(r,t),r.length!==Ur)throw new Error("bad n size");if(t.length!==dr)throw new Error("bad p size");var n=new Uint8Array(dr);return T(n,r,t),n},r.scalarMult.base=function(r){if(Q(r),r.length!==Ur)throw new Error("bad n size");var t=new Uint8Array(dr);return Y(t,r),t},r.scalarMult.scalarLength=Ur,r.scalarMult.groupElementLength=dr,r.box=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox(t,n,i)},r.box.before=function(r,t){Q(r,t),J(r,t);var n=new Uint8Array(Mr);return L(n,r,t),n},r.box.after=r.secretbox,r.box.open=function(t,n,e,o){var i=r.box.before(e,o);return r.secretbox.open(t,n,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Er),t=new Uint8Array(xr);return k(r,t),{publicKey:r,secretKey:t}},r.box.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==xr)throw new Error("bad secret key size");var t=new Uint8Array(Er);return Y(t,r),{publicKey:t,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Er,r.box.secretKeyLength=xr,r.box.sharedKeyLength=Mr,r.box.nonceLength=mr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,t){if(Q(r,t),t.length!==Yr)throw new Error("bad secret key size");var n=new Uint8Array(Kr+r.length);return V(n,r,r.length,t),n},r.sign.open=function(r,t){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(Q(r,t),t.length!==Tr)throw new Error("bad public key size");var n=new Uint8Array(r.length),e=D(n,r,r.length,t);if(0>e)return null;for(var o=new Uint8Array(e),i=0;i<o.length;i++)o[i]=n[i];return o},r.sign.detached=function(t,n){for(var e=r.sign(t,n),o=new Uint8Array(Kr),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached.verify=function(r,t,n){if(Q(r,t,n),t.length!==Kr)throw new Error("bad signature size");if(n.length!==Tr)throw new Error("bad public key size");var e,o=new Uint8Array(Kr+r.length),i=new Uint8Array(Kr+r.length);for(e=0;Kr>e;e++)o[e]=t[e];for(e=0;e<r.length;e++)o[e+Kr]=r[e];return D(i,o,o.length,n)>=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return Z(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;n<t.length;n++)t[n]=r[32+n];return{publicKey:t,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(Q(r),r.length!==kr)throw new Error("bad seed size");for(var t=new Uint8Array(Tr),n=new Uint8Array(Yr),e=0;32>e;e++)n[e]=r[e];return Z(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return O(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t),
+0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){var n=65536;r.setPRNG(function(r,e){var o,i=new Uint8Array(e);for(o=0;e>o;o+=n)t.getRandomValues(i.subarray(o,o+Math.min(e-o,n)));for(o=0;e>o;o++)r[o]=i[o];W(i)})}else"undefined"!=typeof require&&(t=require("crypto"),t&&t.randomBytes&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{}); \ No newline at end of file
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js
index b8edbbee6..f72dd78d1 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js
@@ -944,39 +944,13 @@ function cleanup(arr) {
for (var i = 0; i < arr.length; i++) arr[i] = 0;
}
-nacl.util = {};
-
-nacl.util.decodeUTF8 = function(s) {
- var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length);
- for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
- return b;
-};
-
-nacl.util.encodeUTF8 = function(arr) {
- var i, s = [];
- for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i]));
- return decodeURIComponent(escape(s.join('')));
-};
-
-nacl.util.encodeBase64 = function(arr) {
- if (typeof btoa === 'undefined') {
- return (new Buffer(arr)).toString('base64');
- } else {
- var i, s = [], len = arr.length;
- for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i]));
- return btoa(s.join(''));
- }
-};
-
-nacl.util.decodeBase64 = function(s) {
- if (typeof atob === 'undefined') {
- return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0));
- } else {
- var i, d = atob(s), b = new Uint8Array(d.length);
- for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i);
- return b;
- }
-};
+// TODO: Completely remove this in v0.15.
+if (!nacl.util) {
+ nacl.util = {};
+ nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
+ throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');
+ };
+}
nacl.randomBytes = function(n) {
var b = new Uint8Array(n);
@@ -1173,26 +1147,22 @@ nacl.setPRNG = function(fn) {
(function() {
// Initialize PRNG if environment provides CSPRNG.
// If not, methods calling randombytes will throw.
- var crypto;
- if (typeof window !== 'undefined') {
- // Browser.
- if (window.crypto && window.crypto.getRandomValues) {
- crypto = window.crypto; // Standard
- } else if (window.msCrypto && window.msCrypto.getRandomValues) {
- crypto = window.msCrypto; // Internet Explorer 11+
- }
- if (crypto) {
- nacl.setPRNG(function(x, n) {
- var i, v = new Uint8Array(n);
- crypto.getRandomValues(v);
- for (i = 0; i < n; i++) x[i] = v[i];
- cleanup(v);
- });
- }
+ var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
+ if (crypto && crypto.getRandomValues) {
+ // Browsers.
+ var QUOTA = 65536;
+ nacl.setPRNG(function(x, n) {
+ var i, v = new Uint8Array(n);
+ for (i = 0; i < n; i += QUOTA) {
+ crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
+ }
+ for (i = 0; i < n; i++) x[i] = v[i];
+ cleanup(v);
+ });
} else if (typeof require !== 'undefined') {
// Node.js.
crypto = require('crypto');
- if (crypto) {
+ if (crypto && crypto.randomBytes) {
nacl.setPRNG(function(x, n) {
var i, v = crypto.randomBytes(n);
for (i = 0; i < n; i++) x[i] = v[i];
@@ -1202,4 +1172,4 @@ nacl.setPRNG = function(fn) {
}
})();
-})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {}));
+})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js
index 95d869502..eed385415 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js
@@ -1 +1 @@
-!function(r){"use strict";function n(r,n){return r<<n|r>>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function p(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function v(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,p(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(p(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,p(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function b(r,n,e,t,o,i){var a=new Uint8Array(16);return v(a,0,e,t,o,i),f(r,n,a,0)}function A(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),v(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function U(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==b(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function _(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function d(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function E(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(d(a),d(a),d(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,E(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];d(r),d(r)}function L(r,n){Y(r,n,n)}function C(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function k(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,E(f,u,t),E(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ur),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),E(f,u,t),E(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return C(l,l),Y(h,h,l),x(r,h),0}function z(r,n){return k(r,n,vr)}function P(r,n){return gr(n,32),z(r,n)}function O(r,n,e){var t=new Uint8Array(32);return k(t,e,n),y(r,pr,t,Br)}function F(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Kr(r,n,e,t,a)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e<arguments.length;e++)r=arguments[e].lo,n=arguments[e].hi,t+=r&f,o+=r>>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function j(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function G(){var r,n=0,e=0;for(r=0;r<arguments.length;r++)n^=arguments[r].lo,e^=arguments[r].hi;return new lr(e,n)}function I(r,n){var e,t,o=32-n;return 32>n?(e=r.hi>>>n|r.lo<<o,t=r.lo>>>n|r.hi<<o):64>n&&(e=r.lo>>>n|r.hi<<o,t=r.hi>>>n|r.lo<<o),new lr(e,t)}function Z(r,n,e){var t=r.hi&n.hi^~r.hi&e.hi,o=r.lo&n.lo^~r.lo&e.lo;return new lr(t,o)}function V(r,n,e){var t=r.hi&n.hi^r.hi&e.hi^n.hi&e.hi,o=r.lo&n.lo^r.lo&e.lo^n.lo&e.lo;return new lr(t,o)}function q(r){return G(I(r,28),I(r,34),I(r,39))}function X(r){return G(I(r,14),I(r,18),I(r,41))}function D(r){return G(I(r,1),I(r,8),j(r,7))}function H(r){return G(I(r,19),I(r,61),j(r,6))}function J(r,n,e){var o,a,f,u=[],c=[],w=[],y=[];for(a=0;8>a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),Z(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,q(w[0]),V(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,dr),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)E(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();C(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(_(r[0],br),_(r[1],Ar),_(r[2],Ar),_(r[3],br),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];_(e[0],Er),_(e[1],xr),_(e[2],Ar),Y(e[3],Er,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*Cr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*Cr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*Cr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return _(r[2],Ar),S(r[1],n),L(o,r[1]),Y(i,o,_r),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),R(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],br,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==Rr)throw new Error("bad key size");if(n.length!==kr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Nr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;n<arguments.length;n++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[n])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function sr(r){for(var n=0;n<r.length;n++)r[n]=0}var lr=function(r,n){this.hi=0|r,this.lo=0|n},hr=function(r){var n,e=new Float64Array(16);if(r)for(n=0;n<r.length;n++)e[n]=r[n];return e},gr=function(){throw new Error("no PRNG")},pr=new Uint8Array(16),vr=new Uint8Array(32);vr[0]=9;var br=hr(),Ar=hr([1]),Ur=hr([56129,1]),_r=hr([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),dr=hr([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),Er=hr([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),xr=hr([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),mr=hr([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),Br=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),Sr=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]),Kr=A,Tr=U,Yr=[new lr(1116352408,3609767458),new lr(1899447441,602891725),new lr(3049323471,3964484399),new lr(3921009573,2173295548),new lr(961987163,4081628472),new lr(1508970993,3053834265),new lr(2453635748,2937671579),new lr(2870763221,3664609560),new lr(3624381080,2734883394),new lr(310598401,1164996542),new lr(607225278,1323610764),new lr(1426881987,3590304994),new lr(1925078388,4068182383),new lr(2162078206,991336113),new lr(2614888103,633803317),new lr(3248222580,3479774868),new lr(3835390401,2666613458),new lr(4022224774,944711139),new lr(264347078,2341262773),new lr(604807628,2007800933),new lr(770255983,1495990901),new lr(1249150122,1856431235),new lr(1555081692,3175218132),new lr(1996064986,2198950837),new lr(2554220882,3999719339),new lr(2821834349,766784016),new lr(2952996808,2566594879),new lr(3210313671,3203337956),new lr(3336571891,1034457026),new lr(3584528711,2466948901),new lr(113926993,3758326383),new lr(338241895,168717936),new lr(666307205,1188179964),new lr(773529912,1546045734),new lr(1294757372,1522805485),new lr(1396182291,2643833823),new lr(1695183700,2343527390),new lr(1986661051,1014477480),new lr(2177026350,1206759142),new lr(2456956037,344077627),new lr(2730485921,1290863460),new lr(2820302411,3158454273),new lr(3259730800,3505952657),new lr(3345764771,106217008),new lr(3516065817,3606008344),new lr(3600352804,1432725776),new lr(4094571909,1467031594),new lr(275423344,851169720),new lr(430227734,3100823752),new lr(506948616,1363258195),new lr(659060556,3750685593),new lr(883997877,3785050280),new lr(958139571,3318307427),new lr(1322822218,3812723403),new lr(1537002063,2003034995),new lr(1747873779,3602036899),new lr(1955562222,1575990012),new lr(2024104815,1125592928),new lr(2227730452,2716904306),new lr(2361852424,442776044),new lr(2428436474,593698344),new lr(2756734187,3733110249),new lr(3204031479,2999351573),new lr(3329325298,3815920427),new lr(3391569614,3928383900),new lr(3515267271,566280711),new lr(3940187606,3454069534),new lr(4118630271,4000239992),new lr(116418474,1914138554),new lr(174292421,2731055270),new lr(289380356,3203993006),new lr(460393269,320620315),new lr(685471733,587496836),new lr(852142971,1086792851),new lr(1017036298,365543100),new lr(1126000580,2618297676),new lr(1288033470,3409855158),new lr(1501505948,4234509866),new lr(1607167915,987167468),new lr(1816402316,1246189591)],Lr=new Uint8Array([106,9,230,103,243,188,201,8,187,103,174,133,132,202,167,59,60,110,243,114,254,148,248,43,165,79,245,58,95,29,54,241,81,14,82,127,173,230,130,209,155,5,104,140,43,62,108,31,31,131,217,171,251,65,189,107,91,224,205,25,19,126,33,121]),Cr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),Rr=32,kr=24,zr=32,Pr=16,Or=32,Fr=32,Nr=32,Mr=32,jr=32,Gr=kr,Ir=zr,Zr=Pr,Vr=64,qr=32,Xr=64,Dr=32,Hr=64;r.lowlevel={crypto_core_hsalsa20:y,crypto_stream_xor:g,crypto_stream:h,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:l,crypto_onetimeauth:v,crypto_onetimeauth_verify:b,crypto_verify_16:f,crypto_verify_32:u,crypto_secretbox:A,crypto_secretbox_open:U,crypto_scalarmult:k,crypto_scalarmult_base:z,crypto_box_beforenm:O,crypto_box_afternm:Kr,crypto_box:F,crypto_box_open:N,crypto_box_keypair:P,crypto_hash:Q,crypto_sign:ar,crypto_sign_keypair:tr,crypto_sign_open:ur,crypto_secretbox_KEYBYTES:Rr,crypto_secretbox_NONCEBYTES:kr,crypto_secretbox_ZEROBYTES:zr,crypto_secretbox_BOXZEROBYTES:Pr,crypto_scalarmult_BYTES:Or,crypto_scalarmult_SCALARBYTES:Fr,crypto_box_PUBLICKEYBYTES:Nr,crypto_box_SECRETKEYBYTES:Mr,crypto_box_BEFORENMBYTES:jr,crypto_box_NONCEBYTES:Gr,crypto_box_ZEROBYTES:Ir,crypto_box_BOXZEROBYTES:Zr,crypto_sign_BYTES:Vr,crypto_sign_PUBLICKEYBYTES:qr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:Dr,crypto_hash_BYTES:Hr},r.util={},r.util.decodeUTF8=function(r){var n,e=unescape(encodeURIComponent(r)),t=new Uint8Array(e.length);for(n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},r.util.encodeUTF8=function(r){var n,e=[];for(n=0;n<r.length;n++)e.push(String.fromCharCode(r[n]));return decodeURIComponent(escape(e.join("")))},r.util.encodeBase64=function(r){if("undefined"==typeof btoa)return new Buffer(r).toString("base64");var n,e=[],t=r.length;for(n=0;t>n;n++)e.push(String.fromCharCode(r[n]));return btoa(e.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var n,e=atob(r),t=new Uint8Array(e.length);for(n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},r.randomBytes=function(r){var n=new Uint8Array(r);return gr(n,r),n},r.secretbox=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(zr+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+zr]=r[i];return A(o,t,t.length,n,e),o.subarray(Pr)},r.secretbox.open=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(Pr+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+Pr]=r[i];return t.length<32?!1:0!==U(o,t,t.length,n,e)?!1:o.subarray(zr)},r.secretbox.keyLength=Rr,r.secretbox.nonceLength=kr,r.secretbox.overheadLength=Pr,r.scalarMult=function(r,n){if(yr(r,n),r.length!==Fr)throw new Error("bad n size");if(n.length!==Or)throw new Error("bad p size");var e=new Uint8Array(Or);return k(e,r,n),e},r.scalarMult.base=function(r){if(yr(r),r.length!==Fr)throw new Error("bad n size");var n=new Uint8Array(Or);return z(n,r),n},r.scalarMult.scalarLength=Fr,r.scalarMult.groupElementLength=Or,r.box=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox(n,e,i)},r.box.before=function(r,n){yr(r,n),wr(r,n);var e=new Uint8Array(jr);return O(e,r,n),e},r.box.after=r.secretbox,r.box.open=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox.open(n,e,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Nr),n=new Uint8Array(Mr);return P(r,n),{publicKey:r,secretKey:n}},r.box.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Mr)throw new Error("bad secret key size");var n=new Uint8Array(Nr);return z(n,r),{publicKey:n,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Nr,r.box.secretKeyLength=Mr,r.box.sharedKeyLength=jr,r.box.nonceLength=Gr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,n){if(yr(r,n),n.length!==Xr)throw new Error("bad secret key size");var e=new Uint8Array(Vr+r.length);return ar(e,r,r.length,n),e},r.sign.open=function(r,n){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(yr(r,n),n.length!==qr)throw new Error("bad public key size");var e=new Uint8Array(r.length),t=ur(e,r,r.length,n);if(0>t)return null;for(var o=new Uint8Array(t),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached=function(n,e){for(var t=r.sign(n,e),o=new Uint8Array(Vr),i=0;i<o.length;i++)o[i]=t[i];return o},r.sign.detached.verify=function(r,n,e){if(yr(r,n,e),n.length!==Vr)throw new Error("bad signature size");if(e.length!==qr)throw new Error("bad public key size");var t,o=new Uint8Array(Vr+r.length),i=new Uint8Array(Vr+r.length);for(t=0;Vr>t;t++)o[t]=n[t];for(t=0;t<r.length;t++)o[t+Vr]=r[t];return ur(i,o,o.length,e)>=0},r.sign.keyPair=function(){var r=new Uint8Array(qr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(qr),e=0;e<n.length;e++)n[e]=r[32+e];return{publicKey:n,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(yr(r),r.length!==Dr)throw new Error("bad seed size");for(var n=new Uint8Array(qr),e=new Uint8Array(Xr),t=0;32>t;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=qr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Vr,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?n=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(n=window.msCrypto),n&&r.setPRNG(function(r,e){var t,o=new Uint8Array(e);for(n.getRandomValues(o),t=0;e>t;t++)r[t]=o[t];sr(o)})):"undefined"!=typeof require&&(n=require("crypto"),n&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file
+!function(r){"use strict";function n(r,n){return r<<n|r>>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function v(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function b(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,v(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(v(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,v(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function p(r,n,e,t,o,i){var a=new Uint8Array(16);return b(a,0,e,t,o,i),f(r,n,a,0)}function _(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),b(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function A(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==p(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function U(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function E(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function d(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(E(a),E(a),E(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];E(r),E(r)}function L(r,n){Y(r,n,n)}function k(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function z(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,d(f,u,t),d(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ar),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),d(f,u,t),d(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return k(l,l),Y(h,h,l),x(r,h),0}function P(r,n){return R(r,n,br)}function O(r,n){return gr(n,32),P(r,n)}function F(r,n,e){var t=new Uint8Array(32);return R(t,e,n),y(r,vr,t,Br)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Kr(r,n,e,t,a)}function C(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e<arguments.length;e++)r=arguments[e].lo,n=arguments[e].hi,t+=r&f,o+=r>>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function G(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function Z(){var r,n=0,e=0;for(r=0;r<arguments.length;r++)n^=arguments[r].lo,e^=arguments[r].hi;return new lr(e,n)}function j(r,n){var e,t,o=32-n;return 32>n?(e=r.hi>>>n|r.lo<<o,t=r.lo>>>n|r.hi<<o):64>n&&(e=r.lo>>>n|r.hi<<o,t=r.hi>>>n|r.lo<<o),new lr(e,t)}function q(r,n,e){var t=r.hi&n.hi^~r.hi&e.hi,o=r.lo&n.lo^~r.lo&e.lo;return new lr(t,o)}function I(r,n,e){var t=r.hi&n.hi^r.hi&e.hi^n.hi&e.hi,o=r.lo&n.lo^r.lo&e.lo^n.lo&e.lo;return new lr(t,o)}function V(r){return Z(j(r,28),j(r,34),j(r,39))}function X(r){return Z(j(r,14),j(r,18),j(r,41))}function D(r){return Z(j(r,1),j(r,8),G(r,7))}function H(r){return Z(j(r,19),j(r,61),G(r,6))}function J(r,n,e){var o,a,f,u=[],c=[],w=[],y=[];for(a=0;8>a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),q(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,V(w[0]),I(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,Er),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)d(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();k(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(U(r[0],pr),U(r[1],_r),U(r[2],_r),U(r[3],pr),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];U(e[0],dr),U(e[1],xr),U(e[2],_r),Y(e[3],dr,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*kr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*kr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*kr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return U(r[2],_r),S(r[1],n),L(o,r[1]),Y(i,o,Ur),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),z(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],pr,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==zr)throw new Error("bad key size");if(n.length!==Rr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Cr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;n<arguments.length;n++)if("[object Uint8Array]"!==(r=Object.prototype.toString.call(arguments[n])))throw new TypeError("unexpected type "+r+", use Uint8Array")}function sr(r){for(var n=0;n<r.length;n++)r[n]=0}var lr=function(r,n){this.hi=0|r,this.lo=0|n},hr=function(r){var n,e=new Float64Array(16);if(r)for(n=0;n<r.length;n++)e[n]=r[n];return e},gr=function(){throw new Error("no PRNG")},vr=new Uint8Array(16),br=new Uint8Array(32);br[0]=9;var pr=hr(),_r=hr([1]),Ar=hr([56129,1]),Ur=hr([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),Er=hr([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),dr=hr([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),xr=hr([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),mr=hr([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]),Br=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]),Sr=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]),Kr=_,Tr=A,Yr=[new lr(1116352408,3609767458),new lr(1899447441,602891725),new lr(3049323471,3964484399),new lr(3921009573,2173295548),new lr(961987163,4081628472),new lr(1508970993,3053834265),new lr(2453635748,2937671579),new lr(2870763221,3664609560),new lr(3624381080,2734883394),new lr(310598401,1164996542),new lr(607225278,1323610764),new lr(1426881987,3590304994),new lr(1925078388,4068182383),new lr(2162078206,991336113),new lr(2614888103,633803317),new lr(3248222580,3479774868),new lr(3835390401,2666613458),new lr(4022224774,944711139),new lr(264347078,2341262773),new lr(604807628,2007800933),new lr(770255983,1495990901),new lr(1249150122,1856431235),new lr(1555081692,3175218132),new lr(1996064986,2198950837),new lr(2554220882,3999719339),new lr(2821834349,766784016),new lr(2952996808,2566594879),new lr(3210313671,3203337956),new lr(3336571891,1034457026),new lr(3584528711,2466948901),new lr(113926993,3758326383),new lr(338241895,168717936),new lr(666307205,1188179964),new lr(773529912,1546045734),new lr(1294757372,1522805485),new lr(1396182291,2643833823),new lr(1695183700,2343527390),new lr(1986661051,1014477480),new lr(2177026350,1206759142),new lr(2456956037,344077627),new lr(2730485921,1290863460),new lr(2820302411,3158454273),new lr(3259730800,3505952657),new lr(3345764771,106217008),new lr(3516065817,3606008344),new lr(3600352804,1432725776),new lr(4094571909,1467031594),new lr(275423344,851169720),new lr(430227734,3100823752),new lr(506948616,1363258195),new lr(659060556,3750685593),new lr(883997877,3785050280),new lr(958139571,3318307427),new lr(1322822218,3812723403),new lr(1537002063,2003034995),new lr(1747873779,3602036899),new lr(1955562222,1575990012),new lr(2024104815,1125592928),new lr(2227730452,2716904306),new lr(2361852424,442776044),new lr(2428436474,593698344),new lr(2756734187,3733110249),new lr(3204031479,2999351573),new lr(3329325298,3815920427),new lr(3391569614,3928383900),new lr(3515267271,566280711),new lr(3940187606,3454069534),new lr(4118630271,4000239992),new lr(116418474,1914138554),new lr(174292421,2731055270),new lr(289380356,3203993006),new lr(460393269,320620315),new lr(685471733,587496836),new lr(852142971,1086792851),new lr(1017036298,365543100),new lr(1126000580,2618297676),new lr(1288033470,3409855158),new lr(1501505948,4234509866),new lr(1607167915,987167468),new lr(1816402316,1246189591)],Lr=new Uint8Array([106,9,230,103,243,188,201,8,187,103,174,133,132,202,167,59,60,110,243,114,254,148,248,43,165,79,245,58,95,29,54,241,81,14,82,127,173,230,130,209,155,5,104,140,43,62,108,31,31,131,217,171,251,65,189,107,91,224,205,25,19,126,33,121]),kr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),zr=32,Rr=24,Pr=32,Or=16,Fr=32,Nr=32,Cr=32,Mr=32,Gr=32,Zr=Rr,jr=Pr,qr=Or,Ir=64,Vr=32,Xr=64,Dr=32,Hr=64;r.lowlevel={crypto_core_hsalsa20:y,crypto_stream_xor:g,crypto_stream:h,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:l,crypto_onetimeauth:b,crypto_onetimeauth_verify:p,crypto_verify_16:f,crypto_verify_32:u,crypto_secretbox:_,crypto_secretbox_open:A,crypto_scalarmult:R,crypto_scalarmult_base:P,crypto_box_beforenm:F,crypto_box_afternm:Kr,crypto_box:N,crypto_box_open:C,crypto_box_keypair:O,crypto_hash:Q,crypto_sign:ar,crypto_sign_keypair:tr,crypto_sign_open:ur,crypto_secretbox_KEYBYTES:zr,crypto_secretbox_NONCEBYTES:Rr,crypto_secretbox_ZEROBYTES:Pr,crypto_secretbox_BOXZEROBYTES:Or,crypto_scalarmult_BYTES:Fr,crypto_scalarmult_SCALARBYTES:Nr,crypto_box_PUBLICKEYBYTES:Cr,crypto_box_SECRETKEYBYTES:Mr,crypto_box_BEFORENMBYTES:Gr,crypto_box_NONCEBYTES:Zr,crypto_box_ZEROBYTES:jr,crypto_box_BOXZEROBYTES:qr,crypto_sign_BYTES:Ir,crypto_sign_PUBLICKEYBYTES:Vr,crypto_sign_SECRETKEYBYTES:Xr,crypto_sign_SEEDBYTES:Dr,crypto_hash_BYTES:Hr},r.util||(r.util={},r.util.decodeUTF8=r.util.encodeUTF8=r.util.encodeBase64=r.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),r.randomBytes=function(r){var n=new Uint8Array(r);return gr(n,r),n},r.secretbox=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(Pr+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+Pr]=r[i];return _(o,t,t.length,n,e),o.subarray(Or)},r.secretbox.open=function(r,n,e){yr(r,n,e),cr(e,n);for(var t=new Uint8Array(Or+r.length),o=new Uint8Array(t.length),i=0;i<r.length;i++)t[i+Or]=r[i];return t.length<32?!1:0!==A(o,t,t.length,n,e)?!1:o.subarray(Pr)},r.secretbox.keyLength=zr,r.secretbox.nonceLength=Rr,r.secretbox.overheadLength=Or,r.scalarMult=function(r,n){if(yr(r,n),r.length!==Nr)throw new Error("bad n size");if(n.length!==Fr)throw new Error("bad p size");var e=new Uint8Array(Fr);return R(e,r,n),e},r.scalarMult.base=function(r){if(yr(r),r.length!==Nr)throw new Error("bad n size");var n=new Uint8Array(Fr);return P(n,r),n},r.scalarMult.scalarLength=Nr,r.scalarMult.groupElementLength=Fr,r.box=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox(n,e,i)},r.box.before=function(r,n){yr(r,n),wr(r,n);var e=new Uint8Array(Gr);return F(e,r,n),e},r.box.after=r.secretbox,r.box.open=function(n,e,t,o){var i=r.box.before(t,o);return r.secretbox.open(n,e,i)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var r=new Uint8Array(Cr),n=new Uint8Array(Mr);return O(r,n),{publicKey:r,secretKey:n}},r.box.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Mr)throw new Error("bad secret key size");var n=new Uint8Array(Cr);return P(n,r),{publicKey:n,secretKey:new Uint8Array(r)}},r.box.publicKeyLength=Cr,r.box.secretKeyLength=Mr,r.box.sharedKeyLength=Gr,r.box.nonceLength=Zr,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(r,n){if(yr(r,n),n.length!==Xr)throw new Error("bad secret key size");var e=new Uint8Array(Ir+r.length);return ar(e,r,r.length,n),e},r.sign.open=function(r,n){if(2!==arguments.length)throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?");if(yr(r,n),n.length!==Vr)throw new Error("bad public key size");var e=new Uint8Array(r.length),t=ur(e,r,r.length,n);if(0>t)return null;for(var o=new Uint8Array(t),i=0;i<o.length;i++)o[i]=e[i];return o},r.sign.detached=function(n,e){for(var t=r.sign(n,e),o=new Uint8Array(Ir),i=0;i<o.length;i++)o[i]=t[i];return o},r.sign.detached.verify=function(r,n,e){if(yr(r,n,e),n.length!==Ir)throw new Error("bad signature size");if(e.length!==Vr)throw new Error("bad public key size");var t,o=new Uint8Array(Ir+r.length),i=new Uint8Array(Ir+r.length);for(t=0;Ir>t;t++)o[t]=n[t];for(t=0;t<r.length;t++)o[t+Ir]=r[t];return ur(i,o,o.length,e)>=0},r.sign.keyPair=function(){var r=new Uint8Array(Vr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(Vr),e=0;e<n.length;e++)n[e]=r[32+e];return{publicKey:n,secretKey:new Uint8Array(r)}},r.sign.keyPair.fromSeed=function(r){if(yr(r),r.length!==Dr)throw new Error("bad seed size");for(var n=new Uint8Array(Vr),e=new Uint8Array(Xr),t=0;32>t;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=Vr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Ir,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var e=65536;r.setPRNG(function(r,t){var o,i=new Uint8Array(t);for(o=0;t>o;o+=e)n.getRandomValues(i.subarray(o,o+Math.min(t-o,e)));for(o=0;t>o;o++)r[o]=i[o];sr(i)})}else"undefined"!=typeof require&&(n=require("crypto"),n&&n.randomBytes&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{}); \ No newline at end of file
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json
index 7cca76eb5..0903b54cc 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json
@@ -6,16 +6,20 @@
]
],
"_from": "tweetnacl@>=0.13.0 <1.0.0",
- "_id": "tweetnacl@0.13.3",
+ "_id": "tweetnacl@0.14.3",
"_inCache": true,
"_installable": true,
"_location": "/request/http-signature/sshpk/tweetnacl",
- "_nodeVersion": "4.2.3",
+ "_nodeVersion": "5.6.0",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/tweetnacl-0.14.3.tgz_1459224951636_0.7403244483284652"
+ },
"_npmUser": {
"email": "dmitry@codingrobots.com",
"name": "dchest"
},
- "_npmVersion": "2.14.7",
+ "_npmVersion": "3.7.3",
"_phantomChildren": {},
"_requested": {
"name": "tweetnacl",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/http-signature/sshpk"
],
- "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz",
- "_shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56",
+ "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz",
+ "_shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d",
"_shrinkwrap": null,
"_spec": "tweetnacl@>=0.13.0 <1.0.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk",
@@ -46,23 +50,24 @@
"dependencies": {},
"description": "Port of TweetNaCl cryptographic library to JavaScript",
"devDependencies": {
- "browserify": "^10.1.3",
- "eslint": "^1.4.3",
- "faucet": "0.0.1",
+ "browserify": "^13.0.0",
+ "eslint": "^2.2.0",
+ "faucet": "^0.0.1",
"tap-browser-color": "^0.1.2",
- "tape": "^4.0.0",
- "testling": "^1.7.1",
- "uglify-js": "^2.4.21"
+ "tape": "^4.4.0",
+ "tape-run": "^2.1.3",
+ "tweetnacl-util": "^0.13.3",
+ "uglify-js": "^2.6.1"
},
"directories": {
"test": "test"
},
"dist": {
- "shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56",
- "tarball": "http://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz"
+ "shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d",
+ "tarball": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz"
},
- "gitHead": "2bb422cb707fba4a5ec9654688564a4fb861b068",
- "homepage": "https://dchest.github.io/tweetnacl-js",
+ "gitHead": "3eb4fc544a2a1d6c0a41b98b9906288ca8b087e4",
+ "homepage": "https://tweetnacl.js.org",
"keywords": [
"crypto",
"cryptography",
@@ -77,12 +82,12 @@
"salsa20",
"signatures"
],
- "license": "Public domain",
+ "license": "SEE LICENSE IN COPYING.txt",
"main": "nacl-fast.js",
"maintainers": [
{
- "name": "dchest",
- "email": "dmitry@codingrobots.com"
+ "email": "dmitry@codingrobots.com",
+ "name": "dchest"
}
],
"name": "tweetnacl",
@@ -94,27 +99,13 @@
},
"scripts": {
"bench": "node test/benchmark/bench.js",
- "browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null",
- "browser-quick": "browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null",
"build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js",
- "chrome": "browserify test/browser/testling_init.js test/*.js | testling -x google-chrome | faucet",
- "firefox": "browserify test/browser/testling_init.js test/*.js | testling -x firefox | faucet",
+ "build-test-browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null && browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null",
"lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js",
- "test": "tape test/*.js | faucet",
- "testall": "make -C test/c && tape test/*.js test/c/*.js | faucet",
- "testling": "browserify test/browser/testling_init.js test/*.js | testling | faucet"
- },
- "testling": {
- "browsers": [
- "android-browser/latest",
- "chrome/22..latest",
- "firefox/16..latest",
- "ipad/6..latest",
- "iphone/6..latest",
- "opera/11.0..latest",
- "safari/latest"
- ],
- "files": "test/*.js"
+ "test": "npm run test-node-all && npm run test-browser",
+ "test-browser": "NACL_SRC=${NACL_SRC:='nacl.min.js'} && npm run build-test-browser && cat $NACL_SRC test/browser/_bundle.js | tape-run | faucet",
+ "test-node": "tape test/*.js | faucet",
+ "test-node-all": "make -C test/c && tape test/*.js test/c/*.js | faucet"
},
- "version": "0.13.3"
+ "version": "0.14.3"
}
diff --git a/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json b/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json
index 6fce0e320..fc995b42c 100644
--- a/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json
+++ b/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json
@@ -6,16 +6,20 @@
]
],
"_from": "sshpk@>=1.7.0 <2.0.0",
- "_id": "sshpk@1.7.3",
+ "_id": "sshpk@1.7.4",
"_inCache": true,
"_installable": true,
"_location": "/request/http-signature/sshpk",
"_nodeVersion": "0.12.9",
+ "_npmOperationalInternal": {
+ "host": "packages-6-west.internal.npmjs.com",
+ "tmp": "tmp/sshpk-1.7.4.tgz_1455236064846_0.4782760036177933"
+ },
"_npmUser": {
"email": "alex@cooperi.net",
"name": "arekinath"
},
- "_npmVersion": "2.14.9",
+ "_npmVersion": "2.14.4",
"_phantomChildren": {},
"_requested": {
"name": "sshpk",
@@ -28,8 +32,8 @@
"_requiredBy": [
"/request/http-signature"
],
- "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz",
- "_shasum": "caa8ef95e30765d856698b7025f9f211ab65962f",
+ "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz",
+ "_shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38",
"_shrinkwrap": null,
"_spec": "sshpk@^1.7.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature",
@@ -46,16 +50,16 @@
},
"contributors": [
{
- "name": "Dave Eddy",
- "email": "dave@daveeddy.com"
+ "email": "dave@daveeddy.com",
+ "name": "Dave Eddy"
},
{
- "name": "Mark Cavage",
- "email": "mcavage@gmail.com"
+ "email": "mcavage@gmail.com",
+ "name": "Mark Cavage"
},
{
- "name": "Alex Wilson",
- "email": "alex@cooperi.net"
+ "email": "alex@cooperi.net",
+ "name": "Alex Wilson"
}
],
"dependencies": {
@@ -80,20 +84,20 @@
"man": "./man/man1"
},
"dist": {
- "shasum": "caa8ef95e30765d856698b7025f9f211ab65962f",
- "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz"
+ "shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38",
+ "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz"
},
"engines": {
"node": ">=0.8.0"
},
- "gitHead": "3d98bfc22bb1c09f0747244acbb408f3ca9448b5",
+ "gitHead": "9b86d45d512c97f6ea10b98a2970828dfb290310",
"homepage": "https://github.com/arekinath/node-sshpk#readme",
"license": "MIT",
"main": "lib/index.js",
"maintainers": [
{
- "name": "arekinath",
- "email": "alex@cooperi.net"
+ "email": "alex@cooperi.net",
+ "name": "arekinath"
}
],
"man": [
@@ -116,5 +120,5 @@
"scripts": {
"test": "tape test/*.js"
},
- "version": "1.7.3"
+ "version": "1.7.4"
}
diff --git a/node_modules/request/node_modules/mime-types/HISTORY.md b/node_modules/request/node_modules/mime-types/HISTORY.md
index 61b54b420..1d86a5cb1 100644
--- a/node_modules/request/node_modules/mime-types/HISTORY.md
+++ b/node_modules/request/node_modules/mime-types/HISTORY.md
@@ -1,3 +1,11 @@
+2.1.10 / 2016-02-15
+===================
+
+ * deps: mime-db@~1.22.0
+ - Add new mime types
+ - Fix extension of `application/dash+xml`
+ - Update primary extension for `audio/mp4`
+
2.1.9 / 2016-01-06
==================
diff --git a/node_modules/request/node_modules/mime-types/README.md b/node_modules/request/node_modules/mime-types/README.md
index e26295d04..e77d615d3 100644
--- a/node_modules/request/node_modules/mime-types/README.md
+++ b/node_modules/request/node_modules/mime-types/README.md
@@ -94,7 +94,7 @@ A map of extensions by content-type.
[npm-image]: https://img.shields.io/npm/v/mime-types.svg
[npm-url]: https://npmjs.org/package/mime-types
[node-version-image]: https://img.shields.io/node/v/mime-types.svg
-[node-version-url]: http://nodejs.org/download/
+[node-version-url]: https://nodejs.org/en/download/
[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
[travis-url]: https://travis-ci.org/jshttp/mime-types
[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
index 41a667af5..44f9f6465 100644
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
@@ -1,3 +1,17 @@
+1.22.0 / 2016-02-15
+===================
+
+ * Add `application/ppsp-tracker+json`
+ * Add `application/problem+json`
+ * Add `application/problem+xml`
+ * Add `application/vnd.hdt`
+ * Add `application/vnd.ms-printschematicket+xml`
+ * Add `model/vnd.rosette.annotated-data-model`
+ * Add `text/slim`
+ * Add extension `.rng` to `application/xml`
+ * Fix extension of `application/dash+xml` to be `.mpd`
+ * Update primary extension to `.m4a` for `audio/mp4`
+
1.21.0 / 2016-01-06
===================
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
index 412ba9ed6..863deb4f0 100644
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
@@ -217,7 +217,7 @@
},
"application/dash+xml": {
"source": "iana",
- "extensions": ["mdp"]
+ "extensions": ["mpd"]
},
"application/dashdelta": {
"source": "iana"
@@ -837,6 +837,17 @@
"compressible": true,
"extensions": ["ai","eps","ps"]
},
+ "application/ppsp-tracker+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/problem+json": {
+ "source": "iana",
+ "compressible": true
+ },
+ "application/problem+xml": {
+ "source": "iana"
+ },
"application/provenance+xml": {
"source": "iana"
},
@@ -2093,6 +2104,9 @@
"application/vnd.hcl-bireports": {
"source": "iana"
},
+ "application/vnd.hdt": {
+ "source": "iana"
+ },
"application/vnd.heroku+json": {
"source": "iana",
"compressible": true
@@ -2687,6 +2701,9 @@
"application/vnd.ms-printing.printticket+xml": {
"source": "apache"
},
+ "application/vnd.ms-printschematicket+xml": {
+ "source": "iana"
+ },
"application/vnd.ms-project": {
"source": "iana",
"extensions": ["mpp","mpt"]
@@ -4749,7 +4766,7 @@
"application/xml": {
"source": "iana",
"compressible": true,
- "extensions": ["xml","xsl","xsd"]
+ "extensions": ["xml","xsl","xsd","rng"]
},
"application/xml-dtd": {
"source": "iana",
@@ -5023,7 +5040,7 @@
"audio/mp4": {
"source": "iana",
"compressible": false,
- "extensions": ["mp4a","m4a"]
+ "extensions": ["m4a","mp4a"]
},
"audio/mp4a-latm": {
"source": "iana"
@@ -5774,6 +5791,9 @@
"model/vnd.parasolid.transmit.text": {
"source": "iana"
},
+ "model/vnd.rosette.annotated-data-model": {
+ "source": "iana"
+ },
"model/vnd.valve.source.compiled-map": {
"source": "iana"
},
@@ -6003,6 +6023,9 @@
"source": "iana",
"extensions": ["sgml","sgm"]
},
+ "text/slim": {
+ "extensions": ["slim","slm"]
+ },
"text/stylus": {
"extensions": ["stylus","styl"]
},
diff --git a/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
index bb48d8cf5..1abcdca6c 100644
--- a/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
+++ b/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
@@ -1,73 +1,78 @@
{
"_args": [
[
- "mime-db@~1.21.0",
+ "mime-db@~1.22.0",
"/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types"
]
],
- "_from": "mime-db@>=1.21.0 <1.22.0",
- "_id": "mime-db@1.21.0",
+ "_from": "mime-db@>=1.22.0 <1.23.0",
+ "_id": "mime-db@1.22.0",
"_inCache": true,
"_installable": true,
"_location": "/request/mime-types/mime-db",
+ "_nodeVersion": "4.2.3",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/mime-db-1.22.0.tgz_1455558813990_0.7830642955377698"
+ },
"_npmUser": {
"email": "doug@somethingdoug.com",
"name": "dougwilson"
},
- "_npmVersion": "1.4.28",
+ "_npmVersion": "2.14.7",
"_phantomChildren": {},
"_requested": {
"name": "mime-db",
- "raw": "mime-db@~1.21.0",
- "rawSpec": "~1.21.0",
+ "raw": "mime-db@~1.22.0",
+ "rawSpec": "~1.22.0",
"scope": null,
- "spec": ">=1.21.0 <1.22.0",
+ "spec": ">=1.22.0 <1.23.0",
"type": "range"
},
"_requiredBy": [
"/request/mime-types"
],
- "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz",
- "_shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac",
+ "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz",
+ "_shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a",
"_shrinkwrap": null,
- "_spec": "mime-db@~1.21.0",
+ "_spec": "mime-db@~1.22.0",
"_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types",
"bugs": {
"url": "https://github.com/jshttp/mime-db/issues"
},
"contributors": [
{
- "name": "Douglas Christopher Wilson",
- "email": "doug@somethingdoug.com"
+ "email": "doug@somethingdoug.com",
+ "name": "Douglas Christopher Wilson"
},
{
- "name": "Jonathan Ong",
"email": "me@jongleberry.com",
+ "name": "Jonathan Ong",
"url": "http://jongleberry.com"
},
{
- "name": "Robert Kieffer",
"email": "robert@broofa.com",
+ "name": "Robert Kieffer",
"url": "http://github.com/broofa"
}
],
"dependencies": {},
"description": "Media Type Database",
"devDependencies": {
- "bluebird": "3.1.1",
+ "bluebird": "3.3.1",
"co": "4.6.0",
"cogent": "1.0.1",
"csv-parse": "1.0.1",
- "gnode": "0.1.1",
- "istanbul": "0.4.1",
+ "gnode": "0.1.2",
+ "istanbul": "0.4.2",
"mocha": "1.21.5",
"raw-body": "2.1.5",
- "stream-to-array": "2.2.0"
+ "stream-to-array": "2.2.1"
},
"directories": {},
"dist": {
- "shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac",
- "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz"
+ "shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a",
+ "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz"
},
"engines": {
"node": ">= 0.6"
@@ -79,26 +84,26 @@
"db.json",
"index.js"
],
- "gitHead": "9ab92f0a912a602408a64db5741dfef6f82c597f",
- "homepage": "https://github.com/jshttp/mime-db",
+ "gitHead": "ed88d32405582a5aaff6225d1210005d6be2623e",
+ "homepage": "https://github.com/jshttp/mime-db#readme",
"keywords": [
- "charset",
- "charsets",
- "database",
- "db",
"mime",
+ "db",
"type",
- "types"
+ "types",
+ "database",
+ "charset",
+ "charsets"
],
"license": "MIT",
"maintainers": [
{
- "name": "jongleberry",
- "email": "jonathanrichardong@gmail.com"
+ "email": "doug@somethingdoug.com",
+ "name": "dougwilson"
},
{
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
+ "email": "jonathanrichardong@gmail.com",
+ "name": "jongleberry"
}
],
"name": "mime-db",
@@ -116,5 +121,5 @@
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
"update": "npm run fetch && npm run build"
},
- "version": "1.21.0"
+ "version": "1.22.0"
}
diff --git a/node_modules/request/node_modules/mime-types/package.json b/node_modules/request/node_modules/mime-types/package.json
index aba63f70e..8e7b5f62b 100644
--- a/node_modules/request/node_modules/mime-types/package.json
+++ b/node_modules/request/node_modules/mime-types/package.json
@@ -6,15 +6,20 @@
]
],
"_from": "mime-types@>=2.1.7 <2.2.0",
- "_id": "mime-types@2.1.9",
+ "_id": "mime-types@2.1.10",
"_inCache": true,
"_installable": true,
"_location": "/request/mime-types",
+ "_nodeVersion": "4.2.3",
+ "_npmOperationalInternal": {
+ "host": "packages-9-west.internal.npmjs.com",
+ "tmp": "tmp/mime-types-2.1.10.tgz_1455575237256_0.9163766100537032"
+ },
"_npmUser": {
"email": "doug@somethingdoug.com",
"name": "dougwilson"
},
- "_npmVersion": "1.4.28",
+ "_npmVersion": "2.14.7",
"_phantomChildren": {},
"_requested": {
"name": "mime-types",
@@ -28,8 +33,8 @@
"/request",
"/request/form-data"
],
- "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz",
- "_shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8",
+ "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz",
+ "_shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837",
"_shrinkwrap": null,
"_spec": "mime-types@~2.1.7",
"_where": "/Users/rebecca/code/npm/node_modules/request",
@@ -38,32 +43,32 @@
},
"contributors": [
{
- "name": "Douglas Christopher Wilson",
- "email": "doug@somethingdoug.com"
+ "email": "doug@somethingdoug.com",
+ "name": "Douglas Christopher Wilson"
},
{
- "name": "Jeremiah Senkpiel",
"email": "fishrock123@rocketmail.com",
+ "name": "Jeremiah Senkpiel",
"url": "https://searchbeam.jit.su"
},
{
- "name": "Jonathan Ong",
"email": "me@jongleberry.com",
+ "name": "Jonathan Ong",
"url": "http://jongleberry.com"
}
],
"dependencies": {
- "mime-db": "~1.21.0"
+ "mime-db": "~1.22.0"
},
"description": "The ultimate javascript content-type utility.",
"devDependencies": {
- "istanbul": "0.4.1",
- "mocha": "~1.21.5"
+ "istanbul": "0.4.2",
+ "mocha": "1.21.5"
},
"directories": {},
"dist": {
- "shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8",
- "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz"
+ "shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837",
+ "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz"
},
"engines": {
"node": ">= 0.6"
@@ -73,8 +78,8 @@
"LICENSE",
"index.js"
],
- "gitHead": "329f1c77e1a77c8fac59b15038e3808e9e314d96",
- "homepage": "https://github.com/jshttp/mime-types",
+ "gitHead": "70785d38e9cc251137b00f73ab3d3257c4aea203",
+ "homepage": "https://github.com/jshttp/mime-types#readme",
"keywords": [
"mime",
"types"
@@ -82,16 +87,16 @@
"license": "MIT",
"maintainers": [
{
- "name": "jongleberry",
- "email": "jonathanrichardong@gmail.com"
+ "email": "doug@somethingdoug.com",
+ "name": "dougwilson"
},
{
- "name": "fishrock123",
- "email": "fishrock123@rocketmail.com"
+ "email": "fishrock123@rocketmail.com",
+ "name": "fishrock123"
},
{
- "name": "dougwilson",
- "email": "doug@somethingdoug.com"
+ "email": "jonathanrichardong@gmail.com",
+ "name": "jongleberry"
}
],
"name": "mime-types",
@@ -106,5 +111,5 @@
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
},
- "version": "2.1.9"
+ "version": "2.1.10"
}
diff --git a/node_modules/request/node_modules/oauth-sign/index.js b/node_modules/request/node_modules/oauth-sign/index.js
index a587541dc..dadcba970 100644
--- a/node_modules/request/node_modules/oauth-sign/index.js
+++ b/node_modules/request/node_modules/oauth-sign/index.js
@@ -132,3 +132,5 @@ exports.rsasign = rsasign
exports.plaintext = plaintext
exports.sign = sign
exports.rfc3986 = rfc3986
+exports.generateBase = generateBase
+
diff --git a/node_modules/request/node_modules/oauth-sign/package.json b/node_modules/request/node_modules/oauth-sign/package.json
index eeaaa68d3..788eebb0c 100644
--- a/node_modules/request/node_modules/oauth-sign/package.json
+++ b/node_modules/request/node_modules/oauth-sign/package.json
@@ -1,59 +1,83 @@
{
+ "_args": [
+ [
+ "oauth-sign@~0.8.0",
+ "/Users/rebecca/code/npm/node_modules/request"
+ ]
+ ],
+ "_from": "oauth-sign@>=0.8.0 <0.9.0",
+ "_id": "oauth-sign@0.8.1",
+ "_inCache": true,
+ "_installable": true,
+ "_location": "/request/oauth-sign",
+ "_nodeVersion": "5.5.0",
+ "_npmUser": {
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
+ },
+ "_npmVersion": "3.6.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "name": "oauth-sign",
+ "raw": "oauth-sign@~0.8.0",
+ "rawSpec": "~0.8.0",
+ "scope": null,
+ "spec": ">=0.8.0 <0.9.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/request"
+ ],
+ "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz",
+ "_shasum": "182439bdb91378bf7460e75c64ea43e6448def06",
+ "_shrinkwrap": null,
+ "_spec": "oauth-sign@~0.8.0",
+ "_where": "/Users/rebecca/code/npm/node_modules/request",
"author": {
- "name": "Mikeal Rogers",
"email": "mikeal.rogers@gmail.com",
+ "name": "Mikeal Rogers",
"url": "http://www.futurealoof.com"
},
- "name": "oauth-sign",
- "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
- "version": "0.8.0",
- "license": "Apache-2.0",
- "repository": {
- "url": "git+https://github.com/mikeal/oauth-sign.git"
+ "bugs": {
+ "url": "https://github.com/mikeal/oauth-sign/issues"
},
- "main": "index.js",
"dependencies": {},
+ "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
"devDependencies": {},
- "optionalDependencies": {},
+ "directories": {},
+ "dist": {
+ "shasum": "182439bdb91378bf7460e75c64ea43e6448def06",
+ "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz"
+ },
"engines": {
"node": "*"
},
- "scripts": {
- "test": "node test.js"
- },
- "gitHead": "e1f2b42ff039901ce977f8e81918767d97d496b5",
- "bugs": {
- "url": "https://github.com/mikeal/oauth-sign/issues"
- },
+ "gitHead": "9c7229a336c9face98b83f93b72cb7c80dbba08d",
"homepage": "https://github.com/mikeal/oauth-sign#readme",
- "_id": "oauth-sign@0.8.0",
- "_shasum": "938fdc875765ba527137d8aec9d178e24debc553",
- "_from": "oauth-sign@>=0.8.0 <0.9.0",
- "_npmVersion": "2.10.1",
- "_nodeVersion": "0.12.4",
- "_npmUser": {
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
- },
+ "license": "Apache-2.0",
+ "main": "index.js",
"maintainers": [
{
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
+ "email": "mikeal.rogers@gmail.com",
+ "name": "mikeal"
},
{
- "name": "nylen",
- "email": "jnylen@gmail.com"
+ "email": "jnylen@gmail.com",
+ "name": "nylen"
},
{
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
}
],
- "dist": {
- "shasum": "938fdc875765ba527137d8aec9d178e24debc553",
- "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz"
+ "name": "oauth-sign",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "url": "git+https://github.com/mikeal/oauth-sign.git"
},
- "directories": {},
- "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz",
- "readme": "ERROR: No README data found!"
+ "scripts": {
+ "test": "node test.js"
+ },
+ "version": "0.8.1"
}
diff --git a/node_modules/request/node_modules/qs/CHANGELOG.md b/node_modules/request/node_modules/qs/CHANGELOG.md
index 2df5e9d37..5c66ea444 100644
--- a/node_modules/request/node_modules/qs/CHANGELOG.md
+++ b/node_modules/request/node_modules/qs/CHANGELOG.md
@@ -1,3 +1,8 @@
+## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=34&state=closed)
+- [New] allowDots option for `stringify` (#151)
+- [Fix] "sort" option should work at a depth of 3 or more (#151)
+- [Fix] Restore `dist` directory; will be removed in v7 (#148)
+
## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
- Revert ES6 requirement and restore support for node down to v0.8.
diff --git a/node_modules/request/node_modules/qs/bower.json b/node_modules/request/node_modules/qs/bower.json
index 8b21420a6..44f050642 100644
--- a/node_modules/request/node_modules/qs/bower.json
+++ b/node_modules/request/node_modules/qs/bower.json
@@ -1,7 +1,6 @@
{
"name": "qs",
"main": "dist/qs.js",
- "version": "5.2.0",
"homepage": "https://github.com/hapijs/qs",
"authors": [
"Nathan LaFreniere <quitlahok@gmail.com>"
diff --git a/node_modules/request/node_modules/qs/component.json b/node_modules/request/node_modules/qs/component.json
index fca856a63..cb8d93fb1 100644
--- a/node_modules/request/node_modules/qs/component.json
+++ b/node_modules/request/node_modules/qs/component.json
@@ -2,7 +2,7 @@
"name": "qs",
"repository": "hapijs/qs",
"description": "query-string parser / stringifier with nesting support",
- "version": "5.2.0",
+ "version": "6.1.0",
"keywords": ["querystring", "query", "parser"],
"main": "lib/index.js",
"scripts": [
diff --git a/node_modules/request/node_modules/qs/dist/qs.js b/node_modules/request/node_modules/qs/dist/qs.js
index 68433d45a..bb8ea31a9 100644
--- a/node_modules/request/node_modules/qs/dist/qs.js
+++ b/node_modules/request/node_modules/qs/dist/qs.js
@@ -198,7 +198,7 @@ var internals = {
encode: true
};
-internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) {
var obj = object;
if (typeof filter === 'function') {
obj = filter(prefix, obj);
@@ -243,9 +243,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH
}
if (Array.isArray(obj)) {
- values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
} else {
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
}
@@ -260,6 +260,7 @@ module.exports = function (object, opts) {
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
var sort = typeof options.sort === 'function' ? options.sort : null;
+ var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
var objKeys;
var filter;
if (typeof options.filter === 'function') {
@@ -301,7 +302,7 @@ module.exports = function (object, opts) {
continue;
}
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
return keys.join(delimiter);
diff --git a/node_modules/request/node_modules/qs/lib/stringify.js b/node_modules/request/node_modules/qs/lib/stringify.js
index e7b669d3d..892dad45a 100755
--- a/node_modules/request/node_modules/qs/lib/stringify.js
+++ b/node_modules/request/node_modules/qs/lib/stringify.js
@@ -20,7 +20,7 @@ var internals = {
encode: true
};
-internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) {
var obj = object;
if (typeof filter === 'function') {
obj = filter(prefix, obj);
@@ -65,9 +65,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH
}
if (Array.isArray(obj)) {
- values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
} else {
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+ values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
}
@@ -82,6 +82,7 @@ module.exports = function (object, opts) {
var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
var sort = typeof options.sort === 'function' ? options.sort : null;
+ var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
var objKeys;
var filter;
if (typeof options.filter === 'function') {
@@ -123,7 +124,7 @@ module.exports = function (object, opts) {
continue;
}
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots));
}
return keys.join(delimiter);
diff --git a/node_modules/request/node_modules/qs/package.json b/node_modules/request/node_modules/qs/package.json
index ed0815b5b..33318a725 100644
--- a/node_modules/request/node_modules/qs/package.json
+++ b/node_modules/request/node_modules/qs/package.json
@@ -1,16 +1,20 @@
{
"_args": [
[
- "qs@~6.0.2",
+ "qs@~6.1.0",
"/Users/rebecca/code/npm/node_modules/request"
]
],
- "_from": "qs@>=6.0.2 <6.1.0",
- "_id": "qs@6.0.2",
+ "_from": "qs@>=6.1.0 <6.2.0",
+ "_id": "qs@6.1.0",
"_inCache": true,
"_installable": true,
"_location": "/request/qs",
- "_nodeVersion": "5.4.1",
+ "_nodeVersion": "5.5.0",
+ "_npmOperationalInternal": {
+ "host": "packages-5-east.internal.npmjs.com",
+ "tmp": "tmp/qs-6.1.0.tgz_1454565583082_0.44599376199766994"
+ },
"_npmUser": {
"email": "ljharb@gmail.com",
"name": "ljharb"
@@ -19,27 +23,27 @@
"_phantomChildren": {},
"_requested": {
"name": "qs",
- "raw": "qs@~6.0.2",
- "rawSpec": "~6.0.2",
+ "raw": "qs@~6.1.0",
+ "rawSpec": "~6.1.0",
"scope": null,
- "spec": ">=6.0.2 <6.1.0",
+ "spec": ">=6.1.0 <6.2.0",
"type": "range"
},
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/qs/-/qs-6.0.2.tgz",
- "_shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
+ "_resolved": "https://registry.npmjs.org/qs/-/qs-6.1.0.tgz",
+ "_shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26",
"_shrinkwrap": null,
- "_spec": "qs@~6.0.2",
+ "_spec": "qs@~6.1.0",
"_where": "/Users/rebecca/code/npm/node_modules/request",
"bugs": {
"url": "https://github.com/ljharb/qs/issues"
},
"contributors": [
{
- "name": "Jordan Harband",
"email": "ljharb@gmail.com",
+ "name": "Jordan Harband",
"url": "http://ljharb.codes"
}
],
@@ -57,32 +61,32 @@
},
"directories": {},
"dist": {
- "shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
- "tarball": "http://registry.npmjs.org/qs/-/qs-6.0.2.tgz"
+ "shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26",
+ "tarball": "http://registry.npmjs.org/qs/-/qs-6.1.0.tgz"
},
"engines": {
"node": ">=0.6"
},
- "gitHead": "47dfbd6740b3cc1593847825701c8aa136f636e3",
+ "gitHead": "5bd79545edb33d6a43398fec7df9ecef2da005ea",
"homepage": "https://github.com/ljharb/qs",
"keywords": [
- "qs",
- "querystring"
+ "querystring",
+ "qs"
],
"license": "BSD-3-Clause",
"main": "lib/index.js",
"maintainers": [
{
- "name": "hueniverse",
- "email": "eran@hammer.io"
+ "email": "eran@hammer.io",
+ "name": "hueniverse"
},
{
- "name": "ljharb",
- "email": "ljharb@gmail.com"
+ "email": "ljharb@gmail.com",
+ "name": "ljharb"
},
{
- "name": "nlf",
- "email": "quitlahok@gmail.com"
+ "email": "quitlahok@gmail.com",
+ "name": "nlf"
}
],
"name": "qs",
@@ -101,5 +105,5 @@
"test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'",
"tests-only": "node test"
},
- "version": "6.0.2"
+ "version": "6.1.0"
}
diff --git a/node_modules/request/node_modules/qs/test/stringify.js b/node_modules/request/node_modules/qs/test/stringify.js
index 88d22f25e..da72839d2 100755
--- a/node_modules/request/node_modules/qs/test/stringify.js
+++ b/node_modules/request/node_modules/qs/test/stringify.js
@@ -21,6 +21,12 @@ test('stringify()', function (t) {
st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e');
st.end();
});
+
+ t.test('stringifies a nested object with dots notation', function (st) {
+ st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');
+ st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');
+ st.end();
+ });
t.test('stringifies an array value', function (st) {
st.equal(qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
@@ -47,12 +53,23 @@ test('stringify()', function (t) {
st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
st.end();
});
+
+ t.test('stringifies a nested array value with dots notation', function (st) {
+ st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { allowDots: true, encode: false }), 'a.b[0]=c&a.b[1]=d');
+ st.end();
+ });
t.test('stringifies an object inside an array', function (st) {
st.equal(qs.stringify({ a: [{ b: 'c' }] }), 'a%5B0%5D%5Bb%5D=c');
st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }), 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
st.end();
});
+
+ t.test('stringifies an object inside an array with dots notation', function (st) {
+ st.equal(qs.stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false }), 'a[0].b=c');
+ st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false }), 'a[0].b.c[0]=1');
+ st.end();
+ });
t.test('does not omit object keys when indices = false', function (st) {
st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
@@ -232,4 +249,11 @@ test('stringify()', function (t) {
st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
st.end();
});
+
+ t.test('can sort the keys at depth 3 or more too', function (st) {
+ var sort = function (a, b) { return a.localeCompare(b); };
+ st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: sort, encode: false }), 'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb');
+ st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: null, encode: false }), 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b');
+ st.end();
+ });
});
diff --git a/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/node_modules/request/node_modules/tough-cookie/lib/cookie.js
index 0afe4a2a9..12da297ac 100644
--- a/node_modules/request/node_modules/tough-cookie/lib/cookie.js
+++ b/node_modules/request/node_modules/tough-cookie/lib/cookie.js
@@ -58,11 +58,11 @@ var CONTROL_CHARS = /[\x00-\x1F]/;
// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60)
// '=' and ';' are attribute/values separators
// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64)
-var COOKIE_PAIR = /^(([^=;]+))\s*=\s*(("?)[^\n\r\0]*\3)/
+var COOKIE_PAIR = /^(([^=;]+))\s*=\s*([^\n\r\0]*)/;
// Used to parse non-RFC-compliant cookies like '=abc' when given the `loose`
// option in Cookie.parse:
-var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?(("?)[^\n\r\0]*\3)/;
+var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?([^\n\r\0]*)/;
// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
// Note ';' is \x3B
diff --git a/node_modules/request/node_modules/tough-cookie/package.json b/node_modules/request/node_modules/tough-cookie/package.json
index 24c18e2ec..565dbe191 100644
--- a/node_modules/request/node_modules/tough-cookie/package.json
+++ b/node_modules/request/node_modules/tough-cookie/package.json
@@ -2,20 +2,24 @@
"_args": [
[
"tough-cookie@~2.2.0",
- "/Users/ogd/Documents/projects/npm/npm/node_modules/request"
+ "/Users/rebecca/code/npm/node_modules/request"
]
],
"_from": "tough-cookie@>=2.2.0 <2.3.0",
- "_id": "tough-cookie@2.2.1",
+ "_id": "tough-cookie@2.2.2",
"_inCache": true,
"_installable": true,
"_location": "/request/tough-cookie",
- "_nodeVersion": "0.12.5",
+ "_nodeVersion": "5.1.1",
+ "_npmOperationalInternal": {
+ "host": "packages-13-west.internal.npmjs.com",
+ "tmp": "tmp/tough-cookie-2.2.2.tgz_1457564639182_0.5129188685677946"
+ },
"_npmUser": {
"email": "jstash@gmail.com",
"name": "jstash"
},
- "_npmVersion": "2.11.2",
+ "_npmVersion": "3.3.12",
"_phantomChildren": {},
"_requested": {
"name": "tough-cookie",
@@ -28,11 +32,11 @@
"_requiredBy": [
"/request"
],
- "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz",
- "_shasum": "3b0516b799e70e8164436a1446e7e5877fda118e",
+ "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz",
+ "_shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7",
"_shrinkwrap": null,
"_spec": "tough-cookie@~2.2.0",
- "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request",
+ "_where": "/Users/rebecca/code/npm/node_modules/request",
"author": {
"email": "jstashewsky@salesforce.com",
"name": "Jeremy Stashewsky"
@@ -68,8 +72,8 @@
},
"directories": {},
"dist": {
- "shasum": "3b0516b799e70e8164436a1446e7e5877fda118e",
- "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz"
+ "shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7",
+ "tarball": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz"
},
"engines": {
"node": ">=0.10.0"
@@ -77,28 +81,28 @@
"files": [
"lib"
],
- "gitHead": "f1055655ea56c85bd384aaf7d5b740b916700b6f",
+ "gitHead": "cc46628c4d7d2e8c372ecba29293ca8a207ec192",
"homepage": "https://github.com/SalesforceEng/tough-cookie",
"keywords": [
"HTTP",
- "RFC2965",
- "RFC6265",
"cookie",
- "cookiejar",
"cookies",
+ "set-cookie",
+ "cookiejar",
"jar",
- "set-cookie"
+ "RFC6265",
+ "RFC2965"
],
"license": "BSD-3-Clause",
"main": "./lib/cookie",
"maintainers": [
{
- "name": "jstash",
- "email": "jeremy@goinstant.com"
+ "email": "jeremy@goinstant.com",
+ "name": "jstash"
},
{
- "name": "goinstant",
- "email": "services@goinstant.com"
+ "email": "services@goinstant.com",
+ "name": "goinstant"
}
],
"name": "tough-cookie",
@@ -112,5 +116,5 @@
"suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js",
"test": "vows test/*_test.js"
},
- "version": "2.2.1"
+ "version": "2.2.2"
}
diff --git a/node_modules/request/package.json b/node_modules/request/package.json
index f3f8cf490..62960bd71 100644
--- a/node_modules/request/package.json
+++ b/node_modules/request/package.json
@@ -6,20 +6,24 @@
]
],
"_from": "request@latest",
- "_id": "request@2.69.0",
+ "_id": "request@2.70.0",
"_inCache": true,
"_installable": true,
"_location": "/request",
- "_nodeVersion": "4.1.2",
+ "_nodeVersion": "5.9.0",
+ "_npmOperationalInternal": {
+ "host": "packages-12-west.internal.npmjs.com",
+ "tmp": "tmp/request-2.70.0.tgz_1459850846109_0.8679330893792212"
+ },
"_npmUser": {
- "email": "mikeal.rogers@gmail.com",
- "name": "mikeal"
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
},
- "_npmVersion": "2.14.4",
+ "_npmVersion": "3.8.5",
"_phantomChildren": {
"ansi-regex": "2.0.0",
- "readable-stream": "2.0.5",
- "strip-ansi": "3.0.0"
+ "readable-stream": "2.0.6",
+ "strip-ansi": "3.0.1"
},
"_requested": {
"name": "request",
@@ -34,8 +38,8 @@
"/node-gyp",
"/npm-registry-client"
],
- "_resolved": "https://registry.npmjs.org/request/-/request-2.69.0.tgz",
- "_shasum": "cf91d2e000752b1217155c005241911991a2346a",
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.70.0.tgz",
+ "_shasum": "7ecf8437d6fb553e92e2981a411b9ee2aadd7cce",
"_shrinkwrap": null,
"_spec": "request@latest",
"_where": "/Users/rebecca/code/npm",
@@ -49,43 +53,44 @@
"dependencies": {
"aws-sign2": "~0.6.0",
"aws4": "^1.2.1",
- "bl": "~1.0.0",
+ "bl": "~1.1.2",
"caseless": "~0.11.0",
"combined-stream": "~1.0.5",
"extend": "~3.0.0",
"forever-agent": "~0.6.1",
"form-data": "~1.0.0-rc3",
"har-validator": "~2.0.6",
- "hawk": "~3.1.0",
+ "hawk": "~3.1.3",
"http-signature": "~1.1.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.7",
"node-uuid": "~1.4.7",
- "oauth-sign": "~0.8.0",
- "qs": "~6.0.2",
+ "oauth-sign": "~0.8.1",
+ "qs": "~6.1.0",
"stringstream": "~0.0.4",
"tough-cookie": "~2.2.0",
"tunnel-agent": "~0.4.1"
},
"description": "Simplified HTTP request client.",
"devDependencies": {
- "bluebird": "^3.0.2",
- "browserify": "^13.0.0",
- "browserify-istanbul": "^0.1.5",
+ "bluebird": "^3.2.1",
+ "browserify": "^12.0.2",
+ "browserify-istanbul": "^2.0.0",
"buffer-equal": "^1.0.0",
"codecov.io": "^0.1.6",
"coveralls": "^2.11.4",
- "eslint": "1.10.3",
+ "eslint": "^2.5.3",
"function-bind": "^1.0.2",
"istanbul": "^0.4.0",
"karma": "^0.13.10",
- "karma-browserify": "^4.4.0",
+ "karma-browserify": "^5.0.1",
"karma-cli": "^0.1.1",
"karma-coverage": "^0.5.3",
- "karma-phantomjs-launcher": "^0.1.4",
+ "karma-phantomjs-launcher": "^1.0.0",
"karma-tap": "^1.0.3",
+ "phantomjs-prebuilt": "^2.1.3",
"rimraf": "^2.2.8",
"server-destroy": "^1.0.1",
"tape": "^4.2.0",
@@ -93,32 +98,32 @@
},
"directories": {},
"dist": {
- "shasum": "cf91d2e000752b1217155c005241911991a2346a",
- "tarball": "http://registry.npmjs.org/request/-/request-2.69.0.tgz"
+ "shasum": "7ecf8437d6fb553e92e2981a411b9ee2aadd7cce",
+ "tarball": "https://registry.npmjs.org/request/-/request-2.70.0.tgz"
},
"engines": {
"node": ">=0.8.0"
},
- "gitHead": "1c2fb40c74efb4f706f350a78dbd5e58fe913af3",
+ "gitHead": "bc781cb49aafedb057719e8b1eb7850979688a85",
"homepage": "https://github.com/request/request#readme",
"license": "Apache-2.0",
"main": "index.js",
"maintainers": [
{
- "name": "mikeal",
- "email": "mikeal.rogers@gmail.com"
+ "email": "mikeal.rogers@gmail.com",
+ "name": "mikeal"
},
{
- "name": "nylen",
- "email": "jnylen@gmail.com"
+ "email": "jnylen@gmail.com",
+ "name": "nylen"
},
{
- "name": "fredkschott",
- "email": "fkschott@gmail.com"
+ "email": "fkschott@gmail.com",
+ "name": "fredkschott"
},
{
- "name": "simov",
- "email": "simeonvelichkov@gmail.com"
+ "email": "simeonvelichkov@gmail.com",
+ "name": "simov"
}
],
"name": "request",
@@ -141,5 +146,5 @@
"util",
"utility"
],
- "version": "2.69.0"
+ "version": "2.70.0"
}
diff --git a/node_modules/request/request.js b/node_modules/request/request.js
index e4a181237..6310e0a6b 100644
--- a/node_modules/request/request.js
+++ b/node_modules/request/request.js
@@ -16,6 +16,7 @@ var http = require('http')
, ForeverAgent = require('forever-agent')
, FormData = require('form-data')
, extend = require('extend')
+ , isstream = require('isstream')
, isTypedArray = require('is-typedarray').strict
, helpers = require('./lib/helpers')
, cookies = require('./lib/cookies')
@@ -452,7 +453,7 @@ Request.prototype.init = function (options) {
}
}
}
- if (self.body) {
+ if (self.body && !isstream(self.body)) {
setContentLength()
}
@@ -552,15 +553,19 @@ Request.prototype.init = function (options) {
self._multipart.body.pipe(self)
}
if (self.body) {
- setContentLength()
- if (Array.isArray(self.body)) {
- self.body.forEach(function (part) {
- self.write(part)
- })
+ if (isstream(self.body)) {
+ self.body.pipe(self)
} else {
- self.write(self.body)
+ setContentLength()
+ if (Array.isArray(self.body)) {
+ self.body.forEach(function (part) {
+ self.write(part)
+ })
+ } else {
+ self.write(self.body)
+ }
+ self.end()
}
- self.end()
} else if (self.requestBodyStream) {
console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
self.requestBodyStream.pipe(self)
@@ -1157,11 +1162,15 @@ Request.prototype.json = function (val) {
self.setHeader('accept', 'application/json')
}
+ if (typeof self.jsonReplacer === 'function') {
+ self._jsonReplacer = self.jsonReplacer
+ }
+
self._json = true
if (typeof val === 'boolean') {
if (self.body !== undefined) {
if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
- self.body = safeStringify(self.body)
+ self.body = safeStringify(self.body, self._jsonReplacer)
} else {
self.body = self._qs.rfc3986(self.body)
}
@@ -1170,7 +1179,7 @@ Request.prototype.json = function (val) {
}
}
} else {
- self.body = safeStringify(val)
+ self.body = safeStringify(val, self._jsonReplacer)
if (!self.hasHeader('content-type')) {
self.setHeader('content-type', 'application/json')
}