summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent')
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.npmignore1
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml8
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md67
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md134
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.npmignore1
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml8
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md41
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md121
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js101
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.npmignore4
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.travis.yml5
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE15
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/README.md303
-rwxr-xr-xdeps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/bin/semver133
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/package.json52
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/semver.js1200
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/big-numbers.js31
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/clean.js29
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/gtr.js173
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/index.js698
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/ltr.js181
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/major-minor-patch.js72
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json65
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js54
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key15
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem12
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js300
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.jscs.json174
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.npmignore1
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.travis.yml179
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/CHANGELOG.md76
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/LICENSE22
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/README.md80
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/component.json31
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/index.js86
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/package.json79
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore4
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE20
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md339
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js33
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js30
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js31
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js6
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js108
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js306
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc46
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore2
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml15
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md90
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js416
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json57
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js407
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore5
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml11
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE20
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md307
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js726
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map1
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js371
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json73
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js410
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts383
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json72
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json69
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js131
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt13
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key15
-rw-r--r--deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js151
68 files changed, 9220 insertions, 0 deletions
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.npmignore
new file mode 100644
index 0000000000..07e6e472cc
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.npmignore
@@ -0,0 +1 @@
+/node_modules
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml
new file mode 100644
index 0000000000..85a50123c6
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.12"
+before_install:
+ - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
+ - npm install -g npm@latest
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md
new file mode 100644
index 0000000000..519a31b373
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/History.md
@@ -0,0 +1,67 @@
+
+2.0.0 / 2015-07-10
+==================
+
+ * API CHANGE! Removed `secure` boolean second argument in constructor
+ * upgrade to "agent-base" v2 API
+ * package: update "extend" to v3
+
+1.0.2 / 2015-07-01
+==================
+
+ * remove "v4a" from description
+ * socks-proxy-agent: cast `port` to a Number
+ * travis: attempt to make node v0.8 work
+ * travis: test node v0.12, don't test v0.11
+ * test: pass `rejectUnauthorized` as a proxy opt
+ * test: catch http.ClientRequest errors
+ * test: add self-signed SSL server cert files
+ * test: refactor to use local SOCKS, HTTP and HTTPS servers
+ * README: use SVG for Travis-CI badge
+
+1.0.1 / 2015-03-01
+==================
+
+ * switched from using "socks-client" to "socks" (#5, @JoshGlazebrook)
+
+1.0.0 / 2015-02-11
+==================
+
+ * add client-side DNS lookup logic for 4 and 5 version socks proxies
+ * remove dead `onproxyconnect()` code function
+ * use a switch statement to decide the socks `version`
+ * refactor to use "socks-client" instead of "rainbowsocks"
+ * package: remove "rainbowsocks" dependency
+ * package: allow any "mocha" v2
+
+0.1.2 / 2014-06-11
+==================
+
+ * package: update "rainbowsocks" to v0.1.2
+ * travis: don't test node v0.9
+
+0.1.1 / 2014-04-09
+==================
+
+ * package: update outdated dependencies
+ * socks-proxy-agent: pass `secure` flag when no `new`
+ * socks-proxy-agent: small code cleanup
+
+0.1.0 / 2013-11-19
+==================
+
+ * add .travis.yml file
+ * socks-proxy-agent: properly mix in the proxy options
+ * socks-proxy-agent: coerce the `secureEndpoint` into a Boolean
+ * socks-proxy-agent: use "extend" module
+ * socks-proxy-agent: update to "agent-base" v1 API
+
+0.0.2 / 2013-07-24
+==================
+
+ * socks-proxy-agent: properly set the `defaultPort` property
+
+0.0.1 / 2013-07-11
+==================
+
+ * Initial release
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md
new file mode 100644
index 0000000000..f671685d39
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/README.md
@@ -0,0 +1,134 @@
+socks-proxy-agent
+================
+### A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
+[![Build Status](https://travis-ci.org/TooTallNate/node-socks-proxy-agent.svg?branch=master)](https://travis-ci.org/TooTallNate/node-socks-proxy-agent)
+
+This module provides an `http.Agent` implementation that connects to a
+specified SOCKS proxy server, and can be used with the built-in `http`
+or `https` modules.
+
+It can also be used in conjunction with the `ws` module to establish a WebSocket
+connection over a SOCKS proxy. See the "Examples" section below.
+
+Installation
+------------
+
+Install with `npm`:
+
+``` bash
+$ npm install socks-proxy-agent
+```
+
+
+Examples
+--------
+
+#### `http` module example
+
+``` js
+var url = require('url');
+var http = require('http');
+var SocksProxyAgent = require('socks-proxy-agent');
+
+// SOCKS proxy to connect to
+var proxy = process.env.socks_proxy || 'socks://127.0.0.1:9050';
+console.log('using proxy server %j', proxy);
+
+// HTTP endpoint for the proxy to connect to
+var endpoint = process.argv[2] || 'http://nodejs.org/api/';
+console.log('attempting to GET %j', endpoint);
+var opts = url.parse(endpoint);
+
+// create an instance of the `SocksProxyAgent` class with the proxy server information
+var agent = new SocksProxyAgent(proxy);
+opts.agent = agent;
+
+http.get(opts, function (res) {
+ console.log('"response" event!', res.headers);
+ res.pipe(process.stdout);
+});
+```
+
+#### `https` module example
+
+``` js
+var url = require('url');
+var https = require('https');
+var SocksProxyAgent = require('socks-proxy-agent');
+
+// SOCKS proxy to connect to
+var proxy = process.env.socks_proxy || 'socks://127.0.0.1:9050';
+console.log('using proxy server %j', proxy);
+
+// HTTP endpoint for the proxy to connect to
+var endpoint = process.argv[2] || 'https://encrypted.google.com/';
+console.log('attempting to GET %j', endpoint);
+var opts = url.parse(endpoint);
+
+// create an instance of the `SocksProxyAgent` class with the proxy server information
+// NOTE: the `true` second argument! Means to use TLS encryption on the socket
+var agent = new SocksProxyAgent(proxy, true);
+opts.agent = agent;
+
+http.get(opts, function (res) {
+ console.log('"response" event!', res.headers);
+ res.pipe(process.stdout);
+});
+```
+
+#### `ws` WebSocket connection example
+
+``` js
+var WebSocket = require('ws');
+var SocksProxyAgent = require('socks-proxy-agent');
+
+// SOCKS proxy to connect to
+var proxy = process.env.socks_proxy || 'socks://127.0.0.1:9050';
+console.log('using proxy server %j', proxy);
+
+// WebSocket endpoint for the proxy to connect to
+var endpoint = process.argv[2] || 'ws://echo.websocket.org';
+console.log('attempting to connect to WebSocket %j', endpoint);
+
+// create an instance of the `SocksProxyAgent` class with the proxy server information
+var agent = new SocksProxyAgent(proxy);
+
+// initiate the WebSocket connection
+var socket = new WebSocket(endpoint, { agent: agent });
+
+socket.on('open', function () {
+ console.log('"open" event!');
+ socket.send('hello world');
+});
+
+socket.on('message', function (data, flags) {
+ console.log('"message" event! %j %j', data, flags);
+ socket.close();
+});
+```
+
+License
+-------
+
+(The MIT License)
+
+Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.npmignore
new file mode 100644
index 0000000000..07e6e472cc
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.npmignore
@@ -0,0 +1 @@
+/node_modules
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml
new file mode 100644
index 0000000000..85a50123c6
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/.travis.yml
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.12"
+before_install:
+ - '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
+ - npm install -g npm@latest
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md
new file mode 100644
index 0000000000..0ceef6c13f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/History.md
@@ -0,0 +1,41 @@
+
+2.0.1 / 2015-09-10
+==================
+
+ * package: update "semver" to v5.0.1 for WebPack (#1, @vhpoet)
+
+2.0.0 / 2015-07-10
+==================
+
+ * refactor to patch Node.js core for more consistent `opts` values
+ * ensure that HTTP(s) default port numbers are always given
+ * test: use ssl-cert-snakeoil SSL certs
+ * test: add tests for arbitrary options
+ * README: add API section
+ * README: make the Agent HTTP/HTTPS generic in the example
+ * README: use SVG for Travis-CI badge
+
+1.0.2 / 2015-06-27
+==================
+
+ * agent: set `req._hadError` to true after emitting "error"
+ * package: update "mocha" to v2
+ * test: add artificial HTTP GET request test
+ * test: add artificial data events test
+ * test: fix artifical GET response test on node > v0.11.3
+ * test: use a real timeout for the async error test
+
+1.0.1 / 2013-09-09
+==================
+
+ * Fix passing an "error" object to the callback function on the first tick
+
+1.0.0 / 2013-09-09
+==================
+
+ * New API: now you pass a callback function directly
+
+0.0.1 / 2013-07-09
+==================
+
+ * Initial release
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md
new file mode 100644
index 0000000000..616b90cdbf
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/README.md
@@ -0,0 +1,121 @@
+agent-base
+==========
+### Turn a function into an `http.Agent` instance
+[![Build Status](https://travis-ci.org/TooTallNate/node-agent-base.svg?branch=master)](https://travis-ci.org/TooTallNate/node-agent-base)
+
+This module provides an `http.Agent` generator. That is, you pass it an async
+callback function, and it returns a new `http.Agent` instance that will invoke the
+given callback function when sending outbound HTTP requests.
+
+#### Some subclasses:
+
+Here's some more interesting uses of `agent-base`.
+Send a pull request to list yours!
+
+ * [`http-proxy-agent`][http-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTP endpoints
+ * [`https-proxy-agent`][https-proxy-agent]: An HTTP(s) proxy `http.Agent` implementation for HTTPS endpoints
+ * [`pac-proxy-agent`][pac-proxy-agent]: A PAC file proxy `http.Agent` implementation for HTTP and HTTPS
+ * [`socks-proxy-agent`][socks-proxy-agent]: A SOCKS (v4a) proxy `http.Agent` implementation for HTTP and HTTPS
+
+
+Installation
+------------
+
+Install with `npm`:
+
+``` bash
+$ npm install agent-base
+```
+
+
+Example
+-------
+
+Here's a minimal example that creates a new `net.Socket` connection to the server
+for every HTTP request (i.e. the equivalent of `agent: false` option):
+
+``` js
+var net = require('net');
+var tls = require('tls');
+var url = require('url');
+var http = require('http');
+var agent = require('agent-base');
+
+var endpoint = 'http://nodejs.org/api/';
+var opts = url.parse(endpoint);
+
+// This is the important part!
+opts.agent = agent(function (req, opts, fn) {
+ var socket;
+ // `secureEndpoint` is true when using the https module
+ if (opts.secureEndpoint) {
+ socket = tls.connect(opts);
+ } else {
+ socket = net.connect(opts);
+ }
+ fn(null, socket);
+});
+
+// Everything else works just like normal...
+http.get(opts, function (res) {
+ console.log('"response" event!', res.headers);
+ res.pipe(process.stdout);
+});
+```
+
+API
+---
+
+## Agent(Function callback) → http.Agent
+
+Creates a base `http.Agent` that will execute the callback function `callback`
+for every HTTP request that it is used as the `agent` for. The callback function
+is responsible for creating a `stream.Duplex` instance of some kind that will be
+used as the underlying socket in the HTTP request.
+
+The callback function should have the following signature:
+
+### callback(http.ClientRequest req, Object options, Function cb) → undefined
+
+The ClientRequest `req` can be accessed to read request headers and
+and the path, etc. The `options` object contains the options passed
+to the `http.request()`/`https.request()` function call, and is formatted
+to be directly passed to `net.connect()`/`tls.connect()`, or however
+else you want a Socket to be created. Pass the created socket to
+the callback function `cb` once created, and the HTTP request will
+continue to proceed.
+
+If the `https` module is used to invoke the HTTP request, then the
+`secureEndpoint` property on `options` will be set to `true`.
+
+
+License
+-------
+
+(The MIT License)
+
+Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+[http-proxy-agent]: https://github.com/TooTallNate/node-http-proxy-agent
+[https-proxy-agent]: https://github.com/TooTallNate/node-https-proxy-agent
+[pac-proxy-agent]: https://github.com/TooTallNate/node-pac-proxy-agent
+[socks-proxy-agent]: https://github.com/TooTallNate/node-socks-proxy-agent
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js
new file mode 100644
index 0000000000..4005ebc0ef
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/agent.js
@@ -0,0 +1,101 @@
+
+/**
+ * Module dependencies.
+ */
+
+require('./patch-core');
+var extend = require('extend');
+var inherits = require('util').inherits;
+var EventEmitter = require('events').EventEmitter;
+
+/**
+ * Module exports.
+ */
+
+module.exports = Agent;
+
+/**
+ * Base `http.Agent` implementation.
+ * No pooling/keep-alive is implemented by default.
+ *
+ * @param {Function} callback
+ * @api public
+ */
+
+function Agent (callback) {
+ if (!(this instanceof Agent)) return new Agent(callback);
+ if ('function' != typeof callback) throw new Error('Must pass a "callback function"');
+ EventEmitter.call(this);
+ this.callback = callback;
+}
+inherits(Agent, EventEmitter);
+
+/**
+ * Called by node-core's "_http_client.js" module when creating
+ * a new HTTP request with this Agent instance.
+ *
+ * @api public
+ */
+
+Agent.prototype.addRequest = function (req, host, port, localAddress) {
+ var opts;
+ if ('object' == typeof host) {
+ // >= v0.11.x API
+ opts = extend({}, req._options, host);
+ } else {
+ // <= v0.10.x API
+ opts = extend({}, req._options, { host: host, port: port });
+ if (null != localAddress) {
+ opts.localAddress = localAddress;
+ }
+ }
+
+ if (opts.host && opts.path) {
+ // if both a `host` and `path` are specified then it's most likely the
+ // result of a `url.parse()` call... we need to remove the `path` portion so
+ // that `net.connect()` doesn't attempt to open that as a unix socket file.
+ delete opts.path;
+ }
+
+ // set default `port` if none was explicitly specified
+ if (null == opts.port) {
+ opts.port = opts.secureEndpoint ? 443 : 80;
+ }
+
+ delete opts.agent;
+ delete opts.hostname;
+ delete opts._defaultAgent;
+ delete opts.defaultPort;
+ delete opts.createConnection;
+
+ // hint to use "Connection: close"
+ // XXX: non-documented `http` module API :(
+ req._last = true;
+ req.shouldKeepAlive = false;
+
+ // clean up a bit of memory since we're no longer using this
+ req._options = null;
+
+ // create the `net.Socket` instance
+ var sync = true;
+ this.callback(req, opts, function (err, socket) {
+ function emitErr () {
+ req.emit('error', err);
+ // For Safety. Some additional errors might fire later on
+ // and we need to make sure we don't double-fire the error event.
+ req._hadError = true;
+ }
+ if (err) {
+ if (sync) {
+ // need to defer the "error" event, when sync, because by now the `req`
+ // instance hasn't event been passed back to the user yet...
+ process.nextTick(emitErr);
+ } else {
+ emitErr();
+ }
+ } else {
+ req.onSocket(socket);
+ }
+ });
+ sync = false;
+};
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.npmignore
new file mode 100644
index 0000000000..534108e3f4
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.npmignore
@@ -0,0 +1,4 @@
+node_modules/
+coverage/
+.nyc_output/
+nyc_output/
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.travis.yml
new file mode 100644
index 0000000000..991d04b6e2
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - '0.10'
+ - '0.12'
+ - 'iojs'
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE
new file mode 100644
index 0000000000..19129e315f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/README.md
new file mode 100644
index 0000000000..b5e35ff0b5
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/README.md
@@ -0,0 +1,303 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Usage
+
+ $ npm install semver
+
+ semver.valid('1.2.3') // '1.2.3'
+ semver.valid('a.b.c') // null
+ semver.clean(' =v1.2.3 ') // '1.2.3'
+ semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+ semver.gt('1.2.3', '9.8.7') // false
+ semver.lt('1.2.3', '9.8.7') // true
+
+As a command-line utility:
+
+ $ semver -h
+
+ Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
+ Test if version(s) satisfy the supplied range(s), and sort them.
+
+ Multiple versions or ranges may be supplied, unless increment
+ option is specified. In that case, only a single version may
+ be used, and it is incremented by the specified level
+
+ Program exits successfully if any valid version satisfies
+ all supplied ranges, and prints all satisfying versions.
+
+ If no versions are valid, or ranges are not satisfied,
+ then exits failure.
+
+ Versions are printed in ascending order, so supplying
+ multiple versions to the utility will just sort them.
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+<http://semver.org/>.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`. The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal. If no operator is specified, then equality is assumed,
+ so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`. A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
+range only accepts prerelease tags on the `1.2.3` version. The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold. First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions. By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk. However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+> semver.inc('1.2.3', 'pre', 'beta')
+'1.2.4-beta.0'
+```
+
+command-line example:
+
+```shell
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```shell
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any version satisfies)
+* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator. Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero digit in the
+`[major, minor, patch]` tuple. In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0`
+* `^0.2.3` := `>=0.2.3 <0.3.0`
+* `^0.0.3` := `>=0.0.3 <0.0.4`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
+ the `1.2.3` version will be allowed, if they are greater than or
+ equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
+ `1.2.4-beta.2` would not, because it is a prerelease of a
+ different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
+ `0.0.3` version *only* will be allowed, if they are greater than or
+ equal to `beta`. So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0`
+* `^0.0.x` := `>=0.0.0 <0.1.0`
+* `^0.0` := `>=0.0.0 <0.1.0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0`
+* `^0.x` := `>=0.0.0 <1.0.0`
+
+## Functions
+
+All methods and classes take a final `loose` boolean argument that, if
+true, will be more forgiving about not-quite-valid semver strings.
+The resulting output will always be 100% strict, of course.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+ type (`major`, `premajor`, `minor`, `preminor`, `patch`,
+ `prepatch`, or `prerelease`), or null if it's not valid
+ * `premajor` in one call will bump the version up to the next major
+ version and down to a prerelease of that major version.
+ `preminor`, and `prepatch` work the same way.
+ * If called from a non-prerelease version, the `prerelease` will work the
+ same as `prepatch`. It increments the patch version, then makes a
+ prerelease. If the input version is already a prerelease it simply
+ increments it.
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+ even if they're not the exact same string. You already know how to
+ compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+ the corresponding function above. `"==="` and `"!=="` do simple
+ string comparison, but are included for completeness. Throws if an
+ invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+ `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
+ in descending order when passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+ (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+ or null if the versions are the same.
+
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+ range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+ that satisfies the range, or `null` if none of them do.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+ versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+ versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+ the bounds of the range in either the high or low direction. The
+ `hilo` argument must be either the string `'>'` or `'<'`. (This is
+ the function called by `gtr` and `ltr`.)
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range! For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/bin/semver b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/bin/semver
new file mode 100755
index 0000000000..c5f2e857e8
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/bin/semver
@@ -0,0 +1,133 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+var argv = process.argv.slice(2)
+ , versions = []
+ , range = []
+ , gt = []
+ , lt = []
+ , eq = []
+ , inc = null
+ , version = require("../package.json").version
+ , loose = false
+ , identifier = undefined
+ , semver = require("../semver")
+ , reverse = false
+
+main()
+
+function main () {
+ if (!argv.length) return help()
+ while (argv.length) {
+ var a = argv.shift()
+ var i = a.indexOf('=')
+ if (i !== -1) {
+ a = a.slice(0, i)
+ argv.unshift(a.slice(i + 1))
+ }
+ switch (a) {
+ case "-rv": case "-rev": case "--rev": case "--reverse":
+ reverse = true
+ break
+ case "-l": case "--loose":
+ loose = true
+ break
+ case "-v": case "--version":
+ versions.push(argv.shift())
+ break
+ case "-i": case "--inc": case "--increment":
+ switch (argv[0]) {
+ case "major": case "minor": case "patch": case "prerelease":
+ case "premajor": case "preminor": case "prepatch":
+ inc = argv.shift()
+ break
+ default:
+ inc = "patch"
+ break
+ }
+ break
+ case "--preid":
+ identifier = argv.shift()
+ break
+ case "-r": case "--range":
+ range.push(argv.shift())
+ break
+ case "-h": case "--help": case "-?":
+ return help()
+ default:
+ versions.push(a)
+ break
+ }
+ }
+
+ versions = versions.filter(function (v) {
+ return semver.valid(v, loose)
+ })
+ if (!versions.length) return fail()
+ if (inc && (versions.length !== 1 || range.length))
+ return failInc()
+
+ for (var i = 0, l = range.length; i < l ; i ++) {
+ versions = versions.filter(function (v) {
+ return semver.satisfies(v, range[i], loose)
+ })
+ if (!versions.length) return fail()
+ }
+ return success(versions)
+}
+
+function failInc () {
+ console.error("--inc can only be used on a single version with no range")
+ fail()
+}
+
+function fail () { process.exit(1) }
+
+function success () {
+ var compare = reverse ? "rcompare" : "compare"
+ versions.sort(function (a, b) {
+ return semver[compare](a, b, loose)
+ }).map(function (v) {
+ return semver.clean(v, loose)
+ }).map(function (v) {
+ return inc ? semver.inc(v, inc, loose, identifier) : v
+ }).forEach(function (v,i,_) { console.log(v) })
+}
+
+function help () {
+ console.log(["SemVer " + version
+ ,""
+ ,"A JavaScript implementation of the http://semver.org/ specification"
+ ,"Copyright Isaac Z. Schlueter"
+ ,""
+ ,"Usage: semver [options] <version> [<version> [...]]"
+ ,"Prints valid versions sorted by SemVer precedence"
+ ,""
+ ,"Options:"
+ ,"-r --range <range>"
+ ," Print versions that match the specified range."
+ ,""
+ ,"-i --increment [<level>]"
+ ," Increment a version by the specified level. Level can"
+ ," be one of: major, minor, patch, premajor, preminor,"
+ ," prepatch, or prerelease. Default level is 'patch'."
+ ," Only one version may be specified."
+ ,""
+ ,"--preid <identifier>"
+ ," Identifier to be used to prefix premajor, preminor,"
+ ," prepatch or prerelease version increments."
+ ,""
+ ,"-l --loose"
+ ," Interpret versions and ranges loosely"
+ ,""
+ ,"Program exits successfully if any valid version satisfies"
+ ,"all supplied ranges, and prints all satisfying versions."
+ ,""
+ ,"If no satisfying versions are found, then exits failure."
+ ,""
+ ,"Versions are printed in ascending order, so supplying"
+ ,"multiple versions to the utility will just sort them."
+ ].join("\n"))
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/package.json
new file mode 100644
index 0000000000..29aeddec1f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/package.json
@@ -0,0 +1,52 @@
+{
+ "_from": "semver@~5.0.1",
+ "_id": "semver@5.0.3",
+ "_integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/agent-base/semver",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "semver@~5.0.1",
+ "name": "semver",
+ "escapedName": "semver",
+ "rawSpec": "~5.0.1",
+ "saveSpec": null,
+ "fetchSpec": "~5.0.1"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent/agent-base"
+ ],
+ "_resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz",
+ "_shasum": "77466de589cd5d3c95f138aa78bc569a3cb5d27a",
+ "_shrinkwrap": null,
+ "_spec": "semver@~5.0.1",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base",
+ "bin": {
+ "semver": "./bin/semver"
+ },
+ "bugs": {
+ "url": "https://github.com/npm/node-semver/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "The semantic version parser used by npm.",
+ "devDependencies": {
+ "tap": "^1.3.4"
+ },
+ "homepage": "https://github.com/npm/node-semver#readme",
+ "license": "ISC",
+ "main": "semver.js",
+ "name": "semver",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/npm/node-semver.git"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "version": "5.0.3"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/semver.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/semver.js
new file mode 100644
index 0000000000..19392d8ff9
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/semver.js
@@ -0,0 +1,1200 @@
+exports = module.exports = SemVer;
+
+// The debug function is excluded entirely from the minified version.
+/* nomin */ var debug;
+/* nomin */ if (typeof process === 'object' &&
+ /* nomin */ process.env &&
+ /* nomin */ process.env.NODE_DEBUG &&
+ /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG))
+ /* nomin */ debug = function() {
+ /* nomin */ var args = Array.prototype.slice.call(arguments, 0);
+ /* nomin */ args.unshift('SEMVER');
+ /* nomin */ console.log.apply(console, args);
+ /* nomin */ };
+/* nomin */ else
+ /* nomin */ debug = function() {};
+
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+exports.SEMVER_SPEC_VERSION = '2.0.0';
+
+var MAX_LENGTH = 256;
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
+
+// The actual regexps go on exports.re
+var re = exports.re = [];
+var src = exports.src = [];
+var R = 0;
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+var NUMERICIDENTIFIER = R++;
+src[NUMERICIDENTIFIER] = '0|[1-9]\\d*';
+var NUMERICIDENTIFIERLOOSE = R++;
+src[NUMERICIDENTIFIERLOOSE] = '[0-9]+';
+
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+var NONNUMERICIDENTIFIER = R++;
+src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
+
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+var MAINVERSION = R++;
+src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIER] + ')';
+
+var MAINVERSIONLOOSE = R++;
+src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+ '(' + src[NUMERICIDENTIFIERLOOSE] + ')';
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+var PRERELEASEIDENTIFIER = R++;
+src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
+ '|' + src[NONNUMERICIDENTIFIER] + ')';
+
+var PRERELEASEIDENTIFIERLOOSE = R++;
+src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
+ '|' + src[NONNUMERICIDENTIFIER] + ')';
+
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+var PRERELEASE = R++;
+src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
+ '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))';
+
+var PRERELEASELOOSE = R++;
+src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
+ '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+var BUILDIDENTIFIER = R++;
+src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+var BUILD = R++;
+src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
+ '(?:\\.' + src[BUILDIDENTIFIER] + ')*))';
+
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups. The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+var FULL = R++;
+var FULLPLAIN = 'v?' + src[MAINVERSION] +
+ src[PRERELEASE] + '?' +
+ src[BUILD] + '?';
+
+src[FULL] = '^' + FULLPLAIN + '$';
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
+ src[PRERELEASELOOSE] + '?' +
+ src[BUILD] + '?';
+
+var LOOSE = R++;
+src[LOOSE] = '^' + LOOSEPLAIN + '$';
+
+var GTLT = R++;
+src[GTLT] = '((?:<|>)?=?)';
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+var XRANGEIDENTIFIERLOOSE = R++;
+src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
+var XRANGEIDENTIFIER = R++;
+src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*';
+
+var XRANGEPLAIN = R++;
+src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+ '(?:' + src[PRERELEASE] + ')?' +
+ src[BUILD] + '?' +
+ ')?)?';
+
+var XRANGEPLAINLOOSE = R++;
+src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+ '(?:' + src[PRERELEASELOOSE] + ')?' +
+ src[BUILD] + '?' +
+ ')?)?';
+
+var XRANGE = R++;
+src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$';
+var XRANGELOOSE = R++;
+src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$';
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+var LONETILDE = R++;
+src[LONETILDE] = '(?:~>?)';
+
+var TILDETRIM = R++;
+src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
+re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
+var tildeTrimReplace = '$1~';
+
+var TILDE = R++;
+src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
+var TILDELOOSE = R++;
+src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+var LONECARET = R++;
+src[LONECARET] = '(?:\\^)';
+
+var CARETTRIM = R++;
+src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
+re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
+var caretTrimReplace = '$1^';
+
+var CARET = R++;
+src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
+var CARETLOOSE = R++;
+src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+var COMPARATORLOOSE = R++;
+src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$';
+var COMPARATOR = R++;
+src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
+
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+var COMPARATORTRIM = R++;
+src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
+ '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
+
+// this one has to use the /g flag
+re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
+var comparatorTrimReplace = '$1$2$3';
+
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+var HYPHENRANGE = R++;
+src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[XRANGEPLAIN] + ')' +
+ '\\s*$';
+
+var HYPHENRANGELOOSE = R++;
+src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
+ '\\s+-\\s+' +
+ '(' + src[XRANGEPLAINLOOSE] + ')' +
+ '\\s*$';
+
+// Star ranges basically just allow anything at all.
+var STAR = R++;
+src[STAR] = '(<|>)?=?\\s*\\*';
+
+// Compile to actual regexp objects.
+// All are flag-free, unless they were created above with a flag.
+for (var i = 0; i < R; i++) {
+ debug(i, src[i]);
+ if (!re[i])
+ re[i] = new RegExp(src[i]);
+}
+
+exports.parse = parse;
+function parse(version, loose) {
+ if (version instanceof SemVer)
+ return version;
+
+ if (typeof version !== 'string')
+ return null;
+
+ if (version.length > MAX_LENGTH)
+ return null;
+
+ var r = loose ? re[LOOSE] : re[FULL];
+ if (!r.test(version))
+ return null;
+
+ try {
+ return new SemVer(version, loose);
+ } catch (er) {
+ return null;
+ }
+}
+
+exports.valid = valid;
+function valid(version, loose) {
+ var v = parse(version, loose);
+ return v ? v.version : null;
+}
+
+
+exports.clean = clean;
+function clean(version, loose) {
+ var s = parse(version.trim().replace(/^[=v]+/, ''), loose);
+ return s ? s.version : null;
+}
+
+exports.SemVer = SemVer;
+
+function SemVer(version, loose) {
+ if (version instanceof SemVer) {
+ if (version.loose === loose)
+ return version;
+ else
+ version = version.version;
+ } else if (typeof version !== 'string') {
+ throw new TypeError('Invalid Version: ' + version);
+ }
+
+ if (version.length > MAX_LENGTH)
+ throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
+
+ if (!(this instanceof SemVer))
+ return new SemVer(version, loose);
+
+ debug('SemVer', version, loose);
+ this.loose = loose;
+ var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
+
+ if (!m)
+ throw new TypeError('Invalid Version: ' + version);
+
+ this.raw = version;
+
+ // these are actually numbers
+ this.major = +m[1];
+ this.minor = +m[2];
+ this.patch = +m[3];
+
+ if (this.major > MAX_SAFE_INTEGER || this.major < 0)
+ throw new TypeError('Invalid major version')
+
+ if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
+ throw new TypeError('Invalid minor version')
+
+ if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
+ throw new TypeError('Invalid patch version')
+
+ // numberify any prerelease numeric ids
+ if (!m[4])
+ this.prerelease = [];
+ else
+ this.prerelease = m[4].split('.').map(function(id) {
+ if (/^[0-9]+$/.test(id)) {
+ var num = +id
+ if (num >= 0 && num < MAX_SAFE_INTEGER)
+ return num
+ }
+ return id;
+ });
+
+ this.build = m[5] ? m[5].split('.') : [];
+ this.format();
+}
+
+SemVer.prototype.format = function() {
+ this.version = this.major + '.' + this.minor + '.' + this.patch;
+ if (this.prerelease.length)
+ this.version += '-' + this.prerelease.join('.');
+ return this.version;
+};
+
+SemVer.prototype.inspect = function() {
+ return '<SemVer "' + this + '">';
+};
+
+SemVer.prototype.toString = function() {
+ return this.version;
+};
+
+SemVer.prototype.compare = function(other) {
+ debug('SemVer.compare', this.version, this.loose, other);
+ if (!(other instanceof SemVer))
+ other = new SemVer(other, this.loose);
+
+ return this.compareMain(other) || this.comparePre(other);
+};
+
+SemVer.prototype.compareMain = function(other) {
+ if (!(other instanceof SemVer))
+ other = new SemVer(other, this.loose);
+
+ return compareIdentifiers(this.major, other.major) ||
+ compareIdentifiers(this.minor, other.minor) ||
+ compareIdentifiers(this.patch, other.patch);
+};
+
+SemVer.prototype.comparePre = function(other) {
+ if (!(other instanceof SemVer))
+ other = new SemVer(other, this.loose);
+
+ // NOT having a prerelease is > having one
+ if (this.prerelease.length && !other.prerelease.length)
+ return -1;
+ else if (!this.prerelease.length && other.prerelease.length)
+ return 1;
+ else if (!this.prerelease.length && !other.prerelease.length)
+ return 0;
+
+ var i = 0;
+ do {
+ var a = this.prerelease[i];
+ var b = other.prerelease[i];
+ debug('prerelease compare', i, a, b);
+ if (a === undefined && b === undefined)
+ return 0;
+ else if (b === undefined)
+ return 1;
+ else if (a === undefined)
+ return -1;
+ else if (a === b)
+ continue;
+ else
+ return compareIdentifiers(a, b);
+ } while (++i);
+};
+
+// preminor will bump the version up to the next minor release, and immediately
+// down to pre-release. premajor and prepatch work the same way.
+SemVer.prototype.inc = function(release, identifier) {
+ switch (release) {
+ case 'premajor':
+ this.prerelease.length = 0;
+ this.patch = 0;
+ this.minor = 0;
+ this.major++;
+ this.inc('pre', identifier);
+ break;
+ case 'preminor':
+ this.prerelease.length = 0;
+ this.patch = 0;
+ this.minor++;
+ this.inc('pre', identifier);
+ break;
+ case 'prepatch':
+ // If this is already a prerelease, it will bump to the next version
+ // drop any prereleases that might already exist, since they are not
+ // relevant at this point.
+ this.prerelease.length = 0;
+ this.inc('patch', identifier);
+ this.inc('pre', identifier);
+ break;
+ // If the input is a non-prerelease version, this acts the same as
+ // prepatch.
+ case 'prerelease':
+ if (this.prerelease.length === 0)
+ this.inc('patch', identifier);
+ this.inc('pre', identifier);
+ break;
+
+ case 'major':
+ // If this is a pre-major version, bump up to the same major version.
+ // Otherwise increment major.
+ // 1.0.0-5 bumps to 1.0.0
+ // 1.1.0 bumps to 2.0.0
+ if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0)
+ this.major++;
+ this.minor = 0;
+ this.patch = 0;
+ this.prerelease = [];
+ break;
+ case 'minor':
+ // If this is a pre-minor version, bump up to the same minor version.
+ // Otherwise increment minor.
+ // 1.2.0-5 bumps to 1.2.0
+ // 1.2.1 bumps to 1.3.0
+ if (this.patch !== 0 || this.prerelease.length === 0)
+ this.minor++;
+ this.patch = 0;
+ this.prerelease = [];
+ break;
+ case 'patch':
+ // If this is not a pre-release version, it will increment the patch.
+ // If it is a pre-release it will bump up to the same patch version.
+ // 1.2.0-5 patches to 1.2.0
+ // 1.2.0 patches to 1.2.1
+ if (this.prerelease.length === 0)
+ this.patch++;
+ this.prerelease = [];
+ break;
+ // This probably shouldn't be used publicly.
+ // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+ case 'pre':
+ if (this.prerelease.length === 0)
+ this.prerelease = [0];
+ else {
+ var i = this.prerelease.length;
+ while (--i >= 0) {
+ if (typeof this.prerelease[i] === 'number') {
+ this.prerelease[i]++;
+ i = -2;
+ }
+ }
+ if (i === -1) // didn't increment anything
+ this.prerelease.push(0);
+ }
+ if (identifier) {
+ // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+ // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+ if (this.prerelease[0] === identifier) {
+ if (isNaN(this.prerelease[1]))
+ this.prerelease = [identifier, 0];
+ } else
+ this.prerelease = [identifier, 0];
+ }
+ break;
+
+ default:
+ throw new Error('invalid increment argument: ' + release);
+ }
+ this.format();
+ this.raw = this.version;
+ return this;
+};
+
+exports.inc = inc;
+function inc(version, release, loose, identifier) {
+ if (typeof(loose) === 'string') {
+ identifier = loose;
+ loose = undefined;
+ }
+
+ try {
+ return new SemVer(version, loose).inc(release, identifier).version;
+ } catch (er) {
+ return null;
+ }
+}
+
+exports.diff = diff;
+function diff(version1, version2) {
+ if (eq(version1, version2)) {
+ return null;
+ } else {
+ var v1 = parse(version1);
+ var v2 = parse(version2);
+ if (v1.prerelease.length || v2.prerelease.length) {
+ for (var key in v1) {
+ if (key === 'major' || key === 'minor' || key === 'patch') {
+ if (v1[key] !== v2[key]) {
+ return 'pre'+key;
+ }
+ }
+ }
+ return 'prerelease';
+ }
+ for (var key in v1) {
+ if (key === 'major' || key === 'minor' || key === 'patch') {
+ if (v1[key] !== v2[key]) {
+ return key;
+ }
+ }
+ }
+ }
+}
+
+exports.compareIdentifiers = compareIdentifiers;
+
+var numeric = /^[0-9]+$/;
+function compareIdentifiers(a, b) {
+ var anum = numeric.test(a);
+ var bnum = numeric.test(b);
+
+ if (anum && bnum) {
+ a = +a;
+ b = +b;
+ }
+
+ return (anum && !bnum) ? -1 :
+ (bnum && !anum) ? 1 :
+ a < b ? -1 :
+ a > b ? 1 :
+ 0;
+}
+
+exports.rcompareIdentifiers = rcompareIdentifiers;
+function rcompareIdentifiers(a, b) {
+ return compareIdentifiers(b, a);
+}
+
+exports.major = major;
+function major(a, loose) {
+ return new SemVer(a, loose).major;
+}
+
+exports.minor = minor;
+function minor(a, loose) {
+ return new SemVer(a, loose).minor;
+}
+
+exports.patch = patch;
+function patch(a, loose) {
+ return new SemVer(a, loose).patch;
+}
+
+exports.compare = compare;
+function compare(a, b, loose) {
+ return new SemVer(a, loose).compare(b);
+}
+
+exports.compareLoose = compareLoose;
+function compareLoose(a, b) {
+ return compare(a, b, true);
+}
+
+exports.rcompare = rcompare;
+function rcompare(a, b, loose) {
+ return compare(b, a, loose);
+}
+
+exports.sort = sort;
+function sort(list, loose) {
+ return list.sort(function(a, b) {
+ return exports.compare(a, b, loose);
+ });
+}
+
+exports.rsort = rsort;
+function rsort(list, loose) {
+ return list.sort(function(a, b) {
+ return exports.rcompare(a, b, loose);
+ });
+}
+
+exports.gt = gt;
+function gt(a, b, loose) {
+ return compare(a, b, loose) > 0;
+}
+
+exports.lt = lt;
+function lt(a, b, loose) {
+ return compare(a, b, loose) < 0;
+}
+
+exports.eq = eq;
+function eq(a, b, loose) {
+ return compare(a, b, loose) === 0;
+}
+
+exports.neq = neq;
+function neq(a, b, loose) {
+ return compare(a, b, loose) !== 0;
+}
+
+exports.gte = gte;
+function gte(a, b, loose) {
+ return compare(a, b, loose) >= 0;
+}
+
+exports.lte = lte;
+function lte(a, b, loose) {
+ return compare(a, b, loose) <= 0;
+}
+
+exports.cmp = cmp;
+function cmp(a, op, b, loose) {
+ var ret;
+ switch (op) {
+ case '===':
+ if (typeof a === 'object') a = a.version;
+ if (typeof b === 'object') b = b.version;
+ ret = a === b;
+ break;
+ case '!==':
+ if (typeof a === 'object') a = a.version;
+ if (typeof b === 'object') b = b.version;
+ ret = a !== b;
+ break;
+ case '': case '=': case '==': ret = eq(a, b, loose); break;
+ case '!=': ret = neq(a, b, loose); break;
+ case '>': ret = gt(a, b, loose); break;
+ case '>=': ret = gte(a, b, loose); break;
+ case '<': ret = lt(a, b, loose); break;
+ case '<=': ret = lte(a, b, loose); break;
+ default: throw new TypeError('Invalid operator: ' + op);
+ }
+ return ret;
+}
+
+exports.Comparator = Comparator;
+function Comparator(comp, loose) {
+ if (comp instanceof Comparator) {
+ if (comp.loose === loose)
+ return comp;
+ else
+ comp = comp.value;
+ }
+
+ if (!(this instanceof Comparator))
+ return new Comparator(comp, loose);
+
+ debug('comparator', comp, loose);
+ this.loose = loose;
+ this.parse(comp);
+
+ if (this.semver === ANY)
+ this.value = '';
+ else
+ this.value = this.operator + this.semver.version;
+
+ debug('comp', this);
+}
+
+var ANY = {};
+Comparator.prototype.parse = function(comp) {
+ var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
+ var m = comp.match(r);
+
+ if (!m)
+ throw new TypeError('Invalid comparator: ' + comp);
+
+ this.operator = m[1];
+ if (this.operator === '=')
+ this.operator = '';
+
+ // if it literally is just '>' or '' then allow anything.
+ if (!m[2])
+ this.semver = ANY;
+ else
+ this.semver = new SemVer(m[2], this.loose);
+};
+
+Comparator.prototype.inspect = function() {
+ return '<SemVer Comparator "' + this + '">';
+};
+
+Comparator.prototype.toString = function() {
+ return this.value;
+};
+
+Comparator.prototype.test = function(version) {
+ debug('Comparator.test', version, this.loose);
+
+ if (this.semver === ANY)
+ return true;
+
+ if (typeof version === 'string')
+ version = new SemVer(version, this.loose);
+
+ return cmp(version, this.operator, this.semver, this.loose);
+};
+
+
+exports.Range = Range;
+function Range(range, loose) {
+ if ((range instanceof Range) && range.loose === loose)
+ return range;
+
+ if (!(this instanceof Range))
+ return new Range(range, loose);
+
+ this.loose = loose;
+
+ // First, split based on boolean or ||
+ this.raw = range;
+ this.set = range.split(/\s*\|\|\s*/).map(function(range) {
+ return this.parseRange(range.trim());
+ }, this).filter(function(c) {
+ // throw out any that are not relevant for whatever reason
+ return c.length;
+ });
+
+ if (!this.set.length) {
+ throw new TypeError('Invalid SemVer Range: ' + range);
+ }
+
+ this.format();
+}
+
+Range.prototype.inspect = function() {
+ return '<SemVer Range "' + this.range + '">';
+};
+
+Range.prototype.format = function() {
+ this.range = this.set.map(function(comps) {
+ return comps.join(' ').trim();
+ }).join('||').trim();
+ return this.range;
+};
+
+Range.prototype.toString = function() {
+ return this.range;
+};
+
+Range.prototype.parseRange = function(range) {
+ var loose = this.loose;
+ range = range.trim();
+ debug('range', range, loose);
+ // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+ var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
+ range = range.replace(hr, hyphenReplace);
+ debug('hyphen replace', range);
+ // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+ range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
+ debug('comparator trim', range, re[COMPARATORTRIM]);
+
+ // `~ 1.2.3` => `~1.2.3`
+ range = range.replace(re[TILDETRIM], tildeTrimReplace);
+
+ // `^ 1.2.3` => `^1.2.3`
+ range = range.replace(re[CARETTRIM], caretTrimReplace);
+
+ // normalize spaces
+ range = range.split(/\s+/).join(' ');
+
+ // At this point, the range is completely trimmed and
+ // ready to be split into comparators.
+
+ var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
+ var set = range.split(' ').map(function(comp) {
+ return parseComparator(comp, loose);
+ }).join(' ').split(/\s+/);
+ if (this.loose) {
+ // in loose mode, throw out any that are not valid comparators
+ set = set.filter(function(comp) {
+ return !!comp.match(compRe);
+ });
+ }
+ set = set.map(function(comp) {
+ return new Comparator(comp, loose);
+ });
+
+ return set;
+};
+
+// Mostly just for testing and legacy API reasons
+exports.toComparators = toComparators;
+function toComparators(range, loose) {
+ return new Range(range, loose).set.map(function(comp) {
+ return comp.map(function(c) {
+ return c.value;
+ }).join(' ').trim().split(' ');
+ });
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+function parseComparator(comp, loose) {
+ debug('comp', comp);
+ comp = replaceCarets(comp, loose);
+ debug('caret', comp);
+ comp = replaceTildes(comp, loose);
+ debug('tildes', comp);
+ comp = replaceXRanges(comp, loose);
+ debug('xrange', comp);
+ comp = replaceStars(comp, loose);
+ debug('stars', comp);
+ return comp;
+}
+
+function isX(id) {
+ return !id || id.toLowerCase() === 'x' || id === '*';
+}
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+function replaceTildes(comp, loose) {
+ return comp.trim().split(/\s+/).map(function(comp) {
+ return replaceTilde(comp, loose);
+ }).join(' ');
+}
+
+function replaceTilde(comp, loose) {
+ var r = loose ? re[TILDELOOSE] : re[TILDE];
+ return comp.replace(r, function(_, M, m, p, pr) {
+ debug('tilde', comp, _, M, m, p, pr);
+ var ret;
+
+ if (isX(M))
+ ret = '';
+ else if (isX(m))
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
+ else if (isX(p))
+ // ~1.2 == >=1.2.0- <1.3.0-
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
+ else if (pr) {
+ debug('replaceTilde pr', pr);
+ if (pr.charAt(0) !== '-')
+ pr = '-' + pr;
+ ret = '>=' + M + '.' + m + '.' + p + pr +
+ ' <' + M + '.' + (+m + 1) + '.0';
+ } else
+ // ~1.2.3 == >=1.2.3 <1.3.0
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0';
+
+ debug('tilde return', ret);
+ return ret;
+ });
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2.0 --> >=1.2.0 <2.0.0
+function replaceCarets(comp, loose) {
+ return comp.trim().split(/\s+/).map(function(comp) {
+ return replaceCaret(comp, loose);
+ }).join(' ');
+}
+
+function replaceCaret(comp, loose) {
+ debug('caret', comp, loose);
+ var r = loose ? re[CARETLOOSE] : re[CARET];
+ return comp.replace(r, function(_, M, m, p, pr) {
+ debug('caret', comp, _, M, m, p, pr);
+ var ret;
+
+ if (isX(M))
+ ret = '';
+ else if (isX(m))
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
+ else if (isX(p)) {
+ if (M === '0')
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
+ else
+ ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
+ } else if (pr) {
+ debug('replaceCaret pr', pr);
+ if (pr.charAt(0) !== '-')
+ pr = '-' + pr;
+ if (M === '0') {
+ if (m === '0')
+ ret = '>=' + M + '.' + m + '.' + p + pr +
+ ' <' + M + '.' + m + '.' + (+p + 1);
+ else
+ ret = '>=' + M + '.' + m + '.' + p + pr +
+ ' <' + M + '.' + (+m + 1) + '.0';
+ } else
+ ret = '>=' + M + '.' + m + '.' + p + pr +
+ ' <' + (+M + 1) + '.0.0';
+ } else {
+ debug('no pr');
+ if (M === '0') {
+ if (m === '0')
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + m + '.' + (+p + 1);
+ else
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + M + '.' + (+m + 1) + '.0';
+ } else
+ ret = '>=' + M + '.' + m + '.' + p +
+ ' <' + (+M + 1) + '.0.0';
+ }
+
+ debug('caret return', ret);
+ return ret;
+ });
+}
+
+function replaceXRanges(comp, loose) {
+ debug('replaceXRanges', comp, loose);
+ return comp.split(/\s+/).map(function(comp) {
+ return replaceXRange(comp, loose);
+ }).join(' ');
+}
+
+function replaceXRange(comp, loose) {
+ comp = comp.trim();
+ var r = loose ? re[XRANGELOOSE] : re[XRANGE];
+ return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
+ debug('xRange', comp, ret, gtlt, M, m, p, pr);
+ var xM = isX(M);
+ var xm = xM || isX(m);
+ var xp = xm || isX(p);
+ var anyX = xp;
+
+ if (gtlt === '=' && anyX)
+ gtlt = '';
+
+ if (xM) {
+ if (gtlt === '>' || gtlt === '<') {
+ // nothing is allowed
+ ret = '<0.0.0';
+ } else {
+ // nothing is forbidden
+ ret = '*';
+ }
+ } else if (gtlt && anyX) {
+ // replace X with 0
+ if (xm)
+ m = 0;
+ if (xp)
+ p = 0;
+
+ if (gtlt === '>') {
+ // >1 => >=2.0.0
+ // >1.2 => >=1.3.0
+ // >1.2.3 => >= 1.2.4
+ gtlt = '>=';
+ if (xm) {
+ M = +M + 1;
+ m = 0;
+ p = 0;
+ } else if (xp) {
+ m = +m + 1;
+ p = 0;
+ }
+ } else if (gtlt === '<=') {
+ // <=0.7.x is actually <0.8.0, since any 0.7.x should
+ // pass. Similarly, <=7.x is actually <8.0.0, etc.
+ gtlt = '<'
+ if (xm)
+ M = +M + 1
+ else
+ m = +m + 1
+ }
+
+ ret = gtlt + M + '.' + m + '.' + p;
+ } else if (xm) {
+ ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
+ } else if (xp) {
+ ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
+ }
+
+ debug('xRange return', ret);
+
+ return ret;
+ });
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+function replaceStars(comp, loose) {
+ debug('replaceStars', comp, loose);
+ // Looseness is ignored here. star is always as loose as it gets!
+ return comp.trim().replace(re[STAR], '');
+}
+
+// This function is passed to string.replace(re[HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0
+function hyphenReplace($0,
+ from, fM, fm, fp, fpr, fb,
+ to, tM, tm, tp, tpr, tb) {
+
+ if (isX(fM))
+ from = '';
+ else if (isX(fm))
+ from = '>=' + fM + '.0.0';
+ else if (isX(fp))
+ from = '>=' + fM + '.' + fm + '.0';
+ else
+ from = '>=' + from;
+
+ if (isX(tM))
+ to = '';
+ else if (isX(tm))
+ to = '<' + (+tM + 1) + '.0.0';
+ else if (isX(tp))
+ to = '<' + tM + '.' + (+tm + 1) + '.0';
+ else if (tpr)
+ to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
+ else
+ to = '<=' + to;
+
+ return (from + ' ' + to).trim();
+}
+
+
+// if ANY of the sets match ALL of its comparators, then pass
+Range.prototype.test = function(version) {
+ if (!version)
+ return false;
+
+ if (typeof version === 'string')
+ version = new SemVer(version, this.loose);
+
+ for (var i = 0; i < this.set.length; i++) {
+ if (testSet(this.set[i], version))
+ return true;
+ }
+ return false;
+};
+
+function testSet(set, version) {
+ for (var i = 0; i < set.length; i++) {
+ if (!set[i].test(version))
+ return false;
+ }
+
+ if (version.prerelease.length) {
+ // Find the set of versions that are allowed to have prereleases
+ // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+ // That should allow `1.2.3-pr.2` to pass.
+ // However, `1.2.4-alpha.notready` should NOT be allowed,
+ // even though it's within the range set by the comparators.
+ for (var i = 0; i < set.length; i++) {
+ debug(set[i].semver);
+ if (set[i].semver === ANY)
+ continue;
+
+ if (set[i].semver.prerelease.length > 0) {
+ var allowed = set[i].semver;
+ if (allowed.major === version.major &&
+ allowed.minor === version.minor &&
+ allowed.patch === version.patch)
+ return true;
+ }
+ }
+
+ // Version has a -pre, but it's not one of the ones we like.
+ return false;
+ }
+
+ return true;
+}
+
+exports.satisfies = satisfies;
+function satisfies(version, range, loose) {
+ try {
+ range = new Range(range, loose);
+ } catch (er) {
+ return false;
+ }
+ return range.test(version);
+}
+
+exports.maxSatisfying = maxSatisfying;
+function maxSatisfying(versions, range, loose) {
+ return versions.filter(function(version) {
+ return satisfies(version, range, loose);
+ }).sort(function(a, b) {
+ return rcompare(a, b, loose);
+ })[0] || null;
+}
+
+exports.validRange = validRange;
+function validRange(range, loose) {
+ try {
+ // Return '*' instead of '' so that truthiness works.
+ // This will throw if it's invalid anyway
+ return new Range(range, loose).range || '*';
+ } catch (er) {
+ return null;
+ }
+}
+
+// Determine if version is less than all the versions possible in the range
+exports.ltr = ltr;
+function ltr(version, range, loose) {
+ return outside(version, range, '<', loose);
+}
+
+// Determine if version is greater than all the versions possible in the range.
+exports.gtr = gtr;
+function gtr(version, range, loose) {
+ return outside(version, range, '>', loose);
+}
+
+exports.outside = outside;
+function outside(version, range, hilo, loose) {
+ version = new SemVer(version, loose);
+ range = new Range(range, loose);
+
+ var gtfn, ltefn, ltfn, comp, ecomp;
+ switch (hilo) {
+ case '>':
+ gtfn = gt;
+ ltefn = lte;
+ ltfn = lt;
+ comp = '>';
+ ecomp = '>=';
+ break;
+ case '<':
+ gtfn = lt;
+ ltefn = gte;
+ ltfn = gt;
+ comp = '<';
+ ecomp = '<=';
+ break;
+ default:
+ throw new TypeError('Must provide a hilo val of "<" or ">"');
+ }
+
+ // If it satisifes the range it is not outside
+ if (satisfies(version, range, loose)) {
+ return false;
+ }
+
+ // From now on, variable terms are as if we're in "gtr" mode.
+ // but note that everything is flipped for the "ltr" function.
+
+ for (var i = 0; i < range.set.length; ++i) {
+ var comparators = range.set[i];
+
+ var high = null;
+ var low = null;
+
+ comparators.forEach(function(comparator) {
+ if (comparator.semver === ANY) {
+ comparator = new Comparator('>=0.0.0')
+ }
+ high = high || comparator;
+ low = low || comparator;
+ if (gtfn(comparator.semver, high.semver, loose)) {
+ high = comparator;
+ } else if (ltfn(comparator.semver, low.semver, loose)) {
+ low = comparator;
+ }
+ });
+
+ // If the edge version comparator has a operator then our version
+ // isn't outside it
+ if (high.operator === comp || high.operator === ecomp) {
+ return false;
+ }
+
+ // If the lowest version comparator has an operator and our version
+ // is less than it then it isn't higher than the range
+ if ((!low.operator || low.operator === comp) &&
+ ltefn(version, low.semver)) {
+ return false;
+ } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+ return false;
+ }
+ }
+ return true;
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/big-numbers.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/big-numbers.js
new file mode 100644
index 0000000000..c051864bc9
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/big-numbers.js
@@ -0,0 +1,31 @@
+var test = require('tap').test
+var semver = require('../')
+
+test('long version is too long', function (t) {
+ var v = '1.2.' + new Array(256).join('1')
+ t.throws(function () {
+ new semver.SemVer(v)
+ })
+ t.equal(semver.valid(v, false), null)
+ t.equal(semver.valid(v, true), null)
+ t.equal(semver.inc(v, 'patch'), null)
+ t.end()
+})
+
+test('big number is like too long version', function (t) {
+ var v = '1.2.' + new Array(100).join('1')
+ t.throws(function () {
+ new semver.SemVer(v)
+ })
+ t.equal(semver.valid(v, false), null)
+ t.equal(semver.valid(v, true), null)
+ t.equal(semver.inc(v, 'patch'), null)
+ t.end()
+})
+
+test('parsing null does not throw', function (t) {
+ t.equal(semver.parse(null), null)
+ t.equal(semver.parse({}), null)
+ t.equal(semver.parse(new semver.SemVer('1.2.3')).version, '1.2.3')
+ t.end()
+})
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/clean.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/clean.js
new file mode 100644
index 0000000000..9e268de950
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/clean.js
@@ -0,0 +1,29 @@
+var tap = require('tap');
+var test = tap.test;
+var semver = require('../semver.js');
+var clean = semver.clean;
+
+test('\nclean tests', function(t) {
+ // [range, version]
+ // Version should be detectable despite extra characters
+ [
+ ['1.2.3', '1.2.3'],
+ [' 1.2.3 ', '1.2.3'],
+ [' 1.2.3-4 ', '1.2.3-4'],
+ [' 1.2.3-pre ', '1.2.3-pre'],
+ [' =v1.2.3 ', '1.2.3'],
+ ['v1.2.3', '1.2.3'],
+ [' v1.2.3 ', '1.2.3'],
+ ['\t1.2.3', '1.2.3'],
+ ['>1.2.3', null],
+ ['~1.2.3', null],
+ ['<=1.2.3', null],
+ ['1.2.x', null]
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var msg = 'clean(' + range + ') = ' + version;
+ t.equal(clean(range), version, msg);
+ });
+ t.end();
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/gtr.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/gtr.js
new file mode 100644
index 0000000000..bbb87896c6
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/gtr.js
@@ -0,0 +1,173 @@
+var tap = require('tap');
+var test = tap.test;
+var semver = require('../semver.js');
+var gtr = semver.gtr;
+
+test('\ngtr tests', function(t) {
+ // [range, version, loose]
+ // Version should be greater than range
+ [
+ ['~1.2.2', '1.3.0'],
+ ['~0.6.1-1', '0.7.1-1'],
+ ['1.0.0 - 2.0.0', '2.0.1'],
+ ['1.0.0', '1.0.1-beta1'],
+ ['1.0.0', '2.0.0'],
+ ['<=2.0.0', '2.1.1'],
+ ['<=2.0.0', '3.2.9'],
+ ['<2.0.0', '2.0.0'],
+ ['0.1.20 || 1.2.4', '1.2.5'],
+ ['2.x.x', '3.0.0'],
+ ['1.2.x', '1.3.0'],
+ ['1.2.x || 2.x', '3.0.0'],
+ ['2.*.*', '5.0.1'],
+ ['1.2.*', '1.3.3'],
+ ['1.2.* || 2.*', '4.0.0'],
+ ['2', '3.0.0'],
+ ['2.3', '2.4.2'],
+ ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0
+ ['~2.4', '2.5.5'],
+ ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0
+ ['~1', '2.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '2.2.4'],
+ ['~> 1', '3.2.3'],
+ ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0
+ ['~ 1.0', '1.1.0'],
+ ['<1.2', '1.2.0'],
+ ['< 1.2', '1.2.1'],
+ ['1', '2.0.0beta', true],
+ ['~v0.5.4-pre', '0.6.0'],
+ ['~v0.5.4-pre', '0.6.1-pre'],
+ ['=0.7.x', '0.8.0'],
+ ['=0.7.x', '0.8.0-asdf'],
+ ['<0.7.x', '0.7.0'],
+ ['~1.2.2', '1.3.0'],
+ ['1.0.0 - 2.0.0', '2.2.3'],
+ ['1.0.0', '1.0.1'],
+ ['<=2.0.0', '3.0.0'],
+ ['<=2.0.0', '2.9999.9999'],
+ ['<=2.0.0', '2.2.9'],
+ ['<2.0.0', '2.9999.9999'],
+ ['<2.0.0', '2.2.9'],
+ ['2.x.x', '3.1.3'],
+ ['1.2.x', '1.3.3'],
+ ['1.2.x || 2.x', '3.1.3'],
+ ['2.*.*', '3.1.3'],
+ ['1.2.*', '1.3.3'],
+ ['1.2.* || 2.*', '3.1.3'],
+ ['2', '3.1.2'],
+ ['2.3', '2.4.1'],
+ ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0
+ ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0
+ ['~1', '2.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '2.2.3'],
+ ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0
+ ['<1', '1.0.0'],
+ ['1', '2.0.0beta', true],
+ ['<1', '1.0.0beta', true],
+ ['< 1', '1.0.0beta', true],
+ ['=0.7.x', '0.8.2'],
+ ['<0.7.x', '0.7.2']
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var loose = tuple[2] || false;
+ var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')';
+ t.ok(gtr(version, range, loose), msg);
+ });
+ t.end();
+});
+
+test('\nnegative gtr tests', function(t) {
+ // [range, version, loose]
+ // Version should NOT be greater than range
+ [
+ ['~0.6.1-1', '0.6.1-1'],
+ ['1.0.0 - 2.0.0', '1.2.3'],
+ ['1.0.0 - 2.0.0', '0.9.9'],
+ ['1.0.0', '1.0.0'],
+ ['>=*', '0.2.4'],
+ ['', '1.0.0', true],
+ ['*', '1.2.3'],
+ ['*', 'v1.2.3-foo'],
+ ['>=1.0.0', '1.0.0'],
+ ['>=1.0.0', '1.0.1'],
+ ['>=1.0.0', '1.1.0'],
+ ['>1.0.0', '1.0.1'],
+ ['>1.0.0', '1.1.0'],
+ ['<=2.0.0', '2.0.0'],
+ ['<=2.0.0', '1.9999.9999'],
+ ['<=2.0.0', '0.2.9'],
+ ['<2.0.0', '1.9999.9999'],
+ ['<2.0.0', '0.2.9'],
+ ['>= 1.0.0', '1.0.0'],
+ ['>= 1.0.0', '1.0.1'],
+ ['>= 1.0.0', '1.1.0'],
+ ['> 1.0.0', '1.0.1'],
+ ['> 1.0.0', '1.1.0'],
+ ['<= 2.0.0', '2.0.0'],
+ ['<= 2.0.0', '1.9999.9999'],
+ ['<= 2.0.0', '0.2.9'],
+ ['< 2.0.0', '1.9999.9999'],
+ ['<\t2.0.0', '0.2.9'],
+ ['>=0.1.97', 'v0.1.97'],
+ ['>=0.1.97', '0.1.97'],
+ ['0.1.20 || 1.2.4', '1.2.4'],
+ ['0.1.20 || >1.2.4', '1.2.4'],
+ ['0.1.20 || 1.2.4', '1.2.3'],
+ ['0.1.20 || 1.2.4', '0.1.20'],
+ ['>=0.2.3 || <0.0.1', '0.0.0'],
+ ['>=0.2.3 || <0.0.1', '0.2.3'],
+ ['>=0.2.3 || <0.0.1', '0.2.4'],
+ ['||', '1.3.4'],
+ ['2.x.x', '2.1.3'],
+ ['1.2.x', '1.2.3'],
+ ['1.2.x || 2.x', '2.1.3'],
+ ['1.2.x || 2.x', '1.2.3'],
+ ['x', '1.2.3'],
+ ['2.*.*', '2.1.3'],
+ ['1.2.*', '1.2.3'],
+ ['1.2.* || 2.*', '2.1.3'],
+ ['1.2.* || 2.*', '1.2.3'],
+ ['1.2.* || 2.*', '1.2.3'],
+ ['*', '1.2.3'],
+ ['2', '2.1.2'],
+ ['2.3', '2.3.1'],
+ ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0
+ ['~2.4', '2.4.5'],
+ ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0
+ ['~1', '1.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '1.2.3'],
+ ['~> 1', '1.2.3'],
+ ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0
+ ['~ 1.0', '1.0.2'],
+ ['>=1', '1.0.0'],
+ ['>= 1', '1.0.0'],
+ ['<1.2', '1.1.1'],
+ ['< 1.2', '1.1.1'],
+ ['1', '1.0.0beta', true],
+ ['~v0.5.4-pre', '0.5.5'],
+ ['~v0.5.4-pre', '0.5.4'],
+ ['=0.7.x', '0.7.2'],
+ ['>=0.7.x', '0.7.2'],
+ ['=0.7.x', '0.7.0-asdf'],
+ ['>=0.7.x', '0.7.0-asdf'],
+ ['<=0.7.x', '0.6.2'],
+ ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'],
+ ['>=0.2.3 <=0.2.4', '0.2.4'],
+ ['1.0.0 - 2.0.0', '2.0.0'],
+ ['^1', '0.0.0-0'],
+ ['^3.0.0', '2.0.0'],
+ ['^1.0.0 || ~2.0.1', '2.0.0'],
+ ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'],
+ ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true],
+ ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true],
+ ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0']
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var loose = tuple[2] || false;
+ var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')';
+ t.notOk(gtr(version, range, loose), msg);
+ });
+ t.end();
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/index.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/index.js
new file mode 100644
index 0000000000..47c3f5f951
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/index.js
@@ -0,0 +1,698 @@
+'use strict';
+
+var tap = require('tap');
+var test = tap.test;
+var semver = require('../semver.js');
+var eq = semver.eq;
+var gt = semver.gt;
+var lt = semver.lt;
+var neq = semver.neq;
+var cmp = semver.cmp;
+var gte = semver.gte;
+var lte = semver.lte;
+var satisfies = semver.satisfies;
+var validRange = semver.validRange;
+var inc = semver.inc;
+var diff = semver.diff;
+var replaceStars = semver.replaceStars;
+var toComparators = semver.toComparators;
+var SemVer = semver.SemVer;
+var Range = semver.Range;
+
+test('\ncomparison tests', function(t) {
+ // [version1, version2]
+ // version1 should be greater than version2
+ [['0.0.0', '0.0.0-foo'],
+ ['0.0.1', '0.0.0'],
+ ['1.0.0', '0.9.9'],
+ ['0.10.0', '0.9.0'],
+ ['0.99.0', '0.10.0'],
+ ['2.0.0', '1.2.3'],
+ ['v0.0.0', '0.0.0-foo', true],
+ ['v0.0.1', '0.0.0', true],
+ ['v1.0.0', '0.9.9', true],
+ ['v0.10.0', '0.9.0', true],
+ ['v0.99.0', '0.10.0', true],
+ ['v2.0.0', '1.2.3', true],
+ ['0.0.0', 'v0.0.0-foo', true],
+ ['0.0.1', 'v0.0.0', true],
+ ['1.0.0', 'v0.9.9', true],
+ ['0.10.0', 'v0.9.0', true],
+ ['0.99.0', 'v0.10.0', true],
+ ['2.0.0', 'v1.2.3', true],
+ ['1.2.3', '1.2.3-asdf'],
+ ['1.2.3', '1.2.3-4'],
+ ['1.2.3', '1.2.3-4-foo'],
+ ['1.2.3-5-foo', '1.2.3-5'],
+ ['1.2.3-5', '1.2.3-4'],
+ ['1.2.3-5-foo', '1.2.3-5-Foo'],
+ ['3.0.0', '2.7.2+asdf'],
+ ['1.2.3-a.10', '1.2.3-a.5'],
+ ['1.2.3-a.b', '1.2.3-a.5'],
+ ['1.2.3-a.b', '1.2.3-a'],
+ ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'],
+ ['1.2.3-r2', '1.2.3-r100'],
+ ['1.2.3-r100', '1.2.3-R2']
+ ].forEach(function(v) {
+ var v0 = v[0];
+ var v1 = v[1];
+ var loose = v[2];
+ t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')");
+ t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')");
+ t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')");
+ t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')");
+ t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')");
+ t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')");
+ t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')");
+ t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')");
+ t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')");
+ t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')");
+ t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')");
+ });
+ t.end();
+});
+
+test('\nequality tests', function(t) {
+ // [version1, version2]
+ // version1 should be equivalent to version2
+ [['1.2.3', 'v1.2.3', true],
+ ['1.2.3', '=1.2.3', true],
+ ['1.2.3', 'v 1.2.3', true],
+ ['1.2.3', '= 1.2.3', true],
+ ['1.2.3', ' v1.2.3', true],
+ ['1.2.3', ' =1.2.3', true],
+ ['1.2.3', ' v 1.2.3', true],
+ ['1.2.3', ' = 1.2.3', true],
+ ['1.2.3-0', 'v1.2.3-0', true],
+ ['1.2.3-0', '=1.2.3-0', true],
+ ['1.2.3-0', 'v 1.2.3-0', true],
+ ['1.2.3-0', '= 1.2.3-0', true],
+ ['1.2.3-0', ' v1.2.3-0', true],
+ ['1.2.3-0', ' =1.2.3-0', true],
+ ['1.2.3-0', ' v 1.2.3-0', true],
+ ['1.2.3-0', ' = 1.2.3-0', true],
+ ['1.2.3-1', 'v1.2.3-1', true],
+ ['1.2.3-1', '=1.2.3-1', true],
+ ['1.2.3-1', 'v 1.2.3-1', true],
+ ['1.2.3-1', '= 1.2.3-1', true],
+ ['1.2.3-1', ' v1.2.3-1', true],
+ ['1.2.3-1', ' =1.2.3-1', true],
+ ['1.2.3-1', ' v 1.2.3-1', true],
+ ['1.2.3-1', ' = 1.2.3-1', true],
+ ['1.2.3-beta', 'v1.2.3-beta', true],
+ ['1.2.3-beta', '=1.2.3-beta', true],
+ ['1.2.3-beta', 'v 1.2.3-beta', true],
+ ['1.2.3-beta', '= 1.2.3-beta', true],
+ ['1.2.3-beta', ' v1.2.3-beta', true],
+ ['1.2.3-beta', ' =1.2.3-beta', true],
+ ['1.2.3-beta', ' v 1.2.3-beta', true],
+ ['1.2.3-beta', ' = 1.2.3-beta', true],
+ ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true],
+ ['1.2.3+build', ' = 1.2.3+otherbuild', true],
+ ['1.2.3-beta+build', '1.2.3-beta+otherbuild'],
+ ['1.2.3+build', '1.2.3+otherbuild'],
+ [' v1.2.3+build', '1.2.3+otherbuild']
+ ].forEach(function(v) {
+ var v0 = v[0];
+ var v1 = v[1];
+ var loose = v[2];
+ t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')");
+ t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')");
+ t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')');
+ t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')');
+ t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')');
+ t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')');
+ t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')");
+ t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')");
+ t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')");
+ t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')");
+ });
+ t.end();
+});
+
+
+test('\nrange tests', function(t) {
+ // [range, version]
+ // version should be included by range
+ [['1.0.0 - 2.0.0', '1.2.3'],
+ ['^1.2.3+build', '1.2.3'],
+ ['^1.2.3+build', '1.3.0'],
+ ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'],
+ ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true],
+ ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true],
+ ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true],
+ ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'],
+ ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'],
+ ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'],
+ ['1.0.0', '1.0.0'],
+ ['>=*', '0.2.4'],
+ ['', '1.0.0'],
+ ['*', '1.2.3'],
+ ['*', 'v1.2.3', true],
+ ['>=1.0.0', '1.0.0'],
+ ['>=1.0.0', '1.0.1'],
+ ['>=1.0.0', '1.1.0'],
+ ['>1.0.0', '1.0.1'],
+ ['>1.0.0', '1.1.0'],
+ ['<=2.0.0', '2.0.0'],
+ ['<=2.0.0', '1.9999.9999'],
+ ['<=2.0.0', '0.2.9'],
+ ['<2.0.0', '1.9999.9999'],
+ ['<2.0.0', '0.2.9'],
+ ['>= 1.0.0', '1.0.0'],
+ ['>= 1.0.0', '1.0.1'],
+ ['>= 1.0.0', '1.1.0'],
+ ['> 1.0.0', '1.0.1'],
+ ['> 1.0.0', '1.1.0'],
+ ['<= 2.0.0', '2.0.0'],
+ ['<= 2.0.0', '1.9999.9999'],
+ ['<= 2.0.0', '0.2.9'],
+ ['< 2.0.0', '1.9999.9999'],
+ ['<\t2.0.0', '0.2.9'],
+ ['>=0.1.97', 'v0.1.97', true],
+ ['>=0.1.97', '0.1.97'],
+ ['0.1.20 || 1.2.4', '1.2.4'],
+ ['>=0.2.3 || <0.0.1', '0.0.0'],
+ ['>=0.2.3 || <0.0.1', '0.2.3'],
+ ['>=0.2.3 || <0.0.1', '0.2.4'],
+ ['||', '1.3.4'],
+ ['2.x.x', '2.1.3'],
+ ['1.2.x', '1.2.3'],
+ ['1.2.x || 2.x', '2.1.3'],
+ ['1.2.x || 2.x', '1.2.3'],
+ ['x', '1.2.3'],
+ ['2.*.*', '2.1.3'],
+ ['1.2.*', '1.2.3'],
+ ['1.2.* || 2.*', '2.1.3'],
+ ['1.2.* || 2.*', '1.2.3'],
+ ['*', '1.2.3'],
+ ['2', '2.1.2'],
+ ['2.3', '2.3.1'],
+ ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0
+ ['~2.4', '2.4.5'],
+ ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0,
+ ['~1', '1.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '1.2.3'],
+ ['~> 1', '1.2.3'],
+ ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0,
+ ['~ 1.0', '1.0.2'],
+ ['~ 1.0.3', '1.0.12'],
+ ['>=1', '1.0.0'],
+ ['>= 1', '1.0.0'],
+ ['<1.2', '1.1.1'],
+ ['< 1.2', '1.1.1'],
+ ['~v0.5.4-pre', '0.5.5'],
+ ['~v0.5.4-pre', '0.5.4'],
+ ['=0.7.x', '0.7.2'],
+ ['<=0.7.x', '0.7.2'],
+ ['>=0.7.x', '0.7.2'],
+ ['<=0.7.x', '0.6.2'],
+ ['~1.2.1 >=1.2.3', '1.2.3'],
+ ['~1.2.1 =1.2.3', '1.2.3'],
+ ['~1.2.1 1.2.3', '1.2.3'],
+ ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'],
+ ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'],
+ ['~1.2.1 1.2.3', '1.2.3'],
+ ['>=1.2.1 1.2.3', '1.2.3'],
+ ['1.2.3 >=1.2.1', '1.2.3'],
+ ['>=1.2.3 >=1.2.1', '1.2.3'],
+ ['>=1.2.1 >=1.2.3', '1.2.3'],
+ ['>=1.2', '1.2.8'],
+ ['^1.2.3', '1.8.1'],
+ ['^0.1.2', '0.1.2'],
+ ['^0.1', '0.1.2'],
+ ['^1.2', '1.4.2'],
+ ['^1.2 ^1', '1.4.2'],
+ ['^1.2.3-alpha', '1.2.3-pre'],
+ ['^1.2.0-alpha', '1.2.0-pre'],
+ ['^0.0.1-alpha', '0.0.1-beta']
+ ].forEach(function(v) {
+ var range = v[0];
+ var ver = v[1];
+ var loose = v[2];
+ t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver);
+ });
+ t.end();
+});
+
+test('\nnegative range tests', function(t) {
+ // [range, version]
+ // version should not be included by range
+ [['1.0.0 - 2.0.0', '2.2.3'],
+ ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'],
+ ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'],
+ ['^1.2.3+build', '2.0.0'],
+ ['^1.2.3+build', '1.2.0'],
+ ['^1.2.3', '1.2.3-pre'],
+ ['^1.2', '1.2.0-pre'],
+ ['>1.2', '1.3.0-beta'],
+ ['<=1.2.3', '1.2.3-beta'],
+ ['^1.2.3', '1.2.3-beta'],
+ ['=0.7.x', '0.7.0-asdf'],
+ ['>=0.7.x', '0.7.0-asdf'],
+ ['1', '1.0.0beta', true],
+ ['<1', '1.0.0beta', true],
+ ['< 1', '1.0.0beta', true],
+ ['1.0.0', '1.0.1'],
+ ['>=1.0.0', '0.0.0'],
+ ['>=1.0.0', '0.0.1'],
+ ['>=1.0.0', '0.1.0'],
+ ['>1.0.0', '0.0.1'],
+ ['>1.0.0', '0.1.0'],
+ ['<=2.0.0', '3.0.0'],
+ ['<=2.0.0', '2.9999.9999'],
+ ['<=2.0.0', '2.2.9'],
+ ['<2.0.0', '2.9999.9999'],
+ ['<2.0.0', '2.2.9'],
+ ['>=0.1.97', 'v0.1.93', true],
+ ['>=0.1.97', '0.1.93'],
+ ['0.1.20 || 1.2.4', '1.2.3'],
+ ['>=0.2.3 || <0.0.1', '0.0.3'],
+ ['>=0.2.3 || <0.0.1', '0.2.2'],
+ ['2.x.x', '1.1.3'],
+ ['2.x.x', '3.1.3'],
+ ['1.2.x', '1.3.3'],
+ ['1.2.x || 2.x', '3.1.3'],
+ ['1.2.x || 2.x', '1.1.3'],
+ ['2.*.*', '1.1.3'],
+ ['2.*.*', '3.1.3'],
+ ['1.2.*', '1.3.3'],
+ ['1.2.* || 2.*', '3.1.3'],
+ ['1.2.* || 2.*', '1.1.3'],
+ ['2', '1.1.2'],
+ ['2.3', '2.4.1'],
+ ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0
+ ['~2.4', '2.3.9'],
+ ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0
+ ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0
+ ['~1', '0.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '2.2.3'],
+ ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0
+ ['<1', '1.0.0'],
+ ['>=1.2', '1.1.1'],
+ ['1', '2.0.0beta', true],
+ ['~v0.5.4-beta', '0.5.4-alpha'],
+ ['=0.7.x', '0.8.2'],
+ ['>=0.7.x', '0.6.2'],
+ ['<0.7.x', '0.7.2'],
+ ['<1.2.3', '1.2.3-beta'],
+ ['=1.2.3', '1.2.3-beta'],
+ ['>1.2', '1.2.8'],
+ ['^1.2.3', '2.0.0-alpha'],
+ ['^1.2.3', '1.2.2'],
+ ['^1.2', '1.1.9'],
+ ['*', 'v1.2.3-foo', true],
+ // invalid ranges never satisfied!
+ ['blerg', '1.2.3'],
+ ['git+https://user:password0123@github.com/foo', '123.0.0', true],
+ ['^1.2.3', '2.0.0-pre']
+ ].forEach(function(v) {
+ var range = v[0];
+ var ver = v[1];
+ var loose = v[2];
+ var found = satisfies(ver, range, loose);
+ t.ok(!found, ver + ' not satisfied by ' + range);
+ });
+ t.end();
+});
+
+test('\nincrement versions test', function(t) {
+// [version, inc, result, identifier]
+// inc(version, inc) -> result
+ [['1.2.3', 'major', '2.0.0'],
+ ['1.2.3', 'minor', '1.3.0'],
+ ['1.2.3', 'patch', '1.2.4'],
+ ['1.2.3tag', 'major', '2.0.0', true],
+ ['1.2.3-tag', 'major', '2.0.0'],
+ ['1.2.3', 'fake', null],
+ ['1.2.0-0', 'patch', '1.2.0'],
+ ['fake', 'major', null],
+ ['1.2.3-4', 'major', '2.0.0'],
+ ['1.2.3-4', 'minor', '1.3.0'],
+ ['1.2.3-4', 'patch', '1.2.3'],
+ ['1.2.3-alpha.0.beta', 'major', '2.0.0'],
+ ['1.2.3-alpha.0.beta', 'minor', '1.3.0'],
+ ['1.2.3-alpha.0.beta', 'patch', '1.2.3'],
+ ['1.2.4', 'prerelease', '1.2.5-0'],
+ ['1.2.3-0', 'prerelease', '1.2.3-1'],
+ ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'],
+ ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'],
+ ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'],
+ ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'],
+ ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'],
+ ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'],
+ ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'],
+ ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'],
+ ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'],
+ ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'],
+ ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'],
+ ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'],
+ ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'],
+ ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'],
+ ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'],
+ ['1.2.0', 'prepatch', '1.2.1-0'],
+ ['1.2.0-1', 'prepatch', '1.2.1-0'],
+ ['1.2.0', 'preminor', '1.3.0-0'],
+ ['1.2.3-1', 'preminor', '1.3.0-0'],
+ ['1.2.0', 'premajor', '2.0.0-0'],
+ ['1.2.3-1', 'premajor', '2.0.0-0'],
+ ['1.2.0-1', 'minor', '1.2.0'],
+ ['1.0.0-1', 'major', '1.0.0'],
+
+ ['1.2.3', 'major', '2.0.0', false, 'dev'],
+ ['1.2.3', 'minor', '1.3.0', false, 'dev'],
+ ['1.2.3', 'patch', '1.2.4', false, 'dev'],
+ ['1.2.3tag', 'major', '2.0.0', true, 'dev'],
+ ['1.2.3-tag', 'major', '2.0.0', false, 'dev'],
+ ['1.2.3', 'fake', null, false, 'dev'],
+ ['1.2.0-0', 'patch', '1.2.0', false, 'dev'],
+ ['fake', 'major', null, false, 'dev'],
+ ['1.2.3-4', 'major', '2.0.0', false, 'dev'],
+ ['1.2.3-4', 'minor', '1.3.0', false, 'dev'],
+ ['1.2.3-4', 'patch', '1.2.3', false, 'dev'],
+ ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'],
+ ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'],
+ ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'],
+ ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'],
+ ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'],
+ ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'],
+ ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'],
+ ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'],
+ ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'],
+ ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'],
+ ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'],
+ ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'],
+ ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'],
+ ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'],
+ ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'],
+ ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'],
+ ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'],
+ ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'],
+ ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'],
+ ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'],
+ ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'],
+ ['1.2.0', 'prepatch', '1.2.1-dev.0', false, 'dev'],
+ ['1.2.0-1', 'prepatch', '1.2.1-dev.0', false, 'dev'],
+ ['1.2.0', 'preminor', '1.3.0-dev.0', false, 'dev'],
+ ['1.2.3-1', 'preminor', '1.3.0-dev.0', false, 'dev'],
+ ['1.2.0', 'premajor', '2.0.0-dev.0', false, 'dev'],
+ ['1.2.3-1', 'premajor', '2.0.0-dev.0', false, 'dev'],
+ ['1.2.0-1', 'minor', '1.2.0', false, 'dev'],
+ ['1.0.0-1', 'major', '1.0.0', false, 'dev'],
+ ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev']
+
+ ].forEach(function(v) {
+ var pre = v[0];
+ var what = v[1];
+ var wanted = v[2];
+ var loose = v[3];
+ var id = v[4];
+ var found = inc(pre, what, loose, id);
+ var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')';
+ t.equal(found, wanted, cmd + ' === ' + wanted);
+
+ var parsed = semver.parse(pre, loose);
+ if (wanted) {
+ parsed.inc(what, id);
+ t.equal(parsed.version, wanted, cmd + ' object version updated');
+ t.equal(parsed.raw, wanted, cmd + ' object raw field updated');
+ } else if (parsed) {
+ t.throws(function () {
+ parsed.inc(what, id)
+ })
+ } else {
+ t.equal(parsed, null)
+ }
+ });
+
+ t.end();
+});
+
+test('\ndiff versions test', function(t) {
+// [version1, version2, result]
+// diff(version1, version2) -> result
+ [['1.2.3', '0.2.3', 'major'],
+ ['1.4.5', '0.2.3', 'major'],
+ ['1.2.3', '2.0.0-pre', 'premajor'],
+ ['1.2.3', '1.3.3', 'minor'],
+ ['1.0.1', '1.1.0-pre', 'preminor'],
+ ['1.2.3', '1.2.4', 'patch'],
+ ['1.2.3', '1.2.4-pre', 'prepatch'],
+ ['0.0.1', '0.0.1-pre', 'prerelease'],
+ ['0.0.1', '0.0.1-pre-2', 'prerelease'],
+ ['1.1.0', '1.1.0-pre', 'prerelease'],
+ ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'],
+ ['1.0.0', '1.0.0', null]
+
+ ].forEach(function(v) {
+ var version1 = v[0];
+ var version2 = v[1];
+ var wanted = v[2];
+ var found = diff(version1, version2);
+ var cmd = 'diff(' + version1 + ', ' + version2 + ')';
+ t.equal(found, wanted, cmd + ' === ' + wanted);
+ });
+
+ t.end();
+});
+
+test('\nvalid range test', function(t) {
+ // [range, result]
+ // validRange(range) -> result
+ // translate ranges into their canonical form
+ [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'],
+ ['1.0.0', '1.0.0'],
+ ['>=*', '*'],
+ ['', '*'],
+ ['*', '*'],
+ ['*', '*'],
+ ['>=1.0.0', '>=1.0.0'],
+ ['>1.0.0', '>1.0.0'],
+ ['<=2.0.0', '<=2.0.0'],
+ ['1', '>=1.0.0 <2.0.0'],
+ ['<=2.0.0', '<=2.0.0'],
+ ['<=2.0.0', '<=2.0.0'],
+ ['<2.0.0', '<2.0.0'],
+ ['<2.0.0', '<2.0.0'],
+ ['>= 1.0.0', '>=1.0.0'],
+ ['>= 1.0.0', '>=1.0.0'],
+ ['>= 1.0.0', '>=1.0.0'],
+ ['> 1.0.0', '>1.0.0'],
+ ['> 1.0.0', '>1.0.0'],
+ ['<= 2.0.0', '<=2.0.0'],
+ ['<= 2.0.0', '<=2.0.0'],
+ ['<= 2.0.0', '<=2.0.0'],
+ ['< 2.0.0', '<2.0.0'],
+ ['< 2.0.0', '<2.0.0'],
+ ['>=0.1.97', '>=0.1.97'],
+ ['>=0.1.97', '>=0.1.97'],
+ ['0.1.20 || 1.2.4', '0.1.20||1.2.4'],
+ ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'],
+ ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'],
+ ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'],
+ ['||', '||'],
+ ['2.x.x', '>=2.0.0 <3.0.0'],
+ ['1.2.x', '>=1.2.0 <1.3.0'],
+ ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'],
+ ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'],
+ ['x', '*'],
+ ['2.*.*', '>=2.0.0 <3.0.0'],
+ ['1.2.*', '>=1.2.0 <1.3.0'],
+ ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'],
+ ['*', '*'],
+ ['2', '>=2.0.0 <3.0.0'],
+ ['2.3', '>=2.3.0 <2.4.0'],
+ ['~2.4', '>=2.4.0 <2.5.0'],
+ ['~2.4', '>=2.4.0 <2.5.0'],
+ ['~>3.2.1', '>=3.2.1 <3.3.0'],
+ ['~1', '>=1.0.0 <2.0.0'],
+ ['~>1', '>=1.0.0 <2.0.0'],
+ ['~> 1', '>=1.0.0 <2.0.0'],
+ ['~1.0', '>=1.0.0 <1.1.0'],
+ ['~ 1.0', '>=1.0.0 <1.1.0'],
+ ['^0', '>=0.0.0 <1.0.0'],
+ ['^ 1', '>=1.0.0 <2.0.0'],
+ ['^0.1', '>=0.1.0 <0.2.0'],
+ ['^1.0', '>=1.0.0 <2.0.0'],
+ ['^1.2', '>=1.2.0 <2.0.0'],
+ ['^0.0.1', '>=0.0.1 <0.0.2'],
+ ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'],
+ ['^0.1.2', '>=0.1.2 <0.2.0'],
+ ['^1.2.3', '>=1.2.3 <2.0.0'],
+ ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'],
+ ['<1', '<1.0.0'],
+ ['< 1', '<1.0.0'],
+ ['>=1', '>=1.0.0'],
+ ['>= 1', '>=1.0.0'],
+ ['<1.2', '<1.2.0'],
+ ['< 1.2', '<1.2.0'],
+ ['1', '>=1.0.0 <2.0.0'],
+ ['>01.02.03', '>1.2.3', true],
+ ['>01.02.03', null],
+ ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true],
+ ['~1.2.3beta', null],
+ ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0']
+ ].forEach(function(v) {
+ var pre = v[0];
+ var wanted = v[1];
+ var loose = v[2];
+ var found = validRange(pre, loose);
+
+ t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted);
+ });
+
+ t.end();
+});
+
+test('\ncomparators test', function(t) {
+ // [range, comparators]
+ // turn range into a set of individual comparators
+ [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]],
+ ['1.0.0', [['1.0.0']]],
+ ['>=*', [['']]],
+ ['', [['']]],
+ ['*', [['']]],
+ ['*', [['']]],
+ ['>=1.0.0', [['>=1.0.0']]],
+ ['>=1.0.0', [['>=1.0.0']]],
+ ['>=1.0.0', [['>=1.0.0']]],
+ ['>1.0.0', [['>1.0.0']]],
+ ['>1.0.0', [['>1.0.0']]],
+ ['<=2.0.0', [['<=2.0.0']]],
+ ['1', [['>=1.0.0', '<2.0.0']]],
+ ['<=2.0.0', [['<=2.0.0']]],
+ ['<=2.0.0', [['<=2.0.0']]],
+ ['<2.0.0', [['<2.0.0']]],
+ ['<2.0.0', [['<2.0.0']]],
+ ['>= 1.0.0', [['>=1.0.0']]],
+ ['>= 1.0.0', [['>=1.0.0']]],
+ ['>= 1.0.0', [['>=1.0.0']]],
+ ['> 1.0.0', [['>1.0.0']]],
+ ['> 1.0.0', [['>1.0.0']]],
+ ['<= 2.0.0', [['<=2.0.0']]],
+ ['<= 2.0.0', [['<=2.0.0']]],
+ ['<= 2.0.0', [['<=2.0.0']]],
+ ['< 2.0.0', [['<2.0.0']]],
+ ['<\t2.0.0', [['<2.0.0']]],
+ ['>=0.1.97', [['>=0.1.97']]],
+ ['>=0.1.97', [['>=0.1.97']]],
+ ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]],
+ ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]],
+ ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]],
+ ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]],
+ ['||', [[''], ['']]],
+ ['2.x.x', [['>=2.0.0', '<3.0.0']]],
+ ['1.2.x', [['>=1.2.0', '<1.3.0']]],
+ ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
+ ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
+ ['x', [['']]],
+ ['2.*.*', [['>=2.0.0', '<3.0.0']]],
+ ['1.2.*', [['>=1.2.0', '<1.3.0']]],
+ ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
+ ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]],
+ ['*', [['']]],
+ ['2', [['>=2.0.0', '<3.0.0']]],
+ ['2.3', [['>=2.3.0', '<2.4.0']]],
+ ['~2.4', [['>=2.4.0', '<2.5.0']]],
+ ['~2.4', [['>=2.4.0', '<2.5.0']]],
+ ['~>3.2.1', [['>=3.2.1', '<3.3.0']]],
+ ['~1', [['>=1.0.0', '<2.0.0']]],
+ ['~>1', [['>=1.0.0', '<2.0.0']]],
+ ['~> 1', [['>=1.0.0', '<2.0.0']]],
+ ['~1.0', [['>=1.0.0', '<1.1.0']]],
+ ['~ 1.0', [['>=1.0.0', '<1.1.0']]],
+ ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]],
+ ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]],
+ ['<1', [['<1.0.0']]],
+ ['< 1', [['<1.0.0']]],
+ ['>=1', [['>=1.0.0']]],
+ ['>= 1', [['>=1.0.0']]],
+ ['<1.2', [['<1.2.0']]],
+ ['< 1.2', [['<1.2.0']]],
+ ['1', [['>=1.0.0', '<2.0.0']]],
+ ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]],
+ ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]],
+ ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]],
+ ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]],
+ ['>*', [['<0.0.0']]],
+ ['<*', [['<0.0.0']]]
+ ].forEach(function(v) {
+ var pre = v[0];
+ var wanted = v[1];
+ var found = toComparators(v[0]);
+ var jw = JSON.stringify(wanted);
+ t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw);
+ });
+
+ t.end();
+});
+
+test('\ninvalid version numbers', function(t) {
+ ['1.2.3.4',
+ 'NOT VALID',
+ 1.2,
+ null,
+ 'Infinity.NaN.Infinity'
+ ].forEach(function(v) {
+ t.throws(function() {
+ new SemVer(v);
+ }, {name:'TypeError', message:'Invalid Version: ' + v});
+ });
+
+ t.end();
+});
+
+test('\nstrict vs loose version numbers', function(t) {
+ [['=1.2.3', '1.2.3'],
+ ['01.02.03', '1.2.3'],
+ ['1.2.3-beta.01', '1.2.3-beta.1'],
+ [' =1.2.3', '1.2.3'],
+ ['1.2.3foo', '1.2.3-foo']
+ ].forEach(function(v) {
+ var loose = v[0];
+ var strict = v[1];
+ t.throws(function() {
+ new SemVer(loose);
+ });
+ var lv = new SemVer(loose, true);
+ t.equal(lv.version, strict);
+ t.ok(eq(loose, strict, true));
+ t.throws(function() {
+ eq(loose, strict);
+ });
+ t.throws(function() {
+ new SemVer(strict).compare(loose);
+ });
+ });
+ t.end();
+});
+
+test('\nstrict vs loose ranges', function(t) {
+ [['>=01.02.03', '>=1.2.3'],
+ ['~1.02.03beta', '>=1.2.3-beta <1.3.0']
+ ].forEach(function(v) {
+ var loose = v[0];
+ var comps = v[1];
+ t.throws(function() {
+ new Range(loose);
+ });
+ t.equal(new Range(loose, true).range, comps);
+ });
+ t.end();
+});
+
+test('\nmax satisfying', function(t) {
+ [[['1.2.3', '1.2.4'], '1.2', '1.2.4'],
+ [['1.2.4', '1.2.3'], '1.2', '1.2.4'],
+ [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'],
+ [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true]
+ ].forEach(function(v) {
+ var versions = v[0];
+ var range = v[1];
+ var expect = v[2];
+ var loose = v[3];
+ var actual = semver.maxSatisfying(versions, range, loose);
+ t.equal(actual, expect);
+ });
+ t.end();
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/ltr.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/ltr.js
new file mode 100644
index 0000000000..0f7167d658
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/ltr.js
@@ -0,0 +1,181 @@
+var tap = require('tap');
+var test = tap.test;
+var semver = require('../semver.js');
+var ltr = semver.ltr;
+
+test('\nltr tests', function(t) {
+ // [range, version, loose]
+ // Version should be less than range
+ [
+ ['~1.2.2', '1.2.1'],
+ ['~0.6.1-1', '0.6.1-0'],
+ ['1.0.0 - 2.0.0', '0.0.1'],
+ ['1.0.0-beta.2', '1.0.0-beta.1'],
+ ['1.0.0', '0.0.0'],
+ ['>=2.0.0', '1.1.1'],
+ ['>=2.0.0', '1.2.9'],
+ ['>2.0.0', '2.0.0'],
+ ['0.1.20 || 1.2.4', '0.1.5'],
+ ['2.x.x', '1.0.0'],
+ ['1.2.x', '1.1.0'],
+ ['1.2.x || 2.x', '1.0.0'],
+ ['2.*.*', '1.0.1'],
+ ['1.2.*', '1.1.3'],
+ ['1.2.* || 2.*', '1.1.9999'],
+ ['2', '1.0.0'],
+ ['2.3', '2.2.2'],
+ ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0
+ ['~2.4', '2.3.5'],
+ ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0
+ ['~1', '0.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '0.2.4'],
+ ['~> 1', '0.2.3'],
+ ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0
+ ['~ 1.0', '0.1.0'],
+ ['>1.2', '1.2.0'],
+ ['> 1.2', '1.2.1'],
+ ['1', '0.0.0beta', true],
+ ['~v0.5.4-pre', '0.5.4-alpha'],
+ ['~v0.5.4-pre', '0.5.4-alpha'],
+ ['=0.7.x', '0.6.0'],
+ ['=0.7.x', '0.6.0-asdf'],
+ ['>=0.7.x', '0.6.0'],
+ ['~1.2.2', '1.2.1'],
+ ['1.0.0 - 2.0.0', '0.2.3'],
+ ['1.0.0', '0.0.1'],
+ ['>=2.0.0', '1.0.0'],
+ ['>=2.0.0', '1.9999.9999'],
+ ['>=2.0.0', '1.2.9'],
+ ['>2.0.0', '2.0.0'],
+ ['>2.0.0', '1.2.9'],
+ ['2.x.x', '1.1.3'],
+ ['1.2.x', '1.1.3'],
+ ['1.2.x || 2.x', '1.1.3'],
+ ['2.*.*', '1.1.3'],
+ ['1.2.*', '1.1.3'],
+ ['1.2.* || 2.*', '1.1.3'],
+ ['2', '1.9999.9999'],
+ ['2.3', '2.2.1'],
+ ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0
+ ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0
+ ['~1', '0.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '0.2.3'],
+ ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0
+ ['>1', '1.0.0'],
+ ['2', '1.0.0beta', true],
+ ['>1', '1.0.0beta', true],
+ ['> 1', '1.0.0beta', true],
+ ['=0.7.x', '0.6.2'],
+ ['=0.7.x', '0.7.0-asdf'],
+ ['^1', '1.0.0-0'],
+ ['>=0.7.x', '0.7.0-asdf'],
+ ['1', '1.0.0beta', true],
+ ['>=0.7.x', '0.6.2'],
+ ['>1.2.3', '1.3.0-alpha']
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var loose = tuple[2] || false;
+ var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')';
+ t.ok(ltr(version, range, loose), msg);
+ });
+ t.end();
+});
+
+test('\nnegative ltr tests', function(t) {
+ // [range, version, loose]
+ // Version should NOT be less than range
+ [
+ ['~ 1.0', '1.1.0'],
+ ['~0.6.1-1', '0.6.1-1'],
+ ['1.0.0 - 2.0.0', '1.2.3'],
+ ['1.0.0 - 2.0.0', '2.9.9'],
+ ['1.0.0', '1.0.0'],
+ ['>=*', '0.2.4'],
+ ['', '1.0.0', true],
+ ['*', '1.2.3'],
+ ['>=1.0.0', '1.0.0'],
+ ['>=1.0.0', '1.0.1'],
+ ['>=1.0.0', '1.1.0'],
+ ['>1.0.0', '1.0.1'],
+ ['>1.0.0', '1.1.0'],
+ ['<=2.0.0', '2.0.0'],
+ ['<=2.0.0', '1.9999.9999'],
+ ['<=2.0.0', '0.2.9'],
+ ['<2.0.0', '1.9999.9999'],
+ ['<2.0.0', '0.2.9'],
+ ['>= 1.0.0', '1.0.0'],
+ ['>= 1.0.0', '1.0.1'],
+ ['>= 1.0.0', '1.1.0'],
+ ['> 1.0.0', '1.0.1'],
+ ['> 1.0.0', '1.1.0'],
+ ['<= 2.0.0', '2.0.0'],
+ ['<= 2.0.0', '1.9999.9999'],
+ ['<= 2.0.0', '0.2.9'],
+ ['< 2.0.0', '1.9999.9999'],
+ ['<\t2.0.0', '0.2.9'],
+ ['>=0.1.97', 'v0.1.97'],
+ ['>=0.1.97', '0.1.97'],
+ ['0.1.20 || 1.2.4', '1.2.4'],
+ ['0.1.20 || >1.2.4', '1.2.4'],
+ ['0.1.20 || 1.2.4', '1.2.3'],
+ ['0.1.20 || 1.2.4', '0.1.20'],
+ ['>=0.2.3 || <0.0.1', '0.0.0'],
+ ['>=0.2.3 || <0.0.1', '0.2.3'],
+ ['>=0.2.3 || <0.0.1', '0.2.4'],
+ ['||', '1.3.4'],
+ ['2.x.x', '2.1.3'],
+ ['1.2.x', '1.2.3'],
+ ['1.2.x || 2.x', '2.1.3'],
+ ['1.2.x || 2.x', '1.2.3'],
+ ['x', '1.2.3'],
+ ['2.*.*', '2.1.3'],
+ ['1.2.*', '1.2.3'],
+ ['1.2.* || 2.*', '2.1.3'],
+ ['1.2.* || 2.*', '1.2.3'],
+ ['1.2.* || 2.*', '1.2.3'],
+ ['*', '1.2.3'],
+ ['2', '2.1.2'],
+ ['2.3', '2.3.1'],
+ ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0
+ ['~2.4', '2.4.5'],
+ ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0
+ ['~1', '1.2.3'], // >=1.0.0 <2.0.0
+ ['~>1', '1.2.3'],
+ ['~> 1', '1.2.3'],
+ ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0
+ ['~ 1.0', '1.0.2'],
+ ['>=1', '1.0.0'],
+ ['>= 1', '1.0.0'],
+ ['<1.2', '1.1.1'],
+ ['< 1.2', '1.1.1'],
+ ['~v0.5.4-pre', '0.5.5'],
+ ['~v0.5.4-pre', '0.5.4'],
+ ['=0.7.x', '0.7.2'],
+ ['>=0.7.x', '0.7.2'],
+ ['<=0.7.x', '0.6.2'],
+ ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'],
+ ['>=0.2.3 <=0.2.4', '0.2.4'],
+ ['1.0.0 - 2.0.0', '2.0.0'],
+ ['^3.0.0', '4.0.0'],
+ ['^1.0.0 || ~2.0.1', '2.0.0'],
+ ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'],
+ ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true],
+ ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true],
+ ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'],
+ ['^1.0.0alpha', '1.0.0beta', true],
+ ['~1.0.0alpha', '1.0.0beta', true],
+ ['^1.0.0-alpha', '1.0.0beta', true],
+ ['~1.0.0-alpha', '1.0.0beta', true],
+ ['^1.0.0-alpha', '1.0.0-beta'],
+ ['~1.0.0-alpha', '1.0.0-beta'],
+ ['=0.1.0', '1.0.0']
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var loose = tuple[2] || false;
+ var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')';
+ t.notOk(ltr(version, range, loose), msg);
+ });
+ t.end();
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/major-minor-patch.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/major-minor-patch.js
new file mode 100644
index 0000000000..e9d4039c8b
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/node_modules/semver/test/major-minor-patch.js
@@ -0,0 +1,72 @@
+var tap = require('tap');
+var test = tap.test;
+var semver = require('../semver.js');
+
+test('\nmajor tests', function(t) {
+ // [range, version]
+ // Version should be detectable despite extra characters
+ [
+ ['1.2.3', 1],
+ [' 1.2.3 ', 1],
+ [' 2.2.3-4 ', 2],
+ [' 3.2.3-pre ', 3],
+ ['v5.2.3', 5],
+ [' v8.2.3 ', 8],
+ ['\t13.2.3', 13],
+ ['=21.2.3', 21, true],
+ ['v=34.2.3', 34, true]
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var loose = tuple[2] || false;
+ var msg = 'major(' + range + ') = ' + version;
+ t.equal(semver.major(range, loose), version, msg);
+ });
+ t.end();
+});
+
+test('\nminor tests', function(t) {
+ // [range, version]
+ // Version should be detectable despite extra characters
+ [
+ ['1.1.3', 1],
+ [' 1.1.3 ', 1],
+ [' 1.2.3-4 ', 2],
+ [' 1.3.3-pre ', 3],
+ ['v1.5.3', 5],
+ [' v1.8.3 ', 8],
+ ['\t1.13.3', 13],
+ ['=1.21.3', 21, true],
+ ['v=1.34.3', 34, true]
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var loose = tuple[2] || false;
+ var msg = 'minor(' + range + ') = ' + version;
+ t.equal(semver.minor(range, loose), version, msg);
+ });
+ t.end();
+});
+
+test('\npatch tests', function(t) {
+ // [range, version]
+ // Version should be detectable despite extra characters
+ [
+ ['1.2.1', 1],
+ [' 1.2.1 ', 1],
+ [' 1.2.2-4 ', 2],
+ [' 1.2.3-pre ', 3],
+ ['v1.2.5', 5],
+ [' v1.2.8 ', 8],
+ ['\t1.2.13', 13],
+ ['=1.2.21', 21, true],
+ ['v=1.2.34', 34, true]
+ ].forEach(function(tuple) {
+ var range = tuple[0];
+ var version = tuple[1];
+ var loose = tuple[2] || false;
+ var msg = 'patch(' + range + ') = ' + version;
+ t.equal(semver.patch(range, loose), version, msg);
+ });
+ t.end();
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json
new file mode 100644
index 0000000000..81950940bb
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/package.json
@@ -0,0 +1,65 @@
+{
+ "_from": "agent-base@2",
+ "_id": "agent-base@2.0.1",
+ "_integrity": "sha1-vY+ehqjrIh//oHvRS+/VXfFCgV4=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/agent-base",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "agent-base@2",
+ "name": "agent-base",
+ "escapedName": "agent-base",
+ "rawSpec": "2",
+ "saveSpec": null,
+ "fetchSpec": "2"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent"
+ ],
+ "_resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.0.1.tgz",
+ "_shasum": "bd8f9e86a8eb221fffa07bd14befd55df142815e",
+ "_shrinkwrap": null,
+ "_spec": "agent-base@2",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent",
+ "author": {
+ "name": "Nathan Rajlich",
+ "email": "nathan@tootallnate.net",
+ "url": "http://n8.io/"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/TooTallNate/node-agent-base/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "extend": "~3.0.0",
+ "semver": "~5.0.1"
+ },
+ "deprecated": false,
+ "description": "Turn a function into an `http.Agent` instance",
+ "devDependencies": {
+ "mocha": "2"
+ },
+ "homepage": "https://github.com/TooTallNate/node-agent-base#readme",
+ "keywords": [
+ "http",
+ "agent",
+ "base",
+ "barebones",
+ "https"
+ ],
+ "license": "MIT",
+ "main": "agent.js",
+ "name": "agent-base",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/node-agent-base.git"
+ },
+ "scripts": {
+ "test": "mocha --reporter spec"
+ },
+ "version": "2.0.1"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js
new file mode 100644
index 0000000000..7cdacafa3e
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/patch-core.js
@@ -0,0 +1,54 @@
+var url = require('url');
+var http = require('http');
+var https = require('https');
+var semver = require('semver');
+var inherits = require('util').inherits;
+
+
+// we only need to patch the `http.request()` and
+// `http.ClientRequest` on older versions of Node.js
+if (semver.lt(process.version, '0.11.8')) {
+ // subclass the native ClientRequest to include the
+ // passed in `options` object.
+ http.ClientRequest = (function (_ClientRequest) {
+ function ClientRequest (options, cb) {
+ this._options = options;
+ _ClientRequest.call(this, options, cb);
+ }
+ inherits(ClientRequest, _ClientRequest);
+
+ return ClientRequest;
+ })(http.ClientRequest);
+
+
+ // need to re-define the `request()` method, since on node v0.8/v0.10
+ // the closure-local ClientRequest is used, rather than the monkey
+ // patched version we have created here.
+ http.request = (function (request) {
+ return function (options, cb) {
+ if (typeof options === 'string') {
+ options = url.parse(options);
+ }
+ if (options.protocol && options.protocol !== 'http:') {
+ throw new Error('Protocol:' + options.protocol + ' not supported.');
+ }
+ return new http.ClientRequest(options, cb);
+ };
+ })(http.request);
+}
+
+
+// this currently needs to be applied to all Node.js versions
+// (v0.8.x, v0.10.x, v0.12.x), in order to determine if the `req`
+// is an HTTP or HTTPS request. There is currently no PR attempting
+// to move this property upstream.
+https.request = (function (request) {
+ return function (options, cb) {
+ if (typeof options === 'string') {
+ options = url.parse(options);
+ }
+ if (null == options.port) options.port = 443;
+ options.secureEndpoint = true;
+ return request.call(https, options, cb);
+ };
+})(https.request);
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key
new file mode 100644
index 0000000000..fd12501220
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICWwIBAAKBgQCzURxIqzer0ACAbX/lHdsn4Gd9PLKrf7EeDYfIdV0HZKPD8WDr
+bBx2/fBu0OW2sjnzv/SVZbJ0DAuPE/p0+eT0qb2qC10iz9iTD7ribd7gxhirVb8y
+b3fBjXsxc8V8p4Ny1LcvNSqCjwUbJqdRogfoJeTiqPM58z5sNzuv5iq7iwIDAQAB
+AoGAPMQy4olrP0UotlzlJ36bowLP70ffgHCwU+/f4NWs5fF78c3du0oSx1w820Dd
+Z7E0JF8bgnlJJTxjumPZz0RUCugrEHBKJmzEz3cxF5E3+7NvteZcjKn9D67RrM5x
+1/uSZ9cqKE9cYvY4fSuHx18diyZ4axR/wB1Pea2utjjDM+ECQQDb9ZbmmaWMiRpQ
+5Up+loxP7BZNPsEVsm+DVJmEFbaFgGfncWBqSIqnPNjMwTwj0OigTwCAEGPkfRVW
+T0pbYWCxAkEA0LK7SCTwzyDmhASUalk0x+3uCAA6ryFdwJf/wd8TRAvVOmkTEldX
+uJ7ldLvfrONYO3v56uKTU/SoNdZYzKtO+wJAX2KM4ctXYy5BXztPpr2acz4qHa1N
+Bh+vBAC34fOYhyQ76r3b1btHhWZ5jbFuZwm9F2erC94Ps5IaoqcX07DSwQJAPKGw
+h2U0EPkd/3zVIZCJJQya+vgWFIs9EZcXVtvYXQyTBkVApTN66MhBIYjzkub5205J
+bVQmOV37AKklY1DhwQJAA1wos0cYxro02edzatxd0DIR2r4qqOqLkw6BhYHhq6HJ
+ZvIcQkHqdSXzdETFc01I1znDGGIrJHcnvKWgBPoEUg==
+-----END RSA PRIVATE KEY-----
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem
new file mode 100644
index 0000000000..b115a5e914
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/ssl-cert-snakeoil.pem
@@ -0,0 +1,12 @@
+-----BEGIN CERTIFICATE-----
+MIIB1TCCAT4CCQDV5mPlzm9+izANBgkqhkiG9w0BAQUFADAvMS0wKwYDVQQDEyQ3
+NTI3YmQ3Ny1hYjNlLTQ3NGItYWNlNy1lZWQ2MDUzOTMxZTcwHhcNMTUwNzA2MjI0
+NTA3WhcNMjUwNzAzMjI0NTA3WjAvMS0wKwYDVQQDEyQ3NTI3YmQ3Ny1hYjNlLTQ3
+NGItYWNlNy1lZWQ2MDUzOTMxZTcwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGB
+ALNRHEirN6vQAIBtf+Ud2yfgZ308sqt/sR4Nh8h1XQdko8PxYOtsHHb98G7Q5bay
+OfO/9JVlsnQMC48T+nT55PSpvaoLXSLP2JMPuuJt3uDGGKtVvzJvd8GNezFzxXyn
+g3LUty81KoKPBRsmp1GiB+gl5OKo8znzPmw3O6/mKruLAgMBAAEwDQYJKoZIhvcN
+AQEFBQADgYEACzoHUF8UV2Z6541Q2wKEA0UFUzmUjf/E1XwBO+1P15ZZ64uw34B4
+1RwMPtAo9RY/PmICTWtNxWGxkzwb2JtDWtnxVER/lF8k2XcXPE76fxTHJF/BKk9J
+QU8OTD1dd9gHCBviQB9TqntRZ5X7axjtuWjb2umY+owBYzAHZkp1HKI=
+-----END CERTIFICATE-----
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js
new file mode 100644
index 0000000000..f87d308f8e
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/agent-base/test/test.js
@@ -0,0 +1,300 @@
+
+/**
+ * Module dependencies.
+ */
+
+var fs = require('fs');
+var url = require('url');
+var net = require('net');
+var tls = require('tls');
+var http = require('http');
+var https = require('https');
+var assert = require('assert');
+var events = require('events');
+var Agent = require('../');
+
+describe('Agent', function () {
+ describe('"error" event', function () {
+ it('should be invoked on `http.ClientRequest` instance if passed to callback function on the first tick', function (done) {
+ var agent = new Agent(function (req, opts, fn) {
+ fn(new Error('is this caught?'));
+ });
+ var info = url.parse('http://127.0.0.1/foo');
+ info.agent = agent;
+ var req = http.get(info);
+ req.on('error', function (err) {
+ assert.equal('is this caught?', err.message);
+ done();
+ });
+ });
+ it('should be invoked on `http.ClientRequest` instance if passed to callback function after the first tick', function (done) {
+ var agent = new Agent(function (req, opts, fn) {
+ setTimeout(function () {
+ fn(new Error('is this caught?'));
+ }, 10);
+ });
+ var info = url.parse('http://127.0.0.1/foo');
+ info.agent = agent;
+ var req = http.get(info);
+ req.on('error', function (err) {
+ assert.equal('is this caught?', err.message);
+ done();
+ });
+ });
+ });
+ describe('artificial "streams"', function () {
+ it('should send a GET request', function (done) {
+ var stream = new events.EventEmitter();
+
+ // needed for the `http` module to call .write() on the stream
+ stream.writable = true;
+
+ stream.write = function (str) {
+ assert(0 == str.indexOf('GET / HTTP/1.1'));
+ done();
+ };
+
+ var opts = {
+ method: 'GET',
+ host: '127.0.0.1',
+ path: '/',
+ port: 80,
+ agent: new Agent(function (req, opts, fn) {
+ fn(null, stream);
+ })
+ };
+ var req = http.request(opts);
+ req.end();
+ });
+ it('should receive a GET response', function (done) {
+ var stream = new events.EventEmitter();
+ var opts = {
+ method: 'GET',
+ host: '127.0.0.1',
+ path: '/',
+ port: 80,
+ agent: new Agent(function (req, opts, fn) {
+ fn(null, stream);
+ })
+ };
+ var req = http.request(opts, function (res) {
+ assert.equal('0.9', res.httpVersion);
+ assert.equal(111, res.statusCode);
+ assert.equal('bar', res.headers.foo);
+ done();
+ });
+ req.end();
+
+ // have to nextTick() since `http.ClientRequest` doesn't *actually*
+ // attach the listeners to the "stream" until the next tick :\
+ process.nextTick(function () {
+ var buf = new Buffer('HTTP/0.9 111\r\n' +
+ 'Foo: bar\r\n' +
+ 'Set-Cookie: 1\r\n' +
+ 'Set-Cookie: 2\r\n\r\n');
+ if ('function' == typeof stream.ondata) {
+ // node <= v0.11.3
+ stream.ondata(buf, 0, buf.length);
+ } else {
+ // node > v0.11.3
+ stream.emit('data', buf);
+ }
+ });
+ });
+ });
+});
+
+describe('"http" module', function () {
+ var server;
+ var port;
+
+ // setup test HTTP server
+ before(function (done) {
+ server = http.createServer();
+ server.listen(0, function () {
+ port = server.address().port;
+ done();
+ });
+ });
+
+ // shut down test HTTP server
+ after(function (done) {
+ server.once('close', function () {
+ done();
+ });
+ server.close();
+ });
+
+ it('should work for basic HTTP requests', function (done) {
+ var called = false;
+ var agent = new Agent(function (req, opts, fn) {
+ called = true;
+ var socket = net.connect(opts);
+ fn(null, socket);
+ });
+
+ // add HTTP server "request" listener
+ var gotReq = false;
+ server.once('request', function (req, res) {
+ gotReq = true;
+ res.setHeader('X-Foo', 'bar');
+ res.setHeader('X-Url', req.url);
+ res.end();
+ });
+
+ var info = url.parse('http://127.0.0.1:' + port + '/foo');
+ info.agent = agent;
+ http.get(info, function (res) {
+ assert.equal('bar', res.headers['x-foo']);
+ assert.equal('/foo', res.headers['x-url']);
+ assert(gotReq);
+ assert(called);
+ done();
+ });
+ });
+
+ it('should set the `Connection: close` response header', function (done) {
+ var called = false;
+ var agent = new Agent(function (req, opts, fn) {
+ called = true;
+ var socket = net.connect(opts);
+ fn(null, socket);
+ });
+
+ // add HTTP server "request" listener
+ var gotReq = false;
+ server.once('request', function (req, res) {
+ gotReq = true;
+ res.setHeader('X-Url', req.url);
+ assert.equal('close', req.headers.connection);
+ res.end();
+ });
+
+ var info = url.parse('http://127.0.0.1:' + port + '/bar');
+ info.agent = agent;
+ http.get(info, function (res) {
+ assert.equal('/bar', res.headers['x-url']);
+ assert.equal('close', res.headers.connection);
+ assert(gotReq);
+ assert(called);
+ done();
+ });
+ });
+
+ it('should pass through options from `http.request()`', function (done) {
+ var agent = new Agent(function (req, opts, fn) {
+ assert.equal('google.com', opts.host);
+ assert.equal('bar', opts.foo);
+ done();
+ });
+
+ http.get({
+ host: 'google.com',
+ foo: 'bar',
+ agent: agent
+ });
+ });
+
+ it('should default to port 80', function (done) {
+ var agent = new Agent(function (req, opts, fn) {
+ assert.equal(80, opts.port);
+ done();
+ });
+
+ // (probably) not hitting a real HTTP server here,
+ // so no need to add a httpServer request listener
+ http.get({
+ host: '127.0.0.1',
+ path: '/foo',
+ agent: agent
+ });
+ });
+});
+
+describe('"https" module', function () {
+ var server;
+ var port;
+
+ // setup test HTTPS server
+ before(function (done) {
+ var options = {
+ key: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.key'),
+ cert: fs.readFileSync(__dirname + '/ssl-cert-snakeoil.pem')
+ };
+ server = https.createServer(options);
+ server.listen(0, function () {
+ port = server.address().port;
+ done();
+ });
+ });
+
+ // shut down test HTTP server
+ after(function (done) {
+ server.once('close', function () {
+ done();
+ });
+ server.close();
+ });
+
+ it('should work for basic HTTPS requests', function (done) {
+ var called = false;
+ var agent = new Agent(function (req, opts, fn) {
+ called = true;
+ assert(opts.secureEndpoint);
+ var socket = tls.connect(opts);
+ fn(null, socket);
+ });
+
+ // add HTTPS server "request" listener
+ var gotReq = false;
+ server.once('request', function (req, res) {
+ gotReq = true;
+ res.setHeader('X-Foo', 'bar');
+ res.setHeader('X-Url', req.url);
+ res.end();
+ });
+
+ var info = url.parse('https://127.0.0.1:' + port + '/foo');
+ info.agent = agent;
+ info.rejectUnauthorized = false;
+ https.get(info, function (res) {
+ assert.equal('bar', res.headers['x-foo']);
+ assert.equal('/foo', res.headers['x-url']);
+ assert(gotReq);
+ assert(called);
+ done();
+ });
+ });
+
+ it('should pass through options from `https.request()`', function (done) {
+ var agent = new Agent(function (req, opts, fn) {
+ assert.equal('google.com', opts.host);
+ assert.equal('bar', opts.foo);
+ done();
+ });
+
+ https.get({
+ host: 'google.com',
+ foo: 'bar',
+ agent: agent
+ });
+ });
+
+ it('should default to port 443', function (done) {
+ var agent = new Agent(function (req, opts, fn) {
+ assert.equal(true, opts.secureEndpoint);
+ assert.equal(false, opts.rejectUnauthorized);
+ assert.equal(443, opts.port);
+ done();
+ });
+
+ // (probably) not hitting a real HTTPS server here,
+ // so no need to add a httpsServer request listener
+ https.get({
+ host: '127.0.0.1',
+ path: '/foo',
+ agent: agent,
+ rejectUnauthorized: false
+ });
+ });
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.jscs.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.jscs.json
new file mode 100644
index 0000000000..b1c6a99f97
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.jscs.json
@@ -0,0 +1,174 @@
+{
+ "es3": true,
+
+ "additionalRules": [],
+
+ "requireSemicolons": true,
+
+ "disallowMultipleSpaces": true,
+
+ "disallowIdentifierNames": [],
+
+ "requireCurlyBraces": {
+ "allExcept": [],
+ "keywords": ["if", "else", "for", "while", "do", "try", "catch"]
+ },
+
+ "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
+
+ "disallowSpaceAfterKeywords": [],
+
+ "disallowSpaceBeforeComma": true,
+ "disallowSpaceAfterComma": false,
+ "disallowSpaceBeforeSemicolon": true,
+
+ "disallowNodeTypes": [
+ "DebuggerStatement",
+ "LabeledStatement",
+ "SwitchCase",
+ "SwitchStatement",
+ "WithStatement"
+ ],
+
+ "requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
+
+ "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
+ "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
+ "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
+ "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
+ "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
+
+ "requireSpaceBetweenArguments": true,
+
+ "disallowSpacesInsideParentheses": true,
+
+ "disallowSpacesInsideArrayBrackets": true,
+
+ "disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },
+
+ "disallowSpaceAfterObjectKeys": true,
+
+ "requireCommaBeforeLineBreak": true,
+
+ "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+ "requireSpaceAfterPrefixUnaryOperators": [],
+
+ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+ "requireSpaceBeforePostfixUnaryOperators": [],
+
+ "disallowSpaceBeforeBinaryOperators": [],
+ "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+
+ "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+ "disallowSpaceAfterBinaryOperators": [],
+
+ "disallowImplicitTypeConversion": ["binary", "string"],
+
+ "disallowKeywords": ["with", "eval"],
+
+ "requireKeywordsOnNewLine": [],
+ "disallowKeywordsOnNewLine": ["else"],
+
+ "requireLineFeedAtFileEnd": true,
+
+ "disallowTrailingWhitespace": true,
+
+ "disallowTrailingComma": true,
+
+ "excludeFiles": ["node_modules/**", "vendor/**"],
+
+ "disallowMultipleLineStrings": true,
+
+ "requireDotNotation": { "allExcept": ["keywords"] },
+
+ "requireParenthesesAroundIIFE": true,
+
+ "validateLineBreaks": "LF",
+
+ "validateQuoteMarks": {
+ "escape": true,
+ "mark": "'"
+ },
+
+ "disallowOperatorBeforeLineBreak": [],
+
+ "requireSpaceBeforeKeywords": [
+ "do",
+ "for",
+ "if",
+ "else",
+ "switch",
+ "case",
+ "try",
+ "catch",
+ "finally",
+ "while",
+ "with",
+ "return"
+ ],
+
+ "validateAlignedFunctionParameters": {
+ "lineBreakAfterOpeningBraces": true,
+ "lineBreakBeforeClosingBraces": true
+ },
+
+ "requirePaddingNewLinesBeforeExport": true,
+
+ "validateNewlineAfterArrayElements": {
+ "maximum": 6
+ },
+
+ "requirePaddingNewLinesAfterUseStrict": true,
+
+ "disallowArrowFunctions": true,
+
+ "disallowMultiLineTernary": true,
+
+ "validateOrderInObjectKeys": false,
+
+ "disallowIdenticalDestructuringNames": true,
+
+ "disallowNestedTernaries": { "maxLevel": 1 },
+
+ "requireSpaceAfterComma": { "allExcept": ["trailing"] },
+ "requireAlignedMultilineParams": false,
+
+ "requireSpacesInGenerator": {
+ "afterStar": true
+ },
+
+ "disallowSpacesInGenerator": {
+ "beforeStar": true
+ },
+
+ "disallowVar": false,
+
+ "requireArrayDestructuring": false,
+
+ "requireEnhancedObjectLiterals": false,
+
+ "requireObjectDestructuring": false,
+
+ "requireEarlyReturn": false,
+
+ "requireCapitalizedConstructorsNew": {
+ "allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
+ },
+
+ "requireImportAlphabetized": false,
+
+ "requireSpaceBeforeObjectValues": true,
+ "requireSpaceBeforeDestructuredValues": true,
+
+ "disallowSpacesInsideTemplateStringPlaceholders": true,
+
+ "disallowArrayDestructuringReturn": false,
+
+ "requireNewlineBeforeSingleStatementsInIf": false,
+
+ "disallowUnusedVariables": true,
+
+ "requireSpacesInsideImportedObjectBraces": true,
+
+ "requireUseStrict": true
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.npmignore
new file mode 100644
index 0000000000..30d74d2584
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.npmignore
@@ -0,0 +1 @@
+test \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.travis.yml
new file mode 100644
index 0000000000..6bf696c87b
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/.travis.yml
@@ -0,0 +1,179 @@
+language: node_js
+os:
+ - linux
+node_js:
+ - "7.9"
+ - "6.10"
+ - "5.12"
+ - "4.8"
+ - "iojs-v3.3"
+ - "iojs-v2.5"
+ - "iojs-v1.8"
+ - "0.12"
+ - "0.10"
+ - "0.8"
+before_install:
+ - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
+ - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
+install:
+ - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
+script:
+ - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
+ - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
+ - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
+ - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
+sudo: false
+env:
+ - TEST=true
+matrix:
+ fast_finish: true
+ include:
+ - node_js: "node"
+ env: PRETEST=true
+ - node_js: "node"
+ env: COVERAGE=true
+ - node_js: "7.8"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.7"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.6"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.5"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.4"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.3"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.2"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.1"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "7.0"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.9"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.8"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.7"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.6"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.5"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.4"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.3"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.2"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.1"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "6.0"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.11"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.10"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.9"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.8"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.7"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.6"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.5"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.4"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.3"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.2"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.1"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "5.0"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.7"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.6"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.5"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.4"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.3"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.2"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.1"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "4.0"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v3.2"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v3.1"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v3.0"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v2.4"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v2.3"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v2.2"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v2.1"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v2.0"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.7"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.6"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.5"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.4"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.3"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.2"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.1"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "iojs-v1.0"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "0.11"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "0.9"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "0.6"
+ env: TEST=true ALLOW_FAILURE=true
+ - node_js: "0.4"
+ env: TEST=true ALLOW_FAILURE=true
+ ##- node_js: "7"
+ #env: TEST=true
+ #os: osx
+ #- node_js: "6"
+ #env: TEST=true
+ #os: osx
+ #- node_js: "5"
+ #env: TEST=true
+ #os: osx
+ #- node_js: "4"
+ #env: TEST=true
+ #os: osx
+ #- node_js: "iojs"
+ #env: TEST=true
+ #os: osx
+ #- node_js: "0.12"
+ #env: TEST=true
+ #os: osx
+ #- node_js: "0.10"
+ #env: TEST=true
+ #os: osx
+ #- node_js: "0.8"
+ #env: TEST=true
+ #os: osx
+ allow_failures:
+ - os: osx
+ - env: TEST=true ALLOW_FAILURE=true
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/CHANGELOG.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/CHANGELOG.md
new file mode 100644
index 0000000000..7d2e5f3a50
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/CHANGELOG.md
@@ -0,0 +1,76 @@
+3.0.1 / 2017-04-27
+==================
+ * [Fix] deep extending should work with a non-object (#46)
+ * [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`
+ * [Tests] up to `node` `v7.9`, `v6.10`, `v4.8`; improve matrix
+ * [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG.
+ * [Docs] Add example to readme (#34)
+
+3.0.0 / 2015-07-01
+==================
+ * [Possible breaking change] Use global "strict" directive (#32)
+ * [Tests] `int` is an ES3 reserved word
+ * [Tests] Test up to `io.js` `v2.3`
+ * [Tests] Add `npm run eslint`
+ * [Dev Deps] Update `covert`, `jscs`
+
+2.0.1 / 2015-04-25
+==================
+ * Use an inline `isArray` check, for ES3 browsers. (#27)
+ * Some old browsers fail when an identifier is `toString`
+ * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds
+ * Add license info to package.json (#25)
+ * Update `tape`, `jscs`
+ * Adding a CHANGELOG
+
+2.0.0 / 2014-10-01
+==================
+ * Increase code coverage to 100%; run code coverage as part of tests
+ * Add `npm run lint`; Run linter as part of tests
+ * Remove nodeType and setInterval checks in isPlainObject
+ * Updating `tape`, `jscs`, `covert`
+ * General style and README cleanup
+
+1.3.0 / 2014-06-20
+==================
+ * Add component.json for browser support (#18)
+ * Use SVG for badges in README (#16)
+ * Updating `tape`, `covert`
+ * Updating travis-ci to work with multiple node versions
+ * Fix `deep === false` bug (returning target as {}) (#14)
+ * Fixing constructor checks in isPlainObject
+ * Adding additional test coverage
+ * Adding `npm run coverage`
+ * Add LICENSE (#13)
+ * Adding a warning about `false`, per #11
+ * General style and whitespace cleanup
+
+1.2.1 / 2013-09-14
+==================
+ * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8
+ * Updating `tape`
+
+1.2.0 / 2013-09-02
+==================
+ * Updating the README: add badges
+ * Adding a missing variable reference.
+ * Using `tape` instead of `buster` for tests; add more tests (#7)
+ * Adding node 0.10 to Travis CI (#6)
+ * Enabling "npm test" and cleaning up package.json (#5)
+ * Add Travis CI.
+
+1.1.3 / 2012-12-06
+==================
+ * Added unit tests.
+ * Ensure extend function is named. (Looks nicer in a stack trace.)
+ * README cleanup.
+
+1.1.1 / 2012-11-07
+==================
+ * README cleanup.
+ * Added installation instructions.
+ * Added a missing semicolon
+
+1.0.0 / 2012-04-08
+==================
+ * Initial commit
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/LICENSE b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/LICENSE
new file mode 100644
index 0000000000..92d41503d3
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Stefan Thomas
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/README.md
new file mode 100644
index 0000000000..947dda6aeb
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/README.md
@@ -0,0 +1,80 @@
+[![Build Status][travis-svg]][travis-url]
+[![dependency status][deps-svg]][deps-url]
+[![dev dependency status][dev-deps-svg]][dev-deps-url]
+
+# extend() for Node.js <sup>[![Version Badge][npm-version-png]][npm-url]</sup>
+
+`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true.
+
+Notes:
+
+* Since Node.js >= 4,
+ [`Object.assign`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
+ now offers the same functionality natively (but without the "deep copy" option).
+ See [ECMAScript 2015 (ES6) in Node.js](https://nodejs.org/en/docs/es6).
+* Some native implementations of `Object.assign` in both Node.js and many
+ browsers (since NPM modules are for the browser too) may not be fully
+ spec-compliant.
+ Check [`object.assign`](https://www.npmjs.com/package/object.assign) module for
+ a compliant candidate.
+
+## Installation
+
+This package is available on [npm][npm-url] as: `extend`
+
+``` sh
+npm install extend
+```
+
+## Usage
+
+**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)**
+
+*Extend one object with one or more others, returning the modified object.*
+
+**Example:**
+
+``` js
+var extend = require('extend');
+extend(targetObject, object1, object2);
+```
+
+Keep in mind that the target object will be modified, and will be returned from extend().
+
+If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s).
+Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over.
+Warning: passing `false` as the first argument is not supported.
+
+### Arguments
+
+* `deep` *Boolean* (optional)
+If set, the merge becomes recursive (i.e. deep copy).
+* `target` *Object*
+The object to extend.
+* `object1` *Object*
+The object that will be merged into the first.
+* `objectN` *Object* (Optional)
+More objects to merge into the first.
+
+## License
+
+`node-extend` is licensed under the [MIT License][mit-license-url].
+
+## Acknowledgements
+
+All credit to the jQuery authors for perfecting this amazing utility.
+
+Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb].
+
+[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg
+[travis-url]: https://travis-ci.org/justmoon/node-extend
+[npm-url]: https://npmjs.org/package/extend
+[mit-license-url]: http://opensource.org/licenses/MIT
+[github-justmoon]: https://github.com/justmoon
+[github-insin]: https://github.com/insin
+[github-ljharb]: https://github.com/ljharb
+[npm-version-png]: http://versionbadg.es/justmoon/node-extend.svg
+[deps-svg]: https://david-dm.org/justmoon/node-extend.svg
+[deps-url]: https://david-dm.org/justmoon/node-extend
+[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg
+[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/component.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/component.json
new file mode 100644
index 0000000000..0f76b59305
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/component.json
@@ -0,0 +1,31 @@
+{
+ "name": "extend",
+ "author": "Stefan Thomas <justmoon@members.fsf.org> (http://www.justmoon.net)",
+ "version": "3.0.0",
+ "description": "Port of jQuery.extend for node.js and the browser.",
+ "scripts": [
+ "index.js"
+ ],
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "url": "https://github.com/ljharb"
+ }
+ ],
+ "keywords": [
+ "extend",
+ "clone",
+ "merge"
+ ],
+ "repository" : {
+ "type": "git",
+ "url": "https://github.com/justmoon/node-extend.git"
+ },
+ "dependencies": {
+ },
+ "devDependencies": {
+ "tape" : "~3.0.0",
+ "covert": "~0.4.0",
+ "jscs": "~1.6.2"
+ }
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/index.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/index.js
new file mode 100644
index 0000000000..bbe53f6608
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/index.js
@@ -0,0 +1,86 @@
+'use strict';
+
+var hasOwn = Object.prototype.hasOwnProperty;
+var toStr = Object.prototype.toString;
+
+var isArray = function isArray(arr) {
+ if (typeof Array.isArray === 'function') {
+ return Array.isArray(arr);
+ }
+
+ return toStr.call(arr) === '[object Array]';
+};
+
+var isPlainObject = function isPlainObject(obj) {
+ if (!obj || toStr.call(obj) !== '[object Object]') {
+ return false;
+ }
+
+ var hasOwnConstructor = hasOwn.call(obj, 'constructor');
+ var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
+ // Not own constructor property must be Object
+ if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ var key;
+ for (key in obj) { /**/ }
+
+ return typeof key === 'undefined' || hasOwn.call(obj, key);
+};
+
+module.exports = function extend() {
+ var options, name, src, copy, copyIsArray, clone;
+ var target = arguments[0];
+ var i = 1;
+ var length = arguments.length;
+ var deep = false;
+
+ // Handle a deep copy situation
+ if (typeof target === 'boolean') {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+ if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
+ target = {};
+ }
+
+ for (; i < length; ++i) {
+ options = arguments[i];
+ // Only deal with non-null/undefined values
+ if (options != null) {
+ // Extend the base object
+ for (name in options) {
+ src = target[name];
+ copy = options[name];
+
+ // Prevent never-ending loop
+ if (target !== copy) {
+ // Recurse if we're merging plain objects or arrays
+ if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
+ if (copyIsArray) {
+ copyIsArray = false;
+ clone = src && isArray(src) ? src : [];
+ } else {
+ clone = src && isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[name] = extend(deep, clone, copy);
+
+ // Don't bring in undefined values
+ } else if (typeof copy !== 'undefined') {
+ target[name] = copy;
+ }
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/package.json
new file mode 100644
index 0000000000..f617c01d62
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/extend/package.json
@@ -0,0 +1,79 @@
+{
+ "_from": "extend@3",
+ "_id": "extend@3.0.1",
+ "_integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/extend",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "extend@3",
+ "name": "extend",
+ "escapedName": "extend",
+ "rawSpec": "3",
+ "saveSpec": null,
+ "fetchSpec": "3"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent",
+ "/pacote/make-fetch-happen/socks-proxy-agent/agent-base"
+ ],
+ "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
+ "_shasum": "a755ea7bc1adfcc5a31ce7e762dbaadc5e636444",
+ "_shrinkwrap": null,
+ "_spec": "extend@3",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent",
+ "author": {
+ "name": "Stefan Thomas",
+ "email": "justmoon@members.fsf.org",
+ "url": "http://www.justmoon.net"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/justmoon/node-extend/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Jordan Harband",
+ "url": "https://github.com/ljharb"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Port of jQuery.extend for node.js and the browser",
+ "devDependencies": {
+ "@ljharb/eslint-config": "^11.0.0",
+ "covert": "^1.1.0",
+ "eslint": "^3.19.0",
+ "jscs": "^3.0.7",
+ "tape": "^4.6.3"
+ },
+ "homepage": "https://github.com/justmoon/node-extend#readme",
+ "keywords": [
+ "extend",
+ "clone",
+ "merge"
+ ],
+ "license": "MIT",
+ "main": "index",
+ "name": "extend",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/justmoon/node-extend.git"
+ },
+ "scripts": {
+ "coverage": "covert test/index.js",
+ "coverage-quiet": "covert test/index.js --quiet",
+ "eslint": "eslint *.js */*.js",
+ "jscs": "jscs *.js */*.js",
+ "lint": "npm run jscs && npm run eslint",
+ "posttest": "npm run coverage-quiet",
+ "pretest": "npm run lint",
+ "test": "npm run tests-only",
+ "tests-only": "node test"
+ },
+ "version": "3.0.1"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore
new file mode 100644
index 0000000000..7deddced8b
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/.npmignore
@@ -0,0 +1,4 @@
+node_modules
+.git*
+.idea
+npm-debug.log \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE
new file mode 100644
index 0000000000..b2442a9e71
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Josh Glazebrook
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md
new file mode 100644
index 0000000000..890b7deb6a
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/README.md
@@ -0,0 +1,339 @@
+socks
+=============
+
+socks is a full client implementation of the SOCKS 4, 4a, and 5 protocols in an easy to use node.js module.
+
+### Notice
+As of February 26th, 2015, socks is the new home of the socks-client package.
+
+### Why socks?
+
+There is not any other SOCKS proxy client library on npm that supports all three variants of the SOCKS protocol. Nor are there any that support the BIND and associate features that some versions of the SOCKS protocol supports.
+
+Key Features:
+* Supports SOCKS 4, 4a, and 5 protocols
+* Supports the connect method (simple tcp connections of SOCKS) (Client -> SOCKS Server -> Target Server)
+* Supports the BIND method (4, 4a, 5)
+* Supports the associate (UDP forwarding) method (5)
+* Simple and easy to use (one function call to make any type of SOCKS connection)
+
+## Installing:
+
+`npm install socks`
+
+### Getting Started Example
+
+For this example, say you wanted to grab the html of google's home page.
+
+```javascript
+var Socks = require('socks');
+
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108", // Random public proxy
+ port: 1080,
+ type: 5 // type is REQUIRED. Valid types: [4, 5] (note 4 also works for 4a)
+ },
+ target: {
+ host: "google.com", // can be an ip address or domain (4a and 5 only)
+ port: 80
+ },
+ command: 'connect' // This defaults to connect, so it's optional if you're not using BIND or Associate.
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ // Connection has been established, we can start sending data now:
+ socket.write("GET / HTTP/1.1\nHost: google.com\n\n");
+ socket.on('data', function(data) {
+ console.log(data.length);
+ console.log(data);
+ });
+
+ // PLEASE NOTE: sockets need to be resumed before any data will come in or out as they are paused right before this callback is fired.
+ socket.resume();
+
+ // 569
+ // <Buffer 48 54 54 50 2f 31 2e 31 20 33 30 31 20 4d 6f 76 65 64 20 50 65...
+ }
+});
+```
+
+### BIND Example:
+
+When sending the BIND command to a SOCKS proxy server, this will cause the proxy server to open up a new tcp port. Once this port is open, you, another client, application, etc, can then connect to the SOCKS proxy on that tcp port and communications will be forwarded to each connection through the proxy itself.
+
+```javascript
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 4,
+ command: "bind" // Since we are using bind, we must specify it here.
+ },
+ target: {
+ host: "1.2.3.4", // When using bind, it's best to give an estimation of the ip that will be connecting to the newly opened tcp port on the proxy server.
+ port: 1080
+ }
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ // BIND request has completed.
+ // info object contains the remote ip and newly opened tcp port to connect to.
+ console.log(info);
+
+ // { port: 1494, host: '202.101.228.108' }
+
+ socket.on('data', function(data) {
+ console.log(data.length);
+ console.log(data);
+ });
+
+ // Remember to resume the socket stream.
+ socket.resume();
+ }
+});
+
+```
+At this point, your original connection to the proxy server remains open, and no data will be received until a tcp connection is made to the given endpoint in the info object.
+
+For an example, I am going to connect to the endpoint with telnet:
+
+```
+Joshs-MacBook-Pro:~ Josh$ telnet 202.101.228.108 1494
+ Trying 202.101.228.108...
+ Connected to 202.101.228.108.
+ Escape character is '^]'.
+ hello
+ aaaaaaaaa
+```
+
+Note that this connection to the newly bound port does not need to go through the SOCKS handshake.
+
+Back at our original connection we see that we have received some new data:
+
+```
+8
+<Buffer 00 5a ca 61 43 a8 09 01> // This first piece of information can be ignored.
+
+7
+<Buffer 68 65 6c 6c 6f 0d 0a> // Hello <\r\n (enter key)>
+
+11
+<Buffer 61 61 61 61 61 61 61 61 61 0d 0a> // aaaaaaaaa <\r\n (enter key)>
+```
+
+As you can see the data entered in the telnet terminal is routed through the SOCKS proxy and back to the original connection that was made to the proxy.
+
+**Note** Please pay close attention to the first piece of data that was received.
+
+```
+<Buffer 00 5a ca 61 43 a8 09 01>
+
+ [005a] [PORT:2} [IP:4]
+```
+
+This piece of data is technically part of the SOCKS BIND specifications, but because of my design decisions that were made in an effort to keep this library simple to use, you will need to make sure to ignore and/or deal with this initial packet that is received when a connection is made to the newly opened port.
+
+### Associate Example:
+The associate command sets up a UDP relay for the remote SOCKS proxy server to relay UDP packets to the remote host of your choice.
+
+```javascript
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ command: "associate" // Since we are using associate, we must specify it here.
+ },
+ target: {
+ // When using associate, either set the ip and port to 0.0.0.0:0 or the expected source of incoming udp packets.
+ // Note: Some SOCKS servers MAY block associate requests with 0.0.0.0:0 endpoints.
+ // Note: ipv4, ipv6, and hostnames are supported here.
+ host: "0.0.0.0",
+ port: 0
+ }
+};
+
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ // Associate request has completed.
+ // info object contains the remote ip and udp port to send UDP packets to.
+ console.log(info);
+ // { port: 42803, host: '202.101.228.108' }
+
+ var udp = new dgram.Socket('udp4');
+
+ // In this example we are going to send "Hello" to 1.2.3.4:2323 through the SOCKS proxy.
+
+ var pack = Socks.createUDPFrame({ host: "1.2.3.4", port: 2323}, new Buffer("hello"));
+
+ // Send Packet to Proxy UDP endpoint given in the info object.
+ udp.send(pack, 0, pack.length, info.port, info.host);
+ }
+});
+
+```
+Now assuming that the associate request went through correctly. Anything that is typed in the stdin will first be sent to the SOCKS proxy on the endpoint that was provided in the info object. Once the SOCKS proxy receives it, it will then forward on the actual UDP packet to the host you you wanted.
+
+
+1.2.3.4:2323 should now receive our relayed UDP packet from 202.101.228.108 (SOCKS proxy)
+```
+// <Buffer 68 65 6c 6c 6f>
+```
+
+## Using socks as an HTTP Agent
+
+You can use socks as a http agent which will relay all your http
+connections through the socks server.
+
+The object that `Socks.Agent` accepts is the same as `Socks.createConnection`, you don't need to set a target since you have to define it in `http.request` or `http.get` methods.
+
+The second argument is a boolean which indicates whether the remote endpoint requires TLS.
+
+```javascript
+var socksAgent = new Socks.Agent({
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ }},
+ true, // we are connecting to a HTTPS server, false for HTTP server
+ false // rejectUnauthorized option passed to tls.connect(). Only when secure is set to true
+);
+
+http.get({ hostname: 'google.com', port: '443', agent: socksAgent}, function (res) {
+ // Connection header by default is keep-alive, we have to manually end the socket
+ socksAgent.encryptedSocket.end();
+});
+```
+
+# Api Reference:
+
+There are only three exported functions that you will ever need to use.
+
+### Socks.createConnection( options, callback(err, socket, info) )
+> `Object` **Object containing options to use when creating this connection**
+
+> `function` **Callback that is called when connection completes or errors**
+
+Options:
+
+```javascript
+var options = {
+
+ // Information about proxy server
+ proxy: {
+ // IP Address of Proxy (Required)
+ ipaddress: "1.2.3.4",
+
+ // TCP Port of Proxy (Required)
+ port: 1080,
+
+ // Proxy Type [4, 5] (Required)
+ // Note: 4 works for both 4 and 4a.
+ type: 4,
+
+ // SOCKS Connection Type (Optional)
+ // - defaults to 'connect'
+
+ // 'connect' - establishes a regular SOCKS connection to the target host.
+ // 'bind' - establishes an open tcp port on the SOCKS for another client to connect to.
+ // 'associate' - establishes a udp association relay on the SOCKS server.
+ command: "connect",
+
+
+ // SOCKS 4 Specific:
+
+ // UserId used when making a SOCKS 4/4a request. (Optional)
+ userid: "someuserid",
+
+ // SOCKS 5 Specific:
+
+ // Authentication used for SOCKS 5 (when it's required) (Optional)
+ authentication: {
+ username: "Josh",
+ password: "somepassword"
+ }
+ },
+
+ // Information about target host and/or expected client of a bind association. (Required)
+ target: {
+ // When using 'connect': IP Address or hostname (4a and 5 only) of a target to connect to.
+ // When using 'bind': IP Address of the expected client that will connect to the newly open tcp port.
+ // When using 'associate': IP Address and Port of the expected client that will send UDP packets to this UDP association relay.
+
+ // Note:
+ // When using SOCKS 4, only an ipv4 address can be used.
+ // When using SOCKS 4a, an ipv4 address OR a hostname can be used.
+ // When using SOCKS 5, ipv4, ipv6, or a hostname can be used.
+ host: "1.2.3.4",
+
+ // TCP port of target to connect to.
+ port: 1080
+ },
+
+ // Amount of time to wait for a connection to be established. (Optional)
+ // - defaults to 10000ms (10 seconds)
+ timeout: 10000
+};
+```
+Callback:
+
+```javascript
+
+// err: If an error occurs, err will be an Error object, otherwise null.
+// socket: Socket with established connection to your target host.
+// info: If using BIND or associate, this will be the remote endpoint to use.
+
+function(err, socket, info) {
+ // Hopefully no errors :-)
+}
+```
+
+### Socks.createUDPFrame( target, data, [frame] )
+> `Object` **Target host object containing destination for UDP packet**
+
+> `Buffer` **Data Buffer to send in the UDP packet**
+
+> `Number` **Frame number in UDP packet. (defaults to 0)**
+
+Creates a UDP packet frame for using with UDP association relays.
+
+returns `Buffer` The completed UDP packet container to be sent to the proxy for forwarding.
+
+target:
+```javascript
+
+// Target host information for where the UDP packet should be sent.
+var target =
+ {
+ // ipv4, ipv6, or hostname for where to have the proxy send the UDP packet.
+ host: "1.2.3.4",
+
+ // udpport for where to send the UDP packet.
+ port: 2323
+ }
+
+```
+
+### Socks.Agent( options, tls) )
+> `Object` **Object containing options to use when creating this connection (see above in createConnection)**
+
+> `boolean` **Boolean indicating if we upgrade the connection to TLS on the socks server**
+
+
+# Further Reading:
+Please read the SOCKS 5 specifications for more information on how to use BIND and Associate.
+http://www.ietf.org/rfc/rfc1928.txt
+
+# License
+This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License).
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js
new file mode 100644
index 0000000000..82d6afa97b
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/associate.js
@@ -0,0 +1,33 @@
+var Socks = require('../index.js');
+var dgram = require('dgram');
+
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ command: 'associate'
+ },
+
+ target: {
+ host: "0.0.0.0",
+ port: 0
+ }
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ console.log("Connected");
+
+ // Associate request completed.
+ // Now we can send properly formed UDP packet frames to this endpoint for forwarding:
+ console.log(info);
+ // { port: 4381, host: '202.101.228.108' }
+
+ var udp = new dgram.Socket('udp4');
+ var packet = SocksClient.createUDPFrame({ host: "1.2.3.4", port: 5454}, new Buffer("Hello"));
+ udp.send(packet, 0, packet.length, info.port, info.host);
+ }
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js
new file mode 100644
index 0000000000..4410dd1def
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/bind.js
@@ -0,0 +1,30 @@
+var Socks = require('../index.js');
+
+var options = {
+ proxy: {
+ ipaddress: "202.101.228.108",
+ port: 1080,
+ type: 5,
+ command: 'bind'
+ },
+
+ target: {
+ host: "0.0.0.0",
+ port: 0
+ }
+};
+
+Socks.createConnection(options, function(err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ console.log("Connected");
+
+ // BIND request completed, now a tcp client should connect to this endpoint:
+ console.log(info);
+ // { port: 3334, host: '202.101.228.108' }
+
+ // Resume! You need to!
+ socket.resume();
+ }
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js
new file mode 100644
index 0000000000..528ad4d416
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/examples/connect.js
@@ -0,0 +1,31 @@
+var Socks = require('../index.js');
+
+var options = {
+ proxy: {
+ ipaddress: "31.193.133.9",
+ port: 1081,
+ type: 5 // (4 or 5)
+ },
+
+ target: {
+ host: "173.194.33.103", // (google.com)
+ port: 80
+ }
+};
+
+Socks.createConnection(options, function (err, socket, info) {
+ if (err)
+ console.log(err);
+ else {
+ console.log("Connected");
+
+ socket.on('data', function (data) {
+ // do something with incoming data
+ });
+
+ // Please remember that sockets need to be resumed before any data will come in.
+ socket.resume();
+
+ // We can do whatever we want with the socket now.
+ }
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js
new file mode 100644
index 0000000000..29331d4a1c
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/index.js
@@ -0,0 +1,6 @@
+var SocksClient = require('./lib/socks-client.js');
+var SocksAgent = require('./lib/socks-agent.js');
+
+exports.createConnection = SocksClient.createConnection;
+exports.createUDPFrame = SocksClient.createUDPFrame;
+exports.Agent = SocksAgent.Agent;
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js
new file mode 100644
index 0000000000..db1c301ec9
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-agent.js
@@ -0,0 +1,108 @@
+var tls = require('tls');
+var inherits = require('util').inherits;
+var EventEmitter = require('events').EventEmitter;
+var SocksClient = require('./socks-client.js');
+
+function SocksAgent(options, secure, rejectUnauthorized) {
+ this.options = options;
+ this.secure = secure || false;
+ this.rejectUnauthorized = rejectUnauthorized;
+
+ if (this.rejectUnauthorized === undefined) {
+ this.rejectUnauthorized = true;
+ }
+}
+
+inherits(SocksAgent, EventEmitter);
+
+SocksAgent.prototype.createConnection = function(req, opts, fn) {
+ var handler = fn, host, self = this;
+
+ this.options.target = this.options.target || {};
+
+ if (!this.options.target.host) {
+ this.options.target.host = opts.host;
+ }
+
+ if (!this.options.target.port) {
+ this.options.target.port = opts.port;
+ }
+
+ host = this.options.target.host;
+
+ if (this.secure) {
+ handler = function(err, socket, info) {
+ var options, cleartext;
+
+ if (err) {
+ return fn(err);
+ }
+
+ // save encrypted socket
+ self.encryptedSocket = socket;
+
+ options = {
+ socket: socket,
+ servername: host,
+ rejectUnauthorized: self.rejectUnauthorized
+ };
+
+ cleartext = tls.connect(options, function (err) {
+ return fn(err, this);
+ });
+ cleartext.on('error', fn);
+
+ socket.resume();
+ }
+ }
+
+ SocksClient.createConnection(this.options, handler);
+};
+
+/**
+ * @see https://www.npmjs.com/package/agent-base
+ */
+SocksAgent.prototype.addRequest = function(req, host, port, localAddress) {
+ var opts;
+ if ('object' === typeof host) {
+ // >= v0.11.x API
+ opts = host;
+ if (opts.host && opts.path) {
+ // if both a `host` and `path` are specified then it's most likely the
+ // result of a `url.parse()` call... we need to remove the `path` portion so
+ // that `net.connect()` doesn't attempt to open that as a unix socket file.
+ delete opts.path;
+ }
+ } else {
+ // <= v0.10.x API
+ opts = { host: host, port: port };
+ if (null !== localAddress) {
+ opts.localAddress = localAddress;
+ }
+ }
+
+ var sync = true;
+
+ this.createConnection(req, opts, function (err, socket) {
+ function emitErr () {
+ req.emit('error', err);
+ }
+ if (err) {
+ if (sync) {
+ // need to defer the "error" event, when sync, because by now the `req`
+ // instance hasn't event been passed back to the user yet...
+ process.nextTick(emitErr);
+ } else {
+ emitErr();
+ }
+ } else {
+ req.onSocket(socket);
+ //have to resume this socket when node 12
+ socket.resume();
+ }
+ });
+
+ sync = false;
+};
+
+exports.Agent = SocksAgent;
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js
new file mode 100644
index 0000000000..4a31f62c32
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/lib/socks-client.js
@@ -0,0 +1,306 @@
+var net = require('net');
+var ip = require('ip');
+var SmartBuffer = require('smart-buffer');
+
+(function () {
+
+ var COMMAND = {
+ Connect: 0x01,
+ Bind: 0x02,
+ Associate: 0x03
+ };
+
+ var SOCKS4_RESPONSE = {
+ Granted: 0x5A,
+ Failed: 0x5B,
+ Rejected: 0x5C,
+ RejectedIdent: 0x5D
+ };
+
+ var SOCKS5_AUTH = {
+ NoAuth: 0x00,
+ GSSApi: 0x01,
+ UserPass: 0x02
+ };
+
+ var SOCKS5_RESPONSE = {
+ Granted: 0x00,
+ Failure: 0x01,
+ NotAllowed: 0x02,
+ NetworkUnreachable: 0x03,
+ HostUnreachable: 0x04,
+ ConnectionRefused: 0x05,
+ TTLExpired: 0x06,
+ CommandNotSupported: 0x07,
+ AddressNotSupported: 0x08
+ };
+
+
+ exports.createConnection = function (options, callback) {
+ var socket = new net.Socket(), finished = false, buff = new SmartBuffer();
+
+ // Defaults
+ options.timeout = options.timeout || 10000;
+ options.proxy.command = commandFromString(options.proxy.command);
+ options.proxy.userid = options.proxy.userid || "";
+
+ var auth = options.proxy.authentication || {};
+ auth.username = auth.username || "";
+ auth.password = auth.password || "";
+
+ options.proxy.authentication = auth;
+
+ // Connect & negotiation timeout
+ function onTimeout() {
+ finish(new Error("Connection Timed Out"), socket, null, callback);
+ }
+ socket.setTimeout(options.timeout, onTimeout);
+
+ // Socket events
+ socket.once('close', function () {
+ finish(new Error("Socket Closed"), socket, null, callback);
+ });
+
+ socket.once('error', function (err) {
+ });
+
+ socket.once('connect', function () {
+ if (options.proxy.type === 4) {
+ negotiateSocks4(options, socket, callback);
+ } else if (options.proxy.type === 5) {
+ negotiateSocks5(options, socket, callback);
+ } else {
+ throw new Error("Please specify a proxy type in options.proxy.type");
+ }
+ });
+
+ socket.connect(options.proxy.port, options.proxy.ipaddress);
+
+
+ // 4/4a (connect, bind) - Supports domains & ipaddress
+ function negotiateSocks4(options, socket, callback) {
+ buff.writeUInt8(0x04);
+ buff.writeUInt8(options.proxy.command);
+ buff.writeUInt16BE(options.target.port);
+
+ // ipv4 or domain?
+ if (net.isIPv4(options.target.host)) {
+ buff.writeBuffer(ip.toBuffer(options.target.host));
+ buff.writeStringNT(options.proxy.userid);
+ } else {
+ buff.writeUInt8(0x00);
+ buff.writeUInt8(0x00);
+ buff.writeUInt8(0x00);
+ buff.writeUInt8(0x01);
+ buff.writeStringNT(options.proxy.userid);
+ buff.writeStringNT(options.target.host);
+ }
+
+ socket.once('data', receivedResponse);
+ socket.write(buff.toBuffer());
+
+ function receivedResponse(data) {
+ socket.pause();
+ if (data.length === 8 && data[1] === SOCKS4_RESPONSE.Granted) {
+
+ if (options.proxy.command === COMMAND.Bind) {
+ buff.clear();
+ buff.writeBuffer(data);
+ buff.skip(2);
+
+ var info = {
+ port: buff.readUInt16BE(),
+ host: buff.readUInt32BE()
+ };
+
+ if (info.host === 0) {
+ info.host = options.proxy.ipaddress;
+ } else {
+ info.host = ip.fromLong(info.host);
+ }
+
+ finish(null, socket, info, callback);
+ } else {
+ finish(null, socket, null, callback);
+ }
+
+ } else {
+ finish(new Error("Rejected (" + data[1] + ")"), socket, null, callback);
+ }
+ }
+ }
+
+ // Socks 5 (connect, bind, associate) - Supports domains and ipv4, ipv6.
+ function negotiateSocks5(options, socket, callback) {
+ buff.writeUInt8(0x05);
+ buff.writeUInt8(2);
+ buff.writeUInt8(SOCKS5_AUTH.NoAuth);
+ buff.writeUInt8(SOCKS5_AUTH.UserPass);
+
+ socket.once('data', handshake);
+ socket.write(buff.toBuffer());
+
+ function handshake(data) {
+ if (data.length !== 2) {
+ finish(new Error("Negotiation Error"), socket, null, callback);
+ } else if (data[0] !== 0x05) {
+ finish(new Error("Negotiation Error (invalid version)"), socket, null, callback);
+ } else if (data[1] === 0xFF) {
+ finish(new Error("Negotiation Error (unacceptable authentication)"), socket, null, callback);
+ } else {
+ if (data[1] === SOCKS5_AUTH.NoAuth) {
+ sendRequest();
+ } else if (data[1] === SOCKS5_AUTH.UserPass) {
+ sendAuthentication(options.proxy.authentication);
+ } else {
+ finish(new Error("Negotiation Error (unknown authentication type)"), socket, null, callback);
+ }
+ }
+ }
+
+ function sendAuthentication(authinfo) {
+ buff.clear();
+ buff.writeUInt8(0x01);
+ buff.writeUInt8(Buffer.byteLength(authinfo.username));
+ buff.writeString(authinfo.username);
+ buff.writeUInt8(Buffer.byteLength(authinfo.password));
+ buff.writeString(authinfo.password);
+
+ socket.once('data', authenticationResponse);
+ socket.write(buff.toBuffer());
+
+ function authenticationResponse(data) {
+ if (data.length === 2 && data[1] === 0x00) {
+ sendRequest();
+ } else {
+ finish(new Error("Negotiation Error (authentication failed)"), socket, null, callback);
+ }
+ }
+ }
+
+ function sendRequest() {
+ buff.clear();
+ buff.writeUInt8(0x05);
+ buff.writeUInt8(options.proxy.command);
+ buff.writeUInt8(0x00);
+
+ // ipv4, ipv6, domain?
+ if (net.isIPv4(options.target.host)) {
+ buff.writeUInt8(0x01);
+ buff.writeBuffer(ip.toBuffer(options.target.host));
+ } else if (net.isIPv6(options.target.host)) {
+ buff.writeUInt8(0x04);
+ buff.writeBuffer(ip.toBuffer(options.target.host));
+ } else {
+ buff.writeUInt8(0x03);
+ buff.writeUInt8(options.target.host.length);
+ buff.writeString(options.target.host);
+ }
+ buff.writeUInt16BE(options.target.port);
+
+ socket.once('data', receivedResponse);
+ socket.write(buff.toBuffer());
+ }
+
+ function receivedResponse(data) {
+ socket.pause();
+ if (data.length < 4) {
+ finish(new Error("Negotiation Error"), socket, null, callback);
+ } else if (data[0] === 0x05 && data[1] === SOCKS5_RESPONSE.Granted) {
+ if (options.proxy.command === COMMAND.Connect) {
+ finish(null, socket, null, callback);
+ } else if (options.proxy.command === COMMAND.Bind || options.proxy.command === COMMAND.Associate) {
+ buff.clear();
+ buff.writeBuffer(data);
+ buff.skip(3);
+
+ var info = {};
+ var addrtype = buff.readUInt8();
+
+ try {
+
+ if (addrtype === 0x01) {
+ info.host = buff.readUInt32BE();
+ if (info.host === 0)
+ info.host = options.proxy.ipaddress;
+ else
+ info.host = ip.fromLong(info.host);
+ } else if (addrtype === 0x03) {
+ var len = buff.readUInt8();
+ info.host = buff.readString(len);
+ } else if (addrtype === 0x04) {
+ info.host = buff.readBuffer(16);
+ } else {
+ finish(new Error("Negotiation Error (invalid host address)"), socket, null, callback);
+ }
+ info.port = buff.readUInt16BE();
+
+ finish(null, socket, info, callback);
+ } catch (ex) {
+ finish(new Error("Negotiation Error (missing data)"), socket, null, callback);
+ }
+ }
+ } else {
+ finish(new Error("Negotiation Error (" + data[1] + ")"), socket, null, callback);
+ }
+ }
+ }
+
+ function finish(err, socket, info, callback) {
+ socket.setTimeout(0, onTimeout);
+ if (!finished) {
+ finished = true;
+
+ if (buff instanceof SmartBuffer)
+ buff.destroy();
+
+ if (err && socket instanceof net.Socket) {
+ socket.removeAllListeners('close');
+ socket.removeAllListeners('timeout');
+ socket.removeAllListeners('data');
+ socket.destroy();
+ socket = null;
+ }
+
+ callback(err, socket, info);
+ }
+ }
+
+ function commandFromString(str) {
+ var result = COMMAND.Connect;
+
+ if (str === "connect") {
+ result = COMMAND.Connect;
+ } else if (str === 'associate') {
+ result = COMMAND.Associate;
+ } else if (str === 'bind') {
+ result = COMMAND.Bind;
+ }
+
+ return result;
+ }
+ };
+
+
+ exports.createUDPFrame = function (target, data, frame) {
+ var buff = new SmartBuffer();
+ buff.writeUInt16BE(0);
+ buff.writeUInt8(frame || 0x00);
+
+ if (net.isIPv4(target.host)) {
+ buff.writeUInt8(0x01);
+ buff.writeUInt32BE(ip.toLong(target.host));
+ } else if (net.isIPv6(target.host)) {
+ buff.writeUInt8(0x04);
+ buff.writeBuffer(ip.toBuffer(target.host));
+ } else {
+ buff.writeUInt8(0x03);
+ buff.writeUInt8(Buffer.byteLength(target.host));
+ buff.writeString(target.host);
+ }
+
+ buff.writeUInt16BE(target.port);
+ buff.writeBuffer(data);
+ return buff.toBuffer();
+ };
+})();
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc
new file mode 100644
index 0000000000..dbaae20574
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.jscsrc
@@ -0,0 +1,46 @@
+{
+ "disallowKeywordsOnNewLine": [ "else" ],
+ "disallowMixedSpacesAndTabs": true,
+ "disallowMultipleLineStrings": true,
+ "disallowMultipleVarDecl": true,
+ "disallowNewlineBeforeBlockStatements": true,
+ "disallowQuotedKeysInObjects": true,
+ "disallowSpaceAfterObjectKeys": true,
+ "disallowSpaceAfterPrefixUnaryOperators": true,
+ "disallowSpaceBeforePostfixUnaryOperators": true,
+ "disallowSpacesInCallExpression": true,
+ "disallowTrailingComma": true,
+ "disallowTrailingWhitespace": true,
+ "disallowYodaConditions": true,
+
+ "requireCommaBeforeLineBreak": true,
+ "requireOperatorBeforeLineBreak": true,
+ "requireSpaceAfterBinaryOperators": true,
+ "requireSpaceAfterKeywords": [ "if", "for", "while", "else", "try", "catch" ],
+ "requireSpaceAfterLineComment": true,
+ "requireSpaceBeforeBinaryOperators": true,
+ "requireSpaceBeforeBlockStatements": true,
+ "requireSpaceBeforeKeywords": [ "else", "catch" ],
+ "requireSpaceBeforeObjectValues": true,
+ "requireSpaceBetweenArguments": true,
+ "requireSpacesInAnonymousFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireSpacesInFunctionDeclaration": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireSpacesInFunctionExpression": {
+ "beforeOpeningCurlyBrace": true
+ },
+ "requireSpacesInConditionalExpression": true,
+ "requireSpacesInForStatement": true,
+ "requireSpacesInsideArrayBrackets": "all",
+ "requireSpacesInsideObjectBrackets": "all",
+ "requireDotNotation": true,
+
+ "maximumLineLength": 80,
+ "validateIndentation": 2,
+ "validateLineBreaks": "LF",
+ "validateParameterSeparator": ", ",
+ "validateQuoteMarks": "'"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore
new file mode 100644
index 0000000000..1ca957177f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.npmignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml
new file mode 100644
index 0000000000..a3a8fad6b6
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/.travis.yml
@@ -0,0 +1,15 @@
+sudo: false
+language: node_js
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.12"
+ - "4"
+ - "6"
+
+before_install:
+ - travis_retry npm install -g npm@2.14.5
+ - travis_retry npm install
+
+script:
+ - npm test
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md
new file mode 100644
index 0000000000..9035fd71b1
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/README.md
@@ -0,0 +1,90 @@
+# IP
+[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip)
+
+IP address utilities for node.js
+
+## Installation
+
+### npm
+```shell
+npm install ip
+```
+
+### git
+
+```shell
+git clone https://github.com/indutny/node-ip.git
+```
+
+## Usage
+Get your ip address, compare ip addresses, validate ip addresses, etc.
+
+```js
+var ip = require('ip');
+
+ip.address() // my ip address
+ip.isEqual('::1', '::0:1'); // true
+ip.toBuffer('127.0.0.1') // Buffer([127, 0, 0, 1])
+ip.toString(new Buffer([127, 0, 0, 1])) // 127.0.0.1
+ip.fromPrefixLen(24) // 255.255.255.0
+ip.mask('192.168.1.134', '255.255.255.0') // 192.168.1.0
+ip.cidr('192.168.1.134/26') // 192.168.1.128
+ip.not('255.255.255.0') // 0.0.0.255
+ip.or('192.168.1.134', '0.0.0.255') // 192.168.1.255
+ip.isPrivate('127.0.0.1') // true
+ip.isV4Format('127.0.0.1'); // true
+ip.isV6Format('::ffff:127.0.0.1'); // true
+
+// operate on buffers in-place
+var buf = new Buffer(128);
+var offset = 64;
+ip.toBuffer('127.0.0.1', buf, offset); // [127, 0, 0, 1] at offset 64
+ip.toString(buf, offset, 4); // '127.0.0.1'
+
+// subnet information
+ip.subnet('192.168.1.134', '255.255.255.192')
+// { networkAddress: '192.168.1.128',
+// firstAddress: '192.168.1.129',
+// lastAddress: '192.168.1.190',
+// broadcastAddress: '192.168.1.191',
+// subnetMask: '255.255.255.192',
+// subnetMaskLength: 26,
+// numHosts: 62,
+// length: 64,
+// contains: function(addr){...} }
+ip.cidrSubnet('192.168.1.134/26')
+// Same as previous.
+
+// range checking
+ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.190') // true
+
+
+// ipv4 long conversion
+ip.toLong('127.0.0.1'); // 2130706433
+ip.fromLong(2130706433); // '127.0.0.1'
+```
+
+### License
+
+This software is licensed under the MIT License.
+
+Copyright Fedor Indutny, 2012.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js
new file mode 100644
index 0000000000..c1799a8c50
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/lib/ip.js
@@ -0,0 +1,416 @@
+'use strict';
+
+var ip = exports;
+var Buffer = require('buffer').Buffer;
+var os = require('os');
+
+ip.toBuffer = function(ip, buff, offset) {
+ offset = ~~offset;
+
+ var result;
+
+ if (this.isV4Format(ip)) {
+ result = buff || new Buffer(offset + 4);
+ ip.split(/\./g).map(function(byte) {
+ result[offset++] = parseInt(byte, 10) & 0xff;
+ });
+ } else if (this.isV6Format(ip)) {
+ var sections = ip.split(':', 8);
+
+ var i;
+ for (i = 0; i < sections.length; i++) {
+ var isv4 = this.isV4Format(sections[i]);
+ var v4Buffer;
+
+ if (isv4) {
+ v4Buffer = this.toBuffer(sections[i]);
+ sections[i] = v4Buffer.slice(0, 2).toString('hex');
+ }
+
+ if (v4Buffer && ++i < 8) {
+ sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex'));
+ }
+ }
+
+ if (sections[0] === '') {
+ while (sections.length < 8) sections.unshift('0');
+ } else if (sections[sections.length - 1] === '') {
+ while (sections.length < 8) sections.push('0');
+ } else if (sections.length < 8) {
+ for (i = 0; i < sections.length && sections[i] !== ''; i++);
+ var argv = [ i, 1 ];
+ for (i = 9 - sections.length; i > 0; i--) {
+ argv.push('0');
+ }
+ sections.splice.apply(sections, argv);
+ }
+
+ result = buff || new Buffer(offset + 16);
+ for (i = 0; i < sections.length; i++) {
+ var word = parseInt(sections[i], 16);
+ result[offset++] = (word >> 8) & 0xff;
+ result[offset++] = word & 0xff;
+ }
+ }
+
+ if (!result) {
+ throw Error('Invalid ip address: ' + ip);
+ }
+
+ return result;
+};
+
+ip.toString = function(buff, offset, length) {
+ offset = ~~offset;
+ length = length || (buff.length - offset);
+
+ var result = [];
+ if (length === 4) {
+ // IPv4
+ for (var i = 0; i < length; i++) {
+ result.push(buff[offset + i]);
+ }
+ result = result.join('.');
+ } else if (length === 16) {
+ // IPv6
+ for (var i = 0; i < length; i += 2) {
+ result.push(buff.readUInt16BE(offset + i).toString(16));
+ }
+ result = result.join(':');
+ result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3');
+ result = result.replace(/:{3,4}/, '::');
+ }
+
+ return result;
+};
+
+var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/;
+var ipv6Regex =
+ /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;
+
+ip.isV4Format = function(ip) {
+ return ipv4Regex.test(ip);
+};
+
+ip.isV6Format = function(ip) {
+ return ipv6Regex.test(ip);
+};
+function _normalizeFamily(family) {
+ return family ? family.toLowerCase() : 'ipv4';
+}
+
+ip.fromPrefixLen = function(prefixlen, family) {
+ if (prefixlen > 32) {
+ family = 'ipv6';
+ } else {
+ family = _normalizeFamily(family);
+ }
+
+ var len = 4;
+ if (family === 'ipv6') {
+ len = 16;
+ }
+ var buff = new Buffer(len);
+
+ for (var i = 0, n = buff.length; i < n; ++i) {
+ var bits = 8;
+ if (prefixlen < 8) {
+ bits = prefixlen;
+ }
+ prefixlen -= bits;
+
+ buff[i] = ~(0xff >> bits) & 0xff;
+ }
+
+ return ip.toString(buff);
+};
+
+ip.mask = function(addr, mask) {
+ addr = ip.toBuffer(addr);
+ mask = ip.toBuffer(mask);
+
+ var result = new Buffer(Math.max(addr.length, mask.length));
+
+ var i = 0;
+ // Same protocol - do bitwise and
+ if (addr.length === mask.length) {
+ for (i = 0; i < addr.length; i++) {
+ result[i] = addr[i] & mask[i];
+ }
+ } else if (mask.length === 4) {
+ // IPv6 address and IPv4 mask
+ // (Mask low bits)
+ for (i = 0; i < mask.length; i++) {
+ result[i] = addr[addr.length - 4 + i] & mask[i];
+ }
+ } else {
+ // IPv6 mask and IPv4 addr
+ for (var i = 0; i < result.length - 6; i++) {
+ result[i] = 0;
+ }
+
+ // ::ffff:ipv4
+ result[10] = 0xff;
+ result[11] = 0xff;
+ for (i = 0; i < addr.length; i++) {
+ result[i + 12] = addr[i] & mask[i + 12];
+ }
+ i = i + 12;
+ }
+ for (; i < result.length; i++)
+ result[i] = 0;
+
+ return ip.toString(result);
+};
+
+ip.cidr = function(cidrString) {
+ var cidrParts = cidrString.split('/');
+
+ var addr = cidrParts[0];
+ if (cidrParts.length !== 2)
+ throw new Error('invalid CIDR subnet: ' + addr);
+
+ var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
+
+ return ip.mask(addr, mask);
+};
+
+ip.subnet = function(addr, mask) {
+ var networkAddress = ip.toLong(ip.mask(addr, mask));
+
+ // Calculate the mask's length.
+ var maskBuffer = ip.toBuffer(mask);
+ var maskLength = 0;
+
+ for (var i = 0; i < maskBuffer.length; i++) {
+ if (maskBuffer[i] === 0xff) {
+ maskLength += 8;
+ } else {
+ var octet = maskBuffer[i] & 0xff;
+ while (octet) {
+ octet = (octet << 1) & 0xff;
+ maskLength++;
+ }
+ }
+ }
+
+ var numberOfAddresses = Math.pow(2, 32 - maskLength);
+
+ return {
+ networkAddress: ip.fromLong(networkAddress),
+ firstAddress: numberOfAddresses <= 2 ?
+ ip.fromLong(networkAddress) :
+ ip.fromLong(networkAddress + 1),
+ lastAddress: numberOfAddresses <= 2 ?
+ ip.fromLong(networkAddress + numberOfAddresses - 1) :
+ ip.fromLong(networkAddress + numberOfAddresses - 2),
+ broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1),
+ subnetMask: mask,
+ subnetMaskLength: maskLength,
+ numHosts: numberOfAddresses <= 2 ?
+ numberOfAddresses : numberOfAddresses - 2,
+ length: numberOfAddresses,
+ contains: function(other) {
+ return networkAddress === ip.toLong(ip.mask(other, mask));
+ }
+ };
+};
+
+ip.cidrSubnet = function(cidrString) {
+ var cidrParts = cidrString.split('/');
+
+ var addr = cidrParts[0];
+ if (cidrParts.length !== 2)
+ throw new Error('invalid CIDR subnet: ' + addr);
+
+ var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));
+
+ return ip.subnet(addr, mask);
+};
+
+ip.not = function(addr) {
+ var buff = ip.toBuffer(addr);
+ for (var i = 0; i < buff.length; i++) {
+ buff[i] = 0xff ^ buff[i];
+ }
+ return ip.toString(buff);
+};
+
+ip.or = function(a, b) {
+ a = ip.toBuffer(a);
+ b = ip.toBuffer(b);
+
+ // same protocol
+ if (a.length === b.length) {
+ for (var i = 0; i < a.length; ++i) {
+ a[i] |= b[i];
+ }
+ return ip.toString(a);
+
+ // mixed protocols
+ } else {
+ var buff = a;
+ var other = b;
+ if (b.length > a.length) {
+ buff = b;
+ other = a;
+ }
+
+ var offset = buff.length - other.length;
+ for (var i = offset; i < buff.length; ++i) {
+ buff[i] |= other[i - offset];
+ }
+
+ return ip.toString(buff);
+ }
+};
+
+ip.isEqual = function(a, b) {
+ a = ip.toBuffer(a);
+ b = ip.toBuffer(b);
+
+ // Same protocol
+ if (a.length === b.length) {
+ for (var i = 0; i < a.length; i++) {
+ if (a[i] !== b[i]) return false;
+ }
+ return true;
+ }
+
+ // Swap
+ if (b.length === 4) {
+ var t = b;
+ b = a;
+ a = t;
+ }
+
+ // a - IPv4, b - IPv6
+ for (var i = 0; i < 10; i++) {
+ if (b[i] !== 0) return false;
+ }
+
+ var word = b.readUInt16BE(10);
+ if (word !== 0 && word !== 0xffff) return false;
+
+ for (var i = 0; i < 4; i++) {
+ if (a[i] !== b[i + 12]) return false;
+ }
+
+ return true;
+};
+
+ip.isPrivate = function(addr) {
+ return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i
+ .test(addr) ||
+ /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) ||
+ /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i
+ .test(addr) ||
+ /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) ||
+ /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) ||
+ /^f[cd][0-9a-f]{2}:/i.test(addr) ||
+ /^fe80:/i.test(addr) ||
+ /^::1$/.test(addr) ||
+ /^::$/.test(addr);
+};
+
+ip.isPublic = function(addr) {
+ return !ip.isPrivate(addr);
+};
+
+ip.isLoopback = function(addr) {
+ return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/
+ .test(addr) ||
+ /^fe80::1$/.test(addr) ||
+ /^::1$/.test(addr) ||
+ /^::$/.test(addr);
+};
+
+ip.loopback = function(family) {
+ //
+ // Default to `ipv4`
+ //
+ family = _normalizeFamily(family);
+
+ if (family !== 'ipv4' && family !== 'ipv6') {
+ throw new Error('family must be ipv4 or ipv6');
+ }
+
+ return family === 'ipv4' ? '127.0.0.1' : 'fe80::1';
+};
+
+//
+// ### function address (name, family)
+// #### @name {string|'public'|'private'} **Optional** Name or security
+// of the network interface.
+// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults
+// to ipv4).
+//
+// Returns the address for the network interface on the current system with
+// the specified `name`:
+// * String: First `family` address of the interface.
+// If not found see `undefined`.
+// * 'public': the first public ip address of family.
+// * 'private': the first private ip address of family.
+// * undefined: First address with `ipv4` or loopback address `127.0.0.1`.
+//
+ip.address = function(name, family) {
+ var interfaces = os.networkInterfaces();
+ var all;
+
+ //
+ // Default to `ipv4`
+ //
+ family = _normalizeFamily(family);
+
+ //
+ // If a specific network interface has been named,
+ // return the address.
+ //
+ if (name && name !== 'private' && name !== 'public') {
+ var res = interfaces[name].filter(function(details) {
+ var itemFamily = details.family.toLowerCase();
+ return itemFamily === family;
+ });
+ if (res.length === 0)
+ return undefined;
+ return res[0].address;
+ }
+
+ var all = Object.keys(interfaces).map(function (nic) {
+ //
+ // Note: name will only be `public` or `private`
+ // when this is called.
+ //
+ var addresses = interfaces[nic].filter(function (details) {
+ details.family = details.family.toLowerCase();
+ if (details.family !== family || ip.isLoopback(details.address)) {
+ return false;
+ } else if (!name) {
+ return true;
+ }
+
+ return name === 'public' ? ip.isPrivate(details.address) :
+ ip.isPublic(details.address);
+ });
+
+ return addresses.length ? addresses[0].address : undefined;
+ }).filter(Boolean);
+
+ return !all.length ? ip.loopback(family) : all[0];
+};
+
+ip.toLong = function(ip) {
+ var ipl = 0;
+ ip.split('.').forEach(function(octet) {
+ ipl <<= 8;
+ ipl += parseInt(octet);
+ });
+ return(ipl >>> 0);
+};
+
+ip.fromLong = function(ipl) {
+ return ((ipl >>> 24) + '.' +
+ (ipl >> 16 & 255) + '.' +
+ (ipl >> 8 & 255) + '.' +
+ (ipl & 255) );
+};
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json
new file mode 100644
index 0000000000..851da5fadc
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/package.json
@@ -0,0 +1,57 @@
+{
+ "_from": "ip@^1.1.4",
+ "_id": "ip@1.1.5",
+ "_integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/socks/ip",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "ip@^1.1.4",
+ "name": "ip",
+ "escapedName": "ip",
+ "rawSpec": "^1.1.4",
+ "saveSpec": null,
+ "fetchSpec": "^1.1.4"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent/socks"
+ ],
+ "_resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
+ "_shasum": "bdded70114290828c0a039e72ef25f5aaec4354a",
+ "_shrinkwrap": null,
+ "_spec": "ip@^1.1.4",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks",
+ "author": {
+ "name": "Fedor Indutny",
+ "email": "fedor@indutny.com"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/indutny/node-ip/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip)",
+ "devDependencies": {
+ "jscs": "^2.1.1",
+ "jshint": "^2.8.0",
+ "mocha": "~1.3.2"
+ },
+ "homepage": "https://github.com/indutny/node-ip",
+ "license": "MIT",
+ "main": "lib/ip",
+ "name": "ip",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/indutny/node-ip.git"
+ },
+ "scripts": {
+ "fix": "jscs lib/*.js test/*.js --fix",
+ "test": "jscs lib/*.js test/*.js && jshint lib/*.js && mocha --reporter spec test/*-test.js"
+ },
+ "version": "1.1.5"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js
new file mode 100644
index 0000000000..2e390f986d
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/ip/test/api-test.js
@@ -0,0 +1,407 @@
+'use strict';
+
+var ip = require('..');
+var assert = require('assert');
+var net = require('net');
+var os = require('os');
+
+describe('IP library for node.js', function() {
+ describe('toBuffer()/toString() methods', function() {
+ it('should convert to buffer IPv4 address', function() {
+ var buf = ip.toBuffer('127.0.0.1');
+ assert.equal(buf.toString('hex'), '7f000001');
+ assert.equal(ip.toString(buf), '127.0.0.1');
+ });
+
+ it('should convert to buffer IPv4 address in-place', function() {
+ var buf = new Buffer(128);
+ var offset = 64;
+ ip.toBuffer('127.0.0.1', buf, offset);
+ assert.equal(buf.toString('hex', offset, offset + 4), '7f000001');
+ assert.equal(ip.toString(buf, offset, 4), '127.0.0.1');
+ });
+
+ it('should convert to buffer IPv6 address', function() {
+ var buf = ip.toBuffer('::1');
+ assert(/(00){15,15}01/.test(buf.toString('hex')));
+ assert.equal(ip.toString(buf), '::1');
+ assert.equal(ip.toString(ip.toBuffer('1::')), '1::');
+ assert.equal(ip.toString(ip.toBuffer('abcd::dcba')), 'abcd::dcba');
+ });
+
+ it('should convert to buffer IPv6 address in-place', function() {
+ var buf = new Buffer(128);
+ var offset = 64;
+ ip.toBuffer('::1', buf, offset);
+ assert(/(00){15,15}01/.test(buf.toString('hex', offset, offset + 16)));
+ assert.equal(ip.toString(buf, offset, 16), '::1');
+ assert.equal(ip.toString(ip.toBuffer('1::', buf, offset),
+ offset, 16), '1::');
+ assert.equal(ip.toString(ip.toBuffer('abcd::dcba', buf, offset),
+ offset, 16), 'abcd::dcba');
+ });
+
+ it('should convert to buffer IPv6 mapped IPv4 address', function() {
+ var buf = ip.toBuffer('::ffff:127.0.0.1');
+ assert.equal(buf.toString('hex'), '00000000000000000000ffff7f000001');
+ assert.equal(ip.toString(buf), '::ffff:7f00:1');
+
+ buf = ip.toBuffer('ffff::127.0.0.1');
+ assert.equal(buf.toString('hex'), 'ffff000000000000000000007f000001');
+ assert.equal(ip.toString(buf), 'ffff::7f00:1');
+
+ buf = ip.toBuffer('0:0:0:0:0:ffff:127.0.0.1');
+ assert.equal(buf.toString('hex'), '00000000000000000000ffff7f000001');
+ assert.equal(ip.toString(buf), '::ffff:7f00:1');
+ });
+ });
+
+ describe('fromPrefixLen() method', function() {
+ it('should create IPv4 mask', function() {
+ assert.equal(ip.fromPrefixLen(24), '255.255.255.0');
+ });
+ it('should create IPv6 mask', function() {
+ assert.equal(ip.fromPrefixLen(64), 'ffff:ffff:ffff:ffff::');
+ });
+ it('should create IPv6 mask explicitly', function() {
+ assert.equal(ip.fromPrefixLen(24, 'IPV6'), 'ffff:ff00::');
+ });
+ });
+
+ describe('not() method', function() {
+ it('should reverse bits in address', function() {
+ assert.equal(ip.not('255.255.255.0'), '0.0.0.255');
+ });
+ });
+
+ describe('or() method', function() {
+ it('should or bits in ipv4 addresses', function() {
+ assert.equal(ip.or('0.0.0.255', '192.168.1.10'), '192.168.1.255');
+ });
+ it('should or bits in ipv6 addresses', function() {
+ assert.equal(ip.or('::ff', '::abcd:dcba:abcd:dcba'),
+ '::abcd:dcba:abcd:dcff');
+ });
+ it('should or bits in mixed addresses', function() {
+ assert.equal(ip.or('0.0.0.255', '::abcd:dcba:abcd:dcba'),
+ '::abcd:dcba:abcd:dcff');
+ });
+ });
+
+ describe('mask() method', function() {
+ it('should mask bits in address', function() {
+ assert.equal(ip.mask('192.168.1.134', '255.255.255.0'), '192.168.1.0');
+ assert.equal(ip.mask('192.168.1.134', '::ffff:ff00'), '::ffff:c0a8:100');
+ });
+
+ it('should not leak data', function() {
+ for (var i = 0; i < 10; i++)
+ assert.equal(ip.mask('::1', '0.0.0.0'), '::');
+ });
+ });
+
+ describe('subnet() method', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.192');
+
+ it('should compute ipv4 network address', function() {
+ assert.equal(ipv4Subnet.networkAddress, '192.168.1.128');
+ });
+
+ it('should compute ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.129');
+ });
+
+ it('should compute ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.190');
+ });
+
+ it('should compute ipv4 broadcast address', function() {
+ assert.equal(ipv4Subnet.broadcastAddress, '192.168.1.191');
+ });
+
+ it('should compute ipv4 subnet number of addresses', function() {
+ assert.equal(ipv4Subnet.length, 64);
+ });
+
+ it('should compute ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 62);
+ });
+
+ it('should compute ipv4 subnet mask', function() {
+ assert.equal(ipv4Subnet.subnetMask, '255.255.255.192');
+ });
+
+ it('should compute ipv4 subnet mask\'s length', function() {
+ assert.equal(ipv4Subnet.subnetMaskLength, 26);
+ });
+
+ it('should know whether a subnet contains an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.180'), true);
+ });
+
+ it('should know whether a subnet does not contain an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.195'), false);
+ });
+ });
+
+ describe('subnet() method with mask length 32', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.255');
+ it('should compute ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.134');
+ });
+
+ it('should compute ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.134');
+ });
+
+ it('should compute ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 1);
+ });
+ });
+
+ describe('subnet() method with mask length 31', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.subnet('192.168.1.134', '255.255.255.254');
+ it('should compute ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.134');
+ });
+
+ it('should compute ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.135');
+ });
+
+ it('should compute ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 2);
+ });
+ });
+
+ describe('cidrSubnet() method', function() {
+ // Test cases calculated with http://www.subnet-calculator.com/
+ var ipv4Subnet = ip.cidrSubnet('192.168.1.134/26');
+
+ it('should compute an ipv4 network address', function() {
+ assert.equal(ipv4Subnet.networkAddress, '192.168.1.128');
+ });
+
+ it('should compute an ipv4 network\'s first address', function() {
+ assert.equal(ipv4Subnet.firstAddress, '192.168.1.129');
+ });
+
+ it('should compute an ipv4 network\'s last address', function() {
+ assert.equal(ipv4Subnet.lastAddress, '192.168.1.190');
+ });
+
+ it('should compute an ipv4 broadcast address', function() {
+ assert.equal(ipv4Subnet.broadcastAddress, '192.168.1.191');
+ });
+
+ it('should compute an ipv4 subnet number of addresses', function() {
+ assert.equal(ipv4Subnet.length, 64);
+ });
+
+ it('should compute an ipv4 subnet number of addressable hosts', function() {
+ assert.equal(ipv4Subnet.numHosts, 62);
+ });
+
+ it('should compute an ipv4 subnet mask', function() {
+ assert.equal(ipv4Subnet.subnetMask, '255.255.255.192');
+ });
+
+ it('should compute an ipv4 subnet mask\'s length', function() {
+ assert.equal(ipv4Subnet.subnetMaskLength, 26);
+ });
+
+ it('should know whether a subnet contains an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.180'), true);
+ });
+
+ it('should know whether a subnet contains an address', function() {
+ assert.equal(ipv4Subnet.contains('192.168.1.195'), false);
+ });
+
+ });
+
+ describe('cidr() method', function() {
+ it('should mask address in CIDR notation', function() {
+ assert.equal(ip.cidr('192.168.1.134/26'), '192.168.1.128');
+ assert.equal(ip.cidr('2607:f0d0:1002:51::4/56'), '2607:f0d0:1002::');
+ });
+ });
+
+ describe('isEqual() method', function() {
+ it('should check if addresses are equal', function() {
+ assert(ip.isEqual('127.0.0.1', '::7f00:1'));
+ assert(!ip.isEqual('127.0.0.1', '::7f00:2'));
+ assert(ip.isEqual('127.0.0.1', '::ffff:7f00:1'));
+ assert(!ip.isEqual('127.0.0.1', '::ffaf:7f00:1'));
+ assert(ip.isEqual('::ffff:127.0.0.1', '::ffff:127.0.0.1'));
+ assert(ip.isEqual('::ffff:127.0.0.1', '127.0.0.1'));
+ });
+ });
+
+
+ describe('isPrivate() method', function() {
+ it('should check if an address is localhost', function() {
+ assert.equal(ip.isPrivate('127.0.0.1'), true);
+ });
+
+ it('should check if an address is from a 192.168.x.x network', function() {
+ assert.equal(ip.isPrivate('192.168.0.123'), true);
+ assert.equal(ip.isPrivate('192.168.122.123'), true);
+ assert.equal(ip.isPrivate('192.162.1.2'), false);
+ });
+
+ it('should check if an address is from a 172.16.x.x network', function() {
+ assert.equal(ip.isPrivate('172.16.0.5'), true);
+ assert.equal(ip.isPrivate('172.16.123.254'), true);
+ assert.equal(ip.isPrivate('171.16.0.5'), false);
+ assert.equal(ip.isPrivate('172.25.232.15'), true);
+ assert.equal(ip.isPrivate('172.15.0.5'), false);
+ assert.equal(ip.isPrivate('172.32.0.5'), false);
+ });
+
+ it('should check if an address is from a 169.254.x.x network', function() {
+ assert.equal(ip.isPrivate('169.254.2.3'), true);
+ assert.equal(ip.isPrivate('169.254.221.9'), true);
+ assert.equal(ip.isPrivate('168.254.2.3'), false);
+ });
+
+ it('should check if an address is from a 10.x.x.x network', function() {
+ assert.equal(ip.isPrivate('10.0.2.3'), true);
+ assert.equal(ip.isPrivate('10.1.23.45'), true);
+ assert.equal(ip.isPrivate('12.1.2.3'), false);
+ });
+
+ it('should check if an address is from a private IPv6 network', function() {
+ assert.equal(ip.isPrivate('fd12:3456:789a:1::1'), true);
+ assert.equal(ip.isPrivate('fe80::f2de:f1ff:fe3f:307e'), true);
+ assert.equal(ip.isPrivate('::ffff:10.100.1.42'), true);
+ assert.equal(ip.isPrivate('::FFFF:172.16.200.1'), true);
+ assert.equal(ip.isPrivate('::ffff:192.168.0.1'), true);
+ });
+
+ it('should check if an address is from the internet', function() {
+ assert.equal(ip.isPrivate('165.225.132.33'), false); // joyent.com
+ });
+
+ it('should check if an address is a loopback IPv6 address', function() {
+ assert.equal(ip.isPrivate('::'), true);
+ assert.equal(ip.isPrivate('::1'), true);
+ assert.equal(ip.isPrivate('fe80::1'), true);
+ });
+ });
+
+ describe('loopback() method', function() {
+ describe('undefined', function() {
+ it('should respond with 127.0.0.1', function() {
+ assert.equal(ip.loopback(), '127.0.0.1')
+ });
+ });
+
+ describe('ipv4', function() {
+ it('should respond with 127.0.0.1', function() {
+ assert.equal(ip.loopback('ipv4'), '127.0.0.1')
+ });
+ });
+
+ describe('ipv6', function() {
+ it('should respond with fe80::1', function() {
+ assert.equal(ip.loopback('ipv6'), 'fe80::1')
+ });
+ });
+ });
+
+ describe('isLoopback() method', function() {
+ describe('127.0.0.1', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('127.0.0.1'))
+ });
+ });
+
+ describe('127.8.8.8', function () {
+ it('should respond with true', function () {
+ assert.ok(ip.isLoopback('127.8.8.8'))
+ });
+ });
+
+ describe('8.8.8.8', function () {
+ it('should respond with false', function () {
+ assert.equal(ip.isLoopback('8.8.8.8'), false);
+ });
+ });
+
+ describe('fe80::1', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('fe80::1'))
+ });
+ });
+
+ describe('::1', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('::1'))
+ });
+ });
+
+ describe('::', function() {
+ it('should respond with true', function() {
+ assert.ok(ip.isLoopback('::'))
+ });
+ });
+ });
+
+ describe('address() method', function() {
+ describe('undefined', function() {
+ it('should respond with a private ip', function() {
+ assert.ok(ip.isPrivate(ip.address()));
+ });
+ });
+
+ describe('private', function() {
+ [ undefined, 'ipv4', 'ipv6' ].forEach(function(family) {
+ describe(family, function() {
+ it('should respond with a private ip', function() {
+ assert.ok(ip.isPrivate(ip.address('private', family)));
+ });
+ });
+ });
+ });
+
+ var interfaces = os.networkInterfaces();
+
+ Object.keys(interfaces).forEach(function(nic) {
+ describe(nic, function() {
+ [ undefined, 'ipv4' ].forEach(function(family) {
+ describe(family, function() {
+ it('should respond with an ipv4 address', function() {
+ var addr = ip.address(nic, family);
+ assert.ok(!addr || net.isIPv4(addr));
+ });
+ });
+ });
+
+ describe('ipv6', function() {
+ it('should respond with an ipv6 address', function() {
+ var addr = ip.address(nic, 'ipv6');
+ assert.ok(!addr || net.isIPv6(addr));
+ });
+ })
+ });
+ });
+ });
+
+ describe('toLong() method', function() {
+ it('should respond with a int', function() {
+ assert.equal(ip.toLong('127.0.0.1'), 2130706433);
+ assert.equal(ip.toLong('255.255.255.255'), 4294967295);
+ });
+ });
+
+ describe('fromLong() method', function() {
+ it('should repond with ipv4 address', function() {
+ assert.equal(ip.fromLong(2130706433), '127.0.0.1');
+ assert.equal(ip.fromLong(4294967295), '255.255.255.255');
+ });
+ })
+});
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore
new file mode 100644
index 0000000000..6bcbf6f77d
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.npmignore
@@ -0,0 +1,5 @@
+.git*
+.idea*
+node_modules/
+npm-debug.log
+coverage \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml
new file mode 100644
index 0000000000..9d67de5878
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/.travis.yml
@@ -0,0 +1,11 @@
+language: node_js
+node_js:
+ - 0.10
+ - 0.12
+ - 4
+ - 6
+ - stable
+
+script: "npm run coverage"
+# Send coverage data to Coveralls
+after_script: "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE
new file mode 100644
index 0000000000..b2442a9e71
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Josh Glazebrook
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md
new file mode 100644
index 0000000000..178ce8827f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/README.md
@@ -0,0 +1,307 @@
+smart-buffer [![Build Status](https://travis-ci.org/JoshGlazebrook/smart-buffer.svg?branch=master)](https://travis-ci.org/JoshGlazebrook/smart-buffer) [![Coverage Status](https://coveralls.io/repos/github/JoshGlazebrook/smart-buffer/badge.svg?branch=master)](https://coveralls.io/github/JoshGlazebrook/smart-buffer?branch=master)
+=============
+
+smart-buffer is a light Buffer wrapper that takes away the need to keep track of what position to read and write data to and from the underlying Buffer. It also adds null terminating string operations and **grows** as you add more data.
+
+
+### What it's useful for:
+
+I created smart-buffer because I wanted to simplify the process of using Buffer for building and reading network packets to send over a socket. Rather than having to keep track of which position I need to write a UInt16 to after adding a string of variable length, I simply don't have to.
+
+Key Features:
+* Proxies all of the Buffer write and read functions.
+* Keeps track of read and write positions for you.
+* Grows the internal Buffer as you add data to it.
+* Useful string operations. (Null terminating strings)
+* Allows for inserting values at specific points in the internal Buffer.
+
+#### Note:
+smart-buffer can be used for writing to an underlying buffer as well as reading from it. It however does not function correctly if you're mixing both read and write operations with each other.
+
+## Installing:
+
+`npm install smart-buffer`
+
+## Using smart-buffer
+
+### Example
+
+Say you were building a packet that had to conform to the following protocol:
+
+`[PacketType:2][PacketLength:2][Data:XX]`
+
+To build this packet using the vanilla Buffer class, you would have to count up the length of the data payload beforehand. You would also need to keep track of the current "cursor" position in your Buffer so you write everything in the right places. With smart-buffer you don't have to do either of those things.
+
+```javascript
+function createLoginPacket(username, password, age, country) {
+ var packet = new SmartBuffer();
+ packet.writeUInt16LE(0x0060); // Login Packet Type/ID
+ packet.writeStringNT(username);
+ packet.writeStringNT(password);
+ packet.writeUInt8(age);
+ packet.writeStringNT(country);
+ packet.writeUInt16LE(packet.length - 2, 2);
+
+ return packet.toBuffer();
+}
+```
+With the above function, you now can do this:
+```javascript
+var login = createLoginPacket("Josh", "secret123", 22, "United States");
+
+// <Buffer 60 00 1e 00 4a 6f 73 68 00 73 65 63 72 65 74 31 32 33 00 16 55 6e 69 74 65 64 20 53 74 61 74 65 73 00>
+```
+Notice that the `[PacketLength:2]` part of the packet was inserted after we had added everything else, and as shown in the Buffer dump above, is in the correct location along with everything else.
+
+Reading back the packet we created above is just as easy:
+```javascript
+
+var reader = new SmartBuffer(login);
+
+var logininfo = {
+ packetType: reader.readUInt16LE(),
+ packetLength: reader.readUInt16LE(),
+ username: reader.readStringNT(),
+ password: reader.readStringNT(),
+ age: reader.readUInt8(),
+ country: reader.readStringNT()
+};
+
+/*
+{
+ packetType: 96, (0x0060)
+ packetLength: 30,
+ username: 'Josh',
+ password: 'secret123',
+ age: 22,
+ country: 'United States'
+};
+*/
+```
+
+# Api Reference:
+
+### Constructing a smart-buffer
+
+smart-buffer has a few different constructor signatures you can use. By default, utf8 encoding is used, and the internal Buffer length will be 4096. When reading from a Buffer, smart-buffer does NOT make a copy of the Buffer. It reads from the Buffer it was given.
+
+```javascript
+var SmartBuffer = require('smart-buffer');
+
+// Reading from an existing Buffer:
+var reader = new SmartBuffer(buffer);
+var reader = new SmartBuffer(buffer, 'ascii');
+
+// Writing to a new Buffer:
+var writer = new SmartBuffer(); // Defaults to utf8, 4096 length internal Buffer.
+var writer = new SmartBuffer(1024); // Defaults to utf8, 1024 length internal Buffer.
+var writer = new SmartBuffer('ascii'); // Sets to ascii encoding, 4096 length internal buffer.
+var writer = new SmartBuffer(1024, 'ascii'); // Sets to ascii encoding, 1024 length internal buffer.
+```
+
+## Reading Data
+
+smart-buffer supports all of the common read functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to start reading from. This is possible because as you read data out of a smart-buffer, it automatically progresses an internal read offset/position to know where to pick up from on the next read.
+
+## Reading Numeric Values
+
+When numeric values, you simply need to call the function you want, and the data is returned.
+
+Supported Operations:
+* readInt8
+* readInt16BE
+* readInt16LE
+* readInt32BE
+* readInt32LE
+* readUInt8
+* readUInt16BE
+* readUInt16LE
+* readUInt32BE
+* readUInt32LE
+* readFloatBE
+* readFloatLE
+* readDoubleBE
+* readDoubleLE
+
+```javascript
+var reader = new SmartBuffer(somebuffer);
+var num = reader.readInt8();
+```
+
+## Reading String Values
+
+When reading String values, you can either choose to read a null terminated string, or a string of a specified length.
+
+### SmartBuffer.readStringNT( [encoding] )
+> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns `String`
+
+> Note: When readStringNT is called and there is no null character found, smart-buffer will read to the end of the internal Buffer.
+
+### SmartBuffer.readString( [length], [encoding] )
+### SmartBuffer.readString( [length] )
+### SmartBuffer.readString( [encoding] )
+> `Number` **Length of the string to read**
+
+> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns `String`
+
+> Note: When readString is called without a specified length, smart-buffer will read to the end of the internal Buffer.
+
+
+
+## Reading Buffer Values
+
+### SmartBuffer.readBuffer( length )
+> `Number` **Length of data to read into a Buffer**
+
+returns `Buffer`
+
+> Note: This function uses `slice` to retrieve the Buffer.
+
+
+### SmartBuffer.readBufferNT()
+
+returns `Buffer`
+
+> Note: This reads the next sequence of bytes in the buffer until a null (0x00) value is found. (Null terminated buffer)
+> Note: This function uses `slice` to retrieve the Buffer.
+
+
+## Writing Data
+
+smart-buffer supports all of the common write functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to write to in your Buffer by default. You do however have the option of **inserting** a piece of data into your smart-buffer at a given location.
+
+
+## Writing Numeric Values
+
+
+For numeric values, you simply need to call the function you want, and the data is written at the end of the internal Buffer's current write position. You can specify a offset/position to **insert** the given value at, but keep in mind this does not override data at the given position. This feature also does not work properly when inserting a value beyond the current internal length of the smart-buffer (length being the .length property of the smart-buffer instance you're writing to)
+
+Supported Operations:
+* writeInt8
+* writeInt16BE
+* writeInt16LE
+* writeInt32BE
+* writeInt32LE
+* writeUInt8
+* writeUInt16BE
+* writeUInt16LE
+* writeUInt32BE
+* writeUInt32LE
+* writeFloatBE
+* writeFloatLE
+* writeDoubleBE
+* writeDoubleLE
+
+The following signature is the same for all the above functions:
+
+### SmartBuffer.writeInt8( value, [offset] )
+> `Number` **A valid Int8 number**
+
+> `Number` **The position to insert this value at**
+
+returns this
+
+> Note: All write operations return `this` to allow for chaining.
+
+## Writing String Values
+
+When reading String values, you can either choose to write a null terminated string, or a non null terminated string.
+
+### SmartBuffer.writeStringNT( value, [offset], [encoding] )
+### SmartBuffer.writeStringNT( value, [offset] )
+### SmartBuffer.writeStringNT( value, [encoding] )
+> `String` **String value to write**
+
+> `Number` **The position to insert this String at**
+
+> `String` **The String encoding to use.** - Defaults to the encoding set in the constructor, or utf8.
+
+returns this
+
+### SmartBuffer.writeString( value, [offset], [encoding] )
+### SmartBuffer.writeString( value, [offset] )
+### SmartBuffer.writeString( value, [encoding] )
+> `String` **String value to write**
+
+> `Number` **The position to insert this String at**
+
+> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns this
+
+
+## Writing Buffer Values
+
+### SmartBuffer.writeBuffer( value, [offset] )
+> `Buffer` **Buffer value to write**
+
+> `Number` **The position to insert this Buffer's content at**
+
+returns this
+
+### SmartBuffer.writeBufferNT( value, [offset] )
+> `Buffer` **Buffer value to write**
+
+> `Number` **The position to insert this Buffer's content at**
+
+returns this
+
+
+## Utility Functions
+
+### SmartBuffer.clear()
+Resets the SmartBuffer to its default state where it can be reused for reading or writing.
+
+### SmartBuffer.remaining()
+
+returns `Number` The amount of data left to read based on the current read Position.
+
+### SmartBuffer.skip( value )
+> `Number` **The amount of bytes to skip ahead**
+
+Skips the read position ahead by the given value.
+
+returns this
+
+### SmartBuffer.rewind( value )
+> `Number` **The amount of bytes to reward backwards**
+
+Rewinds the read position backwards by the given value.
+
+returns this
+
+### SmartBuffer.skipTo( position )
+> `Number` **The point to skip the read position to**
+
+Moves the read position to the given point.
+returns this
+
+### SmartBuffer.toBuffer()
+
+returns `Buffer` A Buffer containing the contents of the internal Buffer.
+
+> Note: This uses the slice function.
+
+### SmartBuffer.toString( [encoding] )
+> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8.
+
+returns `String` The internal Buffer in String representation.
+
+### SmartBuffer.destroy()
+Attempts to destroy the smart-buffer.
+
+returns this
+
+## Properties
+
+### SmartBuffer.length
+
+returns `Number` **The length of the data that is being tracked in the internal Buffer** - Does NOT return the absolute length of the internal Buffer being written to.
+
+## License
+
+This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js
new file mode 100644
index 0000000000..ef53b9fd4d
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js
@@ -0,0 +1,726 @@
+"use strict";
+// The default Buffer size if one is not provided.
+const DEFAULT_SMARTBUFFER_SIZE = 4096;
+// The default string encoding to use for reading/writing strings.
+const DEFAULT_SMARTBUFFER_ENCODING = 'utf8';
+class SmartBuffer {
+ /**
+ * Creates a new SmartBuffer instance.
+ *
+ * @param arg1 { Number | BufferEncoding | Buffer | SmartBufferOptions }
+ * @param arg2 { BufferEncoding }
+ */
+ constructor(arg1, arg2) {
+ this.length = 0;
+ this.encoding = DEFAULT_SMARTBUFFER_ENCODING;
+ this.writeOffset = 0;
+ this.readOffset = 0;
+ // Initial buffer size provided
+ if (typeof arg1 === 'number') {
+ if (Number.isFinite(arg1) && Number.isInteger(arg1) && arg1 > 0) {
+ this.buff = Buffer.allocUnsafe(arg1);
+ }
+ else {
+ throw new Error('Invalid size provided. Size must be a valid integer greater than zero.');
+ }
+ }
+ else if (typeof arg1 === 'string') {
+ if (Buffer.isEncoding(arg1)) {
+ this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
+ this.encoding = arg1;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ else if (arg1 instanceof Buffer) {
+ this.buff = arg1;
+ this.length = arg1.length;
+ }
+ else if (SmartBuffer.isSmartBufferOptions(arg1)) {
+ // Checks for encoding
+ if (arg1.encoding) {
+ if (Buffer.isEncoding(arg1.encoding)) {
+ this.encoding = arg1.encoding;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ // Checks for initial size length
+ if (arg1.size) {
+ if (Number.isFinite(arg1.size) && Number.isInteger(arg1.size) && arg1.size > 0) {
+ this.buff = Buffer.allocUnsafe(arg1.size);
+ }
+ else {
+ throw new Error('Invalid size provided. Size must be a valid integer greater than zero.');
+ }
+ }
+ else if (arg1.buff) {
+ if (arg1.buff instanceof Buffer) {
+ this.buff = arg1.buff;
+ this.length = arg1.buff.length;
+ }
+ else {
+ throw new Error('Invalid buffer provided in SmartBufferOptions.');
+ }
+ }
+ else {
+ this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
+ }
+ }
+ else if (typeof arg1 === 'object') {
+ throw new Error('Invalid object supplied to SmartBuffer constructor.');
+ }
+ else {
+ this.buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);
+ }
+ // Check for encoding (Buffer, Encoding) constructor.
+ if (typeof arg2 === 'string') {
+ if (Buffer.isEncoding(arg2)) {
+ this.encoding = arg2;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ }
+ /**
+ * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.
+ *
+ * @param size { Number } The size of the internal Buffer.
+ * @param encoding { String } The BufferEncoding to use for strings.
+ *
+ * @return { SmartBuffer }
+ */
+ static fromSize(size, encoding) {
+ return new this({
+ size: size,
+ encoding: encoding
+ });
+ }
+ /**
+ * Creates a new SmartBuffer instance with the provided Buffer and optional encoding.
+ *
+ * @param buffer { Buffer } The Buffer to use as the internal Buffer value.
+ * @param encoding { String } The BufferEncoding to use for strings.
+ *
+ * @return { SmartBuffer }
+ */
+ static fromBuffer(buff, encoding) {
+ return new this({
+ buff: buff,
+ encoding: encoding
+ });
+ }
+ /**
+ * Creates a new SmartBuffer instance with the provided SmartBufferOptions options.
+ *
+ * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance.
+ */
+ static fromOptions(options) {
+ return new this(options);
+ }
+ /**
+ * Ensures that the internal Buffer is large enough to write data.
+ *
+ * @param minLength { Number } The minimum length of the data that needs to be written.
+ * @param offset { Number } The offset of the data to be written.
+ */
+ ensureWriteable(minLength, offset) {
+ const offsetVal = typeof offset === 'number' ? offset : 0;
+ // Ensure there is enough internal Buffer capacity.
+ this.ensureCapacity(this.length + minLength + offsetVal);
+ // If offset is provided, copy data into appropriate location in regards to the offset.
+ if (typeof offset === 'number') {
+ this.buff.copy(this.buff, offsetVal + minLength, offsetVal, this.buff.length);
+ }
+ // Adjust instance length.
+ this.length = Math.max(this.length + minLength, offsetVal + minLength);
+ }
+ /**
+ * Ensures that the internal Buffer is large enough to write at least the given amount of data.
+ *
+ * @param minLength { Number } The minimum length of the data needs to be written.
+ */
+ ensureCapacity(minLength) {
+ const oldLength = this.buff.length;
+ if (minLength > oldLength) {
+ let data = this.buff;
+ let newLength = (oldLength * 3) / 2 + 1;
+ if (newLength < minLength) {
+ newLength = minLength;
+ }
+ this.buff = Buffer.allocUnsafe(newLength);
+ data.copy(this.buff, 0, 0, oldLength);
+ }
+ }
+ /**
+ * Reads a numeric number value using the provided function.
+ *
+ * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with.
+ * @param byteSize { Number } The number of bytes read.
+ *
+ * @param { Number }
+ */
+ readNumberValue(func, byteSize) {
+ // Call Buffer.readXXXX();
+ const value = func.call(this.buff, this.readOffset);
+ // Adjust internal read offset
+ this.readOffset += byteSize;
+ return value;
+ }
+ /**
+ * Writes a numeric number value using the provided function.
+ *
+ * @param func { Function(offset: number, offset?) => number} The function to write data on the internal Buffer with.
+ * @param byteSize { Number } The number of bytes written.
+ * @param value { Number } The number value to write.
+ * @param offset { Number } the offset to write the number at.
+ *
+ */
+ writeNumberValue(func, byteSize, value, offset) {
+ const offsetVal = typeof offset === 'number' ? offset : this.writeOffset;
+ // Ensure there is enough internal Buffer capacity. (raw offset is passed)
+ this.ensureWriteable(byteSize, offset);
+ // Call buffer.writeXXXX();
+ func.call(this.buff, value, offsetVal);
+ // Adjusts internal write offset
+ this.writeOffset += byteSize;
+ }
+ // Signed integers
+ /**
+ * Reads an Int8 value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt8() {
+ return this.readNumberValue(Buffer.prototype.readUInt8, 1);
+ }
+ /**
+ * Reads an Int16BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt16BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16BE, 2);
+ }
+ /**
+ * Reads an Int16LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt16LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16LE, 2);
+ }
+ /**
+ * Reads an Int32BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt32BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32BE, 4);
+ }
+ /**
+ * Reads an Int32LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readInt32LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32LE, 4);
+ }
+ /**
+ * Writes an Int8 value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt8(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int16BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt16BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int16LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt16LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int32BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt32BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);
+ return this;
+ }
+ /**
+ * Writes an Int32LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeInt32LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);
+ return this;
+ }
+ // Unsigned Integers
+ /**
+ * Reads an UInt8 value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt8() {
+ return this.readNumberValue(Buffer.prototype.readUInt8, 1);
+ }
+ /**
+ * Reads an UInt16BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt16BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16BE, 2);
+ }
+ /**
+ * Reads an UInt16LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt16LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt16LE, 2);
+ }
+ /**
+ * Reads an UInt32BE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt32BE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32BE, 4);
+ }
+ /**
+ * Reads an UInt32LE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readUInt32LE() {
+ return this.readNumberValue(Buffer.prototype.readUInt32LE, 4);
+ }
+ /**
+ * Writes an UInt8 value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt8(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt16BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt16BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt16LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt16LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt32BE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt32BE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);
+ return this;
+ }
+ /**
+ * Writes an UInt32LE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeUInt32LE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);
+ return this;
+ }
+ // Floating Point
+ /**
+ * Reads an FloatBE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readFloatBE() {
+ return this.readNumberValue(Buffer.prototype.readFloatBE, 4);
+ }
+ /**
+ * Reads an FloatLE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readFloatLE() {
+ return this.readNumberValue(Buffer.prototype.readFloatLE, 4);
+ }
+ /**
+ * Writes a FloatBE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeFloatBE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);
+ return this;
+ }
+ /**
+ * Writes a FloatLE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeFloatLE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);
+ return this;
+ }
+ // Double Floating Point
+ /**
+ * Reads an DoublEBE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readDoubleBE() {
+ return this.readNumberValue(Buffer.prototype.readDoubleBE, 8);
+ }
+ /**
+ * Reads an DoubleLE value from the current read position.
+ *
+ * @return { Number }
+ */
+ readDoubleLE() {
+ return this.readNumberValue(Buffer.prototype.readDoubleLE, 8);
+ }
+ /**
+ * Writes a DoubleBE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeDoubleBE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);
+ return this;
+ }
+ /**
+ * Writes a DoubleLE value to the current write position (or at optional offset).
+ *
+ * @param value { Number } The value to write.
+ * @param offset { Number } The offset to write the value at.
+ *
+ * @return this
+ */
+ writeDoubleLE(value, offset) {
+ this.writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);
+ return this;
+ }
+ // Strings
+ /**
+ * Reads a String from the current read position.
+ *
+ * @param length { Number } The number of bytes to read as a String.
+ * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
+ *
+ * @return { String }
+ */
+ readString(length, encoding) {
+ const lengthVal = Math.min(length, this.length - this.readOffset) || this.length - this.readOffset;
+ const value = this.buff.slice(this.readOffset, this.readOffset + lengthVal).toString(encoding || this.encoding);
+ this.readOffset += lengthVal;
+ return value;
+ }
+ /**
+ * Writes a String to the current write position.
+ *
+ * @param value { String } The String value to write.
+ * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
+ * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
+ */
+ writeString(value, arg2, encoding) {
+ let offsetVal = this.writeOffset;
+ let encodingVal = this.encoding;
+ // Check for offset
+ if (typeof arg2 === 'number') {
+ offsetVal = arg2;
+ }
+ else if (typeof arg2 === 'string') {
+ if (Buffer.isEncoding(arg2)) {
+ encodingVal = arg2;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ // Check for encoding (third param)
+ if (typeof encoding === 'string') {
+ if (Buffer.isEncoding(encoding)) {
+ encodingVal = encoding;
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ // Calculate bytelength of string.
+ const byteLength = Buffer.byteLength(value, encodingVal);
+ // Ensure there is enough internal Buffer capacity.
+ this.ensureWriteable(byteLength, offsetVal);
+ // Write value
+ this.buff.write(value, offsetVal, byteLength, encodingVal);
+ // Increment internal Buffer write offset;
+ this.writeOffset += byteLength;
+ return this;
+ }
+ /**
+ * Reads a null-terminated String from the current read position.
+ *
+ * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).
+ *
+ * @return { String }
+ */
+ readStringNT(encoding) {
+ // Set null character position to the end SmartBuffer instance.
+ let nullPos = this.length;
+ // Find next null character (if one is not found, default from above is used)
+ for (let i = this.readOffset; i < this.length; i++) {
+ if (this.buff[i] === 0x00) {
+ nullPos = i;
+ break;
+ }
+ }
+ // Read string value
+ const value = this.buff.slice(this.readOffset, nullPos);
+ // Increment internal Buffer read offset
+ this.readOffset = nullPos + 1;
+ return value.toString(encoding || this.encoding);
+ }
+ /**
+ * Writes a null-terminated String to the current write position.
+ *
+ * @param value { String } The String value to write.
+ * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.
+ * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).
+ */
+ writeStringNT(value, offset, encoding) {
+ // Write Values
+ this.writeString(value, offset, encoding);
+ this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this.writeOffset));
+ }
+ // Buffers
+ /**
+ * Reads a Buffer from the internal read position.
+ *
+ * @param length { Number } The length of data to read as a Buffer.
+ *
+ * @return { Buffer }
+ */
+ readBuffer(length) {
+ const lengthVal = typeof length === 'number' ? length : this.length;
+ const endPoint = Math.min(this.length, this.readOffset + lengthVal);
+ // Read buffer value
+ const value = this.buff.slice(this.readOffset, endPoint);
+ // Increment internal Buffer read offset
+ this.readOffset = endPoint;
+ return value;
+ }
+ /**
+ * Writes a Buffer to the current write position.
+ *
+ * @param value { Buffer } The Buffer to write.
+ * @param offset { Number } The offset to write the Buffer to.
+ */
+ writeBuffer(value, offset) {
+ const offsetVal = typeof offset === 'number' ? offset : this.writeOffset;
+ // Ensure there is enough internal Buffer capacity.
+ this.ensureWriteable(value.length, offsetVal);
+ // Write buffer value
+ value.copy(this.buff, offsetVal);
+ // Increment internal Buffer write offset
+ this.writeOffset += value.length;
+ return this;
+ }
+ /**
+ * Reads a null-terminated Buffer from the current read poisiton.
+ *
+ * @return { Buffer }
+ */
+ readBufferNT() {
+ // Set null character position to the end SmartBuffer instance.
+ let nullPos = this.length;
+ // Find next null character (if one is not found, default from above is used)
+ for (let i = this.readOffset; i < this.length; i++) {
+ if (this.buff[i] === 0x00) {
+ nullPos = i;
+ break;
+ }
+ }
+ // Read value
+ const value = this.buff.slice(this.readOffset, nullPos);
+ // Increment internal Buffer read offset
+ this.readOffset = nullPos + 1;
+ return value;
+ }
+ /**
+ * Writes a null-terminated Buffer to the current write position.
+ *
+ * @param value { Buffer } The Buffer to write.
+ * @param offset { Number } The offset to write the Buffer to.
+ */
+ writeBufferNT(value, offset) {
+ // Write Values
+ this.writeBuffer(value, offset);
+ this.writeUInt8(0, (typeof offset === 'number' ? offset + value.length : this.writeOffset));
+ return this;
+ }
+ /**
+ * Clears the SmartBuffer instance to its original empty state.
+ */
+ clear() {
+ this.writeOffset = 0;
+ this.readOffset = 0;
+ this.length = 0;
+ }
+ /**
+ * Gets the remaining data left to be read from the SmartBuffer instance.
+ *
+ * @return { Number }
+ */
+ remaining() {
+ return this.length - this.readOffset;
+ }
+ /**
+ * Moves the read offset forward.
+ *
+ * @param amount { Number } The amount to move the read offset forward by.
+ */
+ skip(amount) {
+ if (this.readOffset + amount > this.length) {
+ throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
+ }
+ this.readOffset += amount;
+ }
+ /**
+ * Moves the read offset backwards.
+ *
+ * @param amount { Number } The amount to move the read offset backwards by.
+ */
+ rewind(amount) {
+ if (this.readOffset - amount < 0) {
+ throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
+ }
+ this.readOffset -= amount;
+ }
+ /**
+ * Moves the read offset to a specific position.
+ *
+ * @param position { Number } The position to move the read offset to.
+ */
+ skipTo(position) {
+ this.moveTo(position);
+ }
+ /**
+ * Moves the read offset to a specific position.
+ *
+ * @param position { Number } The position to move the read offset to.
+ */
+ moveTo(position) {
+ if (position > this.length) {
+ throw new Error('Target position is beyond the bounds of the SmartBuffer size.');
+ }
+ this.readOffset = position;
+ }
+ /**
+ * Gets the value of the internal managed Buffer
+ *
+ * @param { Buffer }
+ */
+ toBuffer() {
+ return this.buff.slice(0, this.length);
+ }
+ /**
+ * Gets the String value of the internal managed Buffer
+ *
+ * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).
+ */
+ toString(encoding) {
+ const encodingVal = typeof encoding === 'string' ? encoding : this.encoding;
+ if (Buffer.isEncoding(encodingVal)) {
+ return this.buff.toString(encodingVal, 0, this.length);
+ }
+ else {
+ throw new Error('Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.');
+ }
+ }
+ /**
+ * Destroys the SmartBuffer instance.
+ */
+ destroy() {
+ this.clear();
+ }
+ /**
+ * Type checking function that determines if an object is a SmartBufferOptions object.
+ */
+ static isSmartBufferOptions(options) {
+ const castOptions = options;
+ return castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined);
+ }
+}
+module.exports = SmartBuffer;
+//# sourceMappingURL=smartbuffer.js.map \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map
new file mode 100644
index 0000000000..60af067a2c
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/build/smartbuffer.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"smartbuffer.js","sourceRoot":"","sources":["../src/smartbuffer.ts"],"names":[],"mappings":"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"} \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js
new file mode 100644
index 0000000000..ea69cfc09a
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/lib/smart-buffer.js
@@ -0,0 +1,371 @@
+var SmartBuffer = (function () {
+
+ /**
+ * Constructor for SmartBuffer.
+ * @param arg1 {Buffer || Number || String} Buffer to read from, or expected size to write to, or encoding to use.
+ * @param arg2 {String} Encoding to use for writing and reading strings. Defaults to utf8. If encoding is given in arg1, this is ignored.
+ * @constructor
+ *
+ * There are a few ways to construct a SmartBuffer:
+ *
+ * SmartBuffer() - Defaults to utf8, 4096 pre-set internal Buffer length.
+ * SmartBuffer(size) - Defaults to utf8, sets internal Buffer length to the size given.
+ * SmartBuffer(encoding) - Sets the given encoding, defaults to 4096 pre-set internal Buffer length.
+ * SmartBuffer(Buffer) - Defaults to utf8, sets the internal Buffer to the given buffer (same memory).
+ * SmartBuffer(Buffer, encoding) - Sets the given encoding, sets the internal Buffer to the given buffer (same memory).
+ *
+ */
+ function SmartBuffer(arg1, arg2) {
+ var type;
+ switch (type = typeof arg1) {
+ case 'number':
+ if (isFinite(arg1) && arg1 > 0) {
+ this.buff = new Buffer(Math.ceil(arg1));
+ this.length = 0;
+ } else {
+ throw new Error('When specifying a size, it must be a valid number above zero.');
+ }
+ break;
+
+ case 'string':
+ if (Buffer.isEncoding(arg1)) {
+ this.buff = new Buffer(4096);
+ this.length = 0;
+ this.encoding = arg1;
+ } else {
+ throw new Error('Invalid Encoding');
+ }
+ break;
+
+ case 'object':
+ if (Buffer.isBuffer(arg1)) {
+ this.buff = arg1;
+ this.length = arg1.length;
+ } else {
+ throw new TypeError('First argument must be a Buffer, Number representing the size, or a String representing the encoding.');
+ }
+ break;
+
+ default:
+ this.buff = new Buffer(4096);
+ this.length = 0;
+ break;
+ }
+
+ if (typeof this.encoding === 'undefined') {
+ if (typeof arg2 === 'string') {
+ if (Buffer.isEncoding(arg2)) {
+ this.encoding = arg2;
+ } else {
+ throw new Error('Invalid Encoding');
+ }
+ }
+ }
+
+ this._readOffset = 0;
+ this._writeOffset = 0;
+ }
+
+
+ SmartBuffer.prototype._ensureWritable = function (len, offset) {
+ this._ensureCapacity(this.length + len + (typeof offset === 'number' ? offset : 0));
+
+ if (typeof offset === 'number') {
+ this.buff.copy(this.buff, offset + len, offset, this.buff.length);
+ }
+ this.length = Math.max(this.length + len, (typeof offset === 'number' ? offset : 0) + len);
+ };
+
+ SmartBuffer.prototype._ensureCapacity = function (minlen) {
+ var oldlen = this.buff.length;
+
+ if (minlen > oldlen) {
+ var data = this.buff;
+ var newlen = (oldlen * 3) / 2 + 1;
+ if (newlen < minlen)
+ newlen = minlen;
+ this.buff = new Buffer(newlen);
+ data.copy(this.buff, 0, 0, oldlen);
+ }
+ };
+
+
+ var makeReader = function (func, size) {
+ return function () {
+ var ret = func.call(this.buff, this._readOffset);
+ this._readOffset += size;
+ return ret;
+ }
+ };
+
+ var makeWriter = function (func, size) {
+ return function (value, offset) {
+ this._ensureWritable(size, offset);
+ func.call(this.buff, value, typeof offset === 'number' ? offset : this._writeOffset);
+ this._writeOffset += size;
+ return this;
+ }
+ };
+
+
+ /*
+ Read Operations
+ */
+
+ SmartBuffer.prototype.readInt8 = makeReader(Buffer.prototype.readInt8, 1);
+ SmartBuffer.prototype.readInt16BE = makeReader(Buffer.prototype.readInt16BE, 2);
+ SmartBuffer.prototype.readInt16LE = makeReader(Buffer.prototype.readInt16LE, 2);
+ SmartBuffer.prototype.readInt32BE = makeReader(Buffer.prototype.readInt32BE, 4);
+ SmartBuffer.prototype.readInt32LE = makeReader(Buffer.prototype.readInt32LE, 4);
+
+ SmartBuffer.prototype.readUInt8 = makeReader(Buffer.prototype.readUInt8, 1);
+ SmartBuffer.prototype.readUInt16BE = makeReader(Buffer.prototype.readUInt16BE, 2);
+ SmartBuffer.prototype.readUInt16LE = makeReader(Buffer.prototype.readUInt16LE, 2);
+ SmartBuffer.prototype.readUInt32BE = makeReader(Buffer.prototype.readUInt32BE, 4);
+ SmartBuffer.prototype.readUInt32LE = makeReader(Buffer.prototype.readUInt32LE, 4);
+
+ SmartBuffer.prototype.readFloatBE = makeReader(Buffer.prototype.readFloatBE, 4);
+ SmartBuffer.prototype.readFloatLE = makeReader(Buffer.prototype.readFloatLE, 4);
+
+ SmartBuffer.prototype.readDoubleBE = makeReader(Buffer.prototype.readDoubleBE, 8);
+ SmartBuffer.prototype.readDoubleLE = makeReader(Buffer.prototype.readDoubleLE, 8);
+
+
+ /**
+ * Reads a string of the given length.
+ * @param length {Number} The length of the string to read. (Defaults to the length of the remaining data)
+ * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or utf8)
+ * @returns {string} The string.
+ */
+ SmartBuffer.prototype.readString = function (length, encoding) {
+ var len = Math.min(length, this.length - this._readOffset) || (this.length - this._readOffset);
+ var ret = this.buff.slice(this._readOffset, this._readOffset + len).toString(encoding || this.encoding);
+ this._readOffset += len;
+ return ret;
+ };
+
+ /**
+ * Reads a null terminated string from the underlying buffer.
+ * @param encoding {String} Encoding to use. Defaults to encoding set in constructor, or utf8.
+ * @returns {string}
+ */
+ SmartBuffer.prototype.readStringNT = function (encoding) {
+ var nullpos = this.length;
+ for (var i = this._readOffset; i < this.length; i++) {
+ if (this.buff[i] == 0x00) {
+ nullpos = i;
+ break;
+ }
+ }
+
+ var result = this.buff.slice(this._readOffset, nullpos);
+ this._readOffset = nullpos + 1;
+
+ return result.toString(encoding || this.encoding);
+ };
+
+
+ /**
+ * Reads a specified number of bytes.
+ * @param len {Number} Numbers of bytes to read. (Defaults to the remaining data length)
+ * @returns {Buffer} Buffer containing the read bytes.
+ */
+ SmartBuffer.prototype.readBuffer = function (len) {
+ var endpoint = Math.min(this.length, this._readOffset + (typeof len === 'number' ? len : this.length));
+ var ret = this.buff.slice(this._readOffset, endpoint);
+ this._readOffset = endpoint;
+ return ret;
+ };
+
+ /**
+ * Reads a null terminated sequence of bytes from the underlying buffer.
+ * @returns {Buffer} Buffer containing the read bytes.
+ */
+ SmartBuffer.prototype.readBufferNT = function () {
+ var nullpos = this.length;
+ for (var i = this._readOffset; i < this.length; i++) {
+ if (this.buff[i] == 0x00) {
+ nullpos = i;
+ break;
+ }
+ }
+
+ var ret = this.buff.slice(this._readOffset, nullpos);
+ this._readOffset = nullpos + 1;
+
+ return ret;
+ };
+
+
+ /*
+ Write Operations
+ */
+
+
+ SmartBuffer.prototype.writeInt8 = makeWriter(Buffer.prototype.writeInt8, 1);
+ SmartBuffer.prototype.writeInt16BE = makeWriter(Buffer.prototype.writeInt16BE, 2);
+ SmartBuffer.prototype.writeInt16LE = makeWriter(Buffer.prototype.writeInt16LE, 2);
+ SmartBuffer.prototype.writeInt32BE = makeWriter(Buffer.prototype.writeInt32BE, 4);
+ SmartBuffer.prototype.writeInt32LE = makeWriter(Buffer.prototype.writeInt32LE, 4);
+
+ SmartBuffer.prototype.writeUInt8 = makeWriter(Buffer.prototype.writeUInt8, 1);
+ SmartBuffer.prototype.writeUInt16BE = makeWriter(Buffer.prototype.writeUInt16BE, 2);
+ SmartBuffer.prototype.writeUInt16LE = makeWriter(Buffer.prototype.writeUInt16LE, 2);
+ SmartBuffer.prototype.writeUInt32BE = makeWriter(Buffer.prototype.writeUInt32BE, 4);
+ SmartBuffer.prototype.writeUInt32LE = makeWriter(Buffer.prototype.writeUInt32LE, 4);
+
+ SmartBuffer.prototype.writeFloatBE = makeWriter(Buffer.prototype.writeFloatBE, 4);
+ SmartBuffer.prototype.writeFloatLE = makeWriter(Buffer.prototype.writeFloatLE, 4);
+
+ SmartBuffer.prototype.writeDoubleBE = makeWriter(Buffer.prototype.writeDoubleBE, 8);
+ SmartBuffer.prototype.writeDoubleLE = makeWriter(Buffer.prototype.writeDoubleLE, 8);
+
+
+ /**
+ * Writes a string to the underlying buffer.
+ * @param value {String} The string to write.
+ * @param offset {Number} The offset to write the string to. (Encoding can also be set here in place of offset)
+ * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or to utf8)
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeString = function (value, offset, encoding) {
+ var len, _offset, type = typeof offset;
+
+ if (type === 'number') {
+ _offset = offset;
+ } else if (type === 'string') {
+ encoding = offset;
+ offset = this._writeOffset;
+ } else {
+ encoding = undefined;
+ offset = this._writeOffset;
+ }
+
+ len = Buffer.byteLength(value, encoding || this.encoding);
+ this._ensureWritable(len, _offset);
+
+ this.buff.write(value, offset, len, encoding || this.encoding);
+ this._writeOffset += len;
+ return this;
+ };
+
+ /**
+ * Writes a null terminated string to the underlying buffer.
+ * @param value {String} The string to write.
+ * @param offset {Number} The offset to write the string to. (Encoding can also be set here in place of offset)
+ * @param encoding {String} The encoding to use. (Defaults to encoding set in constructor, or to utf8)
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeStringNT = function (value, offset, encoding) {
+ this.writeString(value, offset, encoding);
+ this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this._writeOffset));
+ return this;
+ };
+
+ /**
+ * Writes a Buffer to the underlying buffer.
+ * @param value {Buffer} The buffer to write.
+ * @param offset {Number} The offset to write the Buffer to.
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeBuffer = function (value, offset) {
+ var len = value.length;
+ this._ensureWritable(len, offset);
+ value.copy(this.buff, typeof offset === 'number' ? offset : this._writeOffset);
+ this._writeOffset += len;
+ return this;
+ };
+
+ /**
+ * Writes a null terminated Buffer to the underlying buffer.
+ * @param value {Buffer} The buffer to write.
+ * @param offset {Number} The offset to write the Buffer to.
+ * @returns {*}
+ */
+ SmartBuffer.prototype.writeBufferNT = function (value, offset) {
+ this.writeBuffer(value, offset);
+ this.writeUInt8(0x00, (typeof offset === 'number' ? offset + value.length : this._writeOffset));
+
+ return this;
+ };
+
+
+ /**
+ * Resets the Endless Buffer.
+ */
+ SmartBuffer.prototype.clear = function () {
+ this._writeOffset = 0;
+ this._readOffset = 0;
+ this.length = 0;
+ };
+
+ /**
+ * Gets the remaining number of bytes to be read from the existing Buffer.
+ * @returns {number} The number of bytes remaining.
+ */
+ SmartBuffer.prototype.remaining = function () {
+ return this.length - this._readOffset;
+ };
+
+ /**
+ * Skips the read position forward by the amount of given.
+ * @param amount {Number} The amount of bytes to skip forward.
+ */
+ SmartBuffer.prototype.skip = function (amount) {
+ if (this._readOffset + amount > this.length)
+ throw new Error('Target position is beyond the bounds of the data.');
+
+ this._readOffset += amount;
+ };
+
+ /**
+ * Rewinds the read position backward by the amount given.
+ * @param amount {Number} The amount of bytes to reverse backward.
+ */
+ SmartBuffer.prototype.rewind = function (amount) {
+ if (this._readOffset - amount < 0)
+ throw new Error('Target position is beyond the bounds of the data.');
+
+ this._readOffset -= amount;
+ };
+
+ /**
+ * Skips the read position to the given position.
+ * @param position {Number} The position to skip to.
+ */
+ SmartBuffer.prototype.skipTo = function (position) {
+ if (position < 0 || position > this.length)
+ throw new Error('Target position is beyond the bounds of the data.');
+
+ this._readOffset = position;
+ };
+
+ /**
+ * Gets the underlying Buffer.
+ * @returns {*}
+ */
+ SmartBuffer.prototype.toBuffer = function () {
+ return this.buff.slice(0, this.length);
+ };
+
+ /**
+ * Gets a string representation of the underlying Buffer.
+ * @param encoding {String} Encoding to use. (Defaults to encoding set in constructor, or utf8.)
+ * @returns {*}
+ */
+ SmartBuffer.prototype.toString = function (encoding) {
+ return this.buff.toString(encoding || this.encoding, 0, this.length);
+ };
+
+ /**
+ * Destroys the underlying Buffer, and resets the SmartBuffer.
+ */
+ SmartBuffer.prototype.destroy = function () {
+ delete this.buff;
+ this.clear();
+ };
+
+ return SmartBuffer;
+})();
+
+module.exports = SmartBuffer; \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json
new file mode 100644
index 0000000000..dd6cec4698
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/package.json
@@ -0,0 +1,73 @@
+{
+ "_from": "smart-buffer@^1.0.13",
+ "_id": "smart-buffer@1.1.15",
+ "_integrity": "sha1-fxFLW2X6s+KjWqd1uxLw0cZJvxY=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/socks/smart-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "smart-buffer@^1.0.13",
+ "name": "smart-buffer",
+ "escapedName": "smart-buffer",
+ "rawSpec": "^1.0.13",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.13"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent/socks"
+ ],
+ "_resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-1.1.15.tgz",
+ "_shasum": "7f114b5b65fab3e2a35aa775bb12f0d1c649bf16",
+ "_shrinkwrap": null,
+ "_spec": "smart-buffer@^1.0.13",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks",
+ "author": {
+ "name": "Josh Glazebrook"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/JoshGlazebrook/smart-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "A smarter Buffer that keeps track of its own read and write positions while growing endlessly.",
+ "devDependencies": {
+ "chai": "^3.5.0",
+ "coveralls": "^2.11.15",
+ "istanbul": "^0.4.3",
+ "mocha": "^3.2.0",
+ "mocha-lcov-reporter": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.10.15",
+ "npm": ">= 1.3.5"
+ },
+ "homepage": "https://github.com/JoshGlazebrook/smart-buffer/",
+ "keywords": [
+ "buffer",
+ "smart",
+ "serialize",
+ "packet",
+ "network",
+ "cursor",
+ "simple"
+ ],
+ "license": "MIT",
+ "main": "lib/smart-buffer.js",
+ "name": "smart-buffer",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/JoshGlazebrook/smart-buffer.git"
+ },
+ "scripts": {
+ "coverage": "istanbul cover node_modules/mocha/bin/_mocha recursive test",
+ "fullcoverage": "istanbul -include-all-sources cover node_modules/mocha/bin/_mocha recursive test",
+ "test": "mocha test/smart-buffer.test.js"
+ },
+ "typings": "typings/index",
+ "version": "1.1.15"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js
new file mode 100644
index 0000000000..0897d54c2f
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/test/smart-buffer.test.js
@@ -0,0 +1,410 @@
+var SmartBuffer = require('../lib/smart-buffer.js');
+var assert = require('chai').assert;
+
+
+describe('Constructing a SmartBuffer', function () {
+ describe('Constructing with an existing Buffer', function () {
+ var buff = new Buffer([0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99]);
+ var reader = new SmartBuffer(buff);
+
+ it('should have the exact same internal Buffer when constructed with a Buffer', function () {
+ assert.strictEqual(reader.buff, buff);
+ });
+
+ it('should return a buffer with the same content', function () {
+ assert.deepEqual(reader.toBuffer(), buff);
+ });
+ });
+
+ describe('Constructing with an existing Buffer and setting the encoding', function () {
+ var buff = new Buffer([0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99]);
+ var reader = new SmartBuffer(buff, 'ascii');
+
+ it('should have the exact same internal Buffer', function () {
+ assert.strictEqual(reader.buff, buff);
+ });
+
+ it('should have the same encoding that was set', function () {
+ assert.strictEqual(reader.encoding, 'ascii');
+ });
+ });
+
+ describe('Constructing with a specified size', function () {
+ var size = 128;
+ var reader = new SmartBuffer(size);
+
+ it('should have an internal Buffer with the same length as the size defined in the constructor', function () {
+ assert.strictEqual(reader.buff.length, size);
+ });
+ });
+
+ describe('Constructing with a specified encoding', function () {
+ var encoding = 'utf8';
+
+ it('should have an internal encoding with the encoding given to the constructor (1st argument)', function () {
+ var reader = new SmartBuffer(encoding);
+ assert.strictEqual(reader.encoding, encoding);
+ });
+
+ it('should have an internal encoding with the encoding given to the constructor (2nd argument)', function () {
+ var reader = new SmartBuffer(1024, encoding);
+ assert.strictEqual(reader.encoding, encoding);
+ });
+
+ });
+
+ describe('Constructing with invalid parameters', function () {
+ it('should throw an exception when given an invalid number size', function () {
+ assert.throws(function () {
+ var reader = new SmartBuffer(-100);
+ }, Error);
+ });
+
+ it('should throw an exception when give a invalid encoding', function () {
+ assert.throws(function () {
+ var reader = new SmartBuffer('invalid');
+ }, Error);
+
+ assert.throws(function () {
+ var reader = new SmartBuffer(1024, 'invalid');
+ }, Error);
+ });
+
+ it('should throw and exception when given an object that is not a Buffer', function () {
+ assert.throws(function () {
+ var reader = new SmartBuffer(null);
+ }, TypeError);
+ });
+ });
+});
+
+
+describe('Reading/Writing To/From SmartBuffer', function () {
+ /**
+ * Technically, if one of these works, they all should. But they're all here anyways.
+ */
+
+ describe('Numeric Values', function () {
+ var reader = new SmartBuffer();
+ reader.writeInt8(0x44);
+ reader.writeUInt8(0xFF);
+ reader.writeInt16BE(0x6699);
+ reader.writeInt16LE(0x6699);
+ reader.writeUInt16BE(0xFFDD);
+ reader.writeUInt16LE(0xFFDD);
+ reader.writeInt32BE(0x77889900);
+ reader.writeInt32LE(0x77889900);
+ reader.writeUInt32BE(0xFFDDCCBB);
+ reader.writeUInt32LE(0xFFDDCCBB);
+ reader.writeFloatBE(1.234);
+ reader.writeFloatLE(1.234);
+ reader.writeDoubleBE(1.234567890);
+ reader.writeDoubleLE(1.234567890);
+
+ it('should equal the correct values that were written above', function () {
+ assert.strictEqual(reader.readInt8(), 0x44);
+ assert.strictEqual(reader.readUInt8(), 0xFF);
+ assert.strictEqual(reader.readInt16BE(), 0x6699);
+ assert.strictEqual(reader.readInt16LE(), 0x6699);
+ assert.strictEqual(reader.readUInt16BE(), 0xFFDD);
+ assert.strictEqual(reader.readUInt16LE(), 0xFFDD);
+ assert.strictEqual(reader.readInt32BE(), 0x77889900);
+ assert.strictEqual(reader.readInt32LE(), 0x77889900);
+ assert.strictEqual(reader.readUInt32BE(), 0xFFDDCCBB);
+ assert.strictEqual(reader.readUInt32LE(), 0xFFDDCCBB);
+ assert.closeTo(reader.readFloatBE(), 1.234, 0.001);
+ assert.closeTo(reader.readFloatLE(), 1.234, 0.001);
+ assert.closeTo(reader.readDoubleBE(), 1.234567890, 0.001);
+ assert.closeTo(reader.readDoubleLE(), 1.234567890, 0.001);
+ });
+
+ });
+
+ describe('Basic String Values', function () {
+ var reader = new SmartBuffer();
+ reader.writeStringNT('hello');
+ reader.writeString('world');
+ reader.writeStringNT('✎✏✎✏✎✏');
+
+ it('should equal the correct strings that were written above', function () {
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ assert.strictEqual(reader.readString(5), 'world');
+ assert.strictEqual(reader.readStringNT(), '✎✏✎✏✎✏');
+ });
+ });
+
+ describe('Mixed Encoding Strings', function () {
+ var reader = new SmartBuffer('ascii');
+ reader.writeStringNT('some ascii text');
+ reader.writeStringNT('ѕσмє υтƒ8 тєχт', 'utf8');
+
+ it('should equal the correct strings that were written above', function () {
+ assert.strictEqual(reader.readStringNT(), 'some ascii text');
+ assert.strictEqual(reader.readStringNT('utf8'), 'ѕσмє υтƒ8 тєχт');
+ });
+ });
+
+ describe('Null/non-null terminating strings', function () {
+ var reader = new SmartBuffer();
+ reader.writeString('hello\0test\0bleh');
+
+ it('should equal hello', function () {
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ });
+
+ it('should equal: test', function () {
+ assert.strictEqual(reader.readString(4), 'test');
+ });
+
+ it('should have a length of zero', function () {
+ assert.strictEqual(reader.readStringNT().length, 0);
+ });
+
+ it('should equal: bleh', function () {
+ assert.strictEqual(reader.readStringNT(), 'bleh');
+ });
+
+
+ });
+
+ describe('Reading string without specifying length', function () {
+ var str = 'hello123';
+ var writer = new SmartBuffer();
+ writer.writeString(str);
+
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ assert.strictEqual(reader.readString(), str);
+ });
+
+ describe('Write string as specific position', function () {
+ var str = 'hello123';
+ var writer = new SmartBuffer();
+ writer.writeString(str, 10);
+
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ reader.skipTo(10);
+ it('Should read the correct string from the original position it was written to.', function () {
+ assert.strictEqual(reader.readString(), str);
+ });
+
+
+ });
+
+ describe('Buffer Values', function () {
+ describe('Writing buffer to position 0', function () {
+ var buff = new SmartBuffer();
+ var frontBuff = new Buffer([1, 2, 3, 4, 5, 6]);
+ buff.writeStringNT('hello');
+ buff.writeBuffer(frontBuff, 0);
+
+ it('should write the buffer to the front of the smart buffer instance', function () {
+ var readBuff = buff.readBuffer(frontBuff.length);
+ assert.deepEqual(readBuff, frontBuff);
+ });
+ });
+
+ describe('Writing null terminated buffer to position 0', function () {
+ var buff = new SmartBuffer();
+ var frontBuff = new Buffer([1, 2, 3, 4, 5, 6]);
+ buff.writeStringNT('hello');
+ buff.writeBufferNT(frontBuff, 0);
+
+ console.log(buff);
+
+ it('should write the buffer to the front of the smart buffer instance', function () {
+ var readBuff = buff.readBufferNT();
+ console.log(readBuff);
+ assert.deepEqual(readBuff, frontBuff);
+ });
+ });
+
+ describe('Explicit lengths', function () {
+ var buff = new Buffer([0x01, 0x02, 0x04, 0x08, 0x16, 0x32, 0x64]);
+ var reader = new SmartBuffer();
+ reader.writeBuffer(buff);
+
+ it('should equal the buffer that was written above.', function () {
+ assert.deepEqual(reader.readBuffer(7), buff);
+ });
+ });
+
+ describe('Implicit lengths', function () {
+ var buff = new Buffer([0x01, 0x02, 0x04, 0x08, 0x16, 0x32, 0x64]);
+ var reader = new SmartBuffer();
+ reader.writeBuffer(buff);
+
+ it('should equal the buffer that was written above.', function () {
+ assert.deepEqual(reader.readBuffer(), buff);
+ });
+ });
+
+ describe('Null Terminated Buffer Reading', function () {
+ var buff = new SmartBuffer();
+ buff.writeBuffer(new Buffer([0x01, 0x02, 0x03, 0x04, 0x00, 0x01, 0x02, 0x03]));
+
+ var read1 = buff.readBufferNT();
+ var read2 = buff.readBufferNT();
+
+ it('Should return a length of 4 for the four bytes before the first null in the buffer.', function () {
+ assert.equal(read1.length, 4);
+ });
+
+ it('Should return a length of 3 for the three bytes after the first null in the buffer after reading to end.', function () {
+ assert.equal(read2.length, 3);
+ });
+ });
+
+ describe('Null Terminated Buffer Writing', function () {
+ var buff = new SmartBuffer();
+ buff.writeBufferNT(new Buffer([0x01, 0x02, 0x03, 0x04]));
+
+ var read1 = buff.readBufferNT();
+
+ it('Should read the correct null terminated buffer data.', function () {
+ assert.equal(read1.length, 4);
+ });
+
+ })
+
+ });
+
+ describe('Inserting values into specific positions', function () {
+ var reader = new SmartBuffer();
+
+ reader.writeUInt16LE(0x0060);
+ reader.writeStringNT('something');
+ reader.writeUInt32LE(8485934);
+ reader.writeUInt16LE(6699);
+ reader.writeStringNT('else');
+ reader.writeUInt16LE(reader.length - 2, 2);
+
+
+ it('should equal the size of the remaining data in the buffer', function () {
+ reader.readUInt16LE();
+ var size = reader.readUInt16LE();
+ assert.strictEqual(reader.remaining(), size);
+ });
+ });
+
+ describe('Adding more data to the buffer than the internal buffer currently allows.', function () {
+ it('Should automatically adjust internal buffer size when needed', function () {
+ var writer = new SmartBuffer();
+ var largeBuff = new Buffer(10000);
+
+ writer.writeBuffer(largeBuff);
+
+ assert.strictEqual(writer.length, largeBuff.length);
+ });
+ });
+
+});
+
+describe('Skipping around data', function () {
+ var writer = new SmartBuffer();
+ writer.writeStringNT('hello');
+ writer.writeUInt16LE(6699);
+ writer.writeStringNT('world!');
+
+ it('Should equal the UInt16 that was written above', function () {
+ var reader = new SmartBuffer(writer.toBuffer());
+ reader.skip(6);
+ assert.strictEqual(reader.readUInt16LE(), 6699);
+ reader.skipTo(0);
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ reader.rewind(6);
+ assert.strictEqual(reader.readStringNT(), 'hello');
+ });
+
+ it('Should throw an error when attempting to skip more bytes than actually exist.', function () {
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ assert.throws(function () {
+ reader.skip(10000);
+ });
+ });
+
+ it('Should throw an error when attempting to skip to a position that does not exist.', function () {
+ var reader = new SmartBuffer(writer.toBuffer());
+
+ assert.throws(function () {
+ reader.skipTo(10000);
+ });
+ });
+
+ it('Should throw an error when attempting to rewind past the start of the buffer.', function () {
+ var buff = new SmartBuffer();
+ assert.throws(function () {
+ buff.rewind(10000);
+ });
+ });
+});
+
+describe('Automatic internal buffer resizing', function () {
+ var writer;
+
+ it('Should not throw an error when adding data that is larger than current buffer size (internal resize algo fails)', function () {
+ var str = 'String larger than one byte';
+ writer = new SmartBuffer(1);
+ writer.writeString(str);
+
+ assert.strictEqual(writer.buff.length, str.length);
+
+ });
+
+ it('Should not throw an error when adding data that is larger than current buffer size (internal resize algo succeeds)', function () {
+ writer = new SmartBuffer(100);
+ var buff = new Buffer(105);
+
+ writer.writeBuffer(buff);
+
+ // Test internal array growth algo.
+ assert.strictEqual(writer.buff.length, (100 * 3 / 2 + 1));
+ });
+});
+
+describe('Clearing the buffer', function () {
+ var writer = new SmartBuffer();
+ writer.writeString('somedata');
+
+ it('Should contain some data.', function () {
+ assert.notStrictEqual(writer.length, 0);
+ });
+
+ it('Should contain zero data after being cleared.', function () {
+ writer.clear();
+ assert.strictEqual(writer.length, 0);
+ });
+});
+
+describe('Displaying the buffer as a string', function () {
+ var buff = new Buffer([1, 2, 3, 4]);
+ var sbuff = new SmartBuffer(buff);
+
+ var str = buff.toString();
+ var str64 = buff.toString('base64');
+
+ it('Should return a valid string representing the internal buffer', function () {
+ assert.strictEqual(str, sbuff.toString());
+ });
+
+ it('Should return a valid base64 string representing the internal buffer', function () {
+ assert.strictEqual(str64, sbuff.toString('base64'));
+ });
+});
+
+describe('Destroying the buffer', function () {
+ var writer = new SmartBuffer();
+ writer.writeString('hello123');
+
+ writer.destroy();
+
+ it('Should have a length of zero when buffer is destroyed', function () {
+ assert.strictEqual(0, writer.length);
+ });
+
+ it('Should have no internal buff property when buffer is destroyed', function () {
+ assert.notProperty(writer, 'buff');
+ });
+}); \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts
new file mode 100644
index 0000000000..b567f1e97c
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/node_modules/smart-buffer/typings/index.d.ts
@@ -0,0 +1,383 @@
+// Type definitions for smart-buffer
+// Project: https://github.com/JoshGlazebrook/smart-buffer
+// Definitions by: Josh Glazebrook <https://github.com/JoshGlazebrook>
+
+
+
+declare class SmartBuffer {
+ /**
+ * Creates a new SmartBuffer instance (defaults to utf8 encoding)
+ */
+ constructor();
+
+ /**
+ * Creates a new SmartBuffer instance
+ *
+ * @param arg1 { Number } The size the underlying buffer instance should be instantiated to (defaults to 4096)
+ * @param arg2 { String } The string encoding to use for reading/writing strings (defaults to utf8)
+ */
+ constructor(size: number, encoding?: string);
+
+ /**
+ * Creates a new SmartBuffer instance
+ *
+ * @param arg1 { String } The string encoding to use for reading/writing strings (defaults to utf8)
+ */
+ constructor(encoding?: string);
+
+ /**
+ * Creates a new SmartBuffer instance
+ *
+ * @param arg1 { Buffer } An existing buffer instance to copy to this smart buffer instance
+ * @param arg2 { String } The string encoding to use for reading/writing strings (defaults to utf8)
+ */
+ constructor(buffer: Buffer, encoding?: string)
+
+
+
+ // Signed number readers
+
+ /**
+ * Reads a 8-bit signed integer
+ */
+ readInt8(): number;
+
+ /**
+ * Reads a 16-bit signed integer (big endian)
+ */
+ readInt16BE(): number;
+
+ /**
+ * Reads a 16-bit signed integer (little endian)
+ */
+ readInt16LE(): number;
+
+ /**
+ * Reads a 32-bit signed integer (big endian)
+ */
+ readInt32BE(): number;
+
+ /**
+ * Reads a 32-bit signed integer (little endian)
+ */
+ readInt32LE(): number;
+
+ // Unsigned number readers
+
+ /**
+ * Reads a 8-bit unsigned integer
+ */
+ readUInt8(): number;
+
+ /**
+ * Reads a 16-bit unsigned integer (big endian)
+ */
+ readUInt16BE(): number;
+
+ /**
+ * Reads a 16-bit unsigned integer (little endian)
+ */
+ readUInt16LE(): number;
+
+ /**
+ * Reads a 32-bit unsigned integer (big endian)
+ */
+ readUInt32BE(): number;
+
+ /**
+ * Reads a 32-bit unsigned integer (little endian)
+ */
+ readUInt32LE(): number;
+
+ // Floating point readers
+
+ /**
+ * Reads a float (big endian)
+ */
+ readFloatBE(): number;
+
+ /**
+ * Reads a float (little endian)
+ */
+ readFloatLE(): number;
+
+ /**
+ * Reads a double (big endian)
+ */
+ readDoubleBE(): number;
+
+ /**
+ * Reads a double (little endian)
+ */
+ readDoubleLE(): number;
+
+ // String readers
+
+ /**
+ * Reads a string
+ *
+ * @param length { Number } The length of the string to read
+ * @param encoding { Number} The encoding to use (defaults to instance level encoding)
+ */
+ readString(length?: number, encoding?: string): string;
+
+ /**
+ * Reads a null terminated string
+ *
+ * @param encoding The encoding to use (defaults to instance level encoding)
+ */
+ readStringNT(encoding?: string): string;
+
+ // Buffer readers
+
+ /**
+ * Reads binary data into a Buffer
+ *
+ * @param len { Number } The amount of data to read
+ */
+ readBuffer(len?: number): Buffer;
+
+ /**
+ * Reads null terminated binary data into a Buffer
+ */
+ readBufferNT(): Buffer;
+
+
+ // Signed number writers
+
+ /**
+ * Writes a 8-bit signed integer value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt8(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit signed integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt16BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit signed integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt16LE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit signed integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt32BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit signed integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeInt32LE(value: number, offset?: number): this;
+
+ // Unsigned number writers
+
+ /**
+ * Writes a 8-bit unsigned integer value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt8(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit unsigned integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt16BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 16-bit unsigned integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt16LE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit unsigned integer (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt32BE(value: number, offset?: number): this;
+
+ /**
+ * Writes a 32-bit unsigned integer (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeUInt32LE(value: number, offset?: number): this;
+
+ // Floating point writers
+
+ /**
+ * Writes a float (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeFloatBE(value: number, offset?: number): this;
+
+ /**
+ * Writes a float (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeFloatLE(value: number, offset?: number): this;
+
+ /**
+ * Writes a double (big endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeDoubleBE(value: number, offset?: number): this;
+
+ /**
+ * Writes a double (little endian) value
+ *
+ * @param value { Number } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeDoubleLE(value: number, offset?: number): this;
+
+ // String writers
+
+ /**
+ * Writes a string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ /**
+ * Writes a string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ /**
+ * Writes a string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ * @param encoding { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ writeString(value: string, offset?: number | string, encoding?: string): this;
+
+ /**
+ * Writes a null terminated string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ /**
+ * Writes a null terminated string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ /**
+ * Writes a null terminated string
+ *
+ * @param value { String } The value to write to the buffer
+ * @param offset { Number } The offset position to write the value to
+ * @param encoding { String } The encoding to use when writing the string (defaults to instance level encoding)
+ */
+ writeStringNT(value: string, offset?: number | string, encoding?: string): this;
+
+ // Buffer writers
+
+ /**
+ * Writes a Buffer
+ *
+ * @param value { Buffer } The Buffer to write to the smart buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeBuffer(value: Buffer, offset?: number): this;
+
+ /**
+ * Writes a Buffer with null termination
+ *
+ * @param value { Buffer } The buffer to write to the smart buffer
+ * @param offset { Number } The offset position to write the value to
+ */
+ writeBufferNT(value: Buffer, offset?: number): this;
+
+
+ // Misc Functions
+
+ /**
+ * Clears the smart buffer
+ */
+ clear();
+
+ /**
+ * Gets the number of bytes that remain to be read
+ */
+ remaining(): number;
+
+ /**
+ * Increases the read offset position
+ *
+ * @param amount { Number } The amount to increase the read offset position by
+ */
+ skip(amount: number);
+
+ /**
+ * Changes the read offset position
+ *
+ * @param position { Number } The position to change the read offset to
+ */
+ skipTo(position: number);
+
+ /**
+ * Decreases the read offset position
+ *
+ * @param amount { Number } The amount to decrease the read offset position by
+ */
+ rewind(amount: number);
+
+ /**
+ * Gets the underlying Buffer instance
+ */
+ toBuffer(): Buffer;
+
+ /**
+ * Gets the string representation of the underlying Buffer
+ *
+ * @param encoding { String } The encoding to use (defaults to instance level encoding)
+ */
+ toString(encoding?: string): string;
+
+ /**
+ * Destroys the smart buffer instance
+ */
+ destroy();
+
+ /**
+ * Gets the current length of the smart buffer instance
+ */
+ length: number;
+}
+
+export = SmartBuffer; \ No newline at end of file
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json
new file mode 100644
index 0000000000..a4ccc56333
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/node_modules/socks/package.json
@@ -0,0 +1,72 @@
+{
+ "_from": "socks@~1.1.5",
+ "_id": "socks@1.1.10",
+ "_integrity": "sha1-W4t/x8jzQcU+0FbpKbe/Tei6e1o=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent/socks",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "socks@~1.1.5",
+ "name": "socks",
+ "escapedName": "socks",
+ "rawSpec": "~1.1.5",
+ "saveSpec": null,
+ "fetchSpec": "~1.1.5"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen/socks-proxy-agent"
+ ],
+ "_resolved": "https://registry.npmjs.org/socks/-/socks-1.1.10.tgz",
+ "_shasum": "5b8b7fc7c8f341c53ed056e929b7bf4de8ba7b5a",
+ "_shrinkwrap": null,
+ "_spec": "socks@~1.1.5",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent",
+ "author": {
+ "name": "Josh Glazebrook"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/JoshGlazebrook/socks/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Samuel Gordalina"
+ }
+ ],
+ "dependencies": {
+ "ip": "^1.1.4",
+ "smart-buffer": "^1.0.13"
+ },
+ "deprecated": false,
+ "description": "A SOCKS proxy client supporting SOCKS 4, 4a, and 5. (also supports BIND/Associate)",
+ "devDependencies": {},
+ "engines": {
+ "node": ">= 0.10.0",
+ "npm": ">= 1.3.5"
+ },
+ "homepage": "https://github.com/JoshGlazebrook/socks",
+ "keywords": [
+ "socks",
+ "proxy",
+ "client",
+ "tor",
+ "bind",
+ "associate",
+ "socks 4",
+ "socks 4a",
+ "socks 5",
+ "agent"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "socks",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/JoshGlazebrook/socks.git"
+ },
+ "version": "1.1.10"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json
new file mode 100644
index 0000000000..39234938d2
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/package.json
@@ -0,0 +1,69 @@
+{
+ "_from": "socks-proxy-agent@^2.0.0",
+ "_id": "socks-proxy-agent@2.0.0",
+ "_integrity": "sha1-xnSELXBBD7KK4ekuYTWpJ4VLwnU=",
+ "_location": "/pacote/make-fetch-happen/socks-proxy-agent",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "socks-proxy-agent@^2.0.0",
+ "name": "socks-proxy-agent",
+ "escapedName": "socks-proxy-agent",
+ "rawSpec": "^2.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.0.0"
+ },
+ "_requiredBy": [
+ "/pacote/make-fetch-happen"
+ ],
+ "_resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-2.0.0.tgz",
+ "_shasum": "c674842d70410fb28ae1e92e6135a927854bc275",
+ "_shrinkwrap": null,
+ "_spec": "socks-proxy-agent@^2.0.0",
+ "_where": "/Users/zkat/Documents/code/npm/node_modules/pacote/node_modules/make-fetch-happen",
+ "author": {
+ "name": "Nathan Rajlich",
+ "email": "nathan@tootallnate.net",
+ "url": "http://n8.io/"
+ },
+ "bin": null,
+ "bugs": {
+ "url": "https://github.com/TooTallNate/node-socks-proxy-agent/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "agent-base": "2",
+ "extend": "3",
+ "socks": "~1.1.5"
+ },
+ "deprecated": false,
+ "description": "A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS",
+ "devDependencies": {
+ "mocha": "2",
+ "socksv5": "0.0.6"
+ },
+ "homepage": "https://github.com/TooTallNate/node-socks-proxy-agent#readme",
+ "keywords": [
+ "socks",
+ "socks4",
+ "socks4a",
+ "proxy",
+ "http",
+ "https",
+ "agent"
+ ],
+ "license": "MIT",
+ "main": "socks-proxy-agent.js",
+ "name": "socks-proxy-agent",
+ "optionalDependencies": {},
+ "peerDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/node-socks-proxy-agent.git"
+ },
+ "scripts": {
+ "test": "mocha --reporter spec"
+ },
+ "version": "2.0.0"
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js
new file mode 100644
index 0000000000..46d30f7c68
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/socks-proxy-agent.js
@@ -0,0 +1,131 @@
+
+/**
+ * Module dependencies.
+ */
+
+var tls; // lazy-loaded...
+var url = require('url');
+var dns = require('dns');
+var extend = require('extend');
+var Agent = require('agent-base');
+var SocksClient = require('socks');
+var inherits = require('util').inherits;
+
+/**
+ * Module exports.
+ */
+
+module.exports = SocksProxyAgent;
+
+/**
+ * The `SocksProxyAgent`.
+ *
+ * @api public
+ */
+
+function SocksProxyAgent (opts) {
+ if (!(this instanceof SocksProxyAgent)) return new SocksProxyAgent(opts);
+ if ('string' == typeof opts) opts = url.parse(opts);
+ if (!opts) throw new Error('a SOCKS proxy server `host` and `port` must be specified!');
+ Agent.call(this, connect);
+
+ var proxy = extend({}, opts);
+
+ // prefer `hostname` over `host`, because of `url.parse()`
+ proxy.host = proxy.hostname || proxy.host;
+
+ // SOCKS doesn't *technically* have a default port, but this is
+ // the same default that `curl(1)` uses
+ proxy.port = +proxy.port || 1080;
+
+ if (proxy.host && proxy.path) {
+ // if both a `host` and `path` are specified then it's most likely the
+ // result of a `url.parse()` call... we need to remove the `path` portion so
+ // that `net.connect()` doesn't attempt to open that as a unix socket file.
+ delete proxy.path;
+ delete proxy.pathname;
+ }
+
+ // figure out if we want socks v4 or v5, based on the "protocol" used.
+ // Defaults to 5.
+ proxy.lookup = false;
+ switch (proxy.protocol) {
+ case 'socks4:':
+ proxy.lookup = true;
+ // pass through
+ case 'socks4a:':
+ proxy.version = 4;
+ break;
+ case 'socks5:':
+ proxy.lookup = true;
+ // pass through
+ case 'socks:': // no version specified, default to 5h
+ case 'socks5h:':
+ proxy.version = 5;
+ break;
+ default:
+ throw new TypeError('A "socks" protocol must be specified! Got: ' + proxy.protocol);
+ }
+
+ this.proxy = proxy;
+}
+inherits(SocksProxyAgent, Agent);
+
+/**
+ * Initiates a SOCKS connection to the specified SOCKS proxy server,
+ * which in turn connects to the specified remote host and port.
+ *
+ * @api public
+ */
+
+function connect (req, opts, fn) {
+
+ var proxy = this.proxy;
+
+ // called once the SOCKS proxy has connected to the specified remote endpoint
+ function onhostconnect (err, socket) {
+ if (err) return fn(err);
+ var s = socket;
+ if (opts.secureEndpoint) {
+ // since the proxy is connecting to an SSL server, we have
+ // to upgrade this socket connection to an SSL connection
+ if (!tls) tls = require('tls');
+ opts.socket = socket;
+ opts.servername = opts.host;
+ opts.host = null;
+ opts.hostname = null;
+ opts.port = null;
+ s = tls.connect(opts);
+ socket.resume();
+ }
+ fn(null, s);
+ }
+
+ // called for the `dns.lookup()` callback
+ function onlookup (err, ip, type) {
+ if (err) return fn(err);
+ options.target.host = ip;
+ SocksClient.createConnection(options, onhostconnect);
+ }
+
+ var options = {
+ proxy: {
+ ipaddress: proxy.host,
+ port: +proxy.port,
+ type: proxy.version
+ },
+ target: {
+ port: +opts.port
+ },
+ command: 'connect'
+ };
+
+ if (proxy.lookup) {
+ // client-side DNS resolution for "4" and "5" socks proxy versions
+ dns.lookup(opts.host, onlookup);
+ } else {
+ // proxy hostname DNS resolution for "4a" and "5h" socks proxy servers
+ options.target.host = opts.host;
+ SocksClient.createConnection(options, onhostconnect);
+ }
+}
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt
new file mode 100644
index 0000000000..9580116cd7
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.crt
@@ -0,0 +1,13 @@
+-----BEGIN CERTIFICATE-----
+MIICATCCAWoCCQCSMIVZI8DGgTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJB
+VTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0
+cyBQdHkgTHRkMB4XDTEzMDkwOTIyNTI1MVoXDTE0MDkwOTIyNTI1MVowRTELMAkG
+A1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNVBAoTGEludGVybmV0
+IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwQO2
+jlSxR12EvpF1hROxQAyQzDsxVv7AjDGhSVhizn7anxo5mCE9+5jHRJ6hgxF/3RJO
+q157J49W7hlgiJfN3X4Q3WCqkTnfj1wFr8aSjWUl6TWeLMrhKZgzGCmZH0GV4Kpu
+4jQ4lyjl/dIBw8HiJmKvaEagdUb5UJCKBDrDtvECAwEAATANBgkqhkiG9w0BAQUF
+AAOBgQB33WAM5Yr2jkaeRog6rEglMC8i+Jab12amnFFJEMoWnH6csXVGSXxCtlX8
+FWnCoNb/D71dnEusS4JxbYluRg2Xrdfb/pmHje9pE2TTprZRBFAIoh4CmDh129Ka
+HJwYPZi59XRnac8ghiF2l4d2yOQPznrJDekj6pfLVdIcVowSvg==
+-----END CERTIFICATE-----
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key
new file mode 100644
index 0000000000..25ade3cd16
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/server.key
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDBA7aOVLFHXYS+kXWFE7FADJDMOzFW/sCMMaFJWGLOftqfGjmY
+IT37mMdEnqGDEX/dEk6rXnsnj1buGWCIl83dfhDdYKqROd+PXAWvxpKNZSXpNZ4s
+yuEpmDMYKZkfQZXgqm7iNDiXKOX90gHDweImYq9oRqB1RvlQkIoEOsO28QIDAQAB
+AoGBAJGXlm34bp0Rat9A46/VMd/JWrPjdo1TrrRRf4LO3AE9aPWYl5cshA+zp6QY
+MGaonZWJiLP1mdo2YnFJzSpbr9mzEBEIjCsKdzeKbmnaEpCZY5YUj/ypVWYVJqXx
+jZ6/9VEIxCrB9WmXi9fs97IZtZJcHI4M+0FXakjF9AmxtVvRAkEA5MNakvgLPn5s
+GH5yuu0P0vSQ6d7EEgcM/89pjEpfKCvsYBh92VvmKspjBV71OuQ3Eh7/0GB/5UGC
+gaJwID7ibQJBANf+wBky99/+ffzwrUGavIbLO4NOwnbQsz7v49PwJHoGIhlfoLW7
+21JwDwWUteFyYOwzHxRdKedolT5Ul+PxNBUCQCXYU7Ggq2uJSqS6toxKD6Yco6St
+H87Dr9jaHWICI7/nlFFJe/hrhaZqmPsYfIVjn+C1lCiK7l2k+swrbVVIUfkCQQCA
+8MgWgvGsWw00+SxElK3kveAaI+M88JuAf85+z8XGvnCOuyKCOtHT5adiCoOFQTWQ
+63erPW5tgWZOnktKPMx9AkEAru3G68AjJN6e14aHkK9KFD0DV1RjrIe7E5iQq5Tn
+QXyiyiu624him6pov6UIGs5429z+gl3JjRM3A2rl//j//w==
+-----END RSA PRIVATE KEY-----
diff --git a/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js
new file mode 100644
index 0000000000..3ab7e55b22
--- /dev/null
+++ b/deps/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/socks-proxy-agent/test/test.js
@@ -0,0 +1,151 @@
+
+/**
+ * Module dependencies.
+ */
+
+var fs = require('fs');
+var url = require('url');
+var http = require('http');
+var https = require('https');
+var assert = require('assert');
+var socks = require('socksv5');
+var SocksProxyAgent = require('../');
+
+describe('SocksProxyAgent', function () {
+ var httpServer, httpPort;
+ var httpsServer, httpsPort;
+ var socksServer, socksPort;
+
+ before(function (done) {
+ // setup SOCKS proxy server
+ socksServer = socks.createServer(function(info, accept, deny) {
+ accept();
+ });
+ socksServer.listen(0, '127.0.0.1', function() {
+ socksPort = socksServer.address().port;
+ //console.log('SOCKS server listening on port %d', socksPort);
+ done();
+ });
+ socksServer.useAuth(socks.auth.None());
+ //socksServer.useAuth(socks.auth.UserPassword(function(user, password, cb) {
+ // cb(user === 'nodejs' && password === 'rules!');
+ //}));
+ });
+
+ before(function (done) {
+ // setup target HTTP server
+ httpServer = http.createServer();
+ httpServer.listen(function () {
+ httpPort = httpServer.address().port;
+ done();
+ });
+ });
+
+ before(function (done) {
+ // setup target SSL HTTPS server
+ var options = {
+ key: fs.readFileSync(__dirname + '/server.key'),
+ cert: fs.readFileSync(__dirname + '/server.crt')
+ };
+ httpsServer = https.createServer(options);
+ httpsServer.listen(function () {
+ httpsPort = httpsServer.address().port;
+ done();
+ });
+ });
+
+ after(function (done) {
+ socksServer.once('close', function () { done(); });
+ socksServer.close();
+ });
+
+ after(function (done) {
+ httpServer.once('close', function () { done(); });
+ httpServer.close();
+ });
+
+ after(function (done) {
+ httpsServer.once('close', function () { done(); });
+ httpsServer.close();
+ });
+
+ describe('constructor', function () {
+ it('should throw an Error if no "proxy" argument is given', function () {
+ assert.throws(function () {
+ new SocksProxyAgent();
+ });
+ });
+ it('should accept a "string" proxy argument', function () {
+ var agent = new SocksProxyAgent('socks://127.0.0.1:' + socksPort);
+ assert.equal('127.0.0.1', agent.proxy.host);
+ assert.equal(socksPort, agent.proxy.port);
+ });
+ it('should accept a `url.parse()` result object argument', function () {
+ var opts = url.parse('socks://127.0.0.1:' + socksPort);
+ var agent = new SocksProxyAgent(opts);
+ assert.equal('127.0.0.1', agent.proxy.host);
+ assert.equal(socksPort, agent.proxy.port);
+ });
+ });
+
+ describe('"http" module', function () {
+ it('should work against an HTTP endpoint', function (done) {
+ httpServer.once('request', function (req, res) {
+ assert.equal('/foo', req.url);
+ res.statusCode = 404;
+ res.end(JSON.stringify(req.headers));
+ });
+
+ var agent = new SocksProxyAgent('socks://127.0.0.1:' + socksPort);
+ var opts = url.parse('http://127.0.0.1:' + httpPort + '/foo');
+ opts.agent = agent;
+ opts.headers = { foo: 'bar' };
+ var req = http.get(opts, function (res) {
+ assert.equal(404, res.statusCode);
+ var data = '';
+ res.setEncoding('utf8');
+ res.on('data', function (b) {
+ data += b;
+ });
+ res.on('end', function () {
+ data = JSON.parse(data);
+ assert.equal('bar', data.foo);
+ done();
+ });
+ });
+ req.once('error', done);
+ });
+ });
+
+ describe('"https" module', function () {
+ it('should work against an HTTPS endpoint', function (done) {
+ httpsServer.once('request', function (req, res) {
+ assert.equal('/foo', req.url);
+ res.statusCode = 404;
+ res.end(JSON.stringify(req.headers));
+ });
+
+ var agent = new SocksProxyAgent('socks://127.0.0.1:' + socksPort);
+ var opts = url.parse('https://127.0.0.1:' + httpsPort + '/foo');
+ opts.agent = agent;
+ opts.rejectUnauthorized = false;
+
+ opts.headers = { foo: 'bar' };
+ var req = https.get(opts, function (res) {
+ assert.equal(404, res.statusCode);
+ var data = '';
+ res.setEncoding('utf8');
+ res.on('data', function (b) {
+ data += b;
+ });
+ res.on('end', function () {
+ data = JSON.parse(data);
+ assert.equal('bar', data.foo);
+ done();
+ });
+ });
+ req.once('error', done);
+ });
+ });
+
+});